@guiexpert/react-table 18.0.12 → 18.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +25 -9
- package/index.js +593 -459
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as se } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as oe, useEffect as ie } from "react";
|
|
3
|
-
import
|
|
4
|
-
function
|
|
3
|
+
import ae from "react-dom";
|
|
4
|
+
function re(f, e = 500) {
|
|
5
5
|
let t = null;
|
|
6
6
|
return function(...s) {
|
|
7
7
|
t && window.clearTimeout(t), t = window.setTimeout(() => {
|
|
8
|
-
|
|
8
|
+
f.apply(this, s), t = null;
|
|
9
9
|
}, e);
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -34,18 +34,18 @@ class k {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
function H(
|
|
38
|
-
return
|
|
37
|
+
function H(f) {
|
|
38
|
+
return f && f.type === "TreeRow";
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
40
|
+
function W(f) {
|
|
41
|
+
return f && f.type === "AreaModelTree";
|
|
42
42
|
}
|
|
43
|
-
class
|
|
44
|
-
constructor(e = -1, t = -1, s = -1, o = -1, i,
|
|
45
|
-
this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = o, this.areaIdent = i, this.sideIdent =
|
|
43
|
+
class N {
|
|
44
|
+
constructor(e = -1, t = -1, s = -1, o = -1, i, a, l, r = 0, n = 0, c = 0, h = "") {
|
|
45
|
+
this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = o, this.areaIdent = i, this.sideIdent = a, this.originalEvent = l, this.clickCount = r, this.draggingX = n, this.draggingY = c, this.action = h;
|
|
46
46
|
}
|
|
47
47
|
clone() {
|
|
48
|
-
return new
|
|
48
|
+
return new N(
|
|
49
49
|
this.rowIndex,
|
|
50
50
|
this.rowTop,
|
|
51
51
|
this.columnIndex,
|
|
@@ -86,12 +86,12 @@ class J {
|
|
|
86
86
|
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = o;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
class
|
|
89
|
+
class Z {
|
|
90
90
|
constructor(e = new D("↑", "", ["ge-header-sorted-asc"]), t = new D("↓", "", ["ge-header-sorted-desc"]), s = new D("↑", "color:transparent;", [])) {
|
|
91
91
|
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
class
|
|
94
|
+
class le {
|
|
95
95
|
constructor(e) {
|
|
96
96
|
this.domService = e;
|
|
97
97
|
}
|
|
@@ -164,83 +164,83 @@ class ae {
|
|
|
164
164
|
const s = this.domService.createElement("div");
|
|
165
165
|
return this.addClass(e, s), this.domService.appendChild(t, s), s;
|
|
166
166
|
}
|
|
167
|
-
addRowDiv(e, t, s = -1, o, i,
|
|
168
|
-
const
|
|
169
|
-
if (this.domService.addClass(
|
|
167
|
+
addRowDiv(e, t, s = -1, o, i, a = "") {
|
|
168
|
+
const l = t.index ?? -1, r = this.getDivOrCreateDiv(l, e);
|
|
169
|
+
if (this.domService.addClass(r, "ge-table-row-div"), this.domService.addClass(r, `ge-table-row-div-${t.index}`), o === "body" && i === "center") {
|
|
170
170
|
const n = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
171
|
-
this.domService.addClass(
|
|
171
|
+
this.domService.addClass(r, `ge-table-row-${n}`);
|
|
172
172
|
}
|
|
173
|
-
if (this.domService.setStyle(
|
|
174
|
-
const n = this.domService.createText(
|
|
175
|
-
this.domService.appendChild(
|
|
173
|
+
if (this.domService.setStyle(r, "display", "clip"), this.domService.setStyle(r, "position", "absolute"), this.domService.setStyle(r, "left", `${t.left}px`), this.domService.setStyle(r, "top", `${t.top}px`), this.domService.setStyle(r, "width", `${t.width}px`), this.domService.setStyle(r, "height", `${t.height}px`), this.domService.setAttribute(r, "data-row-index", `${s}`), this.domService.setAttribute(r, "data-area", `${o}`), a) {
|
|
174
|
+
const n = this.domService.createText(a);
|
|
175
|
+
this.domService.appendChild(r, n);
|
|
176
176
|
}
|
|
177
|
-
return this.domService.appendChild(e.child,
|
|
177
|
+
return this.domService.appendChild(e.child, r), r;
|
|
178
178
|
}
|
|
179
179
|
addColumnDiv(e) {
|
|
180
|
-
const { parent: t, geo: s, rowIndex: o = -1, columnIndex: i = -1, areaIdent:
|
|
181
|
-
this.domService.addClass(
|
|
182
|
-
const
|
|
183
|
-
if (
|
|
184
|
-
const
|
|
185
|
-
this.addLabelDiv(
|
|
180
|
+
const { parent: t, geo: s, rowIndex: o = -1, columnIndex: i = -1, areaIdent: a, sideIdent: l, text: r = "", treeArrow: n, tableOptions: c, checkedType: h = void 0, sortState: d } = e, m = c == null ? void 0 : c.treeOptions, p = c == null ? void 0 : c.showCheckboxWihoutExtraColumn, b = this.domService.createElement("div");
|
|
181
|
+
this.domService.addClass(b, "ge-table-col-div"), p && this.domService.addClass(b, "ge-with-checkbox"), this.domService.addClass(b, `ge-table-col-div-${s.index}`), this.domService.setAttribute(b, "data-col-index", `${s.index}`), this.domService.setAttribute(b, "data-row-index", `${o}`), this.domService.setAttribute(b, "data-area", `${a}`);
|
|
182
|
+
const g = ((s == null ? void 0 : s.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
183
|
+
if (a === "body" && l === "center" && this.domService.addClass(b, `ge-table-column-${g}`), this.domService.setStyle(b, "display", "clip"), this.domService.setStyle(b, "position", "absolute"), this.domService.setStyle(b, "left", `${s.left}px`), this.domService.setStyle(b, "top", `${s.top}px`), this.domService.setStyle(b, "width", `${s.width}px`), this.domService.setStyle(b, "height", `${s.height}px`), n && n !== "none" && (this.domService.addClass(b, "ge-table-col-tree"), this.addArrowDiv(b, n, m, o, i, a)), p && i === 0 && h && this.addCheckboxToDiv(b, h, a, o), r) {
|
|
184
|
+
const u = n !== "none" && i === 0;
|
|
185
|
+
this.addLabelDiv(b, r, u, o, i, a);
|
|
186
186
|
}
|
|
187
|
-
return
|
|
187
|
+
return d && this.addSortedIcon(b, d, c == null ? void 0 : c.sortedOptions, i), this.domService.appendChild(t, b), b;
|
|
188
188
|
}
|
|
189
189
|
addCheckboxToDiv(e, t, s, o) {
|
|
190
|
-
const i = this.domService.createElement("div"),
|
|
190
|
+
const i = this.domService.createElement("div"), a = t === "full" ? "checked" : "";
|
|
191
191
|
return i.innerHTML = `
|
|
192
192
|
<input
|
|
193
193
|
type="checkbox"
|
|
194
194
|
data-area="${s}"
|
|
195
195
|
data-row-index="${o}"
|
|
196
196
|
data-input-type="checkbox"
|
|
197
|
-
${
|
|
197
|
+
${a}
|
|
198
198
|
class="ge-table-row-checkbox"> `, this.domService.setStyle(i, "display", "inline"), this.domService.setStyle(i, "width", "inherit"), this.domService.setAttribute(i, "data-row-index", `${o}`), this.domService.appendChild(e, i), i;
|
|
199
199
|
}
|
|
200
|
-
addLabelDiv(e, t = "", s = !1, o = -1, i = -1,
|
|
201
|
-
const
|
|
202
|
-
if (this.domService.addClass(
|
|
200
|
+
addLabelDiv(e, t = "", s = !1, o = -1, i = -1, a = "body") {
|
|
201
|
+
const l = this.domService.createElement("div");
|
|
202
|
+
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", `${o}`), this.domService.setAttribute(l, "data-col-index", `${i}`), this.domService.setAttribute(l, "data-area", `${a}`), t)
|
|
203
203
|
if (s) {
|
|
204
|
-
const
|
|
205
|
-
this.domService.appendChild(
|
|
204
|
+
const r = this.domService.createText(t);
|
|
205
|
+
this.domService.appendChild(l, r);
|
|
206
206
|
} else {
|
|
207
|
-
const
|
|
208
|
-
this.domService.appendChild(
|
|
207
|
+
const r = this.domService.createElement("div");
|
|
208
|
+
this.domService.appendChild(l, r);
|
|
209
209
|
const n = this.domService.createText(t);
|
|
210
|
-
this.domService.addClass(
|
|
210
|
+
this.domService.addClass(r, "ge-table-label"), this.domService.appendChild(r, n), this.domService.setAttribute(r, "data-row-index", `${o}`), this.domService.setAttribute(r, "data-col-index", `${i}`), this.domService.setAttribute(r, "data-area", `${a}`);
|
|
211
211
|
}
|
|
212
|
-
return this.domService.appendChild(e,
|
|
212
|
+
return this.domService.appendChild(e, l), l;
|
|
213
213
|
}
|
|
214
|
-
addSortedIcon(e, t = "", s = new
|
|
214
|
+
addSortedIcon(e, t = "", s = new Z(), o = -1) {
|
|
215
215
|
const i = this.domService.createElement("div");
|
|
216
216
|
this.domService.addClass(i, "ge-table-sorted-icon-div"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "top", "0"), this.domService.setStyle(i, "right", "0"), this.domService.setStyle(i, "width", "20px"), this.domService.setStyle(i, "background", "transparent"), this.domService.setStyle(i, "cursor", "pointer"), this.domService.setAttribute(i, "data-col-index", `${o}`), this.domService.setAttribute(i, "data-area", "header");
|
|
217
|
-
let
|
|
218
|
-
t === "asc" ?
|
|
219
|
-
const
|
|
220
|
-
this.domService.appendChild(i,
|
|
221
|
-
for (const n of
|
|
217
|
+
let a;
|
|
218
|
+
t === "asc" ? a = s.iconAsc : t === "desc" ? a = s.iconDesc : a = s.iconPlaceholder;
|
|
219
|
+
const l = a.content, r = this.domService.createText(l);
|
|
220
|
+
this.domService.appendChild(i, r), a.style && this.applyStyleString(i, a.style);
|
|
221
|
+
for (const n of a.classes)
|
|
222
222
|
this.domService.addClass(i, n);
|
|
223
223
|
return this.domService.appendChild(e, i), i;
|
|
224
224
|
}
|
|
225
|
-
addArrowDiv(e, t = "none", s = new J(), o = -1, i = -1,
|
|
226
|
-
const
|
|
227
|
-
this.domService.addClass(
|
|
228
|
-
let
|
|
229
|
-
t === "expanded" ?
|
|
230
|
-
const n =
|
|
231
|
-
this.domService.appendChild(
|
|
232
|
-
for (const h of
|
|
233
|
-
this.domService.addClass(
|
|
234
|
-
return this.domService.appendChild(e,
|
|
225
|
+
addArrowDiv(e, t = "none", s = new J(), o = -1, i = -1, a = "body") {
|
|
226
|
+
const l = this.domService.createElement("div");
|
|
227
|
+
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", `${o}`), this.domService.setAttribute(l, "data-col-index", `${i}`), this.domService.setAttribute(l, "data-area", `${a}`);
|
|
228
|
+
let r;
|
|
229
|
+
t === "expanded" ? r = s.arrowExpanded : t === "collapsed" ? r = s.arrowCollapsed : r = s.arrowPlaceholder;
|
|
230
|
+
const n = r.content, c = this.domService.createText(n);
|
|
231
|
+
this.domService.appendChild(l, c), r.style && this.applyStyleString(l, r.style);
|
|
232
|
+
for (const h of r.classes)
|
|
233
|
+
this.domService.addClass(l, h);
|
|
234
|
+
return this.domService.appendChild(e, l), l;
|
|
235
235
|
}
|
|
236
236
|
addColumnBorderDivs(e, t, s, o, i) {
|
|
237
237
|
if (e.verticalBorderVisible) {
|
|
238
|
-
const
|
|
239
|
-
this.addVerticalBorder(s, t,
|
|
238
|
+
const a = `ge-table-${o}-${i}-vertical-border`;
|
|
239
|
+
this.addVerticalBorder(s, t, a);
|
|
240
240
|
}
|
|
241
241
|
if (e.horizontalBorderVisible) {
|
|
242
|
-
const
|
|
243
|
-
this.addHorizontalBorder(s, t,
|
|
242
|
+
const a = `ge-table-${o}-${i}-horizontal-border`;
|
|
243
|
+
this.addHorizontalBorder(s, t, a);
|
|
244
244
|
}
|
|
245
245
|
return t;
|
|
246
246
|
}
|
|
@@ -264,8 +264,8 @@ class ae {
|
|
|
264
264
|
applyStyleString(e, t) {
|
|
265
265
|
const s = t.split(";").map((o) => o.trim()).filter((o) => o);
|
|
266
266
|
for (const o of s) {
|
|
267
|
-
const [i,
|
|
268
|
-
this.domService.setStyle(e, i.trim(),
|
|
267
|
+
const [i, a] = o.split(":");
|
|
268
|
+
this.domService.setStyle(e, i.trim(), a.trim());
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
getDivOrCreateDiv(e, t) {
|
|
@@ -273,20 +273,20 @@ class ae {
|
|
|
273
273
|
return s ? (s.innerText = "", s) : (s = this.domService.createElement("div"), t.cache[e] = s, s);
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
const
|
|
276
|
+
const G = (f) => f === "header" ? "header" : f === "footer" ? "footer" : "body";
|
|
277
277
|
class ne {
|
|
278
278
|
constructor(e, t) {
|
|
279
279
|
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)) {
|
|
280
280
|
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"));
|
|
281
281
|
const s = e.getAttribute("data-area");
|
|
282
|
-
if (s && (this.areaIdent =
|
|
282
|
+
if (s && (this.areaIdent = G(s), this.areaModel = t.tableModel.getAreaModel(this.areaIdent), this.row = this.areaModel.getRowByIndex(this.rowIdx)), e instanceof HTMLInputElement) {
|
|
283
283
|
const o = e;
|
|
284
284
|
this.value = o.value;
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
class
|
|
289
|
+
class ce {
|
|
290
290
|
constructor(e) {
|
|
291
291
|
this.tableScope = e, this.doubleClickDelay = 500, this.expandedAll = !0, this.mouseDown = !1, this.dragging = !1, this.lastClicked = 0, this.tableScope.hostElement.addEventListener("click", this.onHostElementClicked.bind(this)), this.tableScope.hostElement.addEventListener("dblclick", this.onHostElementDblClicked.bind(this)), this.tableScope.hostElement.addEventListener("mousedown", this.onMouseDown.bind(this)), this.tableScope.hostElement.addEventListener("mousemove", this.onMouseMove.bind(this)), this.tableScope.hostElement.addEventListener("mouseup", this.onMouseUp.bind(this)), this.tableScope.hostElement.addEventListener("contextmenu", this.onContextmenu.bind(this)), this.tableScope.hostElement._MouseHandler = "true", this.tableScope.scrollViewport.addEventListener("scroll", this.tableScope.adjustAfterScrolling.bind(this.tableScope)), [window, this.tableScope.hostElement].forEach(
|
|
292
292
|
(t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
|
|
@@ -327,8 +327,8 @@ class de {
|
|
|
327
327
|
const o = s.colIdx === this.getArrowColumnIndex() && e.altKey, i = s.className.includes("ge-table-tree-arrow-div");
|
|
328
328
|
if (o || i) {
|
|
329
329
|
e.preventDefault(), e.stopPropagation();
|
|
330
|
-
const
|
|
331
|
-
|
|
330
|
+
const a = s.row;
|
|
331
|
+
a.expanded = !a.expanded, "recalcVisibleTreeRows" in s.areaModel && s.areaModel.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(a);
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
if (s.areaIdent === "body" && this.tableScope.tableOptions.getFocusModel) {
|
|
@@ -345,15 +345,15 @@ class de {
|
|
|
345
345
|
*/
|
|
346
346
|
onHostElementDblClicked(e) {
|
|
347
347
|
if (this.lastClicked = Date.now(), e.target instanceof HTMLElement) {
|
|
348
|
-
const t = e.target, s = t.getAttribute("data-area"), o =
|
|
348
|
+
const t = e.target, s = t.getAttribute("data-area"), o = G(s), i = Number(t.getAttribute("data-row-index")), a = Number(t.getAttribute("data-col-index")), l = this.tableScope.tableModel.getAreaModel(o);
|
|
349
349
|
if (s && o === "header")
|
|
350
|
-
this.tableScope.tableModel.isSortable(
|
|
350
|
+
this.tableScope.tableModel.isSortable(a) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, i, a));
|
|
351
351
|
else if (t.getAttribute("data-row-index")) {
|
|
352
|
-
const
|
|
353
|
-
if (s && o === "body" &&
|
|
352
|
+
const r = l.getRowByIndex(i);
|
|
353
|
+
if (s && o === "body" && l.isEditable(i, a) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(i, a)), H(r) && a === this.getArrowColumnIndex()) {
|
|
354
354
|
e.preventDefault(), e.stopPropagation();
|
|
355
|
-
const n =
|
|
356
|
-
n.expanded = !n.expanded, "recalcVisibleTreeRows" in
|
|
355
|
+
const n = r;
|
|
356
|
+
n.expanded = !n.expanded, "recalcVisibleTreeRows" in l && l.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(n);
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
}
|
|
@@ -378,11 +378,11 @@ class de {
|
|
|
378
378
|
* @returns {void}
|
|
379
379
|
*/
|
|
380
380
|
updateCollapsedExpandedState(e) {
|
|
381
|
-
var s, o, i,
|
|
381
|
+
var s, o, i, a, l;
|
|
382
382
|
const t = (o = (s = this.tableScope.tableOptions) == null ? void 0 : s.autoRestoreOptions) == null ? void 0 : o.getRowId;
|
|
383
383
|
if (t) {
|
|
384
|
-
const
|
|
385
|
-
n ? (
|
|
384
|
+
const r = (i = this.tableScope.storeStateCollapsedExpandService) == null ? void 0 : i.collapsedExpandedStateGet().mode, n = r === "collapsed" && !e.expanded || r === "expanded" && e.expanded, c = r === "collapsed" && e.expanded || r === "expanded" && !e.expanded, h = t(e.data);
|
|
385
|
+
n ? (a = this.tableScope.storeStateCollapsedExpandService) == null || a.collapsedStateIdsPush(h) : c && ((l = this.tableScope.storeStateCollapsedExpandService) == null || l.collapsedStateIdsRemove(h));
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
getArrowColumnIndex() {
|
|
@@ -418,7 +418,7 @@ class de {
|
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
class
|
|
421
|
+
class de {
|
|
422
422
|
constructor(e) {
|
|
423
423
|
this.tableScope = e;
|
|
424
424
|
}
|
|
@@ -535,6 +535,13 @@ class he {
|
|
|
535
535
|
repaintHard() {
|
|
536
536
|
this.tableScope.repaintHard();
|
|
537
537
|
}
|
|
538
|
+
/**
|
|
539
|
+
* Recalculates the column widths of the table.
|
|
540
|
+
*
|
|
541
|
+
* @param {number} clientWidth - The width of the client area.
|
|
542
|
+
*
|
|
543
|
+
* @return {void}
|
|
544
|
+
*/
|
|
538
545
|
recalcColumnWidths(e) {
|
|
539
546
|
this.tableScope.recalcColumnWidths(e);
|
|
540
547
|
}
|
|
@@ -588,6 +595,26 @@ class he {
|
|
|
588
595
|
this.tableScope.focusModel()
|
|
589
596
|
);
|
|
590
597
|
}
|
|
598
|
+
/**
|
|
599
|
+
* Generates and downloads an Excel file based on the table data.
|
|
600
|
+
*
|
|
601
|
+
* @param {string} fileName - The name of the Excel file to be downloaded. Defaults to 'table.xlsx'.
|
|
602
|
+
* @param {string} author - The author of the Excel file. If not provided, it will remain empty.
|
|
603
|
+
* @return {void} No return value. Initiates a file download of the Excel document.
|
|
604
|
+
*/
|
|
605
|
+
downloadExcel(e = "table.xlsx", t = "") {
|
|
606
|
+
const s = [], o = this.tableScope.tableModel.getColumnCount(), i = ["header", "body", "footer"];
|
|
607
|
+
for (const a of i) {
|
|
608
|
+
const l = this.tableScope.tableModel.getAreaModel(a), r = (l == null ? void 0 : l.getRowCount()) ?? 0;
|
|
609
|
+
for (let n = 0; n < r; n++) {
|
|
610
|
+
const c = [];
|
|
611
|
+
s.push(c);
|
|
612
|
+
for (let h = 0; h < o; h++)
|
|
613
|
+
c.push(l.getValueAt(n, h));
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return this.tableScope.excelService.downloadExcel(s, e, t);
|
|
617
|
+
}
|
|
591
618
|
/**
|
|
592
619
|
* Retrieves the current scope of the table.
|
|
593
620
|
*
|
|
@@ -606,7 +633,7 @@ class he {
|
|
|
606
633
|
return this.tableScope.selectionModel();
|
|
607
634
|
}
|
|
608
635
|
}
|
|
609
|
-
class
|
|
636
|
+
class z {
|
|
610
637
|
constructor(e) {
|
|
611
638
|
this.getStorageKeyFn = e;
|
|
612
639
|
}
|
|
@@ -617,9 +644,9 @@ class V {
|
|
|
617
644
|
for (const o of [...s]) {
|
|
618
645
|
const [
|
|
619
646
|
i,
|
|
620
|
-
|
|
647
|
+
a
|
|
621
648
|
] = o;
|
|
622
|
-
t[i] =
|
|
649
|
+
t[i] = a;
|
|
623
650
|
}
|
|
624
651
|
}
|
|
625
652
|
return t;
|
|
@@ -631,8 +658,8 @@ class V {
|
|
|
631
658
|
if (o) {
|
|
632
659
|
const i = o + e;
|
|
633
660
|
if ((t + "").includes("Map")) {
|
|
634
|
-
const
|
|
635
|
-
this.persistItem(i,
|
|
661
|
+
const a = this.autoConvertMapToObject(t);
|
|
662
|
+
this.persistItem(i, a);
|
|
636
663
|
} else
|
|
637
664
|
this.persistItem(i, t);
|
|
638
665
|
}
|
|
@@ -681,7 +708,7 @@ class V {
|
|
|
681
708
|
// }
|
|
682
709
|
// }
|
|
683
710
|
}
|
|
684
|
-
class
|
|
711
|
+
class he extends z {
|
|
685
712
|
constructor(e) {
|
|
686
713
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
687
714
|
}
|
|
@@ -703,14 +730,14 @@ class ce extends V {
|
|
|
703
730
|
}
|
|
704
731
|
}
|
|
705
732
|
}
|
|
706
|
-
class
|
|
733
|
+
class pe {
|
|
707
734
|
constructor(e = "collapsed", t = [], s = !1, o = !1) {
|
|
708
735
|
this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = o;
|
|
709
736
|
}
|
|
710
737
|
}
|
|
711
|
-
class
|
|
738
|
+
class ge extends z {
|
|
712
739
|
constructor(e) {
|
|
713
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
740
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new pe(), this.load();
|
|
714
741
|
}
|
|
715
742
|
collapsedExpandedStateGet() {
|
|
716
743
|
return this.collapsedExpandedState;
|
|
@@ -742,7 +769,7 @@ class pe extends V {
|
|
|
742
769
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
743
770
|
}
|
|
744
771
|
}
|
|
745
|
-
class
|
|
772
|
+
class fe extends z {
|
|
746
773
|
constructor(e) {
|
|
747
774
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
748
775
|
}
|
|
@@ -763,14 +790,14 @@ class be extends V {
|
|
|
763
790
|
}
|
|
764
791
|
}
|
|
765
792
|
}
|
|
766
|
-
class
|
|
793
|
+
class R {
|
|
767
794
|
constructor(e = 0, t = 0, s = 0, o = 0, i) {
|
|
768
795
|
this.left = e, this.width = t, this.height = s, this.top = o, this.index = i;
|
|
769
796
|
}
|
|
770
797
|
}
|
|
771
|
-
class
|
|
798
|
+
class me {
|
|
772
799
|
constructor(e, t, s, o) {
|
|
773
|
-
this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = o, this.scrollTop = 0, this.areaBodyWestGeo = new
|
|
800
|
+
this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = o, this.scrollTop = 0, this.areaBodyWestGeo = new R(), this.areaBodyCenterGeo = new R(), this.areaBodyEastGeo = new R();
|
|
774
801
|
const i = this.hostElement;
|
|
775
802
|
i.innerText = "", this.dom.setAttribute(i, "tabindex", "0"), this.dom.setStyle(
|
|
776
803
|
this.dom.addClass("ge-table", i),
|
|
@@ -974,7 +1001,7 @@ class E {
|
|
|
974
1001
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
975
1002
|
}
|
|
976
1003
|
}
|
|
977
|
-
class
|
|
1004
|
+
class ue {
|
|
978
1005
|
constructor(e, t) {
|
|
979
1006
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
980
1007
|
}
|
|
@@ -985,12 +1012,12 @@ class Se {
|
|
|
985
1012
|
const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
|
|
986
1013
|
for (let s = 0; s < e; s++)
|
|
987
1014
|
for (let o = 0; o < t; o++) {
|
|
988
|
-
let i = this.areaModel.getColspanAt(s, o),
|
|
989
|
-
if (i > 1 ||
|
|
990
|
-
i === 0 && (i = 1),
|
|
991
|
-
const
|
|
1015
|
+
let i = this.areaModel.getColspanAt(s, o), a = this.areaModel.getRowspanAt(s, o);
|
|
1016
|
+
if (i > 1 || a > 1) {
|
|
1017
|
+
i === 0 && (i = 1), a === 0 && (a = 1);
|
|
1018
|
+
const l = "gammaCells" in this.areaModel;
|
|
992
1019
|
this.colAndRowspanRanges.push(
|
|
993
|
-
new E(s, o, s +
|
|
1020
|
+
new E(s, o, s + a - 1, o + i - 1, l)
|
|
994
1021
|
);
|
|
995
1022
|
}
|
|
996
1023
|
}
|
|
@@ -1007,22 +1034,22 @@ class Se {
|
|
|
1007
1034
|
return !1;
|
|
1008
1035
|
}
|
|
1009
1036
|
}
|
|
1010
|
-
class
|
|
1037
|
+
class be {
|
|
1011
1038
|
constructor(e, t, s) {
|
|
1012
1039
|
this.header = e, this.body = t, this.footer = s;
|
|
1013
1040
|
}
|
|
1014
1041
|
}
|
|
1015
|
-
class
|
|
1042
|
+
class Se extends me {
|
|
1016
1043
|
constructor(e, t, s, o) {
|
|
1017
|
-
var
|
|
1044
|
+
var a, l;
|
|
1018
1045
|
super(e, t, s, o), this.dragging = !1, this.editing = !1, this.storedColumnWidths = [], this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
1019
1046
|
header: [],
|
|
1020
1047
|
body: [],
|
|
1021
1048
|
footer: []
|
|
1022
|
-
}, this.tree = !1, this.colAndRowspanModels = new
|
|
1023
|
-
(
|
|
1049
|
+
}, this.tree = !1, this.colAndRowspanModels = new be(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (a = this.tableOptions) != null && a.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (l = this.tableOptions) != null && l.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), W(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
1050
|
+
(r) => {
|
|
1024
1051
|
var n;
|
|
1025
|
-
this.colAndRowspanModels[
|
|
1052
|
+
this.colAndRowspanModels[r] = new ue(t, t.getAreaModel(r)), (n = this.colAndRowspanModels[r]) == null || n.init();
|
|
1026
1053
|
}
|
|
1027
1054
|
);
|
|
1028
1055
|
}
|
|
@@ -1108,19 +1135,19 @@ class me extends ue {
|
|
|
1108
1135
|
for (const t of this.removables)
|
|
1109
1136
|
t.remove();
|
|
1110
1137
|
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(
|
|
1111
|
-
new
|
|
1138
|
+
new R(0, this.hostElement.clientWidth, 1, 0),
|
|
1112
1139
|
this.hostElement,
|
|
1113
1140
|
"ge-table-border"
|
|
1114
1141
|
)), this.tableOptions.tableBottomBorderVisible && this.removables.push(this.dom.addHorizontalBorder(
|
|
1115
|
-
new
|
|
1142
|
+
new R(0, this.hostElement.clientWidth, 1, this.hostElement.clientHeight - 1),
|
|
1116
1143
|
this.hostElement,
|
|
1117
1144
|
"ge-table-border"
|
|
1118
1145
|
)), this.tableModel.getFixedLeftColumnCount() > 0 && this.removables.push(this.dom.addVerticalBorder(
|
|
1119
|
-
new
|
|
1146
|
+
new R(this.areaBodyWest.child.clientWidth, 1, this.hostElement.clientHeight, 0),
|
|
1120
1147
|
this.hostElement,
|
|
1121
1148
|
"ge-table-body-west-vertical-border"
|
|
1122
1149
|
)), ((e = this.tableModel.getAreaModel("header")) == null ? void 0 : e.getRowCount()) > 0 && this.removables.push(this.dom.addHorizontalBorder(
|
|
1123
|
-
new
|
|
1150
|
+
new R(0, this.hostElement.clientWidth, 1, this.areaHeaderCenter.child.clientHeight),
|
|
1124
1151
|
this.hostElement,
|
|
1125
1152
|
"ge-table-body-west-vertical-border"
|
|
1126
1153
|
));
|
|
@@ -1159,22 +1186,23 @@ class me extends ue {
|
|
|
1159
1186
|
* @param {string[]} cssClasses - An array of CSS classes to be applied to the cell.
|
|
1160
1187
|
*/
|
|
1161
1188
|
rerenderCellContent({ area: e, rowIndex: t, columnIndex: s, value: o, cssClasses: i }) {
|
|
1162
|
-
const
|
|
1163
|
-
if (
|
|
1189
|
+
const a = this.tableModel.getAreaModel(e), l = 'div[data-col-index="' + s + '"][data-row-index="' + t + '"][data-area="' + e + '"]', r = document.querySelector(l);
|
|
1190
|
+
if (r) {
|
|
1164
1191
|
let n;
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1167
|
-
|
|
1192
|
+
const c = this.editorRenderer && this.editorRendererRow === t && this.editorRendererColumn === s;
|
|
1193
|
+
let h;
|
|
1194
|
+
if (c ? h = this.editorRenderer : h = a.getCellRenderer(t, s), r.innerText = "", this.applyCssClasses(r, i), h)
|
|
1195
|
+
n = h.render(r, t, s, e, a, o, this.dom.domService), n && this.cleanupFunctions[e].push(n);
|
|
1168
1196
|
else {
|
|
1169
|
-
const
|
|
1170
|
-
this.dom.addLabelDiv(
|
|
1197
|
+
const p = `${o}`;
|
|
1198
|
+
this.dom.addLabelDiv(r, p, !1, t, s, e);
|
|
1171
1199
|
}
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1174
|
-
const
|
|
1175
|
-
if (
|
|
1176
|
-
for (const
|
|
1177
|
-
this.dom.setStyle(
|
|
1200
|
+
const d = a.getCustomClassesAt(t, s);
|
|
1201
|
+
d.length && this.dom.addClasses(d, r);
|
|
1202
|
+
const m = a.getCustomStyleAt(t, s);
|
|
1203
|
+
if (m)
|
|
1204
|
+
for (const p in m)
|
|
1205
|
+
this.dom.setStyle(r, p, m[p]);
|
|
1178
1206
|
}
|
|
1179
1207
|
}
|
|
1180
1208
|
/**
|
|
@@ -1283,87 +1311,87 @@ class me extends ue {
|
|
|
1283
1311
|
* @protected
|
|
1284
1312
|
*/
|
|
1285
1313
|
adjustArea(e, t = 0) {
|
|
1286
|
-
var
|
|
1287
|
-
const s = this.getArea(e, "west"), o = this.getArea(e, "center"), i = this.getArea(e, "east"),
|
|
1314
|
+
var g;
|
|
1315
|
+
const s = this.getArea(e, "west"), o = this.getArea(e, "center"), i = this.getArea(e, "east"), a = o.child.clientHeight;
|
|
1288
1316
|
s.child.innerText = "", o.child.innerText = "", i.child.innerText = "";
|
|
1289
|
-
const
|
|
1317
|
+
const l = 0, r = this.areaBodyCenterGeo.width, n = this.tableModel.getPadding(), c = this.tableModel.getAreaModel(e), h = c.getRowCount();
|
|
1290
1318
|
for (; this.cleanupFunctions[e].length; ) {
|
|
1291
|
-
const
|
|
1292
|
-
|
|
1319
|
+
const u = this.cleanupFunctions[e].shift();
|
|
1320
|
+
u && u();
|
|
1293
1321
|
}
|
|
1294
|
-
let
|
|
1295
|
-
const
|
|
1296
|
-
for (let
|
|
1297
|
-
const
|
|
1298
|
-
if (
|
|
1299
|
-
this.firstVisibleRowIndex =
|
|
1300
|
-
let
|
|
1301
|
-
const
|
|
1322
|
+
let d = t;
|
|
1323
|
+
const m = this.tableModel.getColumnCount(), p = this.tableModel.getFixedRightColumnCount(), b = this.tableModel.getFixedLeftColumnCount();
|
|
1324
|
+
for (let u = 0; u < h; u++) {
|
|
1325
|
+
const x = d, S = u === h - 1, w = this.tableModel.getRowHeight(e, u);
|
|
1326
|
+
if (x + w > 0) {
|
|
1327
|
+
this.firstVisibleRowIndex = u;
|
|
1328
|
+
let v = { left: l, width: r, height: w, top: x, index: u }, y = this.dom.addRowDiv(o, v, u, e, "center");
|
|
1329
|
+
const T = b;
|
|
1302
1330
|
if (this.adjustColumnsToRowParent({
|
|
1303
1331
|
areaIdent: e,
|
|
1304
1332
|
sideIdent: "center",
|
|
1305
|
-
areaModel:
|
|
1306
|
-
geo:
|
|
1333
|
+
areaModel: c,
|
|
1334
|
+
geo: v,
|
|
1307
1335
|
parent: y,
|
|
1308
|
-
rowIndex:
|
|
1309
|
-
columnIndexStart:
|
|
1310
|
-
columnIndexEnd:
|
|
1336
|
+
rowIndex: u,
|
|
1337
|
+
columnIndexStart: T,
|
|
1338
|
+
columnIndexEnd: m - p - 1,
|
|
1311
1339
|
verticalFixed: !1,
|
|
1312
|
-
lastRowOfModel:
|
|
1313
|
-
}), n.left > 0 && (
|
|
1340
|
+
lastRowOfModel: S
|
|
1341
|
+
}), n.left > 0 && (v = { left: l, width: this.areaBodyWestGeo.width, height: w, top: x, index: u }, y = this.dom.addRowDiv(s, v, u, e, "west"), this.adjustColumnsToRowParent({
|
|
1314
1342
|
areaIdent: e,
|
|
1315
1343
|
sideIdent: "west",
|
|
1316
|
-
areaModel:
|
|
1317
|
-
geo:
|
|
1344
|
+
areaModel: c,
|
|
1345
|
+
geo: v,
|
|
1318
1346
|
parent: y,
|
|
1319
|
-
rowIndex:
|
|
1347
|
+
rowIndex: u,
|
|
1320
1348
|
columnIndexStart: 0,
|
|
1321
|
-
columnIndexEnd:
|
|
1349
|
+
columnIndexEnd: T - 1,
|
|
1322
1350
|
verticalFixed: !0,
|
|
1323
|
-
lastRowOfModel:
|
|
1324
|
-
})), n.right > 0 && (
|
|
1351
|
+
lastRowOfModel: S
|
|
1352
|
+
})), n.right > 0 && (v = { left: l, width: this.areaBodyEastGeo.width, height: w, top: x, index: u }, y = this.dom.addRowDiv(i, v, u, e, "east"), this.adjustColumnsToRowParent({
|
|
1325
1353
|
areaIdent: e,
|
|
1326
1354
|
sideIdent: "east",
|
|
1327
|
-
areaModel:
|
|
1328
|
-
geo:
|
|
1355
|
+
areaModel: c,
|
|
1356
|
+
geo: v,
|
|
1329
1357
|
parent: y,
|
|
1330
|
-
rowIndex:
|
|
1331
|
-
columnIndexStart:
|
|
1332
|
-
columnIndexEnd:
|
|
1358
|
+
rowIndex: u,
|
|
1359
|
+
columnIndexStart: m - p,
|
|
1360
|
+
columnIndexEnd: m - 1,
|
|
1333
1361
|
verticalFixed: !0,
|
|
1334
|
-
lastRowOfModel:
|
|
1335
|
-
})), e === "header" && this.tree &&
|
|
1362
|
+
lastRowOfModel: S
|
|
1363
|
+
})), e === "header" && this.tree && u === h - 1) {
|
|
1336
1364
|
const A = this.dom.applyStyle(
|
|
1337
1365
|
this.dom.setAttribute(
|
|
1338
|
-
this.dom.addDiv(y, new
|
|
1366
|
+
this.dom.addDiv(y, new R(16, 20, 20, 8)),
|
|
1339
1367
|
"data-ge-action",
|
|
1340
1368
|
"toggleExpandCollapseAll"
|
|
1341
1369
|
),
|
|
1342
1370
|
{ cursor: "pointer" }
|
|
1343
1371
|
), M = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1344
1372
|
if (M) {
|
|
1345
|
-
const
|
|
1346
|
-
this.dom.domService.appendChild(A,
|
|
1373
|
+
const I = this.dom.domService.createText(M.content);
|
|
1374
|
+
this.dom.domService.appendChild(A, I), M.style && this.dom.applyStyleString(A, M.style);
|
|
1347
1375
|
}
|
|
1348
1376
|
}
|
|
1349
1377
|
}
|
|
1350
|
-
if (
|
|
1378
|
+
if (d = d + w, d > a)
|
|
1351
1379
|
break;
|
|
1352
1380
|
}
|
|
1353
1381
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1354
|
-
const
|
|
1355
|
-
if (
|
|
1356
|
-
for (const
|
|
1357
|
-
let
|
|
1358
|
-
if (
|
|
1359
|
-
|
|
1360
|
-
else if (
|
|
1361
|
-
|
|
1382
|
+
const u = ((g = this.colAndRowspanModels[e]) == null ? void 0 : g.getRanges()) ?? [];
|
|
1383
|
+
if (u.length)
|
|
1384
|
+
for (const x of u) {
|
|
1385
|
+
let S = 0, w = o.child, v = "center";
|
|
1386
|
+
if (x.c1 < b)
|
|
1387
|
+
w = s.child, v = "west";
|
|
1388
|
+
else if (p > 0 && x.c1 >= m - p)
|
|
1389
|
+
w = i.child, v = "east";
|
|
1362
1390
|
else {
|
|
1363
1391
|
const y = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1364
|
-
|
|
1392
|
+
S = this.scrollFactorX * y - this.areaBodyWestGeo.width, v = "center";
|
|
1365
1393
|
}
|
|
1366
|
-
this.drawBigCell(
|
|
1394
|
+
this.drawBigCell(x, S, t, c, w, v);
|
|
1367
1395
|
}
|
|
1368
1396
|
}
|
|
1369
1397
|
}
|
|
@@ -1377,48 +1405,48 @@ class me extends ue {
|
|
|
1377
1405
|
* @param sideIdent SideIdent (west,center,east)
|
|
1378
1406
|
* @protected
|
|
1379
1407
|
*/
|
|
1380
|
-
drawBigCell(e, t, s, o, i,
|
|
1381
|
-
const
|
|
1382
|
-
let
|
|
1383
|
-
n > 0 && e.c1 >=
|
|
1384
|
-
const h = t + this.getColumnWidths(
|
|
1385
|
-
let
|
|
1386
|
-
const
|
|
1387
|
-
|
|
1408
|
+
drawBigCell(e, t, s, o, i, a) {
|
|
1409
|
+
const l = s + this.getRowHeights(0, e.r1 - 1, o).reduce((g, u) => g + u, 0), r = this.tableModel.getColumnCount(), n = this.tableModel.getFixedRightColumnCount();
|
|
1410
|
+
let c = 0;
|
|
1411
|
+
n > 0 && e.c1 >= r - n && (c = r - n);
|
|
1412
|
+
const h = t + this.getColumnWidths(c, e.c1 - 1).reduce((g, u) => g + u, 0), d = this.getRowHeights(e.r1, e.r2, o).reduce((g, u) => g + u, 0), m = this.getColumnWidths(e.c1, e.c2).reduce((g, u) => g + u, 0);
|
|
1413
|
+
let p = !1;
|
|
1414
|
+
const b = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
1415
|
+
b && (p = b.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? this.renderCell({
|
|
1388
1416
|
areaModel: o,
|
|
1389
1417
|
areaIdent: o.areaIdent,
|
|
1390
|
-
sideIdent:
|
|
1418
|
+
sideIdent: a,
|
|
1391
1419
|
rowIndex: e.r1,
|
|
1392
1420
|
columnIndex: e.c1,
|
|
1393
1421
|
left: h,
|
|
1394
|
-
top:
|
|
1395
|
-
width:
|
|
1396
|
-
height:
|
|
1422
|
+
top: l,
|
|
1423
|
+
width: m,
|
|
1424
|
+
height: d,
|
|
1397
1425
|
parent: i,
|
|
1398
|
-
cellSelected:
|
|
1426
|
+
cellSelected: p,
|
|
1399
1427
|
lastRowOfModel: !0,
|
|
1400
1428
|
gammaRange: e.gammaRange
|
|
1401
1429
|
}) : this.renderCell({
|
|
1402
1430
|
areaModel: o,
|
|
1403
1431
|
areaIdent: o.areaIdent,
|
|
1404
|
-
sideIdent:
|
|
1432
|
+
sideIdent: a,
|
|
1405
1433
|
rowIndex: e.r1,
|
|
1406
1434
|
columnIndex: e.c1,
|
|
1407
1435
|
left: h,
|
|
1408
|
-
top:
|
|
1409
|
-
width:
|
|
1410
|
-
height:
|
|
1436
|
+
top: l,
|
|
1437
|
+
width: m,
|
|
1438
|
+
height: d,
|
|
1411
1439
|
parent: i,
|
|
1412
|
-
cellSelected:
|
|
1440
|
+
cellSelected: p,
|
|
1413
1441
|
lastRowOfModel: !0,
|
|
1414
1442
|
gammaRange: e.gammaRange
|
|
1415
1443
|
}), o.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1416
1444
|
rowIndex: e.r1,
|
|
1417
1445
|
columnIndex: e.c1,
|
|
1418
1446
|
cellLeft: h,
|
|
1419
|
-
cellTop:
|
|
1420
|
-
cellWidth:
|
|
1421
|
-
cellHeight:
|
|
1447
|
+
cellTop: l,
|
|
1448
|
+
cellWidth: m,
|
|
1449
|
+
cellHeight: d,
|
|
1422
1450
|
parent: i
|
|
1423
1451
|
});
|
|
1424
1452
|
}
|
|
@@ -1434,8 +1462,8 @@ class me extends ue {
|
|
|
1434
1462
|
findRowOfImportantRowspanCell(e, t, s) {
|
|
1435
1463
|
const o = e.getMaxRowspan();
|
|
1436
1464
|
for (let i = t - 1; i > -1; i--) {
|
|
1437
|
-
const
|
|
1438
|
-
if (
|
|
1465
|
+
const a = e.getRowspanAt(i, s);
|
|
1466
|
+
if (a > 1 && i + a + 1 >= t)
|
|
1439
1467
|
return i;
|
|
1440
1468
|
if (t - i > o)
|
|
1441
1469
|
return -1;
|
|
@@ -1455,65 +1483,65 @@ class me extends ue {
|
|
|
1455
1483
|
areaModel: s,
|
|
1456
1484
|
geo: o,
|
|
1457
1485
|
parent: i,
|
|
1458
|
-
rowIndex:
|
|
1459
|
-
columnIndexStart:
|
|
1460
|
-
columnIndexEnd:
|
|
1486
|
+
rowIndex: a,
|
|
1487
|
+
columnIndexStart: l,
|
|
1488
|
+
columnIndexEnd: r,
|
|
1461
1489
|
verticalFixed: n = !1,
|
|
1462
|
-
lastRowOfModel:
|
|
1490
|
+
lastRowOfModel: c = !1
|
|
1463
1491
|
}) {
|
|
1464
|
-
var
|
|
1492
|
+
var b;
|
|
1465
1493
|
this.scrollViewportLeft = this.scrollViewport.scrollLeft;
|
|
1466
1494
|
let h = 0;
|
|
1467
1495
|
if (!n) {
|
|
1468
|
-
const
|
|
1469
|
-
h = this.scrollFactorX *
|
|
1496
|
+
const g = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1497
|
+
h = this.scrollFactorX * g;
|
|
1470
1498
|
}
|
|
1471
|
-
const
|
|
1472
|
-
let
|
|
1473
|
-
for (let
|
|
1474
|
-
const
|
|
1475
|
-
if (
|
|
1476
|
-
let
|
|
1477
|
-
const
|
|
1478
|
-
|
|
1479
|
-
let y =
|
|
1480
|
-
|
|
1481
|
-
let
|
|
1482
|
-
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (
|
|
1483
|
-
this.renderDragTargetDiv(i,
|
|
1484
|
-
const A = { left:
|
|
1499
|
+
const d = 0, m = !!(e === "body" && t);
|
|
1500
|
+
let p = h;
|
|
1501
|
+
for (let g = l; g <= r; g++) {
|
|
1502
|
+
const u = p, x = this.tableModel.getColumnWidth(g);
|
|
1503
|
+
if (x > 0 && u + x > 0) {
|
|
1504
|
+
let S = o.height;
|
|
1505
|
+
const w = s.getRowspanAt(a, g), v = s.getColspanAt(a, g);
|
|
1506
|
+
w > 1 && (S = this.getRowHeights(a, a + w - 1, s).reduce((A, M) => A + M, 0));
|
|
1507
|
+
let y = x;
|
|
1508
|
+
v > 1 && (y = this.getColumnWidths(g, g + v - 1).reduce((A, M) => A + M, 0));
|
|
1509
|
+
let T = !1;
|
|
1510
|
+
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (b = this.colAndRowspanModels[e]) != null && b.isInRange(a, g) && (T = !0), this.draggingTargetColumnIndex === g && e !== "header") {
|
|
1511
|
+
this.renderDragTargetDiv(i, u, d, y, S);
|
|
1512
|
+
const A = { left: u, top: d, width: y, height: S };
|
|
1485
1513
|
this.dom.addColumnBorderDivs(this.tableOptions, i, A, e, t);
|
|
1486
1514
|
} else {
|
|
1487
|
-
const A = this.renderSelectedBackgroundDiv(
|
|
1488
|
-
"gammaCells" in s && s.getValueAt(
|
|
1515
|
+
const A = this.renderSelectedBackgroundDiv(T, m, t, s, a, g, i, u, d, y, S);
|
|
1516
|
+
"gammaCells" in s && s.getValueAt(a, g) && (T = !1), T || this.renderCell({
|
|
1489
1517
|
areaModel: s,
|
|
1490
1518
|
areaIdent: e,
|
|
1491
1519
|
sideIdent: t,
|
|
1492
|
-
rowIndex:
|
|
1493
|
-
columnIndex:
|
|
1494
|
-
left:
|
|
1495
|
-
top:
|
|
1520
|
+
rowIndex: a,
|
|
1521
|
+
columnIndex: g,
|
|
1522
|
+
left: u,
|
|
1523
|
+
top: d,
|
|
1496
1524
|
width: y,
|
|
1497
|
-
height:
|
|
1525
|
+
height: S,
|
|
1498
1526
|
parent: i,
|
|
1499
1527
|
cellSelected: A,
|
|
1500
|
-
lastRowOfModel:
|
|
1528
|
+
lastRowOfModel: c,
|
|
1501
1529
|
gammaRange: !0
|
|
1502
1530
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1503
|
-
rowIndex:
|
|
1504
|
-
columnIndex:
|
|
1505
|
-
cellLeft:
|
|
1506
|
-
cellTop:
|
|
1531
|
+
rowIndex: a,
|
|
1532
|
+
columnIndex: g,
|
|
1533
|
+
cellLeft: u,
|
|
1534
|
+
cellTop: d,
|
|
1507
1535
|
cellWidth: y,
|
|
1508
|
-
cellHeight:
|
|
1536
|
+
cellHeight: S,
|
|
1509
1537
|
parent: i
|
|
1510
1538
|
});
|
|
1511
1539
|
}
|
|
1512
1540
|
}
|
|
1513
|
-
if (
|
|
1541
|
+
if (p = p + x, p > this.areaBodyCenterGeo.width)
|
|
1514
1542
|
break;
|
|
1515
1543
|
}
|
|
1516
|
-
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new
|
|
1544
|
+
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new R(p - 1, 1, o.height, 0), i);
|
|
1517
1545
|
}
|
|
1518
1546
|
/**
|
|
1519
1547
|
* Retrieves the column index of the tree arrow column in the table.
|
|
@@ -1533,55 +1561,55 @@ class me extends ue {
|
|
|
1533
1561
|
sideIdent: s,
|
|
1534
1562
|
rowIndex: o,
|
|
1535
1563
|
index: i,
|
|
1536
|
-
left:
|
|
1537
|
-
width:
|
|
1538
|
-
height:
|
|
1564
|
+
left: a,
|
|
1565
|
+
width: l,
|
|
1566
|
+
height: r,
|
|
1539
1567
|
top: n,
|
|
1540
|
-
parent:
|
|
1568
|
+
parent: c,
|
|
1541
1569
|
lastRowOfModel: h
|
|
1542
1570
|
}) {
|
|
1543
1571
|
var X;
|
|
1544
|
-
const
|
|
1545
|
-
let
|
|
1546
|
-
if (i === this.getTreeArrowColumnIndex() && H(
|
|
1547
|
-
const C =
|
|
1548
|
-
(X = C.children) != null && X.length ? C.expanded ?
|
|
1572
|
+
const m = this.editorRenderer && this.editorRendererRow === o && this.editorRendererColumn === i ? this.editorRenderer : e.getCellRenderer(o, i), p = { left: a, width: l, height: r, top: n, index: i }, b = e.getRowByIndex(o);
|
|
1573
|
+
let g = "none";
|
|
1574
|
+
if (i === this.getTreeArrowColumnIndex() && H(b)) {
|
|
1575
|
+
const C = b;
|
|
1576
|
+
(X = C.children) != null && X.length ? C.expanded ? g = "expanded" : g = "collapsed" : g = "hidden";
|
|
1549
1577
|
}
|
|
1550
|
-
let
|
|
1578
|
+
let x;
|
|
1551
1579
|
if (t === "header") {
|
|
1552
1580
|
const C = this.tableModel.getColumnDef(i);
|
|
1553
|
-
(!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (
|
|
1581
|
+
(!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (x = C == null ? void 0 : C.sortState);
|
|
1554
1582
|
}
|
|
1555
|
-
const
|
|
1583
|
+
const S = e.getValueAt(o, i), w = m ? "" : `${S}`, v = e.isRowChecked(o), y = this.dom.addColumnDiv(
|
|
1556
1584
|
{
|
|
1557
|
-
parent:
|
|
1558
|
-
geo:
|
|
1585
|
+
parent: c,
|
|
1586
|
+
geo: p,
|
|
1559
1587
|
rowIndex: o,
|
|
1560
1588
|
columnIndex: i,
|
|
1561
1589
|
areaIdent: t,
|
|
1562
1590
|
sideIdent: s,
|
|
1563
|
-
text:
|
|
1564
|
-
treeArrow:
|
|
1591
|
+
text: w,
|
|
1592
|
+
treeArrow: g,
|
|
1565
1593
|
tableOptions: this.tableOptions,
|
|
1566
|
-
checkedType:
|
|
1567
|
-
sortState:
|
|
1594
|
+
checkedType: v,
|
|
1595
|
+
sortState: x
|
|
1568
1596
|
}
|
|
1569
|
-
),
|
|
1570
|
-
|
|
1597
|
+
), T = e.getTooltipAt(o, i);
|
|
1598
|
+
T && this.dom.setAttribute(y, "title", T);
|
|
1571
1599
|
const A = this.tableModel.getColumnDef(i);
|
|
1572
1600
|
A && A.classes[t] && this.dom.addClasses(A.classes[t], y);
|
|
1573
1601
|
let M;
|
|
1574
|
-
|
|
1575
|
-
const
|
|
1576
|
-
if (
|
|
1602
|
+
m && (M = m.render(y, o, i, t, e, S, this.dom.domService));
|
|
1603
|
+
const I = e.getCustomClassesAt(o, i);
|
|
1604
|
+
if (I.length && this.dom.addClasses(I, y), this.dom.addColumnBorderDivs(this.tableOptions, c, p, t, s), h && this.dom.addHorizontalBorder({ left: a, width: l, height: r, top: n + r }, c), this.getFocusModel && t === "body") {
|
|
1577
1605
|
const C = this.getFocusModel();
|
|
1578
|
-
C != null && C.hasFocus(o, i) && this.dom.addFocusBorderDivs(
|
|
1606
|
+
C != null && C.hasFocus(o, i) && this.dom.addFocusBorderDivs(c, p, {});
|
|
1579
1607
|
}
|
|
1580
1608
|
t === "header" && this.dom.setAttribute(y, "data-ge-action", "drag-column");
|
|
1581
|
-
const
|
|
1582
|
-
if (
|
|
1583
|
-
for (const C in
|
|
1584
|
-
this.dom.setStyle(y, C,
|
|
1609
|
+
const $ = e.getCustomStyleAt(o, i);
|
|
1610
|
+
if ($)
|
|
1611
|
+
for (const C in $)
|
|
1612
|
+
this.dom.setStyle(y, C, $[C]);
|
|
1585
1613
|
return [y, M];
|
|
1586
1614
|
}
|
|
1587
1615
|
/**
|
|
@@ -1712,14 +1740,14 @@ class me extends ue {
|
|
|
1712
1740
|
adjustDraggingColumn(e, t, s) {
|
|
1713
1741
|
var o, i;
|
|
1714
1742
|
if (this.dragging) {
|
|
1715
|
-
const
|
|
1743
|
+
const a = this.hostElement.clientHeight, l = this.storedColumnWidths[t];
|
|
1716
1744
|
if ((o = e.originalEvent) != null && o.clientX) {
|
|
1717
|
-
const
|
|
1745
|
+
const c = { left: ((i = e.originalEvent) == null ? void 0 : i.clientX) - l / 2, width: l, height: a, top: 0, index: t };
|
|
1718
1746
|
this.dom.applyStyle(this.draggingColumn, {
|
|
1719
1747
|
background: "rgba(128,128,128,0.2)",
|
|
1720
1748
|
display: "block",
|
|
1721
1749
|
overfllow: "clip"
|
|
1722
|
-
}), this.dom.applyStyleInPx(this.draggingColumn,
|
|
1750
|
+
}), this.dom.applyStyleInPx(this.draggingColumn, c), s && this.renderContentOfDraggingColumn(c);
|
|
1723
1751
|
}
|
|
1724
1752
|
} else
|
|
1725
1753
|
this.hideDraggingColumn();
|
|
@@ -1744,29 +1772,29 @@ class me extends ue {
|
|
|
1744
1772
|
* @return {number} The final y-position after rendering all the content.
|
|
1745
1773
|
*/
|
|
1746
1774
|
renderContentOfDraggingColumnForArea(e, t, s = 0) {
|
|
1747
|
-
const o = "center", i = this.tableModel.getAreaModel(t),
|
|
1748
|
-
if (
|
|
1749
|
-
const
|
|
1750
|
-
for (let n = 0; n <
|
|
1751
|
-
const
|
|
1752
|
-
parent:
|
|
1753
|
-
geo:
|
|
1775
|
+
const o = "center", i = this.tableModel.getAreaModel(t), a = i == null ? void 0 : i.getRowCount();
|
|
1776
|
+
if (a) {
|
|
1777
|
+
const l = e.index ?? 0, r = this.draggingColumn;
|
|
1778
|
+
for (let n = 0; n < a; n++) {
|
|
1779
|
+
const c = s, h = i.getRowHeight(n), d = { left: 0, width: e.width, height: h, top: c, index: n }, m = i.getValueAt(n, l), p = i.getCellRenderer(n, l), b = p ? "" : `${m}`, g = {
|
|
1780
|
+
parent: r,
|
|
1781
|
+
geo: d,
|
|
1754
1782
|
rowIndex: n,
|
|
1755
|
-
columnIndex:
|
|
1783
|
+
columnIndex: l,
|
|
1756
1784
|
areaIdent: t,
|
|
1757
1785
|
sideIdent: o,
|
|
1758
|
-
text:
|
|
1759
|
-
},
|
|
1760
|
-
let
|
|
1761
|
-
|
|
1762
|
-
const
|
|
1763
|
-
|
|
1764
|
-
const
|
|
1765
|
-
|
|
1766
|
-
const
|
|
1767
|
-
if (
|
|
1768
|
-
for (const y in
|
|
1769
|
-
this.dom.setStyle(
|
|
1786
|
+
text: b
|
|
1787
|
+
}, u = this.dom.addColumnDiv(g);
|
|
1788
|
+
let x;
|
|
1789
|
+
p && (x = p.render(u, n, l, t, i, m, this.dom.domService), x && this.cleanupFunctions[t].push(x));
|
|
1790
|
+
const S = i.getCustomClassesAt(n, l);
|
|
1791
|
+
S.length && this.dom.addClasses(S, u);
|
|
1792
|
+
const w = this.tableModel.getColumnDef(l);
|
|
1793
|
+
w && w.classes[t] && this.dom.addClasses(w.classes[t], u), this.dom.addColumnBorderDivs(this.tableOptions, r, d, t, o);
|
|
1794
|
+
const v = i.getCustomStyleAt(n, l);
|
|
1795
|
+
if (v)
|
|
1796
|
+
for (const y in v)
|
|
1797
|
+
this.dom.setStyle(u, y, v[y]);
|
|
1770
1798
|
s = s + h;
|
|
1771
1799
|
}
|
|
1772
1800
|
}
|
|
@@ -1794,10 +1822,10 @@ class me extends ue {
|
|
|
1794
1822
|
* @return {HTMLDivElement} - The rendered draggable target div element.
|
|
1795
1823
|
*/
|
|
1796
1824
|
renderDragTargetDiv(e, t, s, o, i) {
|
|
1797
|
-
const
|
|
1825
|
+
const a = this.dom.applyStylePosistionAbsolute(
|
|
1798
1826
|
this.dom.createDivWithClass("ge-table-drop-zone", e)
|
|
1799
1827
|
);
|
|
1800
|
-
return this.dom.setStyle(
|
|
1828
|
+
return this.dom.setStyle(a, "left", `${t}px`), this.dom.setStyle(a, "top", `${s}px`), this.dom.setStyle(a, "width", `${o}px`), this.dom.setStyle(a, "height", `${i}px`), a;
|
|
1801
1829
|
}
|
|
1802
1830
|
/**
|
|
1803
1831
|
* Render selected background div.
|
|
@@ -1816,23 +1844,23 @@ class me extends ue {
|
|
|
1816
1844
|
* @param {number} height - The height of the div.
|
|
1817
1845
|
* @returns {boolean} - Whether the cell is selected.
|
|
1818
1846
|
*/
|
|
1819
|
-
renderSelectedBackgroundDiv(e, t, s, o, i,
|
|
1820
|
-
let
|
|
1821
|
-
if (!e && t && o.isSelectable(i,
|
|
1822
|
-
const
|
|
1823
|
-
if (
|
|
1824
|
-
const
|
|
1825
|
-
|
|
1826
|
-
for (let
|
|
1827
|
-
const
|
|
1847
|
+
renderSelectedBackgroundDiv(e, t, s, o, i, a, l, r, n, c, h) {
|
|
1848
|
+
let d = !1;
|
|
1849
|
+
if (!e && t && o.isSelectable(i, a) && this.getSelectionModel) {
|
|
1850
|
+
const m = this.getSelectionModel();
|
|
1851
|
+
if (m) {
|
|
1852
|
+
const p = m.getSelectionCount(i, a);
|
|
1853
|
+
d = p > 0;
|
|
1854
|
+
for (let b = 0; b < p; b++) {
|
|
1855
|
+
const g = this.dom.applyStylePosistionAbsolute(
|
|
1828
1856
|
// ge-table-body-west-selected-range
|
|
1829
|
-
this.dom.createDivWithClass(`ge-table-${o.areaIdent}-${s}-selected-range`,
|
|
1857
|
+
this.dom.createDivWithClass(`ge-table-${o.areaIdent}-${s}-selected-range`, l)
|
|
1830
1858
|
);
|
|
1831
|
-
this.dom.setStyle(
|
|
1859
|
+
this.dom.setStyle(g, "left", `${r}px`), this.dom.setStyle(g, "top", `${n}px`), this.dom.setStyle(g, "width", `${c}px`), this.dom.setStyle(g, "height", `${h}px`);
|
|
1832
1860
|
}
|
|
1833
1861
|
}
|
|
1834
1862
|
}
|
|
1835
|
-
return
|
|
1863
|
+
return d;
|
|
1836
1864
|
}
|
|
1837
1865
|
/**
|
|
1838
1866
|
* Renders a cell in the grid.
|
|
@@ -1859,28 +1887,28 @@ class me extends ue {
|
|
|
1859
1887
|
sideIdent: s,
|
|
1860
1888
|
rowIndex: o,
|
|
1861
1889
|
columnIndex: i,
|
|
1862
|
-
left:
|
|
1863
|
-
top:
|
|
1864
|
-
width:
|
|
1890
|
+
left: a,
|
|
1891
|
+
top: l,
|
|
1892
|
+
width: r,
|
|
1865
1893
|
height: n,
|
|
1866
|
-
parent:
|
|
1894
|
+
parent: c,
|
|
1867
1895
|
cellSelected: h,
|
|
1868
|
-
lastRowOfModel:
|
|
1896
|
+
lastRowOfModel: d
|
|
1869
1897
|
}) {
|
|
1870
|
-
const [
|
|
1898
|
+
const [m, p] = this.addAndRenderCellDiv({
|
|
1871
1899
|
areaModel: e,
|
|
1872
1900
|
areaIdent: t,
|
|
1873
1901
|
sideIdent: s,
|
|
1874
1902
|
rowIndex: o,
|
|
1875
1903
|
index: i,
|
|
1876
|
-
left:
|
|
1877
|
-
width:
|
|
1904
|
+
left: a,
|
|
1905
|
+
width: r,
|
|
1878
1906
|
height: n,
|
|
1879
|
-
top:
|
|
1880
|
-
parent:
|
|
1881
|
-
lastRowOfModel:
|
|
1907
|
+
top: l,
|
|
1908
|
+
parent: c,
|
|
1909
|
+
lastRowOfModel: d
|
|
1882
1910
|
});
|
|
1883
|
-
h && this.dom.addClass(`ge-table-${t}-${s}-selected-range`,
|
|
1911
|
+
h && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, m), p && this.cleanupFunctions[t].push(p);
|
|
1884
1912
|
}
|
|
1885
1913
|
/**
|
|
1886
1914
|
* Render the header cell resize handle.
|
|
@@ -1896,9 +1924,9 @@ class me extends ue {
|
|
|
1896
1924
|
*
|
|
1897
1925
|
* @return {void}
|
|
1898
1926
|
*/
|
|
1899
|
-
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: o, cellWidth: i, cellHeight:
|
|
1900
|
-
const
|
|
1901
|
-
|
|
1927
|
+
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: o, cellWidth: i, cellHeight: a, parent: l }) {
|
|
1928
|
+
const r = this.dom.domService, n = this.tableOptions.columnResizeHandleWidthInPx ?? 2, c = r.createElement("div");
|
|
1929
|
+
r.setAttribute(c, "data-col-index", `${t}`), r.setAttribute(c, "data-row-index", `${e}`), r.setAttribute(c, "data-area", "header"), r.setAttribute(c, "data-ge-action", "resize-column"), r.addClass(c, "ge-table-column-resize-handle"), r.setStyle(c, "display", "clip"), r.setStyle(c, "position", "absolute"), r.setStyle(c, "cursor", "col-resize"), r.setStyle(c, "left", `${s + i - n}px`), r.setStyle(c, "top", `${o}px`), r.setStyle(c, "width", `${n}px`), r.setStyle(c, "height", `${a}px`), r.appendChild(l, c);
|
|
1902
1930
|
}
|
|
1903
1931
|
}
|
|
1904
1932
|
class ye {
|
|
@@ -1906,7 +1934,7 @@ class ye {
|
|
|
1906
1934
|
this.columnIndex = e, this.sortState = t;
|
|
1907
1935
|
}
|
|
1908
1936
|
}
|
|
1909
|
-
class
|
|
1937
|
+
class xe {
|
|
1910
1938
|
constructor(e) {
|
|
1911
1939
|
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
1912
1940
|
}
|
|
@@ -1922,23 +1950,23 @@ class ve {
|
|
|
1922
1950
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1923
1951
|
const t = e.target, s = t.getAttribute("data-area"), o = t.getAttribute("data-row-index"), i = t.getAttribute("data-col-index");
|
|
1924
1952
|
if (s && o && i) {
|
|
1925
|
-
const
|
|
1926
|
-
this.tableScope.updateModelValueAfterEdit(
|
|
1953
|
+
const a = G(s), l = Number(o), r = Number(i);
|
|
1954
|
+
this.tableScope.updateModelValueAfterEdit(a, l, r, t.value);
|
|
1927
1955
|
}
|
|
1928
1956
|
}
|
|
1929
1957
|
}
|
|
1930
1958
|
}
|
|
1931
|
-
class
|
|
1959
|
+
class ve {
|
|
1932
1960
|
constructor(e = -1, t = -1) {
|
|
1933
1961
|
this.rowIndex = e, this.columnIndex = t;
|
|
1934
1962
|
}
|
|
1935
1963
|
}
|
|
1936
|
-
class
|
|
1964
|
+
class _ {
|
|
1937
1965
|
constructor(e) {
|
|
1938
1966
|
this.cells = e;
|
|
1939
1967
|
}
|
|
1940
1968
|
static createSingle(e, t) {
|
|
1941
|
-
return new
|
|
1969
|
+
return new _([new ve(e, t)]);
|
|
1942
1970
|
}
|
|
1943
1971
|
}
|
|
1944
1972
|
class Ce {
|
|
@@ -1947,11 +1975,11 @@ class Ce {
|
|
|
1947
1975
|
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);
|
|
1948
1976
|
}
|
|
1949
1977
|
onMouseClicked(e, t) {
|
|
1950
|
-
var i,
|
|
1978
|
+
var i, a, l, r, n, c, h;
|
|
1951
1979
|
let s = !1, o = !1;
|
|
1952
1980
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1953
|
-
const
|
|
1954
|
-
|
|
1981
|
+
const d = this.getSelectionModel(), m = this.getFocusModel();
|
|
1982
|
+
d && m && (m.hasFocus(e.rowIndex, e.columnIndex) || (m.setFocus(e.rowIndex, e.columnIndex), this.tableScope.onFocusChanged(m), s = !0), (i = e.originalEvent) != null && i.shiftKey || d.hasSelection() && (d.clear(), s = !0), (a = e.originalEvent) != null && a.shiftKey && this.previousEvt ? (d.addSelection(this.createRangeByEvents(e, this.previousEvt)), o = !0, s = !0) : (l = e.originalEvent) != null && l.altKey && ((r = e.originalEvent) != null && r.ctrlKey || (n = e.originalEvent) != null && n.metaKey) ? (d.removeSelection(E.singleCell(e.rowIndex, e.columnIndex)), o = !0, s = !0) : (c = e.originalEvent) != null && c.ctrlKey || (h = e.originalEvent) != null && h.metaKey ? (d.addSelection(E.singleCell(e.rowIndex, e.columnIndex)), o = !0, s = !0) : (d.firstClick(e.rowIndex, e.columnIndex), s = !0), this.tableScope.onSelectionChanged(d));
|
|
1955
1983
|
}
|
|
1956
1984
|
return o ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
1957
1985
|
}
|
|
@@ -1973,16 +2001,16 @@ class Ce {
|
|
|
1973
2001
|
}
|
|
1974
2002
|
createRangeByEvents(e, t) {
|
|
1975
2003
|
t || (t = e);
|
|
1976
|
-
const s = Math.min(e.rowIndex, t == null ? void 0 : t.rowIndex), o = Math.max(e.rowIndex, t == null ? void 0 : t.rowIndex), i = Math.min(e.columnIndex, t == null ? void 0 : t.columnIndex),
|
|
2004
|
+
const s = Math.min(e.rowIndex, t == null ? void 0 : t.rowIndex), o = Math.max(e.rowIndex, t == null ? void 0 : t.rowIndex), i = Math.min(e.columnIndex, t == null ? void 0 : t.columnIndex), a = Math.max(e.columnIndex, t == null ? void 0 : t.columnIndex);
|
|
1977
2005
|
return E.create({
|
|
1978
2006
|
rowIndex1: s,
|
|
1979
2007
|
columnIndex1: i,
|
|
1980
2008
|
rowIndex2: o,
|
|
1981
|
-
columnIndex2:
|
|
2009
|
+
columnIndex2: a
|
|
1982
2010
|
});
|
|
1983
2011
|
}
|
|
1984
2012
|
}
|
|
1985
|
-
class
|
|
2013
|
+
class we {
|
|
1986
2014
|
get() {
|
|
1987
2015
|
return {
|
|
1988
2016
|
f2: "START_EDITING",
|
|
@@ -2045,7 +2073,7 @@ class Ae {
|
|
|
2045
2073
|
this.assignPredefinedSystemShortcutMappings(), Object.assign(this.shortcutActionIdMapping, this.tableScope.tableOptions.shortcutActionIdMapping), this.isDebug() && console.debug("ShortcutService", this.shortcutActionIdMapping), this.tableScope.hostElement.addEventListener("keydown", this.onKeyDown.bind(this));
|
|
2046
2074
|
}
|
|
2047
2075
|
assignPredefinedSystemShortcutMappings() {
|
|
2048
|
-
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new Ee().get()) : Object.assign(this.shortcutActionIdMapping, new
|
|
2076
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new Ee().get()) : Object.assign(this.shortcutActionIdMapping, new we().get());
|
|
2049
2077
|
}
|
|
2050
2078
|
isMacintosh() {
|
|
2051
2079
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -2097,7 +2125,7 @@ class Ae {
|
|
|
2097
2125
|
return this.shortcutActionIdMapping;
|
|
2098
2126
|
}
|
|
2099
2127
|
}
|
|
2100
|
-
class
|
|
2128
|
+
class j {
|
|
2101
2129
|
onCheckboxChanged(e) {
|
|
2102
2130
|
}
|
|
2103
2131
|
onContextmenu(e) {
|
|
@@ -2117,7 +2145,7 @@ class K {
|
|
|
2117
2145
|
onFocusChanged(e) {
|
|
2118
2146
|
}
|
|
2119
2147
|
}
|
|
2120
|
-
class
|
|
2148
|
+
class Q {
|
|
2121
2149
|
setStyle(e, t, s) {
|
|
2122
2150
|
return e.style[t] = s, e;
|
|
2123
2151
|
}
|
|
@@ -2145,14 +2173,14 @@ class Z {
|
|
|
2145
2173
|
}
|
|
2146
2174
|
}
|
|
2147
2175
|
class Me {
|
|
2148
|
-
render(e, t, s, o, i,
|
|
2176
|
+
render(e, t, s, o, i, a, l) {
|
|
2149
2177
|
if (i.isEditable(t, s)) {
|
|
2150
|
-
|
|
2151
|
-
const
|
|
2178
|
+
l.addClass(e, "ge-table-row-input-div");
|
|
2179
|
+
const r = i.getValueAt(t, s);
|
|
2152
2180
|
e.innerHTML = `
|
|
2153
2181
|
<input
|
|
2154
2182
|
type="text"
|
|
2155
|
-
value="${
|
|
2183
|
+
value="${r}"
|
|
2156
2184
|
autofocus
|
|
2157
2185
|
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
2158
2186
|
data-listen="change"
|
|
@@ -2165,7 +2193,7 @@ class Me {
|
|
|
2165
2193
|
}
|
|
2166
2194
|
}
|
|
2167
2195
|
}
|
|
2168
|
-
class
|
|
2196
|
+
class Te {
|
|
2169
2197
|
constructor(e = "none", t = "single") {
|
|
2170
2198
|
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1, this.silent = !1, this.listenerArr = [];
|
|
2171
2199
|
}
|
|
@@ -2247,7 +2275,7 @@ class Re {
|
|
|
2247
2275
|
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), this.fireChangeEvent());
|
|
2248
2276
|
}
|
|
2249
2277
|
}
|
|
2250
|
-
class
|
|
2278
|
+
class Re {
|
|
2251
2279
|
constructor(e = "none") {
|
|
2252
2280
|
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1, this.listenerArr = [];
|
|
2253
2281
|
}
|
|
@@ -2298,17 +2326,17 @@ class ee {
|
|
|
2298
2326
|
}
|
|
2299
2327
|
// `⊖ `, `⊕ `;
|
|
2300
2328
|
}
|
|
2301
|
-
const De = new
|
|
2329
|
+
const De = new Te(), ke = new Re("cell");
|
|
2302
2330
|
class te {
|
|
2303
2331
|
constructor() {
|
|
2304
2332
|
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 = {
|
|
2305
2333
|
header: 34,
|
|
2306
2334
|
body: 34,
|
|
2307
2335
|
footer: 34
|
|
2308
|
-
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new J(), this.headerGroupOptions = new ee(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new
|
|
2336
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new J(), this.headerGroupOptions = new ee(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new Z(), this.sortOrder = ["asc", "desc"], this.resizeEventDebounceDelay = 500, this.getEditRenderer = (e, t) => new Me(), this.getSelectionModel = () => De, this.getFocusModel = () => ke;
|
|
2309
2337
|
}
|
|
2310
2338
|
}
|
|
2311
|
-
const
|
|
2339
|
+
const F = class F {
|
|
2312
2340
|
/**
|
|
2313
2341
|
* Returns the content to be copied based on the provided table model, selection model, and focus model.
|
|
2314
2342
|
*
|
|
@@ -2321,24 +2349,24 @@ const I = class I {
|
|
|
2321
2349
|
createContent(e, t, s) {
|
|
2322
2350
|
return new Promise((o, i) => {
|
|
2323
2351
|
if (t != null && t.hasSelection()) {
|
|
2324
|
-
const
|
|
2325
|
-
if (
|
|
2326
|
-
|
|
2327
|
-
const
|
|
2328
|
-
for (let
|
|
2352
|
+
const a = this.mergeRanges(t.getRanges());
|
|
2353
|
+
if (a) {
|
|
2354
|
+
a.c2 = Math.min(a.c2, e.getColumnCount() - 1), a.r2 = Math.min(a.r2, e.getBodyModel().getRowCount() - 1);
|
|
2355
|
+
const l = [];
|
|
2356
|
+
for (let r = a.r1; r <= a.r2; r++) {
|
|
2329
2357
|
const n = [];
|
|
2330
|
-
for (let
|
|
2331
|
-
const h = t.isSelected(
|
|
2358
|
+
for (let c = a.c1; c <= a.c2; c++) {
|
|
2359
|
+
const h = t.isSelected(r, c) ? e.getBodyModel().getTextValueAt(r, c) : "";
|
|
2332
2360
|
n.push(h);
|
|
2333
2361
|
}
|
|
2334
|
-
|
|
2362
|
+
l.push(n.join(F.columnSeparatorChar));
|
|
2335
2363
|
}
|
|
2336
|
-
return o(
|
|
2364
|
+
return o(l.join(F.rowSeparatorChar));
|
|
2337
2365
|
}
|
|
2338
2366
|
}
|
|
2339
2367
|
if (s) {
|
|
2340
|
-
const [
|
|
2341
|
-
return o(
|
|
2368
|
+
const [a, l] = s.getFocus(), r = e.getBodyModel().getTextValueAt(a, l);
|
|
2369
|
+
return o(r);
|
|
2342
2370
|
}
|
|
2343
2371
|
i("Cannot copy, neither selection nor focus defined.");
|
|
2344
2372
|
});
|
|
@@ -2366,13 +2394,13 @@ const I = class I {
|
|
|
2366
2394
|
e,
|
|
2367
2395
|
t,
|
|
2368
2396
|
s
|
|
2369
|
-
).then((
|
|
2370
|
-
|
|
2371
|
-
o(
|
|
2372
|
-
}).catch((
|
|
2397
|
+
).then((a) => {
|
|
2398
|
+
a && this.copyContent(a).then((l) => {
|
|
2399
|
+
o(a);
|
|
2400
|
+
}).catch((l) => {
|
|
2373
2401
|
i();
|
|
2374
2402
|
});
|
|
2375
|
-
}).catch((
|
|
2403
|
+
}).catch((a) => {
|
|
2376
2404
|
i();
|
|
2377
2405
|
});
|
|
2378
2406
|
});
|
|
@@ -2390,30 +2418,136 @@ const I = class I {
|
|
|
2390
2418
|
return t;
|
|
2391
2419
|
}
|
|
2392
2420
|
};
|
|
2393
|
-
|
|
2421
|
+
F.columnSeparatorChar = " ", F.rowSeparatorChar = `
|
|
2394
2422
|
`;
|
|
2395
|
-
let
|
|
2396
|
-
class
|
|
2397
|
-
constructor(e) {
|
|
2398
|
-
this.tableScope = e, new ResizeObserver(
|
|
2423
|
+
let O = F;
|
|
2424
|
+
class Fe {
|
|
2425
|
+
constructor(e, t = 500) {
|
|
2426
|
+
this.tableScope = e, this.debounceDelay = t, new ResizeObserver(re(this.handleResize.bind(this), t)).observe(this.tableScope.hostElement);
|
|
2399
2427
|
}
|
|
2400
2428
|
handleResize(e) {
|
|
2401
2429
|
const t = e[0], { width: s } = t.contentRect;
|
|
2402
2430
|
this.tableScope.recalcColumnWidths(s);
|
|
2403
2431
|
}
|
|
2404
2432
|
}
|
|
2405
|
-
class
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2433
|
+
class Ie {
|
|
2434
|
+
/**
|
|
2435
|
+
* Downloads a matrix data as an Excel file.
|
|
2436
|
+
*
|
|
2437
|
+
* @param {Array<Array<any>>} matrix - A 2D array representing the data to be included in the Excel file. Each inner array corresponds to a row in the sheet.
|
|
2438
|
+
* @param {string} [filename='file.xlsx'] - The name of the Excel file to be downloaded. Defaults to 'file.xlsx'.
|
|
2439
|
+
* @param {string} [author=''] - The author's name to include as metadata in the Excel file. Optional parameter.
|
|
2440
|
+
* @return {void} Does not return a value.
|
|
2441
|
+
* @throws {Error} Throws an error if the input matrix is not a valid 2D array or if the filename is an empty string.
|
|
2442
|
+
*/
|
|
2443
|
+
downloadExcel(e, t = "file.xlsx", s = "") {
|
|
2444
|
+
if (!Array.isArray(e) || e.some((o) => !Array.isArray(o)))
|
|
2445
|
+
throw new Error("Invalid matrix format. Expected a 2D array.");
|
|
2446
|
+
if ((t == null ? void 0 : t.trim()) === "")
|
|
2447
|
+
throw new Error("Invalid filename. Filename must be a non-empty string.");
|
|
2448
|
+
try {
|
|
2449
|
+
const o = this.generateBuffer(e, s), i = new Blob([o], {
|
|
2450
|
+
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
2451
|
+
}), a = document.createElement("a");
|
|
2452
|
+
a.href = URL.createObjectURL(i), a.download = t, document.body.appendChild(a), a.click(), document.body.removeChild(a);
|
|
2453
|
+
} catch (o) {
|
|
2454
|
+
throw console.error("Error generating Excel file:", o), new Error("Failed to download Excel file.");
|
|
2411
2455
|
}
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2456
|
+
}
|
|
2457
|
+
generateMap(e, t = "") {
|
|
2458
|
+
const s = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2459
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>`, o = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2460
|
+
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>Microsoft Macintosh Excel</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="2" baseType="variant"><vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant><vt:variant><vt:i4>1</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="1" baseType="lpstr"><vt:lpstr>Sheet1</vt:lpstr></vt:vector></TitlesOfParts><Company></Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>16.0300</AppVersion></Properties>`, i = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2461
|
+
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>${t}</dc:creator><cp:lastModifiedBy>${t}</cp:lastModifiedBy><dcterms:created xsi:type="dcterms:W3CDTF">2024-12-13T19:45:08Z</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">2024-12-13T19:45:35Z</dcterms:modified></cp:coreProperties>`, a = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2462
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/></Relationships>`, l = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2463
|
+
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="0E2841"/></a:dk2><a:lt2><a:srgbClr val="E8E8E8"/></a:lt2><a:accent1><a:srgbClr val="156082"/></a:accent1><a:accent2><a:srgbClr val="E97132"/></a:accent2><a:accent3><a:srgbClr val="196B24"/></a:accent3><a:accent4><a:srgbClr val="0F9ED5"/></a:accent4><a:accent5><a:srgbClr val="A02B93"/></a:accent5><a:accent6><a:srgbClr val="4EA72E"/></a:accent6><a:hlink><a:srgbClr val="467886"/></a:hlink><a:folHlink><a:srgbClr val="96607D"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Aptos Display" panose="02110004020202020204"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="游ゴシック Light"/><a:font script="Hang" typeface="맑은 고딕"/><a:font script="Hans" typeface="等线 Light"/><a:font script="Hant" typeface="新細明體"/><a:font script="Arab" typeface="Times New Roman"/><a:font script="Hebr" typeface="Times New Roman"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="MoolBoran"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Times New Roman"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/><a:font script="Armn" typeface="Arial"/><a:font script="Bugi" typeface="Leelawadee UI"/><a:font script="Bopo" typeface="Microsoft JhengHei"/><a:font script="Java" typeface="Javanese Text"/><a:font script="Lisu" typeface="Segoe UI"/><a:font script="Mymr" typeface="Myanmar Text"/><a:font script="Nkoo" typeface="Ebrima"/><a:font script="Olck" typeface="Nirmala UI"/><a:font script="Osma" typeface="Ebrima"/><a:font script="Phag" typeface="Phagspa"/><a:font script="Syrn" typeface="Estrangelo Edessa"/><a:font script="Syrj" typeface="Estrangelo Edessa"/><a:font script="Syre" typeface="Estrangelo Edessa"/><a:font script="Sora" typeface="Nirmala UI"/><a:font script="Tale" typeface="Microsoft Tai Le"/><a:font script="Talu" typeface="Microsoft New Tai Lue"/><a:font script="Tfng" typeface="Ebrima"/></a:majorFont><a:minorFont><a:latin typeface="Aptos Narrow" panose="02110004020202020204"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="游ゴシック"/><a:font script="Hang" typeface="맑은 고딕"/><a:font script="Hans" typeface="等线"/><a:font script="Hant" typeface="新細明體"/><a:font script="Arab" typeface="Arial"/><a:font script="Hebr" typeface="Arial"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="DaunPenh"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Arial"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/><a:font script="Armn" typeface="Arial"/><a:font script="Bugi" typeface="Leelawadee UI"/><a:font script="Bopo" typeface="Microsoft JhengHei"/><a:font script="Java" typeface="Javanese Text"/><a:font script="Lisu" typeface="Segoe UI"/><a:font script="Mymr" typeface="Myanmar Text"/><a:font script="Nkoo" typeface="Ebrima"/><a:font script="Olck" typeface="Nirmala UI"/><a:font script="Osma" typeface="Ebrima"/><a:font script="Phag" typeface="Phagspa"/><a:font script="Syrn" typeface="Estrangelo Edessa"/><a:font script="Syrj" typeface="Estrangelo Edessa"/><a:font script="Syre" typeface="Estrangelo Edessa"/><a:font script="Sora" typeface="Nirmala UI"/><a:font script="Tale" typeface="Microsoft Tai Le"/><a:font script="Talu" typeface="Microsoft New Tai Lue"/><a:font script="Tfng" typeface="Ebrima"/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="110000"/><a:satMod val="105000"/><a:tint val="67000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="103000"/><a:tint val="73000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="109000"/><a:tint val="81000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:satMod val="103000"/><a:lumMod val="102000"/><a:tint val="94000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:satMod val="110000"/><a:lumMod val="100000"/><a:shade val="100000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="99000"/><a:satMod val="120000"/><a:shade val="78000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="12700" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="19050" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="57150" dist="19050" dir="5400000" algn="ctr" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="63000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"><a:tint val="95000"/><a:satMod val="170000"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="93000"/><a:satMod val="150000"/><a:shade val="98000"/><a:lumMod val="102000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:tint val="98000"/><a:satMod val="130000"/><a:shade val="90000"/><a:lumMod val="103000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="63000"/><a:satMod val="120000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults><a:lnDef><a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style></a:lnDef></a:objectDefaults><a:extraClrSchemeLst/><a:extLst><a:ext uri="{05A4C25C-085E-4340-85A3-A5531E510DB2}"><thm15:themeFamily xmlns:thm15="http://schemas.microsoft.com/office/thememl/2012/main" name="Office Theme" id="{2E142A2C-CD16-42D6-873A-C26D2A0506FA}" vid="{1BDDFF52-6CD6-40A5-AB3C-68EB2F1E4D0A}"/></a:ext></a:extLst></a:theme>`, r = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2464
|
+
<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="3" uniqueCount="3"><si><t>a</t></si><si><t>b</t></si><si><t>c</t></si></sst>`, n = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2465
|
+
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac x16r2 xr" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:x16r2="http://schemas.microsoft.com/office/spreadsheetml/2015/02/main" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision"><fonts count="1" x14ac:knownFonts="1"><font><sz val="12"/><color theme="1"/><name val="Aptos Narrow"/><family val="2"/><scheme val="minor"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles><dxfs count="0"/><tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleLight16"/><extLst><ext uri="{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:slicerStyles defaultSlicerStyle="SlicerStyleLight1"/></ext><ext uri="{9260A510-F301-46a8-8635-F512D64BE5F5}" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"><x15:timelineStyles defaultTimelineStyle="TimeSlicerStyleLight1"/></ext></extLst></styleSheet>`, c = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2466
|
+
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x15 xr xr6 xr10 xr2" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" xmlns:xr6="http://schemas.microsoft.com/office/spreadsheetml/2016/revision6" xmlns:xr10="http://schemas.microsoft.com/office/spreadsheetml/2016/revision10" xmlns:xr2="http://schemas.microsoft.com/office/spreadsheetml/2015/revision2"><fileVersion appName="xl" lastEdited="7" lowestEdited="7" rupBuild="11207"/><workbookPr defaultThemeVersion="202300"/><mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice Requires="x15"><x15ac:absPath url="/" xmlns:x15ac="http://schemas.microsoft.com/office/spreadsheetml/2010/11/ac"/></mc:Choice></mc:AlternateContent><xr:revisionPtr revIDLastSave="0" documentId="8_{292BF245-1F37-B045-B1A5-26C42FB62779}" xr6:coauthVersionLast="47" xr6:coauthVersionMax="47" xr10:uidLastSave="{00000000-0000-0000-0000-000000000000}"/><bookViews><workbookView xWindow="11340" yWindow="5060" windowWidth="28040" windowHeight="17440" xr2:uid="{858B8D3F-6246-774D-8903-6D38687B7BC6}"/></bookViews><sheets><sheet name="Sheet1" sheetId="1" r:id="rId1"/></sheets><calcPr calcId="181029"/><extLst><ext uri="{140A7094-0E35-4892-8432-C4D2E57EDEB5}" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"><x15:workbookPr chartTrackingRefBase="1"/></ext><ext uri="{B58B0392-4F1F-4190-BB64-5DF3571DCE5F}" xmlns:xcalcf="http://schemas.microsoft.com/office/spreadsheetml/2018/calcfeatures"><xcalcf:calcFeatures><xcalcf:feature name="microsoft.com:RD"/><xcalcf:feature name="microsoft.com:Single"/><xcalcf:feature name="microsoft.com:FV"/><xcalcf:feature name="microsoft.com:CNMTM"/><xcalcf:feature name="microsoft.com:LET_WF"/><xcalcf:feature name="microsoft.com:LAMBDA_WF"/><xcalcf:feature name="microsoft.com:ARRAYTEXT_WF"/></xcalcf:calcFeatures></ext></extLst></workbook>`, h = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2467
|
+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/></Types>`, d = /* @__PURE__ */ new Map();
|
|
2468
|
+
return d.set("_rels/.rels", s), d.set("docProps/app.xml", o), d.set("docProps/core.xml", i), d.set("xl/_rels/workbook.xml.rels", a), d.set("xl/theme/theme1.xml", l), d.set("xl/worksheets/sheet1.xml", this.getX1WorksheetsSheet1Xml(e)), d.set("xl/sharedStrings.xml", r), d.set("xl/styles.xml", n), d.set("xl/workbook.xml", c), d.set("[Content_Types].xml", h), d;
|
|
2469
|
+
}
|
|
2470
|
+
getX1WorksheetsSheet1Xml(e) {
|
|
2471
|
+
const t = [];
|
|
2472
|
+
t.push(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2473
|
+
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac xr xr2 xr3" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" xmlns:xr2="http://schemas.microsoft.com/office/spreadsheetml/2015/revision2" xmlns:xr3="http://schemas.microsoft.com/office/spreadsheetml/2016/revision3" xr:uid="{E15F8FC4-4D40-434C-921A-3D9CFAAA2865}">
|
|
2474
|
+
<dimension ref="A1:B3"/>
|
|
2475
|
+
<sheetViews>
|
|
2476
|
+
<sheetView tabSelected="1" workbookViewId="0"/></sheetViews>
|
|
2477
|
+
<sheetFormatPr baseColWidth="10" defaultRowHeight="16" x14ac:dyDescent="0.2"/>
|
|
2478
|
+
<sheetData>`);
|
|
2479
|
+
for (let s = 0; s < e.length; s++) {
|
|
2480
|
+
const o = e[s];
|
|
2481
|
+
t.push('<row r="${r + 1}" spans="1:2" x14ac:dyDescent="0.2">');
|
|
2482
|
+
for (let i = 0; i < o.length; i++) {
|
|
2483
|
+
const a = o[i], l = this.getCellAddress(s, i);
|
|
2484
|
+
if (typeof a == "number")
|
|
2485
|
+
t.push(`<c r="${l}"><v>${a}</v></c>`);
|
|
2486
|
+
else if (a instanceof Date) {
|
|
2487
|
+
const r = a;
|
|
2488
|
+
t.push(`<c r="${l}" t="inlineStr"><is><t>${r.toISOString()}</t></is></c>`);
|
|
2489
|
+
} else {
|
|
2490
|
+
const r = a != null ? this.escapeXml(String(a)) : "";
|
|
2491
|
+
t.push(`<c r="${l}" t="inlineStr"><is><t>${r}</t></is></c>`);
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
t.push("</row>");
|
|
2495
|
+
}
|
|
2496
|
+
return t.push(""), t.push(""), t.push('</sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/>'), t.push("</worksheet>"), t.join(`
|
|
2497
|
+
`);
|
|
2498
|
+
}
|
|
2499
|
+
escapeXml(e) {
|
|
2500
|
+
return e == null ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2501
|
+
}
|
|
2502
|
+
getCellAddress(e, t) {
|
|
2503
|
+
const s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
2504
|
+
let o = "";
|
|
2505
|
+
for (; t >= 0; )
|
|
2506
|
+
o = s[t % 26] + o, t = Math.floor(t / 26) - 1;
|
|
2507
|
+
return `${o}${e + 1}`;
|
|
2508
|
+
}
|
|
2509
|
+
createZip(e) {
|
|
2510
|
+
const t = [];
|
|
2511
|
+
let s = 0;
|
|
2512
|
+
const o = [];
|
|
2513
|
+
e.forEach((h, d) => {
|
|
2514
|
+
const m = new TextEncoder().encode(d), p = new TextEncoder().encode(h), b = new Uint8Array(30 + m.length), g = new DataView(b.buffer);
|
|
2515
|
+
b.set([80, 75, 3, 4], 0), g.setUint16(4, 20, !0), g.setUint16(6, 0, !0), g.setUint16(8, 0, !0), g.setUint16(10, 0, !0), g.setUint16(12, 0, !0), g.setUint32(14, 0, !0), g.setUint32(18, p.length, !0), g.setUint32(22, p.length, !0), g.setUint16(26, m.length, !0), g.setUint16(28, 0, !0), b.set(m, 30), t.push(b, p), o.push({
|
|
2516
|
+
path: d,
|
|
2517
|
+
offset: s,
|
|
2518
|
+
contentSize: p.length
|
|
2519
|
+
}), s += b.length + p.length;
|
|
2520
|
+
});
|
|
2521
|
+
const i = s;
|
|
2522
|
+
o.forEach((h) => {
|
|
2523
|
+
const d = new TextEncoder().encode(h.path), m = new Uint8Array(46 + d.length), p = new DataView(m.buffer);
|
|
2524
|
+
m.set([80, 75, 1, 2], 0), p.setUint16(4, 20, !0), p.setUint16(6, 20, !0), p.setUint16(8, 0, !0), p.setUint16(10, 0, !0), p.setUint16(12, 0, !0), p.setUint16(14, 0, !0), p.setUint32(16, 0, !0), p.setUint32(20, h.contentSize, !0), p.setUint32(24, h.contentSize, !0), p.setUint16(28, d.length, !0), p.setUint16(30, 0, !0), p.setUint16(32, 0, !0), p.setUint16(34, 0, !0), p.setUint16(36, 0, !0), p.setUint32(38, 0, !0), p.setUint32(42, h.offset, !0), m.set(d, 46), t.push(m), s += m.length;
|
|
2525
|
+
});
|
|
2526
|
+
const a = new Uint8Array(22), l = new DataView(a.buffer);
|
|
2527
|
+
a.set([80, 75, 5, 6], 0), l.setUint16(4, 0, !0), l.setUint16(6, 0, !0), l.setUint16(8, o.length, !0), l.setUint16(10, o.length, !0), l.setUint32(12, s - i, !0), l.setUint32(16, i, !0), l.setUint16(20, 0, !0), t.push(a);
|
|
2528
|
+
const r = t.reduce((h, d) => h + d.length, 0), n = new Uint8Array(r);
|
|
2529
|
+
let c = 0;
|
|
2530
|
+
for (const h of t)
|
|
2531
|
+
n.set(h, c), c += h.length;
|
|
2532
|
+
return n;
|
|
2533
|
+
}
|
|
2534
|
+
generateBuffer(e, t = "") {
|
|
2535
|
+
const s = this.generateMap(e, t);
|
|
2536
|
+
return this.createZip(s);
|
|
2537
|
+
}
|
|
2538
|
+
}
|
|
2539
|
+
class U extends Se {
|
|
2540
|
+
constructor(e, t, s, o, i, a = new O(), l = new Ie()) {
|
|
2541
|
+
var c;
|
|
2542
|
+
if (super(e, t, new le(s), o), this.eventListener = i, this.copyService = a, this.excelService = l, this.licenseManager = k.getInstance(), this.selectionService = new Ce(this), this.api = new de(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.lastDragFrom = -1, this.lastDragTo = -1, this.firstDraggingRendering = !0, i || (this.eventListener = new j()), (c = this.tableOptions) != null && c.autoRestoreOptions) {
|
|
2543
|
+
const h = this.tableOptions.autoRestoreOptions, d = h.getStorageKeyFn;
|
|
2544
|
+
d && (h.autoRestoreScrollPosition && (this.storeScrollPosStateService = new he(d)), h.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new ge(d)), h.autoRestoreSortingState && (this.storeSortingService = new fe(d)));
|
|
2545
|
+
}
|
|
2546
|
+
this.mouseHandler = new ce(this), this.inputHandler = new xe(this), this.resizeHandler = new Fe(this, o.resizeEventDebounceDelay), this.shortcutService = new Ae(this), this.shortcutService.addListener(this.selectionService);
|
|
2547
|
+
const r = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
2548
|
+
r && r.addEventSelectionChangedListener(this);
|
|
2549
|
+
const n = this.getFocusModel ? this.getFocusModel() : void 0;
|
|
2550
|
+
n && n.addEventFocusChangedListener(this);
|
|
2417
2551
|
}
|
|
2418
2552
|
/**
|
|
2419
2553
|
* Creates a TableScope instance.
|
|
@@ -2427,8 +2561,8 @@ class j extends me {
|
|
|
2427
2561
|
*
|
|
2428
2562
|
* @return {TableScope} - The newly created TableScope instance.
|
|
2429
2563
|
*/
|
|
2430
|
-
static create(e, t, s = new te(), o = new
|
|
2431
|
-
return new
|
|
2564
|
+
static create(e, t, s = new te(), o = new j(), i = new Q(), a = new O()) {
|
|
2565
|
+
return new U(e, t, i, s, o, a);
|
|
2432
2566
|
}
|
|
2433
2567
|
/**
|
|
2434
2568
|
* Triggers an action based on the provided actionId.
|
|
@@ -2456,7 +2590,7 @@ class j extends me {
|
|
|
2456
2590
|
return !1;
|
|
2457
2591
|
}
|
|
2458
2592
|
updateModelValueAfterEdit(e, t, s, o) {
|
|
2459
|
-
e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, o) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(
|
|
2593
|
+
e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, o) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(_.createSingle(t, s)), this.hostElement.focus());
|
|
2460
2594
|
}
|
|
2461
2595
|
/**
|
|
2462
2596
|
* Retrieves the TableApi object.
|
|
@@ -2485,7 +2619,7 @@ class j extends me {
|
|
|
2485
2619
|
* @return {GeMouseEvent} - The created GeMouseEvent object.
|
|
2486
2620
|
*/
|
|
2487
2621
|
createGeMouseEvent(e) {
|
|
2488
|
-
const t = new
|
|
2622
|
+
const t = new N();
|
|
2489
2623
|
if (t.originalEvent = e, e) {
|
|
2490
2624
|
const s = e.target;
|
|
2491
2625
|
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) {
|
|
@@ -2555,7 +2689,7 @@ class j extends me {
|
|
|
2555
2689
|
toggleExpandCollapseAll(e = !0) {
|
|
2556
2690
|
var s;
|
|
2557
2691
|
const t = this.tableModel.getBodyModel();
|
|
2558
|
-
|
|
2692
|
+
W(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
2559
2693
|
}
|
|
2560
2694
|
/**
|
|
2561
2695
|
* Toggles the checkbox state of a specific row in a table.
|
|
@@ -2567,11 +2701,11 @@ class j extends me {
|
|
|
2567
2701
|
* @return {void} - This method does not return anything.
|
|
2568
2702
|
*/
|
|
2569
2703
|
toggleRowCheckbox(e, t, s) {
|
|
2570
|
-
var
|
|
2571
|
-
const o = this.tableModel.getAreaModel(s), i = o.isRowChecked(e),
|
|
2572
|
-
o.setRowChecked(e,
|
|
2573
|
-
const
|
|
2574
|
-
this.eventListener.onCheckboxChanged(
|
|
2704
|
+
var r;
|
|
2705
|
+
const o = this.tableModel.getAreaModel(s), i = o.isRowChecked(e), a = i === void 0 || i === "semi" || i === "none";
|
|
2706
|
+
o.setRowChecked(e, a), this.repaint();
|
|
2707
|
+
const l = (r = o.rowSelectionModel) == null ? void 0 : r.getCheckedRows();
|
|
2708
|
+
this.eventListener.onCheckboxChanged(l || []);
|
|
2575
2709
|
}
|
|
2576
2710
|
/**
|
|
2577
2711
|
* Handle mouse click events.
|
|
@@ -2621,12 +2755,12 @@ class j extends me {
|
|
|
2621
2755
|
* @return {void}
|
|
2622
2756
|
*/
|
|
2623
2757
|
onHeaderDblClicked(e, t, s) {
|
|
2624
|
-
var i,
|
|
2758
|
+
var i, a;
|
|
2625
2759
|
const o = this.tableModel.getColumnDef(s);
|
|
2626
2760
|
if (o != null && o.sortable && o.sortable()) {
|
|
2627
2761
|
e.preventDefault(), e.stopPropagation();
|
|
2628
|
-
const
|
|
2629
|
-
this.tableModel.doSort([
|
|
2762
|
+
const l = o.sortStatesOrder ? o.sortStatesOrder : this.tableOptions.sortOrder, r = o.sortState ?? "", n = l[(l.indexOf(r) + 1) % l.length], c = new ye(s, n);
|
|
2763
|
+
this.tableModel.doSort([c]) && ((i = this.tableModel.getColumnDefs()) == null || i.forEach((d) => d.sortState = ""), o.sortState = n), this.repaint(), (a = this.storeSortingService) == null || a.setSortItems([c]);
|
|
2630
2764
|
}
|
|
2631
2765
|
}
|
|
2632
2766
|
/**
|
|
@@ -2770,30 +2904,30 @@ class j extends me {
|
|
|
2770
2904
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
|
|
2771
2905
|
const s = this.tableOptions.autoRestoreOptions, o = s.getRowId;
|
|
2772
2906
|
if (s.autoRestoreCollapsedExpandedState && o) {
|
|
2773
|
-
const i = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(),
|
|
2774
|
-
if (
|
|
2775
|
-
const
|
|
2776
|
-
for (let n = 0; n <
|
|
2777
|
-
const
|
|
2778
|
-
if (
|
|
2907
|
+
const i = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), a = this.tableModel.getAreaModel("body");
|
|
2908
|
+
if (W(a)) {
|
|
2909
|
+
const l = a, r = a.getRowCount();
|
|
2910
|
+
for (let n = 0; n < r; n++) {
|
|
2911
|
+
const c = a.getRowByIndex(n);
|
|
2912
|
+
if (c)
|
|
2779
2913
|
if (i.allExpanded)
|
|
2780
|
-
|
|
2914
|
+
c.expanded = !0;
|
|
2781
2915
|
else if (i.allCollapsed)
|
|
2782
|
-
|
|
2916
|
+
c.expanded = !1;
|
|
2783
2917
|
else {
|
|
2784
|
-
const h = o(
|
|
2785
|
-
i.mode === "expanded" ?
|
|
2918
|
+
const h = o(c.data);
|
|
2919
|
+
i.mode === "expanded" ? c.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h) : i.mode === "collapsed" && (c.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h));
|
|
2786
2920
|
}
|
|
2787
2921
|
}
|
|
2788
|
-
|
|
2922
|
+
l.recalcVisibleTreeRows();
|
|
2789
2923
|
}
|
|
2790
2924
|
}
|
|
2791
2925
|
}
|
|
2792
2926
|
}
|
|
2793
2927
|
}
|
|
2794
|
-
const
|
|
2928
|
+
const B = class B {
|
|
2795
2929
|
};
|
|
2796
|
-
|
|
2930
|
+
B.themes = ["light", "combat", "paper", "blackboard"], B.vars = {
|
|
2797
2931
|
light: `html[data-theme="light"] {
|
|
2798
2932
|
--ge-table-bg: rgba(255,255,255, 0.5);
|
|
2799
2933
|
--ge-table-header-west-bg: rgba(233, 233, 233, 0.5);
|
|
@@ -3027,110 +3161,110 @@ $.themes = ["light", "combat", "paper", "blackboard"], $.vars = {
|
|
|
3027
3161
|
--ge-table-drop-zone-bg: #758129;
|
|
3028
3162
|
}`
|
|
3029
3163
|
};
|
|
3030
|
-
let
|
|
3031
|
-
const
|
|
3164
|
+
let K = B;
|
|
3165
|
+
const P = class P {
|
|
3032
3166
|
constructor(e = new ee()) {
|
|
3033
3167
|
this.headerGroupOptions = e;
|
|
3034
3168
|
}
|
|
3035
|
-
render(e, t, s, o, i,
|
|
3036
|
-
const
|
|
3037
|
-
if (
|
|
3038
|
-
const { toggle: n, visibility:
|
|
3039
|
-
this.addText(e, o, t, s,
|
|
3169
|
+
render(e, t, s, o, i, a, l) {
|
|
3170
|
+
const r = a != null && a.data ? a.data : "";
|
|
3171
|
+
if (a) {
|
|
3172
|
+
const { toggle: n, visibility: c, closed: h } = a, d = n ? P.toggleHeaderGroup : "";
|
|
3173
|
+
this.addText(e, o, t, s, r, d), n && c !== "always" && this.addArrowDiv(l, e, !h, t, s, o, d);
|
|
3040
3174
|
} else
|
|
3041
|
-
this.addText(e, o, t, s,
|
|
3175
|
+
this.addText(e, o, t, s, r, "");
|
|
3042
3176
|
}
|
|
3043
|
-
addText(e, t, s, o, i,
|
|
3177
|
+
addText(e, t, s, o, i, a) {
|
|
3044
3178
|
e.innerHTML = `<span
|
|
3045
|
-
data-ge-action="${
|
|
3179
|
+
data-ge-action="${a}"
|
|
3046
3180
|
data-area="${t}"
|
|
3047
3181
|
data-row-index="${s}"
|
|
3048
3182
|
data-col-index="${o}"
|
|
3049
3183
|
>${i}</span>`;
|
|
3050
3184
|
}
|
|
3051
|
-
addArrowDiv(e, t, s = !0, o = -1, i = -1,
|
|
3052
|
-
const
|
|
3053
|
-
e.addClass(
|
|
3185
|
+
addArrowDiv(e, t, s = !0, o = -1, i = -1, a = "header", l) {
|
|
3186
|
+
const r = e.createElement("div");
|
|
3187
|
+
e.addClass(r, "ge-table-toggle-icon-div"), e.setStyle(r, "display", "inline-block"), e.setStyle(r, "position", ""), e.setStyle(r, "width", "20px"), e.setStyle(r, "background", "transparent"), e.setStyle(r, "cursor", "pointer"), e.setAttribute(r, "data-row-index", `${o}`), e.setAttribute(r, "data-col-index", `${i}`), e.setAttribute(r, "data-area", `${a}`), e.setAttribute(r, "data-ge-action", `${l}`);
|
|
3054
3188
|
let n;
|
|
3055
3189
|
s ? n = this.headerGroupOptions.iconExpanded : n = this.headerGroupOptions.iconCollapsed;
|
|
3056
|
-
const
|
|
3057
|
-
e.appendChild(
|
|
3058
|
-
for (const
|
|
3059
|
-
e.addClass(
|
|
3060
|
-
return e.appendChild(t,
|
|
3190
|
+
const c = n.content, h = e.createText(c);
|
|
3191
|
+
e.appendChild(r, h), n.style && this.applyStyleString(e, r, n.style);
|
|
3192
|
+
for (const d of n.classes)
|
|
3193
|
+
e.addClass(r, d);
|
|
3194
|
+
return e.appendChild(t, r), r;
|
|
3061
3195
|
}
|
|
3062
3196
|
applyStyleString(e, t, s) {
|
|
3063
3197
|
const o = s.split(";").map((i) => i.trim()).filter((i) => i);
|
|
3064
3198
|
for (const i of o) {
|
|
3065
|
-
const [
|
|
3066
|
-
e.setStyle(t,
|
|
3199
|
+
const [a, l] = i.split(":");
|
|
3200
|
+
e.setStyle(t, a.trim(), l.trim());
|
|
3067
3201
|
}
|
|
3068
3202
|
}
|
|
3069
3203
|
};
|
|
3070
|
-
|
|
3071
|
-
let
|
|
3072
|
-
function
|
|
3073
|
-
tableModel:
|
|
3204
|
+
P.toggleHeaderGroup = "toggleHeaderGroup";
|
|
3205
|
+
let Y = P;
|
|
3206
|
+
function Pe({
|
|
3207
|
+
tableModel: f,
|
|
3074
3208
|
tableOptions: e = new te(),
|
|
3075
3209
|
mouseMoved: t,
|
|
3076
3210
|
checkboxChanged: s,
|
|
3077
3211
|
contextmenu: o,
|
|
3078
3212
|
modelChanged: i,
|
|
3079
|
-
mouseClicked:
|
|
3080
|
-
mouseDragging:
|
|
3081
|
-
mouseDraggingEnd:
|
|
3213
|
+
mouseClicked: a,
|
|
3214
|
+
mouseDragging: l,
|
|
3215
|
+
mouseDraggingEnd: r,
|
|
3082
3216
|
selectionChanged: n,
|
|
3083
|
-
focusChanged:
|
|
3217
|
+
focusChanged: c,
|
|
3084
3218
|
tableReady: h,
|
|
3085
|
-
licenseKey:
|
|
3219
|
+
licenseKey: d
|
|
3086
3220
|
}) {
|
|
3087
|
-
const
|
|
3088
|
-
let
|
|
3221
|
+
const m = oe(null);
|
|
3222
|
+
let p = !1;
|
|
3089
3223
|
ie(() => {
|
|
3090
|
-
|
|
3224
|
+
m.current && !p && (b(m.current), p = !0);
|
|
3091
3225
|
});
|
|
3092
|
-
const
|
|
3093
|
-
const
|
|
3094
|
-
onSelectionChanged(
|
|
3095
|
-
n && n(
|
|
3226
|
+
const b = (g) => {
|
|
3227
|
+
const u = {
|
|
3228
|
+
onSelectionChanged(S) {
|
|
3229
|
+
n && n(S);
|
|
3096
3230
|
},
|
|
3097
|
-
onFocusChanged(
|
|
3098
|
-
|
|
3231
|
+
onFocusChanged(S) {
|
|
3232
|
+
c && c(S);
|
|
3099
3233
|
},
|
|
3100
|
-
onCheckboxChanged: (
|
|
3101
|
-
s && s(
|
|
3234
|
+
onCheckboxChanged: (S) => {
|
|
3235
|
+
s && s(S);
|
|
3102
3236
|
},
|
|
3103
|
-
onContextmenu: (
|
|
3104
|
-
o && o(
|
|
3237
|
+
onContextmenu: (S) => {
|
|
3238
|
+
o && o(S);
|
|
3105
3239
|
},
|
|
3106
|
-
onModelChanged: (
|
|
3107
|
-
i && i(
|
|
3240
|
+
onModelChanged: (S) => {
|
|
3241
|
+
i && i(S);
|
|
3108
3242
|
},
|
|
3109
|
-
onMouseClicked: (
|
|
3110
|
-
|
|
3243
|
+
onMouseClicked: (S) => {
|
|
3244
|
+
a && a(S);
|
|
3111
3245
|
},
|
|
3112
|
-
onMouseDragging: (
|
|
3113
|
-
|
|
3246
|
+
onMouseDragging: (S) => {
|
|
3247
|
+
l && l(S);
|
|
3114
3248
|
},
|
|
3115
|
-
onMouseDraggingEnd: (
|
|
3116
|
-
|
|
3249
|
+
onMouseDraggingEnd: (S) => {
|
|
3250
|
+
r && r(S);
|
|
3117
3251
|
},
|
|
3118
|
-
onMouseMoved: (
|
|
3119
|
-
t && t(
|
|
3252
|
+
onMouseMoved: (S) => {
|
|
3253
|
+
t && t(S);
|
|
3120
3254
|
}
|
|
3121
|
-
},
|
|
3122
|
-
b,
|
|
3255
|
+
}, x = new U(
|
|
3123
3256
|
g,
|
|
3124
|
-
|
|
3257
|
+
f,
|
|
3258
|
+
new Q(),
|
|
3125
3259
|
e,
|
|
3126
|
-
|
|
3260
|
+
u
|
|
3127
3261
|
);
|
|
3128
|
-
|
|
3262
|
+
x.firstInit(), h && h(x.getApi()), d && k.getInstance().setLicenseKey(d);
|
|
3129
3263
|
};
|
|
3130
3264
|
return /* @__PURE__ */ se(
|
|
3131
3265
|
"div",
|
|
3132
3266
|
{
|
|
3133
|
-
ref:
|
|
3267
|
+
ref: m,
|
|
3134
3268
|
className: "container-div",
|
|
3135
3269
|
style: {
|
|
3136
3270
|
width: "100%",
|
|
@@ -3142,39 +3276,39 @@ function $e({
|
|
|
3142
3276
|
}
|
|
3143
3277
|
);
|
|
3144
3278
|
}
|
|
3145
|
-
var
|
|
3279
|
+
var V, L = ae;
|
|
3146
3280
|
if (process.env.NODE_ENV === "production")
|
|
3147
|
-
|
|
3281
|
+
V = L.createRoot, L.hydrateRoot;
|
|
3148
3282
|
else {
|
|
3149
|
-
var
|
|
3150
|
-
|
|
3151
|
-
|
|
3283
|
+
var q = L.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
3284
|
+
V = function(f, e) {
|
|
3285
|
+
q.usingClientEntryPoint = !0;
|
|
3152
3286
|
try {
|
|
3153
|
-
return
|
|
3287
|
+
return L.createRoot(f, e);
|
|
3154
3288
|
} finally {
|
|
3155
|
-
|
|
3289
|
+
q.usingClientEntryPoint = !1;
|
|
3156
3290
|
}
|
|
3157
3291
|
};
|
|
3158
3292
|
}
|
|
3159
|
-
class
|
|
3293
|
+
class $e {
|
|
3160
3294
|
constructor(e) {
|
|
3161
3295
|
this.Component = e, console.info(e);
|
|
3162
3296
|
}
|
|
3163
|
-
render(e, t, s, o, i,
|
|
3164
|
-
const
|
|
3297
|
+
render(e, t, s, o, i, a, l) {
|
|
3298
|
+
const r = {
|
|
3165
3299
|
cellDiv: e,
|
|
3166
3300
|
rowIndex: t,
|
|
3167
3301
|
columnIndex: s,
|
|
3168
3302
|
areaIdent: o,
|
|
3169
3303
|
areaModel: i,
|
|
3170
|
-
cellValue:
|
|
3171
|
-
}, n =
|
|
3172
|
-
return n.render(this.Component(
|
|
3304
|
+
cellValue: a
|
|
3305
|
+
}, n = V(e, {});
|
|
3306
|
+
return n.render(this.Component(r)), () => {
|
|
3173
3307
|
n.unmount();
|
|
3174
3308
|
};
|
|
3175
3309
|
}
|
|
3176
3310
|
}
|
|
3177
3311
|
export {
|
|
3178
|
-
|
|
3179
|
-
|
|
3312
|
+
$e as ComponentRendererWrapper,
|
|
3313
|
+
Pe as GuiexpertTable
|
|
3180
3314
|
};
|