@guiexpert/solid-table 1.0.11 → 1.0.13
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/GuiexpertTable.d.ts +6 -0
- package/GuiexpertTableProps.d.ts +1 -0
- package/index.cjs +3 -3
- package/index.js +669 -341
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
const
|
|
2
|
-
equals:
|
|
1
|
+
const xe = (l, e) => l === e, J = Symbol("solid-proxy"), he = {
|
|
2
|
+
equals: xe
|
|
3
3
|
};
|
|
4
|
-
let
|
|
5
|
-
const L = 1,
|
|
4
|
+
let pe = Se;
|
|
5
|
+
const L = 1, N = 2, fe = {
|
|
6
6
|
owned: null,
|
|
7
7
|
cleanups: null,
|
|
8
8
|
context: null,
|
|
9
9
|
owner: null
|
|
10
10
|
};
|
|
11
11
|
var A = null;
|
|
12
|
-
let
|
|
13
|
-
function
|
|
14
|
-
const t = b, s = A, i = l.length === 0, o = e === void 0 ? s : e, r = i ?
|
|
12
|
+
let U = null, b = null, x = null, F = null, K = 0;
|
|
13
|
+
function Ee(l, e) {
|
|
14
|
+
const t = b, s = A, i = l.length === 0, o = e === void 0 ? s : e, r = i ? fe : {
|
|
15
15
|
owned: null,
|
|
16
16
|
cleanups: null,
|
|
17
17
|
context: o ? o.context : null,
|
|
18
18
|
owner: o
|
|
19
|
-
}, n = i ? l : () => l(() =>
|
|
19
|
+
}, n = i ? l : () => l(() => W(() => z(r)));
|
|
20
20
|
A = r, b = null;
|
|
21
21
|
try {
|
|
22
|
-
return
|
|
22
|
+
return V(n, !0);
|
|
23
23
|
} finally {
|
|
24
24
|
b = t, A = s;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const s =
|
|
29
|
-
|
|
27
|
+
function Q(l, e, t) {
|
|
28
|
+
const s = se(l, e, !1, L);
|
|
29
|
+
H(s);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
const s =
|
|
34
|
-
(!t || !t.render) && (s.user = !0), F ? F.push(s) :
|
|
31
|
+
function Ae(l, e, t) {
|
|
32
|
+
pe = Fe;
|
|
33
|
+
const s = se(l, e, !1, L);
|
|
34
|
+
(!t || !t.render) && (s.user = !0), F ? F.push(s) : H(s);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
t = t ? Object.assign({},
|
|
38
|
-
const s =
|
|
39
|
-
return s.observers = null, s.observerSlots = null, s.comparator = t.equals || void 0,
|
|
36
|
+
function Me(l, e, t) {
|
|
37
|
+
t = t ? Object.assign({}, he, t) : he;
|
|
38
|
+
const s = se(l, e, !0, 0);
|
|
39
|
+
return s.observers = null, s.observerSlots = null, s.comparator = t.equals || void 0, H(s), Te.bind(s);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function W(l) {
|
|
42
42
|
if (b === null)
|
|
43
43
|
return l();
|
|
44
44
|
const e = b;
|
|
@@ -49,16 +49,16 @@ function P(l) {
|
|
|
49
49
|
b = e;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
52
|
+
function Re(l) {
|
|
53
|
+
Ae(() => W(l));
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Te() {
|
|
56
56
|
if (this.sources && this.state)
|
|
57
57
|
if (this.state === L)
|
|
58
|
-
|
|
58
|
+
H(this);
|
|
59
59
|
else {
|
|
60
|
-
const l =
|
|
61
|
-
|
|
60
|
+
const l = x;
|
|
61
|
+
x = null, V(() => j(this), !1), x = l;
|
|
62
62
|
}
|
|
63
63
|
if (b) {
|
|
64
64
|
const l = this.observers ? this.observers.length : 0;
|
|
@@ -66,34 +66,42 @@ function Me() {
|
|
|
66
66
|
}
|
|
67
67
|
return this.value;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function De(l, e, t) {
|
|
70
70
|
let s = l.value;
|
|
71
|
-
return (!l.comparator || !l.comparator(s, e)) && (l.value = e, l.observers && l.observers.length &&
|
|
71
|
+
return (!l.comparator || !l.comparator(s, e)) && (l.value = e, l.observers && l.observers.length && V(() => {
|
|
72
72
|
for (let i = 0; i < l.observers.length; i += 1) {
|
|
73
|
-
const o = l.observers[i], r =
|
|
74
|
-
r &&
|
|
73
|
+
const o = l.observers[i], r = U && U.running;
|
|
74
|
+
r && U.disposed.has(o), (r ? !o.tState : !o.state) && (o.pure ? x.push(o) : F.push(o), o.observers && ge(o)), r || (o.state = L);
|
|
75
75
|
}
|
|
76
|
-
if (
|
|
77
|
-
throw
|
|
76
|
+
if (x.length > 1e6)
|
|
77
|
+
throw x = [], new Error();
|
|
78
78
|
}, !1)), e;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function H(l) {
|
|
81
81
|
if (!l.fn)
|
|
82
82
|
return;
|
|
83
|
-
|
|
84
|
-
const e =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
z(l);
|
|
84
|
+
const e = K;
|
|
85
|
+
Ie(
|
|
86
|
+
l,
|
|
87
|
+
l.value,
|
|
88
|
+
e
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
function Ie(l, e, t) {
|
|
88
92
|
let s;
|
|
93
|
+
const i = A, o = b;
|
|
94
|
+
b = A = l;
|
|
89
95
|
try {
|
|
90
96
|
s = l.fn(e);
|
|
91
|
-
} catch (
|
|
92
|
-
return l.pure && (l.state = L, l.owned && l.owned.forEach(
|
|
97
|
+
} catch (r) {
|
|
98
|
+
return l.pure && (l.state = L, l.owned && l.owned.forEach(z), l.owned = null), l.updatedAt = t + 1, me(r);
|
|
99
|
+
} finally {
|
|
100
|
+
b = o, A = i;
|
|
93
101
|
}
|
|
94
|
-
(!l.updatedAt || l.updatedAt <= t) && (l.updatedAt != null && "observers" in l ?
|
|
102
|
+
(!l.updatedAt || l.updatedAt <= t) && (l.updatedAt != null && "observers" in l ? De(l, s) : l.value = s, l.updatedAt = t);
|
|
95
103
|
}
|
|
96
|
-
function
|
|
104
|
+
function se(l, e, t, s = L, i) {
|
|
97
105
|
const o = {
|
|
98
106
|
fn: l,
|
|
99
107
|
state: s,
|
|
@@ -107,74 +115,74 @@ function te(l, e, t, s = L, i) {
|
|
|
107
115
|
context: A ? A.context : null,
|
|
108
116
|
pure: t
|
|
109
117
|
};
|
|
110
|
-
return A === null || A !==
|
|
118
|
+
return A === null || A !== fe && (A.owned ? A.owned.push(o) : A.owned = [o]), o;
|
|
111
119
|
}
|
|
112
|
-
function
|
|
120
|
+
function _(l) {
|
|
113
121
|
if (l.state === 0)
|
|
114
122
|
return;
|
|
115
|
-
if (l.state ===
|
|
116
|
-
return
|
|
117
|
-
if (l.suspense &&
|
|
123
|
+
if (l.state === N)
|
|
124
|
+
return j(l);
|
|
125
|
+
if (l.suspense && W(l.suspense.inFallback))
|
|
118
126
|
return l.suspense.effects.push(l);
|
|
119
127
|
const e = [l];
|
|
120
|
-
for (; (l = l.owner) && (!l.updatedAt || l.updatedAt <
|
|
128
|
+
for (; (l = l.owner) && (!l.updatedAt || l.updatedAt < K); )
|
|
121
129
|
l.state && e.push(l);
|
|
122
130
|
for (let t = e.length - 1; t >= 0; t--)
|
|
123
131
|
if (l = e[t], l.state === L)
|
|
124
|
-
|
|
125
|
-
else if (l.state ===
|
|
126
|
-
const s =
|
|
127
|
-
|
|
132
|
+
H(l);
|
|
133
|
+
else if (l.state === N) {
|
|
134
|
+
const s = x;
|
|
135
|
+
x = null, V(() => j(l, e[0]), !1), x = s;
|
|
128
136
|
}
|
|
129
137
|
}
|
|
130
|
-
function
|
|
131
|
-
if (
|
|
138
|
+
function V(l, e) {
|
|
139
|
+
if (x)
|
|
132
140
|
return l();
|
|
133
141
|
let t = !1;
|
|
134
|
-
e || (
|
|
142
|
+
e || (x = []), F ? t = !0 : F = [], K++;
|
|
135
143
|
try {
|
|
136
144
|
const s = l();
|
|
137
|
-
return
|
|
145
|
+
return Oe(t), s;
|
|
138
146
|
} catch (s) {
|
|
139
|
-
t || (F = null),
|
|
147
|
+
t || (F = null), x = null, me(s);
|
|
140
148
|
}
|
|
141
149
|
}
|
|
142
|
-
function
|
|
143
|
-
if (
|
|
150
|
+
function Oe(l) {
|
|
151
|
+
if (x && (Se(x), x = null), l)
|
|
144
152
|
return;
|
|
145
153
|
const e = F;
|
|
146
|
-
F = null, e.length &&
|
|
154
|
+
F = null, e.length && V(() => pe(e), !1);
|
|
147
155
|
}
|
|
148
|
-
function
|
|
156
|
+
function Se(l) {
|
|
149
157
|
for (let e = 0; e < l.length; e++)
|
|
150
|
-
|
|
158
|
+
_(l[e]);
|
|
151
159
|
}
|
|
152
|
-
function
|
|
160
|
+
function Fe(l) {
|
|
153
161
|
let e, t = 0;
|
|
154
162
|
for (e = 0; e < l.length; e++) {
|
|
155
163
|
const s = l[e];
|
|
156
|
-
s.user ? l[t++] = s :
|
|
164
|
+
s.user ? l[t++] = s : _(s);
|
|
157
165
|
}
|
|
158
166
|
for (e = 0; e < t; e++)
|
|
159
|
-
|
|
167
|
+
_(l[e]);
|
|
160
168
|
}
|
|
161
|
-
function
|
|
169
|
+
function j(l, e) {
|
|
162
170
|
l.state = 0;
|
|
163
171
|
for (let t = 0; t < l.sources.length; t += 1) {
|
|
164
172
|
const s = l.sources[t];
|
|
165
173
|
if (s.sources) {
|
|
166
174
|
const i = s.state;
|
|
167
|
-
i === L ? s !== e && (!s.updatedAt || s.updatedAt <
|
|
175
|
+
i === L ? s !== e && (!s.updatedAt || s.updatedAt < K) && _(s) : i === N && j(s, e);
|
|
168
176
|
}
|
|
169
177
|
}
|
|
170
178
|
}
|
|
171
|
-
function
|
|
179
|
+
function ge(l) {
|
|
172
180
|
for (let e = 0; e < l.observers.length; e += 1) {
|
|
173
181
|
const t = l.observers[e];
|
|
174
|
-
t.state || (t.state =
|
|
182
|
+
t.state || (t.state = N, t.pure ? x.push(t) : F.push(t), t.observers && ge(t));
|
|
175
183
|
}
|
|
176
184
|
}
|
|
177
|
-
function
|
|
185
|
+
function z(l) {
|
|
178
186
|
let e;
|
|
179
187
|
if (l.sources)
|
|
180
188
|
for (; l.sources.length; ) {
|
|
@@ -186,7 +194,7 @@ function K(l) {
|
|
|
186
194
|
}
|
|
187
195
|
if (l.owned) {
|
|
188
196
|
for (e = l.owned.length - 1; e >= 0; e--)
|
|
189
|
-
|
|
197
|
+
z(l.owned[e]);
|
|
190
198
|
l.owned = null;
|
|
191
199
|
}
|
|
192
200
|
if (l.cleanups) {
|
|
@@ -196,26 +204,26 @@ function K(l) {
|
|
|
196
204
|
}
|
|
197
205
|
l.state = 0;
|
|
198
206
|
}
|
|
199
|
-
function
|
|
207
|
+
function Le(l) {
|
|
200
208
|
return l instanceof Error ? l : new Error(typeof l == "string" ? l : "Unknown error", {
|
|
201
209
|
cause: l
|
|
202
210
|
});
|
|
203
211
|
}
|
|
204
|
-
function
|
|
205
|
-
throw
|
|
212
|
+
function me(l, e = A) {
|
|
213
|
+
throw Le(l);
|
|
206
214
|
}
|
|
207
|
-
function
|
|
215
|
+
function k() {
|
|
208
216
|
return !0;
|
|
209
217
|
}
|
|
210
|
-
const
|
|
218
|
+
const $e = {
|
|
211
219
|
get(l, e, t) {
|
|
212
|
-
return e ===
|
|
220
|
+
return e === J ? t : l.get(e);
|
|
213
221
|
},
|
|
214
222
|
has(l, e) {
|
|
215
|
-
return e ===
|
|
223
|
+
return e === J ? !0 : l.has(e);
|
|
216
224
|
},
|
|
217
|
-
set:
|
|
218
|
-
deleteProperty:
|
|
225
|
+
set: k,
|
|
226
|
+
deleteProperty: k,
|
|
219
227
|
getOwnPropertyDescriptor(l, e) {
|
|
220
228
|
return {
|
|
221
229
|
configurable: !0,
|
|
@@ -223,52 +231,55 @@ const Fe = {
|
|
|
223
231
|
get() {
|
|
224
232
|
return l.get(e);
|
|
225
233
|
},
|
|
226
|
-
set:
|
|
227
|
-
deleteProperty:
|
|
234
|
+
set: k,
|
|
235
|
+
deleteProperty: k
|
|
228
236
|
};
|
|
229
237
|
},
|
|
230
238
|
ownKeys(l) {
|
|
231
239
|
return l.keys();
|
|
232
240
|
}
|
|
233
241
|
};
|
|
234
|
-
function
|
|
242
|
+
function q(l) {
|
|
235
243
|
return (l = typeof l == "function" ? l() : l) ? l : {};
|
|
236
244
|
}
|
|
237
|
-
function
|
|
245
|
+
function Be() {
|
|
238
246
|
for (let l = 0, e = this.length; l < e; ++l) {
|
|
239
247
|
const t = this[l]();
|
|
240
248
|
if (t !== void 0)
|
|
241
249
|
return t;
|
|
242
250
|
}
|
|
243
251
|
}
|
|
244
|
-
function
|
|
252
|
+
function be(...l) {
|
|
245
253
|
let e = !1;
|
|
246
254
|
for (let o = 0; o < l.length; o++) {
|
|
247
255
|
const r = l[o];
|
|
248
|
-
e = e || !!r &&
|
|
256
|
+
e = e || !!r && J in r, l[o] = typeof r == "function" ? (e = !0, Me(r)) : r;
|
|
249
257
|
}
|
|
250
258
|
if (e)
|
|
251
|
-
return new Proxy(
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
259
|
+
return new Proxy(
|
|
260
|
+
{
|
|
261
|
+
get(o) {
|
|
262
|
+
for (let r = l.length - 1; r >= 0; r--) {
|
|
263
|
+
const n = q(l[r])[o];
|
|
264
|
+
if (n !== void 0)
|
|
265
|
+
return n;
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
has(o) {
|
|
269
|
+
for (let r = l.length - 1; r >= 0; r--)
|
|
270
|
+
if (o in q(l[r]))
|
|
271
|
+
return !0;
|
|
272
|
+
return !1;
|
|
273
|
+
},
|
|
274
|
+
keys() {
|
|
275
|
+
const o = [];
|
|
276
|
+
for (let r = 0; r < l.length; r++)
|
|
277
|
+
o.push(...Object.keys(q(l[r])));
|
|
278
|
+
return [...new Set(o)];
|
|
257
279
|
}
|
|
258
280
|
},
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
if (o in U(l[r]))
|
|
262
|
-
return !0;
|
|
263
|
-
return !1;
|
|
264
|
-
},
|
|
265
|
-
keys() {
|
|
266
|
-
const o = [];
|
|
267
|
-
for (let r = 0; r < l.length; r++)
|
|
268
|
-
o.push(...Object.keys(U(l[r])));
|
|
269
|
-
return [...new Set(o)];
|
|
270
|
-
}
|
|
271
|
-
}, Fe);
|
|
281
|
+
$e
|
|
282
|
+
);
|
|
272
283
|
const t = {}, s = {}, i = /* @__PURE__ */ new Set();
|
|
273
284
|
for (let o = l.length - 1; o >= 0; o--) {
|
|
274
285
|
const r = l[o];
|
|
@@ -284,7 +295,7 @@ function ge(...l) {
|
|
|
284
295
|
c.get ? (i.add(d), Object.defineProperty(t, d, {
|
|
285
296
|
enumerable: !0,
|
|
286
297
|
configurable: !0,
|
|
287
|
-
get:
|
|
298
|
+
get: Be.bind(s[d] = [c.get.bind(r)])
|
|
288
299
|
})) : (c.value !== void 0 && i.add(d), t[d] = c.value);
|
|
289
300
|
else {
|
|
290
301
|
const p = s[d];
|
|
@@ -294,7 +305,7 @@ function ge(...l) {
|
|
|
294
305
|
}
|
|
295
306
|
return t;
|
|
296
307
|
}
|
|
297
|
-
function
|
|
308
|
+
function Pe(l, e, t) {
|
|
298
309
|
let s = t.length, i = e.length, o = s, r = 0, n = 0, a = e[i - 1].nextSibling, h = null;
|
|
299
310
|
for (; r < i || n < o; ) {
|
|
300
311
|
if (e[r] === t[n]) {
|
|
@@ -339,31 +350,31 @@ function $e(l, e, t) {
|
|
|
339
350
|
}
|
|
340
351
|
}
|
|
341
352
|
}
|
|
342
|
-
function
|
|
353
|
+
function We(l, e, t, s = {}) {
|
|
343
354
|
let i;
|
|
344
|
-
return
|
|
345
|
-
i = o, e === document ? l() :
|
|
355
|
+
return Ee((o) => {
|
|
356
|
+
i = o, e === document ? l() : Ge(e, l(), e.firstChild ? null : void 0, t);
|
|
346
357
|
}, s.owner), () => {
|
|
347
358
|
i(), e.textContent = "";
|
|
348
359
|
};
|
|
349
360
|
}
|
|
350
|
-
function
|
|
361
|
+
function He(l, e, t) {
|
|
351
362
|
let s;
|
|
352
363
|
const i = () => {
|
|
353
364
|
const r = document.createElement("template");
|
|
354
365
|
return r.innerHTML = l, t ? r.content.firstChild.firstChild : r.content.firstChild;
|
|
355
|
-
}, o = e ? () =>
|
|
366
|
+
}, o = e ? () => W(() => document.importNode(s || (s = i()), !0)) : () => (s || (s = i())).cloneNode(!0);
|
|
356
367
|
return o.cloneNode = o, o;
|
|
357
368
|
}
|
|
358
|
-
function
|
|
359
|
-
return
|
|
369
|
+
function Ve(l, e, t) {
|
|
370
|
+
return W(() => l(e, t));
|
|
360
371
|
}
|
|
361
|
-
function
|
|
372
|
+
function Ge(l, e, t, s) {
|
|
362
373
|
if (t !== void 0 && !s && (s = []), typeof e != "function")
|
|
363
|
-
return
|
|
364
|
-
|
|
374
|
+
return X(l, e, s, t);
|
|
375
|
+
Q((i) => X(l, e(), i, t), s);
|
|
365
376
|
}
|
|
366
|
-
function
|
|
377
|
+
function X(l, e, t, s, i) {
|
|
367
378
|
for (; typeof t == "function"; )
|
|
368
379
|
t = t();
|
|
369
380
|
if (e === t)
|
|
@@ -372,34 +383,34 @@ function j(l, e, t, s, i) {
|
|
|
372
383
|
if (l = r && t[0] && t[0].parentNode || l, o === "string" || o === "number")
|
|
373
384
|
if (o === "number" && (e = e.toString()), r) {
|
|
374
385
|
let n = t[0];
|
|
375
|
-
n && n.nodeType === 3 ? n.data = e : n = document.createTextNode(e), t =
|
|
386
|
+
n && n.nodeType === 3 ? n.data = e : n = document.createTextNode(e), t = P(l, t, s, n);
|
|
376
387
|
} else
|
|
377
388
|
t !== "" && typeof t == "string" ? t = l.firstChild.data = e : t = l.textContent = e;
|
|
378
389
|
else if (e == null || o === "boolean")
|
|
379
|
-
t =
|
|
390
|
+
t = P(l, t, s);
|
|
380
391
|
else {
|
|
381
392
|
if (o === "function")
|
|
382
|
-
return
|
|
393
|
+
return Q(() => {
|
|
383
394
|
let n = e();
|
|
384
395
|
for (; typeof n == "function"; )
|
|
385
396
|
n = n();
|
|
386
|
-
t =
|
|
397
|
+
t = X(l, n, t, s);
|
|
387
398
|
}), () => t;
|
|
388
399
|
if (Array.isArray(e)) {
|
|
389
400
|
const n = [], a = t && Array.isArray(t);
|
|
390
|
-
if (
|
|
391
|
-
return
|
|
401
|
+
if (Z(n, e, t, i))
|
|
402
|
+
return Q(() => t = X(l, n, t, s, !0)), () => t;
|
|
392
403
|
if (n.length === 0) {
|
|
393
|
-
if (t =
|
|
404
|
+
if (t = P(l, t, s), r)
|
|
394
405
|
return t;
|
|
395
406
|
} else
|
|
396
|
-
a ? t.length === 0 ?
|
|
407
|
+
a ? t.length === 0 ? ce(l, n, s) : Pe(l, t, n) : (t && P(l), ce(l, n));
|
|
397
408
|
t = n;
|
|
398
409
|
} else if (e.nodeType) {
|
|
399
410
|
if (Array.isArray(t)) {
|
|
400
411
|
if (r)
|
|
401
|
-
return t =
|
|
402
|
-
|
|
412
|
+
return t = P(l, t, s, e);
|
|
413
|
+
P(l, t, null, e);
|
|
403
414
|
} else
|
|
404
415
|
t == null || t === "" || !l.firstChild ? l.appendChild(e) : l.replaceChild(e, l.firstChild);
|
|
405
416
|
t = e;
|
|
@@ -407,7 +418,7 @@ function j(l, e, t, s, i) {
|
|
|
407
418
|
}
|
|
408
419
|
return t;
|
|
409
420
|
}
|
|
410
|
-
function
|
|
421
|
+
function Z(l, e, t, s) {
|
|
411
422
|
let i = !1;
|
|
412
423
|
for (let o = 0, r = e.length; o < r; o++) {
|
|
413
424
|
let n = e[o], a = t && t[o], h;
|
|
@@ -415,12 +426,16 @@ function Q(l, e, t, s) {
|
|
|
415
426
|
if ((h = typeof n) == "object" && n.nodeType)
|
|
416
427
|
l.push(n);
|
|
417
428
|
else if (Array.isArray(n))
|
|
418
|
-
i =
|
|
429
|
+
i = Z(l, n, a) || i;
|
|
419
430
|
else if (h === "function")
|
|
420
431
|
if (s) {
|
|
421
432
|
for (; typeof n == "function"; )
|
|
422
433
|
n = n();
|
|
423
|
-
i =
|
|
434
|
+
i = Z(
|
|
435
|
+
l,
|
|
436
|
+
Array.isArray(n) ? n : [n],
|
|
437
|
+
Array.isArray(a) ? a : [a]
|
|
438
|
+
) || i;
|
|
424
439
|
} else
|
|
425
440
|
l.push(n), i = !0;
|
|
426
441
|
else {
|
|
@@ -430,11 +445,11 @@ function Q(l, e, t, s) {
|
|
|
430
445
|
}
|
|
431
446
|
return i;
|
|
432
447
|
}
|
|
433
|
-
function
|
|
448
|
+
function ce(l, e, t = null) {
|
|
434
449
|
for (let s = 0, i = e.length; s < i; s++)
|
|
435
450
|
l.insertBefore(e[s], t);
|
|
436
451
|
}
|
|
437
|
-
function
|
|
452
|
+
function P(l, e, t, s) {
|
|
438
453
|
if (t === void 0)
|
|
439
454
|
return l.textContent = "";
|
|
440
455
|
const i = s || document.createTextNode("");
|
|
@@ -452,39 +467,64 @@ function B(l, e, t, s) {
|
|
|
452
467
|
l.insertBefore(i, t);
|
|
453
468
|
return [i];
|
|
454
469
|
}
|
|
455
|
-
class
|
|
470
|
+
class ut {
|
|
456
471
|
constructor(e) {
|
|
457
472
|
this.code = e;
|
|
458
473
|
}
|
|
459
474
|
render(e, t, s, i, o, r, n) {
|
|
460
|
-
const a =
|
|
475
|
+
const a = be({
|
|
461
476
|
rowIndex: t,
|
|
462
477
|
columnIndex: s,
|
|
463
478
|
areaIdent: i,
|
|
464
479
|
areaModel: o,
|
|
465
480
|
cellValue: r
|
|
466
481
|
});
|
|
467
|
-
|
|
482
|
+
We(
|
|
468
483
|
() => this.code(a),
|
|
469
484
|
e
|
|
470
485
|
);
|
|
471
486
|
}
|
|
472
487
|
}
|
|
473
|
-
const
|
|
488
|
+
const pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
474
489
|
__proto__: null
|
|
475
490
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
476
|
-
|
|
477
|
-
|
|
491
|
+
class $ {
|
|
492
|
+
// The constructor is private to prevent direct construction calls
|
|
493
|
+
// with the `new` operator
|
|
494
|
+
constructor() {
|
|
495
|
+
this.alreadySet = !1;
|
|
496
|
+
}
|
|
497
|
+
static getInstance() {
|
|
498
|
+
return $.instance || ($.instance = new $()), $.instance;
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Method to set the license key for the application.
|
|
502
|
+
* A 'meta' element is created with content as 'guiexperttable=<license key>'
|
|
503
|
+
* and appended into the head section of the document
|
|
504
|
+
*
|
|
505
|
+
* @param {string} key - The license key to set for the application.
|
|
506
|
+
*
|
|
507
|
+
* @return {void} - This method does not return anything
|
|
508
|
+
*/
|
|
509
|
+
setLicenseKey(e) {
|
|
510
|
+
if (e && !this.alreadySet) {
|
|
511
|
+
const t = document.createElement("meta");
|
|
512
|
+
t.content = "license=" + e, t.name = "guiexperttable", document.getElementsByTagName("head")[0].appendChild(t), this.alreadySet = !0;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
478
515
|
}
|
|
479
516
|
function ee(l) {
|
|
517
|
+
return l && l.type === "TreeRow";
|
|
518
|
+
}
|
|
519
|
+
function te(l) {
|
|
480
520
|
return l && l.type === "AreaModelTree";
|
|
481
521
|
}
|
|
482
|
-
class
|
|
522
|
+
class ie {
|
|
483
523
|
constructor(e = -1, t = -1, s = -1, i = -1, o, r, n, a = 0, h = 0, d = 0, c = "") {
|
|
484
524
|
this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = i, this.areaIdent = o, this.sideIdent = r, this.originalEvent = n, this.clickCount = a, this.draggingX = h, this.draggingY = d, this.action = c;
|
|
485
525
|
}
|
|
486
526
|
clone() {
|
|
487
|
-
return new
|
|
527
|
+
return new ie(
|
|
488
528
|
this.rowIndex,
|
|
489
529
|
this.rowTop,
|
|
490
530
|
this.columnIndex,
|
|
@@ -499,25 +539,25 @@ class se {
|
|
|
499
539
|
);
|
|
500
540
|
}
|
|
501
541
|
}
|
|
502
|
-
class
|
|
542
|
+
class B {
|
|
503
543
|
constructor(e = ">", t = "", s = []) {
|
|
504
544
|
this.content = e, this.style = t, this.classes = s;
|
|
505
545
|
}
|
|
506
546
|
}
|
|
507
|
-
class
|
|
508
|
-
constructor(e = new
|
|
547
|
+
class ye {
|
|
548
|
+
constructor(e = new B(
|
|
509
549
|
">",
|
|
510
550
|
"transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
|
|
511
551
|
["gt-table-tree-arrow-expanded"]
|
|
512
|
-
), t = new
|
|
552
|
+
), t = new B(
|
|
513
553
|
">",
|
|
514
554
|
"",
|
|
515
555
|
["ge-table-tree-arrow-collapsed"]
|
|
516
|
-
), s = new
|
|
556
|
+
), s = new B(
|
|
517
557
|
">",
|
|
518
558
|
"color:transparent;",
|
|
519
559
|
["gt-table-tree-arrow-hidden"]
|
|
520
|
-
), i = new
|
|
560
|
+
), i = new B(
|
|
521
561
|
"↕",
|
|
522
562
|
"",
|
|
523
563
|
["gt-table-tree-arrow-expanded-all"]
|
|
@@ -525,12 +565,12 @@ class me {
|
|
|
525
565
|
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = i;
|
|
526
566
|
}
|
|
527
567
|
}
|
|
528
|
-
class
|
|
529
|
-
constructor(e = new
|
|
568
|
+
class ve {
|
|
569
|
+
constructor(e = new B("↑", "", ["ge-header-sorted-asc"]), t = new B("↓", "", ["ge-header-sorted-desc"]), s = new B("↑", "color:transparent;", [])) {
|
|
530
570
|
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
|
|
531
571
|
}
|
|
532
572
|
}
|
|
533
|
-
class
|
|
573
|
+
class ke {
|
|
534
574
|
constructor(e) {
|
|
535
575
|
this.domService = e;
|
|
536
576
|
}
|
|
@@ -618,10 +658,10 @@ class Ve {
|
|
|
618
658
|
addColumnDiv(e, t, s = -1, i = -1, o, r, n = "", a, h, d = void 0, c) {
|
|
619
659
|
const p = h == null ? void 0 : h.treeOptions, g = h == null ? void 0 : h.showCheckboxWihoutExtraColumn, u = this.domService.createElement("div");
|
|
620
660
|
this.domService.addClass(u, "ge-table-col-div"), this.domService.addClass(u, `ge-table-col-div-${t.index}`), this.domService.setAttribute(u, "data-col-index", `${t.index}`), this.domService.setAttribute(u, "data-row-index", `${s}`), this.domService.setAttribute(u, "data-area", `${o}`);
|
|
621
|
-
const
|
|
622
|
-
if (o === "body" && r === "center" && this.domService.addClass(u, `ge-table-column-${
|
|
623
|
-
const
|
|
624
|
-
this.addLabelDiv(u, n,
|
|
661
|
+
const m = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
662
|
+
if (o === "body" && r === "center" && this.domService.addClass(u, `ge-table-column-${m}`), this.domService.setStyle(u, "display", "clip"), this.domService.setStyle(u, "position", "absolute"), this.domService.setStyle(u, "left", `${t.left}px`), this.domService.setStyle(u, "top", `${t.top}px`), this.domService.setStyle(u, "width", `${t.width}px`), this.domService.setStyle(u, "height", `${t.height}px`), a && a !== "none" && (this.domService.addClass(u, "ge-table-col-tree"), this.addArrowDiv(u, a, p, s, i, o)), g && i === 0 && d && this.addCheckboxToDiv(u, d, o, s), n) {
|
|
663
|
+
const S = a !== "none" && i === 0;
|
|
664
|
+
this.addLabelDiv(u, n, S, s, i, o);
|
|
625
665
|
}
|
|
626
666
|
return c && this.addSortedIcon(u, c, h == null ? void 0 : h.sortedOptions, i), this.domService.appendChild(e, u), u;
|
|
627
667
|
}
|
|
@@ -650,7 +690,7 @@ class Ve {
|
|
|
650
690
|
}
|
|
651
691
|
return this.domService.appendChild(e, n), n;
|
|
652
692
|
}
|
|
653
|
-
addSortedIcon(e, t = "", s = new
|
|
693
|
+
addSortedIcon(e, t = "", s = new ve(), i = -1) {
|
|
654
694
|
const o = this.domService.createElement("div");
|
|
655
695
|
this.domService.addClass(o, "ge-table-sorted-icon-div"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "top", "0"), this.domService.setStyle(o, "right", "0"), this.domService.setStyle(o, "width", "20px"), this.domService.setStyle(o, "background", "transparent"), this.domService.setStyle(o, "cursor", "pointer"), this.domService.setAttribute(o, "data-col-index", `${i}`), this.domService.setAttribute(o, "data-area", "header");
|
|
656
696
|
let r;
|
|
@@ -661,7 +701,7 @@ class Ve {
|
|
|
661
701
|
this.domService.addClass(o, h);
|
|
662
702
|
return this.domService.appendChild(e, o), o;
|
|
663
703
|
}
|
|
664
|
-
addArrowDiv(e, t = "none", s = new
|
|
704
|
+
addArrowDiv(e, t = "none", s = new ye(), i = -1, o = -1, r = "body") {
|
|
665
705
|
const n = this.domService.createElement("div");
|
|
666
706
|
this.domService.addClass(n, "ge-table-tree-arrow-div"), this.domService.setStyle(n, "display", "inline-block"), this.domService.setStyle(n, "position", ""), this.domService.setStyle(n, "width", "20px"), this.domService.setStyle(n, "background", "transparent"), this.domService.setStyle(n, "cursor", "pointer"), this.domService.setAttribute(n, "data-row-index", `${i}`), this.domService.setAttribute(n, "data-col-index", `${o}`), this.domService.setAttribute(n, "data-area", `${r}`);
|
|
667
707
|
let a;
|
|
@@ -711,37 +751,51 @@ class Ve {
|
|
|
711
751
|
return s ? (s.innerText = "", s) : (s = this.domService.createElement("div"), t.cache[e] = s, s);
|
|
712
752
|
}
|
|
713
753
|
}
|
|
714
|
-
const
|
|
715
|
-
class
|
|
754
|
+
const oe = (l) => l === "header" ? "header" : l === "footer" ? "footer" : "body";
|
|
755
|
+
class Ne {
|
|
716
756
|
constructor(e, t) {
|
|
717
757
|
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)) {
|
|
718
758
|
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"));
|
|
719
759
|
const s = e.getAttribute("data-area");
|
|
720
|
-
if (s && (this.areaIdent =
|
|
760
|
+
if (s && (this.areaIdent = oe(s), this.areaModel = t.tableModel.getAreaModel(this.areaIdent), this.row = this.areaModel.getRowByIndex(this.rowIdx)), e instanceof HTMLInputElement) {
|
|
721
761
|
const i = e;
|
|
722
762
|
this.value = i.value;
|
|
723
763
|
}
|
|
724
764
|
}
|
|
725
765
|
}
|
|
726
766
|
}
|
|
727
|
-
class
|
|
767
|
+
class _e {
|
|
728
768
|
constructor(e) {
|
|
729
769
|
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(
|
|
730
770
|
(t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
|
|
731
771
|
);
|
|
732
772
|
}
|
|
773
|
+
/**
|
|
774
|
+
* Handles the "contextmenu" event.
|
|
775
|
+
*
|
|
776
|
+
* @private
|
|
777
|
+
* @param {MouseEvent} evt - The mouse event object.
|
|
778
|
+
* @return {void}
|
|
779
|
+
*/
|
|
733
780
|
onContextmenu(e) {
|
|
734
781
|
this.mouseEvent = e;
|
|
735
782
|
const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
|
|
736
783
|
this.tableScope.contextmenu(t);
|
|
737
784
|
}
|
|
785
|
+
/**
|
|
786
|
+
* Handles the click event on the host element.
|
|
787
|
+
*
|
|
788
|
+
* @param {MouseEvent} event - The click event.
|
|
789
|
+
*
|
|
790
|
+
* @return {void}
|
|
791
|
+
*/
|
|
738
792
|
onHostElementClicked(e) {
|
|
739
|
-
const t = new
|
|
793
|
+
const t = new Ne(e.target, this.tableScope);
|
|
740
794
|
if (t.action === "toggleExpandCollapseAll")
|
|
741
795
|
this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
|
|
742
796
|
else if (t.inputType === "checkbox" && t.areaIdent)
|
|
743
797
|
this.tableScope.toggleRowCheckbox(t.rowIdx, t.colIdx, t.areaIdent), e.preventDefault(), e.stopPropagation();
|
|
744
|
-
else if (
|
|
798
|
+
else if (ee(t.row) && t.areaModel) {
|
|
745
799
|
const s = t.colIdx === this.getArrowColumnIndex() && e.altKey, i = t.className.includes("ge-table-tree-arrow-div");
|
|
746
800
|
if (console.info(i, s), s || i) {
|
|
747
801
|
e.preventDefault(), e.stopPropagation();
|
|
@@ -755,14 +809,20 @@ class ke {
|
|
|
755
809
|
}
|
|
756
810
|
this.publishGeMouseEvent(e, 1);
|
|
757
811
|
}
|
|
812
|
+
/**
|
|
813
|
+
* Handles the double click event on the host element.
|
|
814
|
+
* This method is private.
|
|
815
|
+
*
|
|
816
|
+
* @param {MouseEvent} event - The double click event.
|
|
817
|
+
*/
|
|
758
818
|
onHostElementDblClicked(e) {
|
|
759
819
|
if (e.target instanceof HTMLElement) {
|
|
760
|
-
const t = e.target, s = t.getAttribute("data-area"), i =
|
|
820
|
+
const t = e.target, s = t.getAttribute("data-area"), i = oe(s), o = Number(t.getAttribute("data-row-index")), r = Number(t.getAttribute("data-col-index")), n = this.tableScope.tableModel.getAreaModel(i);
|
|
761
821
|
if (s && i === "header")
|
|
762
822
|
this.tableScope.tableModel.isSortable(r) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, o, r));
|
|
763
823
|
else if (t.getAttribute("data-row-index")) {
|
|
764
824
|
const a = n.getRowByIndex(o);
|
|
765
|
-
if (s && i === "body" && n.isEditable(o, r) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, r)),
|
|
825
|
+
if (s && i === "body" && n.isEditable(o, r) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, r)), ee(a) && r === this.getArrowColumnIndex()) {
|
|
766
826
|
e.preventDefault(), e.stopPropagation();
|
|
767
827
|
const h = a;
|
|
768
828
|
h.expanded = !h.expanded, "recalcVisibleTreeRows" in n && n.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(h);
|
|
@@ -771,10 +831,24 @@ class ke {
|
|
|
771
831
|
}
|
|
772
832
|
this.publishGeMouseEvent(e, 2);
|
|
773
833
|
}
|
|
834
|
+
/**
|
|
835
|
+
* Publishes a GeMouseEvent.
|
|
836
|
+
*
|
|
837
|
+
* @param {MouseEvent} event - The MouseEvent to publish.
|
|
838
|
+
* @param {number} clickCount - The number of clicks for the GeMouseEvent.
|
|
839
|
+
*
|
|
840
|
+
* @return {void}
|
|
841
|
+
*/
|
|
774
842
|
publishGeMouseEvent(e, t) {
|
|
775
843
|
var s;
|
|
776
844
|
this.mouseEvent = e, this.geMouseEventOld = (s = this.geMouseEvent) == null ? void 0 : s.clone(), this.geMouseEvent = this.tableScope.createGeMouseEvent(e), this.geMouseEvent && (this.geMouseEvent.clickCount = t), this.tableScope.onMouseClicked(this.geMouseEvent, this.geMouseEventOld);
|
|
777
845
|
}
|
|
846
|
+
/**
|
|
847
|
+
* Update the collapsed/expanded state of a tree row.
|
|
848
|
+
*
|
|
849
|
+
* @param {TreeRowIf<any>} tr - The tree row object.
|
|
850
|
+
* @returns {void}
|
|
851
|
+
*/
|
|
778
852
|
updateCollapsedExpandedState(e) {
|
|
779
853
|
var s, i, o, r, n;
|
|
780
854
|
const t = (i = (s = this.tableScope.tableOptions) == null ? void 0 : s.autoRestoreOptions) == null ? void 0 : i.getRowId;
|
|
@@ -816,40 +890,114 @@ class ke {
|
|
|
816
890
|
}
|
|
817
891
|
}
|
|
818
892
|
}
|
|
819
|
-
class
|
|
893
|
+
class je {
|
|
820
894
|
constructor(e) {
|
|
821
895
|
this.tableScope = e;
|
|
822
896
|
}
|
|
897
|
+
/**
|
|
898
|
+
* Updates the cells in the table based on the provided events.
|
|
899
|
+
*
|
|
900
|
+
* @param {TableCellUpdateEventIf[]} events - The array of events representing the updates to perform on the cells.
|
|
901
|
+
* @param {boolean} [repaintAll=false] - Optional parameter indicating whether to repaint all cells or not. Default value is false. If true, the full table will be rendered. If false, the table cell will be rendered immediately.
|
|
902
|
+
*
|
|
903
|
+
* @return {void} - This method doesn't return anything.
|
|
904
|
+
*/
|
|
823
905
|
updateCells(e, t = !1) {
|
|
824
906
|
this.tableScope.updateCells(e, t);
|
|
825
907
|
}
|
|
908
|
+
/**
|
|
909
|
+
* Notifies that the external filter has changed.
|
|
910
|
+
*
|
|
911
|
+
* @return {void}
|
|
912
|
+
*/
|
|
826
913
|
externalFilterChanged() {
|
|
827
914
|
this.tableScope.externalFilterChanged();
|
|
828
915
|
}
|
|
916
|
+
/**
|
|
917
|
+
* Scrolls the table body to the specified pixel coordinates.
|
|
918
|
+
*
|
|
919
|
+
* @param {number} px - The horizontal pixel coordinate to scroll to. Defaults to 0.
|
|
920
|
+
* @param {number} py - The vertical pixel coordinate to scroll to. Defaults to 0.
|
|
921
|
+
* @return {void}
|
|
922
|
+
*/
|
|
829
923
|
scrollToPixel(e = 0, t = 0) {
|
|
924
|
+
this.tableScope.scrollToPixel(e, t);
|
|
830
925
|
}
|
|
926
|
+
/**
|
|
927
|
+
* Scrolls to the specified index in both horizontal and vertical directions.
|
|
928
|
+
*
|
|
929
|
+
* @param {number} indexX - The index of the column to scroll to in the horizontal direction. Default is 0.
|
|
930
|
+
* @param {number} indexY - The index of the row to scroll to in the vertical direction. Default is 0.
|
|
931
|
+
*
|
|
932
|
+
* @return undefined
|
|
933
|
+
*/
|
|
831
934
|
scrollToIndex(e = 0, t = 0) {
|
|
935
|
+
this.tableScope.scrollToIndex(e, t);
|
|
832
936
|
}
|
|
937
|
+
/**
|
|
938
|
+
* Sets whether the header is visible or not.
|
|
939
|
+
*
|
|
940
|
+
* @param _visible - A boolean value indicating whether the header should be visible. Default value is true.
|
|
941
|
+
*
|
|
942
|
+
* @return undefined
|
|
943
|
+
*/
|
|
833
944
|
setHeaderVisible(e = !0) {
|
|
834
945
|
}
|
|
946
|
+
/**
|
|
947
|
+
* Sets the visibility of a column in the table.
|
|
948
|
+
*
|
|
949
|
+
* @param {_column} - The column index or column definition to set visibility for.
|
|
950
|
+
* @param {_visible=true} - The flag to set visibility to. true for visible, false for hidden.
|
|
951
|
+
*
|
|
952
|
+
* @return {void} - There is no return value.
|
|
953
|
+
*/
|
|
835
954
|
setColumnVisible(e, t = !0) {
|
|
836
955
|
}
|
|
956
|
+
/**
|
|
957
|
+
* Returns whether a column is visible or not.
|
|
958
|
+
*
|
|
959
|
+
* @param {number | ColumnDefIf} _column - The column index or the column definition.
|
|
960
|
+
* @return {boolean} - True if the column is visible, false otherwise.
|
|
961
|
+
*/
|
|
837
962
|
isColumnVisible(e) {
|
|
838
963
|
return !0;
|
|
839
964
|
}
|
|
965
|
+
/**
|
|
966
|
+
* Checks if the header is visible.
|
|
967
|
+
*
|
|
968
|
+
* @return {boolean} - Returns true if the header is visible, otherwise returns false.
|
|
969
|
+
*/
|
|
840
970
|
isHeaderVisible() {
|
|
841
971
|
return !0;
|
|
842
972
|
}
|
|
973
|
+
/**
|
|
974
|
+
* Sets the visibility of the footer.
|
|
975
|
+
*
|
|
976
|
+
* @param {boolean} _visible - Indicates whether the footer should be visible or not. Default value is true.
|
|
977
|
+
*
|
|
978
|
+
* @return {void} - This method does not return any value.
|
|
979
|
+
*/
|
|
843
980
|
setFooterVisible(e = !0) {
|
|
844
981
|
}
|
|
982
|
+
/**
|
|
983
|
+
* Determines if the footer is visible.
|
|
984
|
+
*
|
|
985
|
+
* @returns {boolean} True if the footer is visible, false otherwise.
|
|
986
|
+
*/
|
|
845
987
|
isFooterVisible() {
|
|
846
988
|
return !0;
|
|
847
989
|
}
|
|
990
|
+
/**
|
|
991
|
+
* Repaints the table.
|
|
992
|
+
*
|
|
993
|
+
* This method calls the repaint method of the tableScope object
|
|
994
|
+
* to update and redraw the table based on the latest data.
|
|
995
|
+
*/
|
|
848
996
|
repaint() {
|
|
849
997
|
this.tableScope.repaint();
|
|
850
998
|
}
|
|
851
999
|
}
|
|
852
|
-
class
|
|
1000
|
+
class le {
|
|
853
1001
|
constructor(e) {
|
|
854
1002
|
this.getStorageKeyFn = e;
|
|
855
1003
|
}
|
|
@@ -924,7 +1072,7 @@ class oe {
|
|
|
924
1072
|
// }
|
|
925
1073
|
// }
|
|
926
1074
|
}
|
|
927
|
-
class
|
|
1075
|
+
class Xe extends le {
|
|
928
1076
|
constructor(e) {
|
|
929
1077
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
930
1078
|
}
|
|
@@ -946,14 +1094,14 @@ class Ne extends oe {
|
|
|
946
1094
|
}
|
|
947
1095
|
}
|
|
948
1096
|
}
|
|
949
|
-
class
|
|
1097
|
+
class Ke {
|
|
950
1098
|
constructor(e = "collapsed", t = [], s = !1, i = !1) {
|
|
951
1099
|
this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = i;
|
|
952
1100
|
}
|
|
953
1101
|
}
|
|
954
|
-
class
|
|
1102
|
+
class ze extends le {
|
|
955
1103
|
constructor(e) {
|
|
956
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
1104
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new Ke(), this.load();
|
|
957
1105
|
}
|
|
958
1106
|
collapsedExpandedStateGet() {
|
|
959
1107
|
return this.collapsedExpandedState;
|
|
@@ -985,7 +1133,7 @@ class Xe extends oe {
|
|
|
985
1133
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
986
1134
|
}
|
|
987
1135
|
}
|
|
988
|
-
class
|
|
1136
|
+
class Ye extends le {
|
|
989
1137
|
constructor(e) {
|
|
990
1138
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
991
1139
|
}
|
|
@@ -1012,7 +1160,7 @@ class O {
|
|
|
1012
1160
|
this.left = e, this.width = t, this.height = s, this.top = i, this.index = o;
|
|
1013
1161
|
}
|
|
1014
1162
|
}
|
|
1015
|
-
class
|
|
1163
|
+
class Ue {
|
|
1016
1164
|
constructor(e, t, s, i) {
|
|
1017
1165
|
this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = i, this.scrollTop = 0, this.areaBodyWestGeo = new O(), this.areaBodyCenterGeo = new O(), this.areaBodyEastGeo = new O();
|
|
1018
1166
|
const o = this.hostElement;
|
|
@@ -1163,12 +1311,21 @@ class ze {
|
|
|
1163
1311
|
this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", t);
|
|
1164
1312
|
}
|
|
1165
1313
|
}
|
|
1166
|
-
class
|
|
1314
|
+
class D {
|
|
1315
|
+
/**
|
|
1316
|
+
* Represents a constructor for a class.
|
|
1317
|
+
* @constructor
|
|
1318
|
+
* @param {number} r1 - The value for r1.
|
|
1319
|
+
* @param {number} c1 - The value for c1.
|
|
1320
|
+
* @param {number} r2 - The value for r2.
|
|
1321
|
+
* @param {number} c2 - The value for c2.
|
|
1322
|
+
* @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
|
|
1323
|
+
*/
|
|
1167
1324
|
constructor(e, t, s, i, o = !1) {
|
|
1168
1325
|
this.r1 = e, this.c1 = t, this.r2 = s, this.c2 = i, this.gammaRange = o;
|
|
1169
1326
|
}
|
|
1170
1327
|
static create(e) {
|
|
1171
|
-
return e.gammaRange === void 0 && (e.gammaRange = !1), new
|
|
1328
|
+
return e.gammaRange === void 0 && (e.gammaRange = !1), new D(
|
|
1172
1329
|
e.rowIndex1,
|
|
1173
1330
|
e.columnIndex1,
|
|
1174
1331
|
e.rowIndex2,
|
|
@@ -1177,19 +1334,19 @@ class T {
|
|
|
1177
1334
|
);
|
|
1178
1335
|
}
|
|
1179
1336
|
static singleCell(e, t) {
|
|
1180
|
-
return new
|
|
1337
|
+
return new D(e, t, e, t);
|
|
1181
1338
|
}
|
|
1182
1339
|
static singleRow(e) {
|
|
1183
|
-
return new
|
|
1340
|
+
return new D(e, 0, e, Number.MAX_SAFE_INTEGER);
|
|
1184
1341
|
}
|
|
1185
1342
|
static singleColumn(e) {
|
|
1186
|
-
return new
|
|
1343
|
+
return new D(0, e, Number.MAX_SAFE_INTEGER, e);
|
|
1187
1344
|
}
|
|
1188
1345
|
isInRange(e, t) {
|
|
1189
1346
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
1190
1347
|
}
|
|
1191
1348
|
}
|
|
1192
|
-
class
|
|
1349
|
+
class qe {
|
|
1193
1350
|
constructor(e, t) {
|
|
1194
1351
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
1195
1352
|
}
|
|
@@ -1205,7 +1362,7 @@ class Ye {
|
|
|
1205
1362
|
o === 0 && (o = 1), r === 0 && (r = 1);
|
|
1206
1363
|
const n = this.areaModel.hasOwnProperty("gammaCells");
|
|
1207
1364
|
this.colAndRowspanRanges.push(
|
|
1208
|
-
new
|
|
1365
|
+
new D(s, i, s + r - 1, i + o - 1, n)
|
|
1209
1366
|
);
|
|
1210
1367
|
}
|
|
1211
1368
|
}
|
|
@@ -1222,22 +1379,22 @@ class Ye {
|
|
|
1222
1379
|
return !1;
|
|
1223
1380
|
}
|
|
1224
1381
|
}
|
|
1225
|
-
class
|
|
1382
|
+
class Je {
|
|
1226
1383
|
constructor(e, t, s) {
|
|
1227
1384
|
this.header = e, this.body = t, this.footer = s;
|
|
1228
1385
|
}
|
|
1229
1386
|
}
|
|
1230
|
-
class
|
|
1387
|
+
class Qe extends Ue {
|
|
1231
1388
|
constructor(e, t, s, i) {
|
|
1232
1389
|
var r, n;
|
|
1233
1390
|
super(e, t, s, i), this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
1234
1391
|
header: [],
|
|
1235
1392
|
body: [],
|
|
1236
1393
|
footer: []
|
|
1237
|
-
}, this.tree = !1, this.colAndRowspanModels = new
|
|
1394
|
+
}, this.tree = !1, this.colAndRowspanModels = new Je(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.editing = !1, this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (r = this.tableOptions) != null && r.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (n = this.tableOptions) != null && n.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), te(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
1238
1395
|
(a) => {
|
|
1239
1396
|
var h;
|
|
1240
|
-
this.colAndRowspanModels[a] = new
|
|
1397
|
+
this.colAndRowspanModels[a] = new qe(t, t.getAreaModel(a)), (h = this.colAndRowspanModels[a]) == null || h.init();
|
|
1241
1398
|
}
|
|
1242
1399
|
);
|
|
1243
1400
|
}
|
|
@@ -1356,87 +1513,87 @@ class qe extends ze {
|
|
|
1356
1513
|
return "";
|
|
1357
1514
|
}
|
|
1358
1515
|
adjustArea(e, t = 0) {
|
|
1359
|
-
var
|
|
1516
|
+
var S;
|
|
1360
1517
|
const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"), r = i.child.clientHeight;
|
|
1361
1518
|
s.child.innerText = "", i.child.innerText = "", o.child.innerText = "";
|
|
1362
1519
|
const n = 0, a = this.areaBodyCenterGeo.width, h = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), c = d.getRowCount();
|
|
1363
1520
|
for (; this.cleanupFunctions[e].length; ) {
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1521
|
+
const f = this.cleanupFunctions[e].shift();
|
|
1522
|
+
f && f();
|
|
1366
1523
|
}
|
|
1367
1524
|
let p = t;
|
|
1368
|
-
const g = this.tableModel.getColumnCount(), u = this.tableModel.getFixedRightColumnCount(),
|
|
1369
|
-
for (let
|
|
1370
|
-
const
|
|
1371
|
-
if (
|
|
1372
|
-
this.firstVisibleRowIndex =
|
|
1373
|
-
let
|
|
1374
|
-
const
|
|
1525
|
+
const g = this.tableModel.getColumnCount(), u = this.tableModel.getFixedRightColumnCount(), m = this.tableModel.getFixedLeftColumnCount();
|
|
1526
|
+
for (let f = 0; f < c; f++) {
|
|
1527
|
+
const M = p, C = f === c - 1, E = this.tableModel.getRowHeight(e, f);
|
|
1528
|
+
if (M + E > 0) {
|
|
1529
|
+
this.firstVisibleRowIndex = f;
|
|
1530
|
+
let v = { left: n, width: a, height: E, top: M, index: f }, w = this.dom.addRowDiv(i, v, f, e, "center");
|
|
1531
|
+
const R = m;
|
|
1375
1532
|
if (this.adjustColumnsToRowParent({
|
|
1376
1533
|
areaIdent: e,
|
|
1377
1534
|
sideIdent: "center",
|
|
1378
1535
|
areaModel: d,
|
|
1379
|
-
geo:
|
|
1380
|
-
parent:
|
|
1381
|
-
rowIndex:
|
|
1382
|
-
columnIndexStart:
|
|
1536
|
+
geo: v,
|
|
1537
|
+
parent: w,
|
|
1538
|
+
rowIndex: f,
|
|
1539
|
+
columnIndexStart: R,
|
|
1383
1540
|
columnIndexEnd: g - u - 1,
|
|
1384
1541
|
verticalFixed: !1,
|
|
1385
|
-
lastRowOfModel:
|
|
1386
|
-
}), h.left > 0 && (
|
|
1542
|
+
lastRowOfModel: C
|
|
1543
|
+
}), h.left > 0 && (v = { left: n, width: this.areaBodyWestGeo.width, height: E, top: M, index: f }, w = this.dom.addRowDiv(s, v, f, e, "west"), this.adjustColumnsToRowParent({
|
|
1387
1544
|
areaIdent: e,
|
|
1388
1545
|
sideIdent: "west",
|
|
1389
1546
|
areaModel: d,
|
|
1390
|
-
geo:
|
|
1391
|
-
parent:
|
|
1392
|
-
rowIndex:
|
|
1547
|
+
geo: v,
|
|
1548
|
+
parent: w,
|
|
1549
|
+
rowIndex: f,
|
|
1393
1550
|
columnIndexStart: 0,
|
|
1394
|
-
columnIndexEnd:
|
|
1551
|
+
columnIndexEnd: R - 1,
|
|
1395
1552
|
verticalFixed: !0,
|
|
1396
|
-
lastRowOfModel:
|
|
1397
|
-
})), h.right > 0 && (
|
|
1553
|
+
lastRowOfModel: C
|
|
1554
|
+
})), h.right > 0 && (v = { left: n, width: this.areaBodyEastGeo.width, height: E, top: M, index: f }, w = this.dom.addRowDiv(o, v, f, e, "east"), this.adjustColumnsToRowParent({
|
|
1398
1555
|
areaIdent: e,
|
|
1399
1556
|
sideIdent: "east",
|
|
1400
1557
|
areaModel: d,
|
|
1401
|
-
geo:
|
|
1402
|
-
parent:
|
|
1403
|
-
rowIndex:
|
|
1558
|
+
geo: v,
|
|
1559
|
+
parent: w,
|
|
1560
|
+
rowIndex: f,
|
|
1404
1561
|
columnIndexStart: g - u,
|
|
1405
1562
|
columnIndexEnd: g - 1,
|
|
1406
1563
|
verticalFixed: !0,
|
|
1407
|
-
lastRowOfModel:
|
|
1408
|
-
})), e === "header" && this.tree &&
|
|
1409
|
-
const
|
|
1564
|
+
lastRowOfModel: C
|
|
1565
|
+
})), e === "header" && this.tree && f === c - 1) {
|
|
1566
|
+
const T = this.dom.applyStyle(
|
|
1410
1567
|
this.dom.setAttribute(
|
|
1411
|
-
this.dom.addDiv(
|
|
1568
|
+
this.dom.addDiv(w, new O(16, 20, 20, 8)),
|
|
1412
1569
|
"data-ge-action",
|
|
1413
1570
|
"toggleExpandCollapseAll"
|
|
1414
1571
|
),
|
|
1415
1572
|
{ cursor: "pointer" }
|
|
1416
|
-
),
|
|
1417
|
-
if (
|
|
1418
|
-
const
|
|
1419
|
-
this.dom.domService.appendChild(
|
|
1573
|
+
), I = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1574
|
+
if (I) {
|
|
1575
|
+
const G = this.dom.domService.createText(I.content);
|
|
1576
|
+
this.dom.domService.appendChild(T, G), I.style && this.dom.applyStyleString(T, I.style);
|
|
1420
1577
|
}
|
|
1421
1578
|
}
|
|
1422
1579
|
}
|
|
1423
|
-
if (p = p +
|
|
1580
|
+
if (p = p + E, p > r)
|
|
1424
1581
|
break;
|
|
1425
1582
|
}
|
|
1426
1583
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1427
|
-
const
|
|
1428
|
-
if (
|
|
1429
|
-
for (const
|
|
1430
|
-
let
|
|
1431
|
-
if (
|
|
1432
|
-
|
|
1433
|
-
else if (u > 0 &&
|
|
1434
|
-
|
|
1584
|
+
const f = ((S = this.colAndRowspanModels[e]) == null ? void 0 : S.getRanges()) ?? [];
|
|
1585
|
+
if (f.length)
|
|
1586
|
+
for (const M of f) {
|
|
1587
|
+
let C = 0, E = i.child, v = "center";
|
|
1588
|
+
if (M.c1 < m)
|
|
1589
|
+
E = s.child, v = "west";
|
|
1590
|
+
else if (u > 0 && M.c1 >= g - u)
|
|
1591
|
+
E = o.child, v = "east";
|
|
1435
1592
|
else {
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1593
|
+
const w = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1594
|
+
C = this.scrollFactorX * w - this.areaBodyWestGeo.width, v = "center";
|
|
1438
1595
|
}
|
|
1439
|
-
this.drawBigCell(
|
|
1596
|
+
this.drawBigCell(M, C, t, d, E, v);
|
|
1440
1597
|
}
|
|
1441
1598
|
}
|
|
1442
1599
|
}
|
|
@@ -1451,13 +1608,13 @@ class qe extends ze {
|
|
|
1451
1608
|
* @protected
|
|
1452
1609
|
*/
|
|
1453
1610
|
drawBigCell(e, t, s, i, o, r) {
|
|
1454
|
-
const n = s + this.getRowHeights(0, e.r1 - 1, i).reduce((
|
|
1611
|
+
const n = s + this.getRowHeights(0, e.r1 - 1, i).reduce((S, f) => S + f, 0), a = this.tableModel.getColumnCount(), h = this.tableModel.getFixedRightColumnCount();
|
|
1455
1612
|
let d = 0;
|
|
1456
1613
|
h > 0 && e.c1 >= a - h && (d = a - h);
|
|
1457
|
-
const c = t + this.getColumnWidths(d, e.c1 - 1).reduce((
|
|
1614
|
+
const c = t + this.getColumnWidths(d, e.c1 - 1).reduce((S, f) => S + f, 0), p = this.getRowHeights(e.r1, e.r2, i).reduce((S, f) => S + f, 0), g = this.getColumnWidths(e.c1, e.c2).reduce((S, f) => S + f, 0);
|
|
1458
1615
|
let u = !1;
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1616
|
+
const m = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
1617
|
+
m && (u = m.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? (console.info("TODO here", e), this.renderCell({
|
|
1461
1618
|
areaModel: i,
|
|
1462
1619
|
areaIdent: i.areaIdent,
|
|
1463
1620
|
sideIdent: r,
|
|
@@ -1518,56 +1675,56 @@ class qe extends ze {
|
|
|
1518
1675
|
verticalFixed: h = !1,
|
|
1519
1676
|
lastRowOfModel: d = !1
|
|
1520
1677
|
}) {
|
|
1521
|
-
var
|
|
1678
|
+
var m;
|
|
1522
1679
|
this.scrollViewportLeft = this.scrollViewport.scrollLeft;
|
|
1523
1680
|
let c = 0;
|
|
1524
1681
|
if (!h) {
|
|
1525
|
-
const
|
|
1526
|
-
c = this.scrollFactorX *
|
|
1682
|
+
const S = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1683
|
+
c = this.scrollFactorX * S;
|
|
1527
1684
|
}
|
|
1528
1685
|
const p = 0, g = !!(e === "body" && t);
|
|
1529
1686
|
let u = c;
|
|
1530
|
-
for (let
|
|
1531
|
-
const
|
|
1532
|
-
if (
|
|
1533
|
-
let
|
|
1534
|
-
const
|
|
1535
|
-
|
|
1536
|
-
let
|
|
1537
|
-
|
|
1538
|
-
let
|
|
1539
|
-
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (
|
|
1540
|
-
this.renderDragTargetDiv(o,
|
|
1541
|
-
const
|
|
1542
|
-
this.dom.addColumnBorderDivs(this.tableOptions, o,
|
|
1687
|
+
for (let S = n; S <= a; S++) {
|
|
1688
|
+
const f = u, M = this.tableModel.getColumnWidth(S);
|
|
1689
|
+
if (M > 0 && f + M > 0) {
|
|
1690
|
+
let C = i.height;
|
|
1691
|
+
const E = s.getRowspanAt(r, S), v = s.getColspanAt(r, S);
|
|
1692
|
+
E > 1 && (C = this.getRowHeights(r, r + E - 1, s).reduce((T, I) => T + I, 0));
|
|
1693
|
+
let w = M;
|
|
1694
|
+
v > 1 && (w = this.getColumnWidths(S, S + v - 1).reduce((T, I) => T + I, 0));
|
|
1695
|
+
let R = !1;
|
|
1696
|
+
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (m = this.colAndRowspanModels[e]) != null && m.isInRange(r, S) && (R = !0), this.draggingTargetColumnIndex === S && e !== "header") {
|
|
1697
|
+
this.renderDragTargetDiv(o, f, p, w, C);
|
|
1698
|
+
const T = { left: f, top: p, width: w, height: C };
|
|
1699
|
+
this.dom.addColumnBorderDivs(this.tableOptions, o, T, e, t);
|
|
1543
1700
|
} else {
|
|
1544
|
-
const
|
|
1545
|
-
|
|
1701
|
+
const T = this.renderSelectedBackgroundDiv(R, g, t, s, r, S, o, f, p, w, C);
|
|
1702
|
+
R || this.renderCell({
|
|
1546
1703
|
areaModel: s,
|
|
1547
1704
|
areaIdent: e,
|
|
1548
1705
|
sideIdent: t,
|
|
1549
1706
|
rowIndex: r,
|
|
1550
|
-
columnIndex:
|
|
1551
|
-
left:
|
|
1707
|
+
columnIndex: S,
|
|
1708
|
+
left: f,
|
|
1552
1709
|
top: p,
|
|
1553
|
-
width:
|
|
1554
|
-
height:
|
|
1710
|
+
width: w,
|
|
1711
|
+
height: C,
|
|
1555
1712
|
parent: o,
|
|
1556
|
-
cellSelected:
|
|
1713
|
+
cellSelected: T,
|
|
1557
1714
|
lastRowOfModel: d,
|
|
1558
1715
|
gammaRange: !0
|
|
1559
1716
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1560
1717
|
rowIndex: r,
|
|
1561
|
-
columnIndex:
|
|
1562
|
-
cellLeft:
|
|
1718
|
+
columnIndex: S,
|
|
1719
|
+
cellLeft: f,
|
|
1563
1720
|
cellTop: p,
|
|
1564
|
-
cellWidth:
|
|
1565
|
-
cellHeight:
|
|
1721
|
+
cellWidth: w,
|
|
1722
|
+
cellHeight: C,
|
|
1566
1723
|
parent: o
|
|
1567
1724
|
});
|
|
1568
1725
|
}
|
|
1569
1726
|
}
|
|
1570
|
-
if (u = u +
|
|
1727
|
+
if (u = u + M, u > this.areaBodyCenterGeo.width)
|
|
1571
1728
|
break;
|
|
1572
1729
|
}
|
|
1573
1730
|
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new O(u - 1, 1, i.height, 0), o);
|
|
@@ -1586,49 +1743,50 @@ class qe extends ze {
|
|
|
1586
1743
|
height: a,
|
|
1587
1744
|
top: h,
|
|
1588
1745
|
parent: d,
|
|
1589
|
-
lastRowOfModel: c
|
|
1746
|
+
lastRowOfModel: c,
|
|
1747
|
+
gammaRange: p
|
|
1590
1748
|
}) {
|
|
1591
|
-
var
|
|
1592
|
-
const
|
|
1749
|
+
var de;
|
|
1750
|
+
const u = this.editorRenderer && this.editorRendererRow === i && this.editorRendererColumn === o ? this.editorRenderer : e.getCellRenderer(i, o), m = { left: r, width: n, height: a, top: h, index: o }, S = e.getRowByIndex(i);
|
|
1593
1751
|
let f = "none";
|
|
1594
|
-
if (o === this.getTreeArrowColumnIndex() &&
|
|
1595
|
-
const
|
|
1596
|
-
(
|
|
1752
|
+
if (o === this.getTreeArrowColumnIndex() && ee(S)) {
|
|
1753
|
+
const y = S;
|
|
1754
|
+
(de = y.children) != null && de.length ? y.expanded ? f = "expanded" : f = "collapsed" : f = "hidden";
|
|
1597
1755
|
}
|
|
1598
1756
|
let C;
|
|
1599
1757
|
if (t === "header") {
|
|
1600
|
-
const
|
|
1601
|
-
(!(
|
|
1758
|
+
const y = this.tableModel.getColumnDef(o);
|
|
1759
|
+
(!(y != null && y.sortIconVisible) || y != null && y.sortIconVisible()) && (C = y == null ? void 0 : y.sortState);
|
|
1602
1760
|
}
|
|
1603
|
-
const
|
|
1761
|
+
const E = e.getValueAt(i, o), v = u ? "" : `${E}`, w = e.isRowChecked(i), R = this.dom.addColumnDiv(
|
|
1604
1762
|
d,
|
|
1605
|
-
|
|
1763
|
+
m,
|
|
1606
1764
|
i,
|
|
1607
1765
|
o,
|
|
1608
1766
|
t,
|
|
1609
1767
|
s,
|
|
1610
|
-
|
|
1768
|
+
v,
|
|
1611
1769
|
f,
|
|
1612
1770
|
this.tableOptions,
|
|
1613
1771
|
w,
|
|
1614
1772
|
C
|
|
1615
|
-
),
|
|
1616
|
-
|
|
1617
|
-
const
|
|
1618
|
-
|
|
1619
|
-
let
|
|
1620
|
-
|
|
1621
|
-
const
|
|
1622
|
-
if (
|
|
1623
|
-
const
|
|
1624
|
-
|
|
1773
|
+
), T = e.getTooltipAt(i, o);
|
|
1774
|
+
T && this.dom.setAttribute(R, "title", T);
|
|
1775
|
+
const I = this.tableModel.getColumnDef(o);
|
|
1776
|
+
I && I.classes[t] && this.dom.addClasses(I.classes[t], R);
|
|
1777
|
+
let G;
|
|
1778
|
+
u && (G = u.render(R, i, o, t, e, E, this.dom.domService));
|
|
1779
|
+
const ae = e.getCustomClassesAt(i, o);
|
|
1780
|
+
if (ae.length && this.dom.addClasses(ae, R), this.dom.addColumnBorderDivs(this.tableOptions, d, m, t, s), c && this.dom.addHorizontalBorder({ left: r, width: n, height: a, top: h + a }, d), this.getFocusModel && t === "body") {
|
|
1781
|
+
const y = this.getFocusModel();
|
|
1782
|
+
y != null && y.hasFocus(i, o) && this.dom.addFocusBorderDivs(d, m, {});
|
|
1625
1783
|
}
|
|
1626
|
-
t === "header" && this.dom.setAttribute(
|
|
1627
|
-
const
|
|
1628
|
-
if (
|
|
1629
|
-
for (const
|
|
1630
|
-
this.dom.setStyle(
|
|
1631
|
-
return [
|
|
1784
|
+
t === "header" && this.dom.setAttribute(R, "data-ge-action", "drag-column");
|
|
1785
|
+
const Y = e.getCustomStyleAt(i, o);
|
|
1786
|
+
if (Y)
|
|
1787
|
+
for (const y in Y)
|
|
1788
|
+
this.dom.setStyle(R, y, Y[y]);
|
|
1789
|
+
return [R, G];
|
|
1632
1790
|
}
|
|
1633
1791
|
applyCssClasses(e, t = {}) {
|
|
1634
1792
|
e && Object.entries(t).forEach(([s, i]) => {
|
|
@@ -1718,12 +1876,12 @@ class qe extends ze {
|
|
|
1718
1876
|
if (g) {
|
|
1719
1877
|
const u = g.getSelectionCount(o, r);
|
|
1720
1878
|
p = u > 0;
|
|
1721
|
-
for (let
|
|
1722
|
-
const
|
|
1879
|
+
for (let m = 0; m < u; m++) {
|
|
1880
|
+
const S = this.dom.applyStylePosistionAbsolute(
|
|
1723
1881
|
// ge-table-body-west-selected-range
|
|
1724
1882
|
this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`, n)
|
|
1725
1883
|
);
|
|
1726
|
-
this.dom.setStyle(
|
|
1884
|
+
this.dom.setStyle(S, "left", `${a}px`), this.dom.setStyle(S, "top", `${h}px`), this.dom.setStyle(S, "width", `${d}px`), this.dom.setStyle(S, "height", `${c}px`);
|
|
1727
1885
|
}
|
|
1728
1886
|
}
|
|
1729
1887
|
}
|
|
@@ -1744,7 +1902,7 @@ class qe extends ze {
|
|
|
1744
1902
|
lastRowOfModel: p,
|
|
1745
1903
|
gammaRange: g
|
|
1746
1904
|
}) {
|
|
1747
|
-
const [u,
|
|
1905
|
+
const [u, m] = this.addAndRenderCellDiv({
|
|
1748
1906
|
areaModel: e,
|
|
1749
1907
|
areaIdent: t,
|
|
1750
1908
|
sideIdent: s,
|
|
@@ -1758,46 +1916,54 @@ class qe extends ze {
|
|
|
1758
1916
|
lastRowOfModel: p,
|
|
1759
1917
|
gammaRange: g
|
|
1760
1918
|
});
|
|
1761
|
-
c && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, u),
|
|
1919
|
+
c && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, u), m && this.cleanupFunctions[t].push(m);
|
|
1762
1920
|
}
|
|
1763
1921
|
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight: r, parent: n }) {
|
|
1764
1922
|
const a = this.dom.domService, h = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = a.createElement("div");
|
|
1765
1923
|
a.setAttribute(d, "data-col-index", `${t}`), a.setAttribute(d, "data-row-index", `${e}`), a.setAttribute(d, "data-area", "header"), a.setAttribute(d, "data-ge-action", "resize-column"), a.addClass(d, "ge-table-column-resize-handle"), a.setStyle(d, "display", "clip"), a.setStyle(d, "position", "absolute"), a.setStyle(d, "cursor", "col-resize"), a.setStyle(d, "left", `${s + o - h}px`), a.setStyle(d, "top", `${i}px`), a.setStyle(d, "width", `${h}px`), a.setStyle(d, "height", `${r}px`), a.appendChild(n, d);
|
|
1766
1924
|
}
|
|
1767
1925
|
}
|
|
1768
|
-
class
|
|
1926
|
+
class Ze {
|
|
1769
1927
|
constructor(e, t) {
|
|
1770
1928
|
this.columnIndex = e, this.sortState = t;
|
|
1771
1929
|
}
|
|
1772
1930
|
}
|
|
1773
|
-
class
|
|
1931
|
+
class et {
|
|
1774
1932
|
constructor(e) {
|
|
1775
1933
|
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
1776
1934
|
}
|
|
1935
|
+
/**
|
|
1936
|
+
* Handles the onHostElementChanged event.
|
|
1937
|
+
* In case that the element is an input field, the tableScope.updateModelValueAfterEdit() method is triggered.
|
|
1938
|
+
*
|
|
1939
|
+
* @param {Event} event - The event object.
|
|
1940
|
+
*
|
|
1941
|
+
* @return {void}
|
|
1942
|
+
*/
|
|
1777
1943
|
onHostElementChanged(e) {
|
|
1778
1944
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1779
1945
|
const t = e.target, s = t.getAttribute("data-area"), i = t.getAttribute("data-row-index"), o = t.getAttribute("data-col-index");
|
|
1780
1946
|
if (s && i && o) {
|
|
1781
|
-
const r =
|
|
1947
|
+
const r = oe(s), n = Number(i), a = Number(o);
|
|
1782
1948
|
this.tableScope.updateModelValueAfterEdit(r, n, a, t.value);
|
|
1783
1949
|
}
|
|
1784
1950
|
}
|
|
1785
1951
|
}
|
|
1786
1952
|
}
|
|
1787
|
-
class
|
|
1953
|
+
class tt {
|
|
1788
1954
|
constructor(e = -1, t = -1) {
|
|
1789
1955
|
this.rowIndex = e, this.columnIndex = t;
|
|
1790
1956
|
}
|
|
1791
1957
|
}
|
|
1792
|
-
class
|
|
1958
|
+
class re {
|
|
1793
1959
|
constructor(e) {
|
|
1794
1960
|
this.cells = e;
|
|
1795
1961
|
}
|
|
1796
1962
|
static createSingle(e, t) {
|
|
1797
|
-
return new
|
|
1963
|
+
return new re([new tt(e, t)]);
|
|
1798
1964
|
}
|
|
1799
1965
|
}
|
|
1800
|
-
class
|
|
1966
|
+
class st {
|
|
1801
1967
|
constructor(e) {
|
|
1802
1968
|
var t, s;
|
|
1803
1969
|
this.tableScope = e, (t = this.tableScope.tableOptions) != null && t.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), (s = this.tableScope.tableOptions) != null && s.getFocusModel && (this.getFocusModel = this.tableScope.tableOptions.getFocusModel);
|
|
@@ -1807,7 +1973,7 @@ class et {
|
|
|
1807
1973
|
let s = !1, i = !1;
|
|
1808
1974
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1809
1975
|
const p = this.getSelectionModel(), g = this.getFocusModel();
|
|
1810
|
-
p && g && (g.hasFocus(e.rowIndex, e.columnIndex) || (g.setFocus(e.rowIndex, e.columnIndex), s = !0), (o = e.originalEvent) != null && o.shiftKey || p.hasSelection() && (p.clear(), s = !0), (r = e.originalEvent) != null && r.shiftKey && this.previousEvt ? (p.addSelection(this.createRangeByEvents(e, this.previousEvt)), i = !0, s = !0) : (n = e.originalEvent) != null && n.ctrlKey || (a = e.originalEvent) != null && a.metaKey ? (p.addSelection(
|
|
1976
|
+
p && g && (g.hasFocus(e.rowIndex, e.columnIndex) || (g.setFocus(e.rowIndex, e.columnIndex), s = !0), (o = e.originalEvent) != null && o.shiftKey || p.hasSelection() && (p.clear(), s = !0), (r = e.originalEvent) != null && r.shiftKey && this.previousEvt ? (p.addSelection(this.createRangeByEvents(e, this.previousEvt)), i = !0, s = !0) : (n = e.originalEvent) != null && n.ctrlKey || (a = e.originalEvent) != null && a.metaKey ? (p.addSelection(D.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0) : (h = e.originalEvent) != null && h.altKey && ((d = e.originalEvent) != null && d.ctrlKey || (c = e.originalEvent) != null && c.metaKey) && (p.removeSelection(D.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0));
|
|
1811
1977
|
}
|
|
1812
1978
|
return i ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
1813
1979
|
}
|
|
@@ -1830,7 +1996,7 @@ class et {
|
|
|
1830
1996
|
createRangeByEvents(e, t) {
|
|
1831
1997
|
t || (t = e);
|
|
1832
1998
|
const s = Math.min(e.rowIndex, t == null ? void 0 : t.rowIndex), i = Math.max(e.rowIndex, t == null ? void 0 : t.rowIndex), o = Math.min(e.columnIndex, t == null ? void 0 : t.columnIndex), r = Math.max(e.columnIndex, t == null ? void 0 : t.columnIndex);
|
|
1833
|
-
return
|
|
1999
|
+
return D.create({
|
|
1834
2000
|
rowIndex1: s,
|
|
1835
2001
|
columnIndex1: o,
|
|
1836
2002
|
rowIndex2: i,
|
|
@@ -1838,7 +2004,7 @@ class et {
|
|
|
1838
2004
|
});
|
|
1839
2005
|
}
|
|
1840
2006
|
}
|
|
1841
|
-
class
|
|
2007
|
+
class it {
|
|
1842
2008
|
get() {
|
|
1843
2009
|
return {
|
|
1844
2010
|
f2: "START_EDITING",
|
|
@@ -1856,7 +2022,7 @@ class tt {
|
|
|
1856
2022
|
};
|
|
1857
2023
|
}
|
|
1858
2024
|
}
|
|
1859
|
-
class
|
|
2025
|
+
class ot {
|
|
1860
2026
|
get() {
|
|
1861
2027
|
return {
|
|
1862
2028
|
f2: "START_EDITING",
|
|
@@ -1876,7 +2042,7 @@ class st {
|
|
|
1876
2042
|
};
|
|
1877
2043
|
}
|
|
1878
2044
|
}
|
|
1879
|
-
class
|
|
2045
|
+
class lt {
|
|
1880
2046
|
constructor(e) {
|
|
1881
2047
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
1882
2048
|
}
|
|
@@ -1884,7 +2050,7 @@ class it {
|
|
|
1884
2050
|
this.listener.includes(e) || this.listener.push(e);
|
|
1885
2051
|
}
|
|
1886
2052
|
init() {
|
|
1887
|
-
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new
|
|
2053
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new ot().get()) : Object.assign(this.shortcutActionIdMapping, new it().get()), Object.assign(this.shortcutActionIdMapping, this.tableScope.tableOptions.shortcutActionIdMapping), this.isDebug() && console.debug("ShortcutService", this.shortcutActionIdMapping), this.tableScope.hostElement.addEventListener("keydown", this.onKeyDown.bind(this));
|
|
1888
2054
|
}
|
|
1889
2055
|
isMacintosh() {
|
|
1890
2056
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -1928,7 +2094,7 @@ class it {
|
|
|
1928
2094
|
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();
|
|
1929
2095
|
}
|
|
1930
2096
|
}
|
|
1931
|
-
class
|
|
2097
|
+
class ue {
|
|
1932
2098
|
onCheckboxChanged(e) {
|
|
1933
2099
|
}
|
|
1934
2100
|
onContextmenu(e) {
|
|
@@ -1944,7 +2110,7 @@ class he {
|
|
|
1944
2110
|
onMouseMoved(e) {
|
|
1945
2111
|
}
|
|
1946
2112
|
}
|
|
1947
|
-
class
|
|
2113
|
+
class we {
|
|
1948
2114
|
setStyle(e, t, s) {
|
|
1949
2115
|
return e.style[t] = s, e;
|
|
1950
2116
|
}
|
|
@@ -1971,7 +2137,7 @@ class ye {
|
|
|
1971
2137
|
e.setAttribute(t, s);
|
|
1972
2138
|
}
|
|
1973
2139
|
}
|
|
1974
|
-
class
|
|
2140
|
+
class rt {
|
|
1975
2141
|
render(e, t, s, i, o, r, n) {
|
|
1976
2142
|
if (o.isEditable(t, s)) {
|
|
1977
2143
|
n.addClass(e, "ge-table-row-input-div");
|
|
@@ -1992,7 +2158,7 @@ class ot {
|
|
|
1992
2158
|
}
|
|
1993
2159
|
}
|
|
1994
2160
|
}
|
|
1995
|
-
class
|
|
2161
|
+
class nt {
|
|
1996
2162
|
constructor(e = "none", t = "single") {
|
|
1997
2163
|
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1998
2164
|
}
|
|
@@ -2027,16 +2193,16 @@ class lt {
|
|
|
2027
2193
|
if (this.selectionType === "none")
|
|
2028
2194
|
return;
|
|
2029
2195
|
let t = e;
|
|
2030
|
-
this.selectionType === "row" ? t =
|
|
2196
|
+
this.selectionType === "row" ? t = D.singleRow(e.r1) : this.selectionType === "column" && (t = D.singleColumn(e.c1)), this.negativeRanges.push(t);
|
|
2031
2197
|
}
|
|
2032
2198
|
togglePoint(e, t) {
|
|
2033
|
-
this.getSelectionCount(e, t) > 0 ? this.removeSelection(
|
|
2199
|
+
this.getSelectionCount(e, t) > 0 ? this.removeSelection(D.singleCell(e, t)) : this.addSelection(D.singleCell(e, t));
|
|
2034
2200
|
}
|
|
2035
2201
|
addRange(e) {
|
|
2036
2202
|
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));
|
|
2037
2203
|
}
|
|
2038
2204
|
}
|
|
2039
|
-
class
|
|
2205
|
+
class at {
|
|
2040
2206
|
constructor(e = "none") {
|
|
2041
2207
|
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
|
|
2042
2208
|
}
|
|
@@ -2059,32 +2225,43 @@ class rt {
|
|
|
2059
2225
|
return [this.rowIndex, this.columnIndex];
|
|
2060
2226
|
}
|
|
2061
2227
|
}
|
|
2062
|
-
const
|
|
2063
|
-
class
|
|
2228
|
+
const dt = new nt(), ht = new at("cell");
|
|
2229
|
+
class Ce {
|
|
2064
2230
|
constructor() {
|
|
2065
2231
|
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 = {
|
|
2066
2232
|
header: 34,
|
|
2067
2233
|
body: 34,
|
|
2068
2234
|
footer: 34
|
|
2069
|
-
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new
|
|
2235
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new ye(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new ve(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new rt(), this.getSelectionModel = () => dt, this.getFocusModel = () => ht;
|
|
2070
2236
|
}
|
|
2071
2237
|
}
|
|
2072
|
-
class
|
|
2238
|
+
class ne extends Qe {
|
|
2073
2239
|
constructor(e, t, s, i, o) {
|
|
2074
2240
|
var r;
|
|
2075
2241
|
if (super(
|
|
2076
2242
|
e,
|
|
2077
2243
|
t,
|
|
2078
|
-
new
|
|
2244
|
+
new ke(s),
|
|
2079
2245
|
i
|
|
2080
|
-
), this.eventListener = o, this.selectionService = new
|
|
2246
|
+
), this.eventListener = o, this.licenseManager = $.getInstance(), this.selectionService = new st(this), this.api = new je(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new ue()), (r = this.tableOptions) != null && r.autoRestoreOptions) {
|
|
2081
2247
|
const n = this.tableOptions.autoRestoreOptions, a = n.getStorageKeyFn;
|
|
2082
|
-
a && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new
|
|
2248
|
+
a && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new Xe(a)), n.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new ze(a)), n.autoRestoreSortingState && (this.storeSortingService = new Ye(a)));
|
|
2083
2249
|
}
|
|
2084
|
-
this.mouseHandler = new
|
|
2250
|
+
this.mouseHandler = new _e(this), this.inputHandler = new et(this), this.shortcutService = new lt(this), this.shortcutService.addListener(this.selectionService);
|
|
2085
2251
|
}
|
|
2086
|
-
|
|
2087
|
-
|
|
2252
|
+
/**
|
|
2253
|
+
* Creates a TableScope instance.
|
|
2254
|
+
*
|
|
2255
|
+
* @param {HTMLDivElement} hostElement - The HTML div element that will contain the table.
|
|
2256
|
+
* @param {TableModelIf} tableModel - The table model object.
|
|
2257
|
+
* @param {TableOptionsIf} [tableOptions=new TableOptions()] - The optional table options object.
|
|
2258
|
+
* @param {EventListenerIf} [eventListener=new EventAdapter()] - The optional event listener object.
|
|
2259
|
+
* @param {DomServiceIf} [domService=new SimpleDomService()] - The optional DOM service object.
|
|
2260
|
+
*
|
|
2261
|
+
* @return {TableScope} - The newly created TableScope instance.
|
|
2262
|
+
*/
|
|
2263
|
+
static create(e, t, s = new Ce(), i = new ue(), o = new we()) {
|
|
2264
|
+
return new ne(
|
|
2088
2265
|
e,
|
|
2089
2266
|
t,
|
|
2090
2267
|
o,
|
|
@@ -2106,20 +2283,36 @@ class re extends qe {
|
|
|
2106
2283
|
return !1;
|
|
2107
2284
|
}
|
|
2108
2285
|
updateModelValueAfterEdit(e, t, s, i) {
|
|
2109
|
-
e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, i) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(
|
|
2286
|
+
e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, i) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(re.createSingle(t, s)), this.hostElement.focus());
|
|
2110
2287
|
}
|
|
2288
|
+
/**
|
|
2289
|
+
* Retrieves the TableApi object.
|
|
2290
|
+
*
|
|
2291
|
+
* @return {TableApi} The TableApi object.
|
|
2292
|
+
*/
|
|
2111
2293
|
getApi() {
|
|
2112
2294
|
return this.api;
|
|
2113
2295
|
}
|
|
2114
|
-
|
|
2115
|
-
* Called by the table component
|
|
2296
|
+
/**
|
|
2297
|
+
* Initializes the table. Called by the table component.
|
|
2298
|
+
*
|
|
2299
|
+
* @function firstInit
|
|
2300
|
+
* @memberof TableScope
|
|
2301
|
+
*
|
|
2302
|
+
* @returns {TableScope} This instance of the table scope.
|
|
2116
2303
|
*/
|
|
2117
2304
|
firstInit() {
|
|
2118
2305
|
var e;
|
|
2119
2306
|
return this.tableModel.init(), (e = this.tableOptions) != null && e.externalFilterFunction && this.externalFilterChanged(!1), this.autoRestoreCollapsedExpandedState(), this.autoRestoreSortingState(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.autoRestoreScrollPosition(), this;
|
|
2120
2307
|
}
|
|
2308
|
+
/**
|
|
2309
|
+
* Creates a GeMouseEvent object based on a MouseEvent.
|
|
2310
|
+
*
|
|
2311
|
+
* @param {MouseEvent} mouseEvent - The MouseEvent object to create the GeMouseEvent from.
|
|
2312
|
+
* @return {GeMouseEvent} - The created GeMouseEvent object.
|
|
2313
|
+
*/
|
|
2121
2314
|
createGeMouseEvent(e) {
|
|
2122
|
-
const t = new
|
|
2315
|
+
const t = new ie();
|
|
2123
2316
|
if (t.originalEvent = e, e) {
|
|
2124
2317
|
const s = e.target;
|
|
2125
2318
|
if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(s), t.rowIndex = this.getNumberByAttr(s, "data-row-index"), t.columnIndex = this.getNumberByAttr(s, "data-col-index"), t.action = this.getStringByAttr(s, "data-ge-action"), t.areaIdent) {
|
|
@@ -2133,26 +2326,72 @@ class re extends qe {
|
|
|
2133
2326
|
}
|
|
2134
2327
|
return t;
|
|
2135
2328
|
}
|
|
2329
|
+
/**
|
|
2330
|
+
* Handles the mouse down event.
|
|
2331
|
+
*
|
|
2332
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event object.
|
|
2333
|
+
* @return {void}
|
|
2334
|
+
*/
|
|
2136
2335
|
onMouseDown(e) {
|
|
2137
2336
|
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));
|
|
2138
2337
|
}
|
|
2338
|
+
/**
|
|
2339
|
+
* Handles mouse dragging on the frame.
|
|
2340
|
+
*
|
|
2341
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event object.
|
|
2342
|
+
*/
|
|
2139
2343
|
mouseDraggingOnFrame(e) {
|
|
2140
2344
|
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());
|
|
2141
2345
|
}
|
|
2346
|
+
/**
|
|
2347
|
+
* Handles the end of mouse dragging event on a frame.
|
|
2348
|
+
*
|
|
2349
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event object.
|
|
2350
|
+
*
|
|
2351
|
+
* @returns {void}
|
|
2352
|
+
*/
|
|
2142
2353
|
mouseDraggingEndOnFrame(e) {
|
|
2143
2354
|
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 = "";
|
|
2144
2355
|
}
|
|
2356
|
+
/**
|
|
2357
|
+
* Handles the mouse move event.
|
|
2358
|
+
*
|
|
2359
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event object.
|
|
2360
|
+
* @return {void}
|
|
2361
|
+
*/
|
|
2145
2362
|
mouseMove(e) {
|
|
2146
2363
|
this.eventListener.onMouseMoved(e), this.adjustHoverRows(e), this.adjustHoverColumns(e);
|
|
2147
2364
|
}
|
|
2365
|
+
/**
|
|
2366
|
+
* Triggers the context menu event based on the mouse move event.
|
|
2367
|
+
*
|
|
2368
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event object.
|
|
2369
|
+
* @return {void}
|
|
2370
|
+
*/
|
|
2148
2371
|
contextmenu(e) {
|
|
2149
2372
|
this.eventListener.onContextmenu(e);
|
|
2150
2373
|
}
|
|
2374
|
+
/**
|
|
2375
|
+
* Toggles the expand or collapse state of all items in the body area model.
|
|
2376
|
+
*
|
|
2377
|
+
* @param {boolean} [expand=true] - Whether to expand or collapse all items. Default is true.
|
|
2378
|
+
*
|
|
2379
|
+
* @return {void}
|
|
2380
|
+
*/
|
|
2151
2381
|
toggleExpandCollapseAll(e = !0) {
|
|
2152
2382
|
var s;
|
|
2153
2383
|
const t = this.tableModel.getBodyModel();
|
|
2154
|
-
|
|
2384
|
+
te(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
2155
2385
|
}
|
|
2386
|
+
/**
|
|
2387
|
+
* Toggles the checkbox state of a specific row in a table.
|
|
2388
|
+
*
|
|
2389
|
+
* @param {number} rowIdx - The index of the row to toggle the checkbox state.
|
|
2390
|
+
* @param {number} _colIdx - The index of the column. This parameter is unused.
|
|
2391
|
+
* @param {AreaIdent} areaIdent - The identifier of the table area.
|
|
2392
|
+
*
|
|
2393
|
+
* @return {void} - This method does not return anything.
|
|
2394
|
+
*/
|
|
2156
2395
|
toggleRowCheckbox(e, t, s) {
|
|
2157
2396
|
var a;
|
|
2158
2397
|
const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e), r = o === void 0 || o === "semi" || o === "none";
|
|
@@ -2160,6 +2399,13 @@ class re extends qe {
|
|
|
2160
2399
|
const n = (a = i.rowSelectionModel) == null ? void 0 : a.getCheckedRows();
|
|
2161
2400
|
this.eventListener.onCheckboxChanged(n || []);
|
|
2162
2401
|
}
|
|
2402
|
+
/**
|
|
2403
|
+
* Handle mouse click events.
|
|
2404
|
+
*
|
|
2405
|
+
* @param {GeMouseEvent} evt - The mouse click event.
|
|
2406
|
+
* @param {GeMouseEvent | undefined} previousEvt - The previous mouse click event, if any.
|
|
2407
|
+
* @returns {void}
|
|
2408
|
+
*/
|
|
2163
2409
|
onMouseClicked(e, t) {
|
|
2164
2410
|
let s = this.selectionService.onMouseClicked(e, t);
|
|
2165
2411
|
if (!s && this.getFocusModel) {
|
|
@@ -2168,19 +2414,41 @@ class re extends qe {
|
|
|
2168
2414
|
}
|
|
2169
2415
|
this.eventListener.onMouseClicked(e), s && this.debounce(this.repaint.bind(this), 10);
|
|
2170
2416
|
}
|
|
2417
|
+
/**
|
|
2418
|
+
* Updates the table (repaint) when an external filter is changed.
|
|
2419
|
+
*
|
|
2420
|
+
* @param {boolean} clearSelection - Indicates whether to clear the selection model or not. Default value is true.
|
|
2421
|
+
* @return {void}
|
|
2422
|
+
*/
|
|
2171
2423
|
externalFilterChanged(e = !0) {
|
|
2172
2424
|
const t = this.tableOptions.externalFilterFunction;
|
|
2173
2425
|
t && (e && this.clearSelectionModel(), this.tableModel.externalFilterChanged(t), this.scrollViewport.scrollTo(0, 0), this.tableModel.recalcHeightAndPadding(), this.resetSizeOfWrapperDiv(), this.repaint());
|
|
2174
2426
|
}
|
|
2427
|
+
/**
|
|
2428
|
+
* Handle the double click event on the table header.
|
|
2429
|
+
*
|
|
2430
|
+
* @param {MouseEvent} event - The mouse event that triggered the double click.
|
|
2431
|
+
* @param {number} _rowIdx - The row index of the header.
|
|
2432
|
+
* @param {number} colIdx - The column index of the header.
|
|
2433
|
+
*
|
|
2434
|
+
* @return {void}
|
|
2435
|
+
*/
|
|
2175
2436
|
onHeaderDblClicked(e, t, s) {
|
|
2176
2437
|
var o, r;
|
|
2177
2438
|
const i = this.tableModel.getColumnDef(s);
|
|
2178
2439
|
if (i != null && i.sortable && i.sortable()) {
|
|
2179
2440
|
e.preventDefault(), e.stopPropagation();
|
|
2180
|
-
const n = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, a = i.sortState ?? "", h = n[(n.indexOf(a) + 1) % n.length], d = new
|
|
2441
|
+
const n = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, a = i.sortState ?? "", h = n[(n.indexOf(a) + 1) % n.length], d = new Ze(s, h);
|
|
2181
2442
|
this.tableModel.doSort([d]) && ((o = this.tableModel.getColumnDefs()) == null || o.forEach((p) => p.sortState = ""), i.sortState = h), this.repaint(), (r = this.storeSortingService) == null || r.setSortItems([d]);
|
|
2182
2443
|
}
|
|
2183
2444
|
}
|
|
2445
|
+
/**
|
|
2446
|
+
* Changes the focus cell using the specified deltas.
|
|
2447
|
+
*
|
|
2448
|
+
* @param {number} dx - The delta for the column index.
|
|
2449
|
+
* @param {number} dy - The delta for the row index.
|
|
2450
|
+
* @return {boolean} - True if the focus cell was changed, false otherwise.
|
|
2451
|
+
*/
|
|
2184
2452
|
changeFocusCell(e, t) {
|
|
2185
2453
|
if (!this.isEditing() && this.getFocusModel) {
|
|
2186
2454
|
const s = this.getFocusModel();
|
|
@@ -2191,9 +2459,19 @@ class re extends qe {
|
|
|
2191
2459
|
}
|
|
2192
2460
|
return !1;
|
|
2193
2461
|
}
|
|
2462
|
+
/**
|
|
2463
|
+
* Resizes the column based on the mouse event.
|
|
2464
|
+
*
|
|
2465
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event that triggered the resize.
|
|
2466
|
+
*/
|
|
2194
2467
|
resizeColumn(e) {
|
|
2195
2468
|
this.tableModel.setColumnWidth(this.mouseStartColumnIndex, this.mouseStartWidth + e.draggingX), this.tableModel.recalcPadding(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows();
|
|
2196
2469
|
}
|
|
2470
|
+
/**
|
|
2471
|
+
* Clears the selection model, if available.
|
|
2472
|
+
*
|
|
2473
|
+
* @return {void}
|
|
2474
|
+
*/
|
|
2197
2475
|
clearSelectionModel() {
|
|
2198
2476
|
var e;
|
|
2199
2477
|
this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
|
|
@@ -2202,6 +2480,14 @@ class re extends qe {
|
|
|
2202
2480
|
var s;
|
|
2203
2481
|
console.clear(), console.info("this.hostElement.offsetTop", this.hostElement.offsetTop), console.info("this.hostElement.scrollHeight", this.hostElement.scrollHeight), console.info("this.scrollViewportTop", this.scrollTop), console.info("this.areaHeaderCenter.parent.clientHeight", this.areaHeaderCenter.parent.clientHeight), console.info("bodyY", t), console.info("bodyX", e), console.info("rows", this.firstVisibleRowIndex), console.info(""), console.info("this.tableModel", this.tableModel), console.info(""), console.info("this.mouseMoveEvent.clientX", (s = this.mouseHandler.mouseEvent) == null ? void 0 : s.clientX), console.info("this.hostElement.offsetLeft", this.hostElement.offsetLeft), console.info("this.areaBodyWestGeo.width", this.areaBodyWestGeo.width);
|
|
2204
2482
|
}
|
|
2483
|
+
/**
|
|
2484
|
+
* Restores the scroll position of the table if auto restore options are enabled.
|
|
2485
|
+
*
|
|
2486
|
+
* @private
|
|
2487
|
+
* @memberof ClassName
|
|
2488
|
+
*
|
|
2489
|
+
* @returns {void}
|
|
2490
|
+
*/
|
|
2205
2491
|
autoRestoreScrollPosition() {
|
|
2206
2492
|
var e;
|
|
2207
2493
|
if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
|
|
@@ -2209,6 +2495,20 @@ class re extends qe {
|
|
|
2209
2495
|
s && this.scrollViewport.scrollTo(...s);
|
|
2210
2496
|
}
|
|
2211
2497
|
}
|
|
2498
|
+
/**
|
|
2499
|
+
* Automatically restores the sorting state of the table.
|
|
2500
|
+
*
|
|
2501
|
+
* @private
|
|
2502
|
+
* @function autoRestoreSortingState
|
|
2503
|
+
* @memberof ClassName
|
|
2504
|
+
*
|
|
2505
|
+
* @description
|
|
2506
|
+
* This method checks if the autoRestoreSortingState option is enabled in the tableOptions.
|
|
2507
|
+
* If enabled, it uses the storeSortingService to retrieve the sort items array.
|
|
2508
|
+
* If there are sort items present, it applies them to the table's body model using the doSort method.
|
|
2509
|
+
*
|
|
2510
|
+
* @returns {void}
|
|
2511
|
+
*/
|
|
2212
2512
|
autoRestoreSortingState() {
|
|
2213
2513
|
var e, t;
|
|
2214
2514
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
|
|
@@ -2216,13 +2516,19 @@ class re extends qe {
|
|
|
2216
2516
|
s != null && s.length && this.tableModel.getBodyModel().doSort(s);
|
|
2217
2517
|
}
|
|
2218
2518
|
}
|
|
2519
|
+
/**
|
|
2520
|
+
* Restores the collapsed/expanded state of the rows in the table based on the autoRestoreOptions
|
|
2521
|
+
* specified in the tableOptions. This method is private and should not be called directly.
|
|
2522
|
+
*
|
|
2523
|
+
* @private
|
|
2524
|
+
*/
|
|
2219
2525
|
autoRestoreCollapsedExpandedState() {
|
|
2220
2526
|
var e, t;
|
|
2221
2527
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
|
|
2222
2528
|
const s = this.tableOptions.autoRestoreOptions, i = s.getRowId;
|
|
2223
2529
|
if (s.autoRestoreCollapsedExpandedState && i) {
|
|
2224
2530
|
const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), r = this.tableModel.getAreaModel("body");
|
|
2225
|
-
if (
|
|
2531
|
+
if (te(r)) {
|
|
2226
2532
|
const n = r, a = r.getRowCount();
|
|
2227
2533
|
for (let h = 0; h < a; h++) {
|
|
2228
2534
|
const d = r.getRowByIndex(h);
|
|
@@ -2241,14 +2547,36 @@ class re extends qe {
|
|
|
2241
2547
|
}
|
|
2242
2548
|
}
|
|
2243
2549
|
}
|
|
2550
|
+
/**
|
|
2551
|
+
* Scrolls the viewport to the specified pixel coordinates.
|
|
2552
|
+
*
|
|
2553
|
+
* @param {number} px - The horizontal pixel coordinate to scroll to.
|
|
2554
|
+
* @param {number} py - The vertical pixel coordinate to scroll to.
|
|
2555
|
+
*
|
|
2556
|
+
* @return {void}
|
|
2557
|
+
*/
|
|
2558
|
+
scrollToPixel(e, t) {
|
|
2559
|
+
this.scrollViewport.scrollTo(e, t);
|
|
2560
|
+
}
|
|
2561
|
+
/**
|
|
2562
|
+
* Scrolls to the specified index in the table.
|
|
2563
|
+
*
|
|
2564
|
+
* @param {number} _indexX - The horizontal index of the table where scrolling is needed.
|
|
2565
|
+
* @param {number} indexY - The vertical index of the table where scrolling is needed.
|
|
2566
|
+
* @return {void}
|
|
2567
|
+
*/
|
|
2568
|
+
scrollToIndex(e, t) {
|
|
2569
|
+
const i = this.tableModel.getAreaModel("body").getYPosByRowIndex(t);
|
|
2570
|
+
this.scrollToPixel(0, i);
|
|
2571
|
+
}
|
|
2244
2572
|
}
|
|
2245
|
-
const
|
|
2573
|
+
const ct = /* @__PURE__ */ He("<div>"), ft = (l) => {
|
|
2246
2574
|
let e;
|
|
2247
|
-
const t =
|
|
2575
|
+
const t = be({
|
|
2248
2576
|
tableModel: null,
|
|
2249
|
-
tableOptions: new
|
|
2577
|
+
tableOptions: new Ce()
|
|
2250
2578
|
}, l);
|
|
2251
|
-
return
|
|
2579
|
+
return Re(() => {
|
|
2252
2580
|
const s = {
|
|
2253
2581
|
onCheckboxChanged: (r) => {
|
|
2254
2582
|
const n = new CustomEvent("checkboxChanged", {
|
|
@@ -2299,20 +2627,20 @@ const dt = /* @__PURE__ */ Pe("<div>"), ut = (l) => {
|
|
|
2299
2627
|
});
|
|
2300
2628
|
e && e.dispatchEvent(n);
|
|
2301
2629
|
}
|
|
2302
|
-
}, i = new
|
|
2630
|
+
}, i = new ne(e, t.tableModel, new we(), t.tableOptions, s);
|
|
2303
2631
|
i.firstInit();
|
|
2304
2632
|
const o = new CustomEvent("tableReady", {
|
|
2305
2633
|
detail: i.getApi(),
|
|
2306
2634
|
bubbles: !0
|
|
2307
2635
|
});
|
|
2308
|
-
e && e.dispatchEvent(o);
|
|
2636
|
+
e && e.dispatchEvent(o), t.licenseKey && $.getInstance().setLicenseKey(t.licenseKey);
|
|
2309
2637
|
}), (() => {
|
|
2310
|
-
const s =
|
|
2311
|
-
return typeof i == "function" ?
|
|
2638
|
+
const s = ct(), i = e;
|
|
2639
|
+
return typeof i == "function" ? Ve(i, s) : e = s, s;
|
|
2312
2640
|
})();
|
|
2313
2641
|
};
|
|
2314
2642
|
export {
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2643
|
+
ut as ComponentRendererWrapper,
|
|
2644
|
+
ft as GuiexpertTable,
|
|
2645
|
+
pt as GuiexpertTableProps
|
|
2318
2646
|
};
|