@guiexpert/vue3-table 3.0.1 → 3.0.2
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 +243 -9
- package/index.js +1710 -768
- package/lib/GuiexpertTable.vue.d.ts +3 -1
- package/package.json +1 -1
- package/style.css +1 -1
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
class
|
|
1
|
+
import { defineComponent as ee, ref as te, onMounted as oe, openBlock as se, createElementBlock as ie, createVNode as re, render as j } from "vue";
|
|
2
|
+
class k {
|
|
3
3
|
// The constructor is private to prevent direct construction calls
|
|
4
4
|
// with the `new` operator
|
|
5
5
|
constructor() {
|
|
6
6
|
this.alreadySet = !1;
|
|
7
7
|
}
|
|
8
8
|
static getInstance() {
|
|
9
|
-
return
|
|
9
|
+
return k.instance || (k.instance = new k()), k.instance;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Method to set the license key for the application.
|
|
@@ -24,18 +24,18 @@ class D {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
27
|
+
function H(c) {
|
|
28
|
+
return c && c.type === "TreeRow";
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
return
|
|
30
|
+
function P(c) {
|
|
31
|
+
return c && c.type === "AreaModelTree";
|
|
32
32
|
}
|
|
33
|
-
class
|
|
34
|
-
constructor(e = -1, t = -1,
|
|
35
|
-
this.rowIndex = e, this.rowTop = t, this.columnIndex =
|
|
33
|
+
class W {
|
|
34
|
+
constructor(e = -1, t = -1, o = -1, s = -1, i, r, a, l = 0, n = 0, d = 0, h = "") {
|
|
35
|
+
this.rowIndex = e, this.rowTop = t, this.columnIndex = o, this.columnLeft = s, this.areaIdent = i, this.sideIdent = r, this.originalEvent = a, this.clickCount = l, this.draggingX = n, this.draggingY = d, this.action = h;
|
|
36
36
|
}
|
|
37
37
|
clone() {
|
|
38
|
-
return new
|
|
38
|
+
return new W(
|
|
39
39
|
this.rowIndex,
|
|
40
40
|
this.rowTop,
|
|
41
41
|
this.columnIndex,
|
|
@@ -50,47 +50,47 @@ class B {
|
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
class
|
|
54
|
-
constructor(e = ">", t = "",
|
|
55
|
-
this.content = e, this.style = t, this.classes =
|
|
53
|
+
class D {
|
|
54
|
+
constructor(e = ">", t = "", o = []) {
|
|
55
|
+
this.content = e, this.style = t, this.classes = o;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
class
|
|
59
|
-
constructor(e = new
|
|
58
|
+
class q {
|
|
59
|
+
constructor(e = new D(
|
|
60
60
|
">",
|
|
61
61
|
"transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
|
|
62
62
|
["gt-table-tree-arrow-expanded"]
|
|
63
|
-
), t = new
|
|
63
|
+
), t = new D(
|
|
64
64
|
">",
|
|
65
65
|
"",
|
|
66
66
|
["ge-table-tree-arrow-collapsed"]
|
|
67
|
-
),
|
|
67
|
+
), o = new D(
|
|
68
68
|
">",
|
|
69
69
|
"color:transparent;",
|
|
70
70
|
["gt-table-tree-arrow-hidden"]
|
|
71
|
-
),
|
|
71
|
+
), s = new D(
|
|
72
72
|
"↕",
|
|
73
73
|
"",
|
|
74
74
|
["gt-table-tree-arrow-expanded-all"]
|
|
75
75
|
)) {
|
|
76
|
-
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder =
|
|
76
|
+
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = o, this.arrowExpandCollapseAll = s;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
class
|
|
80
|
-
constructor(e = new
|
|
81
|
-
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder =
|
|
79
|
+
class U {
|
|
80
|
+
constructor(e = new D("↑", "", ["ge-header-sorted-asc"]), t = new D("↓", "", ["ge-header-sorted-desc"]), o = new D("↑", "color:transparent;", [])) {
|
|
81
|
+
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = o;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
class
|
|
84
|
+
class le {
|
|
85
85
|
constructor(e) {
|
|
86
86
|
this.domService = e;
|
|
87
87
|
}
|
|
88
|
-
setStyle(e, t,
|
|
89
|
-
return this.domService.setStyle(e, t,
|
|
88
|
+
setStyle(e, t, o) {
|
|
89
|
+
return this.domService.setStyle(e, t, o), e;
|
|
90
90
|
}
|
|
91
91
|
applyStyle(e, t) {
|
|
92
|
-
for (const
|
|
93
|
-
this.domService.setStyle(e,
|
|
92
|
+
for (const o in t)
|
|
93
|
+
this.domService.setStyle(e, o, t[o]);
|
|
94
94
|
return e;
|
|
95
95
|
}
|
|
96
96
|
applyDisplayNoneStyle(e) {
|
|
@@ -100,7 +100,7 @@ class ee {
|
|
|
100
100
|
return this.domService.setStyle(e, "display", "block"), e;
|
|
101
101
|
}
|
|
102
102
|
applyStyleInPx(e, t) {
|
|
103
|
-
return Object.entries(t).forEach(([
|
|
103
|
+
return Object.entries(t).forEach(([o, s]) => this.domService.setStyle(e, o, s + "px")), e;
|
|
104
104
|
}
|
|
105
105
|
applyStylePosistionRelative(e) {
|
|
106
106
|
return this.domService.setStyle(e, "position", "relative"), this.domService.setStyle(e, "overflow", "clip"), e;
|
|
@@ -111,8 +111,8 @@ class ee {
|
|
|
111
111
|
applyStyleFullSize(e) {
|
|
112
112
|
return this.domService.setStyle(e, "width", "100%"), this.domService.setStyle(e, "height", "100%"), e;
|
|
113
113
|
}
|
|
114
|
-
applyStyleOverflowAuto(e = "auto", t = "auto",
|
|
115
|
-
return this.domService.setStyle(
|
|
114
|
+
applyStyleOverflowAuto(e = "auto", t = "auto", o) {
|
|
115
|
+
return this.domService.setStyle(o, "overflow-x", e), this.domService.setStyle(o, "overflow-y", t), o;
|
|
116
116
|
}
|
|
117
117
|
applyStyleNoPadding(e) {
|
|
118
118
|
return this.domService.setStyle(e, "padding", "0"), this.domService.setStyle(e, "margin", "0"), this.domService.setStyle(e, "border", "0"), e;
|
|
@@ -128,156 +128,157 @@ class ee {
|
|
|
128
128
|
return this.domService.appendChild(e, t), this.applyStylePosistionAbsolute(e), { parent: e, child: t, cache: {} };
|
|
129
129
|
}
|
|
130
130
|
appendText(e, t) {
|
|
131
|
-
const
|
|
132
|
-
return this.domService.appendChild(e,
|
|
131
|
+
const o = this.domService.createText(t);
|
|
132
|
+
return this.domService.appendChild(e, o), o;
|
|
133
133
|
}
|
|
134
134
|
addClass(e, t) {
|
|
135
|
-
return e.includes(" ") ? e.split(" ").forEach((
|
|
135
|
+
return e.includes(" ") ? e.split(" ").forEach((o) => this.domService.addClass(t, o)) : this.domService.addClass(t, e), t;
|
|
136
136
|
}
|
|
137
137
|
removeClass(e, t) {
|
|
138
|
-
return e.includes(" ") ? e.split(" ").forEach((
|
|
138
|
+
return e.includes(" ") ? e.split(" ").forEach((o) => this.domService.removeClass(t, o)) : this.domService.removeClass(t, e), t;
|
|
139
139
|
}
|
|
140
140
|
addClasses(e, t) {
|
|
141
141
|
if (e)
|
|
142
|
-
for (const
|
|
143
|
-
this.domService.addClass(t,
|
|
142
|
+
for (const o of e)
|
|
143
|
+
this.domService.addClass(t, o);
|
|
144
144
|
return t;
|
|
145
145
|
}
|
|
146
|
-
setAttribute(e, t,
|
|
147
|
-
return t &&
|
|
146
|
+
setAttribute(e, t, o) {
|
|
147
|
+
return t && o && this.domService.setAttribute(e, t, o), e;
|
|
148
148
|
}
|
|
149
|
-
createAreaDivWithClass(e, t,
|
|
150
|
-
const
|
|
151
|
-
return this.addClass(e,
|
|
149
|
+
createAreaDivWithClass(e, t, o, s) {
|
|
150
|
+
const i = this.domService.createElement("div");
|
|
151
|
+
return this.addClass(e, i), this.domService.setAttribute(i, "data-area", o), this.domService.setAttribute(i, "data-side", s), this.domService.appendChild(t, i), i;
|
|
152
152
|
}
|
|
153
153
|
createDivWithClass(e, t) {
|
|
154
|
-
const
|
|
155
|
-
return this.addClass(e,
|
|
154
|
+
const o = this.domService.createElement("div");
|
|
155
|
+
return this.addClass(e, o), this.domService.appendChild(t, o), o;
|
|
156
156
|
}
|
|
157
|
-
addRowDiv(e, t,
|
|
158
|
-
const
|
|
159
|
-
if (this.domService.addClass(
|
|
160
|
-
const
|
|
161
|
-
this.domService.addClass(
|
|
157
|
+
addRowDiv(e, t, o = -1, s, i, r = "") {
|
|
158
|
+
const a = t.index ?? -1, l = this.getDivOrCreateDiv(a, e);
|
|
159
|
+
if (this.domService.addClass(l, "ge-table-row-div"), this.domService.addClass(l, `ge-table-row-div-${t.index}`), s === "body" && i === "center") {
|
|
160
|
+
const n = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
161
|
+
this.domService.addClass(l, `ge-table-row-${n}`);
|
|
162
162
|
}
|
|
163
|
-
if (this.domService.setStyle(
|
|
164
|
-
const
|
|
165
|
-
this.domService.appendChild(
|
|
163
|
+
if (this.domService.setStyle(l, "display", "clip"), this.domService.setStyle(l, "position", "absolute"), this.domService.setStyle(l, "left", `${t.left}px`), this.domService.setStyle(l, "top", `${t.top}px`), this.domService.setStyle(l, "width", `${t.width}px`), this.domService.setStyle(l, "height", `${t.height}px`), this.domService.setAttribute(l, "data-row-index", `${o}`), this.domService.setAttribute(l, "data-area", `${s}`), r) {
|
|
164
|
+
const n = this.domService.createText(r);
|
|
165
|
+
this.domService.appendChild(l, n);
|
|
166
166
|
}
|
|
167
|
-
return this.domService.appendChild(e.child,
|
|
168
|
-
}
|
|
169
|
-
addColumnDiv(e
|
|
170
|
-
const
|
|
171
|
-
this.domService.addClass(
|
|
172
|
-
const
|
|
173
|
-
if (
|
|
174
|
-
const
|
|
175
|
-
this.addLabelDiv(
|
|
167
|
+
return this.domService.appendChild(e.child, l), l;
|
|
168
|
+
}
|
|
169
|
+
addColumnDiv(e) {
|
|
170
|
+
const { parent: t, geo: o, rowIndex: s = -1, columnIndex: i = -1, areaIdent: r, sideIdent: a, text: l = "", treeArrow: n, tableOptions: d, checkedType: h = void 0, sortState: g } = e, f = d == null ? void 0 : d.treeOptions, S = d == null ? void 0 : d.showCheckboxWihoutExtraColumn, u = this.domService.createElement("div");
|
|
171
|
+
this.domService.addClass(u, "ge-table-col-div"), this.domService.addClass(u, `ge-table-col-div-${o.index}`), this.domService.setAttribute(u, "data-col-index", `${o.index}`), this.domService.setAttribute(u, "data-row-index", `${s}`), this.domService.setAttribute(u, "data-area", `${r}`);
|
|
172
|
+
const b = ((o == null ? void 0 : o.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
173
|
+
if (r === "body" && a === "center" && this.domService.addClass(u, `ge-table-column-${b}`), this.domService.setStyle(u, "display", "clip"), this.domService.setStyle(u, "position", "absolute"), this.domService.setStyle(u, "left", `${o.left}px`), this.domService.setStyle(u, "top", `${o.top}px`), this.domService.setStyle(u, "width", `${o.width}px`), this.domService.setStyle(u, "height", `${o.height}px`), n && n !== "none" && (this.domService.addClass(u, "ge-table-col-tree"), this.addArrowDiv(u, n, f, s, i, r)), S && i === 0 && h && this.addCheckboxToDiv(u, h, r, s), l) {
|
|
174
|
+
const p = n !== "none" && i === 0;
|
|
175
|
+
this.addLabelDiv(u, l, p, s, i, r);
|
|
176
176
|
}
|
|
177
|
-
return
|
|
177
|
+
return g && this.addSortedIcon(u, g, d == null ? void 0 : d.sortedOptions, i), this.domService.appendChild(t, u), u;
|
|
178
178
|
}
|
|
179
|
-
addCheckboxToDiv(e, t,
|
|
180
|
-
const
|
|
181
|
-
return
|
|
179
|
+
addCheckboxToDiv(e, t, o, s) {
|
|
180
|
+
const i = this.domService.createElement("div"), r = t === "full" ? "checked" : "";
|
|
181
|
+
return i.innerHTML = `
|
|
182
182
|
<input
|
|
183
183
|
type="checkbox"
|
|
184
|
-
data-area="${
|
|
185
|
-
data-row-index="${
|
|
184
|
+
data-area="${o}"
|
|
185
|
+
data-row-index="${s}"
|
|
186
186
|
data-input-type="checkbox"
|
|
187
|
-
${
|
|
188
|
-
class="ge-table-row-checkbox"> `, this.domService.setStyle(
|
|
189
|
-
}
|
|
190
|
-
addLabelDiv(e, t = "",
|
|
191
|
-
const
|
|
192
|
-
if (this.domService.addClass(
|
|
193
|
-
if (
|
|
194
|
-
const
|
|
195
|
-
this.domService.appendChild(
|
|
187
|
+
${r}
|
|
188
|
+
class="ge-table-row-checkbox"> `, this.domService.setStyle(i, "display", "inline"), this.domService.setStyle(i, "width", "inherit"), this.domService.setAttribute(i, "data-row-index", `${s}`), this.domService.appendChild(e, i), i;
|
|
189
|
+
}
|
|
190
|
+
addLabelDiv(e, t = "", o = !1, s = -1, i = -1, r = "body") {
|
|
191
|
+
const a = this.domService.createElement("div");
|
|
192
|
+
if (this.domService.addClass(a, "ge-table-label-div"), this.domService.setStyle(a, "position", "relative"), this.domService.setStyle(a, "background", "transparent"), this.domService.setStyle(a, "width", "100%"), this.domService.setStyle(a, "height", "100%"), this.domService.setAttribute(a, "data-row-index", `${s}`), this.domService.setAttribute(a, "data-col-index", `${i}`), this.domService.setAttribute(a, "data-area", `${r}`), t)
|
|
193
|
+
if (o) {
|
|
194
|
+
const l = this.domService.createText(t);
|
|
195
|
+
this.domService.appendChild(a, l);
|
|
196
196
|
} else {
|
|
197
|
-
const
|
|
198
|
-
this.domService.appendChild(
|
|
199
|
-
const
|
|
200
|
-
this.domService.addClass(
|
|
197
|
+
const l = this.domService.createElement("div");
|
|
198
|
+
this.domService.appendChild(a, l);
|
|
199
|
+
const n = this.domService.createText(t);
|
|
200
|
+
this.domService.addClass(l, "ge-table-label"), this.domService.appendChild(l, n), this.domService.setAttribute(l, "data-row-index", `${s}`), this.domService.setAttribute(l, "data-col-index", `${i}`), this.domService.setAttribute(l, "data-area", `${r}`);
|
|
201
201
|
}
|
|
202
|
-
return this.domService.appendChild(e,
|
|
202
|
+
return this.domService.appendChild(e, a), a;
|
|
203
203
|
}
|
|
204
|
-
addSortedIcon(e, t = "",
|
|
205
|
-
const
|
|
206
|
-
this.domService.addClass(
|
|
207
|
-
let l;
|
|
208
|
-
t === "asc" ? l = s.iconAsc : t === "desc" ? l = s.iconDesc : l = s.iconPlaceholder;
|
|
209
|
-
const n = l.content, r = this.domService.createText(n);
|
|
210
|
-
this.domService.appendChild(o, r), l.style && this.applyStyleString(o, l.style);
|
|
211
|
-
for (const a of l.classes)
|
|
212
|
-
this.domService.addClass(o, a);
|
|
213
|
-
return this.domService.appendChild(e, o), o;
|
|
214
|
-
}
|
|
215
|
-
addArrowDiv(e, t = "none", s = new j(), i = -1, o = -1, l = "body") {
|
|
216
|
-
const n = this.domService.createElement("div");
|
|
217
|
-
this.domService.addClass(n, "ge-table-tree-arrow-div"), this.domService.setStyle(n, "display", "inline-block"), this.domService.setStyle(n, "position", ""), this.domService.setStyle(n, "width", "20px"), this.domService.setStyle(n, "background", "transparent"), this.domService.setStyle(n, "cursor", "pointer"), this.domService.setAttribute(n, "data-row-index", `${i}`), this.domService.setAttribute(n, "data-col-index", `${o}`), this.domService.setAttribute(n, "data-area", `${l}`);
|
|
204
|
+
addSortedIcon(e, t = "", o = new U(), s = -1) {
|
|
205
|
+
const i = this.domService.createElement("div");
|
|
206
|
+
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", `${s}`), this.domService.setAttribute(i, "data-area", "header");
|
|
218
207
|
let r;
|
|
219
|
-
t === "
|
|
220
|
-
const a = r.content,
|
|
221
|
-
this.domService.appendChild(
|
|
222
|
-
for (const
|
|
223
|
-
this.domService.addClass(
|
|
224
|
-
return this.domService.appendChild(e,
|
|
225
|
-
}
|
|
226
|
-
|
|
208
|
+
t === "asc" ? r = o.iconAsc : t === "desc" ? r = o.iconDesc : r = o.iconPlaceholder;
|
|
209
|
+
const a = r.content, l = this.domService.createText(a);
|
|
210
|
+
this.domService.appendChild(i, l), r.style && this.applyStyleString(i, r.style);
|
|
211
|
+
for (const n of r.classes)
|
|
212
|
+
this.domService.addClass(i, n);
|
|
213
|
+
return this.domService.appendChild(e, i), i;
|
|
214
|
+
}
|
|
215
|
+
addArrowDiv(e, t = "none", o = new q(), s = -1, i = -1, r = "body") {
|
|
216
|
+
const a = this.domService.createElement("div");
|
|
217
|
+
this.domService.addClass(a, "ge-table-tree-arrow-div"), this.domService.setStyle(a, "display", "inline-block"), this.domService.setStyle(a, "position", ""), this.domService.setStyle(a, "width", "20px"), this.domService.setStyle(a, "background", "transparent"), this.domService.setStyle(a, "cursor", "pointer"), this.domService.setAttribute(a, "data-row-index", `${s}`), this.domService.setAttribute(a, "data-col-index", `${i}`), this.domService.setAttribute(a, "data-area", `${r}`);
|
|
218
|
+
let l;
|
|
219
|
+
t === "expanded" ? l = o.arrowExpanded : t === "collapsed" ? l = o.arrowCollapsed : l = o.arrowPlaceholder;
|
|
220
|
+
const n = l.content, d = this.domService.createText(n);
|
|
221
|
+
this.domService.appendChild(a, d), l.style && this.applyStyleString(a, l.style);
|
|
222
|
+
for (const h of l.classes)
|
|
223
|
+
this.domService.addClass(a, h);
|
|
224
|
+
return this.domService.appendChild(e, a), a;
|
|
225
|
+
}
|
|
226
|
+
addColumnBorderDivs(e, t, o, s, i) {
|
|
227
227
|
if (e.verticalBorderVisible) {
|
|
228
|
-
const
|
|
229
|
-
this.addVerticalBorder(
|
|
228
|
+
const r = `ge-table-${s}-${i}-vertical-border`;
|
|
229
|
+
this.addVerticalBorder(o, t, r);
|
|
230
230
|
}
|
|
231
231
|
if (e.horizontalBorderVisible) {
|
|
232
|
-
const
|
|
233
|
-
this.addHorizontalBorder(
|
|
232
|
+
const r = `ge-table-${s}-${i}-horizontal-border`;
|
|
233
|
+
this.addHorizontalBorder(o, t, r);
|
|
234
234
|
}
|
|
235
235
|
return t;
|
|
236
236
|
}
|
|
237
|
-
addHorizontalBorder(e, t,
|
|
238
|
-
const
|
|
239
|
-
return this.domService.addClass(
|
|
237
|
+
addHorizontalBorder(e, t, o = "ge-table-body-center-horizontal-border") {
|
|
238
|
+
const s = this.domService.createElement("div");
|
|
239
|
+
return this.domService.addClass(s, o), this.domService.setStyle(s, "display", "clip"), this.domService.setStyle(s, "position", "absolute"), this.domService.setStyle(s, "left", `${e.left}px`), this.domService.setStyle(s, "top", `${e.top}px`), this.domService.setStyle(s, "width", `${e.width}px`), this.domService.setStyle(s, "height", "1px"), this.domService.appendChild(t, s), s;
|
|
240
240
|
}
|
|
241
|
-
addFocusBorderDivs(e, t,
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
addFocusBorderDivs(e, t, o) {
|
|
242
|
+
t = { ...t, width: t.width + 1, height: t.height + 1 };
|
|
243
|
+
let s = this.domService.createElement("div");
|
|
244
|
+
return this.domService.addClass(s, "ge-table-focus-border"), this.domService.setStyle(s, "display", "clip"), this.domService.setStyle(s, "position", "absolute"), this.domService.setStyle(s, "left", `${t.left}px`), this.domService.setStyle(s, "top", `${t.top}px`), this.domService.setStyle(s, "width", "1px"), this.domService.setStyle(s, "height", `${t.height}px`), this.domService.setStyle(s, "z-index", "9999"), this.applyStyle(s, o), this.domService.appendChild(e, s), s = this.domService.createElement("div"), this.domService.addClass(s, "ge-table-focus-border"), this.domService.setStyle(s, "display", "clip"), this.domService.setStyle(s, "position", "absolute"), this.domService.setStyle(s, "left", `${t.left + t.width - 1}px`), this.domService.setStyle(s, "top", `${t.top}px`), this.domService.setStyle(s, "width", "1px"), this.domService.setStyle(s, "height", `${t.height}px`), this.domService.setStyle(s, "z-index", "9999"), this.applyStyle(s, o), this.domService.appendChild(e, s), s = this.domService.createElement("div"), this.domService.addClass(s, "ge-table-focus-border"), this.domService.setStyle(s, "display", "clip"), this.domService.setStyle(s, "position", "absolute"), this.domService.setStyle(s, "left", `${t.left}px`), this.domService.setStyle(s, "top", `${t.top}px`), this.domService.setStyle(s, "width", `${t.width}px`), this.domService.setStyle(s, "height", "1px"), this.domService.setStyle(s, "z-index", "9999"), this.applyStyle(s, o), this.domService.appendChild(e, s), s = this.domService.createElement("div"), this.domService.addClass(s, "ge-table-focus-border"), this.domService.setStyle(s, "display", "clip"), this.domService.setStyle(s, "position", "absolute"), this.domService.setStyle(s, "left", `${t.left}px`), this.domService.setStyle(s, "top", `${t.top + t.height - 1}px`), this.domService.setStyle(s, "width", `${t.width}px`), this.domService.setStyle(s, "height", "1px"), this.domService.setStyle(s, "z-index", "9999"), this.applyStyle(s, o), this.domService.appendChild(e, s), e;
|
|
244
245
|
}
|
|
245
|
-
addVerticalBorder(e, t,
|
|
246
|
-
const
|
|
247
|
-
return this.domService.addClass(
|
|
246
|
+
addVerticalBorder(e, t, o = "ge-table-body-center-vertical-border") {
|
|
247
|
+
const s = this.domService.createElement("div");
|
|
248
|
+
return this.domService.addClass(s, o), this.domService.setStyle(s, "display", "clip"), this.domService.setStyle(s, "position", "absolute"), this.domService.setStyle(s, "left", `${e.left}px`), this.domService.setStyle(s, "top", `${e.top}px`), this.domService.setStyle(s, "width", "1px"), this.domService.setStyle(s, "height", `${e.height}px`), this.domService.appendChild(t, s), s;
|
|
248
249
|
}
|
|
249
|
-
addDiv(e, t,
|
|
250
|
-
const
|
|
251
|
-
return
|
|
250
|
+
addDiv(e, t, o = "") {
|
|
251
|
+
const s = this.domService.createElement("div");
|
|
252
|
+
return o && this.domService.addClass(s, o), this.domService.setStyle(s, "display", "clip"), this.domService.setStyle(s, "position", "absolute"), this.domService.setStyle(s, "left", `${t.left}px`), this.domService.setStyle(s, "top", `${t.top}px`), this.domService.setStyle(s, "width", `${t.width}px`), this.domService.setStyle(s, "height", `${t.height}px`), this.domService.appendChild(e, s), s;
|
|
252
253
|
}
|
|
253
254
|
applyStyleString(e, t) {
|
|
254
|
-
const
|
|
255
|
-
for (const
|
|
256
|
-
const [
|
|
257
|
-
this.domService.setStyle(e,
|
|
255
|
+
const o = t.split(";").map((s) => s.trim()).filter((s) => s);
|
|
256
|
+
for (const s of o) {
|
|
257
|
+
const [i, r] = s.split(":");
|
|
258
|
+
this.domService.setStyle(e, i.trim(), r.trim());
|
|
258
259
|
}
|
|
259
260
|
}
|
|
260
261
|
getDivOrCreateDiv(e, t) {
|
|
261
|
-
let
|
|
262
|
-
return
|
|
262
|
+
let o = t.cache[e];
|
|
263
|
+
return o ? (o.innerText = "", o) : (o = this.domService.createElement("div"), t.cache[e] = o, o);
|
|
263
264
|
}
|
|
264
265
|
}
|
|
265
|
-
const
|
|
266
|
-
class
|
|
266
|
+
const G = (c) => c === "header" ? "header" : c === "footer" ? "footer" : "body";
|
|
267
|
+
class ae {
|
|
267
268
|
constructor(e, t) {
|
|
268
269
|
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)) {
|
|
269
270
|
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"));
|
|
270
|
-
const
|
|
271
|
-
if (
|
|
272
|
-
const
|
|
273
|
-
this.value =
|
|
271
|
+
const o = e.getAttribute("data-area");
|
|
272
|
+
if (o && (this.areaIdent = G(o), this.areaModel = t.tableModel.getAreaModel(this.areaIdent), this.row = this.areaModel.getRowByIndex(this.rowIdx)), e instanceof HTMLInputElement) {
|
|
273
|
+
const s = e;
|
|
274
|
+
this.value = s.value;
|
|
274
275
|
}
|
|
275
276
|
}
|
|
276
277
|
}
|
|
277
278
|
}
|
|
278
|
-
class
|
|
279
|
+
class ne {
|
|
279
280
|
constructor(e) {
|
|
280
|
-
this.tableScope = e, this.expandedAll = !0, this.mouseDown = !1, this.dragging = !1, this.tableScope.hostElement.addEventListener("click", this.onHostElementClicked.bind(this)), this.tableScope.hostElement.addEventListener("dblclick", this.onHostElementDblClicked.bind(this)), this.tableScope.hostElement.addEventListener("mousedown", this.onMouseDown.bind(this)), this.tableScope.hostElement.addEventListener("mousemove", this.onMouseMove.bind(this)), this.tableScope.hostElement.addEventListener("mouseup", this.onMouseUp.bind(this)), this.tableScope.hostElement.addEventListener("contextmenu", this.onContextmenu.bind(this)), this.tableScope.hostElement._MouseHandler = "true", this.tableScope.scrollViewport.addEventListener("scroll", this.tableScope.adjustAfterScrolling.bind(this.tableScope)), [window, this.tableScope.hostElement].forEach(
|
|
281
|
+
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(
|
|
281
282
|
(t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
|
|
282
283
|
);
|
|
283
284
|
}
|
|
@@ -301,22 +302,28 @@ class se {
|
|
|
301
302
|
* @return {void}
|
|
302
303
|
*/
|
|
303
304
|
onHostElementClicked(e) {
|
|
304
|
-
const t =
|
|
305
|
-
if (t.
|
|
305
|
+
const t = Date.now();
|
|
306
|
+
if (t - this.lastClicked < this.doubleClickDelay)
|
|
307
|
+
return;
|
|
308
|
+
this.lastClicked = t;
|
|
309
|
+
const o = new ae(e.target, this.tableScope);
|
|
310
|
+
if (o.action === "toggleExpandCollapseAll")
|
|
306
311
|
this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
|
|
307
|
-
else if (
|
|
308
|
-
this.tableScope.
|
|
309
|
-
else if (
|
|
310
|
-
|
|
312
|
+
else if (o.action === "toggleHeaderGroup")
|
|
313
|
+
this.tableScope.toggleHeaderGroup(o), e.preventDefault(), e.stopPropagation();
|
|
314
|
+
else if (o.inputType === "checkbox" && o.areaIdent)
|
|
315
|
+
this.tableScope.toggleRowCheckbox(o.rowIdx, o.colIdx, o.areaIdent), e.preventDefault(), e.stopPropagation();
|
|
316
|
+
else if (H(o.row) && o.areaModel) {
|
|
317
|
+
const s = o.colIdx === this.getArrowColumnIndex() && e.altKey, i = o.className.includes("ge-table-tree-arrow-div");
|
|
311
318
|
if (console.info(i, s), s || i) {
|
|
312
319
|
e.preventDefault(), e.stopPropagation();
|
|
313
|
-
const
|
|
314
|
-
|
|
320
|
+
const r = o.row;
|
|
321
|
+
r.expanded = !r.expanded, "recalcVisibleTreeRows" in o.areaModel && o.areaModel.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(r);
|
|
315
322
|
}
|
|
316
323
|
}
|
|
317
|
-
if (
|
|
324
|
+
if (o.areaIdent === "body" && this.tableScope.tableOptions.getFocusModel) {
|
|
318
325
|
const s = this.tableScope.tableOptions.getFocusModel();
|
|
319
|
-
s == null || s.clear(), s == null || s.setFocus(
|
|
326
|
+
s == null || s.clear(), s == null || s.setFocus(o.rowIdx, o.colIdx);
|
|
320
327
|
}
|
|
321
328
|
this.publishGeMouseEvent(e, 1);
|
|
322
329
|
}
|
|
@@ -327,16 +334,16 @@ class se {
|
|
|
327
334
|
* @param {MouseEvent} event - The double click event.
|
|
328
335
|
*/
|
|
329
336
|
onHostElementDblClicked(e) {
|
|
330
|
-
if (e.target instanceof HTMLElement) {
|
|
331
|
-
const t = e.target,
|
|
332
|
-
if (
|
|
333
|
-
this.tableScope.tableModel.isSortable(
|
|
337
|
+
if (this.lastClicked = Date.now(), e.target instanceof HTMLElement) {
|
|
338
|
+
const t = e.target, o = t.getAttribute("data-area"), s = G(o), i = Number(t.getAttribute("data-row-index")), r = Number(t.getAttribute("data-col-index")), a = this.tableScope.tableModel.getAreaModel(s);
|
|
339
|
+
if (o && s === "header")
|
|
340
|
+
this.tableScope.tableModel.isSortable(r) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, i, r));
|
|
334
341
|
else if (t.getAttribute("data-row-index")) {
|
|
335
|
-
const
|
|
336
|
-
if (
|
|
342
|
+
const l = a.getRowByIndex(i);
|
|
343
|
+
if (o && s === "body" && a.isEditable(i, r) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(i, r)), H(l) && r === this.getArrowColumnIndex()) {
|
|
337
344
|
e.preventDefault(), e.stopPropagation();
|
|
338
|
-
const
|
|
339
|
-
|
|
345
|
+
const n = l;
|
|
346
|
+
n.expanded = !n.expanded, "recalcVisibleTreeRows" in a && a.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(n);
|
|
340
347
|
}
|
|
341
348
|
}
|
|
342
349
|
}
|
|
@@ -351,8 +358,8 @@ class se {
|
|
|
351
358
|
* @return {void}
|
|
352
359
|
*/
|
|
353
360
|
publishGeMouseEvent(e, t) {
|
|
354
|
-
var
|
|
355
|
-
this.mouseEvent = e, this.geMouseEventOld = (
|
|
361
|
+
var o;
|
|
362
|
+
this.mouseEvent = e, this.geMouseEventOld = (o = this.geMouseEvent) == null ? void 0 : o.clone(), this.geMouseEvent = this.tableScope.createGeMouseEvent(e), this.geMouseEvent && (this.geMouseEvent.clickCount = t), this.tableScope.onMouseClicked(this.geMouseEvent, this.geMouseEventOld), this.tableScope.publishGeMouseEvent(this.geMouseEvent), t === 1 && this.tableScope.debounceRepaint();
|
|
356
363
|
}
|
|
357
364
|
/**
|
|
358
365
|
* Update the collapsed/expanded state of a tree row.
|
|
@@ -361,30 +368,30 @@ class se {
|
|
|
361
368
|
* @returns {void}
|
|
362
369
|
*/
|
|
363
370
|
updateCollapsedExpandedState(e) {
|
|
364
|
-
var s, i,
|
|
365
|
-
const t = (
|
|
371
|
+
var o, s, i, r, a;
|
|
372
|
+
const t = (s = (o = this.tableScope.tableOptions) == null ? void 0 : o.autoRestoreOptions) == null ? void 0 : s.getRowId;
|
|
366
373
|
if (t) {
|
|
367
|
-
const
|
|
368
|
-
|
|
374
|
+
const l = (i = this.tableScope.storeStateCollapsedExpandService) == null ? void 0 : i.collapsedExpandedStateGet().mode, n = l === "collapsed" && !e.expanded || l === "expanded" && e.expanded, d = l === "collapsed" && e.expanded || l === "expanded" && !e.expanded, h = t(e.data);
|
|
375
|
+
n ? (r = this.tableScope.storeStateCollapsedExpandService) == null || r.collapsedStateIdsPush(h) : d && ((a = this.tableScope.storeStateCollapsedExpandService) == null || a.collapsedStateIdsRemove(h));
|
|
369
376
|
}
|
|
370
377
|
}
|
|
371
378
|
getArrowColumnIndex() {
|
|
372
379
|
return this.tableScope.tableModel.isRowCheckboxVisible() ? 1 : 0;
|
|
373
380
|
}
|
|
374
381
|
onMouseDown(e) {
|
|
375
|
-
this.mouseEvent = e, this.startMouseEvent = this.tableScope.createGeMouseEvent(this.mouseEvent), this.tableScope.onMouseDown(this.startMouseEvent), this.mouseDown = !0;
|
|
382
|
+
this.dragging || (this.mouseEvent = e, this.startMouseEvent = this.tableScope.createGeMouseEvent(this.mouseEvent), this.tableScope.onMouseDown(this.startMouseEvent), this.mouseDown = !0);
|
|
376
383
|
}
|
|
377
384
|
onMouseMove(e) {
|
|
378
|
-
this.mouseEvent = e, this.mouseDown ? (this.dragging = !0, requestAnimationFrame(this.mouseDraggingOnFrame.bind(this))) : requestAnimationFrame(this.mouseMoveOnFrame.bind(this));
|
|
385
|
+
this.mouseEvent = e, this.mouseDown ? (this.dragging || (this.dragging = !0, this.tableScope.setDragging(!0)), requestAnimationFrame(this.mouseDraggingOnFrame.bind(this))) : requestAnimationFrame(this.mouseMoveOnFrame.bind(this));
|
|
379
386
|
}
|
|
380
387
|
onMouseUp(e) {
|
|
381
|
-
this.mouseEvent = e, this.dragging && requestAnimationFrame(this.mouseDraggingEndOnFrame.bind(this)), this.mouseDown = !1, this.dragging = !1;
|
|
388
|
+
this.mouseEvent = e, this.dragging && requestAnimationFrame(this.mouseDraggingEndOnFrame.bind(this)), this.mouseDown = !1, this.dragging = !1, this.tableScope.setDragging(!1);
|
|
382
389
|
}
|
|
383
390
|
mouseDraggingOnFrame() {
|
|
384
391
|
var e;
|
|
385
392
|
if (this.mouseEvent) {
|
|
386
393
|
const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
|
|
387
|
-
(e = this.startMouseEvent) != null && e.originalEvent && (t.draggingX = this.mouseEvent.clientX - this.startMouseEvent.originalEvent.clientX, t.draggingY = this.mouseEvent.clientY - this.startMouseEvent.originalEvent.clientY), this.tableScope.mouseDraggingOnFrame(t);
|
|
394
|
+
(e = this.startMouseEvent) != null && e.originalEvent && (t.draggingX = this.mouseEvent.clientX - this.startMouseEvent.originalEvent.clientX, t.draggingY = this.mouseEvent.clientY - this.startMouseEvent.originalEvent.clientY), this.tableScope.mouseDraggingOnFrame(t, this.startMouseEvent);
|
|
388
395
|
}
|
|
389
396
|
}
|
|
390
397
|
mouseDraggingEndOnFrame() {
|
|
@@ -401,7 +408,7 @@ class se {
|
|
|
401
408
|
}
|
|
402
409
|
}
|
|
403
410
|
}
|
|
404
|
-
class
|
|
411
|
+
class de {
|
|
405
412
|
constructor(e) {
|
|
406
413
|
this.tableScope = e;
|
|
407
414
|
}
|
|
@@ -507,36 +514,114 @@ class ie {
|
|
|
507
514
|
repaint() {
|
|
508
515
|
this.tableScope.repaint();
|
|
509
516
|
}
|
|
517
|
+
/**
|
|
518
|
+
* Repaints the table scope with hard repaint.
|
|
519
|
+
* Repaints the UI by resetting the size of the wrapper div,
|
|
520
|
+
* adjusting the containers and rows, and performing additional adjustments
|
|
521
|
+
* after scrolling.
|
|
522
|
+
*
|
|
523
|
+
* @return {void}
|
|
524
|
+
*/
|
|
525
|
+
repaintHard() {
|
|
526
|
+
this.tableScope.repaintHard();
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Clears the current selection of the table.
|
|
530
|
+
* The table will be rendered automatically.
|
|
531
|
+
*
|
|
532
|
+
* @returns {void}
|
|
533
|
+
*/
|
|
534
|
+
clearSelection() {
|
|
535
|
+
this.tableScope.clearSelection(!0);
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Sets the selection model for the table scope.
|
|
539
|
+
*
|
|
540
|
+
* @param {SelectionModel} sm - The selection model to be set.
|
|
541
|
+
* @param {boolean} [repaint=true] - Indicates whether the table should be repainted after setting the selection model. Default value is true.
|
|
542
|
+
*
|
|
543
|
+
* @return {void}
|
|
544
|
+
*/
|
|
545
|
+
setSelectionModel(e, t = !0) {
|
|
546
|
+
this.tableScope.setSelectionModel(e, t);
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Triggers the action with the given action ID.
|
|
550
|
+
* This function can be invoked programmatically.
|
|
551
|
+
*
|
|
552
|
+
* @param {ActionId} actionId - The ID of the action to trigger.
|
|
553
|
+
* @return {void}
|
|
554
|
+
*/
|
|
555
|
+
triggerAction(e) {
|
|
556
|
+
this.tableScope.onActionTriggered(e);
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Retrieves the mapping of shortcuts to corresponding action in the current table scope.
|
|
560
|
+
*
|
|
561
|
+
* @return {ShortcutActionIdMapping} The mapping of shortcuts to corresponding action.
|
|
562
|
+
*/
|
|
563
|
+
getShortcutActionMapping() {
|
|
564
|
+
return this.tableScope.shortcutService.getShortcutActionMapping();
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Copies the selected data from the table to the clipboard.
|
|
568
|
+
*
|
|
569
|
+
* @return {Promise<string>} - A promise that resolves with the copied data as a string.
|
|
570
|
+
*/
|
|
571
|
+
copyToClipboard() {
|
|
572
|
+
return this.tableScope.copyService.copyToClipboard(
|
|
573
|
+
this.tableScope.tableModel,
|
|
574
|
+
this.tableScope.selectionModel(),
|
|
575
|
+
this.tableScope.focusModel()
|
|
576
|
+
);
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Retrieves the current scope of the table.
|
|
580
|
+
*
|
|
581
|
+
* @returns {TableScope} The current scope of the table.
|
|
582
|
+
*/
|
|
583
|
+
getTableScope() {
|
|
584
|
+
return this.tableScope;
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Retrieves the selection model of the table.
|
|
588
|
+
*
|
|
589
|
+
* @return {SelectionModelIf | undefined} The selection model of the table,
|
|
590
|
+
* or undefined if no selection model is available.
|
|
591
|
+
*/
|
|
592
|
+
getSelectionModel() {
|
|
593
|
+
return this.tableScope.selectionModel();
|
|
594
|
+
}
|
|
510
595
|
}
|
|
511
|
-
class
|
|
596
|
+
class _ {
|
|
512
597
|
constructor(e) {
|
|
513
598
|
this.getStorageKeyFn = e;
|
|
514
599
|
}
|
|
515
600
|
autoConvertMapToObject(e) {
|
|
516
601
|
const t = {};
|
|
517
602
|
if (e instanceof Map) {
|
|
518
|
-
const
|
|
519
|
-
for (const
|
|
603
|
+
const o = e;
|
|
604
|
+
for (const s of [...o]) {
|
|
520
605
|
const [
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
] =
|
|
524
|
-
t[
|
|
606
|
+
i,
|
|
607
|
+
r
|
|
608
|
+
] = s;
|
|
609
|
+
t[i] = r;
|
|
525
610
|
}
|
|
526
611
|
}
|
|
527
612
|
return t;
|
|
528
613
|
}
|
|
529
614
|
checkAndPersistItem(e, t) {
|
|
530
|
-
const
|
|
531
|
-
if (
|
|
532
|
-
const
|
|
533
|
-
if (
|
|
534
|
-
const
|
|
615
|
+
const o = this.getStorageKeyFn;
|
|
616
|
+
if (o) {
|
|
617
|
+
const s = o();
|
|
618
|
+
if (s) {
|
|
619
|
+
const i = s + e;
|
|
535
620
|
if ((t + "").includes("Map")) {
|
|
536
|
-
const
|
|
537
|
-
this.persistItem(
|
|
621
|
+
const r = this.autoConvertMapToObject(t);
|
|
622
|
+
this.persistItem(i, r);
|
|
538
623
|
} else
|
|
539
|
-
this.persistItem(
|
|
624
|
+
this.persistItem(i, t);
|
|
540
625
|
}
|
|
541
626
|
}
|
|
542
627
|
}
|
|
@@ -583,7 +668,7 @@ class H {
|
|
|
583
668
|
// }
|
|
584
669
|
// }
|
|
585
670
|
}
|
|
586
|
-
class
|
|
671
|
+
class ce extends _ {
|
|
587
672
|
constructor(e) {
|
|
588
673
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
589
674
|
}
|
|
@@ -598,21 +683,21 @@ class oe extends H {
|
|
|
598
683
|
if (e) {
|
|
599
684
|
const t = e();
|
|
600
685
|
if (t) {
|
|
601
|
-
const
|
|
602
|
-
let
|
|
603
|
-
this.scrollOffset =
|
|
686
|
+
const o = t + this.SCROLL_STATE;
|
|
687
|
+
let s = this.loadFromLocalStorage(o);
|
|
688
|
+
this.scrollOffset = s || [0, 0];
|
|
604
689
|
}
|
|
605
690
|
}
|
|
606
691
|
}
|
|
607
692
|
}
|
|
608
|
-
class
|
|
609
|
-
constructor(e = "collapsed", t = [],
|
|
610
|
-
this.mode = e, this.rowIds = t, this.allCollapsed =
|
|
693
|
+
class he {
|
|
694
|
+
constructor(e = "collapsed", t = [], o = !1, s = !1) {
|
|
695
|
+
this.mode = e, this.rowIds = t, this.allCollapsed = o, this.allExpanded = s;
|
|
611
696
|
}
|
|
612
697
|
}
|
|
613
|
-
class
|
|
698
|
+
class ge extends _ {
|
|
614
699
|
constructor(e) {
|
|
615
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
700
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new he(), this.load();
|
|
616
701
|
}
|
|
617
702
|
collapsedExpandedStateGet() {
|
|
618
703
|
return this.collapsedExpandedState;
|
|
@@ -635,8 +720,8 @@ class re extends H {
|
|
|
635
720
|
if (e) {
|
|
636
721
|
const t = e();
|
|
637
722
|
if (t) {
|
|
638
|
-
const
|
|
639
|
-
|
|
723
|
+
const o = t + this.COLLAPSED_EXPANDED_STATE, s = this.loadFromLocalStorage(o);
|
|
724
|
+
s && (this.collapsedExpandedState = s);
|
|
640
725
|
}
|
|
641
726
|
}
|
|
642
727
|
}
|
|
@@ -644,7 +729,7 @@ class re extends H {
|
|
|
644
729
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
645
730
|
}
|
|
646
731
|
}
|
|
647
|
-
class
|
|
732
|
+
class pe extends _ {
|
|
648
733
|
constructor(e) {
|
|
649
734
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
650
735
|
}
|
|
@@ -659,95 +744,101 @@ class ne extends H {
|
|
|
659
744
|
if (e) {
|
|
660
745
|
const t = e();
|
|
661
746
|
if (t) {
|
|
662
|
-
const
|
|
663
|
-
|
|
664
|
-
this.sortItems = i || [];
|
|
747
|
+
const o = t + this.SORTING_STATE, s = this.loadFromLocalStorage(o);
|
|
748
|
+
this.sortItems = s || [];
|
|
665
749
|
}
|
|
666
750
|
}
|
|
667
751
|
}
|
|
668
752
|
}
|
|
669
753
|
class T {
|
|
670
|
-
constructor(e = 0, t = 0,
|
|
671
|
-
this.left = e, this.width = t, this.height =
|
|
754
|
+
constructor(e = 0, t = 0, o = 0, s = 0, i) {
|
|
755
|
+
this.left = e, this.width = t, this.height = o, this.top = s, this.index = i;
|
|
672
756
|
}
|
|
673
757
|
}
|
|
674
|
-
class
|
|
675
|
-
constructor(e, t,
|
|
676
|
-
this.hostElement = e, this.tableModel = t, this.dom =
|
|
677
|
-
const
|
|
678
|
-
|
|
679
|
-
this.dom.addClass("ge-table",
|
|
758
|
+
class be {
|
|
759
|
+
constructor(e, t, o, s) {
|
|
760
|
+
this.hostElement = e, this.tableModel = t, this.dom = o, this.tableOptions = s, this.scrollTop = 0, this.areaBodyWestGeo = new T(), this.areaBodyCenterGeo = new T(), this.areaBodyEastGeo = new T();
|
|
761
|
+
const i = this.hostElement;
|
|
762
|
+
i.innerText = "", this.dom.setAttribute(i, "tabindex", "0"), this.dom.setStyle(
|
|
763
|
+
this.dom.addClass("ge-table", i),
|
|
680
764
|
"position",
|
|
681
765
|
"relative"
|
|
682
|
-
), this.hoverRow =
|
|
683
|
-
|
|
684
|
-
), this.hoverColumn =
|
|
685
|
-
|
|
686
|
-
), this.
|
|
687
|
-
|
|
688
|
-
|
|
766
|
+
), this.hoverRow = o.applyStylePosistionAbsolute(
|
|
767
|
+
o.createDivWithClass("ge-table-hover-row", i)
|
|
768
|
+
), this.hoverColumn = o.applyStylePosistionAbsolute(
|
|
769
|
+
o.createDivWithClass("ge-table-hover-column", i)
|
|
770
|
+
), this.draggingColumn = o.applyStylePosistionAbsolute(
|
|
771
|
+
o.createDivWithClass("ge-table-dragging-column", i)
|
|
772
|
+
), this.areaHeaderWest = o.appendRelativeChildDiv(
|
|
773
|
+
o.applyStylePosistionAbsolute(
|
|
774
|
+
o.createAreaDivWithClass("ge-table-header ge-table-header-west", i, "header", "west")
|
|
689
775
|
)
|
|
690
|
-
), this.areaHeaderCenter =
|
|
691
|
-
|
|
692
|
-
|
|
776
|
+
), this.areaHeaderCenter = o.appendRelativeChildDiv(
|
|
777
|
+
o.applyStylePosistionAbsolute(
|
|
778
|
+
o.createAreaDivWithClass("ge-table-header ge-table-header-center", i, "header", "center")
|
|
693
779
|
)
|
|
694
|
-
), this.areaHeaderEast =
|
|
695
|
-
|
|
696
|
-
|
|
780
|
+
), this.areaHeaderEast = o.appendRelativeChildDiv(
|
|
781
|
+
o.applyStylePosistionAbsolute(
|
|
782
|
+
o.createAreaDivWithClass("ge-table-header ge-table-header-east", i, "body", "east")
|
|
697
783
|
)
|
|
698
|
-
), this.areaBodyWest =
|
|
699
|
-
|
|
700
|
-
|
|
784
|
+
), this.areaBodyWest = o.appendRelativeChildDiv(
|
|
785
|
+
o.applyStylePosistionAbsolute(
|
|
786
|
+
o.createAreaDivWithClass("ge-table-body ge-table-body-west", i, "body", "west")
|
|
701
787
|
)
|
|
702
|
-
), this.areaBodyEast =
|
|
703
|
-
|
|
704
|
-
|
|
788
|
+
), this.areaBodyEast = o.appendRelativeChildDiv(
|
|
789
|
+
o.applyStylePosistionAbsolute(
|
|
790
|
+
o.createAreaDivWithClass("ge-table-body ge-table-body-east", i, "body", "east")
|
|
705
791
|
)
|
|
706
|
-
), this.areaFooterWest =
|
|
707
|
-
|
|
708
|
-
|
|
792
|
+
), this.areaFooterWest = o.appendRelativeChildDiv(
|
|
793
|
+
o.applyStylePosistionAbsolute(
|
|
794
|
+
o.createAreaDivWithClass("ge-table-footer ge-table-footer-west", i, "footer", "west")
|
|
709
795
|
)
|
|
710
|
-
), this.areaFooterCenter =
|
|
711
|
-
|
|
712
|
-
|
|
796
|
+
), this.areaFooterCenter = o.appendRelativeChildDiv(
|
|
797
|
+
o.applyStylePosistionAbsolute(
|
|
798
|
+
o.createAreaDivWithClass("ge-table-footer ge-table-footer-center", i, "footer", "center")
|
|
713
799
|
)
|
|
714
|
-
), this.areaFooterEast =
|
|
715
|
-
|
|
716
|
-
|
|
800
|
+
), this.areaFooterEast = o.appendRelativeChildDiv(
|
|
801
|
+
o.applyStylePosistionAbsolute(
|
|
802
|
+
o.createAreaDivWithClass("ge-table-footer ge-table-footer-east", i, "footer", "east")
|
|
717
803
|
)
|
|
718
|
-
), this.scrollViewport =
|
|
804
|
+
), this.scrollViewport = o.applyStyleOverflowAuto(
|
|
719
805
|
this.tableOptions.overflowX ?? "auto",
|
|
720
806
|
this.tableOptions.overflowY ?? "auto",
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
807
|
+
o.applyStyleNoPadding(
|
|
808
|
+
o.applyStylePosistionAbsolute(
|
|
809
|
+
o.createAreaDivWithClass("ge-table-scroll-viewport", i, "body", "center")
|
|
724
810
|
)
|
|
725
811
|
)
|
|
726
|
-
), this.contentWrapperDiv =
|
|
727
|
-
|
|
728
|
-
|
|
812
|
+
), this.contentWrapperDiv = o.applyStyleNoPadding(
|
|
813
|
+
o.applyStylePosistionRelative(
|
|
814
|
+
o.createDivWithClass("ge-table-scroll-content-wrapper", this.scrollViewport)
|
|
729
815
|
)
|
|
730
|
-
), this.contentDiv =
|
|
731
|
-
|
|
732
|
-
|
|
816
|
+
), this.contentDiv = o.applyStyleNoPadding(
|
|
817
|
+
o.applyStylePosistionRelative(
|
|
818
|
+
o.createDivWithClass("ge-table-scroll-content", this.contentWrapperDiv)
|
|
733
819
|
)
|
|
734
|
-
), this.areaBodyCenter =
|
|
735
|
-
|
|
736
|
-
), this.borderHeaderBottom =
|
|
737
|
-
|
|
738
|
-
), this.borderFixedWest =
|
|
739
|
-
|
|
740
|
-
), this.borderFixedEast =
|
|
741
|
-
|
|
742
|
-
), this.borderFooterTop =
|
|
743
|
-
|
|
820
|
+
), this.areaBodyCenter = o.appendRelativeChildDiv(
|
|
821
|
+
o.createDivWithClass("ge-table-body-center", this.contentDiv)
|
|
822
|
+
), this.borderHeaderBottom = o.applyStylePosistionAbsolute(
|
|
823
|
+
o.createDivWithClass("ge-table-header-border", i)
|
|
824
|
+
), this.borderFixedWest = o.applyStylePosistionAbsolute(
|
|
825
|
+
o.createDivWithClass("ge-table-west-fixed-column-border", i)
|
|
826
|
+
), this.borderFixedEast = o.applyStylePosistionAbsolute(
|
|
827
|
+
o.createDivWithClass("ge-table-east-fixed-column-border", i)
|
|
828
|
+
), this.borderFooterTop = o.applyStylePosistionAbsolute(
|
|
829
|
+
o.createDivWithClass("ge-table-footer-border", i)
|
|
744
830
|
);
|
|
745
831
|
}
|
|
832
|
+
/**
|
|
833
|
+
* Adjusts the containers and rows of the table based on the current state.
|
|
834
|
+
*
|
|
835
|
+
* @return {void}
|
|
836
|
+
*/
|
|
746
837
|
adjustContainersAndRows() {
|
|
747
|
-
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth,
|
|
838
|
+
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth, o = this.hostElement.clientHeight;
|
|
748
839
|
this.dom.applyStyle(this.scrollViewport, {
|
|
749
840
|
width: `${t - e.left}px`,
|
|
750
|
-
height: `${
|
|
841
|
+
height: `${o - e.top}px`,
|
|
751
842
|
top: `${e.top}px`,
|
|
752
843
|
left: `${e.left}px`
|
|
753
844
|
}), this.scrollTop = this.scrollViewport.scrollTop, this.dom.applyStyle(this.contentDiv, {
|
|
@@ -755,21 +846,21 @@ class ae {
|
|
|
755
846
|
height: `${this.scrollViewport.clientHeight}px`,
|
|
756
847
|
top: `${this.scrollTop}px`,
|
|
757
848
|
left: `${this.scrollViewport.scrollLeft}px`
|
|
758
|
-
}), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height =
|
|
849
|
+
}), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height = o - e.top - e.bottom, this.areaBodyWestGeo.top = e.top, this.areaBodyWestGeo.left = 0, this.dom.applyStyleInPx(this.areaBodyWest.parent, this.areaBodyWestGeo), this.tableOptions.fixedWestSeparatorBorderVisible && this.tableModel.getFixedLeftColumnCount() ? this.dom.applyDisplayBlockStyle(
|
|
759
850
|
this.dom.applyStyle(this.borderFixedWest, {
|
|
760
851
|
width: "1px",
|
|
761
852
|
height: `${this.areaBodyWestGeo.height}px`,
|
|
762
853
|
top: `${this.areaBodyWestGeo.top}px`,
|
|
763
854
|
left: `${this.areaBodyWestGeo.width}px`
|
|
764
855
|
})
|
|
765
|
-
) : this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height =
|
|
856
|
+
) : this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height = o - e.top - e.bottom, this.areaBodyEastGeo.top = e.top, this.areaBodyEastGeo.left = t - e.right, this.dom.applyStyleInPx(this.areaBodyEast.parent, this.areaBodyEastGeo), this.tableOptions.fixedEastSeparatorBorderVisible && this.tableModel.getFixedLeftColumnCount() ? this.dom.applyDisplayBlockStyle(
|
|
766
857
|
this.dom.applyStyle(this.borderFixedEast, {
|
|
767
858
|
width: "1px",
|
|
768
859
|
height: `${this.areaBodyEastGeo.height}px`,
|
|
769
860
|
top: `${this.areaBodyEastGeo.top}px`,
|
|
770
861
|
left: `${this.areaBodyEastGeo.left}px`
|
|
771
862
|
})
|
|
772
|
-
) : this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = t - e.left - e.right, this.areaBodyCenterGeo.height =
|
|
863
|
+
) : this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = t - e.left - e.right, this.areaBodyCenterGeo.height = o - e.top - e.bottom, this.areaBodyCenterGeo.top = 0, this.areaBodyCenterGeo.left = 0, this.dom.applyStyleInPx(this.areaBodyCenter.parent, this.areaBodyCenterGeo), this.dom.applyStyle(this.areaHeaderCenter.parent, {
|
|
773
864
|
width: `${t - e.left - e.right}px`,
|
|
774
865
|
height: `${e.top}px`,
|
|
775
866
|
top: "0",
|
|
@@ -794,35 +885,48 @@ class ae {
|
|
|
794
885
|
) : this.dom.applyDisplayNoneStyle(this.borderHeaderBottom), this.dom.applyStyle(this.areaFooterWest.parent, {
|
|
795
886
|
width: `${e.left}px`,
|
|
796
887
|
height: `${e.bottom}px`,
|
|
797
|
-
top: `${
|
|
888
|
+
top: `${o - e.bottom}px`,
|
|
798
889
|
left: "0"
|
|
799
890
|
}), this.dom.applyStyle(this.areaFooterCenter.parent, {
|
|
800
891
|
width: `${t - e.left - e.right}px`,
|
|
801
892
|
height: `${e.bottom}px`,
|
|
802
|
-
top: `${
|
|
893
|
+
top: `${o - e.bottom}px`,
|
|
803
894
|
left: `${e.left}px`
|
|
804
895
|
}), this.dom.applyStyle(this.areaFooterEast.parent, {
|
|
805
896
|
width: `${e.right}px`,
|
|
806
897
|
height: `${e.bottom}px`,
|
|
807
|
-
top: `${
|
|
898
|
+
top: `${o - e.bottom}px`,
|
|
808
899
|
left: `${t - e.right}px`
|
|
809
900
|
}), this.tableOptions.footerSeparatorBorderVisible && this.tableModel.isFooterVisibe() ? this.dom.applyDisplayBlockStyle(
|
|
810
901
|
this.dom.applyStyle(this.borderFooterTop, {
|
|
811
902
|
width: `${t}px`,
|
|
812
903
|
height: "1px",
|
|
813
|
-
top: `${
|
|
904
|
+
top: `${o - e.bottom}px`,
|
|
814
905
|
left: "0px"
|
|
815
906
|
})
|
|
816
907
|
) : this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.adjustAfterScrolling();
|
|
817
908
|
}
|
|
909
|
+
/**
|
|
910
|
+
* Adjusts the position or appearance of elements after scrolling.
|
|
911
|
+
* This method must be overwritten in child classes.
|
|
912
|
+
*
|
|
913
|
+
* @return {void}
|
|
914
|
+
*/
|
|
818
915
|
adjustAfterScrolling() {
|
|
819
916
|
}
|
|
917
|
+
/**
|
|
918
|
+
* Resets the size of the wrapper div based on the content dimensions.
|
|
919
|
+
*
|
|
920
|
+
* @protected
|
|
921
|
+
*
|
|
922
|
+
* @returns {void} Returns nothing.
|
|
923
|
+
*/
|
|
820
924
|
resetSizeOfWrapperDiv() {
|
|
821
925
|
const e = `${this.tableModel.getContentWidthInPixel()}px`, t = `${this.tableModel.getContentHeightInPixel() + 1}px`;
|
|
822
926
|
this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", t);
|
|
823
927
|
}
|
|
824
928
|
}
|
|
825
|
-
class
|
|
929
|
+
class E {
|
|
826
930
|
/**
|
|
827
931
|
* Represents a constructor for a class.
|
|
828
932
|
* @constructor
|
|
@@ -832,11 +936,11 @@ class M {
|
|
|
832
936
|
* @param {number} c2 - The value for c2.
|
|
833
937
|
* @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
|
|
834
938
|
*/
|
|
835
|
-
constructor(e, t, s, i
|
|
836
|
-
this.r1 = e, this.c1 = t, this.r2 =
|
|
939
|
+
constructor(e, t, o, s, i = !1) {
|
|
940
|
+
this.r1 = e, this.c1 = t, this.r2 = o, this.c2 = s, this.gammaRange = i;
|
|
837
941
|
}
|
|
838
942
|
static create(e) {
|
|
839
|
-
return e.gammaRange === void 0 && (e.gammaRange = !1), new
|
|
943
|
+
return e.gammaRange === void 0 && (e.gammaRange = !1), new E(
|
|
840
944
|
e.rowIndex1,
|
|
841
945
|
e.columnIndex1,
|
|
842
946
|
e.rowIndex2,
|
|
@@ -845,19 +949,19 @@ class M {
|
|
|
845
949
|
);
|
|
846
950
|
}
|
|
847
951
|
static singleCell(e, t) {
|
|
848
|
-
return new
|
|
952
|
+
return new E(e, t, e, t);
|
|
849
953
|
}
|
|
850
954
|
static singleRow(e) {
|
|
851
|
-
return new
|
|
955
|
+
return new E(e, 0, e, Number.MAX_SAFE_INTEGER);
|
|
852
956
|
}
|
|
853
957
|
static singleColumn(e) {
|
|
854
|
-
return new
|
|
958
|
+
return new E(0, e, Number.MAX_SAFE_INTEGER, e);
|
|
855
959
|
}
|
|
856
960
|
isInRange(e, t) {
|
|
857
961
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
858
962
|
}
|
|
859
963
|
}
|
|
860
|
-
class
|
|
964
|
+
class ue {
|
|
861
965
|
constructor(e, t) {
|
|
862
966
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
863
967
|
}
|
|
@@ -866,14 +970,14 @@ class de {
|
|
|
866
970
|
return;
|
|
867
971
|
this.colAndRowspanRanges = [];
|
|
868
972
|
const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
|
|
869
|
-
for (let
|
|
870
|
-
for (let
|
|
871
|
-
let
|
|
872
|
-
if (
|
|
873
|
-
|
|
874
|
-
const
|
|
973
|
+
for (let o = 0; o < e; o++)
|
|
974
|
+
for (let s = 0; s < t; s++) {
|
|
975
|
+
let i = this.areaModel.getColspanAt(o, s), r = this.areaModel.getRowspanAt(o, s);
|
|
976
|
+
if (i > 1 || r > 1) {
|
|
977
|
+
i === 0 && (i = 1), r === 0 && (r = 1);
|
|
978
|
+
const a = "gammaCells" in this.areaModel;
|
|
875
979
|
this.colAndRowspanRanges.push(
|
|
876
|
-
new
|
|
980
|
+
new E(o, s, o + r - 1, s + i - 1, a)
|
|
877
981
|
);
|
|
878
982
|
}
|
|
879
983
|
}
|
|
@@ -883,58 +987,98 @@ class de {
|
|
|
883
987
|
}
|
|
884
988
|
isInRange(e, t) {
|
|
885
989
|
if (this.colAndRowspanRanges) {
|
|
886
|
-
for (const
|
|
887
|
-
if (
|
|
990
|
+
for (const o of this.colAndRowspanRanges)
|
|
991
|
+
if (o.isInRange(e, t))
|
|
888
992
|
return !0;
|
|
889
993
|
}
|
|
890
994
|
return !1;
|
|
891
995
|
}
|
|
892
996
|
}
|
|
893
|
-
class
|
|
894
|
-
constructor(e, t,
|
|
895
|
-
this.header = e, this.body = t, this.footer =
|
|
997
|
+
class Se {
|
|
998
|
+
constructor(e, t, o) {
|
|
999
|
+
this.header = e, this.body = t, this.footer = o;
|
|
896
1000
|
}
|
|
897
1001
|
}
|
|
898
|
-
class
|
|
899
|
-
constructor(e, t,
|
|
900
|
-
var
|
|
901
|
-
super(e, t,
|
|
1002
|
+
class fe extends be {
|
|
1003
|
+
constructor(e, t, o, s) {
|
|
1004
|
+
var r, a;
|
|
1005
|
+
super(e, t, o, s), this.dragging = !1, this.editing = !1, this.storedColumnWidths = [], this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
902
1006
|
header: [],
|
|
903
1007
|
body: [],
|
|
904
1008
|
footer: []
|
|
905
|
-
}, this.tree = !1, this.colAndRowspanModels = new
|
|
906
|
-
(
|
|
907
|
-
var
|
|
908
|
-
this.colAndRowspanModels[
|
|
1009
|
+
}, this.tree = !1, this.colAndRowspanModels = new Se(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (r = this.tableOptions) != null && r.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (a = this.tableOptions) != null && a.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), P(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
1010
|
+
(l) => {
|
|
1011
|
+
var n;
|
|
1012
|
+
this.colAndRowspanModels[l] = new ue(t, t.getAreaModel(l)), (n = this.colAndRowspanModels[l]) == null || n.init();
|
|
909
1013
|
}
|
|
910
1014
|
);
|
|
911
1015
|
}
|
|
912
1016
|
isEditing() {
|
|
913
1017
|
return this.editing;
|
|
914
1018
|
}
|
|
1019
|
+
/**
|
|
1020
|
+
* Resets the editor renderer by clearing its values and state.
|
|
1021
|
+
*
|
|
1022
|
+
* @function resetEditorRenderer
|
|
1023
|
+
* @memberof ClassName
|
|
1024
|
+
*
|
|
1025
|
+
* @returns {void}
|
|
1026
|
+
*/
|
|
915
1027
|
resetEditorRenderer() {
|
|
916
1028
|
this.editorRenderer = void 0, this.editorRendererRow = -1, this.editorRendererColumn = -1, this.editing = !1;
|
|
917
1029
|
}
|
|
918
|
-
|
|
1030
|
+
/**
|
|
1031
|
+
* Clears the selection in the component.
|
|
1032
|
+
*
|
|
1033
|
+
* @param {boolean} rerender - Indicates whether to rerender the component after clearing the selection. Default value is false.
|
|
1034
|
+
*
|
|
1035
|
+
* @return {void}
|
|
1036
|
+
*/
|
|
1037
|
+
clearSelection(e = !1) {
|
|
919
1038
|
if (this.getSelectionModel) {
|
|
920
|
-
const
|
|
921
|
-
|
|
1039
|
+
const t = this.getSelectionModel();
|
|
1040
|
+
t == null || t.clear(), e && this.repaint();
|
|
922
1041
|
}
|
|
923
1042
|
}
|
|
1043
|
+
/**
|
|
1044
|
+
* Initializes and renders the editor for a specified row and column index.
|
|
1045
|
+
*
|
|
1046
|
+
* @param {number} rowIdx - The index of the row.
|
|
1047
|
+
* @param {number} colIdx - The index of the column.
|
|
1048
|
+
*/
|
|
924
1049
|
initRenderEditor(e, t) {
|
|
925
|
-
var
|
|
926
|
-
let
|
|
927
|
-
if (
|
|
928
|
-
if (this.editorRenderer =
|
|
1050
|
+
var s;
|
|
1051
|
+
let o = (s = this.tableModel.getColumnDef(t)) == null ? void 0 : s.getEditRenderer;
|
|
1052
|
+
if (o || (o = this.tableOptions.getEditRenderer), o)
|
|
1053
|
+
if (this.editorRenderer = o(e, t), this.editorRenderer) {
|
|
929
1054
|
this.editorRendererRow = e, this.editorRendererColumn = t, this.editing = !0, this.repaint();
|
|
930
|
-
const
|
|
931
|
-
|
|
1055
|
+
const i = document.querySelector("input.ge-table-cell-editor-input");
|
|
1056
|
+
i && i.focus();
|
|
932
1057
|
} else
|
|
933
1058
|
this.resetEditorRenderer();
|
|
934
1059
|
}
|
|
1060
|
+
/**
|
|
1061
|
+
* Adjusts the content after scrolling and initiates a repaint of the component.
|
|
1062
|
+
*
|
|
1063
|
+
* @return {void}
|
|
1064
|
+
*/
|
|
935
1065
|
repaint() {
|
|
936
1066
|
this.adjustAfterScrolling();
|
|
937
1067
|
}
|
|
1068
|
+
/**
|
|
1069
|
+
* Repaints the UI by resetting the size of the wrapper div,
|
|
1070
|
+
* adjusting the containers and rows, and performing additional adjustments
|
|
1071
|
+
* after scrolling.
|
|
1072
|
+
*
|
|
1073
|
+
* @return {void} This method does not return any value.
|
|
1074
|
+
*/
|
|
1075
|
+
repaintHard() {
|
|
1076
|
+
this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.adjustAfterScrolling();
|
|
1077
|
+
}
|
|
1078
|
+
/**
|
|
1079
|
+
* Adjusts the table after scrolling. This method performs various adjustments
|
|
1080
|
+
* to the table's appearance and behavior after a scroll event occurs.
|
|
1081
|
+
*/
|
|
938
1082
|
adjustAfterScrolling() {
|
|
939
1083
|
var e;
|
|
940
1084
|
for (const t of this.removables)
|
|
@@ -957,25 +1101,86 @@ class ce extends ae {
|
|
|
957
1101
|
"ge-table-body-west-vertical-border"
|
|
958
1102
|
));
|
|
959
1103
|
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Checks if the scroll position should be saved and saves it.
|
|
1106
|
+
*
|
|
1107
|
+
* @return {void}
|
|
1108
|
+
*/
|
|
960
1109
|
checkForScrollPosSaving() {
|
|
961
1110
|
var e, t;
|
|
962
1111
|
this.storeScrollPosStateService && ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreScrollPosition) && this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
|
|
963
1112
|
}
|
|
1113
|
+
/**
|
|
1114
|
+
* Updates the cells in the table with the provided values and optionally repaints all cells.
|
|
1115
|
+
*
|
|
1116
|
+
* @param {TableCellUpdateEventIf[]} events - The array of events containing information about the cells to update.
|
|
1117
|
+
* @param {boolean} repaintAll - Optional. If true, repaints all cells after updating. Defaults to false.
|
|
1118
|
+
*
|
|
1119
|
+
* @returns {void}
|
|
1120
|
+
*/
|
|
964
1121
|
updateCells(e, t = !1) {
|
|
965
1122
|
e.forEach(
|
|
966
|
-
(
|
|
967
|
-
this.tableModel.getAreaModel(
|
|
1123
|
+
(o) => {
|
|
1124
|
+
this.tableModel.getAreaModel(o.area).setValue(o.rowIndex, o.columnIndex, o.value), t || this.rerenderCellContent(o);
|
|
968
1125
|
}
|
|
969
1126
|
), t && this.repaint();
|
|
970
1127
|
}
|
|
1128
|
+
/**
|
|
1129
|
+
* Rerenders the content of a table cell based on the given parameters.
|
|
1130
|
+
*
|
|
1131
|
+
* @param {TableCellUpdateEventIf} area - The area of the table.
|
|
1132
|
+
* @param {number} rowIndex - The index of the row.
|
|
1133
|
+
* @param {number} columnIndex - The index of the column.
|
|
1134
|
+
* @param {any} value - The new value to be displayed in the cell.
|
|
1135
|
+
* @param {string[]} cssClasses - An array of CSS classes to be applied to the cell.
|
|
1136
|
+
*/
|
|
1137
|
+
rerenderCellContent({ area: e, rowIndex: t, columnIndex: o, value: s, cssClasses: i }) {
|
|
1138
|
+
const r = this.tableModel.getAreaModel(e), a = 'div[data-col-index="' + o + '"][data-row-index="' + t + '"][data-area="' + e + '"]', l = document.querySelector(a);
|
|
1139
|
+
if (l) {
|
|
1140
|
+
let n;
|
|
1141
|
+
const h = this.editorRenderer && this.editorRendererRow === t && this.editorRendererColumn === o ? this.editorRenderer : r.getCellRenderer(t, o);
|
|
1142
|
+
if (l.innerText = "", this.applyCssClasses(l, i), h)
|
|
1143
|
+
n = h.render(l, t, o, e, r, s, this.dom.domService), n && this.cleanupFunctions[e].push(n);
|
|
1144
|
+
else {
|
|
1145
|
+
const S = `${s}`;
|
|
1146
|
+
this.dom.addLabelDiv(l, S, !1, t, o, e);
|
|
1147
|
+
}
|
|
1148
|
+
const g = r.getCustomClassesAt(t, o);
|
|
1149
|
+
g.length && this.dom.addClasses(g, l);
|
|
1150
|
+
const f = r.getCustomStyleAt(t, o);
|
|
1151
|
+
if (f)
|
|
1152
|
+
for (const S in f)
|
|
1153
|
+
this.dom.setStyle(l, S, f[S]);
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* Stores the widths of all columns in the table.
|
|
1158
|
+
*
|
|
1159
|
+
* @protected
|
|
1160
|
+
* @function storeColumnWidths
|
|
1161
|
+
* @returns {void}
|
|
1162
|
+
*/
|
|
1163
|
+
storeColumnWidths() {
|
|
1164
|
+
const e = this.tableModel.getColumnDefs();
|
|
1165
|
+
e != null && e.length && (this.storedColumnWidths = e.map((t, o) => this.tableModel.getColumnWidth(o)));
|
|
1166
|
+
}
|
|
971
1167
|
getAreaAndSideIdentByAttr(e) {
|
|
972
1168
|
if (e) {
|
|
973
|
-
const t = this.getStringByAttr(e, "data-area"),
|
|
974
|
-
if (
|
|
975
|
-
return [t,
|
|
1169
|
+
const t = this.getStringByAttr(e, "data-area"), o = this.getStringByAttr(e, "data-side");
|
|
1170
|
+
if (o && t)
|
|
1171
|
+
return [t, o];
|
|
976
1172
|
}
|
|
977
1173
|
return [void 0, void 0];
|
|
978
1174
|
}
|
|
1175
|
+
/**
|
|
1176
|
+
* Retrieves the specified area from the grid layout.
|
|
1177
|
+
*
|
|
1178
|
+
* @param {string} areaIdent - The identifier for the area ('header', 'body', or 'footer').
|
|
1179
|
+
* @param {string} sideIdent - The identifier for the side of the area ('west', 'center', or 'east').
|
|
1180
|
+
* @protected
|
|
1181
|
+
* @returns {HTMLElement} - The requested area element.
|
|
1182
|
+
* @throws {Error} - If the area identifier or side identifier is incorrect.
|
|
1183
|
+
*/
|
|
979
1184
|
getArea(e, t) {
|
|
980
1185
|
if (e === "header") {
|
|
981
1186
|
if (t === "west")
|
|
@@ -1001,110 +1206,140 @@ class ce extends ae {
|
|
|
1001
1206
|
}
|
|
1002
1207
|
throw Error(`Wrong area identifier: row:${e}, col:${t}`);
|
|
1003
1208
|
}
|
|
1209
|
+
/**
|
|
1210
|
+
* Adjusts the body of the table.
|
|
1211
|
+
*
|
|
1212
|
+
* @protected
|
|
1213
|
+
* @return {void}
|
|
1214
|
+
*/
|
|
1004
1215
|
adjustBody() {
|
|
1005
1216
|
const e = this.areaBodyCenterGeo.height - this.tableModel.getContentHeightInPixel(), t = this.scrollFactorY * e;
|
|
1006
1217
|
this.dom.setStyle(this.contentDiv, "top", `${this.scrollTop}px`), this.dom.setStyle(this.contentDiv, "left", `${this.scrollViewport.scrollLeft}px`), this.adjustArea("body", t);
|
|
1007
1218
|
}
|
|
1219
|
+
/**
|
|
1220
|
+
* Returns a number value extracted from the specified attribute of the source element.
|
|
1221
|
+
*
|
|
1222
|
+
* @param {HTMLElement} srcElement - The source element from which to extract the attribute value.
|
|
1223
|
+
* @param {string} key - The attribute key to extract the value from.
|
|
1224
|
+
* @returns {number} - The extracted number value, or -1 if the attribute was not found or not a valid number.
|
|
1225
|
+
* @protected
|
|
1226
|
+
*/
|
|
1008
1227
|
getNumberByAttr(e, t) {
|
|
1009
|
-
var
|
|
1228
|
+
var o;
|
|
1010
1229
|
if (e) {
|
|
1011
|
-
const
|
|
1012
|
-
if (
|
|
1013
|
-
return Number(
|
|
1230
|
+
const s = (o = e.closest("[" + t + "]")) == null ? void 0 : o.getAttribute(t);
|
|
1231
|
+
if (s)
|
|
1232
|
+
return Number(s);
|
|
1014
1233
|
}
|
|
1015
1234
|
return -1;
|
|
1016
1235
|
}
|
|
1236
|
+
/**
|
|
1237
|
+
* Retrieves the value of the specified attribute from the nearest ancestor element that has the attribute.
|
|
1238
|
+
*
|
|
1239
|
+
* @param {HTMLElement} srcElement - The source element from which to start searching for the nearest ancestor element.
|
|
1240
|
+
* @param {string} key - The name of the attribute to retrieve.
|
|
1241
|
+
* @returns {string} The value of the specified attribute, or an empty string if the attribute is not found.
|
|
1242
|
+
* @protected
|
|
1243
|
+
*/
|
|
1017
1244
|
getStringByAttr(e, t) {
|
|
1018
|
-
var
|
|
1245
|
+
var o;
|
|
1019
1246
|
if (e) {
|
|
1020
|
-
const
|
|
1021
|
-
if (
|
|
1022
|
-
return
|
|
1247
|
+
const s = (o = e.closest("[" + t + "]")) == null ? void 0 : o.getAttribute(t);
|
|
1248
|
+
if (s)
|
|
1249
|
+
return s;
|
|
1023
1250
|
}
|
|
1024
1251
|
return "";
|
|
1025
1252
|
}
|
|
1253
|
+
/**
|
|
1254
|
+
* Adjusts the layout and positioning of the specified area in the table.
|
|
1255
|
+
* This method is used internally and should not be called directly.
|
|
1256
|
+
*
|
|
1257
|
+
* @param {AreaIdent} areaIdent - The identifier of the area to adjust (e.g. header, body, footer).
|
|
1258
|
+
* @param {number} [yStart=0] - The starting y-position for the layout adjustments.
|
|
1259
|
+
* @protected
|
|
1260
|
+
*/
|
|
1026
1261
|
adjustArea(e, t = 0) {
|
|
1027
|
-
var
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1030
|
-
const
|
|
1262
|
+
var b;
|
|
1263
|
+
const o = this.getArea(e, "west"), s = this.getArea(e, "center"), i = this.getArea(e, "east"), r = s.child.clientHeight;
|
|
1264
|
+
o.child.innerText = "", s.child.innerText = "", i.child.innerText = "";
|
|
1265
|
+
const a = 0, l = this.areaBodyCenterGeo.width, n = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), h = d.getRowCount();
|
|
1031
1266
|
for (; this.cleanupFunctions[e].length; ) {
|
|
1032
1267
|
const p = this.cleanupFunctions[e].shift();
|
|
1033
1268
|
p && p();
|
|
1034
1269
|
}
|
|
1035
1270
|
let g = t;
|
|
1036
|
-
const
|
|
1037
|
-
for (let p = 0; p <
|
|
1038
|
-
const
|
|
1039
|
-
if (
|
|
1271
|
+
const f = this.tableModel.getColumnCount(), S = this.tableModel.getFixedRightColumnCount(), u = this.tableModel.getFixedLeftColumnCount();
|
|
1272
|
+
for (let p = 0; p < h; p++) {
|
|
1273
|
+
const v = g, w = p === h - 1, x = this.tableModel.getRowHeight(e, p);
|
|
1274
|
+
if (v + x > 0) {
|
|
1040
1275
|
this.firstVisibleRowIndex = p;
|
|
1041
|
-
let y = { left:
|
|
1042
|
-
const
|
|
1276
|
+
let y = { left: a, width: l, height: x, top: v, index: p }, m = this.dom.addRowDiv(s, y, p, e, "center");
|
|
1277
|
+
const R = u;
|
|
1043
1278
|
if (this.adjustColumnsToRowParent({
|
|
1044
1279
|
areaIdent: e,
|
|
1045
1280
|
sideIdent: "center",
|
|
1046
1281
|
areaModel: d,
|
|
1047
1282
|
geo: y,
|
|
1048
|
-
parent:
|
|
1283
|
+
parent: m,
|
|
1049
1284
|
rowIndex: p,
|
|
1050
|
-
columnIndexStart:
|
|
1051
|
-
columnIndexEnd:
|
|
1285
|
+
columnIndexStart: R,
|
|
1286
|
+
columnIndexEnd: f - S - 1,
|
|
1052
1287
|
verticalFixed: !1,
|
|
1053
|
-
lastRowOfModel:
|
|
1054
|
-
}),
|
|
1288
|
+
lastRowOfModel: w
|
|
1289
|
+
}), n.left > 0 && (y = { left: a, width: this.areaBodyWestGeo.width, height: x, top: v, index: p }, m = this.dom.addRowDiv(o, y, p, e, "west"), this.adjustColumnsToRowParent({
|
|
1055
1290
|
areaIdent: e,
|
|
1056
1291
|
sideIdent: "west",
|
|
1057
1292
|
areaModel: d,
|
|
1058
1293
|
geo: y,
|
|
1059
|
-
parent:
|
|
1294
|
+
parent: m,
|
|
1060
1295
|
rowIndex: p,
|
|
1061
1296
|
columnIndexStart: 0,
|
|
1062
|
-
columnIndexEnd:
|
|
1297
|
+
columnIndexEnd: R - 1,
|
|
1063
1298
|
verticalFixed: !0,
|
|
1064
|
-
lastRowOfModel:
|
|
1065
|
-
})),
|
|
1299
|
+
lastRowOfModel: w
|
|
1300
|
+
})), n.right > 0 && (y = { left: a, width: this.areaBodyEastGeo.width, height: x, top: v, index: p }, m = this.dom.addRowDiv(i, y, p, e, "east"), this.adjustColumnsToRowParent({
|
|
1066
1301
|
areaIdent: e,
|
|
1067
1302
|
sideIdent: "east",
|
|
1068
1303
|
areaModel: d,
|
|
1069
1304
|
geo: y,
|
|
1070
|
-
parent:
|
|
1305
|
+
parent: m,
|
|
1071
1306
|
rowIndex: p,
|
|
1072
|
-
columnIndexStart:
|
|
1073
|
-
columnIndexEnd:
|
|
1307
|
+
columnIndexStart: f - S,
|
|
1308
|
+
columnIndexEnd: f - 1,
|
|
1074
1309
|
verticalFixed: !0,
|
|
1075
|
-
lastRowOfModel:
|
|
1076
|
-
})), e === "header" && this.tree && p ===
|
|
1310
|
+
lastRowOfModel: w
|
|
1311
|
+
})), e === "header" && this.tree && p === h - 1) {
|
|
1077
1312
|
const A = this.dom.applyStyle(
|
|
1078
1313
|
this.dom.setAttribute(
|
|
1079
|
-
this.dom.addDiv(
|
|
1314
|
+
this.dom.addDiv(m, new T(16, 20, 20, 8)),
|
|
1080
1315
|
"data-ge-action",
|
|
1081
1316
|
"toggleExpandCollapseAll"
|
|
1082
1317
|
),
|
|
1083
1318
|
{ cursor: "pointer" }
|
|
1084
|
-
),
|
|
1085
|
-
if (
|
|
1086
|
-
const F = this.dom.domService.createText(
|
|
1087
|
-
this.dom.domService.appendChild(A, F),
|
|
1319
|
+
), M = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1320
|
+
if (M) {
|
|
1321
|
+
const F = this.dom.domService.createText(M.content);
|
|
1322
|
+
this.dom.domService.appendChild(A, F), M.style && this.dom.applyStyleString(A, M.style);
|
|
1088
1323
|
}
|
|
1089
1324
|
}
|
|
1090
1325
|
}
|
|
1091
|
-
if (g = g + x, g >
|
|
1326
|
+
if (g = g + x, g > r)
|
|
1092
1327
|
break;
|
|
1093
1328
|
}
|
|
1094
1329
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1095
|
-
const p = ((
|
|
1330
|
+
const p = ((b = this.colAndRowspanModels[e]) == null ? void 0 : b.getRanges()) ?? [];
|
|
1096
1331
|
if (p.length)
|
|
1097
|
-
for (const
|
|
1098
|
-
let
|
|
1099
|
-
if (
|
|
1100
|
-
x =
|
|
1101
|
-
else if (
|
|
1102
|
-
x =
|
|
1332
|
+
for (const v of p) {
|
|
1333
|
+
let w = 0, x = s.child, y = "center";
|
|
1334
|
+
if (v.c1 < u)
|
|
1335
|
+
x = o.child, y = "west";
|
|
1336
|
+
else if (S > 0 && v.c1 >= f - S)
|
|
1337
|
+
x = i.child, y = "east";
|
|
1103
1338
|
else {
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1339
|
+
const m = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1340
|
+
w = this.scrollFactorX * m - this.areaBodyWestGeo.width, y = "center";
|
|
1106
1341
|
}
|
|
1107
|
-
this.drawBigCell(
|
|
1342
|
+
this.drawBigCell(v, w, t, d, x, y);
|
|
1108
1343
|
}
|
|
1109
1344
|
}
|
|
1110
1345
|
}
|
|
@@ -1118,328 +1353,536 @@ class ce extends ae {
|
|
|
1118
1353
|
* @param sideIdent SideIdent (west,center,east)
|
|
1119
1354
|
* @protected
|
|
1120
1355
|
*/
|
|
1121
|
-
drawBigCell(e, t, s, i,
|
|
1122
|
-
const
|
|
1356
|
+
drawBigCell(e, t, o, s, i, r) {
|
|
1357
|
+
const a = o + this.getRowHeights(0, e.r1 - 1, s).reduce((b, p) => b + p, 0), l = this.tableModel.getColumnCount(), n = this.tableModel.getFixedRightColumnCount();
|
|
1123
1358
|
let d = 0;
|
|
1124
|
-
|
|
1125
|
-
const
|
|
1126
|
-
let
|
|
1127
|
-
const
|
|
1128
|
-
|
|
1129
|
-
areaModel:
|
|
1130
|
-
areaIdent:
|
|
1131
|
-
sideIdent:
|
|
1359
|
+
n > 0 && e.c1 >= l - n && (d = l - n);
|
|
1360
|
+
const h = t + this.getColumnWidths(d, e.c1 - 1).reduce((b, p) => b + p, 0), g = this.getRowHeights(e.r1, e.r2, s).reduce((b, p) => b + p, 0), f = this.getColumnWidths(e.c1, e.c2).reduce((b, p) => b + p, 0);
|
|
1361
|
+
let S = !1;
|
|
1362
|
+
const u = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
1363
|
+
u && (S = u.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? this.renderCell({
|
|
1364
|
+
areaModel: s,
|
|
1365
|
+
areaIdent: s.areaIdent,
|
|
1366
|
+
sideIdent: r,
|
|
1132
1367
|
rowIndex: e.r1,
|
|
1133
1368
|
columnIndex: e.c1,
|
|
1134
|
-
left:
|
|
1135
|
-
top:
|
|
1136
|
-
width:
|
|
1369
|
+
left: h,
|
|
1370
|
+
top: a,
|
|
1371
|
+
width: f,
|
|
1137
1372
|
height: g,
|
|
1138
|
-
parent:
|
|
1139
|
-
cellSelected:
|
|
1373
|
+
parent: i,
|
|
1374
|
+
cellSelected: S,
|
|
1140
1375
|
lastRowOfModel: !0,
|
|
1141
1376
|
gammaRange: e.gammaRange
|
|
1142
|
-
})
|
|
1143
|
-
areaModel:
|
|
1144
|
-
areaIdent:
|
|
1145
|
-
sideIdent:
|
|
1377
|
+
}) : this.renderCell({
|
|
1378
|
+
areaModel: s,
|
|
1379
|
+
areaIdent: s.areaIdent,
|
|
1380
|
+
sideIdent: r,
|
|
1146
1381
|
rowIndex: e.r1,
|
|
1147
1382
|
columnIndex: e.c1,
|
|
1148
|
-
left:
|
|
1149
|
-
top:
|
|
1150
|
-
width:
|
|
1383
|
+
left: h,
|
|
1384
|
+
top: a,
|
|
1385
|
+
width: f,
|
|
1151
1386
|
height: g,
|
|
1152
|
-
parent:
|
|
1153
|
-
cellSelected:
|
|
1387
|
+
parent: i,
|
|
1388
|
+
cellSelected: S,
|
|
1154
1389
|
lastRowOfModel: !0,
|
|
1155
1390
|
gammaRange: e.gammaRange
|
|
1156
|
-
}),
|
|
1391
|
+
}), s.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1157
1392
|
rowIndex: e.r1,
|
|
1158
1393
|
columnIndex: e.c1,
|
|
1159
|
-
cellLeft:
|
|
1160
|
-
cellTop:
|
|
1161
|
-
cellWidth:
|
|
1394
|
+
cellLeft: h,
|
|
1395
|
+
cellTop: a,
|
|
1396
|
+
cellWidth: f,
|
|
1162
1397
|
cellHeight: g,
|
|
1163
|
-
parent:
|
|
1398
|
+
parent: i
|
|
1164
1399
|
});
|
|
1165
1400
|
}
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1401
|
+
/**
|
|
1402
|
+
* Finds the row index of an important rowspan cell in a given area model.
|
|
1403
|
+
*
|
|
1404
|
+
* @param {AreaModelIf} areaModel - The area model to search in.
|
|
1405
|
+
* @param {number} rowIndex - The current row index.
|
|
1406
|
+
* @param {number} colIndex - The current column index.
|
|
1407
|
+
* @returns {number} - The row index of the important rowspan cell, or -1 if not found.
|
|
1408
|
+
* @protected
|
|
1409
|
+
*/
|
|
1410
|
+
findRowOfImportantRowspanCell(e, t, o) {
|
|
1411
|
+
const s = e.getMaxRowspan();
|
|
1412
|
+
for (let i = t - 1; i > -1; i--) {
|
|
1413
|
+
const r = e.getRowspanAt(i, o);
|
|
1414
|
+
if (r > 1 && i + r + 1 >= t)
|
|
1415
|
+
return i;
|
|
1416
|
+
if (t - i > s)
|
|
1173
1417
|
return -1;
|
|
1174
1418
|
}
|
|
1175
1419
|
return -1;
|
|
1176
1420
|
}
|
|
1421
|
+
/**
|
|
1422
|
+
* Adjusts the columns to fit the width of the row's parent element.
|
|
1423
|
+
*
|
|
1424
|
+
* @param {ArgsAdjustColumnsToRowParentParams} params - The parameters for adjusting the columns.
|
|
1425
|
+
* @protected
|
|
1426
|
+
* @return {void}
|
|
1427
|
+
*/
|
|
1177
1428
|
adjustColumnsToRowParent({
|
|
1178
1429
|
areaIdent: e,
|
|
1179
1430
|
sideIdent: t,
|
|
1180
|
-
areaModel:
|
|
1181
|
-
geo:
|
|
1182
|
-
parent:
|
|
1183
|
-
rowIndex:
|
|
1184
|
-
columnIndexStart:
|
|
1185
|
-
columnIndexEnd:
|
|
1186
|
-
verticalFixed:
|
|
1431
|
+
areaModel: o,
|
|
1432
|
+
geo: s,
|
|
1433
|
+
parent: i,
|
|
1434
|
+
rowIndex: r,
|
|
1435
|
+
columnIndexStart: a,
|
|
1436
|
+
columnIndexEnd: l,
|
|
1437
|
+
verticalFixed: n = !1,
|
|
1187
1438
|
lastRowOfModel: d = !1
|
|
1188
1439
|
}) {
|
|
1189
|
-
var
|
|
1440
|
+
var u;
|
|
1190
1441
|
this.scrollViewportLeft = this.scrollViewport.scrollLeft;
|
|
1191
|
-
let
|
|
1192
|
-
if (!
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1442
|
+
let h = 0;
|
|
1443
|
+
if (!n) {
|
|
1444
|
+
const b = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1445
|
+
h = this.scrollFactorX * b;
|
|
1195
1446
|
}
|
|
1196
|
-
const g = 0,
|
|
1197
|
-
let
|
|
1198
|
-
for (let
|
|
1199
|
-
const p =
|
|
1200
|
-
if (
|
|
1201
|
-
let
|
|
1202
|
-
const x =
|
|
1203
|
-
x > 1 && (
|
|
1204
|
-
let
|
|
1205
|
-
y > 1 && (
|
|
1206
|
-
let
|
|
1207
|
-
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (
|
|
1208
|
-
this.renderDragTargetDiv(
|
|
1209
|
-
const A = { left: p, top: g, width:
|
|
1210
|
-
this.dom.addColumnBorderDivs(this.tableOptions,
|
|
1447
|
+
const g = 0, f = !!(e === "body" && t);
|
|
1448
|
+
let S = h;
|
|
1449
|
+
for (let b = a; b <= l; b++) {
|
|
1450
|
+
const p = S, v = this.tableModel.getColumnWidth(b);
|
|
1451
|
+
if (v > 0 && p + v > 0) {
|
|
1452
|
+
let w = s.height;
|
|
1453
|
+
const x = o.getRowspanAt(r, b), y = o.getColspanAt(r, b);
|
|
1454
|
+
x > 1 && (w = this.getRowHeights(r, r + x - 1, o).reduce((A, M) => A + M, 0));
|
|
1455
|
+
let m = v;
|
|
1456
|
+
y > 1 && (m = this.getColumnWidths(b, b + y - 1).reduce((A, M) => A + M, 0));
|
|
1457
|
+
let R = !1;
|
|
1458
|
+
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (u = this.colAndRowspanModels[e]) != null && u.isInRange(r, b) && (R = !0), this.draggingTargetColumnIndex === b && e !== "header") {
|
|
1459
|
+
this.renderDragTargetDiv(i, p, g, m, w);
|
|
1460
|
+
const A = { left: p, top: g, width: m, height: w };
|
|
1461
|
+
this.dom.addColumnBorderDivs(this.tableOptions, i, A, e, t);
|
|
1211
1462
|
} else {
|
|
1212
|
-
const A = this.renderSelectedBackgroundDiv(
|
|
1213
|
-
|
|
1214
|
-
areaModel:
|
|
1463
|
+
const A = this.renderSelectedBackgroundDiv(R, f, t, o, r, b, i, p, g, m, w);
|
|
1464
|
+
"gammaCells" in o && o.getValueAt(r, b) && (R = !1), R || this.renderCell({
|
|
1465
|
+
areaModel: o,
|
|
1215
1466
|
areaIdent: e,
|
|
1216
1467
|
sideIdent: t,
|
|
1217
|
-
rowIndex:
|
|
1218
|
-
columnIndex:
|
|
1468
|
+
rowIndex: r,
|
|
1469
|
+
columnIndex: b,
|
|
1219
1470
|
left: p,
|
|
1220
1471
|
top: g,
|
|
1221
|
-
width:
|
|
1222
|
-
height:
|
|
1223
|
-
parent:
|
|
1472
|
+
width: m,
|
|
1473
|
+
height: w,
|
|
1474
|
+
parent: i,
|
|
1224
1475
|
cellSelected: A,
|
|
1225
1476
|
lastRowOfModel: d,
|
|
1226
1477
|
gammaRange: !0
|
|
1227
1478
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1228
|
-
rowIndex:
|
|
1229
|
-
columnIndex:
|
|
1479
|
+
rowIndex: r,
|
|
1480
|
+
columnIndex: b,
|
|
1230
1481
|
cellLeft: p,
|
|
1231
1482
|
cellTop: g,
|
|
1232
|
-
cellWidth:
|
|
1233
|
-
cellHeight:
|
|
1234
|
-
parent:
|
|
1483
|
+
cellWidth: m,
|
|
1484
|
+
cellHeight: w,
|
|
1485
|
+
parent: i
|
|
1235
1486
|
});
|
|
1236
1487
|
}
|
|
1237
1488
|
}
|
|
1238
|
-
if (
|
|
1489
|
+
if (S = S + v, S > this.areaBodyCenterGeo.width)
|
|
1239
1490
|
break;
|
|
1240
1491
|
}
|
|
1241
|
-
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(
|
|
1492
|
+
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(S - 1, 1, s.height, 0), i);
|
|
1242
1493
|
}
|
|
1494
|
+
/**
|
|
1495
|
+
* Retrieves the column index of the tree arrow column in the table.
|
|
1496
|
+
*
|
|
1497
|
+
* @protected
|
|
1498
|
+
*
|
|
1499
|
+
* @returns {0 | 1} The column index of the tree arrow column.
|
|
1500
|
+
* Returns 0 if the checkbox is not visible,
|
|
1501
|
+
* otherwise returns 1.
|
|
1502
|
+
*/
|
|
1243
1503
|
getTreeArrowColumnIndex() {
|
|
1244
1504
|
return this.tableOptions.showCheckboxWihoutExtraColumn ? 0 : this.tableModel.isRowCheckboxVisible() ? 1 : 0;
|
|
1245
1505
|
}
|
|
1246
1506
|
addAndRenderCellDiv({
|
|
1247
1507
|
areaModel: e,
|
|
1248
1508
|
areaIdent: t,
|
|
1249
|
-
sideIdent:
|
|
1250
|
-
rowIndex:
|
|
1251
|
-
index:
|
|
1252
|
-
left:
|
|
1253
|
-
width:
|
|
1254
|
-
height:
|
|
1255
|
-
top:
|
|
1509
|
+
sideIdent: o,
|
|
1510
|
+
rowIndex: s,
|
|
1511
|
+
index: i,
|
|
1512
|
+
left: r,
|
|
1513
|
+
width: a,
|
|
1514
|
+
height: l,
|
|
1515
|
+
top: n,
|
|
1256
1516
|
parent: d,
|
|
1257
|
-
lastRowOfModel:
|
|
1258
|
-
gammaRange: g
|
|
1517
|
+
lastRowOfModel: h
|
|
1259
1518
|
}) {
|
|
1260
|
-
var
|
|
1261
|
-
const
|
|
1262
|
-
let
|
|
1263
|
-
if (
|
|
1264
|
-
const
|
|
1265
|
-
(
|
|
1519
|
+
var N;
|
|
1520
|
+
const f = this.editorRenderer && this.editorRendererRow === s && this.editorRendererColumn === i ? this.editorRenderer : e.getCellRenderer(s, i), S = { left: r, width: a, height: l, top: n, index: i }, u = e.getRowByIndex(s);
|
|
1521
|
+
let b = "none";
|
|
1522
|
+
if (i === this.getTreeArrowColumnIndex() && H(u)) {
|
|
1523
|
+
const C = u;
|
|
1524
|
+
(N = C.children) != null && N.length ? C.expanded ? b = "expanded" : b = "collapsed" : b = "hidden";
|
|
1266
1525
|
}
|
|
1267
|
-
let
|
|
1526
|
+
let v;
|
|
1268
1527
|
if (t === "header") {
|
|
1269
|
-
const
|
|
1270
|
-
(!(
|
|
1528
|
+
const C = this.tableModel.getColumnDef(i);
|
|
1529
|
+
(!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (v = C == null ? void 0 : C.sortState);
|
|
1271
1530
|
}
|
|
1272
|
-
const
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
R &&
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1531
|
+
const w = e.getValueAt(s, i), x = f ? "" : `${w}`, y = e.isRowChecked(s), m = this.dom.addColumnDiv(
|
|
1532
|
+
{
|
|
1533
|
+
parent: d,
|
|
1534
|
+
geo: S,
|
|
1535
|
+
rowIndex: s,
|
|
1536
|
+
columnIndex: i,
|
|
1537
|
+
areaIdent: t,
|
|
1538
|
+
sideIdent: o,
|
|
1539
|
+
text: x,
|
|
1540
|
+
treeArrow: b,
|
|
1541
|
+
tableOptions: this.tableOptions,
|
|
1542
|
+
checkedType: y,
|
|
1543
|
+
sortState: v
|
|
1544
|
+
}
|
|
1545
|
+
), R = e.getTooltipAt(s, i);
|
|
1546
|
+
R && this.dom.setAttribute(m, "title", R);
|
|
1547
|
+
const A = this.tableModel.getColumnDef(i);
|
|
1548
|
+
A && A.classes[t] && this.dom.addClasses(A.classes[t], m);
|
|
1549
|
+
let M;
|
|
1550
|
+
f && (M = f.render(m, s, i, t, e, w, this.dom.domService));
|
|
1551
|
+
const F = e.getCustomClassesAt(s, i);
|
|
1552
|
+
if (F.length && this.dom.addClasses(F, m), this.dom.addColumnBorderDivs(this.tableOptions, d, S, t, o), h && this.dom.addHorizontalBorder({ left: r, width: a, height: l, top: n + l }, d), this.getFocusModel && t === "body") {
|
|
1553
|
+
const C = this.getFocusModel();
|
|
1554
|
+
C != null && C.hasFocus(s, i) && this.dom.addFocusBorderDivs(d, S, {});
|
|
1294
1555
|
}
|
|
1295
|
-
t === "header" && this.dom.setAttribute(
|
|
1296
|
-
const
|
|
1297
|
-
if (
|
|
1298
|
-
for (const
|
|
1299
|
-
this.dom.setStyle(
|
|
1300
|
-
return [
|
|
1556
|
+
t === "header" && this.dom.setAttribute(m, "data-ge-action", "drag-column");
|
|
1557
|
+
const B = e.getCustomStyleAt(s, i);
|
|
1558
|
+
if (B)
|
|
1559
|
+
for (const C in B)
|
|
1560
|
+
this.dom.setStyle(m, C, B[C]);
|
|
1561
|
+
return [m, M];
|
|
1301
1562
|
}
|
|
1563
|
+
/**
|
|
1564
|
+
* Applies CSS classes to an HTML element.
|
|
1565
|
+
*
|
|
1566
|
+
* @param {HTMLDivElement} ele - The HTML element to which CSS classes will be applied.
|
|
1567
|
+
* @param {Object.<string, boolean>} cssClasses - An object containing CSS class names as keys and boolean values indicating whether to apply or remove the class.
|
|
1568
|
+
* @protected
|
|
1569
|
+
*/
|
|
1302
1570
|
applyCssClasses(e, t = {}) {
|
|
1303
|
-
e && Object.entries(t).forEach(([
|
|
1304
|
-
|
|
1571
|
+
e && Object.entries(t).forEach(([o, s]) => {
|
|
1572
|
+
s ? this.dom.addClass(o, e) : this.dom.removeClass(o, e);
|
|
1305
1573
|
});
|
|
1306
1574
|
}
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
const c = `${i}`;
|
|
1316
|
-
this.dom.addLabelDiv(r, c, !1, t, s, e);
|
|
1317
|
-
}
|
|
1318
|
-
const g = l.getCustomClassesAt(t, s);
|
|
1319
|
-
g.length && this.dom.addClasses(g, r);
|
|
1320
|
-
const m = l.getCustomStyleAt(t, s);
|
|
1321
|
-
if (m)
|
|
1322
|
-
for (const c in m)
|
|
1323
|
-
this.dom.setStyle(r, c, m[c]);
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1575
|
+
/**
|
|
1576
|
+
* Retrieves the column widths of a table within a specified range.
|
|
1577
|
+
*
|
|
1578
|
+
* @param {number} startIndex - The index of the first column to retrieve the width of.
|
|
1579
|
+
* @param {number} endIndex - The index of the last column to retrieve the width of.
|
|
1580
|
+
*
|
|
1581
|
+
* @return {number[]} An array containing the widths of the columns within the specified range.
|
|
1582
|
+
*/
|
|
1326
1583
|
getColumnWidths(e, t) {
|
|
1584
|
+
const o = [];
|
|
1585
|
+
for (let s = e; s <= t; s++)
|
|
1586
|
+
o.push(this.tableModel.getColumnWidth(s));
|
|
1587
|
+
return o;
|
|
1588
|
+
}
|
|
1589
|
+
/**
|
|
1590
|
+
* Retrieves the heights of rows within a specified range.
|
|
1591
|
+
*
|
|
1592
|
+
* @param {number} startIndex - The index of the first row in the range.
|
|
1593
|
+
* @param {number} endIndex - The index of the last row in the range.
|
|
1594
|
+
* @param {AreaModelIf} areaModel - The area model.
|
|
1595
|
+
* @return {number[]} - An array containing the heights of the rows within the specified range.
|
|
1596
|
+
*/
|
|
1597
|
+
getRowHeights(e, t, o) {
|
|
1327
1598
|
const s = [];
|
|
1328
1599
|
for (let i = e; i <= t; i++)
|
|
1329
|
-
s.push(
|
|
1600
|
+
s.push(o.getRowHeight(i));
|
|
1330
1601
|
return s;
|
|
1331
1602
|
}
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1603
|
+
/**
|
|
1604
|
+
* Adjusts the position and size of the hover row based on the mouse move event.
|
|
1605
|
+
*
|
|
1606
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event.
|
|
1607
|
+
*
|
|
1608
|
+
* @return {void}
|
|
1609
|
+
*/
|
|
1338
1610
|
adjustHoverRows(e) {
|
|
1339
1611
|
if (this.tableOptions.hoverRowVisible && e.rowIndex > -1) {
|
|
1340
|
-
const t = this.hostElement.clientWidth,
|
|
1612
|
+
const t = this.hostElement.clientWidth, o = this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex), s = e.rowTop + this.areaHeaderCenter.parent.clientHeight - this.scrollTop;
|
|
1341
1613
|
this.dom.applyStyle(this.hoverRow, {
|
|
1342
1614
|
left: "0",
|
|
1343
|
-
top:
|
|
1615
|
+
top: s + "px",
|
|
1344
1616
|
width: t + "px",
|
|
1345
|
-
height:
|
|
1617
|
+
height: o + "px",
|
|
1346
1618
|
display: "block"
|
|
1347
1619
|
});
|
|
1348
1620
|
} else
|
|
1349
1621
|
this.hideHoverRow();
|
|
1350
1622
|
}
|
|
1623
|
+
/**
|
|
1624
|
+
* Hides the hover row by applying 'display: none' style to it.
|
|
1625
|
+
*
|
|
1626
|
+
* @protected
|
|
1627
|
+
* @function
|
|
1628
|
+
* @name hideHoverRow
|
|
1629
|
+
* @memberof ClassName
|
|
1630
|
+
*
|
|
1631
|
+
* @returns {void}
|
|
1632
|
+
*/
|
|
1351
1633
|
hideHoverRow() {
|
|
1352
1634
|
this.dom.applyStyle(this.hoverRow, {
|
|
1353
1635
|
display: "none"
|
|
1354
1636
|
});
|
|
1355
1637
|
}
|
|
1638
|
+
/**
|
|
1639
|
+
* Adjusts the position and size of the hover column based on the mouse move event.
|
|
1640
|
+
*
|
|
1641
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event object.
|
|
1642
|
+
*/
|
|
1356
1643
|
adjustHoverColumns(e) {
|
|
1357
1644
|
if (this.tableOptions.hoverColumnVisible && e.rowIndex > -1) {
|
|
1358
|
-
const t = this.hostElement.clientHeight,
|
|
1645
|
+
const t = this.hostElement.clientHeight, o = this.tableModel.getColumnWidth(e.columnIndex), s = this.areaBodyWestGeo.width, i = e.columnLeft + this.tableModel.getPadding().left - this.scrollLeft - s;
|
|
1359
1646
|
this.dom.applyStyle(this.hoverColumn, {
|
|
1360
|
-
left:
|
|
1647
|
+
left: i + "px",
|
|
1361
1648
|
top: "0px",
|
|
1362
|
-
width:
|
|
1649
|
+
width: o + "px",
|
|
1363
1650
|
height: t + "px",
|
|
1364
1651
|
display: "block"
|
|
1365
1652
|
});
|
|
1366
1653
|
} else
|
|
1367
1654
|
this.hideHoverColumn();
|
|
1368
1655
|
}
|
|
1656
|
+
/**
|
|
1657
|
+
* Hide hover column.
|
|
1658
|
+
*
|
|
1659
|
+
* This method hides the hover column by applying a style of 'display: none'
|
|
1660
|
+
* to the element representing the hover column.
|
|
1661
|
+
*
|
|
1662
|
+
* @protected
|
|
1663
|
+
* @memberof ClassName
|
|
1664
|
+
*/
|
|
1369
1665
|
hideHoverColumn() {
|
|
1370
1666
|
this.dom.applyStyle(this.hoverColumn, {
|
|
1371
1667
|
display: "none"
|
|
1372
1668
|
});
|
|
1373
1669
|
}
|
|
1670
|
+
/**
|
|
1671
|
+
* Executes a function after a specified delay, ensuring that the function is called only once within that delay period.
|
|
1672
|
+
*
|
|
1673
|
+
* @param {() => void} fn - The function to be executed.
|
|
1674
|
+
* @param {number} [delay=1000] - The delay in milliseconds before executing the function.
|
|
1675
|
+
*
|
|
1676
|
+
* @return {undefined}
|
|
1677
|
+
*/
|
|
1374
1678
|
debounce(e, t = 1e3) {
|
|
1375
1679
|
this.debounceTimeout && clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(e.bind(this), t);
|
|
1376
1680
|
}
|
|
1377
|
-
|
|
1378
|
-
|
|
1681
|
+
/**
|
|
1682
|
+
* Adjusts the dragging column during a mouse move event.
|
|
1683
|
+
*
|
|
1684
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event.
|
|
1685
|
+
* @param {number} sourceColumnIndex - The index of the source column.
|
|
1686
|
+
* @param {boolean} firstDraggingRendering - Indicates if it's the first rendering of the dragging column.
|
|
1687
|
+
*/
|
|
1688
|
+
adjustDraggingColumn(e, t, o) {
|
|
1689
|
+
var s, i;
|
|
1690
|
+
if (this.dragging) {
|
|
1691
|
+
const r = this.hostElement.clientHeight, a = this.storedColumnWidths[t];
|
|
1692
|
+
if ((s = e.originalEvent) != null && s.clientX) {
|
|
1693
|
+
const d = { left: ((i = e.originalEvent) == null ? void 0 : i.clientX) - a / 2, width: a, height: r, top: 0, index: t };
|
|
1694
|
+
this.dom.applyStyle(this.draggingColumn, {
|
|
1695
|
+
background: "rgba(128,128,128,0.2)",
|
|
1696
|
+
display: "block",
|
|
1697
|
+
overfllow: "clip"
|
|
1698
|
+
}), this.dom.applyStyleInPx(this.draggingColumn, d), o && this.renderContentOfDraggingColumn(d);
|
|
1699
|
+
}
|
|
1700
|
+
} else
|
|
1701
|
+
this.hideDraggingColumn();
|
|
1702
|
+
}
|
|
1703
|
+
/**
|
|
1704
|
+
* Renders the content of a dragging column.
|
|
1705
|
+
*
|
|
1706
|
+
* @param {GeoData} columnGeo - The geographic data of the column.
|
|
1707
|
+
*
|
|
1708
|
+
* @returns {number} The y-coordinate of the rendered content.
|
|
1709
|
+
*/
|
|
1710
|
+
renderContentOfDraggingColumn(e) {
|
|
1711
|
+
const t = this.renderContentOfDraggingColumnForArea(e, "header", 0);
|
|
1712
|
+
this.renderContentOfDraggingColumnForArea(e, "body", t);
|
|
1713
|
+
}
|
|
1714
|
+
/**
|
|
1715
|
+
* Renders the content of the dragging column for a specific area.
|
|
1716
|
+
*
|
|
1717
|
+
* @param {GeoData} columnGeo - The geometry data of the dragging column.
|
|
1718
|
+
* @param {AreaIdent} areaIdent - The identifier of the area.
|
|
1719
|
+
* @param {number} [y=0] - The starting y-position.
|
|
1720
|
+
* @return {number} The final y-position after rendering all the content.
|
|
1721
|
+
*/
|
|
1722
|
+
renderContentOfDraggingColumnForArea(e, t, o = 0) {
|
|
1723
|
+
const s = "center", i = this.tableModel.getAreaModel(t), r = i == null ? void 0 : i.getRowCount();
|
|
1724
|
+
if (r) {
|
|
1725
|
+
const a = e.index ?? 0, l = this.draggingColumn;
|
|
1726
|
+
for (let n = 0; n < r; n++) {
|
|
1727
|
+
const d = o, h = i.getRowHeight(n), g = { left: 0, width: e.width, height: h, top: d, index: n }, f = i.getValueAt(n, a), S = i.getCellRenderer(n, a), u = S ? "" : `${f}`, b = {
|
|
1728
|
+
parent: l,
|
|
1729
|
+
geo: g,
|
|
1730
|
+
rowIndex: n,
|
|
1731
|
+
columnIndex: a,
|
|
1732
|
+
areaIdent: t,
|
|
1733
|
+
sideIdent: s,
|
|
1734
|
+
text: u
|
|
1735
|
+
}, p = this.dom.addColumnDiv(b);
|
|
1736
|
+
let v;
|
|
1737
|
+
S && (v = S.render(p, n, a, t, i, f, this.dom.domService), v && this.cleanupFunctions[t].push(v));
|
|
1738
|
+
const w = i.getCustomClassesAt(n, a);
|
|
1739
|
+
w.length && this.dom.addClasses(w, p);
|
|
1740
|
+
const x = this.tableModel.getColumnDef(a);
|
|
1741
|
+
x && x.classes[t] && this.dom.addClasses(x.classes[t], p), this.dom.addColumnBorderDivs(this.tableOptions, l, g, t, s);
|
|
1742
|
+
const y = i.getCustomStyleAt(n, a);
|
|
1743
|
+
if (y)
|
|
1744
|
+
for (const m in y)
|
|
1745
|
+
this.dom.setStyle(p, m, y[m]);
|
|
1746
|
+
o = o + h;
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
return o;
|
|
1750
|
+
}
|
|
1751
|
+
/**
|
|
1752
|
+
* Hides the dragging column by applying a 'display: none' style to it.
|
|
1753
|
+
* This method is protected and can only be accessed within the class.
|
|
1754
|
+
*
|
|
1755
|
+
* @return {void}
|
|
1756
|
+
*/
|
|
1757
|
+
hideDraggingColumn() {
|
|
1758
|
+
this.dom.applyStyle(this.draggingColumn, {
|
|
1759
|
+
display: "none"
|
|
1760
|
+
});
|
|
1761
|
+
}
|
|
1762
|
+
/**
|
|
1763
|
+
* Renders a draggable target div element.
|
|
1764
|
+
*
|
|
1765
|
+
* @param {HTMLDivElement} parent - The parent element where the target div will be appended to.
|
|
1766
|
+
* @param {number} left - The left position of the target div in pixels.
|
|
1767
|
+
* @param {number} top - The top position of the target div in pixels.
|
|
1768
|
+
* @param {number} width - The width of the target div in pixels.
|
|
1769
|
+
* @param {number} height - The height of the target div in pixels.
|
|
1770
|
+
* @return {HTMLDivElement} - The rendered draggable target div element.
|
|
1771
|
+
*/
|
|
1772
|
+
renderDragTargetDiv(e, t, o, s, i) {
|
|
1773
|
+
const r = this.dom.applyStylePosistionAbsolute(
|
|
1379
1774
|
this.dom.createDivWithClass("ge-table-drop-zone", e)
|
|
1380
1775
|
);
|
|
1381
|
-
return this.dom.setStyle(
|
|
1776
|
+
return this.dom.setStyle(r, "left", `${t}px`), this.dom.setStyle(r, "top", `${o}px`), this.dom.setStyle(r, "width", `${s}px`), this.dom.setStyle(r, "height", `${i}px`), r;
|
|
1382
1777
|
}
|
|
1383
|
-
|
|
1778
|
+
/**
|
|
1779
|
+
* Render selected background div.
|
|
1780
|
+
*
|
|
1781
|
+
* @private
|
|
1782
|
+
* @param {boolean} skip - Whether to skip rendering.
|
|
1783
|
+
* @param {boolean} renderSelection - Whether to render the selection.
|
|
1784
|
+
* @param {SideIdent} sideIdent - The side identifier.
|
|
1785
|
+
* @param {AreaModelIf} areaModel - The area model.
|
|
1786
|
+
* @param {number} rowIndex - The row index.
|
|
1787
|
+
* @param {number} index - The index.
|
|
1788
|
+
* @param {HTMLDivElement} parent - The parent div element.
|
|
1789
|
+
* @param {number} left - The left position.
|
|
1790
|
+
* @param {number} top - The top position.
|
|
1791
|
+
* @param {number} width - The width of the div.
|
|
1792
|
+
* @param {number} height - The height of the div.
|
|
1793
|
+
* @returns {boolean} - Whether the cell is selected.
|
|
1794
|
+
*/
|
|
1795
|
+
renderSelectedBackgroundDiv(e, t, o, s, i, r, a, l, n, d, h) {
|
|
1384
1796
|
let g = !1;
|
|
1385
|
-
if (!e && t &&
|
|
1386
|
-
const
|
|
1387
|
-
if (
|
|
1388
|
-
const
|
|
1389
|
-
g =
|
|
1390
|
-
for (let
|
|
1391
|
-
const
|
|
1797
|
+
if (!e && t && s.isSelectable(i, r) && this.getSelectionModel) {
|
|
1798
|
+
const f = this.getSelectionModel();
|
|
1799
|
+
if (f) {
|
|
1800
|
+
const S = f.getSelectionCount(i, r);
|
|
1801
|
+
g = S > 0;
|
|
1802
|
+
for (let u = 0; u < S; u++) {
|
|
1803
|
+
const b = this.dom.applyStylePosistionAbsolute(
|
|
1392
1804
|
// ge-table-body-west-selected-range
|
|
1393
|
-
this.dom.createDivWithClass(`ge-table-${
|
|
1805
|
+
this.dom.createDivWithClass(`ge-table-${s.areaIdent}-${o}-selected-range`, a)
|
|
1394
1806
|
);
|
|
1395
|
-
this.dom.setStyle(
|
|
1807
|
+
this.dom.setStyle(b, "left", `${l}px`), this.dom.setStyle(b, "top", `${n}px`), this.dom.setStyle(b, "width", `${d}px`), this.dom.setStyle(b, "height", `${h}px`);
|
|
1396
1808
|
}
|
|
1397
1809
|
}
|
|
1398
1810
|
}
|
|
1399
1811
|
return g;
|
|
1400
1812
|
}
|
|
1813
|
+
/**
|
|
1814
|
+
* Renders a cell in the grid.
|
|
1815
|
+
*
|
|
1816
|
+
* @param {ArgsRenderCell} args - The arguments for rendering the cell.
|
|
1817
|
+
* @param {AreaModel} args.areaModel - The area model of the grid.
|
|
1818
|
+
* @param {string} args.areaIdent - The identifier of the area.
|
|
1819
|
+
* @param {string} args.sideIdent - The identifier of the side.
|
|
1820
|
+
* @param {number} args.rowIndex - The index of the row.
|
|
1821
|
+
* @param {number} args.columnIndex - The index of the column.
|
|
1822
|
+
* @param {number} args.left - The left position of the cell.
|
|
1823
|
+
* @param {number} args.top - The top position of the cell.
|
|
1824
|
+
* @param {number} args.width - The width of the cell.
|
|
1825
|
+
* @param {number} args.height - The height of the cell.
|
|
1826
|
+
* @param {HTMLElement} args.parent - The parent element of the cell.
|
|
1827
|
+
* @param {boolean} args.cellSelected - Indicates if the cell is selected.
|
|
1828
|
+
* @param {boolean} args.lastRowOfModel - Indicates if the cell is in the last row of the model.
|
|
1829
|
+
*
|
|
1830
|
+
* @returns {void}
|
|
1831
|
+
*/
|
|
1401
1832
|
renderCell({
|
|
1402
1833
|
areaModel: e,
|
|
1403
1834
|
areaIdent: t,
|
|
1404
|
-
sideIdent:
|
|
1405
|
-
rowIndex:
|
|
1406
|
-
columnIndex:
|
|
1407
|
-
left:
|
|
1408
|
-
top:
|
|
1409
|
-
width:
|
|
1410
|
-
height:
|
|
1835
|
+
sideIdent: o,
|
|
1836
|
+
rowIndex: s,
|
|
1837
|
+
columnIndex: i,
|
|
1838
|
+
left: r,
|
|
1839
|
+
top: a,
|
|
1840
|
+
width: l,
|
|
1841
|
+
height: n,
|
|
1411
1842
|
parent: d,
|
|
1412
|
-
cellSelected:
|
|
1413
|
-
lastRowOfModel: g
|
|
1414
|
-
gammaRange: m
|
|
1843
|
+
cellSelected: h,
|
|
1844
|
+
lastRowOfModel: g
|
|
1415
1845
|
}) {
|
|
1416
|
-
const [
|
|
1846
|
+
const [f, S] = this.addAndRenderCellDiv({
|
|
1417
1847
|
areaModel: e,
|
|
1418
1848
|
areaIdent: t,
|
|
1419
|
-
sideIdent:
|
|
1420
|
-
rowIndex:
|
|
1421
|
-
index:
|
|
1422
|
-
left:
|
|
1423
|
-
width:
|
|
1424
|
-
height:
|
|
1425
|
-
top:
|
|
1849
|
+
sideIdent: o,
|
|
1850
|
+
rowIndex: s,
|
|
1851
|
+
index: i,
|
|
1852
|
+
left: r,
|
|
1853
|
+
width: l,
|
|
1854
|
+
height: n,
|
|
1855
|
+
top: a,
|
|
1426
1856
|
parent: d,
|
|
1427
|
-
lastRowOfModel: g
|
|
1428
|
-
gammaRange: m
|
|
1857
|
+
lastRowOfModel: g
|
|
1429
1858
|
});
|
|
1430
|
-
|
|
1859
|
+
h && this.dom.addClass(`ge-table-${t}-${o}-selected-range`, f), S && this.cleanupFunctions[t].push(S);
|
|
1431
1860
|
}
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1861
|
+
/**
|
|
1862
|
+
* Render the header cell resize handle.
|
|
1863
|
+
*
|
|
1864
|
+
* @param {ArgsRenderHeaderCellResizeHandle} args - The arguments for rendering the handle.
|
|
1865
|
+
* @param {number} args.rowIndex - The index of the row.
|
|
1866
|
+
* @param {number} args.columnIndex - The index of the column.
|
|
1867
|
+
* @param {number} args.cellLeft - The left position of the cell.
|
|
1868
|
+
* @param {number} args.cellTop - The top position of the cell.
|
|
1869
|
+
* @param {number} args.cellWidth - The width of the cell.
|
|
1870
|
+
* @param {number} args.cellHeight - The height of the cell.
|
|
1871
|
+
* @param {HTMLElement} args.parent - The parent element to append the handle to.
|
|
1872
|
+
*
|
|
1873
|
+
* @return {void}
|
|
1874
|
+
*/
|
|
1875
|
+
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: o, cellTop: s, cellWidth: i, cellHeight: r, parent: a }) {
|
|
1876
|
+
const l = this.dom.domService, n = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = l.createElement("div");
|
|
1877
|
+
l.setAttribute(d, "data-col-index", `${t}`), l.setAttribute(d, "data-row-index", `${e}`), l.setAttribute(d, "data-area", "header"), l.setAttribute(d, "data-ge-action", "resize-column"), l.addClass(d, "ge-table-column-resize-handle"), l.setStyle(d, "display", "clip"), l.setStyle(d, "position", "absolute"), l.setStyle(d, "cursor", "col-resize"), l.setStyle(d, "left", `${o + i - n}px`), l.setStyle(d, "top", `${s}px`), l.setStyle(d, "width", `${n}px`), l.setStyle(d, "height", `${r}px`), l.appendChild(a, d);
|
|
1435
1878
|
}
|
|
1436
1879
|
}
|
|
1437
|
-
class
|
|
1880
|
+
class me {
|
|
1438
1881
|
constructor(e, t) {
|
|
1439
1882
|
this.columnIndex = e, this.sortState = t;
|
|
1440
1883
|
}
|
|
1441
1884
|
}
|
|
1442
|
-
class
|
|
1885
|
+
class ye {
|
|
1443
1886
|
constructor(e) {
|
|
1444
1887
|
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
1445
1888
|
}
|
|
@@ -1453,52 +1896,52 @@ class ue {
|
|
|
1453
1896
|
*/
|
|
1454
1897
|
onHostElementChanged(e) {
|
|
1455
1898
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1456
|
-
const t = e.target,
|
|
1457
|
-
if (
|
|
1458
|
-
const
|
|
1459
|
-
this.tableScope.updateModelValueAfterEdit(
|
|
1899
|
+
const t = e.target, o = t.getAttribute("data-area"), s = t.getAttribute("data-row-index"), i = t.getAttribute("data-col-index");
|
|
1900
|
+
if (o && s && i) {
|
|
1901
|
+
const r = G(o), a = Number(s), l = Number(i);
|
|
1902
|
+
this.tableScope.updateModelValueAfterEdit(r, a, l, t.value);
|
|
1460
1903
|
}
|
|
1461
1904
|
}
|
|
1462
1905
|
}
|
|
1463
1906
|
}
|
|
1464
|
-
class
|
|
1907
|
+
class ve {
|
|
1465
1908
|
constructor(e = -1, t = -1) {
|
|
1466
1909
|
this.rowIndex = e, this.columnIndex = t;
|
|
1467
1910
|
}
|
|
1468
1911
|
}
|
|
1469
|
-
class
|
|
1912
|
+
class V {
|
|
1470
1913
|
constructor(e) {
|
|
1471
1914
|
this.cells = e;
|
|
1472
1915
|
}
|
|
1473
1916
|
static createSingle(e, t) {
|
|
1474
|
-
return new
|
|
1917
|
+
return new V([new ve(e, t)]);
|
|
1475
1918
|
}
|
|
1476
1919
|
}
|
|
1477
|
-
class
|
|
1920
|
+
class we {
|
|
1478
1921
|
constructor(e) {
|
|
1479
|
-
var t,
|
|
1480
|
-
this.tableScope = e, (t = this.tableScope.tableOptions) != null && t.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), (
|
|
1922
|
+
var t, o;
|
|
1923
|
+
this.tableScope = e, (t = this.tableScope.tableOptions) != null && t.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), (o = this.tableScope.tableOptions) != null && o.getFocusModel && (this.getFocusModel = this.tableScope.tableOptions.getFocusModel);
|
|
1481
1924
|
}
|
|
1482
1925
|
onMouseClicked(e, t) {
|
|
1483
|
-
var
|
|
1484
|
-
let
|
|
1926
|
+
var i, r, a, l, n, d, h;
|
|
1927
|
+
let o = !1, s = !1;
|
|
1485
1928
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1486
|
-
const g = this.getSelectionModel(),
|
|
1487
|
-
g &&
|
|
1929
|
+
const g = this.getSelectionModel(), f = this.getFocusModel();
|
|
1930
|
+
g && f && (f.hasFocus(e.rowIndex, e.columnIndex) || (f.setFocus(e.rowIndex, e.columnIndex), this.tableScope.onFocusChanged(f), o = !0), (i = e.originalEvent) != null && i.shiftKey || g.hasSelection() && (g.clear(), o = !0), (r = e.originalEvent) != null && r.shiftKey && this.previousEvt ? (g.addSelection(this.createRangeByEvents(e, this.previousEvt)), s = !0, o = !0) : (a = e.originalEvent) != null && a.altKey && ((l = e.originalEvent) != null && l.ctrlKey || (n = e.originalEvent) != null && n.metaKey) ? (g.removeSelection(E.singleCell(e.rowIndex, e.columnIndex)), s = !0, o = !0) : (d = e.originalEvent) != null && d.ctrlKey || (h = e.originalEvent) != null && h.metaKey ? (g.addSelection(E.singleCell(e.rowIndex, e.columnIndex)), s = !0, o = !0) : (g.firstClick(e.rowIndex, e.columnIndex), o = !0), this.tableScope.onSelectionChanged(g));
|
|
1488
1931
|
}
|
|
1489
|
-
return
|
|
1932
|
+
return s ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), o;
|
|
1490
1933
|
}
|
|
1491
1934
|
onActionTriggered(e) {
|
|
1492
1935
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1493
|
-
const t = this.getSelectionModel(),
|
|
1494
|
-
if (t &&
|
|
1936
|
+
const t = this.getSelectionModel(), o = this.getFocusModel();
|
|
1937
|
+
if (t && o) {
|
|
1495
1938
|
if (e === "SELECT_ALL")
|
|
1496
1939
|
return t.selectAll(), this.tableScope.repaint(), !0;
|
|
1497
1940
|
if (e === "DESELECT_ALL")
|
|
1498
1941
|
return t.clear(), this.tableScope.repaint(), !0;
|
|
1499
1942
|
if (e === "TOGGLE_SELECTION") {
|
|
1500
|
-
const [
|
|
1501
|
-
return t.togglePoint(
|
|
1943
|
+
const [s, i] = o.getFocus();
|
|
1944
|
+
return t.togglePoint(s, i), this.tableScope.repaint(), !0;
|
|
1502
1945
|
}
|
|
1503
1946
|
}
|
|
1504
1947
|
}
|
|
@@ -1506,16 +1949,16 @@ class ge {
|
|
|
1506
1949
|
}
|
|
1507
1950
|
createRangeByEvents(e, t) {
|
|
1508
1951
|
t || (t = e);
|
|
1509
|
-
const
|
|
1510
|
-
return
|
|
1511
|
-
rowIndex1:
|
|
1512
|
-
columnIndex1:
|
|
1513
|
-
rowIndex2:
|
|
1514
|
-
columnIndex2:
|
|
1952
|
+
const o = Math.min(e.rowIndex, t == null ? void 0 : t.rowIndex), s = Math.max(e.rowIndex, t == null ? void 0 : t.rowIndex), i = Math.min(e.columnIndex, t == null ? void 0 : t.columnIndex), r = Math.max(e.columnIndex, t == null ? void 0 : t.columnIndex);
|
|
1953
|
+
return E.create({
|
|
1954
|
+
rowIndex1: o,
|
|
1955
|
+
columnIndex1: i,
|
|
1956
|
+
rowIndex2: s,
|
|
1957
|
+
columnIndex2: r
|
|
1515
1958
|
});
|
|
1516
1959
|
}
|
|
1517
1960
|
}
|
|
1518
|
-
class
|
|
1961
|
+
class Ce {
|
|
1519
1962
|
get() {
|
|
1520
1963
|
return {
|
|
1521
1964
|
f2: "START_EDITING",
|
|
@@ -1525,43 +1968,60 @@ class me {
|
|
|
1525
1968
|
"ctrl+shift+a": "DESELECT_ALL",
|
|
1526
1969
|
"ctrl+x": "DESELECT_ALL",
|
|
1527
1970
|
"ctrl+num_subtract": "DESELECT_ALL",
|
|
1528
|
-
"
|
|
1971
|
+
"meta -": "DESELECT_ALL",
|
|
1529
1972
|
arrowup: "NAVIGATE_UP",
|
|
1530
1973
|
arrowdown: "NAVIGATE_DOWN",
|
|
1531
1974
|
arrowleft: "NAVIGATE_LEFT",
|
|
1532
|
-
arrowright: "NAVIGATE_RIGHT"
|
|
1975
|
+
arrowright: "NAVIGATE_RIGHT",
|
|
1976
|
+
"meta+c": "COPY_2_CLIPBOARD",
|
|
1977
|
+
"ctrl+c": "COPY_2_CLIPBOARD"
|
|
1533
1978
|
};
|
|
1534
1979
|
}
|
|
1535
1980
|
}
|
|
1536
|
-
class
|
|
1981
|
+
class xe {
|
|
1537
1982
|
get() {
|
|
1538
1983
|
return {
|
|
1539
1984
|
f2: "START_EDITING",
|
|
1540
1985
|
space: "TOGGLE_SELECTION",
|
|
1541
1986
|
"ctrl+num_add": "SELECT_ALL",
|
|
1542
|
-
"
|
|
1987
|
+
"meta+a": "SELECT_ALL",
|
|
1543
1988
|
"ctrl+a": "SELECT_ALL",
|
|
1544
|
-
"
|
|
1545
|
-
"
|
|
1989
|
+
"meta+x": "DESELECT_ALL",
|
|
1990
|
+
"meta+shift+a": "DESELECT_ALL",
|
|
1546
1991
|
"ctrl+shift+a": "DESELECT_ALL",
|
|
1547
1992
|
"ctrl+num_subtract": "DESELECT_ALL",
|
|
1548
1993
|
"ctrl -": "DESELECT_ALL",
|
|
1549
1994
|
arrowup: "NAVIGATE_UP",
|
|
1550
1995
|
arrowdown: "NAVIGATE_DOWN",
|
|
1551
1996
|
arrowleft: "NAVIGATE_LEFT",
|
|
1552
|
-
arrowright: "NAVIGATE_RIGHT"
|
|
1997
|
+
arrowright: "NAVIGATE_RIGHT",
|
|
1998
|
+
"meta+c": "COPY_2_CLIPBOARD",
|
|
1999
|
+
"ctrl+c": "COPY_2_CLIPBOARD"
|
|
1553
2000
|
};
|
|
1554
2001
|
}
|
|
1555
2002
|
}
|
|
1556
|
-
class
|
|
2003
|
+
class Ee {
|
|
1557
2004
|
constructor(e) {
|
|
1558
2005
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
1559
2006
|
}
|
|
2007
|
+
/**
|
|
2008
|
+
* Adds a listener to the list of listeners.
|
|
2009
|
+
*
|
|
2010
|
+
* @param {OnActionTriggeredIf} listener - The listener to be added.
|
|
2011
|
+
* @returns {void}
|
|
2012
|
+
*/
|
|
1560
2013
|
addListener(e) {
|
|
1561
2014
|
this.listener.includes(e) || this.listener.push(e);
|
|
1562
2015
|
}
|
|
2016
|
+
/**
|
|
2017
|
+
* Initializes the ShortcutService by assigning shortcut action id mappings based on the current operating system.
|
|
2018
|
+
* Also adds key down event listener to the table host element.
|
|
2019
|
+
*/
|
|
1563
2020
|
init() {
|
|
1564
|
-
this.
|
|
2021
|
+
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));
|
|
2022
|
+
}
|
|
2023
|
+
assignPredefinedSystemShortcutMappings() {
|
|
2024
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new xe().get()) : Object.assign(this.shortcutActionIdMapping, new Ce().get());
|
|
1565
2025
|
}
|
|
1566
2026
|
isMacintosh() {
|
|
1567
2027
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -1573,30 +2033,30 @@ class be {
|
|
|
1573
2033
|
return location.hostname === "localhost" || location.hostname === "127.0.0.1";
|
|
1574
2034
|
}
|
|
1575
2035
|
onKeyDown(e) {
|
|
1576
|
-
const t = this.
|
|
2036
|
+
const t = this.findEntity(e);
|
|
1577
2037
|
t && this.emit(t) && (e.preventDefault(), e.stopPropagation());
|
|
1578
2038
|
}
|
|
1579
2039
|
emit(e) {
|
|
1580
|
-
this.isDebug() && console.debug("ShortcutService emit:", e);
|
|
2040
|
+
this.isDebug() && console.debug("ShortcutService emit :", e);
|
|
1581
2041
|
let t = !1;
|
|
1582
|
-
for (const
|
|
1583
|
-
|
|
2042
|
+
for (const o of this.listener)
|
|
2043
|
+
o.onActionTriggered(e) && (t = !0);
|
|
1584
2044
|
return t;
|
|
1585
2045
|
}
|
|
1586
|
-
|
|
2046
|
+
findEntity(e) {
|
|
1587
2047
|
const t = this.getTokenByEvent(e);
|
|
1588
|
-
this.isDebug() && console.debug("ShortcutService tokens:", t);
|
|
1589
|
-
for (const
|
|
1590
|
-
const
|
|
1591
|
-
if (this.areTokensEquals(t,
|
|
1592
|
-
return this.shortcutActionIdMapping[
|
|
2048
|
+
this.isDebug() && console.debug("ShortcutService tokens :", t);
|
|
2049
|
+
for (const o in this.shortcutActionIdMapping) {
|
|
2050
|
+
const s = o.replace(/opt/g, "alt").replace(/cmd/g, "meta").split(/[+ ]/g).sort();
|
|
2051
|
+
if (this.areTokensEquals(t, s))
|
|
2052
|
+
return this.shortcutActionIdMapping[o];
|
|
1593
2053
|
}
|
|
1594
2054
|
}
|
|
1595
2055
|
areTokensEquals(e, t) {
|
|
1596
2056
|
if (e.length !== t.length || e.length === 0)
|
|
1597
2057
|
return !1;
|
|
1598
|
-
for (let
|
|
1599
|
-
if (e[
|
|
2058
|
+
for (let o = 0; o < e.length; o++)
|
|
2059
|
+
if (e[o] !== t[o])
|
|
1600
2060
|
return !1;
|
|
1601
2061
|
return !0;
|
|
1602
2062
|
}
|
|
@@ -1604,8 +2064,16 @@ class be {
|
|
|
1604
2064
|
const t = [];
|
|
1605
2065
|
return e.altKey && t.push("alt"), e.shiftKey && t.push("shift"), e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), e.code && t.push(e.code.toLowerCase().replace(/key/g, "")), t.sort();
|
|
1606
2066
|
}
|
|
2067
|
+
/**
|
|
2068
|
+
* Retrieves the shortcut action mapping object.
|
|
2069
|
+
*
|
|
2070
|
+
* @returns {ShortcutActionIdMapping} - The shortcut action mapping object.
|
|
2071
|
+
*/
|
|
2072
|
+
getShortcutActionMapping() {
|
|
2073
|
+
return this.shortcutActionIdMapping;
|
|
2074
|
+
}
|
|
1607
2075
|
}
|
|
1608
|
-
class
|
|
2076
|
+
class X {
|
|
1609
2077
|
onCheckboxChanged(e) {
|
|
1610
2078
|
}
|
|
1611
2079
|
onContextmenu(e) {
|
|
@@ -1620,20 +2088,24 @@ class N {
|
|
|
1620
2088
|
}
|
|
1621
2089
|
onMouseMoved(e) {
|
|
1622
2090
|
}
|
|
2091
|
+
onSelectionChanged(e) {
|
|
2092
|
+
}
|
|
2093
|
+
onFocusChanged(e) {
|
|
2094
|
+
}
|
|
1623
2095
|
}
|
|
1624
|
-
class
|
|
1625
|
-
setStyle(e, t,
|
|
1626
|
-
return e.style[t] =
|
|
2096
|
+
class J {
|
|
2097
|
+
setStyle(e, t, o) {
|
|
2098
|
+
return e.style[t] = o, e;
|
|
1627
2099
|
}
|
|
1628
2100
|
appendText(e, t) {
|
|
1629
|
-
const
|
|
1630
|
-
return this.appendChild(e,
|
|
2101
|
+
const o = this.createText(t);
|
|
2102
|
+
return this.appendChild(e, o), o;
|
|
1631
2103
|
}
|
|
1632
2104
|
addClass(e, t) {
|
|
1633
|
-
return t.includes(" ") ? t.split(" ").forEach((
|
|
2105
|
+
return t.includes(" ") ? t.split(" ").forEach((o) => e.classList.add(o)) : e.classList.add(t), e;
|
|
1634
2106
|
}
|
|
1635
2107
|
removeClass(e, t) {
|
|
1636
|
-
return t.includes(" ") ? t.split(" ").forEach((
|
|
2108
|
+
return t.includes(" ") ? t.split(" ").forEach((o) => e.classList.remove(o)) : e.classList.remove(t), e;
|
|
1637
2109
|
}
|
|
1638
2110
|
appendChild(e, t) {
|
|
1639
2111
|
e.appendChild(t);
|
|
@@ -1644,44 +2116,47 @@ class K {
|
|
|
1644
2116
|
createText(e) {
|
|
1645
2117
|
return document.createTextNode(e);
|
|
1646
2118
|
}
|
|
1647
|
-
setAttribute(e, t,
|
|
1648
|
-
e.setAttribute(t,
|
|
2119
|
+
setAttribute(e, t, o) {
|
|
2120
|
+
e.setAttribute(t, o);
|
|
1649
2121
|
}
|
|
1650
2122
|
}
|
|
1651
|
-
class
|
|
1652
|
-
render(e, t, s, i,
|
|
1653
|
-
if (
|
|
1654
|
-
|
|
1655
|
-
const
|
|
2123
|
+
class Ae {
|
|
2124
|
+
render(e, t, o, s, i, r, a) {
|
|
2125
|
+
if (i.isEditable(t, o)) {
|
|
2126
|
+
a.addClass(e, "ge-table-row-input-div");
|
|
2127
|
+
const l = i.getValueAt(t, o);
|
|
1656
2128
|
e.innerHTML = `
|
|
1657
2129
|
<input
|
|
1658
2130
|
type="text"
|
|
1659
|
-
value="${
|
|
2131
|
+
value="${l}"
|
|
1660
2132
|
autofocus
|
|
1661
2133
|
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
1662
2134
|
data-listen="change"
|
|
1663
|
-
data-area="${
|
|
2135
|
+
data-area="${s}"
|
|
1664
2136
|
data-row-index="${t}"
|
|
1665
|
-
data-col-index="${
|
|
2137
|
+
data-col-index="${o}"
|
|
1666
2138
|
data-input-type="text"
|
|
1667
2139
|
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
1668
2140
|
class="ge-table-cell-editor-input">`;
|
|
1669
2141
|
}
|
|
1670
2142
|
}
|
|
1671
2143
|
}
|
|
1672
|
-
class
|
|
2144
|
+
class Me {
|
|
1673
2145
|
constructor(e = "none", t = "single") {
|
|
1674
2146
|
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1675
2147
|
}
|
|
2148
|
+
firstClick(e, t) {
|
|
2149
|
+
this.selectionType === "row" ? this.addRange(E.singleRow(e)) : this.selectionType === "column" && this.addRange(E.singleColumn(t));
|
|
2150
|
+
}
|
|
1676
2151
|
getSelectionCount(e, t) {
|
|
1677
|
-
let
|
|
1678
|
-
for (const
|
|
1679
|
-
|
|
1680
|
-
return this.allSelected &&
|
|
2152
|
+
let o = 0;
|
|
2153
|
+
for (const s of this.ranges)
|
|
2154
|
+
s.isInRange(e, t) && o++;
|
|
2155
|
+
return this.allSelected && o++, this.isInNegativeRange(e, t) && (o = 0), o;
|
|
1681
2156
|
}
|
|
1682
2157
|
isInNegativeRange(e, t) {
|
|
1683
|
-
for (const
|
|
1684
|
-
if (
|
|
2158
|
+
for (const o of this.negativeRanges)
|
|
2159
|
+
if (o.isInRange(e, t))
|
|
1685
2160
|
return !0;
|
|
1686
2161
|
return !1;
|
|
1687
2162
|
}
|
|
@@ -1692,11 +2167,29 @@ class ve {
|
|
|
1692
2167
|
this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1693
2168
|
}
|
|
1694
2169
|
hasSelection() {
|
|
1695
|
-
return !!this.ranges.length;
|
|
2170
|
+
return this.allSelected || !!this.ranges.length;
|
|
2171
|
+
}
|
|
2172
|
+
hasNoSelection() {
|
|
2173
|
+
return !this.hasSelection();
|
|
2174
|
+
}
|
|
2175
|
+
/**
|
|
2176
|
+
* Retrieves the merged row indices from the given range selection.
|
|
2177
|
+
*
|
|
2178
|
+
* @returns {number[]} Array of merged row indices
|
|
2179
|
+
*/
|
|
2180
|
+
getMergedRowIndices() {
|
|
2181
|
+
const e = /* @__PURE__ */ new Set();
|
|
2182
|
+
for (const t of this.ranges)
|
|
2183
|
+
for (let o = t.r1; o <= t.r2; o++)
|
|
2184
|
+
!e.has(o) && !this.isInNegativeRange(o, 0) && e.add(o);
|
|
2185
|
+
return Array.from(e);
|
|
1696
2186
|
}
|
|
1697
2187
|
selectAll() {
|
|
1698
2188
|
this.allSelected = !0;
|
|
1699
2189
|
}
|
|
2190
|
+
isAllSelected() {
|
|
2191
|
+
return this.allSelected;
|
|
2192
|
+
}
|
|
1700
2193
|
addSelection(e) {
|
|
1701
2194
|
this.addRange(e);
|
|
1702
2195
|
}
|
|
@@ -1704,16 +2197,19 @@ class ve {
|
|
|
1704
2197
|
if (this.selectionType === "none")
|
|
1705
2198
|
return;
|
|
1706
2199
|
let t = e;
|
|
1707
|
-
this.selectionType === "row" ? t =
|
|
2200
|
+
this.selectionType === "row" ? t = E.singleRow(e.r1) : this.selectionType === "column" && (t = E.singleColumn(e.c1)), this.negativeRanges.push(t);
|
|
1708
2201
|
}
|
|
1709
2202
|
togglePoint(e, t) {
|
|
1710
|
-
this.getSelectionCount(e, t) > 0 ? this.removeSelection(
|
|
2203
|
+
this.getSelectionCount(e, t) > 0 ? this.removeSelection(E.singleCell(e, t)) : this.addSelection(E.singleCell(e, t));
|
|
2204
|
+
}
|
|
2205
|
+
isSelected(e, t) {
|
|
2206
|
+
return this.getSelectionCount(e, t) > 0;
|
|
1711
2207
|
}
|
|
1712
2208
|
addRange(e) {
|
|
1713
2209
|
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));
|
|
1714
2210
|
}
|
|
1715
2211
|
}
|
|
1716
|
-
class
|
|
2212
|
+
class Re {
|
|
1717
2213
|
constructor(e = "none") {
|
|
1718
2214
|
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
|
|
1719
2215
|
}
|
|
@@ -1736,29 +2232,128 @@ class Ce {
|
|
|
1736
2232
|
return [this.rowIndex, this.columnIndex];
|
|
1737
2233
|
}
|
|
1738
2234
|
}
|
|
1739
|
-
|
|
1740
|
-
|
|
2235
|
+
class Q {
|
|
2236
|
+
constructor(e = new D(
|
|
2237
|
+
"❯",
|
|
2238
|
+
"",
|
|
2239
|
+
["gt-table-icon-expanded"]
|
|
2240
|
+
), t = new D(
|
|
2241
|
+
"❯",
|
|
2242
|
+
"transform: rotate(180deg) translate(-100%, -100%); transform-origin: 0 0;",
|
|
2243
|
+
["ge-table-icon-collapsed"]
|
|
2244
|
+
)) {
|
|
2245
|
+
this.iconExpanded = e, this.iconCollapsed = t;
|
|
2246
|
+
}
|
|
2247
|
+
// `⊖ `, `⊕ `;
|
|
2248
|
+
}
|
|
2249
|
+
const Te = new Me(), De = new Re("cell");
|
|
2250
|
+
class Z {
|
|
1741
2251
|
constructor() {
|
|
1742
2252
|
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 = {
|
|
1743
2253
|
header: 34,
|
|
1744
2254
|
body: 34,
|
|
1745
2255
|
footer: 34
|
|
1746
|
-
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new
|
|
2256
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new q(), this.headerGroupOptions = new Q(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new U(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new Ae(), this.getSelectionModel = () => Te, this.getFocusModel = () => De;
|
|
1747
2257
|
}
|
|
1748
2258
|
}
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
2259
|
+
const I = class I {
|
|
2260
|
+
/**
|
|
2261
|
+
* Returns the content to be copied based on the provided table model, selection model, and focus model.
|
|
2262
|
+
*
|
|
2263
|
+
* @param {TableModelIf} tableModel - The table model for data retrieval.
|
|
2264
|
+
* @param {SelectionModelIf} selectionModel - The selection model to determine the selected range.
|
|
2265
|
+
* @param {FocusModelIf} focusModel - The focus model to determine the focused cell.
|
|
2266
|
+
* @return {Promise<string>} A promise that resolves to the copied content as a string.
|
|
2267
|
+
* @throws {string} Throws an error if neither selection nor focus is defined.
|
|
2268
|
+
*/
|
|
2269
|
+
createContent(e, t, o) {
|
|
2270
|
+
return new Promise((s, i) => {
|
|
2271
|
+
if (t != null && t.hasSelection()) {
|
|
2272
|
+
const r = this.mergeRanges(t.getRanges());
|
|
2273
|
+
if (r) {
|
|
2274
|
+
r.c2 = Math.min(r.c2, e.getColumnCount() - 1), r.r2 = Math.min(r.r2, e.getBodyModel().getRowCount() - 1);
|
|
2275
|
+
const a = [];
|
|
2276
|
+
for (let l = r.r1; l <= r.r2; l++) {
|
|
2277
|
+
const n = [];
|
|
2278
|
+
for (let d = r.c1; d <= r.c2; d++) {
|
|
2279
|
+
const h = t.isSelected(l, d) ? e.getBodyModel().getTextValueAt(l, d) : "";
|
|
2280
|
+
n.push(h);
|
|
2281
|
+
}
|
|
2282
|
+
a.push(n.join(I.columnSeparatorChar));
|
|
2283
|
+
}
|
|
2284
|
+
return s(a.join(I.rowSeparatorChar));
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
if (o) {
|
|
2288
|
+
const [r, a] = o.getFocus(), l = e.getBodyModel().getTextValueAt(r, a);
|
|
2289
|
+
return s(l);
|
|
2290
|
+
}
|
|
2291
|
+
i("Cannot copy, neither selection nor focus defined.");
|
|
2292
|
+
});
|
|
2293
|
+
}
|
|
2294
|
+
/**
|
|
2295
|
+
* Copy the provided content to the clipboard.
|
|
2296
|
+
*
|
|
2297
|
+
* @param {string} content - The content to be copied.
|
|
2298
|
+
* @return {Promise<void>} A promise that resolves when the content has been successfully copied to the clipboard.
|
|
2299
|
+
*/
|
|
2300
|
+
copyContent(e) {
|
|
2301
|
+
return navigator.clipboard.writeText(e);
|
|
2302
|
+
}
|
|
2303
|
+
/**
|
|
2304
|
+
* Asynchronously copies the content of a table to the clipboard.
|
|
2305
|
+
*
|
|
2306
|
+
* @param {TableModelIf} tableModel - The table model to copy from.
|
|
2307
|
+
* @param {SelectionModelIf} selectionModel - The selection model of the table.
|
|
2308
|
+
* @param {FocusModelIf} focusModel - The focus model of the table.
|
|
2309
|
+
* @returns {Promise<string>} A promise that resolves with the copied text if successful, or rejects if an error occurs.
|
|
2310
|
+
*/
|
|
2311
|
+
copyToClipboard(e, t, o) {
|
|
2312
|
+
return new Promise((s, i) => {
|
|
2313
|
+
this.createContent(
|
|
2314
|
+
e,
|
|
2315
|
+
t,
|
|
2316
|
+
o
|
|
2317
|
+
).then((r) => {
|
|
2318
|
+
r && this.copyContent(r).then((a) => {
|
|
2319
|
+
s(r);
|
|
2320
|
+
}).catch((a) => {
|
|
2321
|
+
i();
|
|
2322
|
+
});
|
|
2323
|
+
}).catch((r) => {
|
|
2324
|
+
i();
|
|
2325
|
+
});
|
|
2326
|
+
});
|
|
2327
|
+
}
|
|
2328
|
+
/**
|
|
2329
|
+
* Merges an array of CellRanges into a single merged CellRange.
|
|
2330
|
+
*
|
|
2331
|
+
* @param {CellRange[]} ranges - The array of CellRanges to be merged.
|
|
2332
|
+
* @return {CellRange | undefined} - The merged CellRange, or undefined if the ranges array is empty.
|
|
2333
|
+
*/
|
|
2334
|
+
mergeRanges(e) {
|
|
2335
|
+
let t;
|
|
2336
|
+
for (const o of e)
|
|
2337
|
+
t ? (t.r1 = Math.min(t.r1, o.r1), t.c1 = Math.min(t.c1, o.c1), t.r2 = Math.max(t.r2, o.r2), t.c2 = Math.max(t.c2, o.c2)) : t = new E(o.r1, o.c1, o.r2, o.c2);
|
|
2338
|
+
return t;
|
|
2339
|
+
}
|
|
2340
|
+
};
|
|
2341
|
+
I.columnSeparatorChar = " ", I.rowSeparatorChar = `
|
|
2342
|
+
`;
|
|
2343
|
+
let O = I;
|
|
2344
|
+
class z extends fe {
|
|
2345
|
+
constructor(e, t, o, s, i, r = new O()) {
|
|
2346
|
+
var a;
|
|
1752
2347
|
if (super(
|
|
1753
2348
|
e,
|
|
1754
2349
|
t,
|
|
1755
|
-
new
|
|
1756
|
-
|
|
1757
|
-
), this.eventListener =
|
|
1758
|
-
const
|
|
1759
|
-
|
|
2350
|
+
new le(o),
|
|
2351
|
+
s
|
|
2352
|
+
), this.eventListener = i, this.copyService = r, this.licenseManager = k.getInstance(), this.selectionService = new we(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 X()), (a = this.tableOptions) != null && a.autoRestoreOptions) {
|
|
2353
|
+
const l = this.tableOptions.autoRestoreOptions, n = l.getStorageKeyFn;
|
|
2354
|
+
n && (l.autoRestoreScrollPosition && (this.storeScrollPosStateService = new ce(n)), l.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new ge(n)), l.autoRestoreSortingState && (this.storeSortingService = new pe(n)));
|
|
1760
2355
|
}
|
|
1761
|
-
this.mouseHandler = new
|
|
2356
|
+
this.mouseHandler = new ne(this), this.inputHandler = new ye(this), this.shortcutService = new Ee(this), this.shortcutService.addListener(this.selectionService);
|
|
1762
2357
|
}
|
|
1763
2358
|
/**
|
|
1764
2359
|
* Creates a TableScope instance.
|
|
@@ -1768,33 +2363,47 @@ class k extends ce {
|
|
|
1768
2363
|
* @param {TableOptionsIf} [tableOptions=new TableOptions()] - The optional table options object.
|
|
1769
2364
|
* @param {EventListenerIf} [eventListener=new EventAdapter()] - The optional event listener object.
|
|
1770
2365
|
* @param {DomServiceIf} [domService=new SimpleDomService()] - The optional DOM service object.
|
|
2366
|
+
* @param {CopyServiceIf} [copyService=new CopyService()] - The optional copy service object.
|
|
1771
2367
|
*
|
|
1772
2368
|
* @return {TableScope} - The newly created TableScope instance.
|
|
1773
2369
|
*/
|
|
1774
|
-
static create(e, t, s = new
|
|
1775
|
-
return new
|
|
2370
|
+
static create(e, t, o = new Z(), s = new X(), i = new J(), r = new O()) {
|
|
2371
|
+
return new z(
|
|
1776
2372
|
e,
|
|
1777
2373
|
t,
|
|
2374
|
+
i,
|
|
1778
2375
|
o,
|
|
1779
2376
|
s,
|
|
1780
|
-
|
|
2377
|
+
r
|
|
1781
2378
|
);
|
|
1782
2379
|
}
|
|
2380
|
+
/**
|
|
2381
|
+
* Triggers an action based on the provided actionId.
|
|
2382
|
+
*
|
|
2383
|
+
* This function can be invoked manually via the table API or by keyboard shortcuts.
|
|
2384
|
+
*
|
|
2385
|
+
* @param {ActionId} actionId - The identifier of the action to be triggered.
|
|
2386
|
+
* @return {boolean} - Returns true if the action was triggered successfully, false otherwise.
|
|
2387
|
+
*/
|
|
1783
2388
|
onActionTriggered(e) {
|
|
1784
2389
|
if (e === "NAVIGATE_DOWN" && this.changeFocusCell(0, 1) || e === "NAVIGATE_UP" && this.changeFocusCell(0, -1) || e === "NAVIGATE_LEFT" && this.changeFocusCell(-1, 0) || e === "NAVIGATE_RIGHT" && this.changeFocusCell(1, 0))
|
|
1785
2390
|
return !0;
|
|
1786
2391
|
if (e === "START_EDITING" && this.getFocusModel) {
|
|
1787
2392
|
const t = this.getFocusModel();
|
|
1788
2393
|
if (t) {
|
|
1789
|
-
const [
|
|
1790
|
-
this.tableModel.getBodyModel().isEditable(
|
|
2394
|
+
const [o, s] = t.getFocus();
|
|
2395
|
+
this.tableModel.getBodyModel().isEditable(o, s) && (this.clearSelection(), this.initRenderEditor(o, s));
|
|
1791
2396
|
}
|
|
1792
2397
|
return !0;
|
|
1793
2398
|
}
|
|
2399
|
+
if (e === "COPY_2_CLIPBOARD") {
|
|
2400
|
+
const t = this.getSelectionModel ? this.getSelectionModel() : void 0, o = this.getFocusModel ? this.getFocusModel() : void 0;
|
|
2401
|
+
this.copyService.createContent(this.tableModel, t, o).then((s) => this.copyService.copyContent(s));
|
|
2402
|
+
}
|
|
1794
2403
|
return !1;
|
|
1795
2404
|
}
|
|
1796
|
-
updateModelValueAfterEdit(e, t,
|
|
1797
|
-
e === "body" && this.tableModel.getAreaModel(e).setValue(t,
|
|
2405
|
+
updateModelValueAfterEdit(e, t, o, s) {
|
|
2406
|
+
e === "body" && this.tableModel.getAreaModel(e).setValue(t, o, s) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(V.createSingle(t, o)), this.hostElement.focus());
|
|
1798
2407
|
}
|
|
1799
2408
|
/**
|
|
1800
2409
|
* Retrieves the TableApi object.
|
|
@@ -1823,16 +2432,16 @@ class k extends ce {
|
|
|
1823
2432
|
* @return {GeMouseEvent} - The created GeMouseEvent object.
|
|
1824
2433
|
*/
|
|
1825
2434
|
createGeMouseEvent(e) {
|
|
1826
|
-
const t = new
|
|
2435
|
+
const t = new W();
|
|
1827
2436
|
if (t.originalEvent = e, e) {
|
|
1828
|
-
const
|
|
1829
|
-
if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(
|
|
1830
|
-
const
|
|
1831
|
-
t.rowTop =
|
|
2437
|
+
const o = e.target;
|
|
2438
|
+
if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(o), t.rowIndex = this.getNumberByAttr(o, "data-row-index"), t.columnIndex = this.getNumberByAttr(o, "data-col-index"), t.action = this.getStringByAttr(o, "data-ge-action"), t.areaIdent) {
|
|
2439
|
+
const s = this.tableModel.getAreaModel(t.areaIdent);
|
|
2440
|
+
t.rowTop = s.getYPosByRowIndex(t.rowIndex);
|
|
1832
2441
|
}
|
|
1833
2442
|
if (t.columnLeft = this.tableModel.getXPosByColumnIndex(t.columnIndex), e.ctrlKey && e.altKey) {
|
|
1834
|
-
const
|
|
1835
|
-
this.debugOnce(
|
|
2443
|
+
const s = e.clientY - this.hostElement.offsetTop - this.areaHeaderCenter.parent.clientHeight, i = e.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width;
|
|
2444
|
+
this.debugOnce(i, s);
|
|
1836
2445
|
}
|
|
1837
2446
|
}
|
|
1838
2447
|
return t;
|
|
@@ -1844,15 +2453,16 @@ class k extends ce {
|
|
|
1844
2453
|
* @return {void}
|
|
1845
2454
|
*/
|
|
1846
2455
|
onMouseDown(e) {
|
|
1847
|
-
e.columnIndex > -1 && e.action && ["resize-column", "drag-column"].includes(e.action) && (this.mouseStartWidth = this.tableModel.getColumnWidth(e.columnIndex), this.mouseStartAction = e.action, this.mouseStartColumnIndex = e.columnIndex, this.mouseStartAction === "drag-column" && (this.dragFrom = this.mouseStartColumnIndex));
|
|
2456
|
+
e.columnIndex > -1 && e.action && ["resize-column", "drag-column"].includes(e.action) && (this.mouseStartWidth = this.tableModel.getColumnWidth(e.columnIndex), this.mouseStartAction = e.action, this.mouseStartColumnIndex = e.columnIndex, this.mouseStartAction === "drag-column" && (this.firstDraggingRendering = !0, this.dragFrom = this.mouseStartColumnIndex));
|
|
1848
2457
|
}
|
|
1849
2458
|
/**
|
|
1850
2459
|
* Handles mouse dragging on the frame.
|
|
1851
2460
|
*
|
|
1852
2461
|
* @param {GeMouseEvent} mouseEvent - The mouse event object.
|
|
2462
|
+
* @param startMouseEvent
|
|
1853
2463
|
*/
|
|
1854
|
-
mouseDraggingOnFrame(e) {
|
|
1855
|
-
this.eventListener.onMouseDragging(e), this.mouseEvent = e, this.mouseStartColumnIndex > -1 && this.mouseStartAction === "resize-column" && this.tableOptions.columnsResizable ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && e.columnIndex > -1 && this.tableOptions.columnsDraggable && (this.draggingTargetColumnIndex = e.columnIndex, this.dragTo = this.draggingTargetColumnIndex, this.dragFrom > -1 && this.dragTo > -1 && this.dragFrom !== this.dragTo && (this.tableModel.changeColumnOrder(this.dragFrom, this.dragTo), this.dragFrom = this.dragTo, this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows()), this.repaint());
|
|
2464
|
+
mouseDraggingOnFrame(e, t) {
|
|
2465
|
+
this.eventListener.onMouseDragging(e), this.mouseEvent = e, this.mouseStartColumnIndex > -1 && this.mouseStartAction === "resize-column" && this.tableOptions.columnsResizable ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && e.columnIndex > -1 && this.tableOptions.columnsDraggable && (this.draggingTargetColumnIndex = e.columnIndex, this.dragTo = this.draggingTargetColumnIndex, this.dragFrom > -1 && this.dragTo > -1 && this.dragFrom !== this.dragTo && (this.lastDragFrom === this.dragTo && this.lastDragTo === this.dragFrom || (this.tableModel.changeColumnOrder(this.dragFrom, this.dragTo), this.lastDragFrom = this.dragFrom, this.lastDragTo = this.dragTo, this.dragFrom = this.dragTo, this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows())), t && (this.adjustDraggingColumn(e, t.columnIndex, this.firstDraggingRendering), this.firstDraggingRendering = !1), this.repaint());
|
|
1856
2466
|
}
|
|
1857
2467
|
/**
|
|
1858
2468
|
* Handles the end of mouse dragging event on a frame.
|
|
@@ -1862,7 +2472,7 @@ class k extends ce {
|
|
|
1862
2472
|
* @returns {void}
|
|
1863
2473
|
*/
|
|
1864
2474
|
mouseDraggingEndOnFrame(e) {
|
|
1865
|
-
this.eventListener.onMouseDraggingEnd(e), this.draggingTargetColumnIndex = -1, this.mouseStartAction === "resize-column" ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && this.repaint(), this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.mouseStartAction = "";
|
|
2475
|
+
this.eventListener.onMouseDraggingEnd(e), this.draggingTargetColumnIndex = -1, this.mouseStartAction === "resize-column" ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && (this.hideDraggingColumn(), this.repaint()), this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.firstDraggingRendering = !0, this.mouseStartAction = "";
|
|
1866
2476
|
}
|
|
1867
2477
|
/**
|
|
1868
2478
|
* Handles the mouse move event.
|
|
@@ -1890,9 +2500,9 @@ class k extends ce {
|
|
|
1890
2500
|
* @return {void}
|
|
1891
2501
|
*/
|
|
1892
2502
|
toggleExpandCollapseAll(e = !0) {
|
|
1893
|
-
var
|
|
2503
|
+
var o;
|
|
1894
2504
|
const t = this.tableModel.getBodyModel();
|
|
1895
|
-
|
|
2505
|
+
P(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (o = this.storeStateCollapsedExpandService) == null || o.collapsedStateAll(e));
|
|
1896
2506
|
}
|
|
1897
2507
|
/**
|
|
1898
2508
|
* Toggles the checkbox state of a specific row in a table.
|
|
@@ -1903,12 +2513,12 @@ class k extends ce {
|
|
|
1903
2513
|
*
|
|
1904
2514
|
* @return {void} - This method does not return anything.
|
|
1905
2515
|
*/
|
|
1906
|
-
toggleRowCheckbox(e, t,
|
|
1907
|
-
var
|
|
1908
|
-
const
|
|
1909
|
-
|
|
1910
|
-
const
|
|
1911
|
-
this.eventListener.onCheckboxChanged(
|
|
2516
|
+
toggleRowCheckbox(e, t, o) {
|
|
2517
|
+
var l;
|
|
2518
|
+
const s = this.tableModel.getAreaModel(o), i = s.isRowChecked(e), r = i === void 0 || i === "semi" || i === "none";
|
|
2519
|
+
s.setRowChecked(e, r), this.repaint();
|
|
2520
|
+
const a = (l = s.rowSelectionModel) == null ? void 0 : l.getCheckedRows();
|
|
2521
|
+
this.eventListener.onCheckboxChanged(a || []);
|
|
1912
2522
|
}
|
|
1913
2523
|
/**
|
|
1914
2524
|
* Handle mouse click events.
|
|
@@ -1918,12 +2528,25 @@ class k extends ce {
|
|
|
1918
2528
|
* @returns {void}
|
|
1919
2529
|
*/
|
|
1920
2530
|
onMouseClicked(e, t) {
|
|
1921
|
-
let
|
|
1922
|
-
if (!
|
|
1923
|
-
|
|
1924
|
-
|
|
2531
|
+
let o = this.selectionService.onMouseClicked(e, t);
|
|
2532
|
+
if (!o && this.getFocusModel) {
|
|
2533
|
+
this.resetEditorRenderer();
|
|
2534
|
+
const s = this.getFocusModel();
|
|
2535
|
+
s && (o = s.hasChanged(), s.clearChanged());
|
|
1925
2536
|
}
|
|
1926
|
-
|
|
2537
|
+
return o;
|
|
2538
|
+
}
|
|
2539
|
+
debounceRepaint() {
|
|
2540
|
+
this.debounce(this.repaint.bind(this), 1);
|
|
2541
|
+
}
|
|
2542
|
+
publishGeMouseEvent(e) {
|
|
2543
|
+
this.eventListener.onMouseClicked(e);
|
|
2544
|
+
}
|
|
2545
|
+
onFocusChanged(e) {
|
|
2546
|
+
this.eventListener.onFocusChanged(e);
|
|
2547
|
+
}
|
|
2548
|
+
onSelectionChanged(e) {
|
|
2549
|
+
this.eventListener.onSelectionChanged(e);
|
|
1927
2550
|
}
|
|
1928
2551
|
/**
|
|
1929
2552
|
* Updates the table (repaint) when an external filter is changed.
|
|
@@ -1944,15 +2567,73 @@ class k extends ce {
|
|
|
1944
2567
|
*
|
|
1945
2568
|
* @return {void}
|
|
1946
2569
|
*/
|
|
1947
|
-
onHeaderDblClicked(e, t,
|
|
1948
|
-
var
|
|
1949
|
-
const
|
|
1950
|
-
if (
|
|
2570
|
+
onHeaderDblClicked(e, t, o) {
|
|
2571
|
+
var i, r;
|
|
2572
|
+
const s = this.tableModel.getColumnDef(o);
|
|
2573
|
+
if (s != null && s.sortable && s.sortable()) {
|
|
1951
2574
|
e.preventDefault(), e.stopPropagation();
|
|
1952
|
-
const
|
|
1953
|
-
this.tableModel.doSort([d]) && ((
|
|
2575
|
+
const a = s.sortStatesOrder ? s.sortStatesOrder : this.tableOptions.sortOrder, l = s.sortState ?? "", n = a[(a.indexOf(l) + 1) % a.length], d = new me(o, n);
|
|
2576
|
+
this.tableModel.doSort([d]) && ((i = this.tableModel.getColumnDefs()) == null || i.forEach((g) => g.sortState = ""), s.sortState = n), this.repaint(), (r = this.storeSortingService) == null || r.setSortItems([d]);
|
|
1954
2577
|
}
|
|
1955
2578
|
}
|
|
2579
|
+
/**
|
|
2580
|
+
* Scrolls the viewport to the specified pixel coordinates.
|
|
2581
|
+
*
|
|
2582
|
+
* @param {number} px - The horizontal pixel coordinate to scroll to.
|
|
2583
|
+
* @param {number} py - The vertical pixel coordinate to scroll to.
|
|
2584
|
+
*
|
|
2585
|
+
* @return {void}
|
|
2586
|
+
*/
|
|
2587
|
+
scrollToPixel(e, t) {
|
|
2588
|
+
this.scrollViewport.scrollTo(e, t);
|
|
2589
|
+
}
|
|
2590
|
+
/**
|
|
2591
|
+
* Scrolls to the specified index in the table.
|
|
2592
|
+
*
|
|
2593
|
+
* @param {number} _indexX - The horizontal index of the table where scrolling is needed.
|
|
2594
|
+
* @param {number} indexY - The vertical index of the table where scrolling is needed.
|
|
2595
|
+
* @return {void}
|
|
2596
|
+
*/
|
|
2597
|
+
scrollToIndex(e, t) {
|
|
2598
|
+
const s = this.tableModel.getAreaModel("body").getYPosByRowIndex(t);
|
|
2599
|
+
this.scrollToPixel(0, s);
|
|
2600
|
+
}
|
|
2601
|
+
/**
|
|
2602
|
+
* Sets the selection model for the table.
|
|
2603
|
+
*
|
|
2604
|
+
* @param {SelectionModel} sm - The selection model to be set.
|
|
2605
|
+
* @param {boolean} rerender - Optional parameter indicating whether to rerender the table after setting the selection model. Default value is false.
|
|
2606
|
+
*
|
|
2607
|
+
* @return {void} - This method does not return any value.
|
|
2608
|
+
*/
|
|
2609
|
+
setSelectionModel(e, t = !1) {
|
|
2610
|
+
const o = () => e;
|
|
2611
|
+
this.tableOptions.getSelectionModel = o, this.getSelectionModel = o, this.selectionService.getSelectionModel = o, t && this.repaint();
|
|
2612
|
+
}
|
|
2613
|
+
toggleHeaderGroup(e) {
|
|
2614
|
+
const t = this.tableModel.getAreaModel("header");
|
|
2615
|
+
"columnDefs" in this.tableModel && (this.tableModel.columnDefs = t.toggleHeaderGroup(e), console.info("####### !!!!!! *******, this.tableModel.columnDefs")), this.firstInit();
|
|
2616
|
+
}
|
|
2617
|
+
/**
|
|
2618
|
+
* Retrieves the selection model.
|
|
2619
|
+
* @returns {SelectionModelIf | undefined} The selection model if available, otherwise undefined.
|
|
2620
|
+
*/
|
|
2621
|
+
selectionModel() {
|
|
2622
|
+
if (this != null && this.getSelectionModel)
|
|
2623
|
+
return this.getSelectionModel();
|
|
2624
|
+
}
|
|
2625
|
+
/**
|
|
2626
|
+
* Retrieves the focus model.
|
|
2627
|
+
*
|
|
2628
|
+
* @returns {FocusModelIf | undefined} The focus model if it exists, or undefined otherwise.
|
|
2629
|
+
*/
|
|
2630
|
+
focusModel() {
|
|
2631
|
+
if (this != null && this.getFocusModel)
|
|
2632
|
+
return this.getFocusModel();
|
|
2633
|
+
}
|
|
2634
|
+
setDragging(e) {
|
|
2635
|
+
this.dragging = e, this.dragging ? (this.storeColumnWidths(), this.lastDragFrom = -1, this.lastDragTo = -1) : this.storedColumnWidths = [];
|
|
2636
|
+
}
|
|
1956
2637
|
/**
|
|
1957
2638
|
* Changes the focus cell using the specified deltas.
|
|
1958
2639
|
*
|
|
@@ -1962,10 +2643,10 @@ class k extends ce {
|
|
|
1962
2643
|
*/
|
|
1963
2644
|
changeFocusCell(e, t) {
|
|
1964
2645
|
if (!this.isEditing() && this.getFocusModel) {
|
|
1965
|
-
const
|
|
1966
|
-
if (
|
|
1967
|
-
const [
|
|
1968
|
-
return
|
|
2646
|
+
const o = this.getFocusModel();
|
|
2647
|
+
if (o) {
|
|
2648
|
+
const [s, i] = o.getFocus();
|
|
2649
|
+
return o.setFocus(s + t, i + e), this.repaint(), !0;
|
|
1969
2650
|
}
|
|
1970
2651
|
}
|
|
1971
2652
|
return !1;
|
|
@@ -1988,22 +2669,20 @@ class k extends ce {
|
|
|
1988
2669
|
this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
|
|
1989
2670
|
}
|
|
1990
2671
|
debugOnce(e, t) {
|
|
1991
|
-
var
|
|
1992
|
-
console.clear(), console.info("this.hostElement.offsetTop", this.hostElement.offsetTop), console.info("this.hostElement.scrollHeight", this.hostElement.scrollHeight), console.info("this.scrollViewportTop", this.scrollTop), console.info("this.areaHeaderCenter.parent.clientHeight", this.areaHeaderCenter.parent.clientHeight), console.info("bodyY", t), console.info("bodyX", e), console.info("rows", this.firstVisibleRowIndex), console.info(""), console.info("this.tableModel", this.tableModel), console.info(""), console.info("this.mouseMoveEvent.clientX", (
|
|
2672
|
+
var o;
|
|
2673
|
+
console.clear(), console.info("this.hostElement.offsetTop", this.hostElement.offsetTop), console.info("this.hostElement.scrollHeight", this.hostElement.scrollHeight), console.info("this.scrollViewportTop", this.scrollTop), console.info("this.areaHeaderCenter.parent.clientHeight", this.areaHeaderCenter.parent.clientHeight), console.info("bodyY", t), console.info("bodyX", e), console.info("rows", this.firstVisibleRowIndex), console.info(""), console.info("this.tableModel", this.tableModel), console.info(""), console.info("this.mouseMoveEvent.clientX", (o = this.mouseHandler.mouseEvent) == null ? void 0 : o.clientX), console.info("this.hostElement.offsetLeft", this.hostElement.offsetLeft), console.info("this.areaBodyWestGeo.width", this.areaBodyWestGeo.width);
|
|
1993
2674
|
}
|
|
1994
2675
|
/**
|
|
1995
2676
|
* Restores the scroll position of the table if auto restore options are enabled.
|
|
1996
2677
|
*
|
|
1997
|
-
* @private
|
|
1998
|
-
* @memberof ClassName
|
|
1999
2678
|
*
|
|
2000
2679
|
* @returns {void}
|
|
2001
2680
|
*/
|
|
2002
2681
|
autoRestoreScrollPosition() {
|
|
2003
2682
|
var e;
|
|
2004
2683
|
if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
|
|
2005
|
-
const
|
|
2006
|
-
|
|
2684
|
+
const o = this.storeScrollPosStateService.getScrollOffset();
|
|
2685
|
+
o && this.scrollViewport.scrollTo(...o);
|
|
2007
2686
|
}
|
|
2008
2687
|
}
|
|
2009
2688
|
/**
|
|
@@ -2023,8 +2702,8 @@ class k extends ce {
|
|
|
2023
2702
|
autoRestoreSortingState() {
|
|
2024
2703
|
var e, t;
|
|
2025
2704
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
|
|
2026
|
-
const
|
|
2027
|
-
|
|
2705
|
+
const o = this.storeSortingService.getSortItems();
|
|
2706
|
+
o != null && o.length && this.tableModel.getBodyModel().doSort(o);
|
|
2028
2707
|
}
|
|
2029
2708
|
}
|
|
2030
2709
|
/**
|
|
@@ -2036,52 +2715,308 @@ class k extends ce {
|
|
|
2036
2715
|
autoRestoreCollapsedExpandedState() {
|
|
2037
2716
|
var e, t;
|
|
2038
2717
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
|
|
2039
|
-
const
|
|
2040
|
-
if (
|
|
2041
|
-
const
|
|
2042
|
-
if (
|
|
2043
|
-
const
|
|
2044
|
-
for (let
|
|
2045
|
-
const d =
|
|
2718
|
+
const o = this.tableOptions.autoRestoreOptions, s = o.getRowId;
|
|
2719
|
+
if (o.autoRestoreCollapsedExpandedState && s) {
|
|
2720
|
+
const i = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), r = this.tableModel.getAreaModel("body");
|
|
2721
|
+
if (P(r)) {
|
|
2722
|
+
const a = r, l = r.getRowCount();
|
|
2723
|
+
for (let n = 0; n < l; n++) {
|
|
2724
|
+
const d = r.getRowByIndex(n);
|
|
2046
2725
|
if (d)
|
|
2047
|
-
if (
|
|
2726
|
+
if (i.allExpanded)
|
|
2048
2727
|
d.expanded = !0;
|
|
2049
|
-
else if (
|
|
2728
|
+
else if (i.allCollapsed)
|
|
2050
2729
|
d.expanded = !1;
|
|
2051
2730
|
else {
|
|
2052
|
-
const
|
|
2053
|
-
|
|
2731
|
+
const h = s(d.data);
|
|
2732
|
+
i.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h) : i.mode === "collapsed" && (d.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h));
|
|
2054
2733
|
}
|
|
2055
2734
|
}
|
|
2056
|
-
|
|
2735
|
+
a.recalcVisibleTreeRows();
|
|
2057
2736
|
}
|
|
2058
2737
|
}
|
|
2059
2738
|
}
|
|
2060
2739
|
}
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2740
|
+
}
|
|
2741
|
+
const L = class L {
|
|
2742
|
+
};
|
|
2743
|
+
L.themes = ["light", "combat", "paper", "blackboard"], L.vars = {
|
|
2744
|
+
light: `html[data-theme="light"] {
|
|
2745
|
+
--ge-table-bg: rgba(255,255,255, 0.5);
|
|
2746
|
+
--ge-table-header-west-bg: rgba(233, 233, 233, 0.5);
|
|
2747
|
+
--ge-table-header-center-bg: rgba(233, 233, 233, 0.5);
|
|
2748
|
+
--ge-table-header-east-bg: rgba(233, 233, 233, 0.5);
|
|
2749
|
+
--ge-table-header-west-text: #000;
|
|
2750
|
+
--ge-table-header-center-text: #000;
|
|
2751
|
+
--ge-table-header-east-text: #000;
|
|
2752
|
+
--ge-table-header-west-horizontal-border: #ddd;
|
|
2753
|
+
--ge-table-header-west-vertical-border: #ccc;
|
|
2754
|
+
--ge-table-header-center-horizontal-border: #ddd;
|
|
2755
|
+
--ge-table-header-center-vertical-border: #ccc;
|
|
2756
|
+
--ge-table-header-east-horizontal-border: #ddd;
|
|
2757
|
+
--ge-table-header-east-vertical-border: #ccc;
|
|
2758
|
+
--ge-table-body-west-bg: rgba(233, 233, 233, 0.5);
|
|
2759
|
+
--ge-table-body-center-bg: rgba(255,255,255, 0.5);
|
|
2760
|
+
--ge-table-body-east-bg: rgba(233, 233, 233, 0.5);
|
|
2761
|
+
--ge-table-body-west-text: #000;
|
|
2762
|
+
--ge-table-body-center-text: #000;
|
|
2763
|
+
--ge-table-body-east-text: #000;
|
|
2764
|
+
--ge-table-body-west-horizontal-border: #ddd;
|
|
2765
|
+
--ge-table-body-west-vertical-border: #ccc;
|
|
2766
|
+
--ge-table-body-center-horizontal-border: #bbb;
|
|
2767
|
+
--ge-table-body-center-vertical-border: #ddd;
|
|
2768
|
+
--ge-table-body-east-horizontal-border: #ddd;
|
|
2769
|
+
--ge-table-body-east-vertical-border: #ccc;
|
|
2770
|
+
--ge-table-body-west-selected-range-bg: rgba(0, 152, 219, 0.4);
|
|
2771
|
+
--ge-table-body-center-selected-range-bg: rgba(0, 152, 219, 0.4);
|
|
2772
|
+
--ge-table-body-east-selected-range-bg: rgba(0, 152, 219, 0.4);
|
|
2773
|
+
--ge-table-body-west-selected-range-text: #000;
|
|
2774
|
+
--ge-table-body-center-selected-range-text: #000;
|
|
2775
|
+
--ge-table-body-east-selected-range-text: #000;
|
|
2776
|
+
--ge-table-footer-west-bg: rgba(233, 233, 233, 0.5);
|
|
2777
|
+
--ge-table-footer-center-bg: rgba(233, 233, 233, 0.5);
|
|
2778
|
+
--ge-table-footer-east-bg: rgba(233, 233, 233, 0.5);
|
|
2779
|
+
--ge-table-footer-west-text: #000;
|
|
2780
|
+
--ge-table-footer-center-text: #000;
|
|
2781
|
+
--ge-table-footer-east-text: #000;
|
|
2782
|
+
--ge-table-footer-west-horizontal-border: #ddd;
|
|
2783
|
+
--ge-table-footer-west-vertical-border: #ccc;
|
|
2784
|
+
--ge-table-footer-center-horizontal-border: #ddd;
|
|
2785
|
+
--ge-table-footer-center-vertical-border: #ccc;
|
|
2786
|
+
--ge-table-footer-east-horizontal-border: #ddd;
|
|
2787
|
+
--ge-table-footer-east-vertical-border: #ccc;
|
|
2788
|
+
--ge-table-border: #ccc;
|
|
2789
|
+
--ge-table-row-odd-bg: transparent;
|
|
2790
|
+
--ge-table-row-even-bg: transparent;
|
|
2791
|
+
--ge-table-column-odd-bg: transparent;
|
|
2792
|
+
--ge-table-column-even-bg: transparent;
|
|
2793
|
+
--ge-table-hover-column-bg: rgba(0, 224, 255, 0.27);
|
|
2794
|
+
--ge-table-hover-row-bg: rgba(0, 224, 255, 0.27);
|
|
2795
|
+
--ge-table-focus-border: rgb(0, 255, 255);
|
|
2796
|
+
--ge-table-color-error-text: #e00034;
|
|
2797
|
+
--ge-table-tree-arrow-collapsed-color: #e00034;
|
|
2798
|
+
--ge-table-column-resize-handle-border: rgb(0, 255, 255);
|
|
2799
|
+
--ge-table-dragged-col-div-bg: lightcyan;
|
|
2800
|
+
--ge-table-drop-zone-bg: rgba(244, 255, 242, 0.6);
|
|
2801
|
+
}`,
|
|
2802
|
+
combat: `html[data-theme="combat"] {
|
|
2803
|
+
--ge-table-bg: #101010;
|
|
2804
|
+
--ge-table-header-west-bg: #101010;
|
|
2805
|
+
--ge-table-header-center-bg: #101010;
|
|
2806
|
+
--ge-table-header-east-bg: #101010;
|
|
2807
|
+
--ge-table-header-west-text: oklch(100% 0 0);
|
|
2808
|
+
--ge-table-header-center-text: oklch(100% 0 0);
|
|
2809
|
+
--ge-table-header-east-text: oklch(100% 0 0);
|
|
2810
|
+
--ge-table-header-west-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2811
|
+
--ge-table-header-west-vertical-border: oklch(100% 0 0 / 0%);
|
|
2812
|
+
--ge-table-header-center-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2813
|
+
--ge-table-header-center-vertical-border: oklch(100% 0 0 / 0%);
|
|
2814
|
+
--ge-table-header-east-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2815
|
+
--ge-table-header-east-vertical-border: oklch(100% 0 0 / 0%);
|
|
2816
|
+
--ge-table-body-west-bg: #101010;
|
|
2817
|
+
--ge-table-body-center-bg: #101010;
|
|
2818
|
+
--ge-table-body-east-bg: #101010;
|
|
2819
|
+
--ge-table-body-west-text: #b6b4b4;
|
|
2820
|
+
--ge-table-body-center-text: #b6b4b4;
|
|
2821
|
+
--ge-table-body-east-text: #b6b4b4;
|
|
2822
|
+
--ge-table-body-west-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2823
|
+
--ge-table-body-west-vertical-border: oklch(100% 0 0 / 0%);
|
|
2824
|
+
--ge-table-body-center-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2825
|
+
--ge-table-body-center-vertical-border: oklch(100% 0 0 / 0%);
|
|
2826
|
+
--ge-table-body-east-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2827
|
+
--ge-table-body-east-vertical-border: oklch(100% 0 0 / 0%);
|
|
2828
|
+
--ge-table-body-west-selected-range-bg: oklch(20% 0.2 39.6 / 37%);
|
|
2829
|
+
--ge-table-body-center-selected-range-bg: oklch(20% 0.2 39.6 / 37%);
|
|
2830
|
+
--ge-table-body-east-selected-range-bg: oklch(20% 0.2 39.6 / 37%);
|
|
2831
|
+
--ge-table-body-west-selected-range-text: #f00032;
|
|
2832
|
+
--ge-table-body-center-selected-range-text: #f00032;
|
|
2833
|
+
--ge-table-body-east-selected-range-text: #f00032;
|
|
2834
|
+
--ge-table-footer-west-bg: #101010;
|
|
2835
|
+
--ge-table-footer-center-bg: #101010;
|
|
2836
|
+
--ge-table-footer-east-bg: #101010;
|
|
2837
|
+
--ge-table-footer-west-text: oklch(100% 0 0);
|
|
2838
|
+
--ge-table-footer-center-text: oklch(100% 0 0);
|
|
2839
|
+
--ge-table-footer-east-text: oklch(100% 0 0);
|
|
2840
|
+
--ge-table-footer-west-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2841
|
+
--ge-table-footer-west-vertical-border: oklch(100% 0 0 / 0%);
|
|
2842
|
+
--ge-table-footer-center-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2843
|
+
--ge-table-footer-center-vertical-border: oklch(100% 0 0 / 0%);
|
|
2844
|
+
--ge-table-footer-east-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2845
|
+
--ge-table-footer-east-vertical-border: oklch(100% 0 0 / 0%);
|
|
2846
|
+
--ge-table-border: oklch(100% 0 0 / 0%);
|
|
2847
|
+
--ge-table-row-odd-bg: oklch(100% 0 0 / 0%);
|
|
2848
|
+
--ge-table-row-even-bg: oklch(100% 0 0 / 0%);
|
|
2849
|
+
--ge-table-column-odd-bg: oklch(100% 0 0 / 0%);
|
|
2850
|
+
--ge-table-column-even-bg: oklch(100% 0 0 / 0%);
|
|
2851
|
+
--ge-table-hover-column-bg: oklch(34% 0.25 3.6 / 27%);
|
|
2852
|
+
--ge-table-hover-row-bg: oklch(34% 0.25 3.6 / 27%);
|
|
2853
|
+
--ge-table-focus-border: oklch(40% 0.25 3.6);
|
|
2854
|
+
--ge-table-color-error-text: oklch(65% 0.31 43.2);
|
|
2855
|
+
--ge-table-tree-arrow-collapsed-color: #e00034;
|
|
2856
|
+
--ge-table-column-resize-handle-border: oklch(63% 0.31 43.2);
|
|
2857
|
+
--ge-table-dragged-col-div-bg: #2c2e33;
|
|
2858
|
+
--ge-table-drop-zone-bg: #101010;
|
|
2859
|
+
}`,
|
|
2860
|
+
paper: `html[data-theme="paper"] {
|
|
2861
|
+
--ge-table-bg: #e7e5df;
|
|
2862
|
+
--ge-table-header-west-bg: oklch(80% 0.02 99 / 48%);
|
|
2863
|
+
--ge-table-header-center-bg: oklch(80% 0.02 99 / 48%);
|
|
2864
|
+
--ge-table-header-east-bg: oklch(80% 0.02 99 / 48%);
|
|
2865
|
+
--ge-table-header-west-text: #111;
|
|
2866
|
+
--ge-table-header-center-text: #111;
|
|
2867
|
+
--ge-table-header-east-text: #111;
|
|
2868
|
+
--ge-table-header-west-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2869
|
+
--ge-table-header-west-vertical-border: oklch(100% 0 0 / 0%);
|
|
2870
|
+
--ge-table-header-center-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2871
|
+
--ge-table-header-center-vertical-border: oklch(100% 0 0 / 0%);
|
|
2872
|
+
--ge-table-header-east-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2873
|
+
--ge-table-header-east-vertical-border: oklch(100% 0 0 / 0%);
|
|
2874
|
+
--ge-table-body-west-bg: oklch(80% 0.02 99 / 48%);
|
|
2875
|
+
--ge-table-body-center-bg: #e7e5df;
|
|
2876
|
+
--ge-table-body-east-bg: oklch(80% 0.02 99 / 48%);
|
|
2877
|
+
--ge-table-body-west-text: #000;
|
|
2878
|
+
--ge-table-body-center-text: #000;
|
|
2879
|
+
--ge-table-body-east-text: #000;
|
|
2880
|
+
--ge-table-body-west-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2881
|
+
--ge-table-body-west-vertical-border: oklch(100% 0 0 / 0%);
|
|
2882
|
+
--ge-table-body-center-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2883
|
+
--ge-table-body-center-vertical-border: oklch(100% 0 0 / 0%);
|
|
2884
|
+
--ge-table-body-east-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2885
|
+
--ge-table-body-east-vertical-border: oklch(100% 0 0 / 0%);
|
|
2886
|
+
--ge-table-body-west-selected-range-bg: #cfcdc2;
|
|
2887
|
+
--ge-table-body-center-selected-range-bg: #cfcdc2;
|
|
2888
|
+
--ge-table-body-east-selected-range-bg: #cfcdc2;
|
|
2889
|
+
--ge-table-body-west-selected-range-text: #000;
|
|
2890
|
+
--ge-table-body-center-selected-range-text: #000;
|
|
2891
|
+
--ge-table-body-east-selected-range-text: #000;
|
|
2892
|
+
--ge-table-footer-west-bg: oklch(80% 0.02 99 / 48%);
|
|
2893
|
+
--ge-table-footer-center-bg: oklch(80% 0.02 99 / 48%);
|
|
2894
|
+
--ge-table-footer-east-bg: oklch(80% 0.02 99 / 48%);
|
|
2895
|
+
--ge-table-footer-west-text: #111;
|
|
2896
|
+
--ge-table-footer-center-text: #111;
|
|
2897
|
+
--ge-table-footer-east-text: #111;
|
|
2898
|
+
--ge-table-footer-west-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2899
|
+
--ge-table-footer-west-vertical-border: oklch(100% 0 0 / 0%);
|
|
2900
|
+
--ge-table-footer-center-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2901
|
+
--ge-table-footer-center-vertical-border: oklch(100% 0 0 / 0%);
|
|
2902
|
+
--ge-table-footer-east-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2903
|
+
--ge-table-footer-east-vertical-border: oklch(100% 0 0 / 0%);
|
|
2904
|
+
--ge-table-border: oklch(100% 0 0 / 0%);
|
|
2905
|
+
--ge-table-row-odd-bg: oklch(100% 0 0 / 0%);
|
|
2906
|
+
--ge-table-row-even-bg: oklch(100% 0 0 / 0%);
|
|
2907
|
+
--ge-table-column-odd-bg: oklch(100% 0 0 / 0%);
|
|
2908
|
+
--ge-table-column-even-bg: oklch(100% 0 0 / 0%);
|
|
2909
|
+
--ge-table-hover-column-bg: oklch(5% 0.2 266.40000000000003 / 9%);
|
|
2910
|
+
--ge-table-hover-row-bg: oklch(5% 0.2 266.40000000000003 / 9%);
|
|
2911
|
+
--ge-table-focus-border: oklch(100% 0.19 205.20000000000002);
|
|
2912
|
+
--ge-table-color-error-text: oklch(45% 0.25 43.2);
|
|
2913
|
+
--ge-table-tree-arrow-collapsed-color: #e00034;
|
|
2914
|
+
--ge-table-column-resize-handle-border: oklch(100% 0.19 205.20000000000002 / 71%);
|
|
2915
|
+
--ge-table-dragged-col-div-bg: #2c2e33;
|
|
2916
|
+
--ge-table-drop-zone-bg: #e7e5df;
|
|
2917
|
+
}`,
|
|
2918
|
+
blackboard: `html[data-theme="dark"] {
|
|
2919
|
+
--ge-table-bg: #0c1021;
|
|
2920
|
+
--ge-table-header-west-bg: #0c1021;
|
|
2921
|
+
--ge-table-header-center-bg: #0c1021;
|
|
2922
|
+
--ge-table-header-east-bg: #0c1021;
|
|
2923
|
+
--ge-table-header-west-text: #e0df85;
|
|
2924
|
+
--ge-table-header-center-text: #e0df85;
|
|
2925
|
+
--ge-table-header-east-text: #e0df85;
|
|
2926
|
+
--ge-table-header-west-horizontal-border: transparent;
|
|
2927
|
+
--ge-table-header-west-vertical-border: transparent;
|
|
2928
|
+
--ge-table-header-center-horizontal-border: transparent;
|
|
2929
|
+
--ge-table-header-center-vertical-border: transparent;
|
|
2930
|
+
--ge-table-header-east-horizontal-border: transparent;
|
|
2931
|
+
--ge-table-header-east-vertical-border: transparent;
|
|
2932
|
+
--ge-table-body-west-bg: #0c1021;
|
|
2933
|
+
--ge-table-body-center-bg: #0c1021;
|
|
2934
|
+
--ge-table-body-east-bg: #0c1021;
|
|
2935
|
+
--ge-table-body-west-text: #a7a7a7;
|
|
2936
|
+
--ge-table-body-center-text: #a7a7a7;
|
|
2937
|
+
--ge-table-body-east-text: #a7a7a7;
|
|
2938
|
+
--ge-table-body-west-horizontal-border: transparent;
|
|
2939
|
+
--ge-table-body-west-vertical-border: transparent;
|
|
2940
|
+
--ge-table-body-center-horizontal-border: transparent;
|
|
2941
|
+
--ge-table-body-center-vertical-border: transparent;
|
|
2942
|
+
--ge-table-body-east-horizontal-border: transparent;
|
|
2943
|
+
--ge-table-body-east-vertical-border: transparent;
|
|
2944
|
+
--ge-table-body-west-selected-range-bg: #758129;
|
|
2945
|
+
--ge-table-body-center-selected-range-bg: #758129;
|
|
2946
|
+
--ge-table-body-east-selected-range-bg: #758129;
|
|
2947
|
+
--ge-table-body-west-selected-range-text: oklch(100% 0 0);
|
|
2948
|
+
--ge-table-body-center-selected-range-text: oklch(100% 0 0);
|
|
2949
|
+
--ge-table-body-east-selected-range-text: oklch(100% 0 0);
|
|
2950
|
+
--ge-table-footer-west-bg: #0c1021;
|
|
2951
|
+
--ge-table-footer-center-bg: #0c1021;
|
|
2952
|
+
--ge-table-footer-east-bg: #0c1021;
|
|
2953
|
+
--ge-table-footer-west-text: #e0df85;
|
|
2954
|
+
--ge-table-footer-center-text: #e0df85;
|
|
2955
|
+
--ge-table-footer-east-text: #e0df85;
|
|
2956
|
+
--ge-table-footer-west-horizontal-border: transparent;
|
|
2957
|
+
--ge-table-footer-west-vertical-border: transparent;
|
|
2958
|
+
--ge-table-footer-center-horizontal-border: transparent;
|
|
2959
|
+
--ge-table-footer-center-vertical-border: otransparent;
|
|
2960
|
+
--ge-table-footer-east-horizontal-border: transparent;
|
|
2961
|
+
--ge-table-footer-east-vertical-border: transparent;
|
|
2962
|
+
--ge-table-border: oklch(0% 0 0);
|
|
2963
|
+
--ge-table-row-odd-bg: oklch(100% 0 0 / 0%);
|
|
2964
|
+
--ge-table-row-even-bg: oklch(100% 0 0 / 0%);
|
|
2965
|
+
--ge-table-column-odd-bg: oklch(100% 0 0 / 0%);
|
|
2966
|
+
--ge-table-column-even-bg: oklch(100% 0 0 / 0%);
|
|
2967
|
+
--ge-table-hover-column-bg: #a9a9a9;
|
|
2968
|
+
--ge-table-hover-row-bg: #a9a9a9;
|
|
2969
|
+
--ge-table-focus-border: #e1ff00;
|
|
2970
|
+
--ge-table-color-error-text: #ff0040;
|
|
2971
|
+
--ge-table-tree-arrow-collapsed-color: #e00034;
|
|
2972
|
+
--ge-table-column-resize-handle-border: oklch(0% 0 0);
|
|
2973
|
+
--ge-table-dragged-col-div-bg: #2c2e33;
|
|
2974
|
+
--ge-table-drop-zone-bg: #758129;
|
|
2975
|
+
}`
|
|
2976
|
+
};
|
|
2977
|
+
let K = L;
|
|
2978
|
+
const $ = class $ {
|
|
2979
|
+
constructor(e = new Q()) {
|
|
2980
|
+
this.headerGroupOptions = e;
|
|
2071
2981
|
}
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
scrollToIndex(e, t) {
|
|
2080
|
-
const i = this.tableModel.getAreaModel("body").getYPosByRowIndex(t);
|
|
2081
|
-
this.scrollToPixel(0, i);
|
|
2982
|
+
render(e, t, o, s, i, r, a) {
|
|
2983
|
+
const l = r != null && r.data ? r.data : "";
|
|
2984
|
+
if (r) {
|
|
2985
|
+
const { toggle: n, visibility: d, closed: h } = r, g = n ? $.toggleHeaderGroup : "";
|
|
2986
|
+
this.addText(e, s, t, o, l, g), n && d !== "always" && this.addArrowDiv(a, e, !h, t, o, s, g);
|
|
2987
|
+
} else
|
|
2988
|
+
this.addText(e, s, t, o, l, "");
|
|
2082
2989
|
}
|
|
2083
|
-
|
|
2084
|
-
|
|
2990
|
+
addText(e, t, o, s, i, r) {
|
|
2991
|
+
e.innerHTML = `<span
|
|
2992
|
+
data-ge-action="${r}"
|
|
2993
|
+
data-area="${t}"
|
|
2994
|
+
data-row-index="${o}"
|
|
2995
|
+
data-col-index="${s}"
|
|
2996
|
+
>${i}</span>`;
|
|
2997
|
+
}
|
|
2998
|
+
addArrowDiv(e, t, o = !0, s = -1, i = -1, r = "header", a) {
|
|
2999
|
+
const l = e.createElement("div");
|
|
3000
|
+
e.addClass(l, "ge-table-toggle-icon-div"), e.setStyle(l, "display", "inline-block"), e.setStyle(l, "position", ""), e.setStyle(l, "width", "20px"), e.setStyle(l, "background", "transparent"), e.setStyle(l, "cursor", "pointer"), e.setAttribute(l, "data-row-index", `${s}`), e.setAttribute(l, "data-col-index", `${i}`), e.setAttribute(l, "data-area", `${r}`), e.setAttribute(l, "data-ge-action", `${a}`);
|
|
3001
|
+
let n;
|
|
3002
|
+
o ? n = this.headerGroupOptions.iconExpanded : n = this.headerGroupOptions.iconCollapsed;
|
|
3003
|
+
const d = n.content, h = e.createText(d);
|
|
3004
|
+
e.appendChild(l, h), n.style && this.applyStyleString(e, l, n.style);
|
|
3005
|
+
for (const g of n.classes)
|
|
3006
|
+
e.addClass(l, g);
|
|
3007
|
+
return e.appendChild(t, l), l;
|
|
3008
|
+
}
|
|
3009
|
+
applyStyleString(e, t, o) {
|
|
3010
|
+
const s = o.split(";").map((i) => i.trim()).filter((i) => i);
|
|
3011
|
+
for (const i of s) {
|
|
3012
|
+
const [r, a] = i.split(":");
|
|
3013
|
+
e.setStyle(t, r.trim(), a.trim());
|
|
3014
|
+
}
|
|
3015
|
+
}
|
|
3016
|
+
};
|
|
3017
|
+
$.toggleHeaderGroup = "toggleHeaderGroup";
|
|
3018
|
+
let Y = $;
|
|
3019
|
+
const ke = ee({
|
|
2085
3020
|
inheritAttrs: !1,
|
|
2086
3021
|
props: {
|
|
2087
3022
|
tableModel: {
|
|
@@ -2089,7 +3024,7 @@ const Ee = Y({
|
|
|
2089
3024
|
},
|
|
2090
3025
|
tableOptions: {
|
|
2091
3026
|
required: !1,
|
|
2092
|
-
default: new
|
|
3027
|
+
default: new Z()
|
|
2093
3028
|
},
|
|
2094
3029
|
debounceMouseClickDelay: {
|
|
2095
3030
|
required: !1,
|
|
@@ -2107,96 +3042,103 @@ const Ee = Y({
|
|
|
2107
3042
|
"checkboxChanged",
|
|
2108
3043
|
"contextmenu",
|
|
2109
3044
|
"modelChanged",
|
|
3045
|
+
"focusChanged",
|
|
3046
|
+
"selectionChanged",
|
|
2110
3047
|
"mouseDraggingEnd",
|
|
2111
3048
|
"mouseMoved"
|
|
2112
3049
|
],
|
|
2113
|
-
setup(
|
|
2114
|
-
const t =
|
|
2115
|
-
const
|
|
2116
|
-
|
|
2117
|
-
e("
|
|
3050
|
+
setup(c, { emit: e }) {
|
|
3051
|
+
const t = te(null), o = (s) => {
|
|
3052
|
+
const i = {
|
|
3053
|
+
onSelectionChanged: (a) => {
|
|
3054
|
+
e("selectionChanged", a);
|
|
2118
3055
|
},
|
|
2119
|
-
|
|
2120
|
-
e("
|
|
3056
|
+
onFocusChanged: (a) => {
|
|
3057
|
+
e("focusChanged", a);
|
|
2121
3058
|
},
|
|
2122
|
-
|
|
2123
|
-
e("
|
|
3059
|
+
onCheckboxChanged: (a) => {
|
|
3060
|
+
e("checkboxChanged", a);
|
|
2124
3061
|
},
|
|
2125
|
-
|
|
2126
|
-
e("
|
|
3062
|
+
onContextmenu: (a) => {
|
|
3063
|
+
e("contextmenu", a);
|
|
2127
3064
|
},
|
|
2128
|
-
|
|
2129
|
-
e("
|
|
3065
|
+
onModelChanged: (a) => {
|
|
3066
|
+
e("modelChanged", a);
|
|
2130
3067
|
},
|
|
2131
|
-
|
|
2132
|
-
e("
|
|
3068
|
+
onMouseClicked: (a) => {
|
|
3069
|
+
e("mouseClicked", a);
|
|
2133
3070
|
},
|
|
2134
|
-
|
|
2135
|
-
e("
|
|
3071
|
+
onMouseDragging: (a) => {
|
|
3072
|
+
e("mouseDragging", a);
|
|
3073
|
+
},
|
|
3074
|
+
onMouseDraggingEnd: (a) => {
|
|
3075
|
+
e("mouseDraggingEnd", a);
|
|
3076
|
+
},
|
|
3077
|
+
onMouseMoved: (a) => {
|
|
3078
|
+
e("mouseMoved", a);
|
|
2136
3079
|
}
|
|
2137
|
-
},
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
new
|
|
2141
|
-
|
|
2142
|
-
|
|
3080
|
+
}, r = new z(
|
|
3081
|
+
s,
|
|
3082
|
+
c.tableModel,
|
|
3083
|
+
new J(),
|
|
3084
|
+
c.tableOptions,
|
|
3085
|
+
i
|
|
2143
3086
|
);
|
|
2144
|
-
|
|
3087
|
+
r.firstInit(), e("tableReady", r.getApi());
|
|
2145
3088
|
};
|
|
2146
|
-
return
|
|
2147
|
-
t.value &&
|
|
2148
|
-
}),
|
|
3089
|
+
return oe(() => {
|
|
3090
|
+
t.value && o(t.value);
|
|
3091
|
+
}), c.licenseKey && k.getInstance().setLicenseKey(c.licenseKey), {
|
|
2149
3092
|
root: t
|
|
2150
3093
|
};
|
|
2151
3094
|
}
|
|
2152
|
-
})
|
|
2153
|
-
const
|
|
2154
|
-
const
|
|
2155
|
-
|
|
2156
|
-
t[s] = i;
|
|
3095
|
+
}), Ie = (c, e) => {
|
|
3096
|
+
const t = c.__vccOpts || c;
|
|
3097
|
+
for (const [o, s] of e)
|
|
3098
|
+
t[o] = s;
|
|
2157
3099
|
return t;
|
|
2158
|
-
},
|
|
3100
|
+
}, Fe = {
|
|
2159
3101
|
ref: "root",
|
|
2160
3102
|
class: "container-div",
|
|
2161
3103
|
style: { width: "100%", height: "100%", "background-color": "transparent", padding: "0", margin: "0" }
|
|
2162
3104
|
};
|
|
2163
|
-
function
|
|
2164
|
-
return
|
|
3105
|
+
function Oe(c, e, t, o, s, i) {
|
|
3106
|
+
return se(), ie("div", Fe, null, 512);
|
|
2165
3107
|
}
|
|
2166
|
-
const
|
|
2167
|
-
class
|
|
3108
|
+
const Le = /* @__PURE__ */ Ie(ke, [["render", Oe]]);
|
|
3109
|
+
class Be {
|
|
2168
3110
|
constructor(e, t) {
|
|
2169
3111
|
this.component = e, this.appContext = t;
|
|
2170
3112
|
}
|
|
2171
|
-
render(e, t, s, i,
|
|
3113
|
+
render(e, t, o, s, i, r, a) {
|
|
2172
3114
|
return this.mount(
|
|
2173
3115
|
this.component,
|
|
2174
3116
|
{
|
|
2175
3117
|
cellDiv: e,
|
|
2176
3118
|
rowIndex: t,
|
|
2177
|
-
columnIndex:
|
|
2178
|
-
areaIdent:
|
|
2179
|
-
areaModel:
|
|
2180
|
-
cellValue:
|
|
3119
|
+
columnIndex: o,
|
|
3120
|
+
areaIdent: s,
|
|
3121
|
+
areaModel: i,
|
|
3122
|
+
cellValue: r
|
|
2181
3123
|
},
|
|
2182
3124
|
this.appContext,
|
|
2183
3125
|
e
|
|
2184
3126
|
);
|
|
2185
3127
|
}
|
|
2186
|
-
mount(e, t,
|
|
2187
|
-
let
|
|
2188
|
-
return
|
|
2189
|
-
|
|
3128
|
+
mount(e, t, o, s) {
|
|
3129
|
+
let i = re(e, t);
|
|
3130
|
+
return i.appContext = o, j(i, s), () => {
|
|
3131
|
+
s && j(null, s);
|
|
2190
3132
|
};
|
|
2191
3133
|
}
|
|
2192
3134
|
}
|
|
2193
|
-
const
|
|
2194
|
-
install: (
|
|
2195
|
-
|
|
3135
|
+
const He = {
|
|
3136
|
+
install: (c, e = { img: "" }) => {
|
|
3137
|
+
c.component("GuiexpertTable", Le);
|
|
2196
3138
|
}
|
|
2197
3139
|
};
|
|
2198
3140
|
export {
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
3141
|
+
Be as ComponentRendererWrapper,
|
|
3142
|
+
Le as GuiexpertTable,
|
|
3143
|
+
He as default
|
|
2202
3144
|
};
|