@guiexpert/vue3-table 1.0.14 → 1.0.16
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 +97 -0
- package/index.cjs +7 -7
- package/index.d.ts +3 -0
- package/index.js +1554 -2486
- package/{components → lib}/ComponentRendererWrapper.d.ts +9 -10
- package/lib/GuiexpertTable.vue.d.ts +40 -0
- package/{GuiexpertTablePlugin.d.ts → lib/GuiexpertTablePlugin.d.ts} +9 -10
- package/package.json +3 -2
- package/style.css +1 -1
- package/GuiexpertTablePlugin.d.ts.map +0 -1
- package/components/ComponentRendererWrapper.d.ts.map +0 -1
- package/components/GuiexpertTable.vue.d.ts +0 -4
- package/components/GuiexpertTable.vue.d.ts.map +0 -1
- package/components/index.d.ts +0 -3
- package/components/index.d.ts.map +0 -1
- package/favicon.ico +0 -0
- package/main.d.ts +0 -2
- package/main.d.ts.map +0 -1
package/index.js
CHANGED
|
@@ -1,747 +1,423 @@
|
|
|
1
|
-
import { defineComponent, ref, onMounted, openBlock, createElementBlock } from "vue";
|
|
2
|
-
class
|
|
3
|
-
constructor(
|
|
4
|
-
this.rowIndex =
|
|
5
|
-
this.rowTop = rowTop;
|
|
6
|
-
this.columnIndex = columnIndex;
|
|
7
|
-
this.columnLeft = columnLeft;
|
|
8
|
-
this.areaIdent = areaIdent;
|
|
9
|
-
this.sideIdent = sideIdent;
|
|
10
|
-
this.originalEvent = originalEvent;
|
|
11
|
-
this.clickCount = clickCount;
|
|
12
|
-
this.draggingX = draggingX;
|
|
13
|
-
this.draggingY = draggingY;
|
|
14
|
-
this.action = action;
|
|
1
|
+
import { defineComponent as G, ref as N, onMounted as z, openBlock as j, createElementBlock as X, createVNode as K, render as k } from "vue";
|
|
2
|
+
class B {
|
|
3
|
+
constructor(e = -1, t = -1, s = -1, i = -1, o, r, l, n = 0, a = 0, d = 0, S = "") {
|
|
4
|
+
this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = i, this.areaIdent = o, this.sideIdent = r, this.originalEvent = l, this.clickCount = n, this.draggingX = a, this.draggingY = d, this.action = S;
|
|
15
5
|
}
|
|
16
6
|
clone() {
|
|
17
|
-
return new
|
|
7
|
+
return new B(
|
|
8
|
+
this.rowIndex,
|
|
9
|
+
this.rowTop,
|
|
10
|
+
this.columnIndex,
|
|
11
|
+
this.columnLeft,
|
|
12
|
+
this.areaIdent,
|
|
13
|
+
this.sideIdent,
|
|
14
|
+
this.originalEvent,
|
|
15
|
+
this.clickCount,
|
|
16
|
+
this.draggingX,
|
|
17
|
+
this.draggingY,
|
|
18
|
+
this.action
|
|
19
|
+
);
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
|
-
class
|
|
21
|
-
constructor(
|
|
22
|
-
this.content =
|
|
23
|
-
this.style = style;
|
|
24
|
-
this.classes = classes;
|
|
22
|
+
class I {
|
|
23
|
+
constructor(e = ">", t = "", s = []) {
|
|
24
|
+
this.content = e, this.style = t, this.classes = s;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
class
|
|
28
|
-
constructor(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
class H {
|
|
28
|
+
constructor(e = new I(
|
|
29
|
+
">",
|
|
30
|
+
"transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
|
|
31
|
+
["gt-table-tree-arrow-expanded"]
|
|
32
|
+
), t = new I(
|
|
33
|
+
">",
|
|
34
|
+
"",
|
|
35
|
+
["ge-table-tree-arrow-collapsed"]
|
|
36
|
+
), s = new I(
|
|
37
|
+
">",
|
|
38
|
+
"color:transparent;",
|
|
39
|
+
["gt-table-tree-arrow-hidden"]
|
|
40
|
+
), i = new I(
|
|
41
|
+
"↕",
|
|
42
|
+
"",
|
|
43
|
+
["gt-table-tree-arrow-expanded-all"]
|
|
44
|
+
)) {
|
|
45
|
+
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = i;
|
|
33
46
|
}
|
|
34
47
|
}
|
|
35
|
-
class
|
|
36
|
-
constructor(
|
|
37
|
-
this.iconAsc =
|
|
38
|
-
this.iconDesc = iconDesc;
|
|
39
|
-
this.iconPlaceholder = iconPlaceholder;
|
|
48
|
+
class W {
|
|
49
|
+
constructor(e = new I("↑", "", ["ge-header-sorted-asc"]), t = new I("↓", "", ["ge-header-sorted-desc"]), s = new I("↑", "color:transparent;", [])) {
|
|
50
|
+
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
|
|
40
51
|
}
|
|
41
52
|
}
|
|
42
|
-
class
|
|
43
|
-
constructor(
|
|
44
|
-
this.domService =
|
|
53
|
+
class Y {
|
|
54
|
+
constructor(e) {
|
|
55
|
+
this.domService = e;
|
|
45
56
|
}
|
|
46
|
-
setStyle(
|
|
47
|
-
this.domService.setStyle(
|
|
48
|
-
return el;
|
|
57
|
+
setStyle(e, t, s) {
|
|
58
|
+
return this.domService.setStyle(e, t, s), e;
|
|
49
59
|
}
|
|
50
|
-
applyStyle(
|
|
51
|
-
for (const
|
|
52
|
-
this.domService.setStyle(
|
|
53
|
-
|
|
54
|
-
return ele;
|
|
55
|
-
}
|
|
56
|
-
applyDisplayNoneStyle(ele) {
|
|
57
|
-
this.domService.setStyle(ele, "display", "none");
|
|
58
|
-
return ele;
|
|
59
|
-
}
|
|
60
|
-
applyDisplayBlockStyle(ele) {
|
|
61
|
-
this.domService.setStyle(ele, "display", "block");
|
|
62
|
-
return ele;
|
|
63
|
-
}
|
|
64
|
-
applyStyleInPx(ele, geoData) {
|
|
65
|
-
Object.entries(geoData).forEach(([key, value]) => this.domService.setStyle(ele, key, value + "px"));
|
|
66
|
-
return ele;
|
|
67
|
-
}
|
|
68
|
-
applyStylePosistionRelative(ele) {
|
|
69
|
-
this.domService.setStyle(ele, "position", "relative");
|
|
70
|
-
this.domService.setStyle(ele, "overflow", "clip");
|
|
71
|
-
return ele;
|
|
72
|
-
}
|
|
73
|
-
applyStylePosistionAbsolute(ele) {
|
|
74
|
-
this.domService.setStyle(ele, "position", "absolute");
|
|
75
|
-
return ele;
|
|
76
|
-
}
|
|
77
|
-
applyStyleFullSize(ele) {
|
|
78
|
-
this.domService.setStyle(ele, "width", "100%");
|
|
79
|
-
this.domService.setStyle(ele, "height", "100%");
|
|
80
|
-
return ele;
|
|
81
|
-
}
|
|
82
|
-
applyStyleOverflowAuto(overflowX = "auto", overflowY = "auto", ele) {
|
|
83
|
-
this.domService.setStyle(ele, "overflow-x", overflowX);
|
|
84
|
-
this.domService.setStyle(ele, "overflow-y", overflowY);
|
|
85
|
-
return ele;
|
|
86
|
-
}
|
|
87
|
-
applyStyleNoPadding(ele) {
|
|
88
|
-
this.domService.setStyle(ele, "padding", "0");
|
|
89
|
-
this.domService.setStyle(ele, "margin", "0");
|
|
90
|
-
this.domService.setStyle(ele, "border", "0");
|
|
91
|
-
return ele;
|
|
92
|
-
}
|
|
93
|
-
appendRelativeChildDiv(parent) {
|
|
94
|
-
const child = this.applyStylePosistionRelative(this.applyStyleFullSize(this.applyStyleNoPadding(this.domService.createElement("div"))));
|
|
95
|
-
this.domService.appendChild(parent, child);
|
|
96
|
-
this.applyStylePosistionAbsolute(parent);
|
|
97
|
-
const cache = {};
|
|
98
|
-
return { parent, child, cache };
|
|
99
|
-
}
|
|
100
|
-
appendText(parent, text) {
|
|
101
|
-
const div = this.domService.createText(text);
|
|
102
|
-
this.domService.appendChild(parent, div);
|
|
103
|
-
return div;
|
|
104
|
-
}
|
|
105
|
-
addClass(clazz, div) {
|
|
106
|
-
if (clazz.includes(" ")) {
|
|
107
|
-
clazz.split(" ").forEach((c) => this.domService.addClass(div, c));
|
|
108
|
-
} else {
|
|
109
|
-
this.domService.addClass(div, clazz);
|
|
110
|
-
}
|
|
111
|
-
return div;
|
|
60
|
+
applyStyle(e, t) {
|
|
61
|
+
for (const s in t)
|
|
62
|
+
this.domService.setStyle(e, s, t[s]);
|
|
63
|
+
return e;
|
|
112
64
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
for (const c of classes) {
|
|
116
|
-
this.domService.addClass(div, c);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return div;
|
|
65
|
+
applyDisplayNoneStyle(e) {
|
|
66
|
+
return this.domService.setStyle(e, "display", "none"), e;
|
|
120
67
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
this.domService.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
this.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
this.domService.
|
|
154
|
-
this.domService.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
this.domService.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
this.domService.
|
|
174
|
-
this.domService.
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
this.domService.setStyle(div, "position", "absolute");
|
|
182
|
-
this.domService.setStyle(div, "left", `${geo.left}px`);
|
|
183
|
-
this.domService.setStyle(div, "top", `${geo.top}px`);
|
|
184
|
-
this.domService.setStyle(div, "width", `${geo.width}px`);
|
|
185
|
-
this.domService.setStyle(div, "height", `${geo.height}px`);
|
|
186
|
-
if (treeArrow && treeArrow !== "none") {
|
|
187
|
-
this.domService.addClass(div, "ge-table-col-tree");
|
|
188
|
-
this.addArrowDiv(div, treeArrow, treeOptions, rowIndex, columnIndex, areaIdent);
|
|
189
|
-
}
|
|
190
|
-
if (checkboxWithoutExtraColumn && columnIndex === 0 && checkedType) {
|
|
191
|
-
this.addCheckboxToDiv(div, checkedType, areaIdent, rowIndex);
|
|
68
|
+
applyDisplayBlockStyle(e) {
|
|
69
|
+
return this.domService.setStyle(e, "display", "block"), e;
|
|
70
|
+
}
|
|
71
|
+
applyStyleInPx(e, t) {
|
|
72
|
+
return Object.entries(t).forEach(([s, i]) => this.domService.setStyle(e, s, i + "px")), e;
|
|
73
|
+
}
|
|
74
|
+
applyStylePosistionRelative(e) {
|
|
75
|
+
return this.domService.setStyle(e, "position", "relative"), this.domService.setStyle(e, "overflow", "clip"), e;
|
|
76
|
+
}
|
|
77
|
+
applyStylePosistionAbsolute(e) {
|
|
78
|
+
return this.domService.setStyle(e, "position", "absolute"), e;
|
|
79
|
+
}
|
|
80
|
+
applyStyleFullSize(e) {
|
|
81
|
+
return this.domService.setStyle(e, "width", "100%"), this.domService.setStyle(e, "height", "100%"), e;
|
|
82
|
+
}
|
|
83
|
+
applyStyleOverflowAuto(e = "auto", t = "auto", s) {
|
|
84
|
+
return this.domService.setStyle(s, "overflow-x", e), this.domService.setStyle(s, "overflow-y", t), s;
|
|
85
|
+
}
|
|
86
|
+
applyStyleNoPadding(e) {
|
|
87
|
+
return this.domService.setStyle(e, "padding", "0"), this.domService.setStyle(e, "margin", "0"), this.domService.setStyle(e, "border", "0"), e;
|
|
88
|
+
}
|
|
89
|
+
appendRelativeChildDiv(e) {
|
|
90
|
+
const t = this.applyStylePosistionRelative(
|
|
91
|
+
this.applyStyleFullSize(
|
|
92
|
+
this.applyStyleNoPadding(
|
|
93
|
+
this.domService.createElement("div")
|
|
94
|
+
)
|
|
95
|
+
)
|
|
96
|
+
);
|
|
97
|
+
return this.domService.appendChild(e, t), this.applyStylePosistionAbsolute(e), { parent: e, child: t, cache: {} };
|
|
98
|
+
}
|
|
99
|
+
appendText(e, t) {
|
|
100
|
+
const s = this.domService.createText(t);
|
|
101
|
+
return this.domService.appendChild(e, s), s;
|
|
102
|
+
}
|
|
103
|
+
addClass(e, t) {
|
|
104
|
+
return e.includes(" ") ? e.split(" ").forEach((s) => this.domService.addClass(t, s)) : this.domService.addClass(t, e), t;
|
|
105
|
+
}
|
|
106
|
+
addClasses(e, t) {
|
|
107
|
+
if (e)
|
|
108
|
+
for (const s of e)
|
|
109
|
+
this.domService.addClass(t, s);
|
|
110
|
+
return t;
|
|
111
|
+
}
|
|
112
|
+
setAttribute(e, t, s) {
|
|
113
|
+
return t && s && this.domService.setAttribute(e, t, s), e;
|
|
114
|
+
}
|
|
115
|
+
createAreaDivWithClass(e, t, s, i) {
|
|
116
|
+
const o = this.domService.createElement("div");
|
|
117
|
+
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;
|
|
118
|
+
}
|
|
119
|
+
createDivWithClass(e, t) {
|
|
120
|
+
const s = this.domService.createElement("div");
|
|
121
|
+
return this.addClass(e, s), this.domService.appendChild(t, s), s;
|
|
122
|
+
}
|
|
123
|
+
addRowDiv(e, t, s = -1, i, o, r = "") {
|
|
124
|
+
const l = t.index ?? -1, n = this.getDivOrCreateDiv(l, e);
|
|
125
|
+
if (this.domService.addClass(n, "ge-table-row-div"), this.domService.addClass(n, `ge-table-row-div-${t.index}`), i === "body" && o === "center") {
|
|
126
|
+
const a = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
127
|
+
this.domService.addClass(n, `ge-table-row-${a}`);
|
|
192
128
|
}
|
|
193
|
-
if (
|
|
194
|
-
const
|
|
195
|
-
this.
|
|
129
|
+
if (this.domService.setStyle(n, "display", "clip"), this.domService.setStyle(n, "position", "absolute"), this.domService.setStyle(n, "left", `${t.left}px`), this.domService.setStyle(n, "top", `${t.top}px`), this.domService.setStyle(n, "width", `${t.width}px`), this.domService.setStyle(n, "height", `${t.height}px`), this.domService.setAttribute(n, "data-row-index", `${s}`), this.domService.setAttribute(n, "data-area", `${i}`), r) {
|
|
130
|
+
const a = this.domService.createText(r);
|
|
131
|
+
this.domService.appendChild(n, a);
|
|
196
132
|
}
|
|
197
|
-
|
|
198
|
-
|
|
133
|
+
return this.domService.appendChild(e.child, n), n;
|
|
134
|
+
}
|
|
135
|
+
addColumnDiv(e, t, s = -1, i = -1, o, r, l = "", n, a, d = void 0, S) {
|
|
136
|
+
const g = a == null ? void 0 : a.treeOptions, f = a == null ? void 0 : a.showCheckboxWihoutExtraColumn, c = this.domService.createElement("div");
|
|
137
|
+
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}`);
|
|
138
|
+
const b = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
139
|
+
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`), n && n !== "none" && (this.domService.addClass(c, "ge-table-col-tree"), this.addArrowDiv(c, n, g, s, i, o)), f && i === 0 && d && this.addCheckboxToDiv(c, d, o, s), l) {
|
|
140
|
+
const p = n !== "none" && i === 0;
|
|
141
|
+
this.addLabelDiv(c, l, p, s, i, o);
|
|
199
142
|
}
|
|
200
|
-
this.domService.appendChild(
|
|
201
|
-
return div;
|
|
143
|
+
return S && this.addSortedIcon(c, S, a == null ? void 0 : a.sortedOptions, i), this.domService.appendChild(e, c), c;
|
|
202
144
|
}
|
|
203
|
-
addCheckboxToDiv(
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
div.innerHTML = `
|
|
145
|
+
addCheckboxToDiv(e, t, s, i) {
|
|
146
|
+
const o = this.domService.createElement("div"), r = t === "full" ? "checked" : "";
|
|
147
|
+
return o.innerHTML = `
|
|
207
148
|
<input
|
|
208
149
|
type="checkbox"
|
|
209
|
-
data-area="${
|
|
210
|
-
data-row-index="${
|
|
150
|
+
data-area="${s}"
|
|
151
|
+
data-row-index="${i}"
|
|
211
152
|
data-input-type="checkbox"
|
|
212
|
-
${
|
|
213
|
-
class="ge-table-row-checkbox">
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
this.domService.
|
|
217
|
-
this.domService.
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
const div = this.domService.createElement("div");
|
|
222
|
-
this.domService.addClass(div, "ge-table-label-div");
|
|
223
|
-
this.domService.setStyle(div, "position", "relative");
|
|
224
|
-
this.domService.setStyle(div, "background", "transparent");
|
|
225
|
-
this.domService.setStyle(div, "width", "100%");
|
|
226
|
-
this.domService.setStyle(div, "height", "100%");
|
|
227
|
-
this.domService.setAttribute(div, "data-row-index", `${rowIndex}`);
|
|
228
|
-
this.domService.setAttribute(div, "data-col-index", `${columnIndex}`);
|
|
229
|
-
this.domService.setAttribute(div, "data-area", `${areaIdent}`);
|
|
230
|
-
if (text) {
|
|
231
|
-
if (firstTreeColumn) {
|
|
232
|
-
const textElement = this.domService.createText(text);
|
|
233
|
-
this.domService.appendChild(div, textElement);
|
|
153
|
+
${r}
|
|
154
|
+
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;
|
|
155
|
+
}
|
|
156
|
+
addLabelDiv(e, t = "", s = !1, i = -1, o = -1, r = "body") {
|
|
157
|
+
const l = this.domService.createElement("div");
|
|
158
|
+
if (this.domService.addClass(l, "ge-table-label-div"), this.domService.setStyle(l, "position", "relative"), this.domService.setStyle(l, "background", "transparent"), this.domService.setStyle(l, "width", "100%"), this.domService.setStyle(l, "height", "100%"), this.domService.setAttribute(l, "data-row-index", `${i}`), this.domService.setAttribute(l, "data-col-index", `${o}`), this.domService.setAttribute(l, "data-area", `${r}`), t)
|
|
159
|
+
if (s) {
|
|
160
|
+
const n = this.domService.createText(t);
|
|
161
|
+
this.domService.appendChild(l, n);
|
|
234
162
|
} else {
|
|
235
|
-
const
|
|
236
|
-
this.domService.appendChild(
|
|
237
|
-
const
|
|
238
|
-
this.domService.addClass(
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
this.domService.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
this.domService.
|
|
255
|
-
this.domService.
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
this.domService.
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
this.
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
this.domService.
|
|
277
|
-
return
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
this.domService.addClass(div, "ge-table-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
this.domService.
|
|
285
|
-
this.domService.setStyle(
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
this.domService.
|
|
289
|
-
this.domService.
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
this.domService.
|
|
301
|
-
if (treeOptionsArrow.style) {
|
|
302
|
-
this.applyStyleString(div, treeOptionsArrow.style);
|
|
303
|
-
}
|
|
304
|
-
for (const clazz of treeOptionsArrow.classes) {
|
|
305
|
-
this.domService.addClass(div, clazz);
|
|
306
|
-
}
|
|
307
|
-
this.domService.appendChild(parent, div);
|
|
308
|
-
return div;
|
|
309
|
-
}
|
|
310
|
-
addColumnBorderDivs(tableOptions, parent, geo, areaIdent, sideIdent) {
|
|
311
|
-
if (tableOptions.verticalBorderVisible) {
|
|
312
|
-
const clazz = `ge-table-${areaIdent}-${sideIdent}-vertical-border`;
|
|
313
|
-
this.addVerticalBorder(geo, parent, clazz);
|
|
314
|
-
}
|
|
315
|
-
if (tableOptions.horizontalBorderVisible) {
|
|
316
|
-
const clazz = `ge-table-${areaIdent}-${sideIdent}-horizontal-border`;
|
|
317
|
-
this.addHorizontalBorder(geo, parent, clazz);
|
|
318
|
-
}
|
|
319
|
-
return parent;
|
|
320
|
-
}
|
|
321
|
-
addHorizontalBorder(geo, parent, clazz = "ge-table-body-center-horizontal-border") {
|
|
322
|
-
const div = this.domService.createElement("div");
|
|
323
|
-
this.domService.addClass(div, clazz);
|
|
324
|
-
this.domService.setStyle(div, "display", "clip");
|
|
325
|
-
this.domService.setStyle(div, "position", "absolute");
|
|
326
|
-
this.domService.setStyle(div, "left", `${geo.left}px`);
|
|
327
|
-
this.domService.setStyle(div, "top", `${geo.top}px`);
|
|
328
|
-
this.domService.setStyle(div, "width", `${geo.width}px`);
|
|
329
|
-
this.domService.setStyle(div, "height", `1px`);
|
|
330
|
-
this.domService.appendChild(parent, div);
|
|
331
|
-
return div;
|
|
332
|
-
}
|
|
333
|
-
addFocusBorderDivs(parent, geo, style) {
|
|
334
|
-
let div = this.domService.createElement("div");
|
|
335
|
-
this.domService.addClass(div, "ge-table-focus-border");
|
|
336
|
-
this.domService.setStyle(div, "display", "clip");
|
|
337
|
-
this.domService.setStyle(div, "position", "absolute");
|
|
338
|
-
this.domService.setStyle(div, "left", `${geo.left}px`);
|
|
339
|
-
this.domService.setStyle(div, "top", `${geo.top}px`);
|
|
340
|
-
this.domService.setStyle(div, "width", `1px`);
|
|
341
|
-
this.domService.setStyle(div, "height", `${geo.height}px`);
|
|
342
|
-
this.applyStyle(div, style);
|
|
343
|
-
this.domService.appendChild(parent, div);
|
|
344
|
-
div = this.domService.createElement("div");
|
|
345
|
-
this.domService.addClass(div, "ge-table-focus-border");
|
|
346
|
-
this.domService.setStyle(div, "display", "clip");
|
|
347
|
-
this.domService.setStyle(div, "position", "absolute");
|
|
348
|
-
this.domService.setStyle(div, "left", `${geo.left + geo.width - 1}px`);
|
|
349
|
-
this.domService.setStyle(div, "top", `${geo.top}px`);
|
|
350
|
-
this.domService.setStyle(div, "width", `1px`);
|
|
351
|
-
this.domService.setStyle(div, "height", `${geo.height}px`);
|
|
352
|
-
this.applyStyle(div, style);
|
|
353
|
-
this.domService.appendChild(parent, div);
|
|
354
|
-
div = this.domService.createElement("div");
|
|
355
|
-
this.domService.addClass(div, "ge-table-focus-border");
|
|
356
|
-
this.domService.setStyle(div, "display", "clip");
|
|
357
|
-
this.domService.setStyle(div, "position", "absolute");
|
|
358
|
-
this.domService.setStyle(div, "left", `${geo.left}px`);
|
|
359
|
-
this.domService.setStyle(div, "top", `${geo.top}px`);
|
|
360
|
-
this.domService.setStyle(div, "width", `${geo.width}px`);
|
|
361
|
-
this.domService.setStyle(div, "height", `1px`);
|
|
362
|
-
this.applyStyle(div, style);
|
|
363
|
-
this.domService.appendChild(parent, div);
|
|
364
|
-
div = this.domService.createElement("div");
|
|
365
|
-
this.domService.addClass(div, "ge-table-focus-border");
|
|
366
|
-
this.domService.setStyle(div, "display", "clip");
|
|
367
|
-
this.domService.setStyle(div, "position", "absolute");
|
|
368
|
-
this.domService.setStyle(div, "left", `${geo.left}px`);
|
|
369
|
-
this.domService.setStyle(div, "top", `${geo.top + geo.height - 1}px`);
|
|
370
|
-
this.domService.setStyle(div, "width", `${geo.width}px`);
|
|
371
|
-
this.domService.setStyle(div, "height", `1px`);
|
|
372
|
-
this.applyStyle(div, style);
|
|
373
|
-
this.domService.appendChild(parent, div);
|
|
374
|
-
return parent;
|
|
375
|
-
}
|
|
376
|
-
addVerticalBorder(geo, parent, clazz = "ge-table-body-center-vertical-border") {
|
|
377
|
-
const div = this.domService.createElement("div");
|
|
378
|
-
this.domService.addClass(div, clazz);
|
|
379
|
-
this.domService.setStyle(div, "display", "clip");
|
|
380
|
-
this.domService.setStyle(div, "position", "absolute");
|
|
381
|
-
this.domService.setStyle(div, "left", `${geo.left}px`);
|
|
382
|
-
this.domService.setStyle(div, "top", `${geo.top}px`);
|
|
383
|
-
this.domService.setStyle(div, "width", `1px`);
|
|
384
|
-
this.domService.setStyle(div, "height", `${geo.height}px`);
|
|
385
|
-
this.domService.appendChild(parent, div);
|
|
386
|
-
return div;
|
|
387
|
-
}
|
|
388
|
-
addDiv(parent, geo, clazz = "") {
|
|
389
|
-
const div = this.domService.createElement("div");
|
|
390
|
-
if (clazz) {
|
|
391
|
-
this.domService.addClass(div, clazz);
|
|
392
|
-
}
|
|
393
|
-
this.domService.setStyle(div, "display", "clip");
|
|
394
|
-
this.domService.setStyle(div, "position", "absolute");
|
|
395
|
-
this.domService.setStyle(div, "left", `${geo.left}px`);
|
|
396
|
-
this.domService.setStyle(div, "top", `${geo.top}px`);
|
|
397
|
-
this.domService.setStyle(div, "width", `${geo.width}px`);
|
|
398
|
-
this.domService.setStyle(div, "height", `${geo.height}px`);
|
|
399
|
-
this.domService.appendChild(parent, div);
|
|
400
|
-
return div;
|
|
401
|
-
}
|
|
402
|
-
applyStyleString(div, style) {
|
|
403
|
-
const cmds = style.split(";").map((s) => s.trim()).filter((s) => s);
|
|
404
|
-
for (const cmd of cmds) {
|
|
405
|
-
const [key, value] = cmd.split(":");
|
|
406
|
-
this.domService.setStyle(div, key.trim(), value.trim());
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
getDivOrCreateDiv(cacheKey, divScope) {
|
|
410
|
-
let div = divScope.cache[cacheKey];
|
|
411
|
-
if (div) {
|
|
412
|
-
div.innerText = "";
|
|
413
|
-
return div;
|
|
414
|
-
}
|
|
415
|
-
div = this.domService.createElement("div");
|
|
416
|
-
divScope.cache[cacheKey] = div;
|
|
417
|
-
return div;
|
|
163
|
+
const n = this.domService.createElement("div");
|
|
164
|
+
this.domService.appendChild(l, n);
|
|
165
|
+
const a = this.domService.createText(t);
|
|
166
|
+
this.domService.addClass(n, "ge-table-label"), this.domService.appendChild(n, a), this.domService.setAttribute(n, "data-row-index", `${i}`), this.domService.setAttribute(n, "data-col-index", `${o}`), this.domService.setAttribute(n, "data-area", `${r}`);
|
|
167
|
+
}
|
|
168
|
+
return this.domService.appendChild(e, l), l;
|
|
169
|
+
}
|
|
170
|
+
addSortedIcon(e, t = "", s = new W(), i = -1) {
|
|
171
|
+
const o = this.domService.createElement("div");
|
|
172
|
+
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");
|
|
173
|
+
let r;
|
|
174
|
+
t === "asc" ? r = s.iconAsc : t === "desc" ? r = s.iconDesc : r = s.iconPlaceholder;
|
|
175
|
+
const l = r.content, n = this.domService.createText(l);
|
|
176
|
+
this.domService.appendChild(o, n), r.style && this.applyStyleString(o, r.style);
|
|
177
|
+
for (const a of r.classes)
|
|
178
|
+
this.domService.addClass(o, a);
|
|
179
|
+
return this.domService.appendChild(e, o), o;
|
|
180
|
+
}
|
|
181
|
+
addArrowDiv(e, t = "none", s = new H(), i = -1, o = -1, r = "body") {
|
|
182
|
+
const l = this.domService.createElement("div");
|
|
183
|
+
this.domService.addClass(l, "ge-table-tree-arrow-div"), this.domService.setStyle(l, "display", "inline-block"), this.domService.setStyle(l, "position", ""), this.domService.setStyle(l, "width", "20px"), this.domService.setStyle(l, "background", "transparent"), this.domService.setStyle(l, "cursor", "pointer"), this.domService.setAttribute(l, "data-row-index", `${i}`), this.domService.setAttribute(l, "data-col-index", `${o}`), this.domService.setAttribute(l, "data-area", `${r}`);
|
|
184
|
+
let n;
|
|
185
|
+
t === "expanded" ? n = s.arrowExpanded : t === "collapsed" ? n = s.arrowCollapsed : n = s.arrowPlaceholder;
|
|
186
|
+
const a = n.content, d = this.domService.createText(a);
|
|
187
|
+
this.domService.appendChild(l, d), n.style && this.applyStyleString(l, n.style);
|
|
188
|
+
for (const S of n.classes)
|
|
189
|
+
this.domService.addClass(l, S);
|
|
190
|
+
return this.domService.appendChild(e, l), l;
|
|
191
|
+
}
|
|
192
|
+
addColumnBorderDivs(e, t, s, i, o) {
|
|
193
|
+
if (e.verticalBorderVisible) {
|
|
194
|
+
const r = `ge-table-${i}-${o}-vertical-border`;
|
|
195
|
+
this.addVerticalBorder(s, t, r);
|
|
196
|
+
}
|
|
197
|
+
if (e.horizontalBorderVisible) {
|
|
198
|
+
const r = `ge-table-${i}-${o}-horizontal-border`;
|
|
199
|
+
this.addHorizontalBorder(s, t, r);
|
|
200
|
+
}
|
|
201
|
+
return t;
|
|
202
|
+
}
|
|
203
|
+
addHorizontalBorder(e, t, s = "ge-table-body-center-horizontal-border") {
|
|
204
|
+
const i = this.domService.createElement("div");
|
|
205
|
+
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;
|
|
206
|
+
}
|
|
207
|
+
addFocusBorderDivs(e, t, s) {
|
|
208
|
+
let i = this.domService.createElement("div");
|
|
209
|
+
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;
|
|
210
|
+
}
|
|
211
|
+
addVerticalBorder(e, t, s = "ge-table-body-center-vertical-border") {
|
|
212
|
+
const i = this.domService.createElement("div");
|
|
213
|
+
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;
|
|
214
|
+
}
|
|
215
|
+
addDiv(e, t, s = "") {
|
|
216
|
+
const i = this.domService.createElement("div");
|
|
217
|
+
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;
|
|
218
|
+
}
|
|
219
|
+
applyStyleString(e, t) {
|
|
220
|
+
const s = t.split(";").map((i) => i.trim()).filter((i) => i);
|
|
221
|
+
for (const i of s) {
|
|
222
|
+
const [o, r] = i.split(":");
|
|
223
|
+
this.domService.setStyle(e, o.trim(), r.trim());
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
getDivOrCreateDiv(e, t) {
|
|
227
|
+
let s = t.cache[e];
|
|
228
|
+
return s ? (s.innerText = "", s) : (s = this.domService.createElement("div"), t.cache[e] = s, s);
|
|
418
229
|
}
|
|
419
230
|
}
|
|
420
|
-
class
|
|
421
|
-
constructor(
|
|
422
|
-
this.data =
|
|
423
|
-
this.expanded = expanded;
|
|
424
|
-
this.children = children;
|
|
425
|
-
this.parent = parent;
|
|
426
|
-
this.deep = deep;
|
|
427
|
-
this.checked = checked;
|
|
428
|
-
this.keep = keep;
|
|
231
|
+
class O {
|
|
232
|
+
constructor(e, t = !0, s, i, o = 0, r = !1, l = !1) {
|
|
233
|
+
this.data = e, this.expanded = t, this.children = s, this.parent = i, this.deep = o, this.checked = r, this.keep = l;
|
|
429
234
|
}
|
|
430
235
|
}
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
class MouseTargetData {
|
|
441
|
-
constructor(eventTarget, tableScope) {
|
|
442
|
-
this.rowIdx = -1;
|
|
443
|
-
this.colIdx = -1;
|
|
444
|
-
this.action = null;
|
|
445
|
-
this.inputType = null;
|
|
446
|
-
this.className = "";
|
|
447
|
-
if (eventTarget === null)
|
|
448
|
-
return;
|
|
449
|
-
if (eventTarget instanceof HTMLDivElement || eventTarget instanceof HTMLSpanElement || eventTarget instanceof HTMLInputElement) {
|
|
450
|
-
this.className = eventTarget.className;
|
|
451
|
-
this.action = eventTarget.getAttribute("data-ge-action");
|
|
452
|
-
this.inputType = eventTarget.getAttribute("data-input-type");
|
|
453
|
-
this.rowIdx = Number(eventTarget.getAttribute("data-row-index"));
|
|
454
|
-
this.colIdx = Number(eventTarget.getAttribute("data-col-index"));
|
|
455
|
-
const area = eventTarget.getAttribute("data-area");
|
|
456
|
-
if (area) {
|
|
457
|
-
this.areaIdent = getAreaIdentByString(area);
|
|
458
|
-
this.areaModel = tableScope.tableModel.getAreaModel(this.areaIdent);
|
|
459
|
-
this.row = this.areaModel.getRowByIndex(this.rowIdx);
|
|
460
|
-
}
|
|
461
|
-
if (eventTarget instanceof HTMLInputElement) {
|
|
462
|
-
const target = eventTarget;
|
|
463
|
-
this.value = target.value;
|
|
236
|
+
const $ = (h) => h === "header" ? "header" : h === "footer" ? "footer" : "body";
|
|
237
|
+
class q {
|
|
238
|
+
constructor(e, t) {
|
|
239
|
+
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)) {
|
|
240
|
+
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"));
|
|
241
|
+
const s = e.getAttribute("data-area");
|
|
242
|
+
if (s && (this.areaIdent = $(s), this.areaModel = t.tableModel.getAreaModel(this.areaIdent), this.row = this.areaModel.getRowByIndex(this.rowIdx)), e instanceof HTMLInputElement) {
|
|
243
|
+
const i = e;
|
|
244
|
+
this.value = i.value;
|
|
464
245
|
}
|
|
465
246
|
}
|
|
466
247
|
}
|
|
467
248
|
}
|
|
468
|
-
class
|
|
469
|
-
constructor(
|
|
470
|
-
this.tableScope = tableScope
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
this.
|
|
476
|
-
this.tableScope.
|
|
477
|
-
this.tableScope.
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
this.tableScope
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
const
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
if (
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
mouseTargetData.areaModel.recalcVisibleTreeRows();
|
|
249
|
+
class U {
|
|
250
|
+
constructor(e) {
|
|
251
|
+
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(
|
|
252
|
+
(t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
onContextmenu(e) {
|
|
256
|
+
this.mouseEvent = e;
|
|
257
|
+
const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
|
|
258
|
+
this.tableScope.contextmenu(t);
|
|
259
|
+
}
|
|
260
|
+
onHostElementClicked(e) {
|
|
261
|
+
const t = new q(e.target, this.tableScope);
|
|
262
|
+
if (t.action === "toggleExpandCollapseAll")
|
|
263
|
+
this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
|
|
264
|
+
else if (t.inputType === "checkbox" && t.areaIdent)
|
|
265
|
+
this.tableScope.toggleRowCheckbox(t.rowIdx, t.colIdx, t.areaIdent), e.preventDefault(), e.stopPropagation();
|
|
266
|
+
else if (t.row instanceof O && t.areaModel) {
|
|
267
|
+
const s = t.colIdx === this.getArrowColumnIndex() && e.altKey, i = t.className.includes("ge-table-tree-arrow-div");
|
|
268
|
+
if (console.info(i, s), s || i) {
|
|
269
|
+
e.preventDefault(), e.stopPropagation();
|
|
270
|
+
const o = t.row;
|
|
271
|
+
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);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (t.areaIdent === "body" && this.tableScope.tableOptions.getFocusModel) {
|
|
275
|
+
const s = this.tableScope.tableOptions.getFocusModel();
|
|
276
|
+
s == null || s.clear(), s == null || s.setFocus(t.rowIdx, t.colIdx);
|
|
277
|
+
}
|
|
278
|
+
this.publishGeMouseEvent(e, 1);
|
|
279
|
+
}
|
|
280
|
+
onHostElementDblClicked(e) {
|
|
281
|
+
if (e.target instanceof HTMLElement) {
|
|
282
|
+
const t = e.target, s = t.getAttribute("data-area"), i = $(s), o = Number(t.getAttribute("data-row-index")), r = Number(t.getAttribute("data-col-index")), l = this.tableScope.tableModel.getAreaModel(i);
|
|
283
|
+
if (s && i === "header")
|
|
284
|
+
this.tableScope.tableModel.isSortable(r) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, o, r));
|
|
285
|
+
else if (t.getAttribute("data-row-index")) {
|
|
286
|
+
const n = l.getRowByIndex(o);
|
|
287
|
+
if (s && i === "body" && l.isEditable(o, r) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, r)), n instanceof O && r === this.getArrowColumnIndex()) {
|
|
288
|
+
e.preventDefault(), e.stopPropagation();
|
|
289
|
+
const a = n;
|
|
290
|
+
a.expanded = !a.expanded, "recalcVisibleTreeRows" in l && l.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(a);
|
|
511
291
|
}
|
|
512
|
-
this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth);
|
|
513
|
-
this.tableScope.adjustContainersAndRows();
|
|
514
|
-
this.updateCollapsedExpandedState(tr);
|
|
515
292
|
}
|
|
516
293
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
const rowIdx = Number(target.getAttribute("data-row-index"));
|
|
530
|
-
const colIdx = Number(target.getAttribute("data-col-index"));
|
|
531
|
-
const areaModel = this.tableScope.tableModel.getAreaModel(areaIdent);
|
|
532
|
-
if (area && areaIdent === "header") {
|
|
533
|
-
if (this.tableScope.tableModel.isSortable(colIdx)) {
|
|
534
|
-
this.tableScope.clearSelection();
|
|
535
|
-
this.tableScope.onHeaderDblClicked(event, rowIdx, colIdx);
|
|
536
|
-
}
|
|
537
|
-
} else if (target.getAttribute("data-row-index")) {
|
|
538
|
-
const row = areaModel.getRowByIndex(rowIdx);
|
|
539
|
-
if (area && areaIdent === "body") {
|
|
540
|
-
if (areaModel.isEditable(rowIdx, colIdx)) {
|
|
541
|
-
this.tableScope.clearSelection();
|
|
542
|
-
this.tableScope.initRenderEditor(rowIdx, colIdx);
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
if (row instanceof TreeRow) {
|
|
546
|
-
if (colIdx === this.getArrowColumnIndex()) {
|
|
547
|
-
event.preventDefault();
|
|
548
|
-
event.stopPropagation();
|
|
549
|
-
const tr = row;
|
|
550
|
-
tr.expanded = !tr.expanded;
|
|
551
|
-
if ("recalcVisibleTreeRows" in areaModel) {
|
|
552
|
-
areaModel.recalcVisibleTreeRows();
|
|
553
|
-
}
|
|
554
|
-
this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth);
|
|
555
|
-
this.tableScope.adjustContainersAndRows();
|
|
556
|
-
this.updateCollapsedExpandedState(tr);
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
this.publishGeMouseEvent(event, 2);
|
|
562
|
-
}
|
|
563
|
-
publishGeMouseEvent(event, clickCount) {
|
|
564
|
-
var _a;
|
|
565
|
-
this.mouseEvent = event;
|
|
566
|
-
this.geMouseEventOld = (_a = this.geMouseEvent) === null || _a === void 0 ? void 0 : _a.clone();
|
|
567
|
-
this.geMouseEvent = this.tableScope.createGeMouseEvent(event);
|
|
568
|
-
if (this.geMouseEvent) {
|
|
569
|
-
this.geMouseEvent.clickCount = clickCount;
|
|
570
|
-
}
|
|
571
|
-
this.tableScope.onMouseClicked(this.geMouseEvent, this.geMouseEventOld);
|
|
572
|
-
}
|
|
573
|
-
updateCollapsedExpandedState(tr) {
|
|
574
|
-
var _a, _b, _c, _d, _e;
|
|
575
|
-
const getRowId = (_b = (_a = this.tableScope.tableOptions) === null || _a === void 0 ? void 0 : _a.autoRestoreOptions) === null || _b === void 0 ? void 0 : _b.getRowId;
|
|
576
|
-
if (getRowId) {
|
|
577
|
-
const mode = (_c = this.tableScope.storeStateCollapsedExpandService) === null || _c === void 0 ? void 0 : _c.collapsedExpandedStateGet().mode;
|
|
578
|
-
const push = mode === "collapsed" && !tr.expanded || mode === "expanded" && tr.expanded;
|
|
579
|
-
const remove = mode === "collapsed" && tr.expanded || mode === "expanded" && !tr.expanded;
|
|
580
|
-
const rowId = getRowId(tr.data);
|
|
581
|
-
if (push) {
|
|
582
|
-
(_d = this.tableScope.storeStateCollapsedExpandService) === null || _d === void 0 ? void 0 : _d.collapsedStateIdsPush(rowId);
|
|
583
|
-
} else if (remove) {
|
|
584
|
-
(_e = this.tableScope.storeStateCollapsedExpandService) === null || _e === void 0 ? void 0 : _e.collapsedStateIdsRemove(rowId);
|
|
585
|
-
}
|
|
294
|
+
this.publishGeMouseEvent(e, 2);
|
|
295
|
+
}
|
|
296
|
+
publishGeMouseEvent(e, t) {
|
|
297
|
+
var s;
|
|
298
|
+
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);
|
|
299
|
+
}
|
|
300
|
+
updateCollapsedExpandedState(e) {
|
|
301
|
+
var s, i, o, r, l;
|
|
302
|
+
const t = (i = (s = this.tableScope.tableOptions) == null ? void 0 : s.autoRestoreOptions) == null ? void 0 : i.getRowId;
|
|
303
|
+
if (t) {
|
|
304
|
+
const n = (o = this.tableScope.storeStateCollapsedExpandService) == null ? void 0 : o.collapsedExpandedStateGet().mode, a = n === "collapsed" && !e.expanded || n === "expanded" && e.expanded, d = n === "collapsed" && e.expanded || n === "expanded" && !e.expanded, S = t(e.data);
|
|
305
|
+
a ? (r = this.tableScope.storeStateCollapsedExpandService) == null || r.collapsedStateIdsPush(S) : d && ((l = this.tableScope.storeStateCollapsedExpandService) == null || l.collapsedStateIdsRemove(S));
|
|
586
306
|
}
|
|
587
307
|
}
|
|
588
308
|
getArrowColumnIndex() {
|
|
589
|
-
|
|
590
|
-
return rowCheckboxVisible ? 1 : 0;
|
|
591
|
-
}
|
|
592
|
-
onMouseDown(evt) {
|
|
593
|
-
this.mouseEvent = evt;
|
|
594
|
-
this.startMouseEvent = this.tableScope.createGeMouseEvent(this.mouseEvent);
|
|
595
|
-
this.tableScope.onMouseDown(this.startMouseEvent);
|
|
596
|
-
this.mouseDown = true;
|
|
597
|
-
}
|
|
598
|
-
onMouseMove(evt) {
|
|
599
|
-
this.mouseEvent = evt;
|
|
600
|
-
if (this.mouseDown) {
|
|
601
|
-
this.dragging = true;
|
|
602
|
-
requestAnimationFrame(this.mouseDraggingOnFrame.bind(this));
|
|
603
|
-
} else {
|
|
604
|
-
requestAnimationFrame(this.mouseMoveOnFrame.bind(this));
|
|
605
|
-
}
|
|
309
|
+
return this.tableScope.tableModel.isRowCheckboxVisible() ? 1 : 0;
|
|
606
310
|
}
|
|
607
|
-
|
|
608
|
-
this.mouseEvent =
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
311
|
+
onMouseDown(e) {
|
|
312
|
+
this.mouseEvent = e, this.startMouseEvent = this.tableScope.createGeMouseEvent(this.mouseEvent), this.tableScope.onMouseDown(this.startMouseEvent), this.mouseDown = !0;
|
|
313
|
+
}
|
|
314
|
+
onMouseMove(e) {
|
|
315
|
+
this.mouseEvent = e, this.mouseDown ? (this.dragging = !0, requestAnimationFrame(this.mouseDraggingOnFrame.bind(this))) : requestAnimationFrame(this.mouseMoveOnFrame.bind(this));
|
|
316
|
+
}
|
|
317
|
+
onMouseUp(e) {
|
|
318
|
+
this.mouseEvent = e, this.dragging && requestAnimationFrame(this.mouseDraggingEndOnFrame.bind(this)), this.mouseDown = !1, this.dragging = !1;
|
|
614
319
|
}
|
|
615
320
|
mouseDraggingOnFrame() {
|
|
616
|
-
var
|
|
321
|
+
var e;
|
|
617
322
|
if (this.mouseEvent) {
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
mouseEvent.draggingX = this.mouseEvent.clientX - this.startMouseEvent.originalEvent.clientX;
|
|
621
|
-
mouseEvent.draggingY = this.mouseEvent.clientY - this.startMouseEvent.originalEvent.clientY;
|
|
622
|
-
}
|
|
623
|
-
this.tableScope.mouseDraggingOnFrame(mouseEvent);
|
|
323
|
+
const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
|
|
324
|
+
(e = this.startMouseEvent) != null && e.originalEvent && (t.draggingX = this.mouseEvent.clientX - this.startMouseEvent.originalEvent.clientX, t.draggingY = this.mouseEvent.clientY - this.startMouseEvent.originalEvent.clientY), this.tableScope.mouseDraggingOnFrame(t);
|
|
624
325
|
}
|
|
625
326
|
}
|
|
626
327
|
mouseDraggingEndOnFrame() {
|
|
627
|
-
var
|
|
328
|
+
var e;
|
|
628
329
|
if (this.mouseEvent) {
|
|
629
|
-
const
|
|
630
|
-
|
|
631
|
-
mouseEvent.draggingX = this.mouseEvent.clientX - this.startMouseEvent.originalEvent.clientX;
|
|
632
|
-
mouseEvent.draggingY = this.mouseEvent.clientY - this.startMouseEvent.originalEvent.clientY;
|
|
633
|
-
}
|
|
634
|
-
this.tableScope.mouseDraggingEndOnFrame(mouseEvent);
|
|
330
|
+
const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
|
|
331
|
+
(e = this.startMouseEvent) != null && e.originalEvent && (t.draggingX = this.mouseEvent.clientX - this.startMouseEvent.originalEvent.clientX, t.draggingY = this.mouseEvent.clientY - this.startMouseEvent.originalEvent.clientY), this.tableScope.mouseDraggingEndOnFrame(t);
|
|
635
332
|
}
|
|
636
333
|
}
|
|
637
334
|
mouseMoveOnFrame() {
|
|
638
335
|
if (this.mouseEvent) {
|
|
639
|
-
const
|
|
640
|
-
this.tableScope.mouseMove(
|
|
336
|
+
const e = this.tableScope.createGeMouseEvent(this.mouseEvent);
|
|
337
|
+
this.tableScope.mouseMove(e);
|
|
641
338
|
}
|
|
642
339
|
}
|
|
643
340
|
}
|
|
644
|
-
class
|
|
645
|
-
constructor(
|
|
646
|
-
this.tableScope =
|
|
341
|
+
class J {
|
|
342
|
+
constructor(e) {
|
|
343
|
+
this.tableScope = e;
|
|
647
344
|
}
|
|
648
|
-
updateCells(
|
|
649
|
-
this.tableScope.updateCells(
|
|
345
|
+
updateCells(e) {
|
|
346
|
+
this.tableScope.updateCells(e);
|
|
650
347
|
}
|
|
651
348
|
externalFilterChanged() {
|
|
652
349
|
this.tableScope.externalFilterChanged();
|
|
653
350
|
}
|
|
654
|
-
scrollToPixel(
|
|
351
|
+
scrollToPixel(e = 0, t = 0) {
|
|
655
352
|
}
|
|
656
|
-
scrollToIndex(
|
|
353
|
+
scrollToIndex(e = 0, t = 0) {
|
|
657
354
|
}
|
|
658
|
-
setHeaderVisible(
|
|
355
|
+
setHeaderVisible(e = !0) {
|
|
659
356
|
}
|
|
660
|
-
setColumnVisible(
|
|
357
|
+
setColumnVisible(e, t = !0) {
|
|
661
358
|
}
|
|
662
|
-
isColumnVisible(
|
|
663
|
-
return
|
|
359
|
+
isColumnVisible(e) {
|
|
360
|
+
return !0;
|
|
664
361
|
}
|
|
665
362
|
isHeaderVisible() {
|
|
666
|
-
return
|
|
363
|
+
return !0;
|
|
667
364
|
}
|
|
668
|
-
setFooterVisible(
|
|
365
|
+
setFooterVisible(e = !0) {
|
|
669
366
|
}
|
|
670
367
|
isFooterVisible() {
|
|
671
|
-
return
|
|
368
|
+
return !0;
|
|
672
369
|
}
|
|
673
370
|
repaint() {
|
|
674
371
|
this.tableScope.repaint();
|
|
675
372
|
}
|
|
676
373
|
}
|
|
677
|
-
class
|
|
678
|
-
flattenTree(
|
|
679
|
-
var
|
|
680
|
-
for (const
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
}
|
|
684
|
-
if ((_a = row.children) === null || _a === void 0 ? void 0 : _a.length) {
|
|
685
|
-
this.flattenTree(row.children, ret);
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
return ret;
|
|
374
|
+
class Q {
|
|
375
|
+
flattenTree(e, t = []) {
|
|
376
|
+
var s;
|
|
377
|
+
for (const i of e)
|
|
378
|
+
this.isVisible(i) && t.push(i), (s = i.children) != null && s.length && this.flattenTree(i.children, t);
|
|
379
|
+
return t;
|
|
689
380
|
}
|
|
690
|
-
isVisible(
|
|
691
|
-
|
|
692
|
-
return true;
|
|
693
|
-
}
|
|
694
|
-
if (!row.parent.expanded) {
|
|
695
|
-
return false;
|
|
696
|
-
}
|
|
697
|
-
return this.isVisible(row.parent);
|
|
381
|
+
isVisible(e) {
|
|
382
|
+
return e.parent ? e.parent.expanded ? this.isVisible(e.parent) : !1 : !0;
|
|
698
383
|
}
|
|
699
384
|
}
|
|
700
|
-
class
|
|
701
|
-
constructor(
|
|
702
|
-
this.areaIdent =
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
this.rowSelectionModel = void 0;
|
|
706
|
-
this.yPositions = [];
|
|
707
|
-
this.cellRenderers = columnDefs.map((def) => def.rendererMap[areaIdent]);
|
|
708
|
-
}
|
|
709
|
-
getTooltipAt(_rowIndex, _columnIndex) {
|
|
385
|
+
class Z {
|
|
386
|
+
constructor(e, t = [], s = -1) {
|
|
387
|
+
this.areaIdent = e, this.columnDefs = t, this.defaultRowHeight = s, this.rowSelectionModel = void 0, this.yPositions = [], this.cellRenderers = t.map((i) => i.rendererMap[e]);
|
|
388
|
+
}
|
|
389
|
+
getTooltipAt(e, t) {
|
|
710
390
|
return "";
|
|
711
391
|
}
|
|
712
|
-
getCellRenderer(
|
|
713
|
-
if (
|
|
714
|
-
return this.cellRenderers[
|
|
715
|
-
}
|
|
716
|
-
return void 0;
|
|
392
|
+
getCellRenderer(e, t) {
|
|
393
|
+
if (t < this.cellRenderers.length)
|
|
394
|
+
return this.cellRenderers[t];
|
|
717
395
|
}
|
|
718
|
-
getColspanAt(
|
|
396
|
+
getColspanAt(e, t) {
|
|
719
397
|
return 0;
|
|
720
398
|
}
|
|
721
|
-
getCustomClassesAt(
|
|
399
|
+
getCustomClassesAt(e, t) {
|
|
722
400
|
return [];
|
|
723
401
|
}
|
|
724
|
-
getCustomStyleAt(
|
|
725
|
-
return void 0;
|
|
402
|
+
getCustomStyleAt(e, t) {
|
|
726
403
|
}
|
|
727
|
-
getRowspanAt(
|
|
404
|
+
getRowspanAt(e, t) {
|
|
728
405
|
return 0;
|
|
729
406
|
}
|
|
730
|
-
getRowByIndex(
|
|
731
|
-
return void 0;
|
|
407
|
+
getRowByIndex(e) {
|
|
732
408
|
}
|
|
733
|
-
isRowCheckable(
|
|
734
|
-
return
|
|
409
|
+
isRowCheckable(e) {
|
|
410
|
+
return !0;
|
|
735
411
|
}
|
|
736
|
-
isRowChecked(
|
|
737
|
-
var
|
|
738
|
-
const
|
|
739
|
-
return (
|
|
412
|
+
isRowChecked(e) {
|
|
413
|
+
var s;
|
|
414
|
+
const t = this.getRowByIndex(e);
|
|
415
|
+
return (s = this.rowSelectionModel) == null ? void 0 : s.isRowChecked(t);
|
|
740
416
|
}
|
|
741
|
-
setRowChecked(
|
|
417
|
+
setRowChecked(e, t) {
|
|
742
418
|
if (this.rowSelectionModel) {
|
|
743
|
-
const
|
|
744
|
-
this.rowSelectionModel.checkRow(
|
|
419
|
+
const s = this.getRowByIndex(e);
|
|
420
|
+
this.rowSelectionModel.checkRow(s, t);
|
|
745
421
|
}
|
|
746
422
|
}
|
|
747
423
|
getMaxColspan() {
|
|
@@ -750,120 +426,77 @@ class AbstractAreaModel {
|
|
|
750
426
|
getMaxRowspan() {
|
|
751
427
|
return 31;
|
|
752
428
|
}
|
|
753
|
-
getYPosByRowIndex(
|
|
754
|
-
|
|
755
|
-
return this.defaultRowHeight * rowIndex;
|
|
756
|
-
}
|
|
757
|
-
return this.yPositions[rowIndex];
|
|
429
|
+
getYPosByRowIndex(e) {
|
|
430
|
+
return this.defaultRowHeight > 0 ? this.defaultRowHeight * e : this.yPositions[e];
|
|
758
431
|
}
|
|
759
432
|
init() {
|
|
760
|
-
|
|
761
|
-
if (this.defaultRowHeight === -1) {
|
|
762
|
-
this.calcYPositions();
|
|
763
|
-
}
|
|
764
|
-
}
|
|
433
|
+
!this.yPositions.length && this.getRowCount() !== void 0 && this.defaultRowHeight === -1 && this.calcYPositions();
|
|
765
434
|
}
|
|
766
435
|
isFilterable() {
|
|
767
436
|
return this.areaIdent === "body";
|
|
768
437
|
}
|
|
769
|
-
doSort(
|
|
770
|
-
return
|
|
438
|
+
doSort(e) {
|
|
439
|
+
return !1;
|
|
771
440
|
}
|
|
772
|
-
isEditable(
|
|
773
|
-
|
|
774
|
-
return this.columnDefs[columnIndex].editable();
|
|
775
|
-
}
|
|
776
|
-
return false;
|
|
441
|
+
isEditable(e, t) {
|
|
442
|
+
return this.columnDefs && t < this.columnDefs.length && this.columnDefs[t].editable ? this.columnDefs[t].editable() : !1;
|
|
777
443
|
}
|
|
778
|
-
setValue(
|
|
779
|
-
var
|
|
780
|
-
const
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
const row = this.getRowByIndex(rowIndex);
|
|
785
|
-
const property = this.columnDefs[columnIndex].property;
|
|
786
|
-
if (property.includes(".")) {
|
|
787
|
-
return this.setPropertyValue(row, property.split("."), value);
|
|
788
|
-
}
|
|
789
|
-
row[property] = value;
|
|
790
|
-
return true;
|
|
444
|
+
setValue(e, t, s) {
|
|
445
|
+
var l;
|
|
446
|
+
const i = (l = this.columnDefs[t]) == null ? void 0 : l.editInputPipe;
|
|
447
|
+
i && (s = i(s, e, t));
|
|
448
|
+
const o = this.getRowByIndex(e), r = this.columnDefs[t].property;
|
|
449
|
+
return r.includes(".") ? this.setPropertyValue(o, r.split("."), s) : (o[r] = s, !0);
|
|
791
450
|
}
|
|
792
|
-
isSelectable(
|
|
793
|
-
return
|
|
451
|
+
isSelectable(e, t) {
|
|
452
|
+
return !0;
|
|
794
453
|
}
|
|
795
|
-
changeColumnOrder(
|
|
796
|
-
this.arrayMove(this.cellRenderers,
|
|
454
|
+
changeColumnOrder(e, t) {
|
|
455
|
+
this.arrayMove(this.cellRenderers, e, t);
|
|
797
456
|
}
|
|
798
|
-
setPropertyValue(
|
|
799
|
-
const
|
|
800
|
-
if (
|
|
801
|
-
let
|
|
802
|
-
|
|
803
|
-
return this.setPropertyValue(o2, props, value);
|
|
804
|
-
} else {
|
|
805
|
-
o[prop] = value;
|
|
806
|
-
return true;
|
|
807
|
-
}
|
|
457
|
+
setPropertyValue(e, t, s) {
|
|
458
|
+
const i = t.shift();
|
|
459
|
+
if (i) {
|
|
460
|
+
let o = e[i];
|
|
461
|
+
return o && t.length ? this.setPropertyValue(o, t, s) : (e[i] = s, !0);
|
|
808
462
|
}
|
|
809
|
-
return
|
|
463
|
+
return !1;
|
|
810
464
|
}
|
|
811
|
-
arrayMove(
|
|
812
|
-
const
|
|
813
|
-
|
|
814
|
-
return arr;
|
|
465
|
+
arrayMove(e, t, s) {
|
|
466
|
+
const i = e.splice(t, 1)[0];
|
|
467
|
+
return e.splice(s, 0, i), e;
|
|
815
468
|
}
|
|
816
469
|
calcYPositions() {
|
|
817
|
-
const
|
|
818
|
-
this.yPositions = new Array(
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
this.yPositions[i + 1] = this.getRowHeight(i) + this.yPositions[i];
|
|
822
|
-
}
|
|
470
|
+
const e = this.getRowCount();
|
|
471
|
+
this.yPositions = new Array(e + 1), this.yPositions[0] = 0;
|
|
472
|
+
for (let t = 0; t < e; t++)
|
|
473
|
+
this.yPositions[t + 1] = this.getRowHeight(t) + this.yPositions[t];
|
|
823
474
|
}
|
|
824
475
|
}
|
|
825
|
-
class
|
|
826
|
-
genericSortComparator(
|
|
827
|
-
if (typeof
|
|
828
|
-
return
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
if (
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
if (va instanceof Array && vb instanceof Array) {
|
|
842
|
-
const arr1 = va;
|
|
843
|
-
const arr2 = vb;
|
|
844
|
-
if (arr1.length && arr2.length) {
|
|
845
|
-
return this.genericSortComparator(arr1[0], arr2[0], f);
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
return f * ("" + va).localeCompare("" + vb);
|
|
476
|
+
class ee {
|
|
477
|
+
genericSortComparator(e, t, s) {
|
|
478
|
+
if (typeof e == "number" && typeof t == "number")
|
|
479
|
+
return s * (e - t);
|
|
480
|
+
if (typeof e == "string" && typeof t == "string")
|
|
481
|
+
return s * e.localeCompare(t);
|
|
482
|
+
if (typeof e == "boolean" && typeof t == "boolean")
|
|
483
|
+
return s * ((e ? -1 : 1) - (t ? -1 : 1));
|
|
484
|
+
if (e instanceof Date && t instanceof Date)
|
|
485
|
+
return s * (e.getTime() - t.getTime());
|
|
486
|
+
if (e instanceof Array && t instanceof Array) {
|
|
487
|
+
const i = e, o = t;
|
|
488
|
+
if (i.length && o.length)
|
|
489
|
+
return this.genericSortComparator(i[0], o[0], s);
|
|
490
|
+
}
|
|
491
|
+
return s * ("" + e).localeCompare("" + t);
|
|
849
492
|
}
|
|
850
493
|
}
|
|
851
|
-
class
|
|
852
|
-
constructor(
|
|
853
|
-
super(areaIdent, columnDefs,
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
this.
|
|
857
|
-
this.columnDefs = columnDefs;
|
|
858
|
-
this.sorterService = new SorterService();
|
|
859
|
-
this.service = new TreeRowService();
|
|
860
|
-
this.properties = columnDefs.map((def) => def.property);
|
|
861
|
-
this.flattenRows = this.service.flattenTree(rows);
|
|
862
|
-
this.filteredFlattenRows = [...this.flattenRows];
|
|
863
|
-
}
|
|
864
|
-
changeColumnOrder(sourceColumnIndex, targetColumnIndex) {
|
|
865
|
-
this.arrayMove(this.properties, sourceColumnIndex, targetColumnIndex);
|
|
866
|
-
super.changeColumnOrder(sourceColumnIndex, targetColumnIndex);
|
|
494
|
+
class L extends Z {
|
|
495
|
+
constructor(e, t, s, i = []) {
|
|
496
|
+
super(e, i, s), this.areaIdent = e, this.rows = t, this.defaultRowHeight = s, this.columnDefs = i, this.sorterService = new ee(), this.service = new Q(), this.properties = i.map((o) => o.property), this.flattenRows = this.service.flattenTree(t), this.filteredFlattenRows = [...this.flattenRows];
|
|
497
|
+
}
|
|
498
|
+
changeColumnOrder(e, t) {
|
|
499
|
+
this.arrayMove(this.properties, e, t), super.changeColumnOrder(e, t);
|
|
867
500
|
}
|
|
868
501
|
recalcVisibleTreeRows() {
|
|
869
502
|
this.filteredFlattenRows = this.service.flattenTree(this.rows);
|
|
@@ -872,270 +505,225 @@ class AreaModelTree extends AbstractAreaModel {
|
|
|
872
505
|
return this.filteredFlattenRows;
|
|
873
506
|
}
|
|
874
507
|
getRowCount() {
|
|
875
|
-
let
|
|
876
|
-
for (const
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
const prop = this.properties[columnIndex];
|
|
887
|
-
if (prop) {
|
|
888
|
-
if (prop.includes(".")) {
|
|
889
|
-
return this.getPropertyValue(row.data, prop.split("."));
|
|
890
|
-
}
|
|
891
|
-
return row.data[prop];
|
|
892
|
-
}
|
|
508
|
+
let e = 0;
|
|
509
|
+
for (const t of this.filteredFlattenRows)
|
|
510
|
+
this.service.isVisible(t) && e++;
|
|
511
|
+
return e;
|
|
512
|
+
}
|
|
513
|
+
getValueAt(e, t) {
|
|
514
|
+
const s = this.getRowByIndex(e);
|
|
515
|
+
if (s) {
|
|
516
|
+
const i = this.properties[t];
|
|
517
|
+
if (i)
|
|
518
|
+
return i.includes(".") ? this.getPropertyValue(s.data, i.split(".")) : s.data[i];
|
|
893
519
|
}
|
|
894
520
|
return "";
|
|
895
521
|
}
|
|
896
|
-
getRowHeight(
|
|
522
|
+
getRowHeight(e) {
|
|
897
523
|
return this.defaultRowHeight;
|
|
898
524
|
}
|
|
899
|
-
getCustomClassesAt(
|
|
900
|
-
|
|
901
|
-
return ["ge-table-tree-cell", "ge-table-tree-deep-" + row.deep];
|
|
525
|
+
getCustomClassesAt(e, t) {
|
|
526
|
+
return ["ge-table-tree-cell", "ge-table-tree-deep-" + this.filteredFlattenRows[e].deep];
|
|
902
527
|
}
|
|
903
|
-
getRowByIndex(
|
|
904
|
-
return this.filteredFlattenRows[
|
|
528
|
+
getRowByIndex(e) {
|
|
529
|
+
return this.filteredFlattenRows[e];
|
|
905
530
|
}
|
|
906
|
-
getValueByT(
|
|
907
|
-
|
|
908
|
-
return this.getPropertyValue(t, property.split("."));
|
|
909
|
-
}
|
|
910
|
-
return t[property];
|
|
911
|
-
}
|
|
912
|
-
externalFilterChanged(predictFn) {
|
|
913
|
-
this.lastPredictFn = predictFn;
|
|
914
|
-
this.doFiltering();
|
|
915
|
-
}
|
|
916
|
-
doSort(sortItems) {
|
|
917
|
-
const { columnIndex, sortState } = sortItems[sortItems.length - 1];
|
|
918
|
-
const f = sortState === "asc" ? 1 : sortState === "desc" ? -1 : 0;
|
|
919
|
-
const property = this.properties[columnIndex];
|
|
920
|
-
this.treeSort(this.rows, property, f);
|
|
921
|
-
this.flattenRows = this.service.flattenTree(this.rows);
|
|
922
|
-
this.filteredFlattenRows = [...this.flattenRows];
|
|
923
|
-
return true;
|
|
924
|
-
}
|
|
925
|
-
toggleExpandCollapseAll(expanded) {
|
|
926
|
-
this.expandAllRecursive(this.rows, expanded);
|
|
927
|
-
this.flattenRows = this.service.flattenTree(this.rows);
|
|
928
|
-
this.doFiltering();
|
|
929
|
-
}
|
|
930
|
-
setAllParentsOk(item) {
|
|
931
|
-
if (item.parent) {
|
|
932
|
-
item.parent.keep = true;
|
|
933
|
-
this.setAllParentsOk(item.parent);
|
|
934
|
-
}
|
|
935
|
-
return false;
|
|
531
|
+
getValueByT(e, t) {
|
|
532
|
+
return t.includes(".") ? this.getPropertyValue(e, t.split(".")) : e[t];
|
|
936
533
|
}
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
534
|
+
externalFilterChanged(e) {
|
|
535
|
+
this.lastPredictFn = e, this.doFiltering();
|
|
536
|
+
}
|
|
537
|
+
doSort(e) {
|
|
538
|
+
const { columnIndex: t, sortState: s } = e[e.length - 1], i = s === "asc" ? 1 : s === "desc" ? -1 : 0, o = this.properties[t];
|
|
539
|
+
return this.treeSort(this.rows, o, i), this.flattenRows = this.service.flattenTree(this.rows), this.filteredFlattenRows = [...this.flattenRows], !0;
|
|
540
|
+
}
|
|
541
|
+
toggleExpandCollapseAll(e) {
|
|
542
|
+
this.expandAllRecursive(this.rows, e), this.flattenRows = this.service.flattenTree(this.rows), this.doFiltering();
|
|
543
|
+
}
|
|
544
|
+
setAllParentsOk(e) {
|
|
545
|
+
return e.parent && (e.parent.keep = !0, this.setAllParentsOk(e.parent)), !1;
|
|
546
|
+
}
|
|
547
|
+
setValue(e, t, s) {
|
|
548
|
+
var r;
|
|
549
|
+
const i = (r = this.columnDefs[t]) == null ? void 0 : r.editInputPipe;
|
|
550
|
+
i && (s = i(s, e, t));
|
|
551
|
+
const o = this.getRowByIndex(e);
|
|
552
|
+
if (o) {
|
|
553
|
+
const l = o.data, n = this.columnDefs[t].property;
|
|
554
|
+
return n.includes(".") ? this.setPropertyValue(l, n.split("."), s) : (l[n] = s, !0);
|
|
952
555
|
}
|
|
953
|
-
return
|
|
556
|
+
return !1;
|
|
954
557
|
}
|
|
955
|
-
genericTreeTableSortComparator(
|
|
956
|
-
return (
|
|
957
|
-
const
|
|
958
|
-
|
|
959
|
-
return this.sorterService.genericSortComparator(va, vb, f);
|
|
558
|
+
genericTreeTableSortComparator(e, t) {
|
|
559
|
+
return (s, i) => {
|
|
560
|
+
const o = this.getValueByT(s.data, e), r = this.getValueByT(i.data, e);
|
|
561
|
+
return this.sorterService.genericSortComparator(o, r, t);
|
|
960
562
|
};
|
|
961
563
|
}
|
|
962
|
-
expandAllRecursive(
|
|
963
|
-
for (const
|
|
964
|
-
|
|
965
|
-
if (row.children) {
|
|
966
|
-
this.expandAllRecursive(row.children, expanded);
|
|
967
|
-
}
|
|
968
|
-
}
|
|
564
|
+
expandAllRecursive(e, t) {
|
|
565
|
+
for (const s of e)
|
|
566
|
+
s.expanded = t, s.children && this.expandAllRecursive(s.children, t);
|
|
969
567
|
}
|
|
970
568
|
doFiltering() {
|
|
971
|
-
if (!this.lastPredictFn)
|
|
569
|
+
if (!this.lastPredictFn)
|
|
972
570
|
this.filteredFlattenRows = [...this.flattenRows ? this.flattenRows : []];
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
this.flattenRows.forEach((v) => {
|
|
979
|
-
maxDeep = Math.max(maxDeep, v.deep);
|
|
980
|
-
});
|
|
981
|
-
const okRows = this.flattenRows.filter((value, index, array) => {
|
|
982
|
-
return this.lastPredictFn(value, index, array);
|
|
983
|
-
});
|
|
984
|
-
this.flattenRows.forEach((v) => v.keep = false);
|
|
985
|
-
this.flattenRows.forEach((v) => {
|
|
986
|
-
if (okRows.includes(v)) {
|
|
987
|
-
v.keep = true;
|
|
988
|
-
this.setAllParentsOk(v);
|
|
989
|
-
}
|
|
571
|
+
else {
|
|
572
|
+
this.flattenRows || (this.flattenRows = []);
|
|
573
|
+
let e = 0;
|
|
574
|
+
this.flattenRows.forEach((s) => {
|
|
575
|
+
e = Math.max(e, s.deep);
|
|
990
576
|
});
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
}
|
|
577
|
+
const t = this.flattenRows.filter(
|
|
578
|
+
(s, i, o) => this.lastPredictFn(s, i, o)
|
|
579
|
+
);
|
|
580
|
+
this.flattenRows.forEach((s) => s.keep = !1), this.flattenRows.forEach((s) => {
|
|
581
|
+
t.includes(s) && (s.keep = !0, this.setAllParentsOk(s));
|
|
582
|
+
}), this.filteredFlattenRows = this.flattenRows.filter(
|
|
583
|
+
(s, i, o) => s.keep
|
|
584
|
+
);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
getPropertyValue(e, t) {
|
|
588
|
+
const s = t.shift();
|
|
589
|
+
let i = e[s];
|
|
590
|
+
return i && t.length ? this.getPropertyValue(i, t) : i;
|
|
591
|
+
}
|
|
592
|
+
treeSort(e, t, s) {
|
|
593
|
+
e.sort(this.genericTreeTableSortComparator(t, s));
|
|
594
|
+
for (const i of e)
|
|
595
|
+
i.children && this.treeSort(i.children, t, s);
|
|
1011
596
|
}
|
|
1012
597
|
}
|
|
1013
|
-
class
|
|
1014
|
-
constructor(
|
|
1015
|
-
this.getStorageKeyFn =
|
|
1016
|
-
}
|
|
1017
|
-
autoConvertMapToObject(
|
|
1018
|
-
const
|
|
1019
|
-
if (
|
|
1020
|
-
const
|
|
1021
|
-
for (const
|
|
1022
|
-
const [
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
this.
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
598
|
+
class P {
|
|
599
|
+
constructor(e) {
|
|
600
|
+
this.getStorageKeyFn = e;
|
|
601
|
+
}
|
|
602
|
+
autoConvertMapToObject(e) {
|
|
603
|
+
const t = {};
|
|
604
|
+
if (e instanceof Map) {
|
|
605
|
+
const s = e;
|
|
606
|
+
for (const i of [...s]) {
|
|
607
|
+
const [
|
|
608
|
+
o,
|
|
609
|
+
r
|
|
610
|
+
] = i;
|
|
611
|
+
t[o] = r;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return t;
|
|
615
|
+
}
|
|
616
|
+
checkAndPersistItem(e, t) {
|
|
617
|
+
const s = this.getStorageKeyFn;
|
|
618
|
+
if (s) {
|
|
619
|
+
const i = s();
|
|
620
|
+
if (i) {
|
|
621
|
+
const o = i + e;
|
|
622
|
+
if ((t + "").includes("Map")) {
|
|
623
|
+
const r = this.autoConvertMapToObject(t);
|
|
624
|
+
this.persistItem(o, r);
|
|
625
|
+
} else
|
|
626
|
+
this.persistItem(o, t);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
persistItem(e, t) {
|
|
631
|
+
t ? localStorage.setItem(e, JSON.stringify(t)) : localStorage.removeItem(e);
|
|
632
|
+
}
|
|
633
|
+
loadFromLocalStorage(e) {
|
|
634
|
+
const t = localStorage.getItem(e);
|
|
635
|
+
return t ? JSON.parse(t) : null;
|
|
636
|
+
}
|
|
637
|
+
// private loadItems() {
|
|
638
|
+
// const fn = this.getStorageKeyFn;
|
|
639
|
+
// if (fn) {
|
|
640
|
+
// const key = fn();
|
|
641
|
+
// if (key) {
|
|
642
|
+
// // A main key is given by function from options
|
|
643
|
+
// const subKey = key + this.CHECKED_STATE;
|
|
644
|
+
// const arr = this.loadFromLocalStorage<Array<string | number>>(subKey);
|
|
645
|
+
// if (arr) {
|
|
646
|
+
// this.checkedStateIds.length = 0;
|
|
647
|
+
// arr.forEach(a => this.checkedStateIds.push(a));
|
|
648
|
+
// }
|
|
649
|
+
//
|
|
650
|
+
// const subKey2 = key + this.COLLAPSED_EXPANDED_STATE;
|
|
651
|
+
// const data = this.loadFromLocalStorage<CollapsedExpandedData>(subKey2);
|
|
652
|
+
// if (data) {
|
|
653
|
+
// this.collapsedExpandedState = data;
|
|
654
|
+
// }
|
|
655
|
+
//
|
|
656
|
+
// const subKey3 = key + this.SELECTED_STATE;
|
|
657
|
+
// const arr3 = this.loadFromLocalStorage<object>(subKey3);
|
|
658
|
+
// if (arr3) {
|
|
659
|
+
// const map: Map<string | number, string[]> = new Map(Object.entries(arr3));
|
|
660
|
+
// if (map) {
|
|
661
|
+
// this.selectedStateIds.clear();
|
|
662
|
+
// map.forEach((col, k) => this.selectedStateIds.set(k, col));
|
|
663
|
+
// }
|
|
664
|
+
// }
|
|
665
|
+
//
|
|
666
|
+
// const subKey4 = key + this.SCROLL_STATE;
|
|
667
|
+
// let scrollOffset = this.loadFromLocalStorage<[number, number]>(subKey4);
|
|
668
|
+
// this.scrollOffset = scrollOffset ? scrollOffset : [0, 0];
|
|
669
|
+
// }
|
|
670
|
+
// }
|
|
671
|
+
// }
|
|
1057
672
|
}
|
|
1058
|
-
class
|
|
1059
|
-
constructor(
|
|
1060
|
-
super(
|
|
1061
|
-
this.SCROLL_STATE = "scrollState";
|
|
1062
|
-
this.scrollOffset = [0, 0];
|
|
1063
|
-
this.load();
|
|
673
|
+
class te extends P {
|
|
674
|
+
constructor(e) {
|
|
675
|
+
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
1064
676
|
}
|
|
1065
677
|
getScrollOffset() {
|
|
1066
678
|
return this.scrollOffset;
|
|
1067
679
|
}
|
|
1068
|
-
updateScrollOffset(
|
|
1069
|
-
this.scrollOffset =
|
|
1070
|
-
this.checkAndPersistItem(this.SCROLL_STATE, this.scrollOffset);
|
|
680
|
+
updateScrollOffset(e) {
|
|
681
|
+
this.scrollOffset = e, this.checkAndPersistItem(this.SCROLL_STATE, this.scrollOffset);
|
|
1071
682
|
}
|
|
1072
683
|
load() {
|
|
1073
|
-
const
|
|
1074
|
-
if (
|
|
1075
|
-
const
|
|
1076
|
-
if (
|
|
1077
|
-
const
|
|
1078
|
-
let
|
|
1079
|
-
this.scrollOffset =
|
|
684
|
+
const e = this.getStorageKeyFn;
|
|
685
|
+
if (e) {
|
|
686
|
+
const t = e();
|
|
687
|
+
if (t) {
|
|
688
|
+
const s = t + this.SCROLL_STATE;
|
|
689
|
+
let i = this.loadFromLocalStorage(s);
|
|
690
|
+
this.scrollOffset = i || [0, 0];
|
|
1080
691
|
}
|
|
1081
692
|
}
|
|
1082
693
|
}
|
|
1083
694
|
}
|
|
1084
|
-
class
|
|
1085
|
-
constructor(
|
|
1086
|
-
this.mode =
|
|
1087
|
-
this.rowIds = rowIds;
|
|
1088
|
-
this.allCollapsed = allCollapsed;
|
|
1089
|
-
this.allExpanded = allExpanded;
|
|
695
|
+
class se {
|
|
696
|
+
constructor(e = "collapsed", t = [], s = !1, i = !1) {
|
|
697
|
+
this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = i;
|
|
1090
698
|
}
|
|
1091
699
|
}
|
|
1092
|
-
class
|
|
1093
|
-
constructor(
|
|
1094
|
-
super(
|
|
1095
|
-
this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState";
|
|
1096
|
-
this.collapsedExpandedState = new CollapsedExpandedData();
|
|
1097
|
-
this.load();
|
|
700
|
+
class ie extends P {
|
|
701
|
+
constructor(e) {
|
|
702
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new se(), this.load();
|
|
1098
703
|
}
|
|
1099
704
|
collapsedExpandedStateGet() {
|
|
1100
705
|
return this.collapsedExpandedState;
|
|
1101
706
|
}
|
|
1102
|
-
collapsedExpandedStateIncludes(
|
|
1103
|
-
return this.collapsedExpandedState.rowIds.includes(
|
|
707
|
+
collapsedExpandedStateIncludes(e) {
|
|
708
|
+
return this.collapsedExpandedState.rowIds.includes(e);
|
|
1104
709
|
}
|
|
1105
|
-
collapsedStateIdsPush(
|
|
1106
|
-
|
|
1107
|
-
this.collapsedExpandedState.rowIds.push(id);
|
|
1108
|
-
this.collapsedExpandedState.allCollapsed = false;
|
|
1109
|
-
this.collapsedExpandedState.allExpanded = false;
|
|
1110
|
-
this.persist();
|
|
1111
|
-
}
|
|
710
|
+
collapsedStateIdsPush(e) {
|
|
711
|
+
this.collapsedExpandedState.rowIds.includes(e) || (this.collapsedExpandedState.rowIds.push(e), this.collapsedExpandedState.allCollapsed = !1, this.collapsedExpandedState.allExpanded = !1, this.persist());
|
|
1112
712
|
}
|
|
1113
|
-
collapsedStateIdsRemove(
|
|
1114
|
-
const
|
|
1115
|
-
|
|
1116
|
-
this.collapsedExpandedState.rowIds.splice(idx, 1);
|
|
1117
|
-
this.collapsedExpandedState.allCollapsed = false;
|
|
1118
|
-
this.collapsedExpandedState.allExpanded = false;
|
|
1119
|
-
this.persist();
|
|
1120
|
-
}
|
|
713
|
+
collapsedStateIdsRemove(e) {
|
|
714
|
+
const t = this.collapsedExpandedState.rowIds.indexOf(e);
|
|
715
|
+
t !== -1 && (this.collapsedExpandedState.rowIds.splice(t, 1), this.collapsedExpandedState.allCollapsed = !1, this.collapsedExpandedState.allExpanded = !1, this.persist());
|
|
1121
716
|
}
|
|
1122
|
-
collapsedStateAll(
|
|
1123
|
-
this.collapsedExpandedState.rowIds = [];
|
|
1124
|
-
this.collapsedExpandedState.mode = expand ? "collapsed" : "expanded";
|
|
1125
|
-
this.collapsedExpandedState.allCollapsed = !expand;
|
|
1126
|
-
this.collapsedExpandedState.allExpanded = expand;
|
|
1127
|
-
this.persist();
|
|
717
|
+
collapsedStateAll(e) {
|
|
718
|
+
this.collapsedExpandedState.rowIds = [], this.collapsedExpandedState.mode = e ? "collapsed" : "expanded", this.collapsedExpandedState.allCollapsed = !e, this.collapsedExpandedState.allExpanded = e, this.persist();
|
|
1128
719
|
}
|
|
1129
720
|
load() {
|
|
1130
|
-
const
|
|
1131
|
-
if (
|
|
1132
|
-
const
|
|
1133
|
-
if (
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1136
|
-
if (data) {
|
|
1137
|
-
this.collapsedExpandedState = data;
|
|
1138
|
-
}
|
|
721
|
+
const e = this.getStorageKeyFn;
|
|
722
|
+
if (e) {
|
|
723
|
+
const t = e();
|
|
724
|
+
if (t) {
|
|
725
|
+
const s = t + this.COLLAPSED_EXPANDED_STATE, i = this.loadFromLocalStorage(s);
|
|
726
|
+
i && (this.collapsedExpandedState = i);
|
|
1139
727
|
}
|
|
1140
728
|
}
|
|
1141
729
|
}
|
|
@@ -1143,1092 +731,856 @@ class StoreStateCollapsedExpandService extends AbstractStoreStateService {
|
|
|
1143
731
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
1144
732
|
}
|
|
1145
733
|
}
|
|
1146
|
-
class
|
|
1147
|
-
constructor(
|
|
1148
|
-
super(
|
|
1149
|
-
this.SORTING_STATE = "sortingState";
|
|
1150
|
-
this.sortItems = [];
|
|
1151
|
-
this.load();
|
|
734
|
+
class oe extends P {
|
|
735
|
+
constructor(e) {
|
|
736
|
+
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
1152
737
|
}
|
|
1153
738
|
getSortItems() {
|
|
1154
739
|
return this.sortItems;
|
|
1155
740
|
}
|
|
1156
|
-
setSortItems(
|
|
1157
|
-
this.sortItems = sortItems;
|
|
1158
|
-
this.checkAndPersistItem(this.SORTING_STATE, this.sortItems);
|
|
741
|
+
setSortItems(e) {
|
|
742
|
+
this.sortItems = e, this.checkAndPersistItem(this.SORTING_STATE, this.sortItems);
|
|
1159
743
|
}
|
|
1160
744
|
load() {
|
|
1161
|
-
const
|
|
1162
|
-
if (
|
|
1163
|
-
const
|
|
1164
|
-
if (
|
|
1165
|
-
const
|
|
1166
|
-
let
|
|
1167
|
-
this.sortItems =
|
|
745
|
+
const e = this.getStorageKeyFn;
|
|
746
|
+
if (e) {
|
|
747
|
+
const t = e();
|
|
748
|
+
if (t) {
|
|
749
|
+
const s = t + this.SORTING_STATE;
|
|
750
|
+
let i = this.loadFromLocalStorage(s);
|
|
751
|
+
this.sortItems = i || [];
|
|
1168
752
|
}
|
|
1169
753
|
}
|
|
1170
754
|
}
|
|
1171
755
|
}
|
|
1172
|
-
class
|
|
1173
|
-
constructor(
|
|
1174
|
-
this.left =
|
|
1175
|
-
this.width = width;
|
|
1176
|
-
this.height = height;
|
|
1177
|
-
this.top = top;
|
|
1178
|
-
this.index = index;
|
|
756
|
+
class T {
|
|
757
|
+
constructor(e = 0, t = 0, s = 0, i = 0, o) {
|
|
758
|
+
this.left = e, this.width = t, this.height = s, this.top = i, this.index = o;
|
|
1179
759
|
}
|
|
1180
760
|
}
|
|
1181
|
-
class
|
|
1182
|
-
constructor(
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
this.
|
|
1190
|
-
|
|
1191
|
-
this.
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
this.
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
this.
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
this.
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
this.
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
this.
|
|
761
|
+
class re {
|
|
762
|
+
constructor(e, t, s, i) {
|
|
763
|
+
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();
|
|
764
|
+
const o = this.hostElement;
|
|
765
|
+
o.innerText = "", this.dom.setAttribute(o, "tabindex", "0"), this.dom.setStyle(
|
|
766
|
+
this.dom.addClass("ge-table", o),
|
|
767
|
+
"position",
|
|
768
|
+
"relative"
|
|
769
|
+
), this.hoverRow = s.applyStylePosistionAbsolute(
|
|
770
|
+
s.createDivWithClass("ge-table-hover-row", o)
|
|
771
|
+
), this.hoverColumn = s.applyStylePosistionAbsolute(
|
|
772
|
+
s.createDivWithClass("ge-table-hover-column", o)
|
|
773
|
+
), this.areaHeaderWest = s.appendRelativeChildDiv(
|
|
774
|
+
s.applyStylePosistionAbsolute(
|
|
775
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-west", o, "header", "west")
|
|
776
|
+
)
|
|
777
|
+
), this.areaHeaderCenter = s.appendRelativeChildDiv(
|
|
778
|
+
s.applyStylePosistionAbsolute(
|
|
779
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-center", o, "header", "center")
|
|
780
|
+
)
|
|
781
|
+
), this.areaHeaderEast = s.appendRelativeChildDiv(
|
|
782
|
+
s.applyStylePosistionAbsolute(
|
|
783
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-east", o, "body", "east")
|
|
784
|
+
)
|
|
785
|
+
), this.areaBodyWest = s.appendRelativeChildDiv(
|
|
786
|
+
s.applyStylePosistionAbsolute(
|
|
787
|
+
s.createAreaDivWithClass("ge-table-body ge-table-body-west", o, "body", "west")
|
|
788
|
+
)
|
|
789
|
+
), this.areaBodyEast = s.appendRelativeChildDiv(
|
|
790
|
+
s.applyStylePosistionAbsolute(
|
|
791
|
+
s.createAreaDivWithClass("ge-table-body ge-table-body-east", o, "body", "east")
|
|
792
|
+
)
|
|
793
|
+
), this.areaFooterWest = s.appendRelativeChildDiv(
|
|
794
|
+
s.applyStylePosistionAbsolute(
|
|
795
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-west", o, "footer", "west")
|
|
796
|
+
)
|
|
797
|
+
), this.areaFooterCenter = s.appendRelativeChildDiv(
|
|
798
|
+
s.applyStylePosistionAbsolute(
|
|
799
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-center", o, "footer", "center")
|
|
800
|
+
)
|
|
801
|
+
), this.areaFooterEast = s.appendRelativeChildDiv(
|
|
802
|
+
s.applyStylePosistionAbsolute(
|
|
803
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-east", o, "footer", "east")
|
|
804
|
+
)
|
|
805
|
+
), this.scrollViewport = s.applyStyleOverflowAuto(
|
|
806
|
+
this.tableOptions.overflowX ?? "auto",
|
|
807
|
+
this.tableOptions.overflowY ?? "auto",
|
|
808
|
+
s.applyStyleNoPadding(
|
|
809
|
+
s.applyStylePosistionAbsolute(
|
|
810
|
+
s.createAreaDivWithClass("ge-table-scroll-viewport", o, "body", "center")
|
|
811
|
+
)
|
|
812
|
+
)
|
|
813
|
+
), this.contentWrapperDiv = s.applyStyleNoPadding(
|
|
814
|
+
s.applyStylePosistionRelative(
|
|
815
|
+
s.createDivWithClass("ge-table-scroll-content-wrapper", this.scrollViewport)
|
|
816
|
+
)
|
|
817
|
+
), this.contentDiv = s.applyStyleNoPadding(
|
|
818
|
+
s.applyStylePosistionRelative(
|
|
819
|
+
s.createDivWithClass("ge-table-scroll-content", this.contentWrapperDiv)
|
|
820
|
+
)
|
|
821
|
+
), this.areaBodyCenter = s.appendRelativeChildDiv(
|
|
822
|
+
s.createDivWithClass("ge-table-body-center", this.contentDiv)
|
|
823
|
+
), this.borderHeaderBottom = s.applyStylePosistionAbsolute(
|
|
824
|
+
s.createDivWithClass("ge-table-header-border", o)
|
|
825
|
+
), this.borderFixedWest = s.applyStylePosistionAbsolute(
|
|
826
|
+
s.createDivWithClass("ge-table-west-fixed-column-border", o)
|
|
827
|
+
), this.borderFixedEast = s.applyStylePosistionAbsolute(
|
|
828
|
+
s.createDivWithClass("ge-table-east-fixed-column-border", o)
|
|
829
|
+
), this.borderFooterTop = s.applyStylePosistionAbsolute(
|
|
830
|
+
s.createDivWithClass("ge-table-footer-border", o)
|
|
831
|
+
);
|
|
1214
832
|
}
|
|
1215
833
|
adjustContainersAndRows() {
|
|
1216
|
-
const
|
|
1217
|
-
const w = this.hostElement.clientWidth;
|
|
1218
|
-
const h = this.hostElement.clientHeight;
|
|
834
|
+
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth, s = this.hostElement.clientHeight;
|
|
1219
835
|
this.dom.applyStyle(this.scrollViewport, {
|
|
1220
|
-
width: `${
|
|
1221
|
-
height: `${
|
|
1222
|
-
top: `${
|
|
1223
|
-
left: `${
|
|
1224
|
-
})
|
|
1225
|
-
this.scrollTop = this.scrollViewport.scrollTop;
|
|
1226
|
-
this.dom.applyStyle(this.contentDiv, {
|
|
836
|
+
width: `${t - e.left}px`,
|
|
837
|
+
height: `${s - e.top}px`,
|
|
838
|
+
top: `${e.top}px`,
|
|
839
|
+
left: `${e.left}px`
|
|
840
|
+
}), this.scrollTop = this.scrollViewport.scrollTop, this.dom.applyStyle(this.contentDiv, {
|
|
1227
841
|
width: `${this.scrollViewport.clientWidth}px`,
|
|
1228
842
|
height: `${this.scrollViewport.clientHeight}px`,
|
|
1229
843
|
top: `${this.scrollTop}px`,
|
|
1230
844
|
left: `${this.scrollViewport.scrollLeft}px`
|
|
1231
|
-
})
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
this.areaBodyWestGeo.top = padding.top;
|
|
1235
|
-
this.areaBodyWestGeo.left = 0;
|
|
1236
|
-
this.dom.applyStyleInPx(this.areaBodyWest.parent, this.areaBodyWestGeo);
|
|
1237
|
-
if (this.tableOptions.fixedWestSeparatorBorderVisible && this.tableModel.getFixedLeftColumnCount()) {
|
|
1238
|
-
this.dom.applyDisplayBlockStyle(this.dom.applyStyle(this.borderFixedWest, {
|
|
1239
|
-
width: `1px`,
|
|
845
|
+
}), 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(
|
|
846
|
+
this.dom.applyStyle(this.borderFixedWest, {
|
|
847
|
+
width: "1px",
|
|
1240
848
|
height: `${this.areaBodyWestGeo.height}px`,
|
|
1241
849
|
top: `${this.areaBodyWestGeo.top}px`,
|
|
1242
850
|
left: `${this.areaBodyWestGeo.width}px`
|
|
1243
|
-
})
|
|
1244
|
-
|
|
1245
|
-
this.dom.
|
|
1246
|
-
|
|
1247
|
-
this.areaBodyEastGeo.width = padding.right;
|
|
1248
|
-
this.areaBodyEastGeo.height = h - padding.top - padding.bottom;
|
|
1249
|
-
this.areaBodyEastGeo.top = padding.top;
|
|
1250
|
-
this.areaBodyEastGeo.left = w - padding.right;
|
|
1251
|
-
this.dom.applyStyleInPx(this.areaBodyEast.parent, this.areaBodyEastGeo);
|
|
1252
|
-
if (this.tableOptions.fixedEastSeparatorBorderVisible && this.tableModel.getFixedLeftColumnCount()) {
|
|
1253
|
-
this.dom.applyDisplayBlockStyle(this.dom.applyStyle(this.borderFixedEast, {
|
|
1254
|
-
width: `1px`,
|
|
851
|
+
})
|
|
852
|
+
) : 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(
|
|
853
|
+
this.dom.applyStyle(this.borderFixedEast, {
|
|
854
|
+
width: "1px",
|
|
1255
855
|
height: `${this.areaBodyEastGeo.height}px`,
|
|
1256
856
|
top: `${this.areaBodyEastGeo.top}px`,
|
|
1257
857
|
left: `${this.areaBodyEastGeo.left}px`
|
|
1258
|
-
})
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
this.areaBodyCenterGeo.width = w - padding.left - padding.right;
|
|
1263
|
-
this.areaBodyCenterGeo.height = h - padding.top - padding.bottom;
|
|
1264
|
-
this.areaBodyCenterGeo.top = 0;
|
|
1265
|
-
this.areaBodyCenterGeo.left = 0;
|
|
1266
|
-
this.dom.applyStyleInPx(this.areaBodyCenter.parent, this.areaBodyCenterGeo);
|
|
1267
|
-
this.dom.applyStyle(this.areaHeaderCenter.parent, {
|
|
1268
|
-
width: `${w - padding.left - padding.right}px`,
|
|
1269
|
-
height: `${padding.top}px`,
|
|
858
|
+
})
|
|
859
|
+
) : 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, {
|
|
860
|
+
width: `${t - e.left - e.right}px`,
|
|
861
|
+
height: `${e.top}px`,
|
|
1270
862
|
top: "0",
|
|
1271
|
-
left: `${
|
|
1272
|
-
})
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
height: `${padding.top}px`,
|
|
863
|
+
left: `${e.left}px`
|
|
864
|
+
}), this.dom.applyStyle(this.areaHeaderWest.parent, {
|
|
865
|
+
width: `${e.left}px`,
|
|
866
|
+
height: `${e.top}px`,
|
|
1276
867
|
top: "0",
|
|
1277
868
|
left: "0"
|
|
1278
|
-
})
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
height: `${padding.top}px`,
|
|
869
|
+
}), this.dom.applyStyle(this.areaHeaderEast.parent, {
|
|
870
|
+
width: `${e.right}px`,
|
|
871
|
+
height: `${e.top}px`,
|
|
1282
872
|
top: "0",
|
|
1283
|
-
left: `${
|
|
1284
|
-
})
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
width: `${w}px`,
|
|
873
|
+
left: `${t - e.right}px`
|
|
874
|
+
}), this.tableOptions.headerSeparatorBorderVisible && this.tableModel.isHeaderVisibe() ? this.dom.applyDisplayBlockStyle(
|
|
875
|
+
this.dom.applyStyle(this.borderHeaderBottom, {
|
|
876
|
+
width: `${t}px`,
|
|
1288
877
|
height: "1px",
|
|
1289
|
-
top: `${
|
|
878
|
+
top: `${e.top}px`,
|
|
1290
879
|
left: "0px"
|
|
1291
|
-
})
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
width: `${padding.left}px`,
|
|
1297
|
-
height: `${padding.bottom}px`,
|
|
1298
|
-
top: `${h - padding.bottom}px`,
|
|
880
|
+
})
|
|
881
|
+
) : this.dom.applyDisplayNoneStyle(this.borderHeaderBottom), this.dom.applyStyle(this.areaFooterWest.parent, {
|
|
882
|
+
width: `${e.left}px`,
|
|
883
|
+
height: `${e.bottom}px`,
|
|
884
|
+
top: `${s - e.bottom}px`,
|
|
1299
885
|
left: "0"
|
|
1300
|
-
})
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
if (this.tableOptions.footerSeparatorBorderVisible && this.tableModel.isFooterVisibe()) {
|
|
1314
|
-
this.dom.applyDisplayBlockStyle(this.dom.applyStyle(this.borderFooterTop, {
|
|
1315
|
-
width: `${w}px`,
|
|
886
|
+
}), this.dom.applyStyle(this.areaFooterCenter.parent, {
|
|
887
|
+
width: `${t - e.left - e.right}px`,
|
|
888
|
+
height: `${e.bottom}px`,
|
|
889
|
+
top: `${s - e.bottom}px`,
|
|
890
|
+
left: `${e.left}px`
|
|
891
|
+
}), this.dom.applyStyle(this.areaFooterEast.parent, {
|
|
892
|
+
width: `${e.right}px`,
|
|
893
|
+
height: `${e.bottom}px`,
|
|
894
|
+
top: `${s - e.bottom}px`,
|
|
895
|
+
left: `${t - e.right}px`
|
|
896
|
+
}), this.tableOptions.footerSeparatorBorderVisible && this.tableModel.isFooterVisibe() ? this.dom.applyDisplayBlockStyle(
|
|
897
|
+
this.dom.applyStyle(this.borderFooterTop, {
|
|
898
|
+
width: `${t}px`,
|
|
1316
899
|
height: "1px",
|
|
1317
|
-
top: `${
|
|
900
|
+
top: `${s - e.bottom}px`,
|
|
1318
901
|
left: "0px"
|
|
1319
|
-
})
|
|
1320
|
-
|
|
1321
|
-
this.dom.applyDisplayNoneStyle(this.borderFooterTop);
|
|
1322
|
-
}
|
|
1323
|
-
this.adjustAfterScrolling();
|
|
902
|
+
})
|
|
903
|
+
) : this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.adjustAfterScrolling();
|
|
1324
904
|
}
|
|
1325
905
|
adjustAfterScrolling() {
|
|
1326
906
|
}
|
|
1327
907
|
resetSizeOfWrapperDiv() {
|
|
1328
|
-
const
|
|
1329
|
-
|
|
1330
|
-
this.dom.setStyle(this.contentWrapperDiv, "width", w);
|
|
1331
|
-
this.dom.setStyle(this.contentWrapperDiv, "height", h);
|
|
908
|
+
const e = `${this.tableModel.getContentWidthInPixel()}px`, t = `${this.tableModel.getContentHeightInPixel() + 1}px`;
|
|
909
|
+
this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", t);
|
|
1332
910
|
}
|
|
1333
911
|
}
|
|
1334
|
-
class
|
|
1335
|
-
constructor(
|
|
1336
|
-
this.r1 =
|
|
1337
|
-
this.c1 = c1;
|
|
1338
|
-
this.r2 = r2;
|
|
1339
|
-
this.c2 = c2;
|
|
1340
|
-
this.gammaRange = gammaRange;
|
|
1341
|
-
}
|
|
1342
|
-
static create(params) {
|
|
1343
|
-
if (params.gammaRange === void 0) {
|
|
1344
|
-
params.gammaRange = false;
|
|
1345
|
-
}
|
|
1346
|
-
return new CellRange(params.rowIndex1, params.columnIndex1, params.rowIndex2, params.columnIndex2, params.gammaRange);
|
|
912
|
+
class A {
|
|
913
|
+
constructor(e, t, s, i, o = !1) {
|
|
914
|
+
this.r1 = e, this.c1 = t, this.r2 = s, this.c2 = i, this.gammaRange = o;
|
|
1347
915
|
}
|
|
1348
|
-
static
|
|
1349
|
-
return
|
|
916
|
+
static create(e) {
|
|
917
|
+
return e.gammaRange === void 0 && (e.gammaRange = !1), new A(
|
|
918
|
+
e.rowIndex1,
|
|
919
|
+
e.columnIndex1,
|
|
920
|
+
e.rowIndex2,
|
|
921
|
+
e.columnIndex2,
|
|
922
|
+
e.gammaRange
|
|
923
|
+
);
|
|
1350
924
|
}
|
|
1351
|
-
static
|
|
1352
|
-
return new
|
|
925
|
+
static singleCell(e, t) {
|
|
926
|
+
return new A(e, t, e, t);
|
|
1353
927
|
}
|
|
1354
|
-
static
|
|
1355
|
-
return new
|
|
928
|
+
static singleRow(e) {
|
|
929
|
+
return new A(e, 0, e, Number.MAX_SAFE_INTEGER);
|
|
1356
930
|
}
|
|
1357
|
-
|
|
1358
|
-
return
|
|
931
|
+
static singleColumn(e) {
|
|
932
|
+
return new A(0, e, Number.MAX_SAFE_INTEGER, e);
|
|
933
|
+
}
|
|
934
|
+
isInRange(e, t) {
|
|
935
|
+
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
1359
936
|
}
|
|
1360
937
|
}
|
|
1361
|
-
class
|
|
1362
|
-
constructor(
|
|
1363
|
-
this.tableModel =
|
|
1364
|
-
this.areaModel = areaModel;
|
|
1365
|
-
this.colAndRowspanRanges = void 0;
|
|
938
|
+
class le {
|
|
939
|
+
constructor(e, t) {
|
|
940
|
+
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
1366
941
|
}
|
|
1367
942
|
init() {
|
|
1368
|
-
if (this.areaModel.getMaxColspan() < 2 && this.areaModel.getMaxRowspan() < 2)
|
|
943
|
+
if (this.areaModel.getMaxColspan() < 2 && this.areaModel.getMaxRowspan() < 2)
|
|
1369
944
|
return;
|
|
1370
|
-
}
|
|
1371
945
|
this.colAndRowspanRanges = [];
|
|
1372
|
-
const
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
if (rs === 0) {
|
|
1383
|
-
rs = 1;
|
|
1384
|
-
}
|
|
1385
|
-
const gammaRange = this.areaModel.hasOwnProperty("gammaCells");
|
|
1386
|
-
this.colAndRowspanRanges.push(new CellRange(r, c, r + rs - 1, c + cs - 1, gammaRange));
|
|
946
|
+
const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
|
|
947
|
+
for (let s = 0; s < e; s++)
|
|
948
|
+
for (let i = 0; i < t; i++) {
|
|
949
|
+
let o = this.areaModel.getColspanAt(s, i), r = this.areaModel.getRowspanAt(s, i);
|
|
950
|
+
if (o > 1 || r > 1) {
|
|
951
|
+
o === 0 && (o = 1), r === 0 && (r = 1);
|
|
952
|
+
const l = this.areaModel.hasOwnProperty("gammaCells");
|
|
953
|
+
this.colAndRowspanRanges.push(
|
|
954
|
+
new A(s, i, s + r - 1, i + o - 1, l)
|
|
955
|
+
);
|
|
1387
956
|
}
|
|
1388
957
|
}
|
|
1389
|
-
}
|
|
1390
958
|
}
|
|
1391
959
|
getRanges() {
|
|
1392
|
-
|
|
1393
|
-
return this.colAndRowspanRanges;
|
|
1394
|
-
}
|
|
1395
|
-
return [];
|
|
960
|
+
return this.colAndRowspanRanges ? this.colAndRowspanRanges : [];
|
|
1396
961
|
}
|
|
1397
|
-
isInRange(
|
|
962
|
+
isInRange(e, t) {
|
|
1398
963
|
if (this.colAndRowspanRanges) {
|
|
1399
|
-
for (const
|
|
1400
|
-
if (
|
|
1401
|
-
return
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
964
|
+
for (const s of this.colAndRowspanRanges)
|
|
965
|
+
if (s.isInRange(e, t))
|
|
966
|
+
return !0;
|
|
1404
967
|
}
|
|
1405
|
-
return
|
|
968
|
+
return !1;
|
|
1406
969
|
}
|
|
1407
970
|
}
|
|
1408
|
-
class
|
|
1409
|
-
constructor(
|
|
1410
|
-
this.header =
|
|
1411
|
-
this.body = body;
|
|
1412
|
-
this.footer = footer;
|
|
971
|
+
class ne {
|
|
972
|
+
constructor(e, t, s) {
|
|
973
|
+
this.header = e, this.body = t, this.footer = s;
|
|
1413
974
|
}
|
|
1414
975
|
}
|
|
1415
|
-
class
|
|
1416
|
-
constructor(
|
|
1417
|
-
var
|
|
1418
|
-
super(
|
|
1419
|
-
this.scrollLeft = 0;
|
|
1420
|
-
this.scrollViewportLeft = 0;
|
|
1421
|
-
this.scrollFactorY = 0;
|
|
1422
|
-
this.scrollFactorX = 0;
|
|
1423
|
-
this.cleanupFunctions = {
|
|
976
|
+
class ae extends re {
|
|
977
|
+
constructor(e, t, s, i) {
|
|
978
|
+
var r, l;
|
|
979
|
+
super(e, t, s, i), this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
1424
980
|
header: [],
|
|
1425
981
|
body: [],
|
|
1426
982
|
footer: []
|
|
1427
|
-
}
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
this.editing = false;
|
|
1434
|
-
if (this.tableModel.getSelectionModel) {
|
|
1435
|
-
this.getSelectionModel = this.tableModel.getSelectionModel;
|
|
1436
|
-
} else if ((_a = this.tableOptions) === null || _a === void 0 ? void 0 : _a.getSelectionModel) {
|
|
1437
|
-
this.getSelectionModel = this.tableOptions.getSelectionModel;
|
|
1438
|
-
}
|
|
1439
|
-
if ((_b = this.tableOptions) === null || _b === void 0 ? void 0 : _b.getFocusModel) {
|
|
1440
|
-
this.getFocusModel = this.tableOptions.getFocusModel;
|
|
1441
|
-
}
|
|
1442
|
-
if (tableModel.getAreaModel("body") instanceof AreaModelTree) {
|
|
1443
|
-
this.tree = true;
|
|
1444
|
-
}
|
|
1445
|
-
const aereaIds = ["header", "body", "footer"];
|
|
1446
|
-
aereaIds.forEach((areaIdent) => {
|
|
1447
|
-
var _a2;
|
|
1448
|
-
this.colAndRowspanModels[areaIdent] = new ColAndRowspanModel(tableModel, tableModel.getAreaModel(areaIdent));
|
|
1449
|
-
(_a2 = this.colAndRowspanModels[areaIdent]) === null || _a2 === void 0 ? void 0 : _a2.init();
|
|
1450
|
-
});
|
|
983
|
+
}, this.tree = !1, this.colAndRowspanModels = new ne(), 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), (l = this.tableOptions) != null && l.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), t.getAreaModel("body") instanceof L && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
984
|
+
(n) => {
|
|
985
|
+
var a;
|
|
986
|
+
this.colAndRowspanModels[n] = new le(t, t.getAreaModel(n)), (a = this.colAndRowspanModels[n]) == null || a.init();
|
|
987
|
+
}
|
|
988
|
+
);
|
|
1451
989
|
}
|
|
1452
990
|
isEditing() {
|
|
1453
991
|
return this.editing;
|
|
1454
992
|
}
|
|
1455
993
|
resetEditorRenderer() {
|
|
1456
|
-
this.editorRenderer = void 0;
|
|
1457
|
-
this.editorRendererRow = -1;
|
|
1458
|
-
this.editorRendererColumn = -1;
|
|
1459
|
-
this.editing = false;
|
|
994
|
+
this.editorRenderer = void 0, this.editorRendererRow = -1, this.editorRendererColumn = -1, this.editing = !1;
|
|
1460
995
|
}
|
|
1461
996
|
clearSelection() {
|
|
1462
997
|
if (this.getSelectionModel) {
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1465
|
-
}
|
|
1466
|
-
}
|
|
1467
|
-
initRenderEditor(
|
|
1468
|
-
var
|
|
1469
|
-
let
|
|
1470
|
-
if (
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
this.editorRendererRow = rowIdx;
|
|
1477
|
-
this.editorRendererColumn = colIdx;
|
|
1478
|
-
this.editing = true;
|
|
1479
|
-
this.repaint();
|
|
1480
|
-
const input = document.querySelector("input.ge-table-cell-editor-input");
|
|
1481
|
-
if (input) {
|
|
1482
|
-
input.focus();
|
|
1483
|
-
}
|
|
1484
|
-
} else {
|
|
998
|
+
const e = this.getSelectionModel();
|
|
999
|
+
e == null || e.clear();
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
initRenderEditor(e, t) {
|
|
1003
|
+
var i;
|
|
1004
|
+
let s = (i = this.tableModel.getColumnDef(t)) == null ? void 0 : i.getEditRenderer;
|
|
1005
|
+
if (s || (s = this.tableOptions.getEditRenderer), s)
|
|
1006
|
+
if (this.editorRenderer = s(e, t), this.editorRenderer) {
|
|
1007
|
+
this.editorRendererRow = e, this.editorRendererColumn = t, this.editing = !0, this.repaint();
|
|
1008
|
+
const o = document.querySelector("input.ge-table-cell-editor-input");
|
|
1009
|
+
o && o.focus();
|
|
1010
|
+
} else
|
|
1485
1011
|
this.resetEditorRenderer();
|
|
1486
|
-
}
|
|
1487
|
-
}
|
|
1488
1012
|
}
|
|
1489
1013
|
repaint() {
|
|
1490
1014
|
this.adjustAfterScrolling();
|
|
1491
1015
|
}
|
|
1492
1016
|
adjustAfterScrolling() {
|
|
1493
|
-
var
|
|
1494
|
-
for (const
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
this.
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
this.
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
if (this.tableOptions.tableTopBorderVisible) {
|
|
1514
|
-
this.removables.push(this.dom.addHorizontalBorder(new GeoData(0, this.hostElement.clientWidth, 1, 0), this.hostElement, "ge-table-border"));
|
|
1515
|
-
}
|
|
1516
|
-
if (this.tableOptions.tableBottomBorderVisible) {
|
|
1517
|
-
this.removables.push(this.dom.addHorizontalBorder(new GeoData(0, this.hostElement.clientWidth, 1, this.hostElement.clientHeight - 1), this.hostElement, "ge-table-border"));
|
|
1518
|
-
}
|
|
1519
|
-
if (this.tableModel.getFixedLeftColumnCount() > 0) {
|
|
1520
|
-
this.removables.push(this.dom.addVerticalBorder(new GeoData(this.areaBodyWest.child.clientWidth, 1, this.hostElement.clientHeight, 0), this.hostElement, "ge-table-body-west-vertical-border"));
|
|
1521
|
-
}
|
|
1522
|
-
if (((_a = this.tableModel.getAreaModel("header")) === null || _a === void 0 ? void 0 : _a.getRowCount()) > 0) {
|
|
1523
|
-
this.removables.push(this.dom.addHorizontalBorder(new GeoData(0, this.hostElement.clientWidth, 1, this.areaHeaderCenter.child.clientHeight), this.hostElement, "ge-table-body-west-vertical-border"));
|
|
1524
|
-
}
|
|
1017
|
+
var e;
|
|
1018
|
+
for (const t of this.removables)
|
|
1019
|
+
t.remove();
|
|
1020
|
+
this.hideHoverRow(), this.hideHoverColumn(), this.scrollTop = this.scrollViewport.scrollTop, this.scrollLeft = this.scrollViewport.scrollLeft, this.debounce(this.checkForScrollPosSaving.bind(this)), this.scrollFactorY = this.scrollTop / (this.scrollViewport.scrollHeight - this.scrollViewport.clientHeight), this.scrollFactorX = this.scrollLeft / (this.scrollViewport.scrollWidth - this.scrollViewport.clientWidth), isNaN(this.scrollFactorY) && (this.scrollFactorY = 0), isNaN(this.scrollFactorX) && (this.scrollFactorX = 0), this.adjustBody(), this.adjustArea("footer"), this.adjustArea("header"), this.tableOptions.tableTopBorderVisible && this.removables.push(this.dom.addHorizontalBorder(
|
|
1021
|
+
new T(0, this.hostElement.clientWidth, 1, 0),
|
|
1022
|
+
this.hostElement,
|
|
1023
|
+
"ge-table-border"
|
|
1024
|
+
)), this.tableOptions.tableBottomBorderVisible && this.removables.push(this.dom.addHorizontalBorder(
|
|
1025
|
+
new T(0, this.hostElement.clientWidth, 1, this.hostElement.clientHeight - 1),
|
|
1026
|
+
this.hostElement,
|
|
1027
|
+
"ge-table-border"
|
|
1028
|
+
)), this.tableModel.getFixedLeftColumnCount() > 0 && this.removables.push(this.dom.addVerticalBorder(
|
|
1029
|
+
new T(this.areaBodyWest.child.clientWidth, 1, this.hostElement.clientHeight, 0),
|
|
1030
|
+
this.hostElement,
|
|
1031
|
+
"ge-table-body-west-vertical-border"
|
|
1032
|
+
)), ((e = this.tableModel.getAreaModel("header")) == null ? void 0 : e.getRowCount()) > 0 && this.removables.push(this.dom.addHorizontalBorder(
|
|
1033
|
+
new T(0, this.hostElement.clientWidth, 1, this.areaHeaderCenter.child.clientHeight),
|
|
1034
|
+
this.hostElement,
|
|
1035
|
+
"ge-table-body-west-vertical-border"
|
|
1036
|
+
));
|
|
1525
1037
|
}
|
|
1526
1038
|
checkForScrollPosSaving() {
|
|
1527
|
-
var
|
|
1528
|
-
|
|
1529
|
-
this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
|
|
1530
|
-
}
|
|
1039
|
+
var e, t;
|
|
1040
|
+
this.storeScrollPosStateService && ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreScrollPosition) && this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
|
|
1531
1041
|
}
|
|
1532
|
-
updateCells(
|
|
1533
|
-
|
|
1534
|
-
|
|
1042
|
+
updateCells(e) {
|
|
1043
|
+
e.forEach(
|
|
1044
|
+
(t) => this.tableModel.getAreaModel(t.area).setValue(t.rowIndex, t.columnIndex, t.value)
|
|
1045
|
+
), this.repaint();
|
|
1535
1046
|
}
|
|
1536
|
-
getAreaAndSideIdentByAttr(
|
|
1537
|
-
if (
|
|
1538
|
-
const
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
return [dataArea, dataSide];
|
|
1542
|
-
}
|
|
1047
|
+
getAreaAndSideIdentByAttr(e) {
|
|
1048
|
+
if (e) {
|
|
1049
|
+
const t = this.getStringByAttr(e, "data-area"), s = this.getStringByAttr(e, "data-side");
|
|
1050
|
+
if (s && t)
|
|
1051
|
+
return [t, s];
|
|
1543
1052
|
}
|
|
1544
1053
|
return [void 0, void 0];
|
|
1545
1054
|
}
|
|
1546
|
-
getArea(
|
|
1547
|
-
if (
|
|
1548
|
-
if (
|
|
1055
|
+
getArea(e, t) {
|
|
1056
|
+
if (e === "header") {
|
|
1057
|
+
if (t === "west")
|
|
1549
1058
|
return this.areaHeaderWest;
|
|
1550
|
-
if (
|
|
1059
|
+
if (t === "center")
|
|
1551
1060
|
return this.areaHeaderCenter;
|
|
1552
|
-
if (
|
|
1061
|
+
if (t === "east")
|
|
1553
1062
|
return this.areaHeaderEast;
|
|
1554
|
-
} else if (
|
|
1555
|
-
if (
|
|
1063
|
+
} else if (e === "body") {
|
|
1064
|
+
if (t === "west")
|
|
1556
1065
|
return this.areaBodyWest;
|
|
1557
|
-
if (
|
|
1066
|
+
if (t === "center")
|
|
1558
1067
|
return this.areaBodyCenter;
|
|
1559
|
-
if (
|
|
1068
|
+
if (t === "east")
|
|
1560
1069
|
return this.areaBodyEast;
|
|
1561
|
-
} else if (
|
|
1562
|
-
if (
|
|
1070
|
+
} else if (e === "footer") {
|
|
1071
|
+
if (t === "west")
|
|
1563
1072
|
return this.areaFooterWest;
|
|
1564
|
-
if (
|
|
1073
|
+
if (t === "center")
|
|
1565
1074
|
return this.areaFooterCenter;
|
|
1566
|
-
if (
|
|
1075
|
+
if (t === "east")
|
|
1567
1076
|
return this.areaFooterEast;
|
|
1568
1077
|
}
|
|
1569
|
-
throw Error(`Wrong area identifier: row:${
|
|
1078
|
+
throw Error(`Wrong area identifier: row:${e}, col:${t}`);
|
|
1570
1079
|
}
|
|
1571
1080
|
adjustBody() {
|
|
1572
|
-
const
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
const attr = (_a = srcElement.closest("[" + key + "]")) === null || _a === void 0 ? void 0 : _a.getAttribute(key);
|
|
1582
|
-
if (attr)
|
|
1583
|
-
return Number(attr);
|
|
1081
|
+
const e = this.areaBodyCenterGeo.height - this.tableModel.getContentHeightInPixel(), t = this.scrollFactorY * e;
|
|
1082
|
+
this.dom.setStyle(this.contentDiv, "top", `${this.scrollTop}px`), this.dom.setStyle(this.contentDiv, "left", `${this.scrollViewport.scrollLeft}px`), this.adjustArea("body", t);
|
|
1083
|
+
}
|
|
1084
|
+
getNumberByAttr(e, t) {
|
|
1085
|
+
var s;
|
|
1086
|
+
if (e) {
|
|
1087
|
+
const i = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
|
|
1088
|
+
if (i)
|
|
1089
|
+
return Number(i);
|
|
1584
1090
|
}
|
|
1585
1091
|
return -1;
|
|
1586
1092
|
}
|
|
1587
|
-
getStringByAttr(
|
|
1588
|
-
var
|
|
1589
|
-
if (
|
|
1590
|
-
const
|
|
1591
|
-
if (
|
|
1592
|
-
return
|
|
1093
|
+
getStringByAttr(e, t) {
|
|
1094
|
+
var s;
|
|
1095
|
+
if (e) {
|
|
1096
|
+
const i = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
|
|
1097
|
+
if (i)
|
|
1098
|
+
return i;
|
|
1593
1099
|
}
|
|
1594
1100
|
return "";
|
|
1595
1101
|
}
|
|
1596
|
-
adjustArea(
|
|
1597
|
-
var
|
|
1598
|
-
const
|
|
1599
|
-
|
|
1600
|
-
const
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
}
|
|
1616
|
-
let y = yStart;
|
|
1617
|
-
const columnCount = this.tableModel.getColumnCount();
|
|
1618
|
-
const fixedRightColumnCount = this.tableModel.getFixedRightColumnCount();
|
|
1619
|
-
const fixedLeftColumnCount = this.tableModel.getFixedLeftColumnCount();
|
|
1620
|
-
for (let index = 0; index < rowCount; index++) {
|
|
1621
|
-
const top = y;
|
|
1622
|
-
const lastRowOfModel = index === rowCount - 1;
|
|
1623
|
-
const height = this.tableModel.getRowHeight(areaIdent, index);
|
|
1624
|
-
if (top + height > 0) {
|
|
1625
|
-
this.firstVisibleRowIndex = index;
|
|
1626
|
-
let geo = { left, width, height, top, index };
|
|
1627
|
-
let rowDiv = this.dom.addRowDiv(centerArea, geo, index, areaIdent, "center");
|
|
1628
|
-
const centerStartCol = fixedLeftColumnCount;
|
|
1629
|
-
this.adjustColumnsToRowParent({
|
|
1630
|
-
areaIdent,
|
|
1102
|
+
adjustArea(e, t = 0) {
|
|
1103
|
+
var p;
|
|
1104
|
+
const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"), r = i.child.clientHeight;
|
|
1105
|
+
s.child.innerText = "", i.child.innerText = "", o.child.innerText = "";
|
|
1106
|
+
const l = 0, n = this.areaBodyCenterGeo.width, a = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), S = d.getRowCount();
|
|
1107
|
+
for (; this.cleanupFunctions[e].length; ) {
|
|
1108
|
+
const u = this.cleanupFunctions[e].shift();
|
|
1109
|
+
u && u();
|
|
1110
|
+
}
|
|
1111
|
+
let g = t;
|
|
1112
|
+
const f = this.tableModel.getColumnCount(), c = this.tableModel.getFixedRightColumnCount(), b = this.tableModel.getFixedLeftColumnCount();
|
|
1113
|
+
for (let u = 0; u < S; u++) {
|
|
1114
|
+
const x = g, v = u === S - 1, C = this.tableModel.getRowHeight(e, u);
|
|
1115
|
+
if (x + C > 0) {
|
|
1116
|
+
this.firstVisibleRowIndex = u;
|
|
1117
|
+
let w = { left: l, width: n, height: C, top: x, index: u }, m = this.dom.addRowDiv(i, w, u, e, "center");
|
|
1118
|
+
const M = b;
|
|
1119
|
+
if (this.adjustColumnsToRowParent({
|
|
1120
|
+
areaIdent: e,
|
|
1631
1121
|
sideIdent: "center",
|
|
1632
|
-
areaModel,
|
|
1633
|
-
geo,
|
|
1634
|
-
parent:
|
|
1635
|
-
rowIndex:
|
|
1636
|
-
columnIndexStart:
|
|
1637
|
-
columnIndexEnd:
|
|
1638
|
-
verticalFixed:
|
|
1639
|
-
lastRowOfModel
|
|
1640
|
-
})
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
const div = this.dom.applyStyle(this.dom.setAttribute(this.dom.addDiv(rowDiv, new GeoData(16, 20, 20, 8)), "data-ge-action", "toggleExpandCollapseAll"), { "cursor": "pointer" });
|
|
1675
|
-
const treeOptionsArrow = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1676
|
-
if (treeOptionsArrow) {
|
|
1677
|
-
const textElement = this.dom.domService.createText(treeOptionsArrow.content);
|
|
1678
|
-
this.dom.domService.appendChild(div, textElement);
|
|
1679
|
-
if (treeOptionsArrow.style) {
|
|
1680
|
-
this.dom.applyStyleString(div, treeOptionsArrow.style);
|
|
1681
|
-
}
|
|
1122
|
+
areaModel: d,
|
|
1123
|
+
geo: w,
|
|
1124
|
+
parent: m,
|
|
1125
|
+
rowIndex: u,
|
|
1126
|
+
columnIndexStart: M,
|
|
1127
|
+
columnIndexEnd: f - c - 1,
|
|
1128
|
+
verticalFixed: !1,
|
|
1129
|
+
lastRowOfModel: v
|
|
1130
|
+
}), a.left > 0 && (w = { left: l, width: this.areaBodyWestGeo.width, height: C, top: x, index: u }, m = this.dom.addRowDiv(s, w, u, e, "west"), this.adjustColumnsToRowParent({
|
|
1131
|
+
areaIdent: e,
|
|
1132
|
+
sideIdent: "west",
|
|
1133
|
+
areaModel: d,
|
|
1134
|
+
geo: w,
|
|
1135
|
+
parent: m,
|
|
1136
|
+
rowIndex: u,
|
|
1137
|
+
columnIndexStart: 0,
|
|
1138
|
+
columnIndexEnd: M - 1,
|
|
1139
|
+
verticalFixed: !0,
|
|
1140
|
+
lastRowOfModel: v
|
|
1141
|
+
})), a.right > 0 && (w = { left: l, width: this.areaBodyEastGeo.width, height: C, top: x, index: u }, m = this.dom.addRowDiv(o, w, u, e, "east"), this.adjustColumnsToRowParent({
|
|
1142
|
+
areaIdent: e,
|
|
1143
|
+
sideIdent: "east",
|
|
1144
|
+
areaModel: d,
|
|
1145
|
+
geo: w,
|
|
1146
|
+
parent: m,
|
|
1147
|
+
rowIndex: u,
|
|
1148
|
+
columnIndexStart: f - c,
|
|
1149
|
+
columnIndexEnd: f - 1,
|
|
1150
|
+
verticalFixed: !0,
|
|
1151
|
+
lastRowOfModel: v
|
|
1152
|
+
})), e === "header" && this.tree && u === S - 1) {
|
|
1153
|
+
const E = this.dom.applyStyle(
|
|
1154
|
+
this.dom.setAttribute(
|
|
1155
|
+
this.dom.addDiv(m, new T(16, 20, 20, 8)),
|
|
1156
|
+
"data-ge-action",
|
|
1157
|
+
"toggleExpandCollapseAll"
|
|
1158
|
+
),
|
|
1159
|
+
{ cursor: "pointer" }
|
|
1160
|
+
), R = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1161
|
+
if (R) {
|
|
1162
|
+
const D = this.dom.domService.createText(R.content);
|
|
1163
|
+
this.dom.domService.appendChild(E, D), R.style && this.dom.applyStyleString(E, R.style);
|
|
1682
1164
|
}
|
|
1683
1165
|
}
|
|
1684
1166
|
}
|
|
1685
|
-
|
|
1686
|
-
if (y > divHeight) {
|
|
1167
|
+
if (g = g + C, g > r)
|
|
1687
1168
|
break;
|
|
1688
|
-
}
|
|
1689
1169
|
}
|
|
1690
|
-
if (this.colAndRowspanModels && this.colAndRowspanModels[
|
|
1691
|
-
const
|
|
1692
|
-
if (
|
|
1693
|
-
for (const
|
|
1694
|
-
let
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
if (
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
sideIdent = "east";
|
|
1703
|
-
} else {
|
|
1704
|
-
const virtualRowDivLeftF1 = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1705
|
-
xStart = this.scrollFactorX * virtualRowDivLeftF1 - this.areaBodyWestGeo.width;
|
|
1706
|
-
sideIdent = "center";
|
|
1170
|
+
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1171
|
+
const u = ((p = this.colAndRowspanModels[e]) == null ? void 0 : p.getRanges()) ?? [];
|
|
1172
|
+
if (u.length)
|
|
1173
|
+
for (const x of u) {
|
|
1174
|
+
let v = 0, C = i.child, w = "center";
|
|
1175
|
+
if (x.c1 < b)
|
|
1176
|
+
C = s.child, w = "west";
|
|
1177
|
+
else if (c > 0 && x.c1 >= f - c)
|
|
1178
|
+
C = o.child, w = "east";
|
|
1179
|
+
else {
|
|
1180
|
+
const m = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1181
|
+
v = this.scrollFactorX * m - this.areaBodyWestGeo.width, w = "center";
|
|
1707
1182
|
}
|
|
1708
|
-
this.drawBigCell(
|
|
1183
|
+
this.drawBigCell(x, v, t, d, C, w);
|
|
1709
1184
|
}
|
|
1710
|
-
}
|
|
1711
1185
|
}
|
|
1712
1186
|
}
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
columnIndex: range.c1,
|
|
1768
|
-
cellLeft: x1,
|
|
1769
|
-
cellTop: y1,
|
|
1770
|
-
cellWidth: w,
|
|
1771
|
-
cellHeight: h,
|
|
1772
|
-
parent: parentDiv
|
|
1773
|
-
});
|
|
1774
|
-
}
|
|
1187
|
+
/**
|
|
1188
|
+
* Draws big cells (rowspan and or colspan) in body/center
|
|
1189
|
+
* @param range CellRange
|
|
1190
|
+
* @param xStart X position in pixel for top left corner
|
|
1191
|
+
* @param yStart Y position in pixel for top left corner
|
|
1192
|
+
* @param areaModel AreaModelIf
|
|
1193
|
+
* @param parentDiv Parent div as HTMLDivElement
|
|
1194
|
+
* @param sideIdent SideIdent (west,center,east)
|
|
1195
|
+
* @protected
|
|
1196
|
+
*/
|
|
1197
|
+
drawBigCell(e, t, s, i, o, r) {
|
|
1198
|
+
const l = s + this.getRowHeights(0, e.r1 - 1, i).reduce((p, u) => p + u, 0), n = this.tableModel.getColumnCount(), a = this.tableModel.getFixedRightColumnCount();
|
|
1199
|
+
let d = 0;
|
|
1200
|
+
a > 0 && e.c1 >= n - a && (d = n - a);
|
|
1201
|
+
const S = t + this.getColumnWidths(d, e.c1 - 1).reduce((p, u) => p + u, 0), g = this.getRowHeights(e.r1, e.r2, i).reduce((p, u) => p + u, 0), f = this.getColumnWidths(e.c1, e.c2).reduce((p, u) => p + u, 0);
|
|
1202
|
+
let c = !1;
|
|
1203
|
+
const b = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
1204
|
+
b && (c = b.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? (console.info("TODO here", e), this.renderCell({
|
|
1205
|
+
areaModel: i,
|
|
1206
|
+
areaIdent: i.areaIdent,
|
|
1207
|
+
sideIdent: r,
|
|
1208
|
+
rowIndex: e.r1,
|
|
1209
|
+
columnIndex: e.c1,
|
|
1210
|
+
left: S,
|
|
1211
|
+
top: l,
|
|
1212
|
+
width: f,
|
|
1213
|
+
height: g,
|
|
1214
|
+
parent: o,
|
|
1215
|
+
cellSelected: c,
|
|
1216
|
+
lastRowOfModel: !0,
|
|
1217
|
+
gammaRange: e.gammaRange
|
|
1218
|
+
})) : this.renderCell({
|
|
1219
|
+
areaModel: i,
|
|
1220
|
+
areaIdent: i.areaIdent,
|
|
1221
|
+
sideIdent: r,
|
|
1222
|
+
rowIndex: e.r1,
|
|
1223
|
+
columnIndex: e.c1,
|
|
1224
|
+
left: S,
|
|
1225
|
+
top: l,
|
|
1226
|
+
width: f,
|
|
1227
|
+
height: g,
|
|
1228
|
+
parent: o,
|
|
1229
|
+
cellSelected: c,
|
|
1230
|
+
lastRowOfModel: !0,
|
|
1231
|
+
gammaRange: e.gammaRange
|
|
1232
|
+
}), i.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1233
|
+
rowIndex: e.r1,
|
|
1234
|
+
columnIndex: e.c1,
|
|
1235
|
+
cellLeft: S,
|
|
1236
|
+
cellTop: l,
|
|
1237
|
+
cellWidth: f,
|
|
1238
|
+
cellHeight: g,
|
|
1239
|
+
parent: o
|
|
1240
|
+
});
|
|
1775
1241
|
}
|
|
1776
|
-
findRowOfImportantRowspanCell(
|
|
1777
|
-
const
|
|
1778
|
-
for (let
|
|
1779
|
-
const
|
|
1780
|
-
if (
|
|
1781
|
-
return
|
|
1782
|
-
|
|
1783
|
-
if (rowIndex - r > maxRowspan) {
|
|
1242
|
+
findRowOfImportantRowspanCell(e, t, s) {
|
|
1243
|
+
const i = e.getMaxRowspan();
|
|
1244
|
+
for (let o = t - 1; o > -1; o--) {
|
|
1245
|
+
const r = e.getRowspanAt(o, s);
|
|
1246
|
+
if (r > 1 && o + r + 1 >= t)
|
|
1247
|
+
return o;
|
|
1248
|
+
if (t - o > i)
|
|
1784
1249
|
return -1;
|
|
1785
|
-
}
|
|
1786
1250
|
}
|
|
1787
1251
|
return -1;
|
|
1788
1252
|
}
|
|
1789
|
-
adjustColumnsToRowParent({
|
|
1790
|
-
|
|
1253
|
+
adjustColumnsToRowParent({
|
|
1254
|
+
areaIdent: e,
|
|
1255
|
+
sideIdent: t,
|
|
1256
|
+
areaModel: s,
|
|
1257
|
+
geo: i,
|
|
1258
|
+
parent: o,
|
|
1259
|
+
rowIndex: r,
|
|
1260
|
+
columnIndexStart: l,
|
|
1261
|
+
columnIndexEnd: n,
|
|
1262
|
+
verticalFixed: a = !1,
|
|
1263
|
+
lastRowOfModel: d = !1
|
|
1264
|
+
}) {
|
|
1265
|
+
var b;
|
|
1791
1266
|
this.scrollViewportLeft = this.scrollViewport.scrollLeft;
|
|
1792
|
-
let
|
|
1793
|
-
if (!
|
|
1794
|
-
const
|
|
1795
|
-
|
|
1796
|
-
}
|
|
1797
|
-
const
|
|
1798
|
-
|
|
1799
|
-
let
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
width = this.getColumnWidths(index, index + colspan - 1).reduce((a, b) => a + b, 0);
|
|
1813
|
-
}
|
|
1814
|
-
let skip = false;
|
|
1815
|
-
if (this.colAndRowspanModels && this.colAndRowspanModels[areaIdent]) {
|
|
1816
|
-
if ((_a = this.colAndRowspanModels[areaIdent]) === null || _a === void 0 ? void 0 : _a.isInRange(rowIndex, index)) {
|
|
1817
|
-
skip = true;
|
|
1818
|
-
}
|
|
1819
|
-
}
|
|
1820
|
-
if (this.draggingTargetColumnIndex === index && areaIdent !== "header") {
|
|
1821
|
-
this.renderDragTargetDiv(parent, left, top, width, height);
|
|
1822
|
-
const geo1 = { left, top, width, height };
|
|
1823
|
-
this.dom.addColumnBorderDivs(this.tableOptions, parent, geo1, areaIdent, sideIdent);
|
|
1267
|
+
let S = 0;
|
|
1268
|
+
if (!a) {
|
|
1269
|
+
const p = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1270
|
+
S = this.scrollFactorX * p;
|
|
1271
|
+
}
|
|
1272
|
+
const g = 0, f = !!(e === "body" && t);
|
|
1273
|
+
let c = S;
|
|
1274
|
+
for (let p = l; p <= n; p++) {
|
|
1275
|
+
const u = c, x = this.tableModel.getColumnWidth(p);
|
|
1276
|
+
if (x > 0 && u + x > 0) {
|
|
1277
|
+
let v = i.height;
|
|
1278
|
+
const C = s.getRowspanAt(r, p), w = s.getColspanAt(r, p);
|
|
1279
|
+
C > 1 && (v = this.getRowHeights(r, r + C - 1, s).reduce((E, R) => E + R, 0));
|
|
1280
|
+
let m = x;
|
|
1281
|
+
w > 1 && (m = this.getColumnWidths(p, p + w - 1).reduce((E, R) => E + R, 0));
|
|
1282
|
+
let M = !1;
|
|
1283
|
+
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (b = this.colAndRowspanModels[e]) != null && b.isInRange(r, p) && (M = !0), this.draggingTargetColumnIndex === p && e !== "header") {
|
|
1284
|
+
this.renderDragTargetDiv(o, u, g, m, v);
|
|
1285
|
+
const E = { left: u, top: g, width: m, height: v };
|
|
1286
|
+
this.dom.addColumnBorderDivs(this.tableOptions, o, E, e, t);
|
|
1824
1287
|
} else {
|
|
1825
|
-
const
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
cellWidth: width,
|
|
1850
|
-
cellHeight: height,
|
|
1851
|
-
parent
|
|
1852
|
-
});
|
|
1853
|
-
}
|
|
1288
|
+
const E = this.renderSelectedBackgroundDiv(M, f, t, s, r, p, o, u, g, m, v);
|
|
1289
|
+
M || this.renderCell({
|
|
1290
|
+
areaModel: s,
|
|
1291
|
+
areaIdent: e,
|
|
1292
|
+
sideIdent: t,
|
|
1293
|
+
rowIndex: r,
|
|
1294
|
+
columnIndex: p,
|
|
1295
|
+
left: u,
|
|
1296
|
+
top: g,
|
|
1297
|
+
width: m,
|
|
1298
|
+
height: v,
|
|
1299
|
+
parent: o,
|
|
1300
|
+
cellSelected: E,
|
|
1301
|
+
lastRowOfModel: d,
|
|
1302
|
+
gammaRange: !0
|
|
1303
|
+
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1304
|
+
rowIndex: r,
|
|
1305
|
+
columnIndex: p,
|
|
1306
|
+
cellLeft: u,
|
|
1307
|
+
cellTop: g,
|
|
1308
|
+
cellWidth: m,
|
|
1309
|
+
cellHeight: v,
|
|
1310
|
+
parent: o
|
|
1311
|
+
});
|
|
1854
1312
|
}
|
|
1855
1313
|
}
|
|
1856
|
-
|
|
1857
|
-
if (x > this.areaBodyCenterGeo.width) {
|
|
1314
|
+
if (c = c + x, c > this.areaBodyCenterGeo.width)
|
|
1858
1315
|
break;
|
|
1859
|
-
}
|
|
1860
|
-
}
|
|
1861
|
-
if (this.tableOptions.verticalBorderVisible) {
|
|
1862
|
-
this.dom.addVerticalBorder(new GeoData(x - 1, 1, geo.height, 0), parent);
|
|
1863
1316
|
}
|
|
1317
|
+
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(c - 1, 1, i.height, 0), o);
|
|
1864
1318
|
}
|
|
1865
1319
|
getTreeArrowColumnIndex() {
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
}
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
}
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
const
|
|
1918
|
-
if (
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
}
|
|
1939
|
-
}
|
|
1940
|
-
return [cell, fn];
|
|
1941
|
-
}
|
|
1942
|
-
getColumnWidths(startIndex, endIndex) {
|
|
1943
|
-
const ret = [];
|
|
1944
|
-
for (let i = startIndex; i <= endIndex; i++) {
|
|
1945
|
-
ret.push(this.tableModel.getColumnWidth(i));
|
|
1946
|
-
}
|
|
1947
|
-
return ret;
|
|
1948
|
-
}
|
|
1949
|
-
getRowHeights(startIndex, endIndex, areaModel) {
|
|
1950
|
-
const ret = [];
|
|
1951
|
-
for (let i = startIndex; i <= endIndex; i++) {
|
|
1952
|
-
ret.push(areaModel.getRowHeight(i));
|
|
1953
|
-
}
|
|
1954
|
-
return ret;
|
|
1955
|
-
}
|
|
1956
|
-
adjustHoverRows(mouseMoveEvent) {
|
|
1957
|
-
if (this.tableOptions.hoverRowVisible && mouseMoveEvent.rowIndex > -1) {
|
|
1958
|
-
const width = this.hostElement.clientWidth;
|
|
1959
|
-
const rowHeight = this.tableModel.getAreaModel("body").getRowHeight(mouseMoveEvent.rowIndex);
|
|
1960
|
-
const top = mouseMoveEvent.rowTop + this.areaHeaderCenter.parent.clientHeight - this.scrollTop;
|
|
1320
|
+
return this.tableOptions.showCheckboxWihoutExtraColumn ? 0 : this.tableModel.isRowCheckboxVisible() ? 1 : 0;
|
|
1321
|
+
}
|
|
1322
|
+
addAndRenderCellDiv({
|
|
1323
|
+
areaModel: e,
|
|
1324
|
+
areaIdent: t,
|
|
1325
|
+
sideIdent: s,
|
|
1326
|
+
rowIndex: i,
|
|
1327
|
+
index: o,
|
|
1328
|
+
left: r,
|
|
1329
|
+
width: l,
|
|
1330
|
+
height: n,
|
|
1331
|
+
top: a,
|
|
1332
|
+
parent: d,
|
|
1333
|
+
lastRowOfModel: S
|
|
1334
|
+
}) {
|
|
1335
|
+
var V;
|
|
1336
|
+
const f = this.editorRenderer && this.editorRendererRow === i && this.editorRendererColumn === o ? this.editorRenderer : e.getCellRenderer(i, o), c = { left: r, width: l, height: n, top: a, index: o }, b = e.getRowByIndex(i);
|
|
1337
|
+
let p = "none";
|
|
1338
|
+
if (o === this.getTreeArrowColumnIndex() && b instanceof O) {
|
|
1339
|
+
const y = b;
|
|
1340
|
+
(V = y.children) != null && V.length ? y.expanded ? p = "expanded" : p = "collapsed" : p = "hidden";
|
|
1341
|
+
}
|
|
1342
|
+
let x;
|
|
1343
|
+
if (t === "header") {
|
|
1344
|
+
const y = this.tableModel.getColumnDef(o);
|
|
1345
|
+
(!(y != null && y.sortIconVisible) || y != null && y.sortIconVisible()) && (x = y == null ? void 0 : y.sortState);
|
|
1346
|
+
}
|
|
1347
|
+
const v = e.getValueAt(i, o), C = f ? "" : `${v}`, w = e.isRowChecked(i), m = this.dom.addColumnDiv(
|
|
1348
|
+
d,
|
|
1349
|
+
c,
|
|
1350
|
+
i,
|
|
1351
|
+
o,
|
|
1352
|
+
t,
|
|
1353
|
+
s,
|
|
1354
|
+
C,
|
|
1355
|
+
p,
|
|
1356
|
+
this.tableOptions,
|
|
1357
|
+
w,
|
|
1358
|
+
x
|
|
1359
|
+
), M = e.getTooltipAt(i, o);
|
|
1360
|
+
M && this.dom.setAttribute(m, "title", M);
|
|
1361
|
+
const E = this.tableModel.getColumnDef(o);
|
|
1362
|
+
E && E.classes[t] && this.dom.addClasses(E.classes[t], m);
|
|
1363
|
+
let R;
|
|
1364
|
+
f && (R = f.render(m, i, o, t, e, v, this.dom.domService));
|
|
1365
|
+
const D = e.getCustomClassesAt(i, o);
|
|
1366
|
+
if (D.length && this.dom.addClasses(D, m), this.dom.addColumnBorderDivs(this.tableOptions, d, c, t, s), S && this.dom.addHorizontalBorder({ left: r, width: l, height: n, top: a + n }, d), this.getFocusModel && t === "body") {
|
|
1367
|
+
const y = this.getFocusModel();
|
|
1368
|
+
y != null && y.hasFocus(i, o) && this.dom.addFocusBorderDivs(d, c, {});
|
|
1369
|
+
}
|
|
1370
|
+
t === "header" && this.dom.setAttribute(m, "data-ge-action", "drag-column");
|
|
1371
|
+
const F = e.getCustomStyleAt(i, o);
|
|
1372
|
+
if (F)
|
|
1373
|
+
for (const y in F)
|
|
1374
|
+
this.dom.setStyle(m, y, F[y]);
|
|
1375
|
+
return [m, R];
|
|
1376
|
+
}
|
|
1377
|
+
getColumnWidths(e, t) {
|
|
1378
|
+
const s = [];
|
|
1379
|
+
for (let i = e; i <= t; i++)
|
|
1380
|
+
s.push(this.tableModel.getColumnWidth(i));
|
|
1381
|
+
return s;
|
|
1382
|
+
}
|
|
1383
|
+
getRowHeights(e, t, s) {
|
|
1384
|
+
const i = [];
|
|
1385
|
+
for (let o = e; o <= t; o++)
|
|
1386
|
+
i.push(s.getRowHeight(o));
|
|
1387
|
+
return i;
|
|
1388
|
+
}
|
|
1389
|
+
adjustHoverRows(e) {
|
|
1390
|
+
if (this.tableOptions.hoverRowVisible && e.rowIndex > -1) {
|
|
1391
|
+
const t = this.hostElement.clientWidth, s = this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex), i = e.rowTop + this.areaHeaderCenter.parent.clientHeight - this.scrollTop;
|
|
1961
1392
|
this.dom.applyStyle(this.hoverRow, {
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1393
|
+
left: "0",
|
|
1394
|
+
top: i + "px",
|
|
1395
|
+
width: t + "px",
|
|
1396
|
+
height: s + "px",
|
|
1397
|
+
display: "block"
|
|
1967
1398
|
});
|
|
1968
|
-
} else
|
|
1399
|
+
} else
|
|
1969
1400
|
this.hideHoverRow();
|
|
1970
|
-
}
|
|
1971
1401
|
}
|
|
1972
1402
|
hideHoverRow() {
|
|
1973
1403
|
this.dom.applyStyle(this.hoverRow, {
|
|
1974
|
-
|
|
1404
|
+
display: "none"
|
|
1975
1405
|
});
|
|
1976
1406
|
}
|
|
1977
|
-
adjustHoverColumns(
|
|
1978
|
-
if (this.tableOptions.hoverColumnVisible &&
|
|
1979
|
-
const
|
|
1980
|
-
const width = this.tableModel.getColumnWidth(mouseMoveEvent.columnIndex);
|
|
1981
|
-
const fixedWest = this.areaBodyWestGeo.width;
|
|
1982
|
-
const left = mouseMoveEvent.columnLeft + this.tableModel.getPadding().left - this.scrollLeft - fixedWest;
|
|
1407
|
+
adjustHoverColumns(e) {
|
|
1408
|
+
if (this.tableOptions.hoverColumnVisible && e.rowIndex > -1) {
|
|
1409
|
+
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;
|
|
1983
1410
|
this.dom.applyStyle(this.hoverColumn, {
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1411
|
+
left: o + "px",
|
|
1412
|
+
top: "0px",
|
|
1413
|
+
width: s + "px",
|
|
1414
|
+
height: t + "px",
|
|
1415
|
+
display: "block"
|
|
1989
1416
|
});
|
|
1990
|
-
} else
|
|
1417
|
+
} else
|
|
1991
1418
|
this.hideHoverColumn();
|
|
1992
|
-
}
|
|
1993
1419
|
}
|
|
1994
1420
|
hideHoverColumn() {
|
|
1995
1421
|
this.dom.applyStyle(this.hoverColumn, {
|
|
1996
|
-
|
|
1422
|
+
display: "none"
|
|
1997
1423
|
});
|
|
1998
1424
|
}
|
|
1999
|
-
debounce(
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
for (let i = 0; i < count; i++) {
|
|
2022
|
-
const div = this.dom.applyStylePosistionAbsolute(
|
|
2023
|
-
this.dom.createDivWithClass(`ge-table-${areaModel.areaIdent}-${sideIdent}-selected-range`, parent)
|
|
2024
|
-
);
|
|
2025
|
-
this.dom.setStyle(div, "left", `${left}px`);
|
|
2026
|
-
this.dom.setStyle(div, "top", `${top}px`);
|
|
2027
|
-
this.dom.setStyle(div, "width", `${width}px`);
|
|
2028
|
-
this.dom.setStyle(div, "height", `${height}px`);
|
|
2029
|
-
}
|
|
1425
|
+
debounce(e, t = 1e3) {
|
|
1426
|
+
this.debounceTimeout && clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(e.bind(this), t);
|
|
1427
|
+
}
|
|
1428
|
+
renderDragTargetDiv(e, t, s, i, o) {
|
|
1429
|
+
const r = this.dom.applyStylePosistionAbsolute(
|
|
1430
|
+
this.dom.createDivWithClass("ge-table-drop-zone", e)
|
|
1431
|
+
);
|
|
1432
|
+
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;
|
|
1433
|
+
}
|
|
1434
|
+
renderSelectedBackgroundDiv(e, t, s, i, o, r, l, n, a, d, S) {
|
|
1435
|
+
let g = !1;
|
|
1436
|
+
if (!e && t && i.isSelectable(o, r) && this.getSelectionModel) {
|
|
1437
|
+
const f = this.getSelectionModel();
|
|
1438
|
+
if (f) {
|
|
1439
|
+
const c = f.getSelectionCount(o, r);
|
|
1440
|
+
g = c > 0;
|
|
1441
|
+
for (let b = 0; b < c; b++) {
|
|
1442
|
+
const p = this.dom.applyStylePosistionAbsolute(
|
|
1443
|
+
// ge-table-body-west-selected-range
|
|
1444
|
+
this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`, l)
|
|
1445
|
+
);
|
|
1446
|
+
this.dom.setStyle(p, "left", `${n}px`), this.dom.setStyle(p, "top", `${a}px`), this.dom.setStyle(p, "width", `${d}px`), this.dom.setStyle(p, "height", `${S}px`);
|
|
2030
1447
|
}
|
|
2031
1448
|
}
|
|
2032
1449
|
}
|
|
2033
|
-
return
|
|
2034
|
-
}
|
|
2035
|
-
renderCell({
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
1450
|
+
return g;
|
|
1451
|
+
}
|
|
1452
|
+
renderCell({
|
|
1453
|
+
areaModel: e,
|
|
1454
|
+
areaIdent: t,
|
|
1455
|
+
sideIdent: s,
|
|
1456
|
+
rowIndex: i,
|
|
1457
|
+
columnIndex: o,
|
|
1458
|
+
left: r,
|
|
1459
|
+
top: l,
|
|
1460
|
+
width: n,
|
|
1461
|
+
height: a,
|
|
1462
|
+
parent: d,
|
|
1463
|
+
cellSelected: S,
|
|
1464
|
+
lastRowOfModel: g,
|
|
1465
|
+
gammaRange: f
|
|
1466
|
+
}) {
|
|
1467
|
+
const [c, b] = this.addAndRenderCellDiv({
|
|
1468
|
+
areaModel: e,
|
|
1469
|
+
areaIdent: t,
|
|
1470
|
+
sideIdent: s,
|
|
1471
|
+
rowIndex: i,
|
|
1472
|
+
index: o,
|
|
1473
|
+
left: r,
|
|
1474
|
+
width: n,
|
|
1475
|
+
height: a,
|
|
1476
|
+
top: l,
|
|
1477
|
+
parent: d,
|
|
1478
|
+
lastRowOfModel: g,
|
|
1479
|
+
gammaRange: f
|
|
2049
1480
|
});
|
|
2050
|
-
|
|
2051
|
-
this.dom.addClass(`ge-table-${areaIdent}-${sideIdent}-selected-range`, div);
|
|
2052
|
-
}
|
|
2053
|
-
if (fn) {
|
|
2054
|
-
this.cleanupFunctions[areaIdent].push(fn);
|
|
2055
|
-
}
|
|
1481
|
+
S && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, c), b && this.cleanupFunctions[t].push(b);
|
|
2056
1482
|
}
|
|
2057
|
-
renderHeaderCellResizeHandle({ rowIndex, columnIndex, cellLeft, cellTop, cellWidth, cellHeight, parent }) {
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
const handleWidth = (_a = this.tableOptions.columnResizeHandleWidthInPx) !== null && _a !== void 0 ? _a : 2;
|
|
2061
|
-
const div = domService.createElement("div");
|
|
2062
|
-
domService.setAttribute(div, "data-col-index", `${columnIndex}`);
|
|
2063
|
-
domService.setAttribute(div, "data-row-index", `${rowIndex}`);
|
|
2064
|
-
domService.setAttribute(div, "data-area", "header");
|
|
2065
|
-
domService.setAttribute(div, "data-ge-action", "resize-column");
|
|
2066
|
-
domService.addClass(div, `ge-table-column-resize-handle`);
|
|
2067
|
-
domService.setStyle(div, "display", "clip");
|
|
2068
|
-
domService.setStyle(div, "position", "absolute");
|
|
2069
|
-
domService.setStyle(div, "cursor", "col-resize");
|
|
2070
|
-
domService.setStyle(div, "left", `${cellLeft + cellWidth - handleWidth}px`);
|
|
2071
|
-
domService.setStyle(div, "top", `${cellTop}px`);
|
|
2072
|
-
domService.setStyle(div, "width", `${handleWidth}px`);
|
|
2073
|
-
domService.setStyle(div, "height", `${cellHeight}px`);
|
|
2074
|
-
domService.appendChild(parent, div);
|
|
1483
|
+
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight: r, parent: l }) {
|
|
1484
|
+
const n = this.dom.domService, a = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = n.createElement("div");
|
|
1485
|
+
n.setAttribute(d, "data-col-index", `${t}`), n.setAttribute(d, "data-row-index", `${e}`), n.setAttribute(d, "data-area", "header"), n.setAttribute(d, "data-ge-action", "resize-column"), n.addClass(d, "ge-table-column-resize-handle"), n.setStyle(d, "display", "clip"), n.setStyle(d, "position", "absolute"), n.setStyle(d, "cursor", "col-resize"), n.setStyle(d, "left", `${s + o - a}px`), n.setStyle(d, "top", `${i}px`), n.setStyle(d, "width", `${a}px`), n.setStyle(d, "height", `${r}px`), n.appendChild(l, d);
|
|
2075
1486
|
}
|
|
2076
1487
|
}
|
|
2077
|
-
class
|
|
2078
|
-
constructor(
|
|
2079
|
-
this.columnIndex =
|
|
2080
|
-
this.sortState = sortState;
|
|
1488
|
+
class de {
|
|
1489
|
+
constructor(e, t) {
|
|
1490
|
+
this.columnIndex = e, this.sortState = t;
|
|
2081
1491
|
}
|
|
2082
1492
|
}
|
|
2083
|
-
class
|
|
2084
|
-
constructor(
|
|
2085
|
-
this.tableScope = tableScope;
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
const columnIndexStr = htmpInputEle.getAttribute("data-col-index");
|
|
2094
|
-
if (areaIdentStr && rowIndexStr && columnIndexStr) {
|
|
2095
|
-
const area = getAreaIdentByString(areaIdentStr);
|
|
2096
|
-
const rowIndex = Number(rowIndexStr);
|
|
2097
|
-
const columnIndex = Number(columnIndexStr);
|
|
2098
|
-
this.tableScope.updateModelValueAfterEdit(area, rowIndex, columnIndex, htmpInputEle.value);
|
|
1493
|
+
class he {
|
|
1494
|
+
constructor(e) {
|
|
1495
|
+
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
1496
|
+
}
|
|
1497
|
+
onHostElementChanged(e) {
|
|
1498
|
+
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1499
|
+
const t = e.target, s = t.getAttribute("data-area"), i = t.getAttribute("data-row-index"), o = t.getAttribute("data-col-index");
|
|
1500
|
+
if (s && i && o) {
|
|
1501
|
+
const r = $(s), l = Number(i), n = Number(o);
|
|
1502
|
+
this.tableScope.updateModelValueAfterEdit(r, l, n, t.value);
|
|
2099
1503
|
}
|
|
2100
1504
|
}
|
|
2101
1505
|
}
|
|
2102
1506
|
}
|
|
2103
|
-
class
|
|
2104
|
-
constructor(
|
|
2105
|
-
this.rowIndex =
|
|
2106
|
-
this.columnIndex = columnIndex;
|
|
1507
|
+
class ce {
|
|
1508
|
+
constructor(e = -1, t = -1) {
|
|
1509
|
+
this.rowIndex = e, this.columnIndex = t;
|
|
2107
1510
|
}
|
|
2108
1511
|
}
|
|
2109
|
-
class
|
|
2110
|
-
constructor(
|
|
2111
|
-
this.cells =
|
|
1512
|
+
class _ {
|
|
1513
|
+
constructor(e) {
|
|
1514
|
+
this.cells = e;
|
|
2112
1515
|
}
|
|
2113
|
-
static createSingle(
|
|
2114
|
-
return new
|
|
1516
|
+
static createSingle(e, t) {
|
|
1517
|
+
return new _([new ce(e, t)]);
|
|
2115
1518
|
}
|
|
2116
1519
|
}
|
|
2117
|
-
class
|
|
2118
|
-
constructor(
|
|
2119
|
-
var
|
|
2120
|
-
this.tableScope = tableScope;
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
this.getFocusModel = this.tableScope.tableOptions.getFocusModel;
|
|
2126
|
-
}
|
|
2127
|
-
}
|
|
2128
|
-
onMouseClicked(evt, _previousEvt) {
|
|
2129
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
2130
|
-
let dirty = false;
|
|
2131
|
-
let deletePreviousEvent = false;
|
|
1520
|
+
class pe {
|
|
1521
|
+
constructor(e) {
|
|
1522
|
+
var t, s;
|
|
1523
|
+
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);
|
|
1524
|
+
}
|
|
1525
|
+
onMouseClicked(e, t) {
|
|
1526
|
+
var o, r, l, n, a, d, S;
|
|
1527
|
+
let s = !1, i = !1;
|
|
2132
1528
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
2133
|
-
const
|
|
2134
|
-
|
|
2135
|
-
if (sm && fm) {
|
|
2136
|
-
if (!fm.hasFocus(evt.rowIndex, evt.columnIndex)) {
|
|
2137
|
-
fm.setFocus(evt.rowIndex, evt.columnIndex);
|
|
2138
|
-
dirty = true;
|
|
2139
|
-
}
|
|
2140
|
-
if (!((_a = evt.originalEvent) === null || _a === void 0 ? void 0 : _a.shiftKey)) {
|
|
2141
|
-
if (sm.hasSelection()) {
|
|
2142
|
-
sm.clear();
|
|
2143
|
-
dirty = true;
|
|
2144
|
-
}
|
|
2145
|
-
}
|
|
2146
|
-
if (((_b = evt.originalEvent) === null || _b === void 0 ? void 0 : _b.shiftKey) && this.previousEvt) {
|
|
2147
|
-
sm.addSelection(this.createRangeByEvents(evt, this.previousEvt));
|
|
2148
|
-
deletePreviousEvent = true;
|
|
2149
|
-
dirty = true;
|
|
2150
|
-
} else if (((_c = evt.originalEvent) === null || _c === void 0 ? void 0 : _c.ctrlKey) || ((_d = evt.originalEvent) === null || _d === void 0 ? void 0 : _d.metaKey)) {
|
|
2151
|
-
sm.addSelection(CellRange.singleCell(evt.rowIndex, evt.columnIndex));
|
|
2152
|
-
deletePreviousEvent = true;
|
|
2153
|
-
dirty = true;
|
|
2154
|
-
} else if (((_e = evt.originalEvent) === null || _e === void 0 ? void 0 : _e.altKey) && (((_f = evt.originalEvent) === null || _f === void 0 ? void 0 : _f.ctrlKey) || ((_g = evt.originalEvent) === null || _g === void 0 ? void 0 : _g.metaKey))) {
|
|
2155
|
-
sm.removeSelection(CellRange.singleCell(evt.rowIndex, evt.columnIndex));
|
|
2156
|
-
deletePreviousEvent = true;
|
|
2157
|
-
dirty = true;
|
|
2158
|
-
}
|
|
2159
|
-
}
|
|
1529
|
+
const g = this.getSelectionModel(), f = this.getFocusModel();
|
|
1530
|
+
g && f && (f.hasFocus(e.rowIndex, e.columnIndex) || (f.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) : (l = e.originalEvent) != null && l.ctrlKey || (n = e.originalEvent) != null && n.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 || (S = e.originalEvent) != null && S.metaKey) && (g.removeSelection(A.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0));
|
|
2160
1531
|
}
|
|
2161
|
-
|
|
2162
|
-
this.previousEvt = void 0;
|
|
2163
|
-
} else {
|
|
2164
|
-
this.previousEvt = evt === null || evt === void 0 ? void 0 : evt.clone();
|
|
2165
|
-
}
|
|
2166
|
-
return dirty;
|
|
1532
|
+
return i ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
2167
1533
|
}
|
|
2168
|
-
onActionTriggered(
|
|
1534
|
+
onActionTriggered(e) {
|
|
2169
1535
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
2170
|
-
const
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
this.tableScope.repaint();
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
sm.clear();
|
|
2180
|
-
this.tableScope.repaint();
|
|
2181
|
-
return true;
|
|
2182
|
-
}
|
|
2183
|
-
if (actionId === "TOGGLE_SELECTION") {
|
|
2184
|
-
const [row, col] = fm.getFocus();
|
|
2185
|
-
sm.togglePoint(row, col);
|
|
2186
|
-
this.tableScope.repaint();
|
|
2187
|
-
return true;
|
|
1536
|
+
const t = this.getSelectionModel(), s = this.getFocusModel();
|
|
1537
|
+
if (t && s) {
|
|
1538
|
+
if (e === "SELECT_ALL")
|
|
1539
|
+
return t.selectAll(), this.tableScope.repaint(), !0;
|
|
1540
|
+
if (e === "DESELECT_ALL")
|
|
1541
|
+
return t.clear(), this.tableScope.repaint(), !0;
|
|
1542
|
+
if (e === "TOGGLE_SELECTION") {
|
|
1543
|
+
const [i, o] = s.getFocus();
|
|
1544
|
+
return t.togglePoint(i, o), this.tableScope.repaint(), !0;
|
|
2188
1545
|
}
|
|
2189
1546
|
}
|
|
2190
1547
|
}
|
|
2191
|
-
return
|
|
1548
|
+
return !1;
|
|
2192
1549
|
}
|
|
2193
|
-
createRangeByEvents(
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
return CellRange.create({
|
|
2202
|
-
rowIndex1: r1,
|
|
2203
|
-
columnIndex1: c1,
|
|
2204
|
-
rowIndex2: r2,
|
|
2205
|
-
columnIndex2: c2
|
|
1550
|
+
createRangeByEvents(e, t) {
|
|
1551
|
+
t || (t = e);
|
|
1552
|
+
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);
|
|
1553
|
+
return A.create({
|
|
1554
|
+
rowIndex1: s,
|
|
1555
|
+
columnIndex1: o,
|
|
1556
|
+
rowIndex2: i,
|
|
1557
|
+
columnIndex2: r
|
|
2206
1558
|
});
|
|
2207
1559
|
}
|
|
2208
1560
|
}
|
|
2209
|
-
class
|
|
1561
|
+
class ue {
|
|
2210
1562
|
get() {
|
|
2211
1563
|
return {
|
|
2212
|
-
|
|
2213
|
-
|
|
1564
|
+
f2: "START_EDITING",
|
|
1565
|
+
space: "TOGGLE_SELECTION",
|
|
2214
1566
|
"ctrl+num_add": "SELECT_ALL",
|
|
2215
1567
|
"ctrl+a": "SELECT_ALL",
|
|
2216
1568
|
"ctrl+shift+a": "DESELECT_ALL",
|
|
2217
1569
|
"ctrl+x": "DESELECT_ALL",
|
|
2218
1570
|
"ctrl+num_subtract": "DESELECT_ALL",
|
|
2219
1571
|
"cmd -": "DESELECT_ALL",
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
1572
|
+
arrowup: "NAVIGATE_UP",
|
|
1573
|
+
arrowdown: "NAVIGATE_DOWN",
|
|
1574
|
+
arrowleft: "NAVIGATE_LEFT",
|
|
1575
|
+
arrowright: "NAVIGATE_RIGHT"
|
|
2224
1576
|
};
|
|
2225
1577
|
}
|
|
2226
1578
|
}
|
|
2227
|
-
class
|
|
1579
|
+
class Se {
|
|
2228
1580
|
get() {
|
|
2229
1581
|
return {
|
|
2230
|
-
|
|
2231
|
-
|
|
1582
|
+
f2: "START_EDITING",
|
|
1583
|
+
space: "TOGGLE_SELECTION",
|
|
2232
1584
|
"ctrl+num_add": "SELECT_ALL",
|
|
2233
1585
|
"cmd+a": "SELECT_ALL",
|
|
2234
1586
|
"ctrl+a": "SELECT_ALL",
|
|
@@ -2237,37 +1589,22 @@ class OsxShortcutActionIdMapping {
|
|
|
2237
1589
|
"ctrl+shift+a": "DESELECT_ALL",
|
|
2238
1590
|
"ctrl+num_subtract": "DESELECT_ALL",
|
|
2239
1591
|
"ctrl -": "DESELECT_ALL",
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
1592
|
+
arrowup: "NAVIGATE_UP",
|
|
1593
|
+
arrowdown: "NAVIGATE_DOWN",
|
|
1594
|
+
arrowleft: "NAVIGATE_LEFT",
|
|
1595
|
+
arrowright: "NAVIGATE_RIGHT"
|
|
2244
1596
|
};
|
|
2245
1597
|
}
|
|
2246
1598
|
}
|
|
2247
|
-
class
|
|
2248
|
-
constructor(
|
|
2249
|
-
this.tableScope =
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
this.listener.push(
|
|
2253
|
-
this.init();
|
|
2254
|
-
}
|
|
2255
|
-
addListener(listener) {
|
|
2256
|
-
if (!this.listener.includes(listener)) {
|
|
2257
|
-
this.listener.push(listener);
|
|
2258
|
-
}
|
|
1599
|
+
class ge {
|
|
1600
|
+
constructor(e) {
|
|
1601
|
+
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
1602
|
+
}
|
|
1603
|
+
addListener(e) {
|
|
1604
|
+
this.listener.includes(e) || this.listener.push(e);
|
|
2259
1605
|
}
|
|
2260
1606
|
init() {
|
|
2261
|
-
|
|
2262
|
-
Object.assign(this.shortcutActionIdMapping, new OsxShortcutActionIdMapping().get());
|
|
2263
|
-
} else {
|
|
2264
|
-
Object.assign(this.shortcutActionIdMapping, new WindowsShortcutActionIdMapping().get());
|
|
2265
|
-
}
|
|
2266
|
-
Object.assign(this.shortcutActionIdMapping, this.tableScope.tableOptions.shortcutActionIdMapping);
|
|
2267
|
-
if (this.isDebug()) {
|
|
2268
|
-
console.debug("ShortcutService", this.shortcutActionIdMapping);
|
|
2269
|
-
}
|
|
2270
|
-
this.tableScope.hostElement.addEventListener("keydown", this.onKeyDown.bind(this));
|
|
1607
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new Se().get()) : Object.assign(this.shortcutActionIdMapping, new ue().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));
|
|
2271
1608
|
}
|
|
2272
1609
|
isMacintosh() {
|
|
2273
1610
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -2278,657 +1615,353 @@ class ShortcutService {
|
|
|
2278
1615
|
isLocalhost() {
|
|
2279
1616
|
return location.hostname === "localhost" || location.hostname === "127.0.0.1";
|
|
2280
1617
|
}
|
|
2281
|
-
onKeyDown(
|
|
2282
|
-
const
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
return this.shortcutActionIdMapping[key];
|
|
2313
|
-
}
|
|
2314
|
-
}
|
|
2315
|
-
return void 0;
|
|
2316
|
-
}
|
|
2317
|
-
areTokensEquals(tokens1, tokens2) {
|
|
2318
|
-
if (tokens1.length !== tokens2.length) {
|
|
2319
|
-
return false;
|
|
2320
|
-
}
|
|
2321
|
-
if (tokens1.length === 0) {
|
|
2322
|
-
return false;
|
|
2323
|
-
}
|
|
2324
|
-
for (let i = 0; i < tokens1.length; i++) {
|
|
2325
|
-
if (tokens1[i] !== tokens2[i]) {
|
|
2326
|
-
return false;
|
|
2327
|
-
}
|
|
2328
|
-
}
|
|
2329
|
-
return true;
|
|
2330
|
-
}
|
|
2331
|
-
getTokenByEvent(evt) {
|
|
2332
|
-
const tokens = [];
|
|
2333
|
-
if (evt.altKey) {
|
|
2334
|
-
tokens.push("alt");
|
|
2335
|
-
}
|
|
2336
|
-
if (evt.shiftKey) {
|
|
2337
|
-
tokens.push("shift");
|
|
2338
|
-
}
|
|
2339
|
-
if (evt.ctrlKey) {
|
|
2340
|
-
tokens.push("ctrl");
|
|
2341
|
-
}
|
|
2342
|
-
if (evt.metaKey) {
|
|
2343
|
-
tokens.push("meta");
|
|
2344
|
-
}
|
|
2345
|
-
if (evt.code) {
|
|
2346
|
-
tokens.push(evt.code.toLowerCase().replace(/key/g, ""));
|
|
2347
|
-
}
|
|
2348
|
-
return tokens.sort();
|
|
1618
|
+
onKeyDown(e) {
|
|
1619
|
+
const t = this.findEnty(e);
|
|
1620
|
+
t && this.emit(t) && (e.preventDefault(), e.stopPropagation());
|
|
1621
|
+
}
|
|
1622
|
+
emit(e) {
|
|
1623
|
+
this.isDebug() && console.debug("ShortcutService emit:", e);
|
|
1624
|
+
let t = !1;
|
|
1625
|
+
for (const s of this.listener)
|
|
1626
|
+
s.onActionTriggered(e) && (t = !0);
|
|
1627
|
+
return t;
|
|
1628
|
+
}
|
|
1629
|
+
findEnty(e) {
|
|
1630
|
+
const t = this.getTokenByEvent(e);
|
|
1631
|
+
this.isDebug() && console.debug("ShortcutService tokens:", t);
|
|
1632
|
+
for (const s in this.shortcutActionIdMapping) {
|
|
1633
|
+
const i = s.replace(/opt/g, "alt").replace(/cmd/g, "meta").split(/[\+ ]/g).sort();
|
|
1634
|
+
if (this.areTokensEquals(t, i))
|
|
1635
|
+
return this.shortcutActionIdMapping[s];
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
areTokensEquals(e, t) {
|
|
1639
|
+
if (e.length !== t.length || e.length === 0)
|
|
1640
|
+
return !1;
|
|
1641
|
+
for (let s = 0; s < e.length; s++)
|
|
1642
|
+
if (e[s] !== t[s])
|
|
1643
|
+
return !1;
|
|
1644
|
+
return !0;
|
|
1645
|
+
}
|
|
1646
|
+
getTokenByEvent(e) {
|
|
1647
|
+
const t = [];
|
|
1648
|
+
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();
|
|
2349
1649
|
}
|
|
2350
1650
|
}
|
|
2351
|
-
class
|
|
2352
|
-
onCheckboxChanged(
|
|
1651
|
+
class fe {
|
|
1652
|
+
onCheckboxChanged(e) {
|
|
2353
1653
|
}
|
|
2354
|
-
onContextmenu(
|
|
1654
|
+
onContextmenu(e) {
|
|
2355
1655
|
}
|
|
2356
|
-
onModelChanged(
|
|
1656
|
+
onModelChanged(e) {
|
|
2357
1657
|
}
|
|
2358
|
-
onMouseClicked(
|
|
1658
|
+
onMouseClicked(e) {
|
|
2359
1659
|
}
|
|
2360
|
-
onMouseDragging(
|
|
1660
|
+
onMouseDragging(e) {
|
|
2361
1661
|
}
|
|
2362
|
-
onMouseDraggingEnd(
|
|
1662
|
+
onMouseDraggingEnd(e) {
|
|
2363
1663
|
}
|
|
2364
|
-
onMouseMoved(
|
|
1664
|
+
onMouseMoved(e) {
|
|
2365
1665
|
}
|
|
2366
1666
|
}
|
|
2367
|
-
class
|
|
2368
|
-
constructor(
|
|
2369
|
-
var
|
|
2370
|
-
super(
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
this.mouseStartWidth = -1
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
if (
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
}
|
|
2397
|
-
this.mouseHandler = new MouseHandler(this);
|
|
2398
|
-
this.inputHandler = new InputHandler(this);
|
|
2399
|
-
this.shortcutService = new ShortcutService(this);
|
|
2400
|
-
this.shortcutService.addListener(this.selectionService);
|
|
2401
|
-
}
|
|
2402
|
-
onActionTriggered(actionId) {
|
|
2403
|
-
if (actionId === "NAVIGATE_DOWN") {
|
|
2404
|
-
if (this.changeFocusCell(0, 1)) {
|
|
2405
|
-
return true;
|
|
2406
|
-
}
|
|
2407
|
-
}
|
|
2408
|
-
if (actionId === "NAVIGATE_UP") {
|
|
2409
|
-
if (this.changeFocusCell(0, -1)) {
|
|
2410
|
-
return true;
|
|
2411
|
-
}
|
|
2412
|
-
}
|
|
2413
|
-
if (actionId === "NAVIGATE_LEFT") {
|
|
2414
|
-
if (this.changeFocusCell(-1, 0)) {
|
|
2415
|
-
return true;
|
|
2416
|
-
}
|
|
2417
|
-
}
|
|
2418
|
-
if (actionId === "NAVIGATE_RIGHT") {
|
|
2419
|
-
if (this.changeFocusCell(1, 0)) {
|
|
2420
|
-
return true;
|
|
2421
|
-
}
|
|
2422
|
-
}
|
|
2423
|
-
if (actionId === "START_EDITING") {
|
|
2424
|
-
if (this.getFocusModel) {
|
|
2425
|
-
const fm = this.getFocusModel();
|
|
2426
|
-
if (fm) {
|
|
2427
|
-
const [rowIdx, colIdx] = fm.getFocus();
|
|
2428
|
-
if (this.tableModel.getBodyModel().isEditable(rowIdx, colIdx)) {
|
|
2429
|
-
this.clearSelection();
|
|
2430
|
-
this.initRenderEditor(rowIdx, colIdx);
|
|
2431
|
-
}
|
|
2432
|
-
}
|
|
2433
|
-
return true;
|
|
2434
|
-
}
|
|
2435
|
-
}
|
|
2436
|
-
return false;
|
|
2437
|
-
}
|
|
2438
|
-
updateModelValueAfterEdit(areaIdent, rowIndex, columnIndex, value) {
|
|
2439
|
-
if (areaIdent === "body") {
|
|
2440
|
-
const bodyAreaModel = this.tableModel.getAreaModel(areaIdent);
|
|
2441
|
-
const ok = bodyAreaModel.setValue(rowIndex, columnIndex, value);
|
|
2442
|
-
if (ok) {
|
|
2443
|
-
this.resetEditorRenderer();
|
|
2444
|
-
this.repaint();
|
|
2445
|
-
this.eventListener.onModelChanged(GeModelChangeEvent.createSingle(rowIndex, columnIndex));
|
|
2446
|
-
this.hostElement.focus();
|
|
2447
|
-
}
|
|
2448
|
-
}
|
|
1667
|
+
class me extends ae {
|
|
1668
|
+
constructor(e, t, s, i, o) {
|
|
1669
|
+
var r;
|
|
1670
|
+
if (super(
|
|
1671
|
+
e,
|
|
1672
|
+
t,
|
|
1673
|
+
new Y(s),
|
|
1674
|
+
i
|
|
1675
|
+
), this.eventListener = o, this.selectionService = new pe(this), this.api = new J(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new fe()), (r = this.tableOptions) != null && r.autoRestoreOptions) {
|
|
1676
|
+
const l = this.tableOptions.autoRestoreOptions, n = l.getStorageKeyFn;
|
|
1677
|
+
n && (l.autoRestoreScrollPosition && (this.storeScrollPosStateService = new te(n)), l.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new ie(n)), l.autoRestoreSortingState && (this.storeSortingService = new oe(n)));
|
|
1678
|
+
}
|
|
1679
|
+
this.mouseHandler = new U(this), this.inputHandler = new he(this), this.shortcutService = new ge(this), this.shortcutService.addListener(this.selectionService);
|
|
1680
|
+
}
|
|
1681
|
+
onActionTriggered(e) {
|
|
1682
|
+
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))
|
|
1683
|
+
return !0;
|
|
1684
|
+
if (e === "START_EDITING" && this.getFocusModel) {
|
|
1685
|
+
const t = this.getFocusModel();
|
|
1686
|
+
if (t) {
|
|
1687
|
+
const [s, i] = t.getFocus();
|
|
1688
|
+
this.tableModel.getBodyModel().isEditable(s, i) && (this.clearSelection(), this.initRenderEditor(s, i));
|
|
1689
|
+
}
|
|
1690
|
+
return !0;
|
|
1691
|
+
}
|
|
1692
|
+
return !1;
|
|
1693
|
+
}
|
|
1694
|
+
updateModelValueAfterEdit(e, t, s, i) {
|
|
1695
|
+
e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, i) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(_.createSingle(t, s)), this.hostElement.focus());
|
|
2449
1696
|
}
|
|
2450
1697
|
getApi() {
|
|
2451
1698
|
return this.api;
|
|
2452
1699
|
}
|
|
1700
|
+
/*
|
|
1701
|
+
* Called by the table component
|
|
1702
|
+
*/
|
|
2453
1703
|
firstInit() {
|
|
2454
|
-
var
|
|
2455
|
-
this.tableModel.init();
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
}
|
|
2465
|
-
createGeMouseEvent(mouseEvent) {
|
|
2466
|
-
const ret = new GeMouseEvent();
|
|
2467
|
-
ret.originalEvent = mouseEvent;
|
|
2468
|
-
if (mouseEvent) {
|
|
2469
|
-
const target = mouseEvent.target;
|
|
2470
|
-
[ret.areaIdent, ret.sideIdent] = this.getAreaAndSideIdentByAttr(target);
|
|
2471
|
-
ret.rowIndex = this.getNumberByAttr(target, "data-row-index");
|
|
2472
|
-
ret.columnIndex = this.getNumberByAttr(target, "data-col-index");
|
|
2473
|
-
ret.action = this.getStringByAttr(target, "data-ge-action");
|
|
2474
|
-
if (ret.areaIdent) {
|
|
2475
|
-
const am = this.tableModel.getAreaModel(ret.areaIdent);
|
|
2476
|
-
ret.rowTop = am.getYPosByRowIndex(ret.rowIndex);
|
|
1704
|
+
var e;
|
|
1705
|
+
this.tableModel.init(), (e = this.tableOptions) != null && e.externalFilterFunction && this.externalFilterChanged(!1), this.autoRestoreCollapsedExpandedState(), this.autoRestoreSortingState(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.autoRestoreScrollPosition();
|
|
1706
|
+
}
|
|
1707
|
+
createGeMouseEvent(e) {
|
|
1708
|
+
const t = new B();
|
|
1709
|
+
if (t.originalEvent = e, e) {
|
|
1710
|
+
const s = e.target;
|
|
1711
|
+
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) {
|
|
1712
|
+
const i = this.tableModel.getAreaModel(t.areaIdent);
|
|
1713
|
+
t.rowTop = i.getYPosByRowIndex(t.rowIndex);
|
|
2477
1714
|
}
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
const bodyX = mouseEvent.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width;
|
|
2482
|
-
this.debugOnce(bodyX, bodyY);
|
|
2483
|
-
}
|
|
2484
|
-
}
|
|
2485
|
-
return ret;
|
|
2486
|
-
}
|
|
2487
|
-
onMouseDown(mouseEvent) {
|
|
2488
|
-
if (mouseEvent.columnIndex > -1 && mouseEvent.action && ["resize-column", "drag-column"].includes(mouseEvent.action)) {
|
|
2489
|
-
this.mouseStartWidth = this.tableModel.getColumnWidth(mouseEvent.columnIndex);
|
|
2490
|
-
this.mouseStartAction = mouseEvent.action;
|
|
2491
|
-
this.mouseStartColumnIndex = mouseEvent.columnIndex;
|
|
2492
|
-
if (this.mouseStartAction === "drag-column") {
|
|
2493
|
-
this.dragFrom = this.mouseStartColumnIndex;
|
|
1715
|
+
if (t.columnLeft = this.tableModel.getXPosByColumnIndex(t.columnIndex), e.ctrlKey && e.altKey) {
|
|
1716
|
+
const i = e.clientY - this.hostElement.offsetTop - this.areaHeaderCenter.parent.clientHeight, o = e.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width;
|
|
1717
|
+
this.debugOnce(o, i);
|
|
2494
1718
|
}
|
|
2495
1719
|
}
|
|
1720
|
+
return t;
|
|
2496
1721
|
}
|
|
2497
|
-
|
|
2498
|
-
this.
|
|
2499
|
-
this.mouseEvent = mouseEvent;
|
|
2500
|
-
if (this.mouseStartColumnIndex > -1 && this.mouseStartAction === "resize-column" && this.tableOptions.columnsResizable) {
|
|
2501
|
-
this.resizeColumn(mouseEvent);
|
|
2502
|
-
} else if (this.mouseStartAction === "drag-column" && mouseEvent.columnIndex > -1 && this.tableOptions.columnsDraggable) {
|
|
2503
|
-
this.draggingTargetColumnIndex = mouseEvent.columnIndex;
|
|
2504
|
-
this.dragTo = this.draggingTargetColumnIndex;
|
|
2505
|
-
if (this.dragFrom > -1 && this.dragTo > -1 && this.dragFrom !== this.dragTo) {
|
|
2506
|
-
this.tableModel.changeColumnOrder(this.dragFrom, this.dragTo);
|
|
2507
|
-
this.dragFrom = this.dragTo;
|
|
2508
|
-
this.resetSizeOfWrapperDiv();
|
|
2509
|
-
this.adjustContainersAndRows();
|
|
2510
|
-
}
|
|
2511
|
-
this.repaint();
|
|
2512
|
-
}
|
|
1722
|
+
onMouseDown(e) {
|
|
1723
|
+
e.columnIndex > -1 && e.action && ["resize-column", "drag-column"].includes(e.action) && (this.mouseStartWidth = this.tableModel.getColumnWidth(e.columnIndex), this.mouseStartAction = e.action, this.mouseStartColumnIndex = e.columnIndex, this.mouseStartAction === "drag-column" && (this.dragFrom = this.mouseStartColumnIndex));
|
|
2513
1724
|
}
|
|
2514
|
-
|
|
2515
|
-
this.eventListener.
|
|
2516
|
-
this.draggingTargetColumnIndex = -1;
|
|
2517
|
-
if (this.mouseStartAction === "resize-column") {
|
|
2518
|
-
this.resizeColumn(mouseEvent);
|
|
2519
|
-
} else if (this.mouseStartAction === "drag-column") {
|
|
2520
|
-
this.repaint();
|
|
2521
|
-
}
|
|
2522
|
-
this.mouseStartWidth = -1;
|
|
2523
|
-
this.mouseStartColumnIndex = -1;
|
|
2524
|
-
this.dragFrom = -1;
|
|
2525
|
-
this.dragTo = -1;
|
|
2526
|
-
this.mouseStartAction = "";
|
|
2527
|
-
}
|
|
2528
|
-
mouseMove(mouseMoveEvent) {
|
|
2529
|
-
this.eventListener.onMouseMoved(mouseMoveEvent);
|
|
2530
|
-
this.adjustHoverRows(mouseMoveEvent);
|
|
2531
|
-
this.adjustHoverColumns(mouseMoveEvent);
|
|
2532
|
-
}
|
|
2533
|
-
contextmenu(mouseMoveEvent) {
|
|
2534
|
-
this.eventListener.onContextmenu(mouseMoveEvent);
|
|
2535
|
-
}
|
|
2536
|
-
toggleExpandCollapseAll(expand = true) {
|
|
2537
|
-
var _a;
|
|
2538
|
-
const bodyAreaModel = this.tableModel.getBodyModel();
|
|
2539
|
-
if (bodyAreaModel instanceof AreaModelTree) {
|
|
2540
|
-
const amt = bodyAreaModel;
|
|
2541
|
-
amt.toggleExpandCollapseAll(expand);
|
|
2542
|
-
this.repaint();
|
|
2543
|
-
(_a = this.storeStateCollapsedExpandService) === null || _a === void 0 ? void 0 : _a.collapsedStateAll(expand);
|
|
2544
|
-
}
|
|
1725
|
+
mouseDraggingOnFrame(e) {
|
|
1726
|
+
this.eventListener.onMouseDragging(e), this.mouseEvent = e, this.mouseStartColumnIndex > -1 && this.mouseStartAction === "resize-column" && this.tableOptions.columnsResizable ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && e.columnIndex > -1 && this.tableOptions.columnsDraggable && (this.draggingTargetColumnIndex = e.columnIndex, this.dragTo = this.draggingTargetColumnIndex, this.dragFrom > -1 && this.dragTo > -1 && this.dragFrom !== this.dragTo && (this.tableModel.changeColumnOrder(this.dragFrom, this.dragTo), this.dragFrom = this.dragTo, this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows()), this.repaint());
|
|
2545
1727
|
}
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
const areaModel = this.tableModel.getAreaModel(areaIdent);
|
|
2549
|
-
const state = areaModel.isRowChecked(rowIdx);
|
|
2550
|
-
const unsel = state === void 0 || state === "semi" || state === "none";
|
|
2551
|
-
areaModel.setRowChecked(rowIdx, unsel);
|
|
2552
|
-
this.repaint();
|
|
2553
|
-
const selectedRows = (_a = areaModel.rowSelectionModel) === null || _a === void 0 ? void 0 : _a.getCheckedRows();
|
|
2554
|
-
this.eventListener.onCheckboxChanged(selectedRows ? selectedRows : []);
|
|
2555
|
-
}
|
|
2556
|
-
onMouseClicked(evt, previousEvt) {
|
|
2557
|
-
let dirty = this.selectionService.onMouseClicked(evt, previousEvt);
|
|
2558
|
-
if (!dirty && this.getFocusModel) {
|
|
2559
|
-
const fm = this.getFocusModel();
|
|
2560
|
-
if (fm) {
|
|
2561
|
-
dirty = fm.hasChanged();
|
|
2562
|
-
fm.clearChanged();
|
|
2563
|
-
if (dirty) {
|
|
2564
|
-
this.resetEditorRenderer();
|
|
2565
|
-
}
|
|
2566
|
-
}
|
|
2567
|
-
}
|
|
2568
|
-
this.eventListener.onMouseClicked(evt);
|
|
2569
|
-
if (dirty) {
|
|
2570
|
-
this.debounce(this.repaint.bind(this), 10);
|
|
2571
|
-
}
|
|
1728
|
+
mouseDraggingEndOnFrame(e) {
|
|
1729
|
+
this.eventListener.onMouseDraggingEnd(e), this.draggingTargetColumnIndex = -1, this.mouseStartAction === "resize-column" ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && this.repaint(), this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.mouseStartAction = "";
|
|
2572
1730
|
}
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
1731
|
+
mouseMove(e) {
|
|
1732
|
+
this.eventListener.onMouseMoved(e), this.adjustHoverRows(e), this.adjustHoverColumns(e);
|
|
1733
|
+
}
|
|
1734
|
+
contextmenu(e) {
|
|
1735
|
+
this.eventListener.onContextmenu(e);
|
|
1736
|
+
}
|
|
1737
|
+
toggleExpandCollapseAll(e = !0) {
|
|
1738
|
+
var s;
|
|
1739
|
+
const t = this.tableModel.getBodyModel();
|
|
1740
|
+
t instanceof L && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
1741
|
+
}
|
|
1742
|
+
toggleRowCheckbox(e, t, s) {
|
|
1743
|
+
var n;
|
|
1744
|
+
const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e), r = o === void 0 || o === "semi" || o === "none";
|
|
1745
|
+
i.setRowChecked(e, r), this.repaint();
|
|
1746
|
+
const l = (n = i.rowSelectionModel) == null ? void 0 : n.getCheckedRows();
|
|
1747
|
+
this.eventListener.onCheckboxChanged(l || []);
|
|
1748
|
+
}
|
|
1749
|
+
onMouseClicked(e, t) {
|
|
1750
|
+
let s = this.selectionService.onMouseClicked(e, t);
|
|
1751
|
+
if (!s && this.getFocusModel) {
|
|
1752
|
+
const i = this.getFocusModel();
|
|
1753
|
+
i && (s = i.hasChanged(), i.clearChanged(), s && this.resetEditorRenderer());
|
|
2584
1754
|
}
|
|
1755
|
+
this.eventListener.onMouseClicked(e), s && this.debounce(this.repaint.bind(this), 10);
|
|
2585
1756
|
}
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
const
|
|
2596
|
-
|
|
2597
|
-
if (done) {
|
|
2598
|
-
(_b = this.tableModel.getColumnDefs()) === null || _b === void 0 ? void 0 : _b.forEach((cd) => cd.sortState = "");
|
|
2599
|
-
colDef.sortState = newState;
|
|
2600
|
-
}
|
|
2601
|
-
this.repaint();
|
|
2602
|
-
(_c = this.storeSortingService) === null || _c === void 0 ? void 0 : _c.setSortItems([sortItem]);
|
|
1757
|
+
externalFilterChanged(e = !0) {
|
|
1758
|
+
const t = this.tableOptions.externalFilterFunction;
|
|
1759
|
+
t && (e && this.clearSelectionModel(), this.tableModel.externalFilterChanged(t), this.scrollViewport.scrollTo(0, 0), this.tableModel.recalcHeightAndPadding(), this.resetSizeOfWrapperDiv(), this.repaint());
|
|
1760
|
+
}
|
|
1761
|
+
onHeaderDblClicked(e, t, s) {
|
|
1762
|
+
var o, r;
|
|
1763
|
+
const i = this.tableModel.getColumnDef(s);
|
|
1764
|
+
if (i != null && i.sortable && i.sortable()) {
|
|
1765
|
+
e.preventDefault(), e.stopPropagation();
|
|
1766
|
+
const l = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, n = i.sortState ?? "", a = l[(l.indexOf(n) + 1) % l.length], d = new de(s, a);
|
|
1767
|
+
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]);
|
|
2603
1768
|
}
|
|
2604
1769
|
}
|
|
2605
|
-
changeFocusCell(
|
|
1770
|
+
changeFocusCell(e, t) {
|
|
2606
1771
|
if (!this.isEditing() && this.getFocusModel) {
|
|
2607
|
-
const
|
|
2608
|
-
if (
|
|
2609
|
-
const [
|
|
2610
|
-
|
|
2611
|
-
this.repaint();
|
|
2612
|
-
return true;
|
|
1772
|
+
const s = this.getFocusModel();
|
|
1773
|
+
if (s) {
|
|
1774
|
+
const [i, o] = s.getFocus();
|
|
1775
|
+
return s.setFocus(i + t, o + e), this.repaint(), !0;
|
|
2613
1776
|
}
|
|
2614
1777
|
}
|
|
2615
|
-
return
|
|
1778
|
+
return !1;
|
|
2616
1779
|
}
|
|
2617
|
-
resizeColumn(
|
|
2618
|
-
this.tableModel.setColumnWidth(this.mouseStartColumnIndex, this.mouseStartWidth +
|
|
2619
|
-
this.tableModel.recalcPadding();
|
|
2620
|
-
this.resetSizeOfWrapperDiv();
|
|
2621
|
-
this.adjustContainersAndRows();
|
|
1780
|
+
resizeColumn(e) {
|
|
1781
|
+
this.tableModel.setColumnWidth(this.mouseStartColumnIndex, this.mouseStartWidth + e.draggingX), this.tableModel.recalcPadding(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows();
|
|
2622
1782
|
}
|
|
2623
1783
|
clearSelectionModel() {
|
|
2624
|
-
var
|
|
2625
|
-
|
|
2626
|
-
(_a = this.getSelectionModel()) === null || _a === void 0 ? void 0 : _a.clear();
|
|
2627
|
-
}
|
|
1784
|
+
var e;
|
|
1785
|
+
this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
|
|
2628
1786
|
}
|
|
2629
|
-
debugOnce(
|
|
2630
|
-
var
|
|
2631
|
-
console.clear();
|
|
2632
|
-
console.info("this.hostElement.offsetTop", this.hostElement.offsetTop);
|
|
2633
|
-
console.info("this.hostElement.scrollHeight", this.hostElement.scrollHeight);
|
|
2634
|
-
console.info("this.scrollViewportTop", this.scrollTop);
|
|
2635
|
-
console.info("this.areaHeaderCenter.parent.clientHeight", this.areaHeaderCenter.parent.clientHeight);
|
|
2636
|
-
console.info("bodyY", bodyY);
|
|
2637
|
-
console.info("bodyX", bodyX);
|
|
2638
|
-
console.info("rows", this.firstVisibleRowIndex);
|
|
2639
|
-
console.info("");
|
|
2640
|
-
console.info("this.tableModel", this.tableModel);
|
|
2641
|
-
console.info("");
|
|
2642
|
-
console.info("this.mouseMoveEvent.clientX", (_a = this.mouseHandler.mouseEvent) === null || _a === void 0 ? void 0 : _a.clientX);
|
|
2643
|
-
console.info("this.hostElement.offsetLeft", this.hostElement.offsetLeft);
|
|
2644
|
-
console.info("this.areaBodyWestGeo.width", this.areaBodyWestGeo.width);
|
|
1787
|
+
debugOnce(e, t) {
|
|
1788
|
+
var s;
|
|
1789
|
+
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);
|
|
2645
1790
|
}
|
|
2646
1791
|
autoRestoreScrollPosition() {
|
|
2647
|
-
var
|
|
2648
|
-
if ((
|
|
2649
|
-
const
|
|
2650
|
-
|
|
2651
|
-
const scrollOffset = this.storeScrollPosStateService.getScrollOffset();
|
|
2652
|
-
if (scrollOffset) {
|
|
2653
|
-
this.scrollViewport.scrollTo(...scrollOffset);
|
|
2654
|
-
}
|
|
2655
|
-
}
|
|
1792
|
+
var e;
|
|
1793
|
+
if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
|
|
1794
|
+
const s = this.storeScrollPosStateService.getScrollOffset();
|
|
1795
|
+
s && this.scrollViewport.scrollTo(...s);
|
|
2656
1796
|
}
|
|
2657
1797
|
}
|
|
2658
1798
|
autoRestoreSortingState() {
|
|
2659
|
-
var
|
|
2660
|
-
if ((
|
|
2661
|
-
const
|
|
2662
|
-
|
|
2663
|
-
const areaModel = this.tableModel.getBodyModel();
|
|
2664
|
-
areaModel.doSort(sortItems);
|
|
2665
|
-
}
|
|
1799
|
+
var e, t;
|
|
1800
|
+
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
|
|
1801
|
+
const s = this.storeSortingService.getSortItems();
|
|
1802
|
+
s != null && s.length && this.tableModel.getBodyModel().doSort(s);
|
|
2666
1803
|
}
|
|
2667
1804
|
}
|
|
2668
1805
|
autoRestoreCollapsedExpandedState() {
|
|
2669
|
-
var
|
|
2670
|
-
if ((
|
|
2671
|
-
const
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
} else {
|
|
2687
|
-
const rowId = getRowId(row.data);
|
|
2688
|
-
if (state.mode === "expanded") {
|
|
2689
|
-
row.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(rowId);
|
|
2690
|
-
} else if (state.mode === "collapsed") {
|
|
2691
|
-
row.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(rowId);
|
|
2692
|
-
}
|
|
1806
|
+
var e, t;
|
|
1807
|
+
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
|
|
1808
|
+
const s = this.tableOptions.autoRestoreOptions, i = s.getRowId;
|
|
1809
|
+
if (s.autoRestoreCollapsedExpandedState && i) {
|
|
1810
|
+
const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), r = this.tableModel.getAreaModel("body");
|
|
1811
|
+
if (r instanceof L) {
|
|
1812
|
+
const l = r, n = r.getRowCount();
|
|
1813
|
+
for (let a = 0; a < n; a++) {
|
|
1814
|
+
const d = r.getRowByIndex(a);
|
|
1815
|
+
if (d)
|
|
1816
|
+
if (o.allExpanded)
|
|
1817
|
+
d.expanded = !0;
|
|
1818
|
+
else if (o.allCollapsed)
|
|
1819
|
+
d.expanded = !1;
|
|
1820
|
+
else {
|
|
1821
|
+
const S = i(d.data);
|
|
1822
|
+
o.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(S) : o.mode === "collapsed" && (d.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(S));
|
|
2693
1823
|
}
|
|
2694
|
-
}
|
|
2695
1824
|
}
|
|
2696
|
-
|
|
1825
|
+
l.recalcVisibleTreeRows();
|
|
2697
1826
|
}
|
|
2698
1827
|
}
|
|
2699
1828
|
}
|
|
2700
1829
|
}
|
|
2701
1830
|
}
|
|
2702
|
-
class
|
|
2703
|
-
render(
|
|
2704
|
-
if (
|
|
2705
|
-
|
|
2706
|
-
const
|
|
2707
|
-
|
|
1831
|
+
class be {
|
|
1832
|
+
render(e, t, s, i, o, r, l) {
|
|
1833
|
+
if (o.isEditable(t, s)) {
|
|
1834
|
+
l.addClass(e, "ge-table-row-input-div");
|
|
1835
|
+
const n = o.getValueAt(t, s);
|
|
1836
|
+
e.innerHTML = `
|
|
2708
1837
|
<input
|
|
2709
1838
|
type="text"
|
|
2710
|
-
value="${
|
|
1839
|
+
value="${n}"
|
|
2711
1840
|
autofocus
|
|
2712
1841
|
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
2713
1842
|
data-listen="change"
|
|
2714
|
-
data-area="${
|
|
2715
|
-
data-row-index="${
|
|
2716
|
-
data-col-index="${
|
|
1843
|
+
data-area="${i}"
|
|
1844
|
+
data-row-index="${t}"
|
|
1845
|
+
data-col-index="${s}"
|
|
2717
1846
|
data-input-type="text"
|
|
2718
1847
|
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
2719
1848
|
class="ge-table-cell-editor-input">`;
|
|
2720
1849
|
}
|
|
2721
|
-
return void 0;
|
|
2722
1850
|
}
|
|
2723
1851
|
}
|
|
2724
|
-
class
|
|
2725
|
-
constructor(
|
|
2726
|
-
this.selectionType =
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
this.
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
if (this.allSelected) {
|
|
2740
|
-
count++;
|
|
2741
|
-
}
|
|
2742
|
-
if (this.isInNegativeRange(rowIndex, columnIndex)) {
|
|
2743
|
-
count = 0;
|
|
2744
|
-
}
|
|
2745
|
-
return count;
|
|
2746
|
-
}
|
|
2747
|
-
isInNegativeRange(rowIndex, columnIndex) {
|
|
2748
|
-
for (const range of this.negativeRanges) {
|
|
2749
|
-
if (range.isInRange(rowIndex, columnIndex)) {
|
|
2750
|
-
return true;
|
|
2751
|
-
}
|
|
2752
|
-
}
|
|
2753
|
-
return false;
|
|
1852
|
+
class ye {
|
|
1853
|
+
constructor(e = "none", t = "single") {
|
|
1854
|
+
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1855
|
+
}
|
|
1856
|
+
getSelectionCount(e, t) {
|
|
1857
|
+
let s = 0;
|
|
1858
|
+
for (const i of this.ranges)
|
|
1859
|
+
i.isInRange(e, t) && s++;
|
|
1860
|
+
return this.allSelected && s++, this.isInNegativeRange(e, t) && (s = 0), s;
|
|
1861
|
+
}
|
|
1862
|
+
isInNegativeRange(e, t) {
|
|
1863
|
+
for (const s of this.negativeRanges)
|
|
1864
|
+
if (s.isInRange(e, t))
|
|
1865
|
+
return !0;
|
|
1866
|
+
return !1;
|
|
2754
1867
|
}
|
|
2755
1868
|
getRanges() {
|
|
2756
1869
|
return this.ranges;
|
|
2757
1870
|
}
|
|
2758
1871
|
clear() {
|
|
2759
|
-
this.ranges = [];
|
|
2760
|
-
this.negativeRanges = [];
|
|
2761
|
-
this.allSelected = false;
|
|
1872
|
+
this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
2762
1873
|
}
|
|
2763
1874
|
hasSelection() {
|
|
2764
1875
|
return !!this.ranges.length;
|
|
2765
1876
|
}
|
|
2766
1877
|
selectAll() {
|
|
2767
|
-
this.allSelected =
|
|
1878
|
+
this.allSelected = !0;
|
|
2768
1879
|
}
|
|
2769
|
-
addSelection(
|
|
2770
|
-
this.addRange(
|
|
1880
|
+
addSelection(e) {
|
|
1881
|
+
this.addRange(e);
|
|
2771
1882
|
}
|
|
2772
|
-
removeSelection(
|
|
2773
|
-
if (this.selectionType === "none")
|
|
1883
|
+
removeSelection(e) {
|
|
1884
|
+
if (this.selectionType === "none")
|
|
2774
1885
|
return;
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
if (this.selectionType === "row") {
|
|
2778
|
-
r = CellRange.singleRow(range.r1);
|
|
2779
|
-
} else if (this.selectionType === "column") {
|
|
2780
|
-
r = CellRange.singleColumn(range.c1);
|
|
2781
|
-
}
|
|
2782
|
-
this.negativeRanges.push(r);
|
|
1886
|
+
let t = e;
|
|
1887
|
+
this.selectionType === "row" ? t = A.singleRow(e.r1) : this.selectionType === "column" && (t = A.singleColumn(e.c1)), this.negativeRanges.push(t);
|
|
2783
1888
|
}
|
|
2784
|
-
togglePoint(
|
|
2785
|
-
|
|
2786
|
-
this.removeSelection(CellRange.singleCell(row, col));
|
|
2787
|
-
} else {
|
|
2788
|
-
this.addSelection(CellRange.singleCell(row, col));
|
|
2789
|
-
}
|
|
1889
|
+
togglePoint(e, t) {
|
|
1890
|
+
this.getSelectionCount(e, t) > 0 ? this.removeSelection(A.singleCell(e, t)) : this.addSelection(A.singleCell(e, t));
|
|
2790
1891
|
}
|
|
2791
|
-
addRange(
|
|
2792
|
-
|
|
2793
|
-
return;
|
|
2794
|
-
}
|
|
2795
|
-
this.allSelected = false;
|
|
2796
|
-
if (this.selectionMode === "single") {
|
|
2797
|
-
this.ranges = [];
|
|
2798
|
-
}
|
|
2799
|
-
if (this.selectionType === "row") {
|
|
2800
|
-
range.c1 = 0;
|
|
2801
|
-
range.c2 = Number.MAX_SAFE_INTEGER;
|
|
2802
|
-
} else if (this.selectionType === "column") {
|
|
2803
|
-
range.r1 = 0;
|
|
2804
|
-
range.r2 = Number.MAX_SAFE_INTEGER;
|
|
2805
|
-
} else if (this.selectionType === "cell") {
|
|
2806
|
-
range.r2 = range.r1;
|
|
2807
|
-
range.c2 = range.c1;
|
|
2808
|
-
} else if (this.selectionType === "range")
|
|
2809
|
-
;
|
|
2810
|
-
this.ranges.push(range);
|
|
1892
|
+
addRange(e) {
|
|
1893
|
+
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));
|
|
2811
1894
|
}
|
|
2812
1895
|
}
|
|
2813
|
-
class
|
|
2814
|
-
constructor(
|
|
2815
|
-
this.selectionType =
|
|
2816
|
-
this.rowIndex = -1;
|
|
2817
|
-
this.columnIndex = -1;
|
|
2818
|
-
this.changed = false;
|
|
1896
|
+
class we {
|
|
1897
|
+
constructor(e = "none") {
|
|
1898
|
+
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
|
|
2819
1899
|
}
|
|
2820
1900
|
clearChanged() {
|
|
2821
|
-
this.changed =
|
|
1901
|
+
this.changed = !1;
|
|
2822
1902
|
}
|
|
2823
1903
|
hasChanged() {
|
|
2824
1904
|
return this.changed;
|
|
2825
1905
|
}
|
|
2826
1906
|
clear() {
|
|
2827
|
-
this.rowIndex = -1;
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
if (this.rowIndex !== rowIndex || this.columnIndex !== columnIndex) {
|
|
2832
|
-
this.rowIndex = rowIndex;
|
|
2833
|
-
this.columnIndex = columnIndex;
|
|
2834
|
-
this.changed = true;
|
|
2835
|
-
}
|
|
1907
|
+
this.rowIndex = -1, this.columnIndex = -1;
|
|
1908
|
+
}
|
|
1909
|
+
setFocus(e, t) {
|
|
1910
|
+
(this.rowIndex !== e || this.columnIndex !== t) && (this.rowIndex = e, this.columnIndex = t, this.changed = !0);
|
|
2836
1911
|
}
|
|
2837
|
-
hasFocus(
|
|
2838
|
-
return this.rowIndex ===
|
|
1912
|
+
hasFocus(e, t) {
|
|
1913
|
+
return this.rowIndex === e && this.columnIndex === t;
|
|
2839
1914
|
}
|
|
2840
1915
|
getFocus() {
|
|
2841
1916
|
return [this.rowIndex, this.columnIndex];
|
|
2842
1917
|
}
|
|
2843
1918
|
}
|
|
2844
|
-
const
|
|
2845
|
-
|
|
2846
|
-
class TableOptions {
|
|
1919
|
+
const xe = new ye(), ve = new we("cell");
|
|
1920
|
+
class Ce {
|
|
2847
1921
|
constructor() {
|
|
2848
|
-
this.overflowX = "auto"
|
|
2849
|
-
this.overflowY = "auto";
|
|
2850
|
-
this.horizontalBorderVisible = true;
|
|
2851
|
-
this.verticalBorderVisible = true;
|
|
2852
|
-
this.footerSeparatorBorderVisible = true;
|
|
2853
|
-
this.headerSeparatorBorderVisible = true;
|
|
2854
|
-
this.fixedEastSeparatorBorderVisible = true;
|
|
2855
|
-
this.fixedWestSeparatorBorderVisible = true;
|
|
2856
|
-
this.tableTopBorderVisible = true;
|
|
2857
|
-
this.tableBottomBorderVisible = true;
|
|
2858
|
-
this.hoverRowVisible = true;
|
|
2859
|
-
this.hoverColumnVisible = true;
|
|
2860
|
-
this.columnsResizable = true;
|
|
2861
|
-
this.columnsDraggable = true;
|
|
2862
|
-
this.columnResizeHandleWidthInPx = 4;
|
|
2863
|
-
this.defaultRowHeights = {
|
|
1922
|
+
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 = {
|
|
2864
1923
|
header: 34,
|
|
2865
1924
|
body: 34,
|
|
2866
1925
|
footer: 34
|
|
2867
|
-
};
|
|
2868
|
-
this.footerVerticalSeparator = false;
|
|
2869
|
-
this.headerToggleExpandCollapseIcons = false;
|
|
2870
|
-
this.headerVerticalSeparator = false;
|
|
2871
|
-
this.treeOptions = new TreeOptions();
|
|
2872
|
-
this.showCheckboxWihoutExtraColumn = false;
|
|
2873
|
-
this.externalFilterFunction = void 0;
|
|
2874
|
-
this.sortedOptions = new SortedOptions();
|
|
2875
|
-
this.sortOrder = ["asc", "desc"];
|
|
2876
|
-
this.getEditRenderer = (_rowIndex, _columnIndex) => new InputCellRenderer();
|
|
2877
|
-
this.getSelectionModel = () => selectionModel;
|
|
2878
|
-
this.getFocusModel = () => focusModel;
|
|
1926
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new H(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new W(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new be(), this.getSelectionModel = () => xe, this.getFocusModel = () => ve;
|
|
2879
1927
|
}
|
|
2880
1928
|
}
|
|
2881
|
-
class
|
|
2882
|
-
setStyle(
|
|
2883
|
-
|
|
2884
|
-
return el;
|
|
2885
|
-
}
|
|
2886
|
-
appendText(parent, text) {
|
|
2887
|
-
const div = this.createText(text);
|
|
2888
|
-
this.appendChild(parent, div);
|
|
2889
|
-
return div;
|
|
2890
|
-
}
|
|
2891
|
-
addClass(div, clazz) {
|
|
2892
|
-
if (clazz.includes(" ")) {
|
|
2893
|
-
clazz.split(" ").forEach((c) => div.classList.add(c));
|
|
2894
|
-
} else {
|
|
2895
|
-
div.classList.add(clazz);
|
|
2896
|
-
}
|
|
2897
|
-
return div;
|
|
1929
|
+
class Ee {
|
|
1930
|
+
setStyle(e, t, s) {
|
|
1931
|
+
return e.style[t] = s, e;
|
|
2898
1932
|
}
|
|
2899
|
-
|
|
2900
|
-
|
|
1933
|
+
appendText(e, t) {
|
|
1934
|
+
const s = this.createText(t);
|
|
1935
|
+
return this.appendChild(e, s), s;
|
|
2901
1936
|
}
|
|
2902
|
-
|
|
2903
|
-
return
|
|
1937
|
+
addClass(e, t) {
|
|
1938
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.add(s)) : e.classList.add(t), e;
|
|
2904
1939
|
}
|
|
2905
|
-
|
|
2906
|
-
|
|
1940
|
+
appendChild(e, t) {
|
|
1941
|
+
e.appendChild(t);
|
|
2907
1942
|
}
|
|
2908
|
-
|
|
2909
|
-
|
|
1943
|
+
createElement(e) {
|
|
1944
|
+
return document.createElement(e);
|
|
2910
1945
|
}
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
var _export_sfc = (sfc, props) => {
|
|
2914
|
-
const target = sfc.__vccOpts || sfc;
|
|
2915
|
-
for (const [key, val] of props) {
|
|
2916
|
-
target[key] = val;
|
|
1946
|
+
createText(e) {
|
|
1947
|
+
return document.createTextNode(e);
|
|
2917
1948
|
}
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
1949
|
+
setAttribute(e, t, s) {
|
|
1950
|
+
e.setAttribute(t, s);
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
const Ae = G({
|
|
1954
|
+
inheritAttrs: !1,
|
|
2922
1955
|
props: {
|
|
2923
1956
|
tableModel: {
|
|
2924
|
-
required:
|
|
1957
|
+
required: !0
|
|
2925
1958
|
},
|
|
2926
1959
|
tableOptions: {
|
|
2927
|
-
required:
|
|
2928
|
-
default: new
|
|
1960
|
+
required: !1,
|
|
1961
|
+
default: new Ce()
|
|
2929
1962
|
},
|
|
2930
1963
|
debounceMouseClickDelay: {
|
|
2931
|
-
required:
|
|
1964
|
+
required: !1,
|
|
2932
1965
|
default: 150
|
|
2933
1966
|
}
|
|
2934
1967
|
},
|
|
@@ -2942,58 +1975,93 @@ const _sfc_main = defineComponent({
|
|
|
2942
1975
|
"mouseDraggingEnd",
|
|
2943
1976
|
"mouseMoved"
|
|
2944
1977
|
],
|
|
2945
|
-
setup(
|
|
2946
|
-
const
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
emit("checkboxChanged", evt);
|
|
1978
|
+
setup(h, { emit: e }) {
|
|
1979
|
+
const t = N(null), s = (i) => {
|
|
1980
|
+
const o = {
|
|
1981
|
+
onCheckboxChanged: (l) => {
|
|
1982
|
+
e("checkboxChanged", l);
|
|
2951
1983
|
},
|
|
2952
|
-
onContextmenu: (
|
|
2953
|
-
|
|
1984
|
+
onContextmenu: (l) => {
|
|
1985
|
+
e("contextmenu", l);
|
|
2954
1986
|
},
|
|
2955
|
-
onModelChanged: (
|
|
2956
|
-
|
|
1987
|
+
onModelChanged: (l) => {
|
|
1988
|
+
e("modelChanged", l);
|
|
2957
1989
|
},
|
|
2958
|
-
onMouseClicked: (
|
|
2959
|
-
|
|
1990
|
+
onMouseClicked: (l) => {
|
|
1991
|
+
e("mouseClicked", l);
|
|
2960
1992
|
},
|
|
2961
|
-
onMouseDragging: (
|
|
2962
|
-
|
|
1993
|
+
onMouseDragging: (l) => {
|
|
1994
|
+
e("mouseDragging", l);
|
|
2963
1995
|
},
|
|
2964
|
-
onMouseDraggingEnd: (
|
|
2965
|
-
|
|
1996
|
+
onMouseDraggingEnd: (l) => {
|
|
1997
|
+
e("mouseDraggingEnd", l);
|
|
2966
1998
|
},
|
|
2967
|
-
onMouseMoved: (
|
|
2968
|
-
|
|
1999
|
+
onMouseMoved: (l) => {
|
|
2000
|
+
e("mouseMoved", l);
|
|
2969
2001
|
}
|
|
2970
|
-
}
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2002
|
+
}, r = new me(
|
|
2003
|
+
i,
|
|
2004
|
+
h.tableModel,
|
|
2005
|
+
new Ee(),
|
|
2006
|
+
h.tableOptions,
|
|
2007
|
+
o
|
|
2008
|
+
);
|
|
2009
|
+
r.firstInit(), e("tableReady", r.getApi());
|
|
2974
2010
|
};
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
});
|
|
2980
|
-
return {
|
|
2981
|
-
root
|
|
2011
|
+
return z(() => {
|
|
2012
|
+
t.value && s(t.value);
|
|
2013
|
+
}), {
|
|
2014
|
+
root: t
|
|
2982
2015
|
};
|
|
2983
2016
|
}
|
|
2984
2017
|
});
|
|
2985
|
-
const
|
|
2018
|
+
const Re = (h, e) => {
|
|
2019
|
+
const t = h.__vccOpts || h;
|
|
2020
|
+
for (const [s, i] of e)
|
|
2021
|
+
t[s] = i;
|
|
2022
|
+
return t;
|
|
2023
|
+
}, Me = {
|
|
2986
2024
|
ref: "root",
|
|
2987
2025
|
class: "container-div",
|
|
2988
|
-
style: {
|
|
2026
|
+
style: { width: "100%", height: "100%", "background-color": "transparent", padding: "0", margin: "0" }
|
|
2989
2027
|
};
|
|
2990
|
-
function
|
|
2991
|
-
return
|
|
2028
|
+
function Te(h, e, t, s, i, o) {
|
|
2029
|
+
return j(), X("div", Me, null, 512);
|
|
2992
2030
|
}
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2031
|
+
const Ie = /* @__PURE__ */ Re(Ae, [["render", Te]]);
|
|
2032
|
+
class Fe {
|
|
2033
|
+
constructor(e, t) {
|
|
2034
|
+
this.component = e, this.appContext = t;
|
|
2035
|
+
}
|
|
2036
|
+
render(e, t, s, i, o, r, l) {
|
|
2037
|
+
return this.mount(
|
|
2038
|
+
this.component,
|
|
2039
|
+
{
|
|
2040
|
+
cellDiv: e,
|
|
2041
|
+
rowIndex: t,
|
|
2042
|
+
columnIndex: s,
|
|
2043
|
+
areaIdent: i,
|
|
2044
|
+
areaModel: o,
|
|
2045
|
+
cellValue: r
|
|
2046
|
+
},
|
|
2047
|
+
this.appContext,
|
|
2048
|
+
e
|
|
2049
|
+
);
|
|
2050
|
+
}
|
|
2051
|
+
mount(e, t, s, i) {
|
|
2052
|
+
let o = K(e, t);
|
|
2053
|
+
return o.appContext = s, k(o, i), () => {
|
|
2054
|
+
i && k(null, i);
|
|
2055
|
+
};
|
|
2997
2056
|
}
|
|
2057
|
+
}
|
|
2058
|
+
const Oe = {
|
|
2059
|
+
install: (h, e = { img: "" }) => {
|
|
2060
|
+
h.component("GuiexpertTable", Ie);
|
|
2061
|
+
}
|
|
2062
|
+
};
|
|
2063
|
+
export {
|
|
2064
|
+
Fe as ComponentRendererWrapper,
|
|
2065
|
+
Ie as GuiexpertTable,
|
|
2066
|
+
Oe as default
|
|
2998
2067
|
};
|
|
2999
|
-
export { GuiexpertTable, GuiexpertTablePlugin as default };
|