@guiexpert/react-table 1.0.4 → 1.0.5
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 +655 -837
- 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 Y } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as q, useEffect as U } from "react";
|
|
3
|
+
import J 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, u = "") {
|
|
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 = u;
|
|
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 j {
|
|
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 X {
|
|
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 Q {
|
|
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,156 +105,154 @@ 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(c, "ge-table-col-div"), this.domService.addClass(c, `ge-table-col-div-${t.index}`), this.domService.setAttribute(c, "data-col-index", `${t.index}`), this.domService.setAttribute(c, "data-row-index", `${
|
|
146
|
+
addColumnDiv(e, t, s = -1, i = -1, o, r, n = "", l, a, d = void 0, u) {
|
|
147
|
+
const g = a == null ? void 0 : a.treeOptions, m = a == null ? void 0 : a.showCheckboxWihoutExtraColumn, c = this.domService.createElement("div");
|
|
148
|
+
this.domService.addClass(c, "ge-table-col-div"), this.domService.addClass(c, `ge-table-col-div-${t.index}`), this.domService.setAttribute(c, "data-col-index", `${t.index}`), this.domService.setAttribute(c, "data-row-index", `${s}`), this.domService.setAttribute(c, "data-area", `${o}`);
|
|
140
149
|
const b = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
141
|
-
if (o === "body" && r === "center" && this.domService.addClass(c, `ge-table-column-${b}`), this.domService.setStyle(c, "display", "clip"), this.domService.setStyle(c, "position", "absolute"), this.domService.setStyle(c, "left", `${t.left}px`), this.domService.setStyle(c, "top", `${t.top}px`), this.domService.setStyle(c, "width", `${t.width}px`), this.domService.setStyle(c, "height", `${t.height}px`), l && l !== "none" && (this.domService.addClass(c, "ge-table-col-tree"), this.addArrowDiv(c, l, g,
|
|
142
|
-
const h = l !== "none" &&
|
|
143
|
-
this.addLabelDiv(c, n, h,
|
|
150
|
+
if (o === "body" && r === "center" && this.domService.addClass(c, `ge-table-column-${b}`), this.domService.setStyle(c, "display", "clip"), this.domService.setStyle(c, "position", "absolute"), this.domService.setStyle(c, "left", `${t.left}px`), this.domService.setStyle(c, "top", `${t.top}px`), this.domService.setStyle(c, "width", `${t.width}px`), this.domService.setStyle(c, "height", `${t.height}px`), l && l !== "none" && (this.domService.addClass(c, "ge-table-col-tree"), this.addArrowDiv(c, l, g, s, i, o)), m && i === 0 && d && this.addCheckboxToDiv(c, d, o, s), n) {
|
|
151
|
+
const h = l !== "none" && i === 0;
|
|
152
|
+
this.addLabelDiv(c, n, h, s, i, o);
|
|
144
153
|
}
|
|
145
|
-
return
|
|
154
|
+
return u && this.addSortedIcon(c, u, a == null ? void 0 : a.sortedOptions, i), this.domService.appendChild(e, c), c;
|
|
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 X(), 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 j(), 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
|
-
for (const
|
|
191
|
-
this.domService.addClass(n,
|
|
199
|
+
for (const u of l.classes)
|
|
200
|
+
this.domService.addClass(n, u);
|
|
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
|
|
238
|
+
let s = t.cache[e];
|
|
239
|
+
return s ? (s.innerText = "", s) : (s = this.domService.createElement("div"), t.cache[e] = s, s);
|
|
231
240
|
}
|
|
232
241
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
this.data = e, this.expanded = t, this.children = i, this.parent = s, this.deep = o, this.checked = r, this.keep = n;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
const V = (p) => p === "header" ? "header" : p === "footer" ? "footer" : "body";
|
|
239
|
-
class q {
|
|
242
|
+
const H = (p) => p === "header" ? "header" : p === "footer" ? "footer" : "body";
|
|
243
|
+
class Z {
|
|
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 ee {
|
|
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))
|
|
@@ -260,33 +264,33 @@ class U {
|
|
|
260
264
|
this.tableScope.contextmenu(t);
|
|
261
265
|
}
|
|
262
266
|
onHostElementClicked(e) {
|
|
263
|
-
const t = new
|
|
267
|
+
const t = new Z(e.target, this.tableScope);
|
|
264
268
|
if (t.action === "toggleExpandCollapseAll")
|
|
265
269
|
this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
|
|
266
270
|
else if (t.inputType === "checkbox" && t.areaIdent)
|
|
267
271
|
this.tableScope.toggleRowCheckbox(t.rowIdx, t.colIdx, t.areaIdent), e.preventDefault(), e.stopPropagation();
|
|
268
|
-
else if (t.row
|
|
269
|
-
const
|
|
270
|
-
if (console.info(
|
|
272
|
+
else if (O(t.row) && t.areaModel) {
|
|
273
|
+
const s = t.colIdx === this.getArrowColumnIndex() && e.altKey, i = t.className.includes("ge-table-tree-arrow-div");
|
|
274
|
+
if (console.info(i, s), s || i) {
|
|
271
275
|
e.preventDefault(), e.stopPropagation();
|
|
272
276
|
const o = t.row;
|
|
273
277
|
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
278
|
}
|
|
275
279
|
}
|
|
276
280
|
if (t.areaIdent === "body" && this.tableScope.tableOptions.getFocusModel) {
|
|
277
|
-
const
|
|
278
|
-
|
|
281
|
+
const s = this.tableScope.tableOptions.getFocusModel();
|
|
282
|
+
s == null || s.clear(), s == null || s.setFocus(t.rowIdx, t.colIdx);
|
|
279
283
|
}
|
|
280
284
|
this.publishGeMouseEvent(e, 1);
|
|
281
285
|
}
|
|
282
286
|
onHostElementDblClicked(e) {
|
|
283
287
|
if (e.target instanceof HTMLElement) {
|
|
284
|
-
const t = e.target,
|
|
285
|
-
if (
|
|
288
|
+
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);
|
|
289
|
+
if (s && i === "header")
|
|
286
290
|
this.tableScope.tableModel.isSortable(r) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, o, r));
|
|
287
291
|
else if (t.getAttribute("data-row-index")) {
|
|
288
292
|
const l = n.getRowByIndex(o);
|
|
289
|
-
if (
|
|
293
|
+
if (s && i === "body" && n.isEditable(o, r) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, r)), O(l) && r === this.getArrowColumnIndex()) {
|
|
290
294
|
e.preventDefault(), e.stopPropagation();
|
|
291
295
|
const a = l;
|
|
292
296
|
a.expanded = !a.expanded, "recalcVisibleTreeRows" in n && n.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(a);
|
|
@@ -296,15 +300,15 @@ class U {
|
|
|
296
300
|
this.publishGeMouseEvent(e, 2);
|
|
297
301
|
}
|
|
298
302
|
publishGeMouseEvent(e, t) {
|
|
299
|
-
var
|
|
300
|
-
this.mouseEvent = e, this.geMouseEventOld = (
|
|
303
|
+
var s;
|
|
304
|
+
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
305
|
}
|
|
302
306
|
updateCollapsedExpandedState(e) {
|
|
303
|
-
var
|
|
304
|
-
const t = (
|
|
307
|
+
var s, i, o, r, n;
|
|
308
|
+
const t = (i = (s = this.tableScope.tableOptions) == null ? void 0 : s.autoRestoreOptions) == null ? void 0 : i.getRowId;
|
|
305
309
|
if (t) {
|
|
306
|
-
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,
|
|
307
|
-
a ? (r = this.tableScope.storeStateCollapsedExpandService) == null || r.collapsedStateIdsPush(
|
|
310
|
+
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, u = t(e.data);
|
|
311
|
+
a ? (r = this.tableScope.storeStateCollapsedExpandService) == null || r.collapsedStateIdsPush(u) : d && ((n = this.tableScope.storeStateCollapsedExpandService) == null || n.collapsedStateIdsRemove(u));
|
|
308
312
|
}
|
|
309
313
|
}
|
|
310
314
|
getArrowColumnIndex() {
|
|
@@ -340,12 +344,12 @@ class U {
|
|
|
340
344
|
}
|
|
341
345
|
}
|
|
342
346
|
}
|
|
343
|
-
class
|
|
347
|
+
class te {
|
|
344
348
|
constructor(e) {
|
|
345
349
|
this.tableScope = e;
|
|
346
350
|
}
|
|
347
|
-
updateCells(e) {
|
|
348
|
-
this.tableScope.updateCells(e);
|
|
351
|
+
updateCells(e, t = !1) {
|
|
352
|
+
this.tableScope.updateCells(e, t);
|
|
349
353
|
}
|
|
350
354
|
externalFilterChanged() {
|
|
351
355
|
this.tableScope.externalFilterChanged();
|
|
@@ -373,254 +377,30 @@ class J {
|
|
|
373
377
|
this.tableScope.repaint();
|
|
374
378
|
}
|
|
375
379
|
}
|
|
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 {
|
|
380
|
+
class P {
|
|
601
381
|
constructor(e) {
|
|
602
382
|
this.getStorageKeyFn = e;
|
|
603
383
|
}
|
|
604
384
|
autoConvertMapToObject(e) {
|
|
605
385
|
const t = {};
|
|
606
386
|
if (e instanceof Map) {
|
|
607
|
-
const
|
|
608
|
-
for (const
|
|
387
|
+
const s = e;
|
|
388
|
+
for (const i of [...s]) {
|
|
609
389
|
const [
|
|
610
390
|
o,
|
|
611
391
|
r
|
|
612
|
-
] =
|
|
392
|
+
] = i;
|
|
613
393
|
t[o] = r;
|
|
614
394
|
}
|
|
615
395
|
}
|
|
616
396
|
return t;
|
|
617
397
|
}
|
|
618
398
|
checkAndPersistItem(e, t) {
|
|
619
|
-
const
|
|
620
|
-
if (
|
|
621
|
-
const
|
|
622
|
-
if (
|
|
623
|
-
const o =
|
|
399
|
+
const s = this.getStorageKeyFn;
|
|
400
|
+
if (s) {
|
|
401
|
+
const i = s();
|
|
402
|
+
if (i) {
|
|
403
|
+
const o = i + e;
|
|
624
404
|
if ((t + "").includes("Map")) {
|
|
625
405
|
const r = this.autoConvertMapToObject(t);
|
|
626
406
|
this.persistItem(o, r);
|
|
@@ -672,7 +452,7 @@ class H {
|
|
|
672
452
|
// }
|
|
673
453
|
// }
|
|
674
454
|
}
|
|
675
|
-
class
|
|
455
|
+
class se extends P {
|
|
676
456
|
constructor(e) {
|
|
677
457
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
678
458
|
}
|
|
@@ -687,19 +467,19 @@ class te extends H {
|
|
|
687
467
|
if (e) {
|
|
688
468
|
const t = e();
|
|
689
469
|
if (t) {
|
|
690
|
-
const
|
|
691
|
-
let
|
|
692
|
-
this.scrollOffset =
|
|
470
|
+
const s = t + this.SCROLL_STATE;
|
|
471
|
+
let i = this.loadFromLocalStorage(s);
|
|
472
|
+
this.scrollOffset = i || [0, 0];
|
|
693
473
|
}
|
|
694
474
|
}
|
|
695
475
|
}
|
|
696
476
|
}
|
|
697
477
|
class ie {
|
|
698
|
-
constructor(e = "collapsed", t = [],
|
|
699
|
-
this.mode = e, this.rowIds = t, this.allCollapsed =
|
|
478
|
+
constructor(e = "collapsed", t = [], s = !1, i = !1) {
|
|
479
|
+
this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = i;
|
|
700
480
|
}
|
|
701
481
|
}
|
|
702
|
-
class
|
|
482
|
+
class oe extends P {
|
|
703
483
|
constructor(e) {
|
|
704
484
|
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new ie(), this.load();
|
|
705
485
|
}
|
|
@@ -724,8 +504,8 @@ class se extends H {
|
|
|
724
504
|
if (e) {
|
|
725
505
|
const t = e();
|
|
726
506
|
if (t) {
|
|
727
|
-
const
|
|
728
|
-
|
|
507
|
+
const s = t + this.COLLAPSED_EXPANDED_STATE, i = this.loadFromLocalStorage(s);
|
|
508
|
+
i && (this.collapsedExpandedState = i);
|
|
729
509
|
}
|
|
730
510
|
}
|
|
731
511
|
}
|
|
@@ -733,7 +513,7 @@ class se extends H {
|
|
|
733
513
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
734
514
|
}
|
|
735
515
|
}
|
|
736
|
-
class
|
|
516
|
+
class le extends P {
|
|
737
517
|
constructor(e) {
|
|
738
518
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
739
519
|
}
|
|
@@ -748,95 +528,95 @@ class oe extends H {
|
|
|
748
528
|
if (e) {
|
|
749
529
|
const t = e();
|
|
750
530
|
if (t) {
|
|
751
|
-
const
|
|
752
|
-
let
|
|
753
|
-
this.sortItems =
|
|
531
|
+
const s = t + this.SORTING_STATE;
|
|
532
|
+
let i = this.loadFromLocalStorage(s);
|
|
533
|
+
this.sortItems = i || [];
|
|
754
534
|
}
|
|
755
535
|
}
|
|
756
536
|
}
|
|
757
537
|
}
|
|
758
538
|
class T {
|
|
759
|
-
constructor(e = 0, t = 0,
|
|
760
|
-
this.left = e, this.width = t, this.height =
|
|
539
|
+
constructor(e = 0, t = 0, s = 0, i = 0, o) {
|
|
540
|
+
this.left = e, this.width = t, this.height = s, this.top = i, this.index = o;
|
|
761
541
|
}
|
|
762
542
|
}
|
|
763
543
|
class re {
|
|
764
|
-
constructor(e, t,
|
|
765
|
-
this.hostElement = e, this.tableModel = t, this.dom =
|
|
544
|
+
constructor(e, t, s, i) {
|
|
545
|
+
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
546
|
const o = this.hostElement;
|
|
767
547
|
o.innerText = "", this.dom.setAttribute(o, "tabindex", "0"), this.dom.setStyle(
|
|
768
548
|
this.dom.addClass("ge-table", o),
|
|
769
549
|
"position",
|
|
770
550
|
"relative"
|
|
771
|
-
), this.hoverRow =
|
|
772
|
-
|
|
773
|
-
), this.hoverColumn =
|
|
774
|
-
|
|
775
|
-
), this.areaHeaderWest =
|
|
776
|
-
|
|
777
|
-
|
|
551
|
+
), this.hoverRow = s.applyStylePosistionAbsolute(
|
|
552
|
+
s.createDivWithClass("ge-table-hover-row", o)
|
|
553
|
+
), this.hoverColumn = s.applyStylePosistionAbsolute(
|
|
554
|
+
s.createDivWithClass("ge-table-hover-column", o)
|
|
555
|
+
), this.areaHeaderWest = s.appendRelativeChildDiv(
|
|
556
|
+
s.applyStylePosistionAbsolute(
|
|
557
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-west", o, "header", "west")
|
|
778
558
|
)
|
|
779
|
-
), this.areaHeaderCenter =
|
|
780
|
-
|
|
781
|
-
|
|
559
|
+
), this.areaHeaderCenter = s.appendRelativeChildDiv(
|
|
560
|
+
s.applyStylePosistionAbsolute(
|
|
561
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-center", o, "header", "center")
|
|
782
562
|
)
|
|
783
|
-
), this.areaHeaderEast =
|
|
784
|
-
|
|
785
|
-
|
|
563
|
+
), this.areaHeaderEast = s.appendRelativeChildDiv(
|
|
564
|
+
s.applyStylePosistionAbsolute(
|
|
565
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-east", o, "body", "east")
|
|
786
566
|
)
|
|
787
|
-
), this.areaBodyWest =
|
|
788
|
-
|
|
789
|
-
|
|
567
|
+
), this.areaBodyWest = s.appendRelativeChildDiv(
|
|
568
|
+
s.applyStylePosistionAbsolute(
|
|
569
|
+
s.createAreaDivWithClass("ge-table-body ge-table-body-west", o, "body", "west")
|
|
790
570
|
)
|
|
791
|
-
), this.areaBodyEast =
|
|
792
|
-
|
|
793
|
-
|
|
571
|
+
), this.areaBodyEast = s.appendRelativeChildDiv(
|
|
572
|
+
s.applyStylePosistionAbsolute(
|
|
573
|
+
s.createAreaDivWithClass("ge-table-body ge-table-body-east", o, "body", "east")
|
|
794
574
|
)
|
|
795
|
-
), this.areaFooterWest =
|
|
796
|
-
|
|
797
|
-
|
|
575
|
+
), this.areaFooterWest = s.appendRelativeChildDiv(
|
|
576
|
+
s.applyStylePosistionAbsolute(
|
|
577
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-west", o, "footer", "west")
|
|
798
578
|
)
|
|
799
|
-
), this.areaFooterCenter =
|
|
800
|
-
|
|
801
|
-
|
|
579
|
+
), this.areaFooterCenter = s.appendRelativeChildDiv(
|
|
580
|
+
s.applyStylePosistionAbsolute(
|
|
581
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-center", o, "footer", "center")
|
|
802
582
|
)
|
|
803
|
-
), this.areaFooterEast =
|
|
804
|
-
|
|
805
|
-
|
|
583
|
+
), this.areaFooterEast = s.appendRelativeChildDiv(
|
|
584
|
+
s.applyStylePosistionAbsolute(
|
|
585
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-east", o, "footer", "east")
|
|
806
586
|
)
|
|
807
|
-
), this.scrollViewport =
|
|
587
|
+
), this.scrollViewport = s.applyStyleOverflowAuto(
|
|
808
588
|
this.tableOptions.overflowX ?? "auto",
|
|
809
589
|
this.tableOptions.overflowY ?? "auto",
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
590
|
+
s.applyStyleNoPadding(
|
|
591
|
+
s.applyStylePosistionAbsolute(
|
|
592
|
+
s.createAreaDivWithClass("ge-table-scroll-viewport", o, "body", "center")
|
|
813
593
|
)
|
|
814
594
|
)
|
|
815
|
-
), this.contentWrapperDiv =
|
|
816
|
-
|
|
817
|
-
|
|
595
|
+
), this.contentWrapperDiv = s.applyStyleNoPadding(
|
|
596
|
+
s.applyStylePosistionRelative(
|
|
597
|
+
s.createDivWithClass("ge-table-scroll-content-wrapper", this.scrollViewport)
|
|
818
598
|
)
|
|
819
|
-
), this.contentDiv =
|
|
820
|
-
|
|
821
|
-
|
|
599
|
+
), this.contentDiv = s.applyStyleNoPadding(
|
|
600
|
+
s.applyStylePosistionRelative(
|
|
601
|
+
s.createDivWithClass("ge-table-scroll-content", this.contentWrapperDiv)
|
|
822
602
|
)
|
|
823
|
-
), this.areaBodyCenter =
|
|
824
|
-
|
|
825
|
-
), this.borderHeaderBottom =
|
|
826
|
-
|
|
827
|
-
), this.borderFixedWest =
|
|
828
|
-
|
|
829
|
-
), this.borderFixedEast =
|
|
830
|
-
|
|
831
|
-
), this.borderFooterTop =
|
|
832
|
-
|
|
603
|
+
), this.areaBodyCenter = s.appendRelativeChildDiv(
|
|
604
|
+
s.createDivWithClass("ge-table-body-center", this.contentDiv)
|
|
605
|
+
), this.borderHeaderBottom = s.applyStylePosistionAbsolute(
|
|
606
|
+
s.createDivWithClass("ge-table-header-border", o)
|
|
607
|
+
), this.borderFixedWest = s.applyStylePosistionAbsolute(
|
|
608
|
+
s.createDivWithClass("ge-table-west-fixed-column-border", o)
|
|
609
|
+
), this.borderFixedEast = s.applyStylePosistionAbsolute(
|
|
610
|
+
s.createDivWithClass("ge-table-east-fixed-column-border", o)
|
|
611
|
+
), this.borderFooterTop = s.applyStylePosistionAbsolute(
|
|
612
|
+
s.createDivWithClass("ge-table-footer-border", o)
|
|
833
613
|
);
|
|
834
614
|
}
|
|
835
615
|
adjustContainersAndRows() {
|
|
836
|
-
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth,
|
|
616
|
+
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth, s = this.hostElement.clientHeight;
|
|
837
617
|
this.dom.applyStyle(this.scrollViewport, {
|
|
838
618
|
width: `${t - e.left}px`,
|
|
839
|
-
height: `${
|
|
619
|
+
height: `${s - e.top}px`,
|
|
840
620
|
top: `${e.top}px`,
|
|
841
621
|
left: `${e.left}px`
|
|
842
622
|
}), this.scrollTop = this.scrollViewport.scrollTop, this.dom.applyStyle(this.contentDiv, {
|
|
@@ -844,21 +624,21 @@ class re {
|
|
|
844
624
|
height: `${this.scrollViewport.clientHeight}px`,
|
|
845
625
|
top: `${this.scrollTop}px`,
|
|
846
626
|
left: `${this.scrollViewport.scrollLeft}px`
|
|
847
|
-
}), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height =
|
|
627
|
+
}), 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
628
|
this.dom.applyStyle(this.borderFixedWest, {
|
|
849
629
|
width: "1px",
|
|
850
630
|
height: `${this.areaBodyWestGeo.height}px`,
|
|
851
631
|
top: `${this.areaBodyWestGeo.top}px`,
|
|
852
632
|
left: `${this.areaBodyWestGeo.width}px`
|
|
853
633
|
})
|
|
854
|
-
) : this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height =
|
|
634
|
+
) : 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
635
|
this.dom.applyStyle(this.borderFixedEast, {
|
|
856
636
|
width: "1px",
|
|
857
637
|
height: `${this.areaBodyEastGeo.height}px`,
|
|
858
638
|
top: `${this.areaBodyEastGeo.top}px`,
|
|
859
639
|
left: `${this.areaBodyEastGeo.left}px`
|
|
860
640
|
})
|
|
861
|
-
) : this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = t - e.left - e.right, this.areaBodyCenterGeo.height =
|
|
641
|
+
) : 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
642
|
width: `${t - e.left - e.right}px`,
|
|
863
643
|
height: `${e.top}px`,
|
|
864
644
|
top: "0",
|
|
@@ -883,23 +663,23 @@ class re {
|
|
|
883
663
|
) : this.dom.applyDisplayNoneStyle(this.borderHeaderBottom), this.dom.applyStyle(this.areaFooterWest.parent, {
|
|
884
664
|
width: `${e.left}px`,
|
|
885
665
|
height: `${e.bottom}px`,
|
|
886
|
-
top: `${
|
|
666
|
+
top: `${s - e.bottom}px`,
|
|
887
667
|
left: "0"
|
|
888
668
|
}), this.dom.applyStyle(this.areaFooterCenter.parent, {
|
|
889
669
|
width: `${t - e.left - e.right}px`,
|
|
890
670
|
height: `${e.bottom}px`,
|
|
891
|
-
top: `${
|
|
671
|
+
top: `${s - e.bottom}px`,
|
|
892
672
|
left: `${e.left}px`
|
|
893
673
|
}), this.dom.applyStyle(this.areaFooterEast.parent, {
|
|
894
674
|
width: `${e.right}px`,
|
|
895
675
|
height: `${e.bottom}px`,
|
|
896
|
-
top: `${
|
|
676
|
+
top: `${s - e.bottom}px`,
|
|
897
677
|
left: `${t - e.right}px`
|
|
898
678
|
}), this.tableOptions.footerSeparatorBorderVisible && this.tableModel.isFooterVisibe() ? this.dom.applyDisplayBlockStyle(
|
|
899
679
|
this.dom.applyStyle(this.borderFooterTop, {
|
|
900
680
|
width: `${t}px`,
|
|
901
681
|
height: "1px",
|
|
902
|
-
top: `${
|
|
682
|
+
top: `${s - e.bottom}px`,
|
|
903
683
|
left: "0px"
|
|
904
684
|
})
|
|
905
685
|
) : this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.adjustAfterScrolling();
|
|
@@ -912,8 +692,8 @@ class re {
|
|
|
912
692
|
}
|
|
913
693
|
}
|
|
914
694
|
class A {
|
|
915
|
-
constructor(e, t,
|
|
916
|
-
this.r1 = e, this.c1 = t, this.r2 =
|
|
695
|
+
constructor(e, t, s, i, o = !1) {
|
|
696
|
+
this.r1 = e, this.c1 = t, this.r2 = s, this.c2 = i, this.gammaRange = o;
|
|
917
697
|
}
|
|
918
698
|
static create(e) {
|
|
919
699
|
return e.gammaRange === void 0 && (e.gammaRange = !1), new A(
|
|
@@ -937,7 +717,7 @@ class A {
|
|
|
937
717
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
938
718
|
}
|
|
939
719
|
}
|
|
940
|
-
class
|
|
720
|
+
class ne {
|
|
941
721
|
constructor(e, t) {
|
|
942
722
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
943
723
|
}
|
|
@@ -946,14 +726,14 @@ class le {
|
|
|
946
726
|
return;
|
|
947
727
|
this.colAndRowspanRanges = [];
|
|
948
728
|
const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
|
|
949
|
-
for (let
|
|
950
|
-
for (let
|
|
951
|
-
let o = this.areaModel.getColspanAt(
|
|
729
|
+
for (let s = 0; s < e; s++)
|
|
730
|
+
for (let i = 0; i < t; i++) {
|
|
731
|
+
let o = this.areaModel.getColspanAt(s, i), r = this.areaModel.getRowspanAt(s, i);
|
|
952
732
|
if (o > 1 || r > 1) {
|
|
953
733
|
o === 0 && (o = 1), r === 0 && (r = 1);
|
|
954
734
|
const n = this.areaModel.hasOwnProperty("gammaCells");
|
|
955
735
|
this.colAndRowspanRanges.push(
|
|
956
|
-
new A(i, s
|
|
736
|
+
new A(s, i, s + r - 1, i + o - 1, n)
|
|
957
737
|
);
|
|
958
738
|
}
|
|
959
739
|
}
|
|
@@ -963,29 +743,29 @@ class le {
|
|
|
963
743
|
}
|
|
964
744
|
isInRange(e, t) {
|
|
965
745
|
if (this.colAndRowspanRanges) {
|
|
966
|
-
for (const
|
|
967
|
-
if (
|
|
746
|
+
for (const s of this.colAndRowspanRanges)
|
|
747
|
+
if (s.isInRange(e, t))
|
|
968
748
|
return !0;
|
|
969
749
|
}
|
|
970
750
|
return !1;
|
|
971
751
|
}
|
|
972
752
|
}
|
|
973
|
-
class
|
|
974
|
-
constructor(e, t,
|
|
975
|
-
this.header = e, this.body = t, this.footer =
|
|
753
|
+
class ae {
|
|
754
|
+
constructor(e, t, s) {
|
|
755
|
+
this.header = e, this.body = t, this.footer = s;
|
|
976
756
|
}
|
|
977
757
|
}
|
|
978
|
-
class
|
|
979
|
-
constructor(e, t,
|
|
758
|
+
class de extends re {
|
|
759
|
+
constructor(e, t, s, i) {
|
|
980
760
|
var r, n;
|
|
981
|
-
super(e, t,
|
|
761
|
+
super(e, t, s, i), this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
982
762
|
header: [],
|
|
983
763
|
body: [],
|
|
984
764
|
footer: []
|
|
985
|
-
}, this.tree = !1, this.colAndRowspanModels = new
|
|
765
|
+
}, this.tree = !1, this.colAndRowspanModels = new ae(), 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
766
|
(l) => {
|
|
987
767
|
var a;
|
|
988
|
-
this.colAndRowspanModels[l] = new
|
|
768
|
+
this.colAndRowspanModels[l] = new ne(t, t.getAreaModel(l)), (a = this.colAndRowspanModels[l]) == null || a.init();
|
|
989
769
|
}
|
|
990
770
|
);
|
|
991
771
|
}
|
|
@@ -1002,10 +782,10 @@ class ae extends re {
|
|
|
1002
782
|
}
|
|
1003
783
|
}
|
|
1004
784
|
initRenderEditor(e, t) {
|
|
1005
|
-
var
|
|
1006
|
-
let
|
|
1007
|
-
if (
|
|
1008
|
-
if (this.editorRenderer =
|
|
785
|
+
var i;
|
|
786
|
+
let s = (i = this.tableModel.getColumnDef(t)) == null ? void 0 : i.getEditRenderer;
|
|
787
|
+
if (s || (s = this.tableOptions.getEditRenderer), s)
|
|
788
|
+
if (this.editorRenderer = s(e, t), this.editorRenderer) {
|
|
1009
789
|
this.editorRendererRow = e, this.editorRendererColumn = t, this.editing = !0, this.repaint();
|
|
1010
790
|
const o = document.querySelector("input.ge-table-cell-editor-input");
|
|
1011
791
|
o && o.focus();
|
|
@@ -1041,16 +821,18 @@ class ae extends re {
|
|
|
1041
821
|
var e, t;
|
|
1042
822
|
this.storeScrollPosStateService && ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreScrollPosition) && this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
|
|
1043
823
|
}
|
|
1044
|
-
updateCells(e) {
|
|
824
|
+
updateCells(e, t = !1) {
|
|
1045
825
|
e.forEach(
|
|
1046
|
-
(
|
|
1047
|
-
|
|
826
|
+
(s) => {
|
|
827
|
+
this.tableModel.getAreaModel(s.area).setValue(s.rowIndex, s.columnIndex, s.value), t || this.rerenderCellContent(s);
|
|
828
|
+
}
|
|
829
|
+
), t && this.repaint();
|
|
1048
830
|
}
|
|
1049
831
|
getAreaAndSideIdentByAttr(e) {
|
|
1050
832
|
if (e) {
|
|
1051
|
-
const t = this.getStringByAttr(e, "data-area"),
|
|
1052
|
-
if (
|
|
1053
|
-
return [t,
|
|
833
|
+
const t = this.getStringByAttr(e, "data-area"), s = this.getStringByAttr(e, "data-side");
|
|
834
|
+
if (s && t)
|
|
835
|
+
return [t, s];
|
|
1054
836
|
}
|
|
1055
837
|
return [void 0, void 0];
|
|
1056
838
|
}
|
|
@@ -1084,105 +866,105 @@ class ae extends re {
|
|
|
1084
866
|
this.dom.setStyle(this.contentDiv, "top", `${this.scrollTop}px`), this.dom.setStyle(this.contentDiv, "left", `${this.scrollViewport.scrollLeft}px`), this.adjustArea("body", t);
|
|
1085
867
|
}
|
|
1086
868
|
getNumberByAttr(e, t) {
|
|
1087
|
-
var
|
|
869
|
+
var s;
|
|
1088
870
|
if (e) {
|
|
1089
|
-
const
|
|
1090
|
-
if (
|
|
1091
|
-
return Number(
|
|
871
|
+
const i = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
|
|
872
|
+
if (i)
|
|
873
|
+
return Number(i);
|
|
1092
874
|
}
|
|
1093
875
|
return -1;
|
|
1094
876
|
}
|
|
1095
877
|
getStringByAttr(e, t) {
|
|
1096
|
-
var
|
|
878
|
+
var s;
|
|
1097
879
|
if (e) {
|
|
1098
|
-
const
|
|
1099
|
-
if (
|
|
1100
|
-
return
|
|
880
|
+
const i = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
|
|
881
|
+
if (i)
|
|
882
|
+
return i;
|
|
1101
883
|
}
|
|
1102
884
|
return "";
|
|
1103
885
|
}
|
|
1104
886
|
adjustArea(e, t = 0) {
|
|
1105
887
|
var h;
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1108
|
-
const n = 0, l = this.areaBodyCenterGeo.width, a = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e),
|
|
888
|
+
const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"), r = i.child.clientHeight;
|
|
889
|
+
s.child.innerText = "", i.child.innerText = "", o.child.innerText = "";
|
|
890
|
+
const n = 0, l = this.areaBodyCenterGeo.width, a = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), u = d.getRowCount();
|
|
1109
891
|
for (; this.cleanupFunctions[e].length; ) {
|
|
1110
|
-
const
|
|
1111
|
-
|
|
892
|
+
const S = this.cleanupFunctions[e].shift();
|
|
893
|
+
S && S();
|
|
1112
894
|
}
|
|
1113
895
|
let g = t;
|
|
1114
|
-
const
|
|
1115
|
-
for (let
|
|
1116
|
-
const
|
|
1117
|
-
if (
|
|
1118
|
-
this.firstVisibleRowIndex =
|
|
1119
|
-
let
|
|
896
|
+
const m = this.tableModel.getColumnCount(), c = this.tableModel.getFixedRightColumnCount(), b = this.tableModel.getFixedLeftColumnCount();
|
|
897
|
+
for (let S = 0; S < u; S++) {
|
|
898
|
+
const C = g, x = S === u - 1, w = this.tableModel.getRowHeight(e, S);
|
|
899
|
+
if (C + w > 0) {
|
|
900
|
+
this.firstVisibleRowIndex = S;
|
|
901
|
+
let v = { left: n, width: l, height: w, top: C, index: S }, f = this.dom.addRowDiv(i, v, S, e, "center");
|
|
1120
902
|
const M = b;
|
|
1121
903
|
if (this.adjustColumnsToRowParent({
|
|
1122
904
|
areaIdent: e,
|
|
1123
905
|
sideIdent: "center",
|
|
1124
906
|
areaModel: d,
|
|
1125
|
-
geo:
|
|
1126
|
-
parent:
|
|
1127
|
-
rowIndex:
|
|
907
|
+
geo: v,
|
|
908
|
+
parent: f,
|
|
909
|
+
rowIndex: S,
|
|
1128
910
|
columnIndexStart: M,
|
|
1129
|
-
columnIndexEnd:
|
|
911
|
+
columnIndexEnd: m - c - 1,
|
|
1130
912
|
verticalFixed: !1,
|
|
1131
913
|
lastRowOfModel: x
|
|
1132
|
-
}), a.left > 0 && (
|
|
914
|
+
}), a.left > 0 && (v = { left: n, width: this.areaBodyWestGeo.width, height: w, top: C, index: S }, f = this.dom.addRowDiv(s, v, S, e, "west"), this.adjustColumnsToRowParent({
|
|
1133
915
|
areaIdent: e,
|
|
1134
916
|
sideIdent: "west",
|
|
1135
917
|
areaModel: d,
|
|
1136
|
-
geo:
|
|
1137
|
-
parent:
|
|
1138
|
-
rowIndex:
|
|
918
|
+
geo: v,
|
|
919
|
+
parent: f,
|
|
920
|
+
rowIndex: S,
|
|
1139
921
|
columnIndexStart: 0,
|
|
1140
922
|
columnIndexEnd: M - 1,
|
|
1141
923
|
verticalFixed: !0,
|
|
1142
924
|
lastRowOfModel: x
|
|
1143
|
-
})), a.right > 0 && (
|
|
925
|
+
})), a.right > 0 && (v = { left: n, width: this.areaBodyEastGeo.width, height: w, top: C, index: S }, f = this.dom.addRowDiv(o, v, S, e, "east"), this.adjustColumnsToRowParent({
|
|
1144
926
|
areaIdent: e,
|
|
1145
927
|
sideIdent: "east",
|
|
1146
928
|
areaModel: d,
|
|
1147
|
-
geo:
|
|
1148
|
-
parent:
|
|
1149
|
-
rowIndex:
|
|
1150
|
-
columnIndexStart:
|
|
1151
|
-
columnIndexEnd:
|
|
929
|
+
geo: v,
|
|
930
|
+
parent: f,
|
|
931
|
+
rowIndex: S,
|
|
932
|
+
columnIndexStart: m - c,
|
|
933
|
+
columnIndexEnd: m - 1,
|
|
1152
934
|
verticalFixed: !0,
|
|
1153
935
|
lastRowOfModel: x
|
|
1154
|
-
})), e === "header" && this.tree &&
|
|
936
|
+
})), e === "header" && this.tree && S === u - 1) {
|
|
1155
937
|
const E = this.dom.applyStyle(
|
|
1156
938
|
this.dom.setAttribute(
|
|
1157
|
-
this.dom.addDiv(
|
|
939
|
+
this.dom.addDiv(f, new T(16, 20, 20, 8)),
|
|
1158
940
|
"data-ge-action",
|
|
1159
941
|
"toggleExpandCollapseAll"
|
|
1160
942
|
),
|
|
1161
943
|
{ cursor: "pointer" }
|
|
1162
944
|
), R = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1163
945
|
if (R) {
|
|
1164
|
-
const
|
|
1165
|
-
this.dom.domService.appendChild(E,
|
|
946
|
+
const I = this.dom.domService.createText(R.content);
|
|
947
|
+
this.dom.domService.appendChild(E, I), R.style && this.dom.applyStyleString(E, R.style);
|
|
1166
948
|
}
|
|
1167
949
|
}
|
|
1168
950
|
}
|
|
1169
|
-
if (g = g +
|
|
951
|
+
if (g = g + w, g > r)
|
|
1170
952
|
break;
|
|
1171
953
|
}
|
|
1172
954
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1173
|
-
const
|
|
1174
|
-
if (
|
|
1175
|
-
for (const
|
|
1176
|
-
let x = 0,
|
|
1177
|
-
if (
|
|
1178
|
-
|
|
1179
|
-
else if (c > 0 &&
|
|
1180
|
-
|
|
955
|
+
const S = ((h = this.colAndRowspanModels[e]) == null ? void 0 : h.getRanges()) ?? [];
|
|
956
|
+
if (S.length)
|
|
957
|
+
for (const C of S) {
|
|
958
|
+
let x = 0, w = i.child, v = "center";
|
|
959
|
+
if (C.c1 < b)
|
|
960
|
+
w = s.child, v = "west";
|
|
961
|
+
else if (c > 0 && C.c1 >= m - c)
|
|
962
|
+
w = o.child, v = "east";
|
|
1181
963
|
else {
|
|
1182
|
-
const
|
|
1183
|
-
x = this.scrollFactorX *
|
|
964
|
+
const f = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
965
|
+
x = this.scrollFactorX * f - this.areaBodyWestGeo.width, v = "center";
|
|
1184
966
|
}
|
|
1185
|
-
this.drawBigCell(
|
|
967
|
+
this.drawBigCell(C, x, t, d, w, v);
|
|
1186
968
|
}
|
|
1187
969
|
}
|
|
1188
970
|
}
|
|
@@ -1196,58 +978,58 @@ class ae extends re {
|
|
|
1196
978
|
* @param sideIdent SideIdent (west,center,east)
|
|
1197
979
|
* @protected
|
|
1198
980
|
*/
|
|
1199
|
-
drawBigCell(e, t,
|
|
1200
|
-
const n =
|
|
981
|
+
drawBigCell(e, t, s, i, o, r) {
|
|
982
|
+
const n = s + this.getRowHeights(0, e.r1 - 1, i).reduce((h, S) => h + S, 0), l = this.tableModel.getColumnCount(), a = this.tableModel.getFixedRightColumnCount();
|
|
1201
983
|
let d = 0;
|
|
1202
984
|
a > 0 && e.c1 >= l - a && (d = l - a);
|
|
1203
|
-
const
|
|
985
|
+
const u = t + this.getColumnWidths(d, e.c1 - 1).reduce((h, S) => h + S, 0), g = this.getRowHeights(e.r1, e.r2, i).reduce((h, S) => h + S, 0), m = this.getColumnWidths(e.c1, e.c2).reduce((h, S) => h + S, 0);
|
|
1204
986
|
let c = !1;
|
|
1205
987
|
const b = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
1206
988
|
b && (c = b.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? (console.info("TODO here", e), this.renderCell({
|
|
1207
|
-
areaModel:
|
|
1208
|
-
areaIdent:
|
|
989
|
+
areaModel: i,
|
|
990
|
+
areaIdent: i.areaIdent,
|
|
1209
991
|
sideIdent: r,
|
|
1210
992
|
rowIndex: e.r1,
|
|
1211
993
|
columnIndex: e.c1,
|
|
1212
|
-
left:
|
|
994
|
+
left: u,
|
|
1213
995
|
top: n,
|
|
1214
|
-
width:
|
|
996
|
+
width: m,
|
|
1215
997
|
height: g,
|
|
1216
998
|
parent: o,
|
|
1217
999
|
cellSelected: c,
|
|
1218
1000
|
lastRowOfModel: !0,
|
|
1219
1001
|
gammaRange: e.gammaRange
|
|
1220
1002
|
})) : this.renderCell({
|
|
1221
|
-
areaModel:
|
|
1222
|
-
areaIdent:
|
|
1003
|
+
areaModel: i,
|
|
1004
|
+
areaIdent: i.areaIdent,
|
|
1223
1005
|
sideIdent: r,
|
|
1224
1006
|
rowIndex: e.r1,
|
|
1225
1007
|
columnIndex: e.c1,
|
|
1226
|
-
left:
|
|
1008
|
+
left: u,
|
|
1227
1009
|
top: n,
|
|
1228
|
-
width:
|
|
1010
|
+
width: m,
|
|
1229
1011
|
height: g,
|
|
1230
1012
|
parent: o,
|
|
1231
1013
|
cellSelected: c,
|
|
1232
1014
|
lastRowOfModel: !0,
|
|
1233
1015
|
gammaRange: e.gammaRange
|
|
1234
|
-
}),
|
|
1016
|
+
}), i.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1235
1017
|
rowIndex: e.r1,
|
|
1236
1018
|
columnIndex: e.c1,
|
|
1237
|
-
cellLeft:
|
|
1019
|
+
cellLeft: u,
|
|
1238
1020
|
cellTop: n,
|
|
1239
|
-
cellWidth:
|
|
1021
|
+
cellWidth: m,
|
|
1240
1022
|
cellHeight: g,
|
|
1241
1023
|
parent: o
|
|
1242
1024
|
});
|
|
1243
1025
|
}
|
|
1244
|
-
findRowOfImportantRowspanCell(e, t,
|
|
1245
|
-
const
|
|
1026
|
+
findRowOfImportantRowspanCell(e, t, s) {
|
|
1027
|
+
const i = e.getMaxRowspan();
|
|
1246
1028
|
for (let o = t - 1; o > -1; o--) {
|
|
1247
|
-
const r = e.getRowspanAt(o,
|
|
1029
|
+
const r = e.getRowspanAt(o, s);
|
|
1248
1030
|
if (r > 1 && o + r + 1 >= t)
|
|
1249
1031
|
return o;
|
|
1250
|
-
if (t - o >
|
|
1032
|
+
if (t - o > i)
|
|
1251
1033
|
return -1;
|
|
1252
1034
|
}
|
|
1253
1035
|
return -1;
|
|
@@ -1255,8 +1037,8 @@ class ae extends re {
|
|
|
1255
1037
|
adjustColumnsToRowParent({
|
|
1256
1038
|
areaIdent: e,
|
|
1257
1039
|
sideIdent: t,
|
|
1258
|
-
areaModel:
|
|
1259
|
-
geo:
|
|
1040
|
+
areaModel: s,
|
|
1041
|
+
geo: i,
|
|
1260
1042
|
parent: o,
|
|
1261
1043
|
rowIndex: r,
|
|
1262
1044
|
columnIndexStart: n,
|
|
@@ -1266,37 +1048,37 @@ class ae extends re {
|
|
|
1266
1048
|
}) {
|
|
1267
1049
|
var b;
|
|
1268
1050
|
this.scrollViewportLeft = this.scrollViewport.scrollLeft;
|
|
1269
|
-
let
|
|
1051
|
+
let u = 0;
|
|
1270
1052
|
if (!a) {
|
|
1271
1053
|
const h = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1272
|
-
|
|
1054
|
+
u = this.scrollFactorX * h;
|
|
1273
1055
|
}
|
|
1274
|
-
const g = 0,
|
|
1275
|
-
let c =
|
|
1056
|
+
const g = 0, m = !!(e === "body" && t);
|
|
1057
|
+
let c = u;
|
|
1276
1058
|
for (let h = n; h <= l; h++) {
|
|
1277
|
-
const
|
|
1278
|
-
if (
|
|
1279
|
-
let x =
|
|
1280
|
-
const
|
|
1281
|
-
|
|
1282
|
-
let
|
|
1283
|
-
|
|
1059
|
+
const S = c, C = this.tableModel.getColumnWidth(h);
|
|
1060
|
+
if (C > 0 && S + C > 0) {
|
|
1061
|
+
let x = i.height;
|
|
1062
|
+
const w = s.getRowspanAt(r, h), v = s.getColspanAt(r, h);
|
|
1063
|
+
w > 1 && (x = this.getRowHeights(r, r + w - 1, s).reduce((E, R) => E + R, 0));
|
|
1064
|
+
let f = C;
|
|
1065
|
+
v > 1 && (f = this.getColumnWidths(h, h + v - 1).reduce((E, R) => E + R, 0));
|
|
1284
1066
|
let M = !1;
|
|
1285
1067
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (b = this.colAndRowspanModels[e]) != null && b.isInRange(r, h) && (M = !0), this.draggingTargetColumnIndex === h && e !== "header") {
|
|
1286
|
-
this.renderDragTargetDiv(o,
|
|
1287
|
-
const E = { left:
|
|
1068
|
+
this.renderDragTargetDiv(o, S, g, f, x);
|
|
1069
|
+
const E = { left: S, top: g, width: f, height: x };
|
|
1288
1070
|
this.dom.addColumnBorderDivs(this.tableOptions, o, E, e, t);
|
|
1289
1071
|
} else {
|
|
1290
|
-
const E = this.renderSelectedBackgroundDiv(M,
|
|
1072
|
+
const E = this.renderSelectedBackgroundDiv(M, m, t, s, r, h, o, S, g, f, x);
|
|
1291
1073
|
M || this.renderCell({
|
|
1292
|
-
areaModel:
|
|
1074
|
+
areaModel: s,
|
|
1293
1075
|
areaIdent: e,
|
|
1294
1076
|
sideIdent: t,
|
|
1295
1077
|
rowIndex: r,
|
|
1296
1078
|
columnIndex: h,
|
|
1297
|
-
left:
|
|
1079
|
+
left: S,
|
|
1298
1080
|
top: g,
|
|
1299
|
-
width:
|
|
1081
|
+
width: f,
|
|
1300
1082
|
height: x,
|
|
1301
1083
|
parent: o,
|
|
1302
1084
|
cellSelected: E,
|
|
@@ -1305,18 +1087,18 @@ class ae extends re {
|
|
|
1305
1087
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1306
1088
|
rowIndex: r,
|
|
1307
1089
|
columnIndex: h,
|
|
1308
|
-
cellLeft:
|
|
1090
|
+
cellLeft: S,
|
|
1309
1091
|
cellTop: g,
|
|
1310
|
-
cellWidth:
|
|
1092
|
+
cellWidth: f,
|
|
1311
1093
|
cellHeight: x,
|
|
1312
1094
|
parent: o
|
|
1313
1095
|
});
|
|
1314
1096
|
}
|
|
1315
1097
|
}
|
|
1316
|
-
if (c = c +
|
|
1098
|
+
if (c = c + C, c > this.areaBodyCenterGeo.width)
|
|
1317
1099
|
break;
|
|
1318
1100
|
}
|
|
1319
|
-
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(c - 1, 1,
|
|
1101
|
+
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(c - 1, 1, i.height, 0), o);
|
|
1320
1102
|
}
|
|
1321
1103
|
getTreeArrowColumnIndex() {
|
|
1322
1104
|
return this.tableOptions.showCheckboxWihoutExtraColumn ? 0 : this.tableModel.isRowCheckboxVisible() ? 1 : 0;
|
|
@@ -1324,78 +1106,102 @@ class ae extends re {
|
|
|
1324
1106
|
addAndRenderCellDiv({
|
|
1325
1107
|
areaModel: e,
|
|
1326
1108
|
areaIdent: t,
|
|
1327
|
-
sideIdent:
|
|
1328
|
-
rowIndex:
|
|
1109
|
+
sideIdent: s,
|
|
1110
|
+
rowIndex: i,
|
|
1329
1111
|
index: o,
|
|
1330
1112
|
left: r,
|
|
1331
1113
|
width: n,
|
|
1332
1114
|
height: l,
|
|
1333
1115
|
top: a,
|
|
1334
1116
|
parent: d,
|
|
1335
|
-
lastRowOfModel:
|
|
1117
|
+
lastRowOfModel: u
|
|
1336
1118
|
}) {
|
|
1337
|
-
var
|
|
1338
|
-
const
|
|
1119
|
+
var G;
|
|
1120
|
+
const m = this.editorRenderer && this.editorRendererRow === i && this.editorRendererColumn === o ? this.editorRenderer : e.getCellRenderer(i, o), c = { left: r, width: n, height: l, top: a, index: o }, b = e.getRowByIndex(i);
|
|
1339
1121
|
let h = "none";
|
|
1340
|
-
if (o === this.getTreeArrowColumnIndex() && b
|
|
1122
|
+
if (o === this.getTreeArrowColumnIndex() && O(b)) {
|
|
1341
1123
|
const y = b;
|
|
1342
|
-
(
|
|
1124
|
+
(G = y.children) != null && G.length ? y.expanded ? h = "expanded" : h = "collapsed" : h = "hidden";
|
|
1343
1125
|
}
|
|
1344
|
-
let
|
|
1126
|
+
let C;
|
|
1345
1127
|
if (t === "header") {
|
|
1346
1128
|
const y = this.tableModel.getColumnDef(o);
|
|
1347
|
-
(!(y != null && y.sortIconVisible) || y != null && y.sortIconVisible()) && (
|
|
1129
|
+
(!(y != null && y.sortIconVisible) || y != null && y.sortIconVisible()) && (C = y == null ? void 0 : y.sortState);
|
|
1348
1130
|
}
|
|
1349
|
-
const x = e.getValueAt(
|
|
1131
|
+
const x = e.getValueAt(i, o), w = m ? "" : `${x}`, v = e.isRowChecked(i), f = this.dom.addColumnDiv(
|
|
1350
1132
|
d,
|
|
1351
1133
|
c,
|
|
1352
|
-
|
|
1134
|
+
i,
|
|
1353
1135
|
o,
|
|
1354
1136
|
t,
|
|
1355
|
-
|
|
1356
|
-
|
|
1137
|
+
s,
|
|
1138
|
+
w,
|
|
1357
1139
|
h,
|
|
1358
1140
|
this.tableOptions,
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
), M = e.getTooltipAt(
|
|
1362
|
-
M && this.dom.setAttribute(
|
|
1141
|
+
v,
|
|
1142
|
+
C
|
|
1143
|
+
), M = e.getTooltipAt(i, o);
|
|
1144
|
+
M && this.dom.setAttribute(f, "title", M);
|
|
1363
1145
|
const E = this.tableModel.getColumnDef(o);
|
|
1364
|
-
E && E.classes[t] && this.dom.addClasses(E.classes[t],
|
|
1146
|
+
E && E.classes[t] && this.dom.addClasses(E.classes[t], f);
|
|
1365
1147
|
let R;
|
|
1366
|
-
|
|
1367
|
-
const
|
|
1368
|
-
if (
|
|
1148
|
+
m && (R = m.render(f, i, o, t, e, x, this.dom.domService));
|
|
1149
|
+
const I = e.getCustomClassesAt(i, o);
|
|
1150
|
+
if (I.length && this.dom.addClasses(I, f), this.dom.addColumnBorderDivs(this.tableOptions, d, c, t, s), u && this.dom.addHorizontalBorder({ left: r, width: n, height: l, top: a + l }, d), this.getFocusModel && t === "body") {
|
|
1369
1151
|
const y = this.getFocusModel();
|
|
1370
|
-
y != null && y.hasFocus(
|
|
1152
|
+
y != null && y.hasFocus(i, o) && this.dom.addFocusBorderDivs(d, c, {});
|
|
1371
1153
|
}
|
|
1372
|
-
t === "header" && this.dom.setAttribute(
|
|
1373
|
-
const
|
|
1374
|
-
if (
|
|
1375
|
-
for (const y in
|
|
1376
|
-
this.dom.setStyle(
|
|
1377
|
-
return [
|
|
1154
|
+
t === "header" && this.dom.setAttribute(f, "data-ge-action", "drag-column");
|
|
1155
|
+
const L = e.getCustomStyleAt(i, o);
|
|
1156
|
+
if (L)
|
|
1157
|
+
for (const y in L)
|
|
1158
|
+
this.dom.setStyle(f, y, L[y]);
|
|
1159
|
+
return [f, R];
|
|
1160
|
+
}
|
|
1161
|
+
applyCssClasses(e, t = {}) {
|
|
1162
|
+
e && Object.entries(t).forEach(([s, i]) => {
|
|
1163
|
+
i ? this.dom.addClass(s, e) : this.dom.removeClass(s, e);
|
|
1164
|
+
});
|
|
1378
1165
|
}
|
|
1379
|
-
|
|
1380
|
-
const
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1166
|
+
rerenderCellContent({ area: e, rowIndex: t, columnIndex: s, value: i, cssClasses: o }) {
|
|
1167
|
+
const r = this.tableModel.getAreaModel(e), n = 'div[data-col-index="' + s + '"][data-row-index="' + t + '"][data-area="' + e + '"]', l = document.querySelector(n);
|
|
1168
|
+
if (l) {
|
|
1169
|
+
let a;
|
|
1170
|
+
const u = this.editorRenderer && this.editorRendererRow === t && this.editorRendererColumn === s ? this.editorRenderer : r.getCellRenderer(t, s);
|
|
1171
|
+
if (l.innerText = "", this.applyCssClasses(l, o), u)
|
|
1172
|
+
a = u.render(l, t, s, e, r, i, this.dom.domService), a && this.cleanupFunctions[e].push(a);
|
|
1173
|
+
else {
|
|
1174
|
+
const c = `${i}`;
|
|
1175
|
+
this.dom.addLabelDiv(l, c, !1, t, s, e);
|
|
1176
|
+
}
|
|
1177
|
+
const g = r.getCustomClassesAt(t, s);
|
|
1178
|
+
g.length && this.dom.addClasses(g, l);
|
|
1179
|
+
const m = r.getCustomStyleAt(t, s);
|
|
1180
|
+
if (m)
|
|
1181
|
+
for (const c in m)
|
|
1182
|
+
this.dom.setStyle(l, c, m[c]);
|
|
1183
|
+
}
|
|
1384
1184
|
}
|
|
1385
|
-
|
|
1185
|
+
getColumnWidths(e, t) {
|
|
1386
1186
|
const s = [];
|
|
1387
|
-
for (let
|
|
1388
|
-
s.push(
|
|
1187
|
+
for (let i = e; i <= t; i++)
|
|
1188
|
+
s.push(this.tableModel.getColumnWidth(i));
|
|
1389
1189
|
return s;
|
|
1390
1190
|
}
|
|
1191
|
+
getRowHeights(e, t, s) {
|
|
1192
|
+
const i = [];
|
|
1193
|
+
for (let o = e; o <= t; o++)
|
|
1194
|
+
i.push(s.getRowHeight(o));
|
|
1195
|
+
return i;
|
|
1196
|
+
}
|
|
1391
1197
|
adjustHoverRows(e) {
|
|
1392
1198
|
if (this.tableOptions.hoverRowVisible && e.rowIndex > -1) {
|
|
1393
|
-
const t = this.hostElement.clientWidth,
|
|
1199
|
+
const t = this.hostElement.clientWidth, s = this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex), i = e.rowTop + this.areaHeaderCenter.parent.clientHeight - this.scrollTop;
|
|
1394
1200
|
this.dom.applyStyle(this.hoverRow, {
|
|
1395
1201
|
left: "0",
|
|
1396
|
-
top:
|
|
1202
|
+
top: i + "px",
|
|
1397
1203
|
width: t + "px",
|
|
1398
|
-
height:
|
|
1204
|
+
height: s + "px",
|
|
1399
1205
|
display: "block"
|
|
1400
1206
|
});
|
|
1401
1207
|
} else
|
|
@@ -1408,11 +1214,11 @@ class ae extends re {
|
|
|
1408
1214
|
}
|
|
1409
1215
|
adjustHoverColumns(e) {
|
|
1410
1216
|
if (this.tableOptions.hoverColumnVisible && e.rowIndex > -1) {
|
|
1411
|
-
const t = this.hostElement.clientHeight,
|
|
1217
|
+
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
1218
|
this.dom.applyStyle(this.hoverColumn, {
|
|
1413
1219
|
left: o + "px",
|
|
1414
1220
|
top: "0px",
|
|
1415
|
-
width:
|
|
1221
|
+
width: s + "px",
|
|
1416
1222
|
height: t + "px",
|
|
1417
1223
|
display: "block"
|
|
1418
1224
|
});
|
|
@@ -1427,25 +1233,25 @@ class ae extends re {
|
|
|
1427
1233
|
debounce(e, t = 1e3) {
|
|
1428
1234
|
this.debounceTimeout && clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(e.bind(this), t);
|
|
1429
1235
|
}
|
|
1430
|
-
renderDragTargetDiv(e, t,
|
|
1236
|
+
renderDragTargetDiv(e, t, s, i, o) {
|
|
1431
1237
|
const r = this.dom.applyStylePosistionAbsolute(
|
|
1432
1238
|
this.dom.createDivWithClass("ge-table-drop-zone", e)
|
|
1433
1239
|
);
|
|
1434
|
-
return this.dom.setStyle(r, "left", `${t}px`), this.dom.setStyle(r, "top", `${
|
|
1240
|
+
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
1241
|
}
|
|
1436
|
-
renderSelectedBackgroundDiv(e, t,
|
|
1242
|
+
renderSelectedBackgroundDiv(e, t, s, i, o, r, n, l, a, d, u) {
|
|
1437
1243
|
let g = !1;
|
|
1438
|
-
if (!e && t &&
|
|
1439
|
-
const
|
|
1440
|
-
if (
|
|
1441
|
-
const c =
|
|
1244
|
+
if (!e && t && i.isSelectable(o, r) && this.getSelectionModel) {
|
|
1245
|
+
const m = this.getSelectionModel();
|
|
1246
|
+
if (m) {
|
|
1247
|
+
const c = m.getSelectionCount(o, r);
|
|
1442
1248
|
g = c > 0;
|
|
1443
1249
|
for (let b = 0; b < c; b++) {
|
|
1444
1250
|
const h = this.dom.applyStylePosistionAbsolute(
|
|
1445
1251
|
// ge-table-body-west-selected-range
|
|
1446
|
-
this.dom.createDivWithClass(`ge-table-${
|
|
1252
|
+
this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`, n)
|
|
1447
1253
|
);
|
|
1448
|
-
this.dom.setStyle(h, "left", `${l}px`), this.dom.setStyle(h, "top", `${a}px`), this.dom.setStyle(h, "width", `${d}px`), this.dom.setStyle(h, "height", `${
|
|
1254
|
+
this.dom.setStyle(h, "left", `${l}px`), this.dom.setStyle(h, "top", `${a}px`), this.dom.setStyle(h, "width", `${d}px`), this.dom.setStyle(h, "height", `${u}px`);
|
|
1449
1255
|
}
|
|
1450
1256
|
}
|
|
1451
1257
|
}
|
|
@@ -1454,23 +1260,23 @@ class ae extends re {
|
|
|
1454
1260
|
renderCell({
|
|
1455
1261
|
areaModel: e,
|
|
1456
1262
|
areaIdent: t,
|
|
1457
|
-
sideIdent:
|
|
1458
|
-
rowIndex:
|
|
1263
|
+
sideIdent: s,
|
|
1264
|
+
rowIndex: i,
|
|
1459
1265
|
columnIndex: o,
|
|
1460
1266
|
left: r,
|
|
1461
1267
|
top: n,
|
|
1462
1268
|
width: l,
|
|
1463
1269
|
height: a,
|
|
1464
1270
|
parent: d,
|
|
1465
|
-
cellSelected:
|
|
1271
|
+
cellSelected: u,
|
|
1466
1272
|
lastRowOfModel: g,
|
|
1467
|
-
gammaRange:
|
|
1273
|
+
gammaRange: m
|
|
1468
1274
|
}) {
|
|
1469
1275
|
const [c, b] = this.addAndRenderCellDiv({
|
|
1470
1276
|
areaModel: e,
|
|
1471
1277
|
areaIdent: t,
|
|
1472
|
-
sideIdent:
|
|
1473
|
-
rowIndex:
|
|
1278
|
+
sideIdent: s,
|
|
1279
|
+
rowIndex: i,
|
|
1474
1280
|
index: o,
|
|
1475
1281
|
left: r,
|
|
1476
1282
|
width: l,
|
|
@@ -1478,72 +1284,72 @@ class ae extends re {
|
|
|
1478
1284
|
top: n,
|
|
1479
1285
|
parent: d,
|
|
1480
1286
|
lastRowOfModel: g,
|
|
1481
|
-
gammaRange:
|
|
1287
|
+
gammaRange: m
|
|
1482
1288
|
});
|
|
1483
|
-
|
|
1289
|
+
u && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, c), b && this.cleanupFunctions[t].push(b);
|
|
1484
1290
|
}
|
|
1485
|
-
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft:
|
|
1291
|
+
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight: r, parent: n }) {
|
|
1486
1292
|
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", `${
|
|
1293
|
+
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
1294
|
}
|
|
1489
1295
|
}
|
|
1490
|
-
class
|
|
1296
|
+
class he {
|
|
1491
1297
|
constructor(e, t) {
|
|
1492
1298
|
this.columnIndex = e, this.sortState = t;
|
|
1493
1299
|
}
|
|
1494
1300
|
}
|
|
1495
|
-
class
|
|
1301
|
+
class ce {
|
|
1496
1302
|
constructor(e) {
|
|
1497
1303
|
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
1498
1304
|
}
|
|
1499
1305
|
onHostElementChanged(e) {
|
|
1500
1306
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1501
|
-
const t = e.target,
|
|
1502
|
-
if (
|
|
1503
|
-
const r =
|
|
1307
|
+
const t = e.target, s = t.getAttribute("data-area"), i = t.getAttribute("data-row-index"), o = t.getAttribute("data-col-index");
|
|
1308
|
+
if (s && i && o) {
|
|
1309
|
+
const r = H(s), n = Number(i), l = Number(o);
|
|
1504
1310
|
this.tableScope.updateModelValueAfterEdit(r, n, l, t.value);
|
|
1505
1311
|
}
|
|
1506
1312
|
}
|
|
1507
1313
|
}
|
|
1508
1314
|
}
|
|
1509
|
-
class
|
|
1315
|
+
class pe {
|
|
1510
1316
|
constructor(e = -1, t = -1) {
|
|
1511
1317
|
this.rowIndex = e, this.columnIndex = t;
|
|
1512
1318
|
}
|
|
1513
1319
|
}
|
|
1514
|
-
class
|
|
1320
|
+
class V {
|
|
1515
1321
|
constructor(e) {
|
|
1516
1322
|
this.cells = e;
|
|
1517
1323
|
}
|
|
1518
1324
|
static createSingle(e, t) {
|
|
1519
|
-
return new
|
|
1325
|
+
return new V([new pe(e, t)]);
|
|
1520
1326
|
}
|
|
1521
1327
|
}
|
|
1522
|
-
class
|
|
1328
|
+
class ue {
|
|
1523
1329
|
constructor(e) {
|
|
1524
|
-
var t,
|
|
1525
|
-
this.tableScope = e, (t = this.tableScope.tableOptions) != null && t.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), (
|
|
1330
|
+
var t, s;
|
|
1331
|
+
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
1332
|
}
|
|
1527
1333
|
onMouseClicked(e, t) {
|
|
1528
|
-
var o, r, n, l, a, d,
|
|
1529
|
-
let
|
|
1334
|
+
var o, r, n, l, a, d, u;
|
|
1335
|
+
let s = !1, i = !1;
|
|
1530
1336
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1531
|
-
const g = this.getSelectionModel(),
|
|
1532
|
-
g &&
|
|
1337
|
+
const g = this.getSelectionModel(), m = this.getFocusModel();
|
|
1338
|
+
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(A.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0) : (a = e.originalEvent) != null && a.altKey && ((d = e.originalEvent) != null && d.ctrlKey || (u = e.originalEvent) != null && u.metaKey) && (g.removeSelection(A.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0));
|
|
1533
1339
|
}
|
|
1534
|
-
return
|
|
1340
|
+
return i ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
1535
1341
|
}
|
|
1536
1342
|
onActionTriggered(e) {
|
|
1537
1343
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1538
|
-
const t = this.getSelectionModel(),
|
|
1539
|
-
if (t &&
|
|
1344
|
+
const t = this.getSelectionModel(), s = this.getFocusModel();
|
|
1345
|
+
if (t && s) {
|
|
1540
1346
|
if (e === "SELECT_ALL")
|
|
1541
1347
|
return t.selectAll(), this.tableScope.repaint(), !0;
|
|
1542
1348
|
if (e === "DESELECT_ALL")
|
|
1543
1349
|
return t.clear(), this.tableScope.repaint(), !0;
|
|
1544
1350
|
if (e === "TOGGLE_SELECTION") {
|
|
1545
|
-
const [
|
|
1546
|
-
return t.togglePoint(
|
|
1351
|
+
const [i, o] = s.getFocus();
|
|
1352
|
+
return t.togglePoint(i, o), this.tableScope.repaint(), !0;
|
|
1547
1353
|
}
|
|
1548
1354
|
}
|
|
1549
1355
|
}
|
|
@@ -1551,16 +1357,16 @@ class pe {
|
|
|
1551
1357
|
}
|
|
1552
1358
|
createRangeByEvents(e, t) {
|
|
1553
1359
|
t || (t = e);
|
|
1554
|
-
const
|
|
1360
|
+
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);
|
|
1555
1361
|
return A.create({
|
|
1556
|
-
rowIndex1:
|
|
1362
|
+
rowIndex1: s,
|
|
1557
1363
|
columnIndex1: o,
|
|
1558
|
-
rowIndex2:
|
|
1364
|
+
rowIndex2: i,
|
|
1559
1365
|
columnIndex2: r
|
|
1560
1366
|
});
|
|
1561
1367
|
}
|
|
1562
1368
|
}
|
|
1563
|
-
class
|
|
1369
|
+
class Se {
|
|
1564
1370
|
get() {
|
|
1565
1371
|
return {
|
|
1566
1372
|
f2: "START_EDITING",
|
|
@@ -1578,7 +1384,7 @@ class ue {
|
|
|
1578
1384
|
};
|
|
1579
1385
|
}
|
|
1580
1386
|
}
|
|
1581
|
-
class
|
|
1387
|
+
class ge {
|
|
1582
1388
|
get() {
|
|
1583
1389
|
return {
|
|
1584
1390
|
f2: "START_EDITING",
|
|
@@ -1598,7 +1404,7 @@ class Se {
|
|
|
1598
1404
|
};
|
|
1599
1405
|
}
|
|
1600
1406
|
}
|
|
1601
|
-
class
|
|
1407
|
+
class me {
|
|
1602
1408
|
constructor(e) {
|
|
1603
1409
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
1604
1410
|
}
|
|
@@ -1606,7 +1412,7 @@ class ge {
|
|
|
1606
1412
|
this.listener.includes(e) || this.listener.push(e);
|
|
1607
1413
|
}
|
|
1608
1414
|
init() {
|
|
1609
|
-
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new
|
|
1415
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new ge().get()) : Object.assign(this.shortcutActionIdMapping, new Se().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
1416
|
}
|
|
1611
1417
|
isMacintosh() {
|
|
1612
1418
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -1624,24 +1430,24 @@ class ge {
|
|
|
1624
1430
|
emit(e) {
|
|
1625
1431
|
this.isDebug() && console.debug("ShortcutService emit:", e);
|
|
1626
1432
|
let t = !1;
|
|
1627
|
-
for (const
|
|
1628
|
-
|
|
1433
|
+
for (const s of this.listener)
|
|
1434
|
+
s.onActionTriggered(e) && (t = !0);
|
|
1629
1435
|
return t;
|
|
1630
1436
|
}
|
|
1631
1437
|
findEnty(e) {
|
|
1632
1438
|
const t = this.getTokenByEvent(e);
|
|
1633
1439
|
this.isDebug() && console.debug("ShortcutService tokens:", t);
|
|
1634
|
-
for (const
|
|
1635
|
-
const
|
|
1636
|
-
if (this.areTokensEquals(t,
|
|
1637
|
-
return this.shortcutActionIdMapping[
|
|
1440
|
+
for (const s in this.shortcutActionIdMapping) {
|
|
1441
|
+
const i = s.replace(/opt/g, "alt").replace(/cmd/g, "meta").split(/[\+ ]/g).sort();
|
|
1442
|
+
if (this.areTokensEquals(t, i))
|
|
1443
|
+
return this.shortcutActionIdMapping[s];
|
|
1638
1444
|
}
|
|
1639
1445
|
}
|
|
1640
1446
|
areTokensEquals(e, t) {
|
|
1641
1447
|
if (e.length !== t.length || e.length === 0)
|
|
1642
1448
|
return !1;
|
|
1643
|
-
for (let
|
|
1644
|
-
if (e[
|
|
1449
|
+
for (let s = 0; s < e.length; s++)
|
|
1450
|
+
if (e[s] !== t[s])
|
|
1645
1451
|
return !1;
|
|
1646
1452
|
return !0;
|
|
1647
1453
|
}
|
|
@@ -1650,7 +1456,7 @@ class ge {
|
|
|
1650
1456
|
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
1457
|
}
|
|
1652
1458
|
}
|
|
1653
|
-
class
|
|
1459
|
+
class k {
|
|
1654
1460
|
onCheckboxChanged(e) {
|
|
1655
1461
|
}
|
|
1656
1462
|
onContextmenu(e) {
|
|
@@ -1666,19 +1472,153 @@ class fe {
|
|
|
1666
1472
|
onMouseMoved(e) {
|
|
1667
1473
|
}
|
|
1668
1474
|
}
|
|
1669
|
-
class
|
|
1670
|
-
|
|
1475
|
+
class z {
|
|
1476
|
+
setStyle(e, t, s) {
|
|
1477
|
+
return e.style[t] = s, e;
|
|
1478
|
+
}
|
|
1479
|
+
appendText(e, t) {
|
|
1480
|
+
const s = this.createText(t);
|
|
1481
|
+
return this.appendChild(e, s), s;
|
|
1482
|
+
}
|
|
1483
|
+
addClass(e, t) {
|
|
1484
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.add(s)) : e.classList.add(t), e;
|
|
1485
|
+
}
|
|
1486
|
+
removeClass(e, t) {
|
|
1487
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.remove(s)) : e.classList.remove(t), e;
|
|
1488
|
+
}
|
|
1489
|
+
appendChild(e, t) {
|
|
1490
|
+
e.appendChild(t);
|
|
1491
|
+
}
|
|
1492
|
+
createElement(e) {
|
|
1493
|
+
return document.createElement(e);
|
|
1494
|
+
}
|
|
1495
|
+
createText(e) {
|
|
1496
|
+
return document.createTextNode(e);
|
|
1497
|
+
}
|
|
1498
|
+
setAttribute(e, t, s) {
|
|
1499
|
+
e.setAttribute(t, s);
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
class fe {
|
|
1503
|
+
render(e, t, s, i, o, r, n) {
|
|
1504
|
+
if (o.isEditable(t, s)) {
|
|
1505
|
+
n.addClass(e, "ge-table-row-input-div");
|
|
1506
|
+
const l = o.getValueAt(t, s);
|
|
1507
|
+
e.innerHTML = `
|
|
1508
|
+
<input
|
|
1509
|
+
type="text"
|
|
1510
|
+
value="${l}"
|
|
1511
|
+
autofocus
|
|
1512
|
+
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
1513
|
+
data-listen="change"
|
|
1514
|
+
data-area="${i}"
|
|
1515
|
+
data-row-index="${t}"
|
|
1516
|
+
data-col-index="${s}"
|
|
1517
|
+
data-input-type="text"
|
|
1518
|
+
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
1519
|
+
class="ge-table-cell-editor-input">`;
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
class be {
|
|
1524
|
+
constructor(e = "none", t = "single") {
|
|
1525
|
+
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1526
|
+
}
|
|
1527
|
+
getSelectionCount(e, t) {
|
|
1528
|
+
let s = 0;
|
|
1529
|
+
for (const i of this.ranges)
|
|
1530
|
+
i.isInRange(e, t) && s++;
|
|
1531
|
+
return this.allSelected && s++, this.isInNegativeRange(e, t) && (s = 0), s;
|
|
1532
|
+
}
|
|
1533
|
+
isInNegativeRange(e, t) {
|
|
1534
|
+
for (const s of this.negativeRanges)
|
|
1535
|
+
if (s.isInRange(e, t))
|
|
1536
|
+
return !0;
|
|
1537
|
+
return !1;
|
|
1538
|
+
}
|
|
1539
|
+
getRanges() {
|
|
1540
|
+
return this.ranges;
|
|
1541
|
+
}
|
|
1542
|
+
clear() {
|
|
1543
|
+
this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1544
|
+
}
|
|
1545
|
+
hasSelection() {
|
|
1546
|
+
return !!this.ranges.length;
|
|
1547
|
+
}
|
|
1548
|
+
selectAll() {
|
|
1549
|
+
this.allSelected = !0;
|
|
1550
|
+
}
|
|
1551
|
+
addSelection(e) {
|
|
1552
|
+
this.addRange(e);
|
|
1553
|
+
}
|
|
1554
|
+
removeSelection(e) {
|
|
1555
|
+
if (this.selectionType === "none")
|
|
1556
|
+
return;
|
|
1557
|
+
let t = e;
|
|
1558
|
+
this.selectionType === "row" ? t = A.singleRow(e.r1) : this.selectionType === "column" && (t = A.singleColumn(e.c1)), this.negativeRanges.push(t);
|
|
1559
|
+
}
|
|
1560
|
+
togglePoint(e, t) {
|
|
1561
|
+
this.getSelectionCount(e, t) > 0 ? this.removeSelection(A.singleCell(e, t)) : this.addSelection(A.singleCell(e, t));
|
|
1562
|
+
}
|
|
1563
|
+
addRange(e) {
|
|
1564
|
+
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));
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
class ye {
|
|
1568
|
+
constructor(e = "none") {
|
|
1569
|
+
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
|
|
1570
|
+
}
|
|
1571
|
+
clearChanged() {
|
|
1572
|
+
this.changed = !1;
|
|
1573
|
+
}
|
|
1574
|
+
hasChanged() {
|
|
1575
|
+
return this.changed;
|
|
1576
|
+
}
|
|
1577
|
+
clear() {
|
|
1578
|
+
this.rowIndex = -1, this.columnIndex = -1;
|
|
1579
|
+
}
|
|
1580
|
+
setFocus(e, t) {
|
|
1581
|
+
(this.rowIndex !== e || this.columnIndex !== t) && (this.rowIndex = e, this.columnIndex = t, this.changed = !0);
|
|
1582
|
+
}
|
|
1583
|
+
hasFocus(e, t) {
|
|
1584
|
+
return this.rowIndex === e && this.columnIndex === t;
|
|
1585
|
+
}
|
|
1586
|
+
getFocus() {
|
|
1587
|
+
return [this.rowIndex, this.columnIndex];
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
const ve = new be(), Ce = new ye("cell");
|
|
1591
|
+
class K {
|
|
1592
|
+
constructor() {
|
|
1593
|
+
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 = {
|
|
1594
|
+
header: 34,
|
|
1595
|
+
body: 34,
|
|
1596
|
+
footer: 34
|
|
1597
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new j(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new X(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new fe(), this.getSelectionModel = () => ve, this.getFocusModel = () => Ce;
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
class _ extends de {
|
|
1601
|
+
constructor(e, t, s, i, o) {
|
|
1671
1602
|
var r;
|
|
1672
1603
|
if (super(
|
|
1673
1604
|
e,
|
|
1674
1605
|
t,
|
|
1675
|
-
new
|
|
1676
|
-
|
|
1677
|
-
), this.eventListener = o, this.selectionService = new
|
|
1606
|
+
new Q(s),
|
|
1607
|
+
i
|
|
1608
|
+
), this.eventListener = o, this.selectionService = new ue(this), this.api = new te(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new k()), (r = this.tableOptions) != null && r.autoRestoreOptions) {
|
|
1678
1609
|
const n = this.tableOptions.autoRestoreOptions, l = n.getStorageKeyFn;
|
|
1679
|
-
l && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new
|
|
1610
|
+
l && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new se(l)), n.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new oe(l)), n.autoRestoreSortingState && (this.storeSortingService = new le(l)));
|
|
1680
1611
|
}
|
|
1681
|
-
this.mouseHandler = new
|
|
1612
|
+
this.mouseHandler = new ee(this), this.inputHandler = new ce(this), this.shortcutService = new me(this), this.shortcutService.addListener(this.selectionService);
|
|
1613
|
+
}
|
|
1614
|
+
static create(e, t, s = new K(), i = new k(), o = new z()) {
|
|
1615
|
+
return new _(
|
|
1616
|
+
e,
|
|
1617
|
+
t,
|
|
1618
|
+
o,
|
|
1619
|
+
s,
|
|
1620
|
+
i
|
|
1621
|
+
);
|
|
1682
1622
|
}
|
|
1683
1623
|
onActionTriggered(e) {
|
|
1684
1624
|
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,15 +1626,15 @@ class me extends ae {
|
|
|
1686
1626
|
if (e === "START_EDITING" && this.getFocusModel) {
|
|
1687
1627
|
const t = this.getFocusModel();
|
|
1688
1628
|
if (t) {
|
|
1689
|
-
const [
|
|
1690
|
-
this.tableModel.getBodyModel().isEditable(
|
|
1629
|
+
const [s, i] = t.getFocus();
|
|
1630
|
+
this.tableModel.getBodyModel().isEditable(s, i) && (this.clearSelection(), this.initRenderEditor(s, i));
|
|
1691
1631
|
}
|
|
1692
1632
|
return !0;
|
|
1693
1633
|
}
|
|
1694
1634
|
return !1;
|
|
1695
1635
|
}
|
|
1696
|
-
updateModelValueAfterEdit(e, t,
|
|
1697
|
-
e === "body" && this.tableModel.getAreaModel(e).setValue(t,
|
|
1636
|
+
updateModelValueAfterEdit(e, t, s, i) {
|
|
1637
|
+
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
1638
|
}
|
|
1699
1639
|
getApi() {
|
|
1700
1640
|
return this.api;
|
|
@@ -1704,19 +1644,19 @@ class me extends ae {
|
|
|
1704
1644
|
*/
|
|
1705
1645
|
firstInit() {
|
|
1706
1646
|
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();
|
|
1647
|
+
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
1648
|
}
|
|
1709
1649
|
createGeMouseEvent(e) {
|
|
1710
|
-
const t = new
|
|
1650
|
+
const t = new W();
|
|
1711
1651
|
if (t.originalEvent = e, e) {
|
|
1712
|
-
const
|
|
1713
|
-
if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(
|
|
1714
|
-
const
|
|
1715
|
-
t.rowTop =
|
|
1652
|
+
const s = e.target;
|
|
1653
|
+
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) {
|
|
1654
|
+
const i = this.tableModel.getAreaModel(t.areaIdent);
|
|
1655
|
+
t.rowTop = i.getYPosByRowIndex(t.rowIndex);
|
|
1716
1656
|
}
|
|
1717
1657
|
if (t.columnLeft = this.tableModel.getXPosByColumnIndex(t.columnIndex), e.ctrlKey && e.altKey) {
|
|
1718
|
-
const
|
|
1719
|
-
this.debugOnce(o,
|
|
1658
|
+
const i = e.clientY - this.hostElement.offsetTop - this.areaHeaderCenter.parent.clientHeight, o = e.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width;
|
|
1659
|
+
this.debugOnce(o, i);
|
|
1720
1660
|
}
|
|
1721
1661
|
}
|
|
1722
1662
|
return t;
|
|
@@ -1737,44 +1677,44 @@ class me extends ae {
|
|
|
1737
1677
|
this.eventListener.onContextmenu(e);
|
|
1738
1678
|
}
|
|
1739
1679
|
toggleExpandCollapseAll(e = !0) {
|
|
1740
|
-
var
|
|
1680
|
+
var s;
|
|
1741
1681
|
const t = this.tableModel.getBodyModel();
|
|
1742
|
-
t
|
|
1682
|
+
$(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
1743
1683
|
}
|
|
1744
|
-
toggleRowCheckbox(e, t,
|
|
1684
|
+
toggleRowCheckbox(e, t, s) {
|
|
1745
1685
|
var l;
|
|
1746
|
-
const
|
|
1747
|
-
|
|
1748
|
-
const n = (l =
|
|
1686
|
+
const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e), r = o === void 0 || o === "semi" || o === "none";
|
|
1687
|
+
i.setRowChecked(e, r), this.repaint();
|
|
1688
|
+
const n = (l = i.rowSelectionModel) == null ? void 0 : l.getCheckedRows();
|
|
1749
1689
|
this.eventListener.onCheckboxChanged(n || []);
|
|
1750
1690
|
}
|
|
1751
1691
|
onMouseClicked(e, t) {
|
|
1752
|
-
let
|
|
1753
|
-
if (!
|
|
1754
|
-
const
|
|
1755
|
-
|
|
1692
|
+
let s = this.selectionService.onMouseClicked(e, t);
|
|
1693
|
+
if (!s && this.getFocusModel) {
|
|
1694
|
+
const i = this.getFocusModel();
|
|
1695
|
+
i && (s = i.hasChanged(), i.clearChanged(), s && this.resetEditorRenderer());
|
|
1756
1696
|
}
|
|
1757
|
-
this.eventListener.onMouseClicked(e),
|
|
1697
|
+
this.eventListener.onMouseClicked(e), s && this.debounce(this.repaint.bind(this), 10);
|
|
1758
1698
|
}
|
|
1759
1699
|
externalFilterChanged(e = !0) {
|
|
1760
1700
|
const t = this.tableOptions.externalFilterFunction;
|
|
1761
1701
|
t && (e && this.clearSelectionModel(), this.tableModel.externalFilterChanged(t), this.scrollViewport.scrollTo(0, 0), this.tableModel.recalcHeightAndPadding(), this.resetSizeOfWrapperDiv(), this.repaint());
|
|
1762
1702
|
}
|
|
1763
|
-
onHeaderDblClicked(e, t,
|
|
1703
|
+
onHeaderDblClicked(e, t, s) {
|
|
1764
1704
|
var o, r;
|
|
1765
|
-
const
|
|
1766
|
-
if (
|
|
1705
|
+
const i = this.tableModel.getColumnDef(s);
|
|
1706
|
+
if (i != null && i.sortable && i.sortable()) {
|
|
1767
1707
|
e.preventDefault(), e.stopPropagation();
|
|
1768
|
-
const n =
|
|
1769
|
-
this.tableModel.doSort([d]) && ((o = this.tableModel.getColumnDefs()) == null || o.forEach((g) => g.sortState = ""),
|
|
1708
|
+
const n = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, l = i.sortState ?? "", a = n[(n.indexOf(l) + 1) % n.length], d = new he(s, a);
|
|
1709
|
+
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
1710
|
}
|
|
1771
1711
|
}
|
|
1772
1712
|
changeFocusCell(e, t) {
|
|
1773
1713
|
if (!this.isEditing() && this.getFocusModel) {
|
|
1774
|
-
const
|
|
1775
|
-
if (
|
|
1776
|
-
const [
|
|
1777
|
-
return
|
|
1714
|
+
const s = this.getFocusModel();
|
|
1715
|
+
if (s) {
|
|
1716
|
+
const [i, o] = s.getFocus();
|
|
1717
|
+
return s.setFocus(i + t, o + e), this.repaint(), !0;
|
|
1778
1718
|
}
|
|
1779
1719
|
}
|
|
1780
1720
|
return !1;
|
|
@@ -1787,30 +1727,30 @@ class me extends ae {
|
|
|
1787
1727
|
this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
|
|
1788
1728
|
}
|
|
1789
1729
|
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", (
|
|
1730
|
+
var s;
|
|
1731
|
+
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
1732
|
}
|
|
1793
1733
|
autoRestoreScrollPosition() {
|
|
1794
1734
|
var e;
|
|
1795
1735
|
if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
|
|
1796
|
-
const
|
|
1797
|
-
|
|
1736
|
+
const s = this.storeScrollPosStateService.getScrollOffset();
|
|
1737
|
+
s && this.scrollViewport.scrollTo(...s);
|
|
1798
1738
|
}
|
|
1799
1739
|
}
|
|
1800
1740
|
autoRestoreSortingState() {
|
|
1801
1741
|
var e, t;
|
|
1802
1742
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
|
|
1803
|
-
const
|
|
1804
|
-
|
|
1743
|
+
const s = this.storeSortingService.getSortItems();
|
|
1744
|
+
s != null && s.length && this.tableModel.getBodyModel().doSort(s);
|
|
1805
1745
|
}
|
|
1806
1746
|
}
|
|
1807
1747
|
autoRestoreCollapsedExpandedState() {
|
|
1808
1748
|
var e, t;
|
|
1809
1749
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
|
|
1810
|
-
const
|
|
1811
|
-
if (
|
|
1750
|
+
const s = this.tableOptions.autoRestoreOptions, i = s.getRowId;
|
|
1751
|
+
if (s.autoRestoreCollapsedExpandedState && i) {
|
|
1812
1752
|
const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), r = this.tableModel.getAreaModel("body");
|
|
1813
|
-
if (r
|
|
1753
|
+
if ($(r)) {
|
|
1814
1754
|
const n = r, l = r.getRowCount();
|
|
1815
1755
|
for (let a = 0; a < l; a++) {
|
|
1816
1756
|
const d = r.getRowByIndex(a);
|
|
@@ -1820,8 +1760,8 @@ class me extends ae {
|
|
|
1820
1760
|
else if (o.allCollapsed)
|
|
1821
1761
|
d.expanded = !1;
|
|
1822
1762
|
else {
|
|
1823
|
-
const
|
|
1824
|
-
o.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(
|
|
1763
|
+
const u = i(d.data);
|
|
1764
|
+
o.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(u) : o.mode === "collapsed" && (d.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(u));
|
|
1825
1765
|
}
|
|
1826
1766
|
}
|
|
1827
1767
|
n.recalcVisibleTreeRows();
|
|
@@ -1830,152 +1770,30 @@ class me extends ae {
|
|
|
1830
1770
|
}
|
|
1831
1771
|
}
|
|
1832
1772
|
}
|
|
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({
|
|
1773
|
+
function Ae({
|
|
1956
1774
|
tableModel: p,
|
|
1957
|
-
tableOptions: e = new
|
|
1775
|
+
tableOptions: e = new K(),
|
|
1958
1776
|
mouseMoved: t,
|
|
1959
|
-
checkboxChanged:
|
|
1960
|
-
contextmenu:
|
|
1777
|
+
checkboxChanged: s,
|
|
1778
|
+
contextmenu: i,
|
|
1961
1779
|
modelChanged: o,
|
|
1962
1780
|
mouseClicked: r,
|
|
1963
1781
|
mouseDragging: n,
|
|
1964
1782
|
mouseDraggingEnd: l,
|
|
1965
1783
|
tableReady: a
|
|
1966
1784
|
}) {
|
|
1967
|
-
const d =
|
|
1968
|
-
let
|
|
1969
|
-
|
|
1970
|
-
d.current && !
|
|
1785
|
+
const d = q(null);
|
|
1786
|
+
let u = !1;
|
|
1787
|
+
U(() => {
|
|
1788
|
+
d.current && !u && (g(d.current), u = !0);
|
|
1971
1789
|
});
|
|
1972
|
-
const g = (
|
|
1790
|
+
const g = (m) => {
|
|
1973
1791
|
const c = {
|
|
1974
1792
|
onCheckboxChanged: (h) => {
|
|
1975
|
-
|
|
1793
|
+
s && s(h);
|
|
1976
1794
|
},
|
|
1977
1795
|
onContextmenu: (h) => {
|
|
1978
|
-
|
|
1796
|
+
i && i(h);
|
|
1979
1797
|
},
|
|
1980
1798
|
onModelChanged: (h) => {
|
|
1981
1799
|
o && o(h);
|
|
@@ -1992,16 +1810,16 @@ function Te({
|
|
|
1992
1810
|
onMouseMoved: (h) => {
|
|
1993
1811
|
t && t(h);
|
|
1994
1812
|
}
|
|
1995
|
-
}, b = new
|
|
1996
|
-
|
|
1813
|
+
}, b = new _(
|
|
1814
|
+
m,
|
|
1997
1815
|
p,
|
|
1998
|
-
new
|
|
1816
|
+
new z(),
|
|
1999
1817
|
e,
|
|
2000
1818
|
c
|
|
2001
1819
|
);
|
|
2002
1820
|
b.firstInit(), a && a(b.getApi());
|
|
2003
1821
|
};
|
|
2004
|
-
return /* @__PURE__ */
|
|
1822
|
+
return /* @__PURE__ */ Y(
|
|
2005
1823
|
"div",
|
|
2006
1824
|
{
|
|
2007
1825
|
ref: d,
|
|
@@ -2009,46 +1827,46 @@ function Te({
|
|
|
2009
1827
|
style: {
|
|
2010
1828
|
width: "100%",
|
|
2011
1829
|
height: "100%",
|
|
2012
|
-
|
|
1830
|
+
background: "transparent",
|
|
2013
1831
|
padding: "0",
|
|
2014
1832
|
margin: "0"
|
|
2015
1833
|
}
|
|
2016
1834
|
}
|
|
2017
1835
|
);
|
|
2018
1836
|
}
|
|
2019
|
-
var
|
|
1837
|
+
var B, F = J;
|
|
2020
1838
|
if (process.env.NODE_ENV === "production")
|
|
2021
|
-
|
|
1839
|
+
B = F.createRoot, F.hydrateRoot;
|
|
2022
1840
|
else {
|
|
2023
|
-
var
|
|
2024
|
-
|
|
2025
|
-
|
|
1841
|
+
var N = F.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
1842
|
+
B = function(p, e) {
|
|
1843
|
+
N.usingClientEntryPoint = !0;
|
|
2026
1844
|
try {
|
|
2027
1845
|
return F.createRoot(p, e);
|
|
2028
1846
|
} finally {
|
|
2029
|
-
|
|
1847
|
+
N.usingClientEntryPoint = !1;
|
|
2030
1848
|
}
|
|
2031
1849
|
};
|
|
2032
1850
|
}
|
|
2033
|
-
class
|
|
1851
|
+
class Re {
|
|
2034
1852
|
constructor(e) {
|
|
2035
1853
|
this.Component = e, console.info(e);
|
|
2036
1854
|
}
|
|
2037
|
-
render(e, t,
|
|
1855
|
+
render(e, t, s, i, o, r, n) {
|
|
2038
1856
|
const l = {
|
|
2039
1857
|
cellDiv: e,
|
|
2040
1858
|
rowIndex: t,
|
|
2041
|
-
columnIndex:
|
|
2042
|
-
areaIdent:
|
|
1859
|
+
columnIndex: s,
|
|
1860
|
+
areaIdent: i,
|
|
2043
1861
|
areaModel: o,
|
|
2044
1862
|
cellValue: r
|
|
2045
|
-
}, a =
|
|
1863
|
+
}, a = B(e, {});
|
|
2046
1864
|
return a.render(this.Component(l)), () => {
|
|
2047
1865
|
a.unmount();
|
|
2048
1866
|
};
|
|
2049
1867
|
}
|
|
2050
1868
|
}
|
|
2051
1869
|
export {
|
|
2052
|
-
|
|
2053
|
-
|
|
1870
|
+
Re as ComponentRendererWrapper,
|
|
1871
|
+
Ae as GuiexpertTable
|
|
2054
1872
|
};
|