@guiexpert/vue3-table 1.0.16 → 1.0.17
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 +8 -1
- package/index.cjs +4 -4
- package/index.js +402 -616
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { defineComponent as X, ref as K, onMounted as Y, openBlock as q, createElementBlock as U, createVNode as J, render as k } from "vue";
|
|
2
|
+
function L(h) {
|
|
3
|
+
return h && h.type === "TreeRow";
|
|
4
|
+
}
|
|
5
|
+
function O(h) {
|
|
6
|
+
return h && h.type === "AreaModelTree";
|
|
7
|
+
}
|
|
8
|
+
class $ {
|
|
9
|
+
constructor(e = -1, t = -1, s = -1, i = -1, o, l, r, n = 0, a = 0, d = 0, S = "") {
|
|
10
|
+
this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = i, this.areaIdent = o, this.sideIdent = l, this.originalEvent = r, this.clickCount = n, this.draggingX = a, this.draggingY = d, this.action = S;
|
|
5
11
|
}
|
|
6
12
|
clone() {
|
|
7
|
-
return new
|
|
13
|
+
return new $(
|
|
8
14
|
this.rowIndex,
|
|
9
15
|
this.rowTop,
|
|
10
16
|
this.columnIndex,
|
|
@@ -19,25 +25,25 @@ class B {
|
|
|
19
25
|
);
|
|
20
26
|
}
|
|
21
27
|
}
|
|
22
|
-
class
|
|
28
|
+
class D {
|
|
23
29
|
constructor(e = ">", t = "", s = []) {
|
|
24
30
|
this.content = e, this.style = t, this.classes = s;
|
|
25
31
|
}
|
|
26
32
|
}
|
|
27
|
-
class
|
|
28
|
-
constructor(e = new
|
|
33
|
+
class G {
|
|
34
|
+
constructor(e = new D(
|
|
29
35
|
">",
|
|
30
36
|
"transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
|
|
31
37
|
["gt-table-tree-arrow-expanded"]
|
|
32
|
-
), t = new
|
|
38
|
+
), t = new D(
|
|
33
39
|
">",
|
|
34
40
|
"",
|
|
35
41
|
["ge-table-tree-arrow-collapsed"]
|
|
36
|
-
), s = new
|
|
42
|
+
), s = new D(
|
|
37
43
|
">",
|
|
38
44
|
"color:transparent;",
|
|
39
45
|
["gt-table-tree-arrow-hidden"]
|
|
40
|
-
), i = new
|
|
46
|
+
), i = new D(
|
|
41
47
|
"↕",
|
|
42
48
|
"",
|
|
43
49
|
["gt-table-tree-arrow-expanded-all"]
|
|
@@ -45,12 +51,12 @@ class H {
|
|
|
45
51
|
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = i;
|
|
46
52
|
}
|
|
47
53
|
}
|
|
48
|
-
class
|
|
49
|
-
constructor(e = new
|
|
54
|
+
class N {
|
|
55
|
+
constructor(e = new D("↑", "", ["ge-header-sorted-asc"]), t = new D("↓", "", ["ge-header-sorted-desc"]), s = new D("↑", "color:transparent;", [])) {
|
|
50
56
|
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
|
-
class
|
|
59
|
+
class Q {
|
|
54
60
|
constructor(e) {
|
|
55
61
|
this.domService = e;
|
|
56
62
|
}
|
|
@@ -120,83 +126,83 @@ class Y {
|
|
|
120
126
|
const s = this.domService.createElement("div");
|
|
121
127
|
return this.addClass(e, s), this.domService.appendChild(t, s), s;
|
|
122
128
|
}
|
|
123
|
-
addRowDiv(e, t, s = -1, i, o,
|
|
124
|
-
const
|
|
129
|
+
addRowDiv(e, t, s = -1, i, o, l = "") {
|
|
130
|
+
const r = t.index ?? -1, n = this.getDivOrCreateDiv(r, e);
|
|
125
131
|
if (this.domService.addClass(n, "ge-table-row-div"), this.domService.addClass(n, `ge-table-row-div-${t.index}`), i === "body" && o === "center") {
|
|
126
132
|
const a = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
127
133
|
this.domService.addClass(n, `ge-table-row-${a}`);
|
|
128
134
|
}
|
|
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}`),
|
|
130
|
-
const a = this.domService.createText(
|
|
135
|
+
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}`), l) {
|
|
136
|
+
const a = this.domService.createText(l);
|
|
131
137
|
this.domService.appendChild(n, a);
|
|
132
138
|
}
|
|
133
139
|
return this.domService.appendChild(e.child, n), n;
|
|
134
140
|
}
|
|
135
|
-
addColumnDiv(e, t, s = -1, i = -1, o,
|
|
136
|
-
const g = a == null ? void 0 : a.treeOptions,
|
|
141
|
+
addColumnDiv(e, t, s = -1, i = -1, o, l, r = "", n, a, d = void 0, S) {
|
|
142
|
+
const g = a == null ? void 0 : a.treeOptions, m = a == null ? void 0 : a.showCheckboxWihoutExtraColumn, c = this.domService.createElement("div");
|
|
137
143
|
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
144
|
const b = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
139
|
-
if (o === "body" &&
|
|
145
|
+
if (o === "body" && l === "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)), m && i === 0 && d && this.addCheckboxToDiv(c, d, o, s), r) {
|
|
140
146
|
const p = n !== "none" && i === 0;
|
|
141
|
-
this.addLabelDiv(c,
|
|
147
|
+
this.addLabelDiv(c, r, p, s, i, o);
|
|
142
148
|
}
|
|
143
149
|
return S && this.addSortedIcon(c, S, a == null ? void 0 : a.sortedOptions, i), this.domService.appendChild(e, c), c;
|
|
144
150
|
}
|
|
145
151
|
addCheckboxToDiv(e, t, s, i) {
|
|
146
|
-
const o = this.domService.createElement("div"),
|
|
152
|
+
const o = this.domService.createElement("div"), l = t === "full" ? "checked" : "";
|
|
147
153
|
return o.innerHTML = `
|
|
148
154
|
<input
|
|
149
155
|
type="checkbox"
|
|
150
156
|
data-area="${s}"
|
|
151
157
|
data-row-index="${i}"
|
|
152
158
|
data-input-type="checkbox"
|
|
153
|
-
${
|
|
159
|
+
${l}
|
|
154
160
|
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
161
|
}
|
|
156
|
-
addLabelDiv(e, t = "", s = !1, i = -1, o = -1,
|
|
157
|
-
const
|
|
158
|
-
if (this.domService.addClass(
|
|
162
|
+
addLabelDiv(e, t = "", s = !1, i = -1, o = -1, l = "body") {
|
|
163
|
+
const r = this.domService.createElement("div");
|
|
164
|
+
if (this.domService.addClass(r, "ge-table-label-div"), this.domService.setStyle(r, "position", "relative"), this.domService.setStyle(r, "background", "transparent"), this.domService.setStyle(r, "width", "100%"), this.domService.setStyle(r, "height", "100%"), this.domService.setAttribute(r, "data-row-index", `${i}`), this.domService.setAttribute(r, "data-col-index", `${o}`), this.domService.setAttribute(r, "data-area", `${l}`), t)
|
|
159
165
|
if (s) {
|
|
160
166
|
const n = this.domService.createText(t);
|
|
161
|
-
this.domService.appendChild(
|
|
167
|
+
this.domService.appendChild(r, n);
|
|
162
168
|
} else {
|
|
163
169
|
const n = this.domService.createElement("div");
|
|
164
|
-
this.domService.appendChild(
|
|
170
|
+
this.domService.appendChild(r, n);
|
|
165
171
|
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", `${
|
|
172
|
+
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", `${l}`);
|
|
167
173
|
}
|
|
168
|
-
return this.domService.appendChild(e,
|
|
174
|
+
return this.domService.appendChild(e, r), r;
|
|
169
175
|
}
|
|
170
|
-
addSortedIcon(e, t = "", s = new
|
|
176
|
+
addSortedIcon(e, t = "", s = new N(), i = -1) {
|
|
171
177
|
const o = this.domService.createElement("div");
|
|
172
178
|
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
|
|
174
|
-
t === "asc" ?
|
|
175
|
-
const
|
|
176
|
-
this.domService.appendChild(o, n),
|
|
177
|
-
for (const a of
|
|
179
|
+
let l;
|
|
180
|
+
t === "asc" ? l = s.iconAsc : t === "desc" ? l = s.iconDesc : l = s.iconPlaceholder;
|
|
181
|
+
const r = l.content, n = this.domService.createText(r);
|
|
182
|
+
this.domService.appendChild(o, n), l.style && this.applyStyleString(o, l.style);
|
|
183
|
+
for (const a of l.classes)
|
|
178
184
|
this.domService.addClass(o, a);
|
|
179
185
|
return this.domService.appendChild(e, o), o;
|
|
180
186
|
}
|
|
181
|
-
addArrowDiv(e, t = "none", s = new
|
|
182
|
-
const
|
|
183
|
-
this.domService.addClass(
|
|
187
|
+
addArrowDiv(e, t = "none", s = new G(), i = -1, o = -1, l = "body") {
|
|
188
|
+
const r = this.domService.createElement("div");
|
|
189
|
+
this.domService.addClass(r, "ge-table-tree-arrow-div"), this.domService.setStyle(r, "display", "inline-block"), this.domService.setStyle(r, "position", ""), this.domService.setStyle(r, "width", "20px"), this.domService.setStyle(r, "background", "transparent"), this.domService.setStyle(r, "cursor", "pointer"), this.domService.setAttribute(r, "data-row-index", `${i}`), this.domService.setAttribute(r, "data-col-index", `${o}`), this.domService.setAttribute(r, "data-area", `${l}`);
|
|
184
190
|
let n;
|
|
185
191
|
t === "expanded" ? n = s.arrowExpanded : t === "collapsed" ? n = s.arrowCollapsed : n = s.arrowPlaceholder;
|
|
186
192
|
const a = n.content, d = this.domService.createText(a);
|
|
187
|
-
this.domService.appendChild(
|
|
193
|
+
this.domService.appendChild(r, d), n.style && this.applyStyleString(r, n.style);
|
|
188
194
|
for (const S of n.classes)
|
|
189
|
-
this.domService.addClass(
|
|
190
|
-
return this.domService.appendChild(e,
|
|
195
|
+
this.domService.addClass(r, S);
|
|
196
|
+
return this.domService.appendChild(e, r), r;
|
|
191
197
|
}
|
|
192
198
|
addColumnBorderDivs(e, t, s, i, o) {
|
|
193
199
|
if (e.verticalBorderVisible) {
|
|
194
|
-
const
|
|
195
|
-
this.addVerticalBorder(s, t,
|
|
200
|
+
const l = `ge-table-${i}-${o}-vertical-border`;
|
|
201
|
+
this.addVerticalBorder(s, t, l);
|
|
196
202
|
}
|
|
197
203
|
if (e.horizontalBorderVisible) {
|
|
198
|
-
const
|
|
199
|
-
this.addHorizontalBorder(s, t,
|
|
204
|
+
const l = `ge-table-${i}-${o}-horizontal-border`;
|
|
205
|
+
this.addHorizontalBorder(s, t, l);
|
|
200
206
|
}
|
|
201
207
|
return t;
|
|
202
208
|
}
|
|
@@ -219,8 +225,8 @@ class Y {
|
|
|
219
225
|
applyStyleString(e, t) {
|
|
220
226
|
const s = t.split(";").map((i) => i.trim()).filter((i) => i);
|
|
221
227
|
for (const i of s) {
|
|
222
|
-
const [o,
|
|
223
|
-
this.domService.setStyle(e, o.trim(),
|
|
228
|
+
const [o, l] = i.split(":");
|
|
229
|
+
this.domService.setStyle(e, o.trim(), l.trim());
|
|
224
230
|
}
|
|
225
231
|
}
|
|
226
232
|
getDivOrCreateDiv(e, t) {
|
|
@@ -228,25 +234,20 @@ class Y {
|
|
|
228
234
|
return s ? (s.innerText = "", s) : (s = this.domService.createElement("div"), t.cache[e] = s, s);
|
|
229
235
|
}
|
|
230
236
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
this.data = e, this.expanded = t, this.children = s, this.parent = i, this.deep = o, this.checked = r, this.keep = l;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
const $ = (h) => h === "header" ? "header" : h === "footer" ? "footer" : "body";
|
|
237
|
-
class q {
|
|
237
|
+
const B = (h) => h === "header" ? "header" : h === "footer" ? "footer" : "body";
|
|
238
|
+
class Z {
|
|
238
239
|
constructor(e, t) {
|
|
239
240
|
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
241
|
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
242
|
const s = e.getAttribute("data-area");
|
|
242
|
-
if (s && (this.areaIdent =
|
|
243
|
+
if (s && (this.areaIdent = B(s), this.areaModel = t.tableModel.getAreaModel(this.areaIdent), this.row = this.areaModel.getRowByIndex(this.rowIdx)), e instanceof HTMLInputElement) {
|
|
243
244
|
const i = e;
|
|
244
245
|
this.value = i.value;
|
|
245
246
|
}
|
|
246
247
|
}
|
|
247
248
|
}
|
|
248
249
|
}
|
|
249
|
-
class
|
|
250
|
+
class ee {
|
|
250
251
|
constructor(e) {
|
|
251
252
|
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
253
|
(t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
|
|
@@ -258,12 +259,12 @@ class U {
|
|
|
258
259
|
this.tableScope.contextmenu(t);
|
|
259
260
|
}
|
|
260
261
|
onHostElementClicked(e) {
|
|
261
|
-
const t = new
|
|
262
|
+
const t = new Z(e.target, this.tableScope);
|
|
262
263
|
if (t.action === "toggleExpandCollapseAll")
|
|
263
264
|
this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
|
|
264
265
|
else if (t.inputType === "checkbox" && t.areaIdent)
|
|
265
266
|
this.tableScope.toggleRowCheckbox(t.rowIdx, t.colIdx, t.areaIdent), e.preventDefault(), e.stopPropagation();
|
|
266
|
-
else if (t.row
|
|
267
|
+
else if (L(t.row) && t.areaModel) {
|
|
267
268
|
const s = t.colIdx === this.getArrowColumnIndex() && e.altKey, i = t.className.includes("ge-table-tree-arrow-div");
|
|
268
269
|
if (console.info(i, s), s || i) {
|
|
269
270
|
e.preventDefault(), e.stopPropagation();
|
|
@@ -279,15 +280,15 @@ class U {
|
|
|
279
280
|
}
|
|
280
281
|
onHostElementDblClicked(e) {
|
|
281
282
|
if (e.target instanceof HTMLElement) {
|
|
282
|
-
const t = e.target, s = t.getAttribute("data-area"), i =
|
|
283
|
+
const t = e.target, s = t.getAttribute("data-area"), i = B(s), o = Number(t.getAttribute("data-row-index")), l = Number(t.getAttribute("data-col-index")), r = this.tableScope.tableModel.getAreaModel(i);
|
|
283
284
|
if (s && i === "header")
|
|
284
|
-
this.tableScope.tableModel.isSortable(
|
|
285
|
+
this.tableScope.tableModel.isSortable(l) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, o, l));
|
|
285
286
|
else if (t.getAttribute("data-row-index")) {
|
|
286
|
-
const n =
|
|
287
|
-
if (s && i === "body" &&
|
|
287
|
+
const n = r.getRowByIndex(o);
|
|
288
|
+
if (s && i === "body" && r.isEditable(o, l) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, l)), L(n) && l === this.getArrowColumnIndex()) {
|
|
288
289
|
e.preventDefault(), e.stopPropagation();
|
|
289
290
|
const a = n;
|
|
290
|
-
a.expanded = !a.expanded, "recalcVisibleTreeRows" in
|
|
291
|
+
a.expanded = !a.expanded, "recalcVisibleTreeRows" in r && r.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(a);
|
|
291
292
|
}
|
|
292
293
|
}
|
|
293
294
|
}
|
|
@@ -298,11 +299,11 @@ class U {
|
|
|
298
299
|
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
|
}
|
|
300
301
|
updateCollapsedExpandedState(e) {
|
|
301
|
-
var s, i, o,
|
|
302
|
+
var s, i, o, l, r;
|
|
302
303
|
const t = (i = (s = this.tableScope.tableOptions) == null ? void 0 : s.autoRestoreOptions) == null ? void 0 : i.getRowId;
|
|
303
304
|
if (t) {
|
|
304
305
|
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 ? (
|
|
306
|
+
a ? (l = this.tableScope.storeStateCollapsedExpandService) == null || l.collapsedStateIdsPush(S) : d && ((r = this.tableScope.storeStateCollapsedExpandService) == null || r.collapsedStateIdsRemove(S));
|
|
306
307
|
}
|
|
307
308
|
}
|
|
308
309
|
getArrowColumnIndex() {
|
|
@@ -338,7 +339,7 @@ class U {
|
|
|
338
339
|
}
|
|
339
340
|
}
|
|
340
341
|
}
|
|
341
|
-
class
|
|
342
|
+
class te {
|
|
342
343
|
constructor(e) {
|
|
343
344
|
this.tableScope = e;
|
|
344
345
|
}
|
|
@@ -371,231 +372,7 @@ class J {
|
|
|
371
372
|
this.tableScope.repaint();
|
|
372
373
|
}
|
|
373
374
|
}
|
|
374
|
-
class
|
|
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;
|
|
380
|
-
}
|
|
381
|
-
isVisible(e) {
|
|
382
|
-
return e.parent ? e.parent.expanded ? this.isVisible(e.parent) : !1 : !0;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
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) {
|
|
390
|
-
return "";
|
|
391
|
-
}
|
|
392
|
-
getCellRenderer(e, t) {
|
|
393
|
-
if (t < this.cellRenderers.length)
|
|
394
|
-
return this.cellRenderers[t];
|
|
395
|
-
}
|
|
396
|
-
getColspanAt(e, t) {
|
|
397
|
-
return 0;
|
|
398
|
-
}
|
|
399
|
-
getCustomClassesAt(e, t) {
|
|
400
|
-
return [];
|
|
401
|
-
}
|
|
402
|
-
getCustomStyleAt(e, t) {
|
|
403
|
-
}
|
|
404
|
-
getRowspanAt(e, t) {
|
|
405
|
-
return 0;
|
|
406
|
-
}
|
|
407
|
-
getRowByIndex(e) {
|
|
408
|
-
}
|
|
409
|
-
isRowCheckable(e) {
|
|
410
|
-
return !0;
|
|
411
|
-
}
|
|
412
|
-
isRowChecked(e) {
|
|
413
|
-
var s;
|
|
414
|
-
const t = this.getRowByIndex(e);
|
|
415
|
-
return (s = this.rowSelectionModel) == null ? void 0 : s.isRowChecked(t);
|
|
416
|
-
}
|
|
417
|
-
setRowChecked(e, t) {
|
|
418
|
-
if (this.rowSelectionModel) {
|
|
419
|
-
const s = this.getRowByIndex(e);
|
|
420
|
-
this.rowSelectionModel.checkRow(s, t);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
getMaxColspan() {
|
|
424
|
-
return 31;
|
|
425
|
-
}
|
|
426
|
-
getMaxRowspan() {
|
|
427
|
-
return 31;
|
|
428
|
-
}
|
|
429
|
-
getYPosByRowIndex(e) {
|
|
430
|
-
return this.defaultRowHeight > 0 ? this.defaultRowHeight * e : this.yPositions[e];
|
|
431
|
-
}
|
|
432
|
-
init() {
|
|
433
|
-
!this.yPositions.length && this.getRowCount() !== void 0 && this.defaultRowHeight === -1 && this.calcYPositions();
|
|
434
|
-
}
|
|
435
|
-
isFilterable() {
|
|
436
|
-
return this.areaIdent === "body";
|
|
437
|
-
}
|
|
438
|
-
doSort(e) {
|
|
439
|
-
return !1;
|
|
440
|
-
}
|
|
441
|
-
isEditable(e, t) {
|
|
442
|
-
return this.columnDefs && t < this.columnDefs.length && this.columnDefs[t].editable ? this.columnDefs[t].editable() : !1;
|
|
443
|
-
}
|
|
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);
|
|
450
|
-
}
|
|
451
|
-
isSelectable(e, t) {
|
|
452
|
-
return !0;
|
|
453
|
-
}
|
|
454
|
-
changeColumnOrder(e, t) {
|
|
455
|
-
this.arrayMove(this.cellRenderers, e, t);
|
|
456
|
-
}
|
|
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);
|
|
462
|
-
}
|
|
463
|
-
return !1;
|
|
464
|
-
}
|
|
465
|
-
arrayMove(e, t, s) {
|
|
466
|
-
const i = e.splice(t, 1)[0];
|
|
467
|
-
return e.splice(s, 0, i), e;
|
|
468
|
-
}
|
|
469
|
-
calcYPositions() {
|
|
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];
|
|
474
|
-
}
|
|
475
|
-
}
|
|
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);
|
|
492
|
-
}
|
|
493
|
-
}
|
|
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);
|
|
500
|
-
}
|
|
501
|
-
recalcVisibleTreeRows() {
|
|
502
|
-
this.filteredFlattenRows = this.service.flattenTree(this.rows);
|
|
503
|
-
}
|
|
504
|
-
getFilteredFlattenRows() {
|
|
505
|
-
return this.filteredFlattenRows;
|
|
506
|
-
}
|
|
507
|
-
getRowCount() {
|
|
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];
|
|
519
|
-
}
|
|
520
|
-
return "";
|
|
521
|
-
}
|
|
522
|
-
getRowHeight(e) {
|
|
523
|
-
return this.defaultRowHeight;
|
|
524
|
-
}
|
|
525
|
-
getCustomClassesAt(e, t) {
|
|
526
|
-
return ["ge-table-tree-cell", "ge-table-tree-deep-" + this.filteredFlattenRows[e].deep];
|
|
527
|
-
}
|
|
528
|
-
getRowByIndex(e) {
|
|
529
|
-
return this.filteredFlattenRows[e];
|
|
530
|
-
}
|
|
531
|
-
getValueByT(e, t) {
|
|
532
|
-
return t.includes(".") ? this.getPropertyValue(e, t.split(".")) : e[t];
|
|
533
|
-
}
|
|
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);
|
|
555
|
-
}
|
|
556
|
-
return !1;
|
|
557
|
-
}
|
|
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);
|
|
562
|
-
};
|
|
563
|
-
}
|
|
564
|
-
expandAllRecursive(e, t) {
|
|
565
|
-
for (const s of e)
|
|
566
|
-
s.expanded = t, s.children && this.expandAllRecursive(s.children, t);
|
|
567
|
-
}
|
|
568
|
-
doFiltering() {
|
|
569
|
-
if (!this.lastPredictFn)
|
|
570
|
-
this.filteredFlattenRows = [...this.flattenRows ? this.flattenRows : []];
|
|
571
|
-
else {
|
|
572
|
-
this.flattenRows || (this.flattenRows = []);
|
|
573
|
-
let e = 0;
|
|
574
|
-
this.flattenRows.forEach((s) => {
|
|
575
|
-
e = Math.max(e, s.deep);
|
|
576
|
-
});
|
|
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);
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
class P {
|
|
375
|
+
class W {
|
|
599
376
|
constructor(e) {
|
|
600
377
|
this.getStorageKeyFn = e;
|
|
601
378
|
}
|
|
@@ -606,9 +383,9 @@ class P {
|
|
|
606
383
|
for (const i of [...s]) {
|
|
607
384
|
const [
|
|
608
385
|
o,
|
|
609
|
-
|
|
386
|
+
l
|
|
610
387
|
] = i;
|
|
611
|
-
t[o] =
|
|
388
|
+
t[o] = l;
|
|
612
389
|
}
|
|
613
390
|
}
|
|
614
391
|
return t;
|
|
@@ -620,8 +397,8 @@ class P {
|
|
|
620
397
|
if (i) {
|
|
621
398
|
const o = i + e;
|
|
622
399
|
if ((t + "").includes("Map")) {
|
|
623
|
-
const
|
|
624
|
-
this.persistItem(o,
|
|
400
|
+
const l = this.autoConvertMapToObject(t);
|
|
401
|
+
this.persistItem(o, l);
|
|
625
402
|
} else
|
|
626
403
|
this.persistItem(o, t);
|
|
627
404
|
}
|
|
@@ -670,7 +447,7 @@ class P {
|
|
|
670
447
|
// }
|
|
671
448
|
// }
|
|
672
449
|
}
|
|
673
|
-
class
|
|
450
|
+
class se extends W {
|
|
674
451
|
constructor(e) {
|
|
675
452
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
676
453
|
}
|
|
@@ -692,14 +469,14 @@ class te extends P {
|
|
|
692
469
|
}
|
|
693
470
|
}
|
|
694
471
|
}
|
|
695
|
-
class
|
|
472
|
+
class ie {
|
|
696
473
|
constructor(e = "collapsed", t = [], s = !1, i = !1) {
|
|
697
474
|
this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = i;
|
|
698
475
|
}
|
|
699
476
|
}
|
|
700
|
-
class
|
|
477
|
+
class oe extends W {
|
|
701
478
|
constructor(e) {
|
|
702
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
479
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new ie(), this.load();
|
|
703
480
|
}
|
|
704
481
|
collapsedExpandedStateGet() {
|
|
705
482
|
return this.collapsedExpandedState;
|
|
@@ -731,7 +508,7 @@ class ie extends P {
|
|
|
731
508
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
732
509
|
}
|
|
733
510
|
}
|
|
734
|
-
class
|
|
511
|
+
class le extends W {
|
|
735
512
|
constructor(e) {
|
|
736
513
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
737
514
|
}
|
|
@@ -935,7 +712,7 @@ class A {
|
|
|
935
712
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
936
713
|
}
|
|
937
714
|
}
|
|
938
|
-
class
|
|
715
|
+
class ne {
|
|
939
716
|
constructor(e, t) {
|
|
940
717
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
941
718
|
}
|
|
@@ -946,12 +723,12 @@ class le {
|
|
|
946
723
|
const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
|
|
947
724
|
for (let s = 0; s < e; s++)
|
|
948
725
|
for (let i = 0; i < t; i++) {
|
|
949
|
-
let o = this.areaModel.getColspanAt(s, i),
|
|
950
|
-
if (o > 1 ||
|
|
951
|
-
o === 0 && (o = 1),
|
|
952
|
-
const
|
|
726
|
+
let o = this.areaModel.getColspanAt(s, i), l = this.areaModel.getRowspanAt(s, i);
|
|
727
|
+
if (o > 1 || l > 1) {
|
|
728
|
+
o === 0 && (o = 1), l === 0 && (l = 1);
|
|
729
|
+
const r = this.areaModel.hasOwnProperty("gammaCells");
|
|
953
730
|
this.colAndRowspanRanges.push(
|
|
954
|
-
new A(s, i, s +
|
|
731
|
+
new A(s, i, s + l - 1, i + o - 1, r)
|
|
955
732
|
);
|
|
956
733
|
}
|
|
957
734
|
}
|
|
@@ -968,22 +745,22 @@ class le {
|
|
|
968
745
|
return !1;
|
|
969
746
|
}
|
|
970
747
|
}
|
|
971
|
-
class
|
|
748
|
+
class ae {
|
|
972
749
|
constructor(e, t, s) {
|
|
973
750
|
this.header = e, this.body = t, this.footer = s;
|
|
974
751
|
}
|
|
975
752
|
}
|
|
976
|
-
class
|
|
753
|
+
class de extends re {
|
|
977
754
|
constructor(e, t, s, i) {
|
|
978
|
-
var
|
|
755
|
+
var l, r;
|
|
979
756
|
super(e, t, s, i), this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
980
757
|
header: [],
|
|
981
758
|
body: [],
|
|
982
759
|
footer: []
|
|
983
|
-
}, this.tree = !1, this.colAndRowspanModels = new
|
|
760
|
+
}, this.tree = !1, this.colAndRowspanModels = new ae(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.editing = !1, this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (l = this.tableOptions) != null && l.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (r = this.tableOptions) != null && r.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), O(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
984
761
|
(n) => {
|
|
985
762
|
var a;
|
|
986
|
-
this.colAndRowspanModels[n] = new
|
|
763
|
+
this.colAndRowspanModels[n] = new ne(t, t.getAreaModel(n)), (a = this.colAndRowspanModels[n]) == null || a.init();
|
|
987
764
|
}
|
|
988
765
|
);
|
|
989
766
|
}
|
|
@@ -1101,86 +878,86 @@ class ae extends re {
|
|
|
1101
878
|
}
|
|
1102
879
|
adjustArea(e, t = 0) {
|
|
1103
880
|
var p;
|
|
1104
|
-
const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"),
|
|
881
|
+
const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"), l = i.child.clientHeight;
|
|
1105
882
|
s.child.innerText = "", i.child.innerText = "", o.child.innerText = "";
|
|
1106
|
-
const
|
|
883
|
+
const r = 0, n = this.areaBodyCenterGeo.width, a = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), S = d.getRowCount();
|
|
1107
884
|
for (; this.cleanupFunctions[e].length; ) {
|
|
1108
885
|
const u = this.cleanupFunctions[e].shift();
|
|
1109
886
|
u && u();
|
|
1110
887
|
}
|
|
1111
888
|
let g = t;
|
|
1112
|
-
const
|
|
889
|
+
const m = this.tableModel.getColumnCount(), c = this.tableModel.getFixedRightColumnCount(), b = this.tableModel.getFixedLeftColumnCount();
|
|
1113
890
|
for (let u = 0; u < S; u++) {
|
|
1114
|
-
const x = g,
|
|
1115
|
-
if (x +
|
|
891
|
+
const x = g, C = u === S - 1, w = this.tableModel.getRowHeight(e, u);
|
|
892
|
+
if (x + w > 0) {
|
|
1116
893
|
this.firstVisibleRowIndex = u;
|
|
1117
|
-
let
|
|
1118
|
-
const
|
|
894
|
+
let v = { left: r, width: n, height: w, top: x, index: u }, f = this.dom.addRowDiv(i, v, u, e, "center");
|
|
895
|
+
const R = b;
|
|
1119
896
|
if (this.adjustColumnsToRowParent({
|
|
1120
897
|
areaIdent: e,
|
|
1121
898
|
sideIdent: "center",
|
|
1122
899
|
areaModel: d,
|
|
1123
|
-
geo:
|
|
1124
|
-
parent:
|
|
900
|
+
geo: v,
|
|
901
|
+
parent: f,
|
|
1125
902
|
rowIndex: u,
|
|
1126
|
-
columnIndexStart:
|
|
1127
|
-
columnIndexEnd:
|
|
903
|
+
columnIndexStart: R,
|
|
904
|
+
columnIndexEnd: m - c - 1,
|
|
1128
905
|
verticalFixed: !1,
|
|
1129
|
-
lastRowOfModel:
|
|
1130
|
-
}), a.left > 0 && (
|
|
906
|
+
lastRowOfModel: C
|
|
907
|
+
}), a.left > 0 && (v = { left: r, width: this.areaBodyWestGeo.width, height: w, top: x, index: u }, f = this.dom.addRowDiv(s, v, u, e, "west"), this.adjustColumnsToRowParent({
|
|
1131
908
|
areaIdent: e,
|
|
1132
909
|
sideIdent: "west",
|
|
1133
910
|
areaModel: d,
|
|
1134
|
-
geo:
|
|
1135
|
-
parent:
|
|
911
|
+
geo: v,
|
|
912
|
+
parent: f,
|
|
1136
913
|
rowIndex: u,
|
|
1137
914
|
columnIndexStart: 0,
|
|
1138
|
-
columnIndexEnd:
|
|
915
|
+
columnIndexEnd: R - 1,
|
|
1139
916
|
verticalFixed: !0,
|
|
1140
|
-
lastRowOfModel:
|
|
1141
|
-
})), a.right > 0 && (
|
|
917
|
+
lastRowOfModel: C
|
|
918
|
+
})), a.right > 0 && (v = { left: r, width: this.areaBodyEastGeo.width, height: w, top: x, index: u }, f = this.dom.addRowDiv(o, v, u, e, "east"), this.adjustColumnsToRowParent({
|
|
1142
919
|
areaIdent: e,
|
|
1143
920
|
sideIdent: "east",
|
|
1144
921
|
areaModel: d,
|
|
1145
|
-
geo:
|
|
1146
|
-
parent:
|
|
922
|
+
geo: v,
|
|
923
|
+
parent: f,
|
|
1147
924
|
rowIndex: u,
|
|
1148
|
-
columnIndexStart:
|
|
1149
|
-
columnIndexEnd:
|
|
925
|
+
columnIndexStart: m - c,
|
|
926
|
+
columnIndexEnd: m - 1,
|
|
1150
927
|
verticalFixed: !0,
|
|
1151
|
-
lastRowOfModel:
|
|
928
|
+
lastRowOfModel: C
|
|
1152
929
|
})), e === "header" && this.tree && u === S - 1) {
|
|
1153
930
|
const E = this.dom.applyStyle(
|
|
1154
931
|
this.dom.setAttribute(
|
|
1155
|
-
this.dom.addDiv(
|
|
932
|
+
this.dom.addDiv(f, new T(16, 20, 20, 8)),
|
|
1156
933
|
"data-ge-action",
|
|
1157
934
|
"toggleExpandCollapseAll"
|
|
1158
935
|
),
|
|
1159
936
|
{ cursor: "pointer" }
|
|
1160
|
-
),
|
|
1161
|
-
if (
|
|
1162
|
-
const
|
|
1163
|
-
this.dom.domService.appendChild(E,
|
|
937
|
+
), M = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
938
|
+
if (M) {
|
|
939
|
+
const I = this.dom.domService.createText(M.content);
|
|
940
|
+
this.dom.domService.appendChild(E, I), M.style && this.dom.applyStyleString(E, M.style);
|
|
1164
941
|
}
|
|
1165
942
|
}
|
|
1166
943
|
}
|
|
1167
|
-
if (g = g +
|
|
944
|
+
if (g = g + w, g > l)
|
|
1168
945
|
break;
|
|
1169
946
|
}
|
|
1170
947
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1171
948
|
const u = ((p = this.colAndRowspanModels[e]) == null ? void 0 : p.getRanges()) ?? [];
|
|
1172
949
|
if (u.length)
|
|
1173
950
|
for (const x of u) {
|
|
1174
|
-
let
|
|
951
|
+
let C = 0, w = i.child, v = "center";
|
|
1175
952
|
if (x.c1 < b)
|
|
1176
|
-
|
|
1177
|
-
else if (c > 0 && x.c1 >=
|
|
1178
|
-
|
|
953
|
+
w = s.child, v = "west";
|
|
954
|
+
else if (c > 0 && x.c1 >= m - c)
|
|
955
|
+
w = o.child, v = "east";
|
|
1179
956
|
else {
|
|
1180
|
-
const
|
|
1181
|
-
|
|
957
|
+
const f = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
958
|
+
C = this.scrollFactorX * f - this.areaBodyWestGeo.width, v = "center";
|
|
1182
959
|
}
|
|
1183
|
-
this.drawBigCell(x,
|
|
960
|
+
this.drawBigCell(x, C, t, d, w, v);
|
|
1184
961
|
}
|
|
1185
962
|
}
|
|
1186
963
|
}
|
|
@@ -1194,22 +971,22 @@ class ae extends re {
|
|
|
1194
971
|
* @param sideIdent SideIdent (west,center,east)
|
|
1195
972
|
* @protected
|
|
1196
973
|
*/
|
|
1197
|
-
drawBigCell(e, t, s, i, o,
|
|
1198
|
-
const
|
|
974
|
+
drawBigCell(e, t, s, i, o, l) {
|
|
975
|
+
const r = s + this.getRowHeights(0, e.r1 - 1, i).reduce((p, u) => p + u, 0), n = this.tableModel.getColumnCount(), a = this.tableModel.getFixedRightColumnCount();
|
|
1199
976
|
let d = 0;
|
|
1200
977
|
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),
|
|
978
|
+
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), m = this.getColumnWidths(e.c1, e.c2).reduce((p, u) => p + u, 0);
|
|
1202
979
|
let c = !1;
|
|
1203
980
|
const b = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
1204
981
|
b && (c = b.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? (console.info("TODO here", e), this.renderCell({
|
|
1205
982
|
areaModel: i,
|
|
1206
983
|
areaIdent: i.areaIdent,
|
|
1207
|
-
sideIdent:
|
|
984
|
+
sideIdent: l,
|
|
1208
985
|
rowIndex: e.r1,
|
|
1209
986
|
columnIndex: e.c1,
|
|
1210
987
|
left: S,
|
|
1211
|
-
top:
|
|
1212
|
-
width:
|
|
988
|
+
top: r,
|
|
989
|
+
width: m,
|
|
1213
990
|
height: g,
|
|
1214
991
|
parent: o,
|
|
1215
992
|
cellSelected: c,
|
|
@@ -1218,12 +995,12 @@ class ae extends re {
|
|
|
1218
995
|
})) : this.renderCell({
|
|
1219
996
|
areaModel: i,
|
|
1220
997
|
areaIdent: i.areaIdent,
|
|
1221
|
-
sideIdent:
|
|
998
|
+
sideIdent: l,
|
|
1222
999
|
rowIndex: e.r1,
|
|
1223
1000
|
columnIndex: e.c1,
|
|
1224
1001
|
left: S,
|
|
1225
|
-
top:
|
|
1226
|
-
width:
|
|
1002
|
+
top: r,
|
|
1003
|
+
width: m,
|
|
1227
1004
|
height: g,
|
|
1228
1005
|
parent: o,
|
|
1229
1006
|
cellSelected: c,
|
|
@@ -1233,8 +1010,8 @@ class ae extends re {
|
|
|
1233
1010
|
rowIndex: e.r1,
|
|
1234
1011
|
columnIndex: e.c1,
|
|
1235
1012
|
cellLeft: S,
|
|
1236
|
-
cellTop:
|
|
1237
|
-
cellWidth:
|
|
1013
|
+
cellTop: r,
|
|
1014
|
+
cellWidth: m,
|
|
1238
1015
|
cellHeight: g,
|
|
1239
1016
|
parent: o
|
|
1240
1017
|
});
|
|
@@ -1242,8 +1019,8 @@ class ae extends re {
|
|
|
1242
1019
|
findRowOfImportantRowspanCell(e, t, s) {
|
|
1243
1020
|
const i = e.getMaxRowspan();
|
|
1244
1021
|
for (let o = t - 1; o > -1; o--) {
|
|
1245
|
-
const
|
|
1246
|
-
if (
|
|
1022
|
+
const l = e.getRowspanAt(o, s);
|
|
1023
|
+
if (l > 1 && o + l + 1 >= t)
|
|
1247
1024
|
return o;
|
|
1248
1025
|
if (t - o > i)
|
|
1249
1026
|
return -1;
|
|
@@ -1256,8 +1033,8 @@ class ae extends re {
|
|
|
1256
1033
|
areaModel: s,
|
|
1257
1034
|
geo: i,
|
|
1258
1035
|
parent: o,
|
|
1259
|
-
rowIndex:
|
|
1260
|
-
columnIndexStart:
|
|
1036
|
+
rowIndex: l,
|
|
1037
|
+
columnIndexStart: r,
|
|
1261
1038
|
columnIndexEnd: n,
|
|
1262
1039
|
verticalFixed: a = !1,
|
|
1263
1040
|
lastRowOfModel: d = !1
|
|
@@ -1269,44 +1046,44 @@ class ae extends re {
|
|
|
1269
1046
|
const p = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1270
1047
|
S = this.scrollFactorX * p;
|
|
1271
1048
|
}
|
|
1272
|
-
const g = 0,
|
|
1049
|
+
const g = 0, m = !!(e === "body" && t);
|
|
1273
1050
|
let c = S;
|
|
1274
|
-
for (let p =
|
|
1051
|
+
for (let p = r; p <= n; p++) {
|
|
1275
1052
|
const u = c, x = this.tableModel.getColumnWidth(p);
|
|
1276
1053
|
if (x > 0 && u + x > 0) {
|
|
1277
|
-
let
|
|
1278
|
-
const
|
|
1279
|
-
|
|
1280
|
-
let
|
|
1281
|
-
|
|
1282
|
-
let
|
|
1283
|
-
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (b = this.colAndRowspanModels[e]) != null && b.isInRange(
|
|
1284
|
-
this.renderDragTargetDiv(o, u, g,
|
|
1285
|
-
const E = { left: u, top: g, width:
|
|
1054
|
+
let C = i.height;
|
|
1055
|
+
const w = s.getRowspanAt(l, p), v = s.getColspanAt(l, p);
|
|
1056
|
+
w > 1 && (C = this.getRowHeights(l, l + w - 1, s).reduce((E, M) => E + M, 0));
|
|
1057
|
+
let f = x;
|
|
1058
|
+
v > 1 && (f = this.getColumnWidths(p, p + v - 1).reduce((E, M) => E + M, 0));
|
|
1059
|
+
let R = !1;
|
|
1060
|
+
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (b = this.colAndRowspanModels[e]) != null && b.isInRange(l, p) && (R = !0), this.draggingTargetColumnIndex === p && e !== "header") {
|
|
1061
|
+
this.renderDragTargetDiv(o, u, g, f, C);
|
|
1062
|
+
const E = { left: u, top: g, width: f, height: C };
|
|
1286
1063
|
this.dom.addColumnBorderDivs(this.tableOptions, o, E, e, t);
|
|
1287
1064
|
} else {
|
|
1288
|
-
const E = this.renderSelectedBackgroundDiv(
|
|
1289
|
-
|
|
1065
|
+
const E = this.renderSelectedBackgroundDiv(R, m, t, s, l, p, o, u, g, f, C);
|
|
1066
|
+
R || this.renderCell({
|
|
1290
1067
|
areaModel: s,
|
|
1291
1068
|
areaIdent: e,
|
|
1292
1069
|
sideIdent: t,
|
|
1293
|
-
rowIndex:
|
|
1070
|
+
rowIndex: l,
|
|
1294
1071
|
columnIndex: p,
|
|
1295
1072
|
left: u,
|
|
1296
1073
|
top: g,
|
|
1297
|
-
width:
|
|
1298
|
-
height:
|
|
1074
|
+
width: f,
|
|
1075
|
+
height: C,
|
|
1299
1076
|
parent: o,
|
|
1300
1077
|
cellSelected: E,
|
|
1301
1078
|
lastRowOfModel: d,
|
|
1302
1079
|
gammaRange: !0
|
|
1303
1080
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1304
|
-
rowIndex:
|
|
1081
|
+
rowIndex: l,
|
|
1305
1082
|
columnIndex: p,
|
|
1306
1083
|
cellLeft: u,
|
|
1307
1084
|
cellTop: g,
|
|
1308
|
-
cellWidth:
|
|
1309
|
-
cellHeight:
|
|
1085
|
+
cellWidth: f,
|
|
1086
|
+
cellHeight: C,
|
|
1310
1087
|
parent: o
|
|
1311
1088
|
});
|
|
1312
1089
|
}
|
|
@@ -1325,54 +1102,54 @@ class ae extends re {
|
|
|
1325
1102
|
sideIdent: s,
|
|
1326
1103
|
rowIndex: i,
|
|
1327
1104
|
index: o,
|
|
1328
|
-
left:
|
|
1329
|
-
width:
|
|
1105
|
+
left: l,
|
|
1106
|
+
width: r,
|
|
1330
1107
|
height: n,
|
|
1331
1108
|
top: a,
|
|
1332
1109
|
parent: d,
|
|
1333
1110
|
lastRowOfModel: S
|
|
1334
1111
|
}) {
|
|
1335
|
-
var
|
|
1336
|
-
const
|
|
1112
|
+
var _;
|
|
1113
|
+
const m = this.editorRenderer && this.editorRendererRow === i && this.editorRendererColumn === o ? this.editorRenderer : e.getCellRenderer(i, o), c = { left: l, width: r, height: n, top: a, index: o }, b = e.getRowByIndex(i);
|
|
1337
1114
|
let p = "none";
|
|
1338
|
-
if (o === this.getTreeArrowColumnIndex() && b
|
|
1115
|
+
if (o === this.getTreeArrowColumnIndex() && L(b)) {
|
|
1339
1116
|
const y = b;
|
|
1340
|
-
(
|
|
1117
|
+
(_ = y.children) != null && _.length ? y.expanded ? p = "expanded" : p = "collapsed" : p = "hidden";
|
|
1341
1118
|
}
|
|
1342
1119
|
let x;
|
|
1343
1120
|
if (t === "header") {
|
|
1344
1121
|
const y = this.tableModel.getColumnDef(o);
|
|
1345
1122
|
(!(y != null && y.sortIconVisible) || y != null && y.sortIconVisible()) && (x = y == null ? void 0 : y.sortState);
|
|
1346
1123
|
}
|
|
1347
|
-
const
|
|
1124
|
+
const C = e.getValueAt(i, o), w = m ? "" : `${C}`, v = e.isRowChecked(i), f = this.dom.addColumnDiv(
|
|
1348
1125
|
d,
|
|
1349
1126
|
c,
|
|
1350
1127
|
i,
|
|
1351
1128
|
o,
|
|
1352
1129
|
t,
|
|
1353
1130
|
s,
|
|
1354
|
-
|
|
1131
|
+
w,
|
|
1355
1132
|
p,
|
|
1356
1133
|
this.tableOptions,
|
|
1357
|
-
|
|
1134
|
+
v,
|
|
1358
1135
|
x
|
|
1359
|
-
),
|
|
1360
|
-
|
|
1136
|
+
), R = e.getTooltipAt(i, o);
|
|
1137
|
+
R && this.dom.setAttribute(f, "title", R);
|
|
1361
1138
|
const E = this.tableModel.getColumnDef(o);
|
|
1362
|
-
E && E.classes[t] && this.dom.addClasses(E.classes[t],
|
|
1363
|
-
let
|
|
1364
|
-
|
|
1365
|
-
const
|
|
1366
|
-
if (
|
|
1139
|
+
E && E.classes[t] && this.dom.addClasses(E.classes[t], f);
|
|
1140
|
+
let M;
|
|
1141
|
+
m && (M = m.render(f, i, o, t, e, C, this.dom.domService));
|
|
1142
|
+
const I = e.getCustomClassesAt(i, o);
|
|
1143
|
+
if (I.length && this.dom.addClasses(I, f), this.dom.addColumnBorderDivs(this.tableOptions, d, c, t, s), S && this.dom.addHorizontalBorder({ left: l, width: r, height: n, top: a + n }, d), this.getFocusModel && t === "body") {
|
|
1367
1144
|
const y = this.getFocusModel();
|
|
1368
1145
|
y != null && y.hasFocus(i, o) && this.dom.addFocusBorderDivs(d, c, {});
|
|
1369
1146
|
}
|
|
1370
|
-
t === "header" && this.dom.setAttribute(
|
|
1147
|
+
t === "header" && this.dom.setAttribute(f, "data-ge-action", "drag-column");
|
|
1371
1148
|
const F = e.getCustomStyleAt(i, o);
|
|
1372
1149
|
if (F)
|
|
1373
1150
|
for (const y in F)
|
|
1374
|
-
this.dom.setStyle(
|
|
1375
|
-
return [
|
|
1151
|
+
this.dom.setStyle(f, y, F[y]);
|
|
1152
|
+
return [f, M];
|
|
1376
1153
|
}
|
|
1377
1154
|
getColumnWidths(e, t) {
|
|
1378
1155
|
const s = [];
|
|
@@ -1426,22 +1203,22 @@ class ae extends re {
|
|
|
1426
1203
|
this.debounceTimeout && clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(e.bind(this), t);
|
|
1427
1204
|
}
|
|
1428
1205
|
renderDragTargetDiv(e, t, s, i, o) {
|
|
1429
|
-
const
|
|
1206
|
+
const l = this.dom.applyStylePosistionAbsolute(
|
|
1430
1207
|
this.dom.createDivWithClass("ge-table-drop-zone", e)
|
|
1431
1208
|
);
|
|
1432
|
-
return this.dom.setStyle(
|
|
1209
|
+
return this.dom.setStyle(l, "left", `${t}px`), this.dom.setStyle(l, "top", `${s}px`), this.dom.setStyle(l, "width", `${i}px`), this.dom.setStyle(l, "height", `${o}px`), l;
|
|
1433
1210
|
}
|
|
1434
|
-
renderSelectedBackgroundDiv(e, t, s, i, o,
|
|
1211
|
+
renderSelectedBackgroundDiv(e, t, s, i, o, l, r, n, a, d, S) {
|
|
1435
1212
|
let g = !1;
|
|
1436
|
-
if (!e && t && i.isSelectable(o,
|
|
1437
|
-
const
|
|
1438
|
-
if (
|
|
1439
|
-
const c =
|
|
1213
|
+
if (!e && t && i.isSelectable(o, l) && this.getSelectionModel) {
|
|
1214
|
+
const m = this.getSelectionModel();
|
|
1215
|
+
if (m) {
|
|
1216
|
+
const c = m.getSelectionCount(o, l);
|
|
1440
1217
|
g = c > 0;
|
|
1441
1218
|
for (let b = 0; b < c; b++) {
|
|
1442
1219
|
const p = this.dom.applyStylePosistionAbsolute(
|
|
1443
1220
|
// ge-table-body-west-selected-range
|
|
1444
|
-
this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`,
|
|
1221
|
+
this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`, r)
|
|
1445
1222
|
);
|
|
1446
1223
|
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`);
|
|
1447
1224
|
}
|
|
@@ -1455,14 +1232,14 @@ class ae extends re {
|
|
|
1455
1232
|
sideIdent: s,
|
|
1456
1233
|
rowIndex: i,
|
|
1457
1234
|
columnIndex: o,
|
|
1458
|
-
left:
|
|
1459
|
-
top:
|
|
1235
|
+
left: l,
|
|
1236
|
+
top: r,
|
|
1460
1237
|
width: n,
|
|
1461
1238
|
height: a,
|
|
1462
1239
|
parent: d,
|
|
1463
1240
|
cellSelected: S,
|
|
1464
1241
|
lastRowOfModel: g,
|
|
1465
|
-
gammaRange:
|
|
1242
|
+
gammaRange: m
|
|
1466
1243
|
}) {
|
|
1467
1244
|
const [c, b] = this.addAndRenderCellDiv({
|
|
1468
1245
|
areaModel: e,
|
|
@@ -1470,27 +1247,27 @@ class ae extends re {
|
|
|
1470
1247
|
sideIdent: s,
|
|
1471
1248
|
rowIndex: i,
|
|
1472
1249
|
index: o,
|
|
1473
|
-
left:
|
|
1250
|
+
left: l,
|
|
1474
1251
|
width: n,
|
|
1475
1252
|
height: a,
|
|
1476
|
-
top:
|
|
1253
|
+
top: r,
|
|
1477
1254
|
parent: d,
|
|
1478
1255
|
lastRowOfModel: g,
|
|
1479
|
-
gammaRange:
|
|
1256
|
+
gammaRange: m
|
|
1480
1257
|
});
|
|
1481
1258
|
S && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, c), b && this.cleanupFunctions[t].push(b);
|
|
1482
1259
|
}
|
|
1483
|
-
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight:
|
|
1260
|
+
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight: l, parent: r }) {
|
|
1484
1261
|
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", `${
|
|
1262
|
+
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", `${l}px`), n.appendChild(r, d);
|
|
1486
1263
|
}
|
|
1487
1264
|
}
|
|
1488
|
-
class
|
|
1265
|
+
class he {
|
|
1489
1266
|
constructor(e, t) {
|
|
1490
1267
|
this.columnIndex = e, this.sortState = t;
|
|
1491
1268
|
}
|
|
1492
1269
|
}
|
|
1493
|
-
class
|
|
1270
|
+
class ce {
|
|
1494
1271
|
constructor(e) {
|
|
1495
1272
|
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
1496
1273
|
}
|
|
@@ -1498,36 +1275,36 @@ class he {
|
|
|
1498
1275
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1499
1276
|
const t = e.target, s = t.getAttribute("data-area"), i = t.getAttribute("data-row-index"), o = t.getAttribute("data-col-index");
|
|
1500
1277
|
if (s && i && o) {
|
|
1501
|
-
const
|
|
1502
|
-
this.tableScope.updateModelValueAfterEdit(
|
|
1278
|
+
const l = B(s), r = Number(i), n = Number(o);
|
|
1279
|
+
this.tableScope.updateModelValueAfterEdit(l, r, n, t.value);
|
|
1503
1280
|
}
|
|
1504
1281
|
}
|
|
1505
1282
|
}
|
|
1506
1283
|
}
|
|
1507
|
-
class
|
|
1284
|
+
class pe {
|
|
1508
1285
|
constructor(e = -1, t = -1) {
|
|
1509
1286
|
this.rowIndex = e, this.columnIndex = t;
|
|
1510
1287
|
}
|
|
1511
1288
|
}
|
|
1512
|
-
class
|
|
1289
|
+
class H {
|
|
1513
1290
|
constructor(e) {
|
|
1514
1291
|
this.cells = e;
|
|
1515
1292
|
}
|
|
1516
1293
|
static createSingle(e, t) {
|
|
1517
|
-
return new
|
|
1294
|
+
return new H([new pe(e, t)]);
|
|
1518
1295
|
}
|
|
1519
1296
|
}
|
|
1520
|
-
class
|
|
1297
|
+
class ue {
|
|
1521
1298
|
constructor(e) {
|
|
1522
1299
|
var t, s;
|
|
1523
1300
|
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
1301
|
}
|
|
1525
1302
|
onMouseClicked(e, t) {
|
|
1526
|
-
var o,
|
|
1303
|
+
var o, l, r, n, a, d, S;
|
|
1527
1304
|
let s = !1, i = !1;
|
|
1528
1305
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1529
|
-
const g = this.getSelectionModel(),
|
|
1530
|
-
g &&
|
|
1306
|
+
const g = this.getSelectionModel(), m = this.getFocusModel();
|
|
1307
|
+
g && m && (m.hasFocus(e.rowIndex, e.columnIndex) || (m.setFocus(e.rowIndex, e.columnIndex), s = !0), (o = e.originalEvent) != null && o.shiftKey || g.hasSelection() && (g.clear(), s = !0), (l = e.originalEvent) != null && l.shiftKey && this.previousEvt ? (g.addSelection(this.createRangeByEvents(e, this.previousEvt)), i = !0, s = !0) : (r = e.originalEvent) != null && r.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));
|
|
1531
1308
|
}
|
|
1532
1309
|
return i ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
1533
1310
|
}
|
|
@@ -1549,16 +1326,16 @@ class pe {
|
|
|
1549
1326
|
}
|
|
1550
1327
|
createRangeByEvents(e, t) {
|
|
1551
1328
|
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),
|
|
1329
|
+
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), l = Math.max(e.columnIndex, t == null ? void 0 : t.columnIndex);
|
|
1553
1330
|
return A.create({
|
|
1554
1331
|
rowIndex1: s,
|
|
1555
1332
|
columnIndex1: o,
|
|
1556
1333
|
rowIndex2: i,
|
|
1557
|
-
columnIndex2:
|
|
1334
|
+
columnIndex2: l
|
|
1558
1335
|
});
|
|
1559
1336
|
}
|
|
1560
1337
|
}
|
|
1561
|
-
class
|
|
1338
|
+
class Se {
|
|
1562
1339
|
get() {
|
|
1563
1340
|
return {
|
|
1564
1341
|
f2: "START_EDITING",
|
|
@@ -1576,7 +1353,7 @@ class ue {
|
|
|
1576
1353
|
};
|
|
1577
1354
|
}
|
|
1578
1355
|
}
|
|
1579
|
-
class
|
|
1356
|
+
class ge {
|
|
1580
1357
|
get() {
|
|
1581
1358
|
return {
|
|
1582
1359
|
f2: "START_EDITING",
|
|
@@ -1596,7 +1373,7 @@ class Se {
|
|
|
1596
1373
|
};
|
|
1597
1374
|
}
|
|
1598
1375
|
}
|
|
1599
|
-
class
|
|
1376
|
+
class me {
|
|
1600
1377
|
constructor(e) {
|
|
1601
1378
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
1602
1379
|
}
|
|
@@ -1604,7 +1381,7 @@ class ge {
|
|
|
1604
1381
|
this.listener.includes(e) || this.listener.push(e);
|
|
1605
1382
|
}
|
|
1606
1383
|
init() {
|
|
1607
|
-
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new
|
|
1384
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new ge().get()) : Object.assign(this.shortcutActionIdMapping, new Se().get()), Object.assign(this.shortcutActionIdMapping, this.tableScope.tableOptions.shortcutActionIdMapping), this.isDebug() && console.debug("ShortcutService", this.shortcutActionIdMapping), this.tableScope.hostElement.addEventListener("keydown", this.onKeyDown.bind(this));
|
|
1608
1385
|
}
|
|
1609
1386
|
isMacintosh() {
|
|
1610
1387
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -1648,7 +1425,7 @@ class ge {
|
|
|
1648
1425
|
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();
|
|
1649
1426
|
}
|
|
1650
1427
|
}
|
|
1651
|
-
class
|
|
1428
|
+
class V {
|
|
1652
1429
|
onCheckboxChanged(e) {
|
|
1653
1430
|
}
|
|
1654
1431
|
onContextmenu(e) {
|
|
@@ -1664,19 +1441,150 @@ class fe {
|
|
|
1664
1441
|
onMouseMoved(e) {
|
|
1665
1442
|
}
|
|
1666
1443
|
}
|
|
1667
|
-
class
|
|
1444
|
+
class z {
|
|
1445
|
+
setStyle(e, t, s) {
|
|
1446
|
+
return e.style[t] = s, e;
|
|
1447
|
+
}
|
|
1448
|
+
appendText(e, t) {
|
|
1449
|
+
const s = this.createText(t);
|
|
1450
|
+
return this.appendChild(e, s), s;
|
|
1451
|
+
}
|
|
1452
|
+
addClass(e, t) {
|
|
1453
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.add(s)) : e.classList.add(t), e;
|
|
1454
|
+
}
|
|
1455
|
+
appendChild(e, t) {
|
|
1456
|
+
e.appendChild(t);
|
|
1457
|
+
}
|
|
1458
|
+
createElement(e) {
|
|
1459
|
+
return document.createElement(e);
|
|
1460
|
+
}
|
|
1461
|
+
createText(e) {
|
|
1462
|
+
return document.createTextNode(e);
|
|
1463
|
+
}
|
|
1464
|
+
setAttribute(e, t, s) {
|
|
1465
|
+
e.setAttribute(t, s);
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
class fe {
|
|
1469
|
+
render(e, t, s, i, o, l, r) {
|
|
1470
|
+
if (o.isEditable(t, s)) {
|
|
1471
|
+
r.addClass(e, "ge-table-row-input-div");
|
|
1472
|
+
const n = o.getValueAt(t, s);
|
|
1473
|
+
e.innerHTML = `
|
|
1474
|
+
<input
|
|
1475
|
+
type="text"
|
|
1476
|
+
value="${n}"
|
|
1477
|
+
autofocus
|
|
1478
|
+
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
1479
|
+
data-listen="change"
|
|
1480
|
+
data-area="${i}"
|
|
1481
|
+
data-row-index="${t}"
|
|
1482
|
+
data-col-index="${s}"
|
|
1483
|
+
data-input-type="text"
|
|
1484
|
+
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
1485
|
+
class="ge-table-cell-editor-input">`;
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
class be {
|
|
1490
|
+
constructor(e = "none", t = "single") {
|
|
1491
|
+
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1492
|
+
}
|
|
1493
|
+
getSelectionCount(e, t) {
|
|
1494
|
+
let s = 0;
|
|
1495
|
+
for (const i of this.ranges)
|
|
1496
|
+
i.isInRange(e, t) && s++;
|
|
1497
|
+
return this.allSelected && s++, this.isInNegativeRange(e, t) && (s = 0), s;
|
|
1498
|
+
}
|
|
1499
|
+
isInNegativeRange(e, t) {
|
|
1500
|
+
for (const s of this.negativeRanges)
|
|
1501
|
+
if (s.isInRange(e, t))
|
|
1502
|
+
return !0;
|
|
1503
|
+
return !1;
|
|
1504
|
+
}
|
|
1505
|
+
getRanges() {
|
|
1506
|
+
return this.ranges;
|
|
1507
|
+
}
|
|
1508
|
+
clear() {
|
|
1509
|
+
this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1510
|
+
}
|
|
1511
|
+
hasSelection() {
|
|
1512
|
+
return !!this.ranges.length;
|
|
1513
|
+
}
|
|
1514
|
+
selectAll() {
|
|
1515
|
+
this.allSelected = !0;
|
|
1516
|
+
}
|
|
1517
|
+
addSelection(e) {
|
|
1518
|
+
this.addRange(e);
|
|
1519
|
+
}
|
|
1520
|
+
removeSelection(e) {
|
|
1521
|
+
if (this.selectionType === "none")
|
|
1522
|
+
return;
|
|
1523
|
+
let t = e;
|
|
1524
|
+
this.selectionType === "row" ? t = A.singleRow(e.r1) : this.selectionType === "column" && (t = A.singleColumn(e.c1)), this.negativeRanges.push(t);
|
|
1525
|
+
}
|
|
1526
|
+
togglePoint(e, t) {
|
|
1527
|
+
this.getSelectionCount(e, t) > 0 ? this.removeSelection(A.singleCell(e, t)) : this.addSelection(A.singleCell(e, t));
|
|
1528
|
+
}
|
|
1529
|
+
addRange(e) {
|
|
1530
|
+
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));
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
class ye {
|
|
1534
|
+
constructor(e = "none") {
|
|
1535
|
+
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
|
|
1536
|
+
}
|
|
1537
|
+
clearChanged() {
|
|
1538
|
+
this.changed = !1;
|
|
1539
|
+
}
|
|
1540
|
+
hasChanged() {
|
|
1541
|
+
return this.changed;
|
|
1542
|
+
}
|
|
1543
|
+
clear() {
|
|
1544
|
+
this.rowIndex = -1, this.columnIndex = -1;
|
|
1545
|
+
}
|
|
1546
|
+
setFocus(e, t) {
|
|
1547
|
+
(this.rowIndex !== e || this.columnIndex !== t) && (this.rowIndex = e, this.columnIndex = t, this.changed = !0);
|
|
1548
|
+
}
|
|
1549
|
+
hasFocus(e, t) {
|
|
1550
|
+
return this.rowIndex === e && this.columnIndex === t;
|
|
1551
|
+
}
|
|
1552
|
+
getFocus() {
|
|
1553
|
+
return [this.rowIndex, this.columnIndex];
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
const ve = new be(), xe = new ye("cell");
|
|
1557
|
+
class j {
|
|
1558
|
+
constructor() {
|
|
1559
|
+
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 = {
|
|
1560
|
+
header: 34,
|
|
1561
|
+
body: 34,
|
|
1562
|
+
footer: 34
|
|
1563
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new G(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new N(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new fe(), this.getSelectionModel = () => ve, this.getFocusModel = () => xe;
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
class P extends de {
|
|
1668
1567
|
constructor(e, t, s, i, o) {
|
|
1669
|
-
var
|
|
1568
|
+
var l;
|
|
1670
1569
|
if (super(
|
|
1671
1570
|
e,
|
|
1672
1571
|
t,
|
|
1673
|
-
new
|
|
1572
|
+
new Q(s),
|
|
1674
1573
|
i
|
|
1675
|
-
), this.eventListener = o, this.selectionService = new
|
|
1676
|
-
const
|
|
1677
|
-
n && (
|
|
1574
|
+
), this.eventListener = o, this.selectionService = new ue(this), this.api = new te(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new V()), (l = this.tableOptions) != null && l.autoRestoreOptions) {
|
|
1575
|
+
const r = this.tableOptions.autoRestoreOptions, n = r.getStorageKeyFn;
|
|
1576
|
+
n && (r.autoRestoreScrollPosition && (this.storeScrollPosStateService = new se(n)), r.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new oe(n)), r.autoRestoreSortingState && (this.storeSortingService = new le(n)));
|
|
1678
1577
|
}
|
|
1679
|
-
this.mouseHandler = new
|
|
1578
|
+
this.mouseHandler = new ee(this), this.inputHandler = new ce(this), this.shortcutService = new me(this), this.shortcutService.addListener(this.selectionService);
|
|
1579
|
+
}
|
|
1580
|
+
static create(e, t, s = new j(), i = new V(), o = new z()) {
|
|
1581
|
+
return new P(
|
|
1582
|
+
e,
|
|
1583
|
+
t,
|
|
1584
|
+
o,
|
|
1585
|
+
s,
|
|
1586
|
+
i
|
|
1587
|
+
);
|
|
1680
1588
|
}
|
|
1681
1589
|
onActionTriggered(e) {
|
|
1682
1590
|
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))
|
|
@@ -1692,7 +1600,7 @@ class me extends ae {
|
|
|
1692
1600
|
return !1;
|
|
1693
1601
|
}
|
|
1694
1602
|
updateModelValueAfterEdit(e, t, s, i) {
|
|
1695
|
-
e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, i) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(
|
|
1603
|
+
e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, i) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(H.createSingle(t, s)), this.hostElement.focus());
|
|
1696
1604
|
}
|
|
1697
1605
|
getApi() {
|
|
1698
1606
|
return this.api;
|
|
@@ -1702,10 +1610,10 @@ class me extends ae {
|
|
|
1702
1610
|
*/
|
|
1703
1611
|
firstInit() {
|
|
1704
1612
|
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();
|
|
1613
|
+
return this.tableModel.init(), (e = this.tableOptions) != null && e.externalFilterFunction && this.externalFilterChanged(!1), this.autoRestoreCollapsedExpandedState(), this.autoRestoreSortingState(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.autoRestoreScrollPosition(), this;
|
|
1706
1614
|
}
|
|
1707
1615
|
createGeMouseEvent(e) {
|
|
1708
|
-
const t = new
|
|
1616
|
+
const t = new $();
|
|
1709
1617
|
if (t.originalEvent = e, e) {
|
|
1710
1618
|
const s = e.target;
|
|
1711
1619
|
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) {
|
|
@@ -1737,14 +1645,14 @@ class me extends ae {
|
|
|
1737
1645
|
toggleExpandCollapseAll(e = !0) {
|
|
1738
1646
|
var s;
|
|
1739
1647
|
const t = this.tableModel.getBodyModel();
|
|
1740
|
-
t
|
|
1648
|
+
O(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
1741
1649
|
}
|
|
1742
1650
|
toggleRowCheckbox(e, t, s) {
|
|
1743
1651
|
var n;
|
|
1744
|
-
const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e),
|
|
1745
|
-
i.setRowChecked(e,
|
|
1746
|
-
const
|
|
1747
|
-
this.eventListener.onCheckboxChanged(
|
|
1652
|
+
const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e), l = o === void 0 || o === "semi" || o === "none";
|
|
1653
|
+
i.setRowChecked(e, l), this.repaint();
|
|
1654
|
+
const r = (n = i.rowSelectionModel) == null ? void 0 : n.getCheckedRows();
|
|
1655
|
+
this.eventListener.onCheckboxChanged(r || []);
|
|
1748
1656
|
}
|
|
1749
1657
|
onMouseClicked(e, t) {
|
|
1750
1658
|
let s = this.selectionService.onMouseClicked(e, t);
|
|
@@ -1759,12 +1667,12 @@ class me extends ae {
|
|
|
1759
1667
|
t && (e && this.clearSelectionModel(), this.tableModel.externalFilterChanged(t), this.scrollViewport.scrollTo(0, 0), this.tableModel.recalcHeightAndPadding(), this.resetSizeOfWrapperDiv(), this.repaint());
|
|
1760
1668
|
}
|
|
1761
1669
|
onHeaderDblClicked(e, t, s) {
|
|
1762
|
-
var o,
|
|
1670
|
+
var o, l;
|
|
1763
1671
|
const i = this.tableModel.getColumnDef(s);
|
|
1764
1672
|
if (i != null && i.sortable && i.sortable()) {
|
|
1765
1673
|
e.preventDefault(), e.stopPropagation();
|
|
1766
|
-
const
|
|
1767
|
-
this.tableModel.doSort([d]) && ((o = this.tableModel.getColumnDefs()) == null || o.forEach((g) => g.sortState = ""), i.sortState = a), this.repaint(), (
|
|
1674
|
+
const r = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, n = i.sortState ?? "", a = r[(r.indexOf(n) + 1) % r.length], d = new he(s, a);
|
|
1675
|
+
this.tableModel.doSort([d]) && ((o = this.tableModel.getColumnDefs()) == null || o.forEach((g) => g.sortState = ""), i.sortState = a), this.repaint(), (l = this.storeSortingService) == null || l.setSortItems([d]);
|
|
1768
1676
|
}
|
|
1769
1677
|
}
|
|
1770
1678
|
changeFocusCell(e, t) {
|
|
@@ -1807,11 +1715,11 @@ class me extends ae {
|
|
|
1807
1715
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
|
|
1808
1716
|
const s = this.tableOptions.autoRestoreOptions, i = s.getRowId;
|
|
1809
1717
|
if (s.autoRestoreCollapsedExpandedState && i) {
|
|
1810
|
-
const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(),
|
|
1811
|
-
if (
|
|
1812
|
-
const
|
|
1718
|
+
const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), l = this.tableModel.getAreaModel("body");
|
|
1719
|
+
if (O(l)) {
|
|
1720
|
+
const r = l, n = l.getRowCount();
|
|
1813
1721
|
for (let a = 0; a < n; a++) {
|
|
1814
|
-
const d =
|
|
1722
|
+
const d = l.getRowByIndex(a);
|
|
1815
1723
|
if (d)
|
|
1816
1724
|
if (o.allExpanded)
|
|
1817
1725
|
d.expanded = !0;
|
|
@@ -1822,135 +1730,13 @@ class me extends ae {
|
|
|
1822
1730
|
o.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(S) : o.mode === "collapsed" && (d.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(S));
|
|
1823
1731
|
}
|
|
1824
1732
|
}
|
|
1825
|
-
|
|
1733
|
+
r.recalcVisibleTreeRows();
|
|
1826
1734
|
}
|
|
1827
1735
|
}
|
|
1828
1736
|
}
|
|
1829
1737
|
}
|
|
1830
1738
|
}
|
|
1831
|
-
|
|
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 = `
|
|
1837
|
-
<input
|
|
1838
|
-
type="text"
|
|
1839
|
-
value="${n}"
|
|
1840
|
-
autofocus
|
|
1841
|
-
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
1842
|
-
data-listen="change"
|
|
1843
|
-
data-area="${i}"
|
|
1844
|
-
data-row-index="${t}"
|
|
1845
|
-
data-col-index="${s}"
|
|
1846
|
-
data-input-type="text"
|
|
1847
|
-
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
1848
|
-
class="ge-table-cell-editor-input">`;
|
|
1849
|
-
}
|
|
1850
|
-
}
|
|
1851
|
-
}
|
|
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;
|
|
1867
|
-
}
|
|
1868
|
-
getRanges() {
|
|
1869
|
-
return this.ranges;
|
|
1870
|
-
}
|
|
1871
|
-
clear() {
|
|
1872
|
-
this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1873
|
-
}
|
|
1874
|
-
hasSelection() {
|
|
1875
|
-
return !!this.ranges.length;
|
|
1876
|
-
}
|
|
1877
|
-
selectAll() {
|
|
1878
|
-
this.allSelected = !0;
|
|
1879
|
-
}
|
|
1880
|
-
addSelection(e) {
|
|
1881
|
-
this.addRange(e);
|
|
1882
|
-
}
|
|
1883
|
-
removeSelection(e) {
|
|
1884
|
-
if (this.selectionType === "none")
|
|
1885
|
-
return;
|
|
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);
|
|
1888
|
-
}
|
|
1889
|
-
togglePoint(e, t) {
|
|
1890
|
-
this.getSelectionCount(e, t) > 0 ? this.removeSelection(A.singleCell(e, t)) : this.addSelection(A.singleCell(e, t));
|
|
1891
|
-
}
|
|
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));
|
|
1894
|
-
}
|
|
1895
|
-
}
|
|
1896
|
-
class we {
|
|
1897
|
-
constructor(e = "none") {
|
|
1898
|
-
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
|
|
1899
|
-
}
|
|
1900
|
-
clearChanged() {
|
|
1901
|
-
this.changed = !1;
|
|
1902
|
-
}
|
|
1903
|
-
hasChanged() {
|
|
1904
|
-
return this.changed;
|
|
1905
|
-
}
|
|
1906
|
-
clear() {
|
|
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);
|
|
1911
|
-
}
|
|
1912
|
-
hasFocus(e, t) {
|
|
1913
|
-
return this.rowIndex === e && this.columnIndex === t;
|
|
1914
|
-
}
|
|
1915
|
-
getFocus() {
|
|
1916
|
-
return [this.rowIndex, this.columnIndex];
|
|
1917
|
-
}
|
|
1918
|
-
}
|
|
1919
|
-
const xe = new ye(), ve = new we("cell");
|
|
1920
|
-
class Ce {
|
|
1921
|
-
constructor() {
|
|
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 = {
|
|
1923
|
-
header: 34,
|
|
1924
|
-
body: 34,
|
|
1925
|
-
footer: 34
|
|
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;
|
|
1927
|
-
}
|
|
1928
|
-
}
|
|
1929
|
-
class Ee {
|
|
1930
|
-
setStyle(e, t, s) {
|
|
1931
|
-
return e.style[t] = s, e;
|
|
1932
|
-
}
|
|
1933
|
-
appendText(e, t) {
|
|
1934
|
-
const s = this.createText(t);
|
|
1935
|
-
return this.appendChild(e, s), s;
|
|
1936
|
-
}
|
|
1937
|
-
addClass(e, t) {
|
|
1938
|
-
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.add(s)) : e.classList.add(t), e;
|
|
1939
|
-
}
|
|
1940
|
-
appendChild(e, t) {
|
|
1941
|
-
e.appendChild(t);
|
|
1942
|
-
}
|
|
1943
|
-
createElement(e) {
|
|
1944
|
-
return document.createElement(e);
|
|
1945
|
-
}
|
|
1946
|
-
createText(e) {
|
|
1947
|
-
return document.createTextNode(e);
|
|
1948
|
-
}
|
|
1949
|
-
setAttribute(e, t, s) {
|
|
1950
|
-
e.setAttribute(t, s);
|
|
1951
|
-
}
|
|
1952
|
-
}
|
|
1953
|
-
const Ae = G({
|
|
1739
|
+
const Ce = X({
|
|
1954
1740
|
inheritAttrs: !1,
|
|
1955
1741
|
props: {
|
|
1956
1742
|
tableModel: {
|
|
@@ -1958,7 +1744,7 @@ const Ae = G({
|
|
|
1958
1744
|
},
|
|
1959
1745
|
tableOptions: {
|
|
1960
1746
|
required: !1,
|
|
1961
|
-
default: new
|
|
1747
|
+
default: new j()
|
|
1962
1748
|
},
|
|
1963
1749
|
debounceMouseClickDelay: {
|
|
1964
1750
|
required: !1,
|
|
@@ -1976,64 +1762,64 @@ const Ae = G({
|
|
|
1976
1762
|
"mouseMoved"
|
|
1977
1763
|
],
|
|
1978
1764
|
setup(h, { emit: e }) {
|
|
1979
|
-
const t =
|
|
1765
|
+
const t = K(null), s = (i) => {
|
|
1980
1766
|
const o = {
|
|
1981
|
-
onCheckboxChanged: (
|
|
1982
|
-
e("checkboxChanged",
|
|
1767
|
+
onCheckboxChanged: (r) => {
|
|
1768
|
+
e("checkboxChanged", r);
|
|
1983
1769
|
},
|
|
1984
|
-
onContextmenu: (
|
|
1985
|
-
e("contextmenu",
|
|
1770
|
+
onContextmenu: (r) => {
|
|
1771
|
+
e("contextmenu", r);
|
|
1986
1772
|
},
|
|
1987
|
-
onModelChanged: (
|
|
1988
|
-
e("modelChanged",
|
|
1773
|
+
onModelChanged: (r) => {
|
|
1774
|
+
e("modelChanged", r);
|
|
1989
1775
|
},
|
|
1990
|
-
onMouseClicked: (
|
|
1991
|
-
e("mouseClicked",
|
|
1776
|
+
onMouseClicked: (r) => {
|
|
1777
|
+
e("mouseClicked", r);
|
|
1992
1778
|
},
|
|
1993
|
-
onMouseDragging: (
|
|
1994
|
-
e("mouseDragging",
|
|
1779
|
+
onMouseDragging: (r) => {
|
|
1780
|
+
e("mouseDragging", r);
|
|
1995
1781
|
},
|
|
1996
|
-
onMouseDraggingEnd: (
|
|
1997
|
-
e("mouseDraggingEnd",
|
|
1782
|
+
onMouseDraggingEnd: (r) => {
|
|
1783
|
+
e("mouseDraggingEnd", r);
|
|
1998
1784
|
},
|
|
1999
|
-
onMouseMoved: (
|
|
2000
|
-
e("mouseMoved",
|
|
1785
|
+
onMouseMoved: (r) => {
|
|
1786
|
+
e("mouseMoved", r);
|
|
2001
1787
|
}
|
|
2002
|
-
},
|
|
1788
|
+
}, l = new P(
|
|
2003
1789
|
i,
|
|
2004
1790
|
h.tableModel,
|
|
2005
|
-
new
|
|
1791
|
+
new z(),
|
|
2006
1792
|
h.tableOptions,
|
|
2007
1793
|
o
|
|
2008
1794
|
);
|
|
2009
|
-
|
|
1795
|
+
l.firstInit(), e("tableReady", l.getApi());
|
|
2010
1796
|
};
|
|
2011
|
-
return
|
|
1797
|
+
return Y(() => {
|
|
2012
1798
|
t.value && s(t.value);
|
|
2013
1799
|
}), {
|
|
2014
1800
|
root: t
|
|
2015
1801
|
};
|
|
2016
1802
|
}
|
|
2017
1803
|
});
|
|
2018
|
-
const
|
|
1804
|
+
const we = (h, e) => {
|
|
2019
1805
|
const t = h.__vccOpts || h;
|
|
2020
1806
|
for (const [s, i] of e)
|
|
2021
1807
|
t[s] = i;
|
|
2022
1808
|
return t;
|
|
2023
|
-
},
|
|
1809
|
+
}, Ee = {
|
|
2024
1810
|
ref: "root",
|
|
2025
1811
|
class: "container-div",
|
|
2026
1812
|
style: { width: "100%", height: "100%", "background-color": "transparent", padding: "0", margin: "0" }
|
|
2027
1813
|
};
|
|
2028
|
-
function
|
|
2029
|
-
return
|
|
1814
|
+
function Ae(h, e, t, s, i, o) {
|
|
1815
|
+
return q(), U("div", Ee, null, 512);
|
|
2030
1816
|
}
|
|
2031
|
-
const
|
|
2032
|
-
class
|
|
1817
|
+
const Me = /* @__PURE__ */ we(Ce, [["render", Ae]]);
|
|
1818
|
+
class Te {
|
|
2033
1819
|
constructor(e, t) {
|
|
2034
1820
|
this.component = e, this.appContext = t;
|
|
2035
1821
|
}
|
|
2036
|
-
render(e, t, s, i, o,
|
|
1822
|
+
render(e, t, s, i, o, l, r) {
|
|
2037
1823
|
return this.mount(
|
|
2038
1824
|
this.component,
|
|
2039
1825
|
{
|
|
@@ -2042,26 +1828,26 @@ class Fe {
|
|
|
2042
1828
|
columnIndex: s,
|
|
2043
1829
|
areaIdent: i,
|
|
2044
1830
|
areaModel: o,
|
|
2045
|
-
cellValue:
|
|
1831
|
+
cellValue: l
|
|
2046
1832
|
},
|
|
2047
1833
|
this.appContext,
|
|
2048
1834
|
e
|
|
2049
1835
|
);
|
|
2050
1836
|
}
|
|
2051
1837
|
mount(e, t, s, i) {
|
|
2052
|
-
let o =
|
|
1838
|
+
let o = J(e, t);
|
|
2053
1839
|
return o.appContext = s, k(o, i), () => {
|
|
2054
1840
|
i && k(null, i);
|
|
2055
1841
|
};
|
|
2056
1842
|
}
|
|
2057
1843
|
}
|
|
2058
|
-
const
|
|
1844
|
+
const De = {
|
|
2059
1845
|
install: (h, e = { img: "" }) => {
|
|
2060
|
-
h.component("GuiexpertTable",
|
|
1846
|
+
h.component("GuiexpertTable", Me);
|
|
2061
1847
|
}
|
|
2062
1848
|
};
|
|
2063
1849
|
export {
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
1850
|
+
Te as ComponentRendererWrapper,
|
|
1851
|
+
Me as GuiexpertTable,
|
|
1852
|
+
De as default
|
|
2067
1853
|
};
|