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