@guiexpert/solid-table 1.0.10 → 1.0.12
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 +3 -3
- package/index.js +753 -457
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
const
|
|
2
|
-
equals:
|
|
1
|
+
const Ce = (l, e) => l === e, q = Symbol("solid-proxy"), de = {
|
|
2
|
+
equals: Ce
|
|
3
3
|
};
|
|
4
|
-
let
|
|
5
|
-
const L = 1,
|
|
4
|
+
let ue = fe;
|
|
5
|
+
const L = 1, k = 2, pe = {
|
|
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 Y = null, b = null,
|
|
12
|
+
let Y = null, b = null, x = null, F = null, X = 0;
|
|
13
13
|
function xe(l, e) {
|
|
14
|
-
const t = b, s = A, i = l.length === 0, o = e === void 0 ? s : e,
|
|
14
|
+
const t = b, s = A, i = l.length === 0, o = e === void 0 ? s : e, r = i ? pe : {
|
|
15
15
|
owned: null,
|
|
16
16
|
cleanups: null,
|
|
17
17
|
context: o ? o.context : null,
|
|
18
18
|
owner: o
|
|
19
|
-
},
|
|
20
|
-
A =
|
|
19
|
+
}, n = i ? l : () => l(() => P(() => K(r)));
|
|
20
|
+
A = r, b = null;
|
|
21
21
|
try {
|
|
22
|
-
return H(
|
|
22
|
+
return H(n, !0);
|
|
23
23
|
} finally {
|
|
24
24
|
b = t, A = s;
|
|
25
25
|
}
|
|
@@ -28,15 +28,15 @@ function J(l, e, t) {
|
|
|
28
28
|
const s = te(l, e, !1, L);
|
|
29
29
|
W(s);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
31
|
+
function Ee(l, e, t) {
|
|
32
|
+
ue = Oe;
|
|
33
33
|
const s = te(l, e, !1, L);
|
|
34
34
|
(!t || !t.render) && (s.user = !0), F ? F.push(s) : W(s);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
t = t ? Object.assign({},
|
|
36
|
+
function Ae(l, e, t) {
|
|
37
|
+
t = t ? Object.assign({}, de, t) : de;
|
|
38
38
|
const s = te(l, e, !0, 0);
|
|
39
|
-
return s.observers = null, s.observerSlots = null, s.comparator = t.equals || void 0, W(s),
|
|
39
|
+
return s.observers = null, s.observerSlots = null, s.comparator = t.equals || void 0, W(s), Re.bind(s);
|
|
40
40
|
}
|
|
41
41
|
function P(l) {
|
|
42
42
|
if (b === null)
|
|
@@ -49,16 +49,16 @@ function P(l) {
|
|
|
49
49
|
b = e;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
52
|
+
function Me(l) {
|
|
53
|
+
Ee(() => P(l));
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Re() {
|
|
56
56
|
if (this.sources && this.state)
|
|
57
57
|
if (this.state === L)
|
|
58
58
|
W(this);
|
|
59
59
|
else {
|
|
60
|
-
const l =
|
|
61
|
-
|
|
60
|
+
const l = x;
|
|
61
|
+
x = null, H(() => N(this), !1), x = l;
|
|
62
62
|
}
|
|
63
63
|
if (b) {
|
|
64
64
|
const l = this.observers ? this.observers.length : 0;
|
|
@@ -66,32 +66,32 @@ function Me() {
|
|
|
66
66
|
}
|
|
67
67
|
return this.value;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Te(l, e, t) {
|
|
70
70
|
let s = l.value;
|
|
71
71
|
return (!l.comparator || !l.comparator(s, e)) && (l.value = e, l.observers && l.observers.length && H(() => {
|
|
72
72
|
for (let i = 0; i < l.observers.length; i += 1) {
|
|
73
|
-
const o = l.observers[i],
|
|
74
|
-
|
|
73
|
+
const o = l.observers[i], r = Y && Y.running;
|
|
74
|
+
r && Y.disposed.has(o), (r ? !o.tState : !o.state) && (o.pure ? x.push(o) : F.push(o), o.observers && Se(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
80
|
function W(l) {
|
|
81
81
|
if (!l.fn)
|
|
82
82
|
return;
|
|
83
|
-
|
|
84
|
-
const e = A, t = b, s =
|
|
85
|
-
b = A = l,
|
|
83
|
+
K(l);
|
|
84
|
+
const e = A, t = b, s = X;
|
|
85
|
+
b = A = l, De(l, l.value, s), b = t, A = e;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function De(l, e, t) {
|
|
88
88
|
let s;
|
|
89
89
|
try {
|
|
90
90
|
s = l.fn(e);
|
|
91
91
|
} catch (i) {
|
|
92
|
-
return l.pure && (l.state = L, l.owned && l.owned.forEach(
|
|
92
|
+
return l.pure && (l.state = L, l.owned && l.owned.forEach(K), l.owned = null), l.updatedAt = t + 1, ge(i);
|
|
93
93
|
}
|
|
94
|
-
(!l.updatedAt || l.updatedAt <= t) && (l.updatedAt != null && "observers" in l ?
|
|
94
|
+
(!l.updatedAt || l.updatedAt <= t) && (l.updatedAt != null && "observers" in l ? Te(l, s) : l.value = s, l.updatedAt = t);
|
|
95
95
|
}
|
|
96
96
|
function te(l, e, t, s = L, i) {
|
|
97
97
|
const o = {
|
|
@@ -107,49 +107,49 @@ function te(l, e, t, s = L, i) {
|
|
|
107
107
|
context: A ? A.context : null,
|
|
108
108
|
pure: t
|
|
109
109
|
};
|
|
110
|
-
return A === null || A !==
|
|
110
|
+
return A === null || A !== pe && (A.owned ? A.owned.push(o) : A.owned = [o]), o;
|
|
111
111
|
}
|
|
112
112
|
function G(l) {
|
|
113
113
|
if (l.state === 0)
|
|
114
114
|
return;
|
|
115
|
-
if (l.state ===
|
|
115
|
+
if (l.state === k)
|
|
116
116
|
return N(l);
|
|
117
117
|
if (l.suspense && P(l.suspense.inFallback))
|
|
118
118
|
return l.suspense.effects.push(l);
|
|
119
119
|
const e = [l];
|
|
120
|
-
for (; (l = l.owner) && (!l.updatedAt || l.updatedAt <
|
|
120
|
+
for (; (l = l.owner) && (!l.updatedAt || l.updatedAt < X); )
|
|
121
121
|
l.state && e.push(l);
|
|
122
122
|
for (let t = e.length - 1; t >= 0; t--)
|
|
123
123
|
if (l = e[t], l.state === L)
|
|
124
124
|
W(l);
|
|
125
|
-
else if (l.state ===
|
|
126
|
-
const s =
|
|
127
|
-
|
|
125
|
+
else if (l.state === k) {
|
|
126
|
+
const s = x;
|
|
127
|
+
x = null, H(() => N(l, e[0]), !1), x = s;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
function H(l, e) {
|
|
131
|
-
if (
|
|
131
|
+
if (x)
|
|
132
132
|
return l();
|
|
133
133
|
let t = !1;
|
|
134
|
-
e || (
|
|
134
|
+
e || (x = []), F ? t = !0 : F = [], X++;
|
|
135
135
|
try {
|
|
136
136
|
const s = l();
|
|
137
|
-
return
|
|
137
|
+
return Ie(t), s;
|
|
138
138
|
} catch (s) {
|
|
139
|
-
t || (F = null),
|
|
139
|
+
t || (F = null), x = null, ge(s);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
if (
|
|
142
|
+
function Ie(l) {
|
|
143
|
+
if (x && (fe(x), x = null), l)
|
|
144
144
|
return;
|
|
145
145
|
const e = F;
|
|
146
|
-
F = null, e.length && H(() =>
|
|
146
|
+
F = null, e.length && H(() => ue(e), !1);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function fe(l) {
|
|
149
149
|
for (let e = 0; e < l.length; e++)
|
|
150
150
|
G(l[e]);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function Oe(l) {
|
|
153
153
|
let e, t = 0;
|
|
154
154
|
for (e = 0; e < l.length; e++) {
|
|
155
155
|
const s = l[e];
|
|
@@ -164,29 +164,29 @@ function N(l, e) {
|
|
|
164
164
|
const s = l.sources[t];
|
|
165
165
|
if (s.sources) {
|
|
166
166
|
const i = s.state;
|
|
167
|
-
i === L ? s !== e && (!s.updatedAt || s.updatedAt <
|
|
167
|
+
i === L ? s !== e && (!s.updatedAt || s.updatedAt < X) && G(s) : i === k && N(s, e);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Se(l) {
|
|
172
172
|
for (let e = 0; e < l.observers.length; e += 1) {
|
|
173
173
|
const t = l.observers[e];
|
|
174
|
-
t.state || (t.state =
|
|
174
|
+
t.state || (t.state = k, t.pure ? x.push(t) : F.push(t), t.observers && Se(t));
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function K(l) {
|
|
178
178
|
let e;
|
|
179
179
|
if (l.sources)
|
|
180
180
|
for (; l.sources.length; ) {
|
|
181
181
|
const t = l.sources.pop(), s = l.sourceSlots.pop(), i = t.observers;
|
|
182
182
|
if (i && i.length) {
|
|
183
|
-
const o = i.pop(),
|
|
184
|
-
s < i.length && (o.sourceSlots[
|
|
183
|
+
const o = i.pop(), r = t.observerSlots.pop();
|
|
184
|
+
s < i.length && (o.sourceSlots[r] = s, i[s] = o, t.observerSlots[s] = r);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
if (l.owned) {
|
|
188
188
|
for (e = l.owned.length - 1; e >= 0; e--)
|
|
189
|
-
|
|
189
|
+
K(l.owned[e]);
|
|
190
190
|
l.owned = null;
|
|
191
191
|
}
|
|
192
192
|
if (l.cleanups) {
|
|
@@ -196,26 +196,26 @@ function X(l) {
|
|
|
196
196
|
}
|
|
197
197
|
l.state = 0;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function Fe(l) {
|
|
200
200
|
return l instanceof Error ? l : new Error(typeof l == "string" ? l : "Unknown error", {
|
|
201
201
|
cause: l
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
|
-
function
|
|
205
|
-
throw
|
|
204
|
+
function ge(l, e = A) {
|
|
205
|
+
throw Fe(l);
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function _() {
|
|
208
208
|
return !0;
|
|
209
209
|
}
|
|
210
|
-
const
|
|
210
|
+
const Le = {
|
|
211
211
|
get(l, e, t) {
|
|
212
212
|
return e === q ? t : l.get(e);
|
|
213
213
|
},
|
|
214
214
|
has(l, e) {
|
|
215
215
|
return e === q ? !0 : l.has(e);
|
|
216
216
|
},
|
|
217
|
-
set:
|
|
218
|
-
deleteProperty:
|
|
217
|
+
set: _,
|
|
218
|
+
deleteProperty: _,
|
|
219
219
|
getOwnPropertyDescriptor(l, e) {
|
|
220
220
|
return {
|
|
221
221
|
configurable: !0,
|
|
@@ -223,8 +223,8 @@ const Fe = {
|
|
|
223
223
|
get() {
|
|
224
224
|
return l.get(e);
|
|
225
225
|
},
|
|
226
|
-
set:
|
|
227
|
-
deleteProperty:
|
|
226
|
+
set: _,
|
|
227
|
+
deleteProperty: _
|
|
228
228
|
};
|
|
229
229
|
},
|
|
230
230
|
ownKeys(l) {
|
|
@@ -234,131 +234,131 @@ const Fe = {
|
|
|
234
234
|
function U(l) {
|
|
235
235
|
return (l = typeof l == "function" ? l() : l) ? l : {};
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function $e() {
|
|
238
238
|
for (let l = 0, e = this.length; l < e; ++l) {
|
|
239
239
|
const t = this[l]();
|
|
240
240
|
if (t !== void 0)
|
|
241
241
|
return t;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function me(...l) {
|
|
245
245
|
let e = !1;
|
|
246
246
|
for (let o = 0; o < l.length; o++) {
|
|
247
|
-
const
|
|
248
|
-
e = e || !!
|
|
247
|
+
const r = l[o];
|
|
248
|
+
e = e || !!r && q in r, l[o] = typeof r == "function" ? (e = !0, Ae(r)) : r;
|
|
249
249
|
}
|
|
250
250
|
if (e)
|
|
251
251
|
return new Proxy({
|
|
252
252
|
get(o) {
|
|
253
|
-
for (let
|
|
254
|
-
const
|
|
255
|
-
if (
|
|
256
|
-
return
|
|
253
|
+
for (let r = l.length - 1; r >= 0; r--) {
|
|
254
|
+
const n = U(l[r])[o];
|
|
255
|
+
if (n !== void 0)
|
|
256
|
+
return n;
|
|
257
257
|
}
|
|
258
258
|
},
|
|
259
259
|
has(o) {
|
|
260
|
-
for (let
|
|
261
|
-
if (o in U(l[
|
|
260
|
+
for (let r = l.length - 1; r >= 0; r--)
|
|
261
|
+
if (o in U(l[r]))
|
|
262
262
|
return !0;
|
|
263
263
|
return !1;
|
|
264
264
|
},
|
|
265
265
|
keys() {
|
|
266
266
|
const o = [];
|
|
267
|
-
for (let
|
|
268
|
-
o.push(...Object.keys(U(l[
|
|
267
|
+
for (let r = 0; r < l.length; r++)
|
|
268
|
+
o.push(...Object.keys(U(l[r])));
|
|
269
269
|
return [...new Set(o)];
|
|
270
270
|
}
|
|
271
|
-
},
|
|
271
|
+
}, Le);
|
|
272
272
|
const t = {}, s = {}, i = /* @__PURE__ */ new Set();
|
|
273
273
|
for (let o = l.length - 1; o >= 0; o--) {
|
|
274
|
-
const
|
|
275
|
-
if (!
|
|
274
|
+
const r = l[o];
|
|
275
|
+
if (!r)
|
|
276
276
|
continue;
|
|
277
|
-
const
|
|
278
|
-
for (let a = 0, h =
|
|
279
|
-
const d =
|
|
277
|
+
const n = Object.getOwnPropertyNames(r);
|
|
278
|
+
for (let a = 0, h = n.length; a < h; a++) {
|
|
279
|
+
const d = n[a];
|
|
280
280
|
if (d === "__proto__" || d === "constructor")
|
|
281
281
|
continue;
|
|
282
|
-
const c = Object.getOwnPropertyDescriptor(
|
|
282
|
+
const c = Object.getOwnPropertyDescriptor(r, d);
|
|
283
283
|
if (!i.has(d))
|
|
284
284
|
c.get ? (i.add(d), Object.defineProperty(t, d, {
|
|
285
285
|
enumerable: !0,
|
|
286
286
|
configurable: !0,
|
|
287
|
-
get:
|
|
287
|
+
get: $e.bind(s[d] = [c.get.bind(r)])
|
|
288
288
|
})) : (c.value !== void 0 && i.add(d), t[d] = c.value);
|
|
289
289
|
else {
|
|
290
290
|
const p = s[d];
|
|
291
|
-
p ? c.get ? p.push(c.get.bind(
|
|
291
|
+
p ? c.get ? p.push(c.get.bind(r)) : c.value !== void 0 && p.push(() => c.value) : t[d] === void 0 && (t[d] = c.value);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
return t;
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
let s = t.length, i = e.length, o = s,
|
|
299
|
-
for (;
|
|
300
|
-
if (e[
|
|
301
|
-
|
|
297
|
+
function Be(l, e, t) {
|
|
298
|
+
let s = t.length, i = e.length, o = s, r = 0, n = 0, a = e[i - 1].nextSibling, h = null;
|
|
299
|
+
for (; r < i || n < o; ) {
|
|
300
|
+
if (e[r] === t[n]) {
|
|
301
|
+
r++, n++;
|
|
302
302
|
continue;
|
|
303
303
|
}
|
|
304
304
|
for (; e[i - 1] === t[o - 1]; )
|
|
305
305
|
i--, o--;
|
|
306
|
-
if (i ===
|
|
307
|
-
const d = o < s ?
|
|
308
|
-
for (;
|
|
309
|
-
l.insertBefore(t[
|
|
310
|
-
} else if (o ===
|
|
311
|
-
for (;
|
|
312
|
-
(!h || !h.has(e[
|
|
313
|
-
else if (e[
|
|
306
|
+
if (i === r) {
|
|
307
|
+
const d = o < s ? n ? t[n - 1].nextSibling : t[o - n] : a;
|
|
308
|
+
for (; n < o; )
|
|
309
|
+
l.insertBefore(t[n++], d);
|
|
310
|
+
} else if (o === n)
|
|
311
|
+
for (; r < i; )
|
|
312
|
+
(!h || !h.has(e[r])) && e[r].remove(), r++;
|
|
313
|
+
else if (e[r] === t[o - 1] && t[n] === e[i - 1]) {
|
|
314
314
|
const d = e[--i].nextSibling;
|
|
315
|
-
l.insertBefore(t[
|
|
315
|
+
l.insertBefore(t[n++], e[r++].nextSibling), l.insertBefore(t[--o], d), e[i] = t[o];
|
|
316
316
|
} else {
|
|
317
317
|
if (!h) {
|
|
318
318
|
h = /* @__PURE__ */ new Map();
|
|
319
|
-
let c =
|
|
319
|
+
let c = n;
|
|
320
320
|
for (; c < o; )
|
|
321
321
|
h.set(t[c], c++);
|
|
322
322
|
}
|
|
323
|
-
const d = h.get(e[
|
|
323
|
+
const d = h.get(e[r]);
|
|
324
324
|
if (d != null)
|
|
325
|
-
if (
|
|
326
|
-
let c =
|
|
325
|
+
if (n < d && d < o) {
|
|
326
|
+
let c = r, p = 1, g;
|
|
327
327
|
for (; ++c < i && c < o && !((g = h.get(e[c])) == null || g !== d + p); )
|
|
328
328
|
p++;
|
|
329
|
-
if (p > d -
|
|
330
|
-
const u = e[
|
|
331
|
-
for (;
|
|
332
|
-
l.insertBefore(t[
|
|
329
|
+
if (p > d - n) {
|
|
330
|
+
const u = e[r];
|
|
331
|
+
for (; n < d; )
|
|
332
|
+
l.insertBefore(t[n++], u);
|
|
333
333
|
} else
|
|
334
|
-
l.replaceChild(t[
|
|
334
|
+
l.replaceChild(t[n++], e[r++]);
|
|
335
335
|
} else
|
|
336
|
-
|
|
336
|
+
r++;
|
|
337
337
|
else
|
|
338
|
-
e[
|
|
338
|
+
e[r++].remove();
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function Pe(l, e, t, s = {}) {
|
|
343
343
|
let i;
|
|
344
344
|
return xe((o) => {
|
|
345
|
-
i = o, e === document ? l() :
|
|
345
|
+
i = o, e === document ? l() : Ve(e, l(), e.firstChild ? null : void 0, t);
|
|
346
346
|
}, s.owner), () => {
|
|
347
347
|
i(), e.textContent = "";
|
|
348
348
|
};
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function We(l, e, t) {
|
|
351
351
|
let s;
|
|
352
352
|
const i = () => {
|
|
353
|
-
const
|
|
354
|
-
return
|
|
353
|
+
const r = document.createElement("template");
|
|
354
|
+
return r.innerHTML = l, t ? r.content.firstChild.firstChild : r.content.firstChild;
|
|
355
355
|
}, o = e ? () => P(() => document.importNode(s || (s = i()), !0)) : () => (s || (s = i())).cloneNode(!0);
|
|
356
356
|
return o.cloneNode = o, o;
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function He(l, e, t) {
|
|
359
359
|
return P(() => l(e, t));
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function Ve(l, e, t, s) {
|
|
362
362
|
if (t !== void 0 && !s && (s = []), typeof e != "function")
|
|
363
363
|
return j(l, e, s, t);
|
|
364
364
|
J((i) => j(l, e(), i, t), s);
|
|
@@ -368,11 +368,11 @@ function j(l, e, t, s, i) {
|
|
|
368
368
|
t = t();
|
|
369
369
|
if (e === t)
|
|
370
370
|
return t;
|
|
371
|
-
const o = typeof e,
|
|
372
|
-
if (l =
|
|
373
|
-
if (o === "number" && (e = e.toString()),
|
|
374
|
-
let
|
|
375
|
-
|
|
371
|
+
const o = typeof e, r = s !== void 0;
|
|
372
|
+
if (l = r && t[0] && t[0].parentNode || l, o === "string" || o === "number")
|
|
373
|
+
if (o === "number" && (e = e.toString()), r) {
|
|
374
|
+
let n = t[0];
|
|
375
|
+
n && n.nodeType === 3 ? n.data = e : n = document.createTextNode(e), t = B(l, t, s, n);
|
|
376
376
|
} else
|
|
377
377
|
t !== "" && typeof t == "string" ? t = l.firstChild.data = e : t = l.textContent = e;
|
|
378
378
|
else if (e == null || o === "boolean")
|
|
@@ -380,24 +380,24 @@ function j(l, e, t, s, i) {
|
|
|
380
380
|
else {
|
|
381
381
|
if (o === "function")
|
|
382
382
|
return J(() => {
|
|
383
|
-
let
|
|
384
|
-
for (; typeof
|
|
385
|
-
|
|
386
|
-
t = j(l,
|
|
383
|
+
let n = e();
|
|
384
|
+
for (; typeof n == "function"; )
|
|
385
|
+
n = n();
|
|
386
|
+
t = j(l, n, t, s);
|
|
387
387
|
}), () => t;
|
|
388
388
|
if (Array.isArray(e)) {
|
|
389
|
-
const
|
|
390
|
-
if (Q(
|
|
391
|
-
return J(() => t = j(l,
|
|
392
|
-
if (
|
|
393
|
-
if (t = B(l, t, s),
|
|
389
|
+
const n = [], a = t && Array.isArray(t);
|
|
390
|
+
if (Q(n, e, t, i))
|
|
391
|
+
return J(() => t = j(l, n, t, s, !0)), () => t;
|
|
392
|
+
if (n.length === 0) {
|
|
393
|
+
if (t = B(l, t, s), r)
|
|
394
394
|
return t;
|
|
395
395
|
} else
|
|
396
|
-
a ? t.length === 0 ?
|
|
397
|
-
t =
|
|
396
|
+
a ? t.length === 0 ? he(l, n, s) : Be(l, t, n) : (t && B(l), he(l, n));
|
|
397
|
+
t = n;
|
|
398
398
|
} else if (e.nodeType) {
|
|
399
399
|
if (Array.isArray(t)) {
|
|
400
|
-
if (
|
|
400
|
+
if (r)
|
|
401
401
|
return t = B(l, t, s, e);
|
|
402
402
|
B(l, t, null, e);
|
|
403
403
|
} else
|
|
@@ -409,28 +409,28 @@ function j(l, e, t, s, i) {
|
|
|
409
409
|
}
|
|
410
410
|
function Q(l, e, t, s) {
|
|
411
411
|
let i = !1;
|
|
412
|
-
for (let o = 0,
|
|
413
|
-
let
|
|
414
|
-
if (!(
|
|
415
|
-
if ((h = typeof
|
|
416
|
-
l.push(
|
|
417
|
-
else if (Array.isArray(
|
|
418
|
-
i = Q(l,
|
|
412
|
+
for (let o = 0, r = e.length; o < r; o++) {
|
|
413
|
+
let n = e[o], a = t && t[o], h;
|
|
414
|
+
if (!(n == null || n === !0 || n === !1))
|
|
415
|
+
if ((h = typeof n) == "object" && n.nodeType)
|
|
416
|
+
l.push(n);
|
|
417
|
+
else if (Array.isArray(n))
|
|
418
|
+
i = Q(l, n, a) || i;
|
|
419
419
|
else if (h === "function")
|
|
420
420
|
if (s) {
|
|
421
|
-
for (; typeof
|
|
422
|
-
|
|
423
|
-
i = Q(l, Array.isArray(
|
|
421
|
+
for (; typeof n == "function"; )
|
|
422
|
+
n = n();
|
|
423
|
+
i = Q(l, Array.isArray(n) ? n : [n], Array.isArray(a) ? a : [a]) || i;
|
|
424
424
|
} else
|
|
425
|
-
l.push(
|
|
425
|
+
l.push(n), i = !0;
|
|
426
426
|
else {
|
|
427
|
-
const d = String(
|
|
427
|
+
const d = String(n);
|
|
428
428
|
a && a.nodeType === 3 && a.data === d ? l.push(a) : l.push(document.createTextNode(d));
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
return i;
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function he(l, e, t = null) {
|
|
434
434
|
for (let s = 0, i = e.length; s < i; s++)
|
|
435
435
|
l.insertBefore(e[s], t);
|
|
436
436
|
}
|
|
@@ -440,11 +440,11 @@ function B(l, e, t, s) {
|
|
|
440
440
|
const i = s || document.createTextNode("");
|
|
441
441
|
if (e.length) {
|
|
442
442
|
let o = !1;
|
|
443
|
-
for (let
|
|
444
|
-
const
|
|
445
|
-
if (i !==
|
|
446
|
-
const a =
|
|
447
|
-
!o && !
|
|
443
|
+
for (let r = e.length - 1; r >= 0; r--) {
|
|
444
|
+
const n = e[r];
|
|
445
|
+
if (i !== n) {
|
|
446
|
+
const a = n.parentNode === l;
|
|
447
|
+
!o && !r ? a ? l.replaceChild(i, n) : l.insertBefore(i, t) : a && n.remove();
|
|
448
448
|
} else
|
|
449
449
|
o = !0;
|
|
450
450
|
}
|
|
@@ -452,25 +452,25 @@ function B(l, e, t, s) {
|
|
|
452
452
|
l.insertBefore(i, t);
|
|
453
453
|
return [i];
|
|
454
454
|
}
|
|
455
|
-
class
|
|
455
|
+
class ct {
|
|
456
456
|
constructor(e) {
|
|
457
457
|
this.code = e;
|
|
458
458
|
}
|
|
459
|
-
render(e, t, s, i, o,
|
|
460
|
-
const a =
|
|
459
|
+
render(e, t, s, i, o, r, n) {
|
|
460
|
+
const a = me({
|
|
461
461
|
rowIndex: t,
|
|
462
462
|
columnIndex: s,
|
|
463
463
|
areaIdent: i,
|
|
464
464
|
areaModel: o,
|
|
465
|
-
cellValue:
|
|
465
|
+
cellValue: r
|
|
466
466
|
});
|
|
467
|
-
|
|
467
|
+
Pe(
|
|
468
468
|
() => this.code(a),
|
|
469
469
|
e
|
|
470
470
|
);
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
|
-
const
|
|
473
|
+
const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
474
474
|
__proto__: null
|
|
475
475
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
476
476
|
function Z(l) {
|
|
@@ -480,8 +480,8 @@ function ee(l) {
|
|
|
480
480
|
return l && l.type === "AreaModelTree";
|
|
481
481
|
}
|
|
482
482
|
class se {
|
|
483
|
-
constructor(e = -1, t = -1, s = -1, i = -1, o,
|
|
484
|
-
this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = i, this.areaIdent = o, this.sideIdent =
|
|
483
|
+
constructor(e = -1, t = -1, s = -1, i = -1, o, r, n, a = 0, h = 0, d = 0, c = "") {
|
|
484
|
+
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
485
|
}
|
|
486
486
|
clone() {
|
|
487
487
|
return new se(
|
|
@@ -504,7 +504,7 @@ class $ {
|
|
|
504
504
|
this.content = e, this.style = t, this.classes = s;
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
class
|
|
507
|
+
class be {
|
|
508
508
|
constructor(e = new $(
|
|
509
509
|
">",
|
|
510
510
|
"transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
|
|
@@ -525,12 +525,12 @@ class me {
|
|
|
525
525
|
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = i;
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
class
|
|
528
|
+
class ye {
|
|
529
529
|
constructor(e = new $("↑", "", ["ge-header-sorted-asc"]), t = new $("↓", "", ["ge-header-sorted-desc"]), s = new $("↑", "color:transparent;", [])) {
|
|
530
530
|
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
|
-
class
|
|
533
|
+
class _e {
|
|
534
534
|
constructor(e) {
|
|
535
535
|
this.domService = e;
|
|
536
536
|
}
|
|
@@ -583,6 +583,9 @@ class Ve {
|
|
|
583
583
|
addClass(e, t) {
|
|
584
584
|
return e.includes(" ") ? e.split(" ").forEach((s) => this.domService.addClass(t, s)) : this.domService.addClass(t, e), t;
|
|
585
585
|
}
|
|
586
|
+
removeClass(e, t) {
|
|
587
|
+
return e.includes(" ") ? e.split(" ").forEach((s) => this.domService.removeClass(t, s)) : this.domService.removeClass(t, e), t;
|
|
588
|
+
}
|
|
586
589
|
addClasses(e, t) {
|
|
587
590
|
if (e)
|
|
588
591
|
for (const s of e)
|
|
@@ -600,83 +603,83 @@ class Ve {
|
|
|
600
603
|
const s = this.domService.createElement("div");
|
|
601
604
|
return this.addClass(e, s), this.domService.appendChild(t, s), s;
|
|
602
605
|
}
|
|
603
|
-
addRowDiv(e, t, s = -1, i, o,
|
|
604
|
-
const
|
|
606
|
+
addRowDiv(e, t, s = -1, i, o, r = "") {
|
|
607
|
+
const n = t.index ?? -1, a = this.getDivOrCreateDiv(n, e);
|
|
605
608
|
if (this.domService.addClass(a, "ge-table-row-div"), this.domService.addClass(a, `ge-table-row-div-${t.index}`), i === "body" && o === "center") {
|
|
606
609
|
const h = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
607
610
|
this.domService.addClass(a, `ge-table-row-${h}`);
|
|
608
611
|
}
|
|
609
|
-
if (this.domService.setStyle(a, "display", "clip"), this.domService.setStyle(a, "position", "absolute"), this.domService.setStyle(a, "left", `${t.left}px`), this.domService.setStyle(a, "top", `${t.top}px`), this.domService.setStyle(a, "width", `${t.width}px`), this.domService.setStyle(a, "height", `${t.height}px`), this.domService.setAttribute(a, "data-row-index", `${s}`), this.domService.setAttribute(a, "data-area", `${i}`),
|
|
610
|
-
const h = this.domService.createText(
|
|
612
|
+
if (this.domService.setStyle(a, "display", "clip"), this.domService.setStyle(a, "position", "absolute"), this.domService.setStyle(a, "left", `${t.left}px`), this.domService.setStyle(a, "top", `${t.top}px`), this.domService.setStyle(a, "width", `${t.width}px`), this.domService.setStyle(a, "height", `${t.height}px`), this.domService.setAttribute(a, "data-row-index", `${s}`), this.domService.setAttribute(a, "data-area", `${i}`), r) {
|
|
613
|
+
const h = this.domService.createText(r);
|
|
611
614
|
this.domService.appendChild(a, h);
|
|
612
615
|
}
|
|
613
616
|
return this.domService.appendChild(e.child, a), a;
|
|
614
617
|
}
|
|
615
|
-
addColumnDiv(e, t, s = -1, i = -1, o,
|
|
618
|
+
addColumnDiv(e, t, s = -1, i = -1, o, r, n = "", a, h, d = void 0, c) {
|
|
616
619
|
const p = h == null ? void 0 : h.treeOptions, g = h == null ? void 0 : h.showCheckboxWihoutExtraColumn, u = this.domService.createElement("div");
|
|
617
620
|
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}`);
|
|
618
|
-
const
|
|
619
|
-
if (o === "body" &&
|
|
620
|
-
const
|
|
621
|
-
this.addLabelDiv(u,
|
|
621
|
+
const m = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
622
|
+
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) {
|
|
623
|
+
const S = a !== "none" && i === 0;
|
|
624
|
+
this.addLabelDiv(u, n, S, s, i, o);
|
|
622
625
|
}
|
|
623
626
|
return c && this.addSortedIcon(u, c, h == null ? void 0 : h.sortedOptions, i), this.domService.appendChild(e, u), u;
|
|
624
627
|
}
|
|
625
628
|
addCheckboxToDiv(e, t, s, i) {
|
|
626
|
-
const o = this.domService.createElement("div"),
|
|
629
|
+
const o = this.domService.createElement("div"), r = t === "full" ? "checked" : "";
|
|
627
630
|
return o.innerHTML = `
|
|
628
631
|
<input
|
|
629
632
|
type="checkbox"
|
|
630
633
|
data-area="${s}"
|
|
631
634
|
data-row-index="${i}"
|
|
632
635
|
data-input-type="checkbox"
|
|
633
|
-
${
|
|
636
|
+
${r}
|
|
634
637
|
class="ge-table-row-checkbox"> `, this.domService.setStyle(o, "display", "inline"), this.domService.setStyle(o, "width", "inherit"), this.domService.setAttribute(o, "data-row-index", `${i}`), this.domService.appendChild(e, o), o;
|
|
635
638
|
}
|
|
636
|
-
addLabelDiv(e, t = "", s = !1, i = -1, o = -1,
|
|
637
|
-
const
|
|
638
|
-
if (this.domService.addClass(
|
|
639
|
+
addLabelDiv(e, t = "", s = !1, i = -1, o = -1, r = "body") {
|
|
640
|
+
const n = this.domService.createElement("div");
|
|
641
|
+
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", `${i}`), this.domService.setAttribute(n, "data-col-index", `${o}`), this.domService.setAttribute(n, "data-area", `${r}`), t)
|
|
639
642
|
if (s) {
|
|
640
643
|
const a = this.domService.createText(t);
|
|
641
|
-
this.domService.appendChild(
|
|
644
|
+
this.domService.appendChild(n, a);
|
|
642
645
|
} else {
|
|
643
646
|
const a = this.domService.createElement("div");
|
|
644
|
-
this.domService.appendChild(
|
|
647
|
+
this.domService.appendChild(n, a);
|
|
645
648
|
const h = this.domService.createText(t);
|
|
646
|
-
this.domService.addClass(a, "ge-table-label"), this.domService.appendChild(a, h), this.domService.setAttribute(a, "data-row-index", `${i}`), this.domService.setAttribute(a, "data-col-index", `${o}`), this.domService.setAttribute(a, "data-area", `${
|
|
649
|
+
this.domService.addClass(a, "ge-table-label"), this.domService.appendChild(a, h), this.domService.setAttribute(a, "data-row-index", `${i}`), this.domService.setAttribute(a, "data-col-index", `${o}`), this.domService.setAttribute(a, "data-area", `${r}`);
|
|
647
650
|
}
|
|
648
|
-
return this.domService.appendChild(e,
|
|
651
|
+
return this.domService.appendChild(e, n), n;
|
|
649
652
|
}
|
|
650
|
-
addSortedIcon(e, t = "", s = new
|
|
653
|
+
addSortedIcon(e, t = "", s = new ye(), i = -1) {
|
|
651
654
|
const o = this.domService.createElement("div");
|
|
652
655
|
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");
|
|
653
|
-
let
|
|
654
|
-
t === "asc" ?
|
|
655
|
-
const
|
|
656
|
-
this.domService.appendChild(o, a),
|
|
657
|
-
for (const h of
|
|
656
|
+
let r;
|
|
657
|
+
t === "asc" ? r = s.iconAsc : t === "desc" ? r = s.iconDesc : r = s.iconPlaceholder;
|
|
658
|
+
const n = r.content, a = this.domService.createText(n);
|
|
659
|
+
this.domService.appendChild(o, a), r.style && this.applyStyleString(o, r.style);
|
|
660
|
+
for (const h of r.classes)
|
|
658
661
|
this.domService.addClass(o, h);
|
|
659
662
|
return this.domService.appendChild(e, o), o;
|
|
660
663
|
}
|
|
661
|
-
addArrowDiv(e, t = "none", s = new
|
|
662
|
-
const
|
|
663
|
-
this.domService.addClass(
|
|
664
|
+
addArrowDiv(e, t = "none", s = new be(), i = -1, o = -1, r = "body") {
|
|
665
|
+
const n = this.domService.createElement("div");
|
|
666
|
+
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}`);
|
|
664
667
|
let a;
|
|
665
668
|
t === "expanded" ? a = s.arrowExpanded : t === "collapsed" ? a = s.arrowCollapsed : a = s.arrowPlaceholder;
|
|
666
669
|
const h = a.content, d = this.domService.createText(h);
|
|
667
|
-
this.domService.appendChild(
|
|
670
|
+
this.domService.appendChild(n, d), a.style && this.applyStyleString(n, a.style);
|
|
668
671
|
for (const c of a.classes)
|
|
669
|
-
this.domService.addClass(
|
|
670
|
-
return this.domService.appendChild(e,
|
|
672
|
+
this.domService.addClass(n, c);
|
|
673
|
+
return this.domService.appendChild(e, n), n;
|
|
671
674
|
}
|
|
672
675
|
addColumnBorderDivs(e, t, s, i, o) {
|
|
673
676
|
if (e.verticalBorderVisible) {
|
|
674
|
-
const
|
|
675
|
-
this.addVerticalBorder(s, t,
|
|
677
|
+
const r = `ge-table-${i}-${o}-vertical-border`;
|
|
678
|
+
this.addVerticalBorder(s, t, r);
|
|
676
679
|
}
|
|
677
680
|
if (e.horizontalBorderVisible) {
|
|
678
|
-
const
|
|
679
|
-
this.addHorizontalBorder(s, t,
|
|
681
|
+
const r = `ge-table-${i}-${o}-horizontal-border`;
|
|
682
|
+
this.addHorizontalBorder(s, t, r);
|
|
680
683
|
}
|
|
681
684
|
return t;
|
|
682
685
|
}
|
|
@@ -699,8 +702,8 @@ class Ve {
|
|
|
699
702
|
applyStyleString(e, t) {
|
|
700
703
|
const s = t.split(";").map((i) => i.trim()).filter((i) => i);
|
|
701
704
|
for (const i of s) {
|
|
702
|
-
const [o,
|
|
703
|
-
this.domService.setStyle(e, o.trim(),
|
|
705
|
+
const [o, r] = i.split(":");
|
|
706
|
+
this.domService.setStyle(e, o.trim(), r.trim());
|
|
704
707
|
}
|
|
705
708
|
}
|
|
706
709
|
getDivOrCreateDiv(e, t) {
|
|
@@ -721,17 +724,31 @@ class ke {
|
|
|
721
724
|
}
|
|
722
725
|
}
|
|
723
726
|
}
|
|
724
|
-
class
|
|
727
|
+
class Ge {
|
|
725
728
|
constructor(e) {
|
|
726
729
|
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(
|
|
727
730
|
(t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
|
|
728
731
|
);
|
|
729
732
|
}
|
|
733
|
+
/**
|
|
734
|
+
* Handles the "contextmenu" event.
|
|
735
|
+
*
|
|
736
|
+
* @private
|
|
737
|
+
* @param {MouseEvent} evt - The mouse event object.
|
|
738
|
+
* @return {void}
|
|
739
|
+
*/
|
|
730
740
|
onContextmenu(e) {
|
|
731
741
|
this.mouseEvent = e;
|
|
732
742
|
const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
|
|
733
743
|
this.tableScope.contextmenu(t);
|
|
734
744
|
}
|
|
745
|
+
/**
|
|
746
|
+
* Handles the click event on the host element.
|
|
747
|
+
*
|
|
748
|
+
* @param {MouseEvent} event - The click event.
|
|
749
|
+
*
|
|
750
|
+
* @return {void}
|
|
751
|
+
*/
|
|
735
752
|
onHostElementClicked(e) {
|
|
736
753
|
const t = new ke(e.target, this.tableScope);
|
|
737
754
|
if (t.action === "toggleExpandCollapseAll")
|
|
@@ -752,32 +769,52 @@ class _e {
|
|
|
752
769
|
}
|
|
753
770
|
this.publishGeMouseEvent(e, 1);
|
|
754
771
|
}
|
|
772
|
+
/**
|
|
773
|
+
* Handles the double click event on the host element.
|
|
774
|
+
* This method is private.
|
|
775
|
+
*
|
|
776
|
+
* @param {MouseEvent} event - The double click event.
|
|
777
|
+
*/
|
|
755
778
|
onHostElementDblClicked(e) {
|
|
756
779
|
if (e.target instanceof HTMLElement) {
|
|
757
|
-
const t = e.target, s = t.getAttribute("data-area"), i = ie(s), o = Number(t.getAttribute("data-row-index")),
|
|
780
|
+
const t = e.target, s = t.getAttribute("data-area"), i = ie(s), o = Number(t.getAttribute("data-row-index")), r = Number(t.getAttribute("data-col-index")), n = this.tableScope.tableModel.getAreaModel(i);
|
|
758
781
|
if (s && i === "header")
|
|
759
|
-
this.tableScope.tableModel.isSortable(
|
|
782
|
+
this.tableScope.tableModel.isSortable(r) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, o, r));
|
|
760
783
|
else if (t.getAttribute("data-row-index")) {
|
|
761
|
-
const a =
|
|
762
|
-
if (s && i === "body" &&
|
|
784
|
+
const a = n.getRowByIndex(o);
|
|
785
|
+
if (s && i === "body" && n.isEditable(o, r) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, r)), Z(a) && r === this.getArrowColumnIndex()) {
|
|
763
786
|
e.preventDefault(), e.stopPropagation();
|
|
764
787
|
const h = a;
|
|
765
|
-
h.expanded = !h.expanded, "recalcVisibleTreeRows" in
|
|
788
|
+
h.expanded = !h.expanded, "recalcVisibleTreeRows" in n && n.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(h);
|
|
766
789
|
}
|
|
767
790
|
}
|
|
768
791
|
}
|
|
769
792
|
this.publishGeMouseEvent(e, 2);
|
|
770
793
|
}
|
|
794
|
+
/**
|
|
795
|
+
* Publishes a GeMouseEvent.
|
|
796
|
+
*
|
|
797
|
+
* @param {MouseEvent} event - The MouseEvent to publish.
|
|
798
|
+
* @param {number} clickCount - The number of clicks for the GeMouseEvent.
|
|
799
|
+
*
|
|
800
|
+
* @return {void}
|
|
801
|
+
*/
|
|
771
802
|
publishGeMouseEvent(e, t) {
|
|
772
803
|
var s;
|
|
773
804
|
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);
|
|
774
805
|
}
|
|
806
|
+
/**
|
|
807
|
+
* Update the collapsed/expanded state of a tree row.
|
|
808
|
+
*
|
|
809
|
+
* @param {TreeRowIf<any>} tr - The tree row object.
|
|
810
|
+
* @returns {void}
|
|
811
|
+
*/
|
|
775
812
|
updateCollapsedExpandedState(e) {
|
|
776
|
-
var s, i, o,
|
|
813
|
+
var s, i, o, r, n;
|
|
777
814
|
const t = (i = (s = this.tableScope.tableOptions) == null ? void 0 : s.autoRestoreOptions) == null ? void 0 : i.getRowId;
|
|
778
815
|
if (t) {
|
|
779
816
|
const a = (o = this.tableScope.storeStateCollapsedExpandService) == null ? void 0 : o.collapsedExpandedStateGet().mode, h = a === "collapsed" && !e.expanded || a === "expanded" && e.expanded, d = a === "collapsed" && e.expanded || a === "expanded" && !e.expanded, c = t(e.data);
|
|
780
|
-
h ? (
|
|
817
|
+
h ? (r = this.tableScope.storeStateCollapsedExpandService) == null || r.collapsedStateIdsPush(c) : d && ((n = this.tableScope.storeStateCollapsedExpandService) == null || n.collapsedStateIdsRemove(c));
|
|
781
818
|
}
|
|
782
819
|
}
|
|
783
820
|
getArrowColumnIndex() {
|
|
@@ -813,35 +850,107 @@ class _e {
|
|
|
813
850
|
}
|
|
814
851
|
}
|
|
815
852
|
}
|
|
816
|
-
class
|
|
853
|
+
class Ne {
|
|
817
854
|
constructor(e) {
|
|
818
855
|
this.tableScope = e;
|
|
819
856
|
}
|
|
820
|
-
|
|
821
|
-
|
|
857
|
+
/**
|
|
858
|
+
* Updates the cells in the table based on the provided events.
|
|
859
|
+
*
|
|
860
|
+
* @param {TableCellUpdateEventIf[]} events - The array of events representing the updates to perform on the cells.
|
|
861
|
+
* @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.
|
|
862
|
+
*
|
|
863
|
+
* @return {void} - This method doesn't return anything.
|
|
864
|
+
*/
|
|
865
|
+
updateCells(e, t = !1) {
|
|
866
|
+
this.tableScope.updateCells(e, t);
|
|
822
867
|
}
|
|
868
|
+
/**
|
|
869
|
+
* Notifies that the external filter has changed.
|
|
870
|
+
*
|
|
871
|
+
* @return {void}
|
|
872
|
+
*/
|
|
823
873
|
externalFilterChanged() {
|
|
824
874
|
this.tableScope.externalFilterChanged();
|
|
825
875
|
}
|
|
876
|
+
/**
|
|
877
|
+
* Scrolls the table body to the specified pixel coordinates.
|
|
878
|
+
*
|
|
879
|
+
* @param {number} _px - The horizontal pixel coordinate to scroll to. Defaults to 0.
|
|
880
|
+
* @param {number} _py - The vertical pixel coordinate to scroll to. Defaults to 0.
|
|
881
|
+
* @return {void}
|
|
882
|
+
*/
|
|
826
883
|
scrollToPixel(e = 0, t = 0) {
|
|
827
884
|
}
|
|
885
|
+
/**
|
|
886
|
+
* Scrolls to the specified index in both horizontal and vertical directions.
|
|
887
|
+
*
|
|
888
|
+
* @param {number} _indexX - The index of the column to scroll to in the horizontal direction. Default is 0.
|
|
889
|
+
* @param {number} _indexY - The index of the row to scroll to in the vertical direction. Default is 0.
|
|
890
|
+
*
|
|
891
|
+
* @return undefined
|
|
892
|
+
*/
|
|
828
893
|
scrollToIndex(e = 0, t = 0) {
|
|
829
894
|
}
|
|
895
|
+
/**
|
|
896
|
+
* Sets whether the header is visible or not.
|
|
897
|
+
*
|
|
898
|
+
* @param _visible - A boolean value indicating whether the header should be visible. Default value is true.
|
|
899
|
+
*
|
|
900
|
+
* @return undefined
|
|
901
|
+
*/
|
|
830
902
|
setHeaderVisible(e = !0) {
|
|
831
903
|
}
|
|
904
|
+
/**
|
|
905
|
+
* Sets the visibility of a column in the table.
|
|
906
|
+
*
|
|
907
|
+
* @param {_column} - The column index or column definition to set visibility for.
|
|
908
|
+
* @param {_visible=true} - The flag to set visibility to. true for visible, false for hidden.
|
|
909
|
+
*
|
|
910
|
+
* @return {void} - There is no return value.
|
|
911
|
+
*/
|
|
832
912
|
setColumnVisible(e, t = !0) {
|
|
833
913
|
}
|
|
914
|
+
/**
|
|
915
|
+
* Returns whether a column is visible or not.
|
|
916
|
+
*
|
|
917
|
+
* @param {number | ColumnDefIf} _column - The column index or the column definition.
|
|
918
|
+
* @return {boolean} - True if the column is visible, false otherwise.
|
|
919
|
+
*/
|
|
834
920
|
isColumnVisible(e) {
|
|
835
921
|
return !0;
|
|
836
922
|
}
|
|
923
|
+
/**
|
|
924
|
+
* Checks if the header is visible.
|
|
925
|
+
*
|
|
926
|
+
* @return {boolean} - Returns true if the header is visible, otherwise returns false.
|
|
927
|
+
*/
|
|
837
928
|
isHeaderVisible() {
|
|
838
929
|
return !0;
|
|
839
930
|
}
|
|
931
|
+
/**
|
|
932
|
+
* Sets the visibility of the footer.
|
|
933
|
+
*
|
|
934
|
+
* @param {boolean} _visible - Indicates whether the footer should be visible or not. Default value is true.
|
|
935
|
+
*
|
|
936
|
+
* @return {void} - This method does not return any value.
|
|
937
|
+
*/
|
|
840
938
|
setFooterVisible(e = !0) {
|
|
841
939
|
}
|
|
940
|
+
/**
|
|
941
|
+
* Determines if the footer is visible.
|
|
942
|
+
*
|
|
943
|
+
* @returns {boolean} True if the footer is visible, false otherwise.
|
|
944
|
+
*/
|
|
842
945
|
isFooterVisible() {
|
|
843
946
|
return !0;
|
|
844
947
|
}
|
|
948
|
+
/**
|
|
949
|
+
* Repaints the table.
|
|
950
|
+
*
|
|
951
|
+
* This method calls the repaint method of the tableScope object
|
|
952
|
+
* to update and redraw the table based on the latest data.
|
|
953
|
+
*/
|
|
845
954
|
repaint() {
|
|
846
955
|
this.tableScope.repaint();
|
|
847
956
|
}
|
|
@@ -857,9 +966,9 @@ class oe {
|
|
|
857
966
|
for (const i of [...s]) {
|
|
858
967
|
const [
|
|
859
968
|
o,
|
|
860
|
-
|
|
969
|
+
r
|
|
861
970
|
] = i;
|
|
862
|
-
t[o] =
|
|
971
|
+
t[o] = r;
|
|
863
972
|
}
|
|
864
973
|
}
|
|
865
974
|
return t;
|
|
@@ -871,8 +980,8 @@ class oe {
|
|
|
871
980
|
if (i) {
|
|
872
981
|
const o = i + e;
|
|
873
982
|
if ((t + "").includes("Map")) {
|
|
874
|
-
const
|
|
875
|
-
this.persistItem(o,
|
|
983
|
+
const r = this.autoConvertMapToObject(t);
|
|
984
|
+
this.persistItem(o, r);
|
|
876
985
|
} else
|
|
877
986
|
this.persistItem(o, t);
|
|
878
987
|
}
|
|
@@ -921,7 +1030,7 @@ class oe {
|
|
|
921
1030
|
// }
|
|
922
1031
|
// }
|
|
923
1032
|
}
|
|
924
|
-
class
|
|
1033
|
+
class je extends oe {
|
|
925
1034
|
constructor(e) {
|
|
926
1035
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
927
1036
|
}
|
|
@@ -943,14 +1052,14 @@ class Ne extends oe {
|
|
|
943
1052
|
}
|
|
944
1053
|
}
|
|
945
1054
|
}
|
|
946
|
-
class
|
|
1055
|
+
class Xe {
|
|
947
1056
|
constructor(e = "collapsed", t = [], s = !1, i = !1) {
|
|
948
1057
|
this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = i;
|
|
949
1058
|
}
|
|
950
1059
|
}
|
|
951
|
-
class
|
|
1060
|
+
class Ke extends oe {
|
|
952
1061
|
constructor(e) {
|
|
953
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
1062
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new Xe(), this.load();
|
|
954
1063
|
}
|
|
955
1064
|
collapsedExpandedStateGet() {
|
|
956
1065
|
return this.collapsedExpandedState;
|
|
@@ -982,7 +1091,7 @@ class ze extends oe {
|
|
|
982
1091
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
983
1092
|
}
|
|
984
1093
|
}
|
|
985
|
-
class
|
|
1094
|
+
class ze extends oe {
|
|
986
1095
|
constructor(e) {
|
|
987
1096
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
988
1097
|
}
|
|
@@ -1009,7 +1118,7 @@ class O {
|
|
|
1009
1118
|
this.left = e, this.width = t, this.height = s, this.top = i, this.index = o;
|
|
1010
1119
|
}
|
|
1011
1120
|
}
|
|
1012
|
-
class
|
|
1121
|
+
class Ye {
|
|
1013
1122
|
constructor(e, t, s, i) {
|
|
1014
1123
|
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();
|
|
1015
1124
|
const o = this.hostElement;
|
|
@@ -1160,12 +1269,21 @@ class Ke {
|
|
|
1160
1269
|
this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", t);
|
|
1161
1270
|
}
|
|
1162
1271
|
}
|
|
1163
|
-
class
|
|
1272
|
+
class D {
|
|
1273
|
+
/**
|
|
1274
|
+
* Represents a constructor for a class.
|
|
1275
|
+
* @constructor
|
|
1276
|
+
* @param {number} r1 - The value for r1.
|
|
1277
|
+
* @param {number} c1 - The value for c1.
|
|
1278
|
+
* @param {number} r2 - The value for r2.
|
|
1279
|
+
* @param {number} c2 - The value for c2.
|
|
1280
|
+
* @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
|
|
1281
|
+
*/
|
|
1164
1282
|
constructor(e, t, s, i, o = !1) {
|
|
1165
1283
|
this.r1 = e, this.c1 = t, this.r2 = s, this.c2 = i, this.gammaRange = o;
|
|
1166
1284
|
}
|
|
1167
1285
|
static create(e) {
|
|
1168
|
-
return e.gammaRange === void 0 && (e.gammaRange = !1), new
|
|
1286
|
+
return e.gammaRange === void 0 && (e.gammaRange = !1), new D(
|
|
1169
1287
|
e.rowIndex1,
|
|
1170
1288
|
e.columnIndex1,
|
|
1171
1289
|
e.rowIndex2,
|
|
@@ -1174,19 +1292,19 @@ class T {
|
|
|
1174
1292
|
);
|
|
1175
1293
|
}
|
|
1176
1294
|
static singleCell(e, t) {
|
|
1177
|
-
return new
|
|
1295
|
+
return new D(e, t, e, t);
|
|
1178
1296
|
}
|
|
1179
1297
|
static singleRow(e) {
|
|
1180
|
-
return new
|
|
1298
|
+
return new D(e, 0, e, Number.MAX_SAFE_INTEGER);
|
|
1181
1299
|
}
|
|
1182
1300
|
static singleColumn(e) {
|
|
1183
|
-
return new
|
|
1301
|
+
return new D(0, e, Number.MAX_SAFE_INTEGER, e);
|
|
1184
1302
|
}
|
|
1185
1303
|
isInRange(e, t) {
|
|
1186
1304
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
1187
1305
|
}
|
|
1188
1306
|
}
|
|
1189
|
-
class
|
|
1307
|
+
class Ue {
|
|
1190
1308
|
constructor(e, t) {
|
|
1191
1309
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
1192
1310
|
}
|
|
@@ -1197,12 +1315,12 @@ class Ye {
|
|
|
1197
1315
|
const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
|
|
1198
1316
|
for (let s = 0; s < e; s++)
|
|
1199
1317
|
for (let i = 0; i < t; i++) {
|
|
1200
|
-
let o = this.areaModel.getColspanAt(s, i),
|
|
1201
|
-
if (o > 1 ||
|
|
1202
|
-
o === 0 && (o = 1),
|
|
1203
|
-
const
|
|
1318
|
+
let o = this.areaModel.getColspanAt(s, i), r = this.areaModel.getRowspanAt(s, i);
|
|
1319
|
+
if (o > 1 || r > 1) {
|
|
1320
|
+
o === 0 && (o = 1), r === 0 && (r = 1);
|
|
1321
|
+
const n = this.areaModel.hasOwnProperty("gammaCells");
|
|
1204
1322
|
this.colAndRowspanRanges.push(
|
|
1205
|
-
new
|
|
1323
|
+
new D(s, i, s + r - 1, i + o - 1, n)
|
|
1206
1324
|
);
|
|
1207
1325
|
}
|
|
1208
1326
|
}
|
|
@@ -1219,22 +1337,22 @@ class Ye {
|
|
|
1219
1337
|
return !1;
|
|
1220
1338
|
}
|
|
1221
1339
|
}
|
|
1222
|
-
class
|
|
1340
|
+
class qe {
|
|
1223
1341
|
constructor(e, t, s) {
|
|
1224
1342
|
this.header = e, this.body = t, this.footer = s;
|
|
1225
1343
|
}
|
|
1226
1344
|
}
|
|
1227
|
-
class
|
|
1345
|
+
class Je extends Ye {
|
|
1228
1346
|
constructor(e, t, s, i) {
|
|
1229
|
-
var
|
|
1347
|
+
var r, n;
|
|
1230
1348
|
super(e, t, s, i), this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
1231
1349
|
header: [],
|
|
1232
1350
|
body: [],
|
|
1233
1351
|
footer: []
|
|
1234
|
-
}, this.tree = !1, this.colAndRowspanModels = new
|
|
1352
|
+
}, this.tree = !1, this.colAndRowspanModels = new qe(), 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), ee(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
1235
1353
|
(a) => {
|
|
1236
1354
|
var h;
|
|
1237
|
-
this.colAndRowspanModels[a] = new
|
|
1355
|
+
this.colAndRowspanModels[a] = new Ue(t, t.getAreaModel(a)), (h = this.colAndRowspanModels[a]) == null || h.init();
|
|
1238
1356
|
}
|
|
1239
1357
|
);
|
|
1240
1358
|
}
|
|
@@ -1290,10 +1408,12 @@ class qe extends Ke {
|
|
|
1290
1408
|
var e, t;
|
|
1291
1409
|
this.storeScrollPosStateService && ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreScrollPosition) && this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
|
|
1292
1410
|
}
|
|
1293
|
-
updateCells(e) {
|
|
1411
|
+
updateCells(e, t = !1) {
|
|
1294
1412
|
e.forEach(
|
|
1295
|
-
(
|
|
1296
|
-
|
|
1413
|
+
(s) => {
|
|
1414
|
+
this.tableModel.getAreaModel(s.area).setValue(s.rowIndex, s.columnIndex, s.value), t || this.rerenderCellContent(s);
|
|
1415
|
+
}
|
|
1416
|
+
), t && this.repaint();
|
|
1297
1417
|
}
|
|
1298
1418
|
getAreaAndSideIdentByAttr(e) {
|
|
1299
1419
|
if (e) {
|
|
@@ -1351,87 +1471,87 @@ class qe extends Ke {
|
|
|
1351
1471
|
return "";
|
|
1352
1472
|
}
|
|
1353
1473
|
adjustArea(e, t = 0) {
|
|
1354
|
-
var
|
|
1355
|
-
const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"),
|
|
1474
|
+
var S;
|
|
1475
|
+
const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"), r = i.child.clientHeight;
|
|
1356
1476
|
s.child.innerText = "", i.child.innerText = "", o.child.innerText = "";
|
|
1357
|
-
const
|
|
1477
|
+
const n = 0, a = this.areaBodyCenterGeo.width, h = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), c = d.getRowCount();
|
|
1358
1478
|
for (; this.cleanupFunctions[e].length; ) {
|
|
1359
|
-
const
|
|
1360
|
-
|
|
1479
|
+
const f = this.cleanupFunctions[e].shift();
|
|
1480
|
+
f && f();
|
|
1361
1481
|
}
|
|
1362
1482
|
let p = t;
|
|
1363
|
-
const g = this.tableModel.getColumnCount(), u = this.tableModel.getFixedRightColumnCount(),
|
|
1364
|
-
for (let
|
|
1365
|
-
const
|
|
1366
|
-
if (
|
|
1367
|
-
this.firstVisibleRowIndex =
|
|
1368
|
-
let
|
|
1369
|
-
const
|
|
1483
|
+
const g = this.tableModel.getColumnCount(), u = this.tableModel.getFixedRightColumnCount(), m = this.tableModel.getFixedLeftColumnCount();
|
|
1484
|
+
for (let f = 0; f < c; f++) {
|
|
1485
|
+
const M = p, C = f === c - 1, E = this.tableModel.getRowHeight(e, f);
|
|
1486
|
+
if (M + E > 0) {
|
|
1487
|
+
this.firstVisibleRowIndex = f;
|
|
1488
|
+
let v = { left: n, width: a, height: E, top: M, index: f }, w = this.dom.addRowDiv(i, v, f, e, "center");
|
|
1489
|
+
const R = m;
|
|
1370
1490
|
if (this.adjustColumnsToRowParent({
|
|
1371
1491
|
areaIdent: e,
|
|
1372
1492
|
sideIdent: "center",
|
|
1373
1493
|
areaModel: d,
|
|
1374
|
-
geo:
|
|
1375
|
-
parent:
|
|
1376
|
-
rowIndex:
|
|
1377
|
-
columnIndexStart:
|
|
1494
|
+
geo: v,
|
|
1495
|
+
parent: w,
|
|
1496
|
+
rowIndex: f,
|
|
1497
|
+
columnIndexStart: R,
|
|
1378
1498
|
columnIndexEnd: g - u - 1,
|
|
1379
1499
|
verticalFixed: !1,
|
|
1380
1500
|
lastRowOfModel: C
|
|
1381
|
-
}), h.left > 0 && (
|
|
1501
|
+
}), 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({
|
|
1382
1502
|
areaIdent: e,
|
|
1383
1503
|
sideIdent: "west",
|
|
1384
1504
|
areaModel: d,
|
|
1385
|
-
geo:
|
|
1386
|
-
parent:
|
|
1387
|
-
rowIndex:
|
|
1505
|
+
geo: v,
|
|
1506
|
+
parent: w,
|
|
1507
|
+
rowIndex: f,
|
|
1388
1508
|
columnIndexStart: 0,
|
|
1389
|
-
columnIndexEnd:
|
|
1509
|
+
columnIndexEnd: R - 1,
|
|
1390
1510
|
verticalFixed: !0,
|
|
1391
1511
|
lastRowOfModel: C
|
|
1392
|
-
})), h.right > 0 && (
|
|
1512
|
+
})), 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({
|
|
1393
1513
|
areaIdent: e,
|
|
1394
1514
|
sideIdent: "east",
|
|
1395
1515
|
areaModel: d,
|
|
1396
|
-
geo:
|
|
1397
|
-
parent:
|
|
1398
|
-
rowIndex:
|
|
1516
|
+
geo: v,
|
|
1517
|
+
parent: w,
|
|
1518
|
+
rowIndex: f,
|
|
1399
1519
|
columnIndexStart: g - u,
|
|
1400
1520
|
columnIndexEnd: g - 1,
|
|
1401
1521
|
verticalFixed: !0,
|
|
1402
1522
|
lastRowOfModel: C
|
|
1403
|
-
})), e === "header" && this.tree &&
|
|
1404
|
-
const
|
|
1523
|
+
})), e === "header" && this.tree && f === c - 1) {
|
|
1524
|
+
const T = this.dom.applyStyle(
|
|
1405
1525
|
this.dom.setAttribute(
|
|
1406
|
-
this.dom.addDiv(
|
|
1526
|
+
this.dom.addDiv(w, new O(16, 20, 20, 8)),
|
|
1407
1527
|
"data-ge-action",
|
|
1408
1528
|
"toggleExpandCollapseAll"
|
|
1409
1529
|
),
|
|
1410
1530
|
{ cursor: "pointer" }
|
|
1411
|
-
),
|
|
1412
|
-
if (
|
|
1413
|
-
const V = this.dom.domService.createText(
|
|
1414
|
-
this.dom.domService.appendChild(
|
|
1531
|
+
), I = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1532
|
+
if (I) {
|
|
1533
|
+
const V = this.dom.domService.createText(I.content);
|
|
1534
|
+
this.dom.domService.appendChild(T, V), I.style && this.dom.applyStyleString(T, I.style);
|
|
1415
1535
|
}
|
|
1416
1536
|
}
|
|
1417
1537
|
}
|
|
1418
|
-
if (p = p +
|
|
1538
|
+
if (p = p + E, p > r)
|
|
1419
1539
|
break;
|
|
1420
1540
|
}
|
|
1421
1541
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1422
|
-
const
|
|
1423
|
-
if (
|
|
1424
|
-
for (const
|
|
1425
|
-
let C = 0,
|
|
1426
|
-
if (
|
|
1427
|
-
|
|
1428
|
-
else if (u > 0 &&
|
|
1429
|
-
|
|
1542
|
+
const f = ((S = this.colAndRowspanModels[e]) == null ? void 0 : S.getRanges()) ?? [];
|
|
1543
|
+
if (f.length)
|
|
1544
|
+
for (const M of f) {
|
|
1545
|
+
let C = 0, E = i.child, v = "center";
|
|
1546
|
+
if (M.c1 < m)
|
|
1547
|
+
E = s.child, v = "west";
|
|
1548
|
+
else if (u > 0 && M.c1 >= g - u)
|
|
1549
|
+
E = o.child, v = "east";
|
|
1430
1550
|
else {
|
|
1431
|
-
const
|
|
1432
|
-
C = this.scrollFactorX *
|
|
1551
|
+
const w = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1552
|
+
C = this.scrollFactorX * w - this.areaBodyWestGeo.width, v = "center";
|
|
1433
1553
|
}
|
|
1434
|
-
this.drawBigCell(
|
|
1554
|
+
this.drawBigCell(M, C, t, d, E, v);
|
|
1435
1555
|
}
|
|
1436
1556
|
}
|
|
1437
1557
|
}
|
|
@@ -1445,21 +1565,21 @@ class qe extends Ke {
|
|
|
1445
1565
|
* @param sideIdent SideIdent (west,center,east)
|
|
1446
1566
|
* @protected
|
|
1447
1567
|
*/
|
|
1448
|
-
drawBigCell(e, t, s, i, o,
|
|
1449
|
-
const
|
|
1568
|
+
drawBigCell(e, t, s, i, o, r) {
|
|
1569
|
+
const n = s + this.getRowHeights(0, e.r1 - 1, i).reduce((S, f) => S + f, 0), a = this.tableModel.getColumnCount(), h = this.tableModel.getFixedRightColumnCount();
|
|
1450
1570
|
let d = 0;
|
|
1451
1571
|
h > 0 && e.c1 >= a - h && (d = a - h);
|
|
1452
|
-
const c = t + this.getColumnWidths(d, e.c1 - 1).reduce((
|
|
1572
|
+
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);
|
|
1453
1573
|
let u = !1;
|
|
1454
|
-
const
|
|
1455
|
-
|
|
1574
|
+
const m = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
1575
|
+
m && (u = m.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? (console.info("TODO here", e), this.renderCell({
|
|
1456
1576
|
areaModel: i,
|
|
1457
1577
|
areaIdent: i.areaIdent,
|
|
1458
|
-
sideIdent:
|
|
1578
|
+
sideIdent: r,
|
|
1459
1579
|
rowIndex: e.r1,
|
|
1460
1580
|
columnIndex: e.c1,
|
|
1461
1581
|
left: c,
|
|
1462
|
-
top:
|
|
1582
|
+
top: n,
|
|
1463
1583
|
width: g,
|
|
1464
1584
|
height: p,
|
|
1465
1585
|
parent: o,
|
|
@@ -1469,11 +1589,11 @@ class qe extends Ke {
|
|
|
1469
1589
|
})) : this.renderCell({
|
|
1470
1590
|
areaModel: i,
|
|
1471
1591
|
areaIdent: i.areaIdent,
|
|
1472
|
-
sideIdent:
|
|
1592
|
+
sideIdent: r,
|
|
1473
1593
|
rowIndex: e.r1,
|
|
1474
1594
|
columnIndex: e.c1,
|
|
1475
1595
|
left: c,
|
|
1476
|
-
top:
|
|
1596
|
+
top: n,
|
|
1477
1597
|
width: g,
|
|
1478
1598
|
height: p,
|
|
1479
1599
|
parent: o,
|
|
@@ -1484,7 +1604,7 @@ class qe extends Ke {
|
|
|
1484
1604
|
rowIndex: e.r1,
|
|
1485
1605
|
columnIndex: e.c1,
|
|
1486
1606
|
cellLeft: c,
|
|
1487
|
-
cellTop:
|
|
1607
|
+
cellTop: n,
|
|
1488
1608
|
cellWidth: g,
|
|
1489
1609
|
cellHeight: p,
|
|
1490
1610
|
parent: o
|
|
@@ -1493,8 +1613,8 @@ class qe extends Ke {
|
|
|
1493
1613
|
findRowOfImportantRowspanCell(e, t, s) {
|
|
1494
1614
|
const i = e.getMaxRowspan();
|
|
1495
1615
|
for (let o = t - 1; o > -1; o--) {
|
|
1496
|
-
const
|
|
1497
|
-
if (
|
|
1616
|
+
const r = e.getRowspanAt(o, s);
|
|
1617
|
+
if (r > 1 && o + r + 1 >= t)
|
|
1498
1618
|
return o;
|
|
1499
1619
|
if (t - o > i)
|
|
1500
1620
|
return -1;
|
|
@@ -1507,62 +1627,62 @@ class qe extends Ke {
|
|
|
1507
1627
|
areaModel: s,
|
|
1508
1628
|
geo: i,
|
|
1509
1629
|
parent: o,
|
|
1510
|
-
rowIndex:
|
|
1511
|
-
columnIndexStart:
|
|
1630
|
+
rowIndex: r,
|
|
1631
|
+
columnIndexStart: n,
|
|
1512
1632
|
columnIndexEnd: a,
|
|
1513
1633
|
verticalFixed: h = !1,
|
|
1514
1634
|
lastRowOfModel: d = !1
|
|
1515
1635
|
}) {
|
|
1516
|
-
var
|
|
1636
|
+
var m;
|
|
1517
1637
|
this.scrollViewportLeft = this.scrollViewport.scrollLeft;
|
|
1518
1638
|
let c = 0;
|
|
1519
1639
|
if (!h) {
|
|
1520
|
-
const
|
|
1521
|
-
c = this.scrollFactorX *
|
|
1640
|
+
const S = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1641
|
+
c = this.scrollFactorX * S;
|
|
1522
1642
|
}
|
|
1523
1643
|
const p = 0, g = !!(e === "body" && t);
|
|
1524
1644
|
let u = c;
|
|
1525
|
-
for (let
|
|
1526
|
-
const
|
|
1527
|
-
if (
|
|
1645
|
+
for (let S = n; S <= a; S++) {
|
|
1646
|
+
const f = u, M = this.tableModel.getColumnWidth(S);
|
|
1647
|
+
if (M > 0 && f + M > 0) {
|
|
1528
1648
|
let C = i.height;
|
|
1529
|
-
const
|
|
1530
|
-
|
|
1531
|
-
let
|
|
1532
|
-
|
|
1533
|
-
let
|
|
1534
|
-
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (
|
|
1535
|
-
this.renderDragTargetDiv(o,
|
|
1536
|
-
const
|
|
1537
|
-
this.dom.addColumnBorderDivs(this.tableOptions, o,
|
|
1649
|
+
const E = s.getRowspanAt(r, S), v = s.getColspanAt(r, S);
|
|
1650
|
+
E > 1 && (C = this.getRowHeights(r, r + E - 1, s).reduce((T, I) => T + I, 0));
|
|
1651
|
+
let w = M;
|
|
1652
|
+
v > 1 && (w = this.getColumnWidths(S, S + v - 1).reduce((T, I) => T + I, 0));
|
|
1653
|
+
let R = !1;
|
|
1654
|
+
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (m = this.colAndRowspanModels[e]) != null && m.isInRange(r, S) && (R = !0), this.draggingTargetColumnIndex === S && e !== "header") {
|
|
1655
|
+
this.renderDragTargetDiv(o, f, p, w, C);
|
|
1656
|
+
const T = { left: f, top: p, width: w, height: C };
|
|
1657
|
+
this.dom.addColumnBorderDivs(this.tableOptions, o, T, e, t);
|
|
1538
1658
|
} else {
|
|
1539
|
-
const
|
|
1540
|
-
|
|
1659
|
+
const T = this.renderSelectedBackgroundDiv(R, g, t, s, r, S, o, f, p, w, C);
|
|
1660
|
+
R || this.renderCell({
|
|
1541
1661
|
areaModel: s,
|
|
1542
1662
|
areaIdent: e,
|
|
1543
1663
|
sideIdent: t,
|
|
1544
|
-
rowIndex:
|
|
1545
|
-
columnIndex:
|
|
1546
|
-
left:
|
|
1664
|
+
rowIndex: r,
|
|
1665
|
+
columnIndex: S,
|
|
1666
|
+
left: f,
|
|
1547
1667
|
top: p,
|
|
1548
|
-
width:
|
|
1668
|
+
width: w,
|
|
1549
1669
|
height: C,
|
|
1550
1670
|
parent: o,
|
|
1551
|
-
cellSelected:
|
|
1671
|
+
cellSelected: T,
|
|
1552
1672
|
lastRowOfModel: d,
|
|
1553
1673
|
gammaRange: !0
|
|
1554
1674
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1555
|
-
rowIndex:
|
|
1556
|
-
columnIndex:
|
|
1557
|
-
cellLeft:
|
|
1675
|
+
rowIndex: r,
|
|
1676
|
+
columnIndex: S,
|
|
1677
|
+
cellLeft: f,
|
|
1558
1678
|
cellTop: p,
|
|
1559
|
-
cellWidth:
|
|
1679
|
+
cellWidth: w,
|
|
1560
1680
|
cellHeight: C,
|
|
1561
1681
|
parent: o
|
|
1562
1682
|
});
|
|
1563
1683
|
}
|
|
1564
1684
|
}
|
|
1565
|
-
if (u = u +
|
|
1685
|
+
if (u = u + M, u > this.areaBodyCenterGeo.width)
|
|
1566
1686
|
break;
|
|
1567
1687
|
}
|
|
1568
1688
|
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new O(u - 1, 1, i.height, 0), o);
|
|
@@ -1576,54 +1696,79 @@ class qe extends Ke {
|
|
|
1576
1696
|
sideIdent: s,
|
|
1577
1697
|
rowIndex: i,
|
|
1578
1698
|
index: o,
|
|
1579
|
-
left:
|
|
1580
|
-
width:
|
|
1699
|
+
left: r,
|
|
1700
|
+
width: n,
|
|
1581
1701
|
height: a,
|
|
1582
1702
|
top: h,
|
|
1583
1703
|
parent: d,
|
|
1584
|
-
lastRowOfModel: c
|
|
1704
|
+
lastRowOfModel: c,
|
|
1705
|
+
gammaRange: p
|
|
1585
1706
|
}) {
|
|
1586
|
-
var
|
|
1587
|
-
const
|
|
1707
|
+
var ae;
|
|
1708
|
+
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);
|
|
1588
1709
|
let f = "none";
|
|
1589
|
-
if (o === this.getTreeArrowColumnIndex() && Z(
|
|
1590
|
-
const
|
|
1591
|
-
(
|
|
1710
|
+
if (o === this.getTreeArrowColumnIndex() && Z(S)) {
|
|
1711
|
+
const y = S;
|
|
1712
|
+
(ae = y.children) != null && ae.length ? y.expanded ? f = "expanded" : f = "collapsed" : f = "hidden";
|
|
1592
1713
|
}
|
|
1593
|
-
let
|
|
1714
|
+
let C;
|
|
1594
1715
|
if (t === "header") {
|
|
1595
|
-
const
|
|
1596
|
-
(!(
|
|
1716
|
+
const y = this.tableModel.getColumnDef(o);
|
|
1717
|
+
(!(y != null && y.sortIconVisible) || y != null && y.sortIconVisible()) && (C = y == null ? void 0 : y.sortState);
|
|
1597
1718
|
}
|
|
1598
|
-
const
|
|
1719
|
+
const E = e.getValueAt(i, o), v = u ? "" : `${E}`, w = e.isRowChecked(i), R = this.dom.addColumnDiv(
|
|
1599
1720
|
d,
|
|
1600
|
-
|
|
1721
|
+
m,
|
|
1601
1722
|
i,
|
|
1602
1723
|
o,
|
|
1603
1724
|
t,
|
|
1604
1725
|
s,
|
|
1605
|
-
|
|
1726
|
+
v,
|
|
1606
1727
|
f,
|
|
1607
1728
|
this.tableOptions,
|
|
1608
1729
|
w,
|
|
1609
|
-
|
|
1610
|
-
),
|
|
1611
|
-
|
|
1612
|
-
const
|
|
1613
|
-
|
|
1614
|
-
let
|
|
1615
|
-
|
|
1616
|
-
const
|
|
1617
|
-
if (
|
|
1618
|
-
const
|
|
1619
|
-
|
|
1730
|
+
C
|
|
1731
|
+
), T = e.getTooltipAt(i, o);
|
|
1732
|
+
T && this.dom.setAttribute(R, "title", T);
|
|
1733
|
+
const I = this.tableModel.getColumnDef(o);
|
|
1734
|
+
I && I.classes[t] && this.dom.addClasses(I.classes[t], R);
|
|
1735
|
+
let V;
|
|
1736
|
+
u && (V = u.render(R, i, o, t, e, E, this.dom.domService));
|
|
1737
|
+
const ne = e.getCustomClassesAt(i, o);
|
|
1738
|
+
if (ne.length && this.dom.addClasses(ne, 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") {
|
|
1739
|
+
const y = this.getFocusModel();
|
|
1740
|
+
y != null && y.hasFocus(i, o) && this.dom.addFocusBorderDivs(d, m, {});
|
|
1741
|
+
}
|
|
1742
|
+
t === "header" && this.dom.setAttribute(R, "data-ge-action", "drag-column");
|
|
1743
|
+
const z = e.getCustomStyleAt(i, o);
|
|
1744
|
+
if (z)
|
|
1745
|
+
for (const y in z)
|
|
1746
|
+
this.dom.setStyle(R, y, z[y]);
|
|
1747
|
+
return [R, V];
|
|
1748
|
+
}
|
|
1749
|
+
applyCssClasses(e, t = {}) {
|
|
1750
|
+
e && Object.entries(t).forEach(([s, i]) => {
|
|
1751
|
+
i ? this.dom.addClass(s, e) : this.dom.removeClass(s, e);
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1754
|
+
rerenderCellContent({ area: e, rowIndex: t, columnIndex: s, value: i, cssClasses: o }) {
|
|
1755
|
+
const r = this.tableModel.getAreaModel(e), n = 'div[data-col-index="' + s + '"][data-row-index="' + t + '"][data-area="' + e + '"]', a = document.querySelector(n);
|
|
1756
|
+
if (a) {
|
|
1757
|
+
let h;
|
|
1758
|
+
const c = this.editorRenderer && this.editorRendererRow === t && this.editorRendererColumn === s ? this.editorRenderer : r.getCellRenderer(t, s);
|
|
1759
|
+
if (a.innerText = "", this.applyCssClasses(a, o), c)
|
|
1760
|
+
h = c.render(a, t, s, e, r, i, this.dom.domService), h && this.cleanupFunctions[e].push(h);
|
|
1761
|
+
else {
|
|
1762
|
+
const u = `${i}`;
|
|
1763
|
+
this.dom.addLabelDiv(a, u, !1, t, s, e);
|
|
1764
|
+
}
|
|
1765
|
+
const p = r.getCustomClassesAt(t, s);
|
|
1766
|
+
p.length && this.dom.addClasses(p, a);
|
|
1767
|
+
const g = r.getCustomStyleAt(t, s);
|
|
1768
|
+
if (g)
|
|
1769
|
+
for (const u in g)
|
|
1770
|
+
this.dom.setStyle(a, u, g[u]);
|
|
1620
1771
|
}
|
|
1621
|
-
t === "header" && this.dom.setAttribute(m, "data-ge-action", "drag-column");
|
|
1622
|
-
const K = e.getCustomStyleAt(i, o);
|
|
1623
|
-
if (K)
|
|
1624
|
-
for (const v in K)
|
|
1625
|
-
this.dom.setStyle(m, v, K[v]);
|
|
1626
|
-
return [m, D];
|
|
1627
1772
|
}
|
|
1628
1773
|
getColumnWidths(e, t) {
|
|
1629
1774
|
const s = [];
|
|
@@ -1677,24 +1822,24 @@ class qe extends Ke {
|
|
|
1677
1822
|
this.debounceTimeout && clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(e.bind(this), t);
|
|
1678
1823
|
}
|
|
1679
1824
|
renderDragTargetDiv(e, t, s, i, o) {
|
|
1680
|
-
const
|
|
1825
|
+
const r = this.dom.applyStylePosistionAbsolute(
|
|
1681
1826
|
this.dom.createDivWithClass("ge-table-drop-zone", e)
|
|
1682
1827
|
);
|
|
1683
|
-
return this.dom.setStyle(
|
|
1828
|
+
return this.dom.setStyle(r, "left", `${t}px`), this.dom.setStyle(r, "top", `${s}px`), this.dom.setStyle(r, "width", `${i}px`), this.dom.setStyle(r, "height", `${o}px`), r;
|
|
1684
1829
|
}
|
|
1685
|
-
renderSelectedBackgroundDiv(e, t, s, i, o,
|
|
1830
|
+
renderSelectedBackgroundDiv(e, t, s, i, o, r, n, a, h, d, c) {
|
|
1686
1831
|
let p = !1;
|
|
1687
|
-
if (!e && t && i.isSelectable(o,
|
|
1832
|
+
if (!e && t && i.isSelectable(o, r) && this.getSelectionModel) {
|
|
1688
1833
|
const g = this.getSelectionModel();
|
|
1689
1834
|
if (g) {
|
|
1690
|
-
const u = g.getSelectionCount(o,
|
|
1835
|
+
const u = g.getSelectionCount(o, r);
|
|
1691
1836
|
p = u > 0;
|
|
1692
|
-
for (let
|
|
1693
|
-
const
|
|
1837
|
+
for (let m = 0; m < u; m++) {
|
|
1838
|
+
const S = this.dom.applyStylePosistionAbsolute(
|
|
1694
1839
|
// ge-table-body-west-selected-range
|
|
1695
|
-
this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`,
|
|
1840
|
+
this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`, n)
|
|
1696
1841
|
);
|
|
1697
|
-
this.dom.setStyle(
|
|
1842
|
+
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`);
|
|
1698
1843
|
}
|
|
1699
1844
|
}
|
|
1700
1845
|
}
|
|
@@ -1706,8 +1851,8 @@ class qe extends Ke {
|
|
|
1706
1851
|
sideIdent: s,
|
|
1707
1852
|
rowIndex: i,
|
|
1708
1853
|
columnIndex: o,
|
|
1709
|
-
left:
|
|
1710
|
-
top:
|
|
1854
|
+
left: r,
|
|
1855
|
+
top: n,
|
|
1711
1856
|
width: a,
|
|
1712
1857
|
height: h,
|
|
1713
1858
|
parent: d,
|
|
@@ -1715,47 +1860,55 @@ class qe extends Ke {
|
|
|
1715
1860
|
lastRowOfModel: p,
|
|
1716
1861
|
gammaRange: g
|
|
1717
1862
|
}) {
|
|
1718
|
-
const [u,
|
|
1863
|
+
const [u, m] = this.addAndRenderCellDiv({
|
|
1719
1864
|
areaModel: e,
|
|
1720
1865
|
areaIdent: t,
|
|
1721
1866
|
sideIdent: s,
|
|
1722
1867
|
rowIndex: i,
|
|
1723
1868
|
index: o,
|
|
1724
|
-
left:
|
|
1869
|
+
left: r,
|
|
1725
1870
|
width: a,
|
|
1726
1871
|
height: h,
|
|
1727
|
-
top:
|
|
1872
|
+
top: n,
|
|
1728
1873
|
parent: d,
|
|
1729
1874
|
lastRowOfModel: p,
|
|
1730
1875
|
gammaRange: g
|
|
1731
1876
|
});
|
|
1732
|
-
c && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, u),
|
|
1877
|
+
c && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, u), m && this.cleanupFunctions[t].push(m);
|
|
1733
1878
|
}
|
|
1734
|
-
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight:
|
|
1879
|
+
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight: r, parent: n }) {
|
|
1735
1880
|
const a = this.dom.domService, h = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = a.createElement("div");
|
|
1736
|
-
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", `${
|
|
1881
|
+
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);
|
|
1737
1882
|
}
|
|
1738
1883
|
}
|
|
1739
|
-
class
|
|
1884
|
+
class Qe {
|
|
1740
1885
|
constructor(e, t) {
|
|
1741
1886
|
this.columnIndex = e, this.sortState = t;
|
|
1742
1887
|
}
|
|
1743
1888
|
}
|
|
1744
|
-
class
|
|
1889
|
+
class Ze {
|
|
1745
1890
|
constructor(e) {
|
|
1746
1891
|
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
1747
1892
|
}
|
|
1893
|
+
/**
|
|
1894
|
+
* Handles the onHostElementChanged event.
|
|
1895
|
+
* In case that the element is an input field, the tableScope.updateModelValueAfterEdit() method is triggered.
|
|
1896
|
+
*
|
|
1897
|
+
* @param {Event} event - The event object.
|
|
1898
|
+
*
|
|
1899
|
+
* @return {void}
|
|
1900
|
+
*/
|
|
1748
1901
|
onHostElementChanged(e) {
|
|
1749
1902
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1750
1903
|
const t = e.target, s = t.getAttribute("data-area"), i = t.getAttribute("data-row-index"), o = t.getAttribute("data-col-index");
|
|
1751
1904
|
if (s && i && o) {
|
|
1752
|
-
const
|
|
1753
|
-
this.tableScope.updateModelValueAfterEdit(
|
|
1905
|
+
const r = ie(s), n = Number(i), a = Number(o);
|
|
1906
|
+
this.tableScope.updateModelValueAfterEdit(r, n, a, t.value);
|
|
1754
1907
|
}
|
|
1755
1908
|
}
|
|
1756
1909
|
}
|
|
1757
1910
|
}
|
|
1758
|
-
class
|
|
1911
|
+
class et {
|
|
1759
1912
|
constructor(e = -1, t = -1) {
|
|
1760
1913
|
this.rowIndex = e, this.columnIndex = t;
|
|
1761
1914
|
}
|
|
@@ -1765,20 +1918,20 @@ class le {
|
|
|
1765
1918
|
this.cells = e;
|
|
1766
1919
|
}
|
|
1767
1920
|
static createSingle(e, t) {
|
|
1768
|
-
return new le([new
|
|
1921
|
+
return new le([new et(e, t)]);
|
|
1769
1922
|
}
|
|
1770
1923
|
}
|
|
1771
|
-
class
|
|
1924
|
+
class tt {
|
|
1772
1925
|
constructor(e) {
|
|
1773
1926
|
var t, s;
|
|
1774
1927
|
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);
|
|
1775
1928
|
}
|
|
1776
1929
|
onMouseClicked(e, t) {
|
|
1777
|
-
var o,
|
|
1930
|
+
var o, r, n, a, h, d, c;
|
|
1778
1931
|
let s = !1, i = !1;
|
|
1779
1932
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1780
1933
|
const p = this.getSelectionModel(), g = this.getFocusModel();
|
|
1781
|
-
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), (
|
|
1934
|
+
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));
|
|
1782
1935
|
}
|
|
1783
1936
|
return i ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
1784
1937
|
}
|
|
@@ -1800,16 +1953,16 @@ class et {
|
|
|
1800
1953
|
}
|
|
1801
1954
|
createRangeByEvents(e, t) {
|
|
1802
1955
|
t || (t = e);
|
|
1803
|
-
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),
|
|
1804
|
-
return
|
|
1956
|
+
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);
|
|
1957
|
+
return D.create({
|
|
1805
1958
|
rowIndex1: s,
|
|
1806
1959
|
columnIndex1: o,
|
|
1807
1960
|
rowIndex2: i,
|
|
1808
|
-
columnIndex2:
|
|
1961
|
+
columnIndex2: r
|
|
1809
1962
|
});
|
|
1810
1963
|
}
|
|
1811
1964
|
}
|
|
1812
|
-
class
|
|
1965
|
+
class st {
|
|
1813
1966
|
get() {
|
|
1814
1967
|
return {
|
|
1815
1968
|
f2: "START_EDITING",
|
|
@@ -1827,7 +1980,7 @@ class tt {
|
|
|
1827
1980
|
};
|
|
1828
1981
|
}
|
|
1829
1982
|
}
|
|
1830
|
-
class
|
|
1983
|
+
class it {
|
|
1831
1984
|
get() {
|
|
1832
1985
|
return {
|
|
1833
1986
|
f2: "START_EDITING",
|
|
@@ -1847,7 +2000,7 @@ class st {
|
|
|
1847
2000
|
};
|
|
1848
2001
|
}
|
|
1849
2002
|
}
|
|
1850
|
-
class
|
|
2003
|
+
class ot {
|
|
1851
2004
|
constructor(e) {
|
|
1852
2005
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
1853
2006
|
}
|
|
@@ -1855,7 +2008,7 @@ class it {
|
|
|
1855
2008
|
this.listener.includes(e) || this.listener.push(e);
|
|
1856
2009
|
}
|
|
1857
2010
|
init() {
|
|
1858
|
-
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new
|
|
2011
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new it().get()) : Object.assign(this.shortcutActionIdMapping, new st().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));
|
|
1859
2012
|
}
|
|
1860
2013
|
isMacintosh() {
|
|
1861
2014
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -1899,7 +2052,7 @@ class it {
|
|
|
1899
2052
|
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();
|
|
1900
2053
|
}
|
|
1901
2054
|
}
|
|
1902
|
-
class
|
|
2055
|
+
class ce {
|
|
1903
2056
|
onCheckboxChanged(e) {
|
|
1904
2057
|
}
|
|
1905
2058
|
onContextmenu(e) {
|
|
@@ -1915,7 +2068,7 @@ class he {
|
|
|
1915
2068
|
onMouseMoved(e) {
|
|
1916
2069
|
}
|
|
1917
2070
|
}
|
|
1918
|
-
class
|
|
2071
|
+
class ve {
|
|
1919
2072
|
setStyle(e, t, s) {
|
|
1920
2073
|
return e.style[t] = s, e;
|
|
1921
2074
|
}
|
|
@@ -1926,6 +2079,9 @@ class ye {
|
|
|
1926
2079
|
addClass(e, t) {
|
|
1927
2080
|
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.add(s)) : e.classList.add(t), e;
|
|
1928
2081
|
}
|
|
2082
|
+
removeClass(e, t) {
|
|
2083
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.remove(s)) : e.classList.remove(t), e;
|
|
2084
|
+
}
|
|
1929
2085
|
appendChild(e, t) {
|
|
1930
2086
|
e.appendChild(t);
|
|
1931
2087
|
}
|
|
@@ -1939,10 +2095,10 @@ class ye {
|
|
|
1939
2095
|
e.setAttribute(t, s);
|
|
1940
2096
|
}
|
|
1941
2097
|
}
|
|
1942
|
-
class
|
|
1943
|
-
render(e, t, s, i, o,
|
|
2098
|
+
class lt {
|
|
2099
|
+
render(e, t, s, i, o, r, n) {
|
|
1944
2100
|
if (o.isEditable(t, s)) {
|
|
1945
|
-
|
|
2101
|
+
n.addClass(e, "ge-table-row-input-div");
|
|
1946
2102
|
const a = o.getValueAt(t, s);
|
|
1947
2103
|
e.innerHTML = `
|
|
1948
2104
|
<input
|
|
@@ -1960,7 +2116,7 @@ class ot {
|
|
|
1960
2116
|
}
|
|
1961
2117
|
}
|
|
1962
2118
|
}
|
|
1963
|
-
class
|
|
2119
|
+
class rt {
|
|
1964
2120
|
constructor(e = "none", t = "single") {
|
|
1965
2121
|
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1966
2122
|
}
|
|
@@ -1995,10 +2151,10 @@ class lt {
|
|
|
1995
2151
|
if (this.selectionType === "none")
|
|
1996
2152
|
return;
|
|
1997
2153
|
let t = e;
|
|
1998
|
-
this.selectionType === "row" ? t =
|
|
2154
|
+
this.selectionType === "row" ? t = D.singleRow(e.r1) : this.selectionType === "column" && (t = D.singleColumn(e.c1)), this.negativeRanges.push(t);
|
|
1999
2155
|
}
|
|
2000
2156
|
togglePoint(e, t) {
|
|
2001
|
-
this.getSelectionCount(e, t) > 0 ? this.removeSelection(
|
|
2157
|
+
this.getSelectionCount(e, t) > 0 ? this.removeSelection(D.singleCell(e, t)) : this.addSelection(D.singleCell(e, t));
|
|
2002
2158
|
}
|
|
2003
2159
|
addRange(e) {
|
|
2004
2160
|
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));
|
|
@@ -2027,32 +2183,43 @@ class nt {
|
|
|
2027
2183
|
return [this.rowIndex, this.columnIndex];
|
|
2028
2184
|
}
|
|
2029
2185
|
}
|
|
2030
|
-
const
|
|
2031
|
-
class
|
|
2186
|
+
const at = new rt(), dt = new nt("cell");
|
|
2187
|
+
class we {
|
|
2032
2188
|
constructor() {
|
|
2033
2189
|
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 = {
|
|
2034
2190
|
header: 34,
|
|
2035
2191
|
body: 34,
|
|
2036
2192
|
footer: 34
|
|
2037
|
-
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new
|
|
2193
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new be(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new ye(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new lt(), this.getSelectionModel = () => at, this.getFocusModel = () => dt;
|
|
2038
2194
|
}
|
|
2039
2195
|
}
|
|
2040
|
-
class
|
|
2196
|
+
class re extends Je {
|
|
2041
2197
|
constructor(e, t, s, i, o) {
|
|
2042
|
-
var
|
|
2198
|
+
var r;
|
|
2043
2199
|
if (super(
|
|
2044
2200
|
e,
|
|
2045
2201
|
t,
|
|
2046
|
-
new
|
|
2202
|
+
new _e(s),
|
|
2047
2203
|
i
|
|
2048
|
-
), this.eventListener = o, this.selectionService = new
|
|
2049
|
-
const
|
|
2050
|
-
a && (
|
|
2204
|
+
), this.eventListener = o, this.selectionService = new tt(this), this.api = new Ne(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new ce()), (r = this.tableOptions) != null && r.autoRestoreOptions) {
|
|
2205
|
+
const n = this.tableOptions.autoRestoreOptions, a = n.getStorageKeyFn;
|
|
2206
|
+
a && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new je(a)), n.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new Ke(a)), n.autoRestoreSortingState && (this.storeSortingService = new ze(a)));
|
|
2051
2207
|
}
|
|
2052
|
-
this.mouseHandler = new
|
|
2208
|
+
this.mouseHandler = new Ge(this), this.inputHandler = new Ze(this), this.shortcutService = new ot(this), this.shortcutService.addListener(this.selectionService);
|
|
2053
2209
|
}
|
|
2054
|
-
|
|
2055
|
-
|
|
2210
|
+
/**
|
|
2211
|
+
* Creates a TableScope instance.
|
|
2212
|
+
*
|
|
2213
|
+
* @param {HTMLDivElement} hostElement - The HTML div element that will contain the table.
|
|
2214
|
+
* @param {TableModelIf} tableModel - The table model object.
|
|
2215
|
+
* @param {TableOptionsIf} [tableOptions=new TableOptions()] - The optional table options object.
|
|
2216
|
+
* @param {EventListenerIf} [eventListener=new EventAdapter()] - The optional event listener object.
|
|
2217
|
+
* @param {DomServiceIf} [domService=new SimpleDomService()] - The optional DOM service object.
|
|
2218
|
+
*
|
|
2219
|
+
* @return {TableScope} - The newly created TableScope instance.
|
|
2220
|
+
*/
|
|
2221
|
+
static create(e, t, s = new we(), i = new ce(), o = new ve()) {
|
|
2222
|
+
return new re(
|
|
2056
2223
|
e,
|
|
2057
2224
|
t,
|
|
2058
2225
|
o,
|
|
@@ -2076,16 +2243,32 @@ class ne extends qe {
|
|
|
2076
2243
|
updateModelValueAfterEdit(e, t, s, i) {
|
|
2077
2244
|
e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, i) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(le.createSingle(t, s)), this.hostElement.focus());
|
|
2078
2245
|
}
|
|
2246
|
+
/**
|
|
2247
|
+
* Retrieves the TableApi object.
|
|
2248
|
+
*
|
|
2249
|
+
* @return {TableApi} The TableApi object.
|
|
2250
|
+
*/
|
|
2079
2251
|
getApi() {
|
|
2080
2252
|
return this.api;
|
|
2081
2253
|
}
|
|
2082
|
-
|
|
2083
|
-
* Called by the table component
|
|
2254
|
+
/**
|
|
2255
|
+
* Initializes the table. Called by the table component.
|
|
2256
|
+
*
|
|
2257
|
+
* @function firstInit
|
|
2258
|
+
* @memberof TableScope
|
|
2259
|
+
*
|
|
2260
|
+
* @returns {TableScope} This instance of the table scope.
|
|
2084
2261
|
*/
|
|
2085
2262
|
firstInit() {
|
|
2086
2263
|
var e;
|
|
2087
2264
|
return this.tableModel.init(), (e = this.tableOptions) != null && e.externalFilterFunction && this.externalFilterChanged(!1), this.autoRestoreCollapsedExpandedState(), this.autoRestoreSortingState(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.autoRestoreScrollPosition(), this;
|
|
2088
2265
|
}
|
|
2266
|
+
/**
|
|
2267
|
+
* Creates a GeMouseEvent object based on a MouseEvent.
|
|
2268
|
+
*
|
|
2269
|
+
* @param {MouseEvent} mouseEvent - The MouseEvent object to create the GeMouseEvent from.
|
|
2270
|
+
* @return {GeMouseEvent} - The created GeMouseEvent object.
|
|
2271
|
+
*/
|
|
2089
2272
|
createGeMouseEvent(e) {
|
|
2090
2273
|
const t = new se();
|
|
2091
2274
|
if (t.originalEvent = e, e) {
|
|
@@ -2101,33 +2284,86 @@ class ne extends qe {
|
|
|
2101
2284
|
}
|
|
2102
2285
|
return t;
|
|
2103
2286
|
}
|
|
2287
|
+
/**
|
|
2288
|
+
* Handles the mouse down event.
|
|
2289
|
+
*
|
|
2290
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event object.
|
|
2291
|
+
* @return {void}
|
|
2292
|
+
*/
|
|
2104
2293
|
onMouseDown(e) {
|
|
2105
2294
|
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));
|
|
2106
2295
|
}
|
|
2296
|
+
/**
|
|
2297
|
+
* Handles mouse dragging on the frame.
|
|
2298
|
+
*
|
|
2299
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event object.
|
|
2300
|
+
*/
|
|
2107
2301
|
mouseDraggingOnFrame(e) {
|
|
2108
2302
|
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());
|
|
2109
2303
|
}
|
|
2304
|
+
/**
|
|
2305
|
+
* Handles the end of mouse dragging event on a frame.
|
|
2306
|
+
*
|
|
2307
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event object.
|
|
2308
|
+
*
|
|
2309
|
+
* @returns {void}
|
|
2310
|
+
*/
|
|
2110
2311
|
mouseDraggingEndOnFrame(e) {
|
|
2111
2312
|
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 = "";
|
|
2112
2313
|
}
|
|
2314
|
+
/**
|
|
2315
|
+
* Handles the mouse move event.
|
|
2316
|
+
*
|
|
2317
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event object.
|
|
2318
|
+
* @return {void}
|
|
2319
|
+
*/
|
|
2113
2320
|
mouseMove(e) {
|
|
2114
2321
|
this.eventListener.onMouseMoved(e), this.adjustHoverRows(e), this.adjustHoverColumns(e);
|
|
2115
2322
|
}
|
|
2323
|
+
/**
|
|
2324
|
+
* Triggers the context menu event based on the mouse move event.
|
|
2325
|
+
*
|
|
2326
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event object.
|
|
2327
|
+
* @return {void}
|
|
2328
|
+
*/
|
|
2116
2329
|
contextmenu(e) {
|
|
2117
2330
|
this.eventListener.onContextmenu(e);
|
|
2118
2331
|
}
|
|
2332
|
+
/**
|
|
2333
|
+
* Toggles the expand or collapse state of all items in the body area model.
|
|
2334
|
+
*
|
|
2335
|
+
* @param {boolean} [expand=true] - Whether to expand or collapse all items. Default is true.
|
|
2336
|
+
*
|
|
2337
|
+
* @return {void}
|
|
2338
|
+
*/
|
|
2119
2339
|
toggleExpandCollapseAll(e = !0) {
|
|
2120
2340
|
var s;
|
|
2121
2341
|
const t = this.tableModel.getBodyModel();
|
|
2122
2342
|
ee(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
2123
2343
|
}
|
|
2344
|
+
/**
|
|
2345
|
+
* Toggles the checkbox state of a specific row in a table.
|
|
2346
|
+
*
|
|
2347
|
+
* @param {number} rowIdx - The index of the row to toggle the checkbox state.
|
|
2348
|
+
* @param {number} _colIdx - The index of the column. This parameter is unused.
|
|
2349
|
+
* @param {AreaIdent} areaIdent - The identifier of the table area.
|
|
2350
|
+
*
|
|
2351
|
+
* @return {void} - This method does not return anything.
|
|
2352
|
+
*/
|
|
2124
2353
|
toggleRowCheckbox(e, t, s) {
|
|
2125
2354
|
var a;
|
|
2126
|
-
const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e),
|
|
2127
|
-
i.setRowChecked(e,
|
|
2128
|
-
const
|
|
2129
|
-
this.eventListener.onCheckboxChanged(
|
|
2355
|
+
const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e), r = o === void 0 || o === "semi" || o === "none";
|
|
2356
|
+
i.setRowChecked(e, r), this.repaint();
|
|
2357
|
+
const n = (a = i.rowSelectionModel) == null ? void 0 : a.getCheckedRows();
|
|
2358
|
+
this.eventListener.onCheckboxChanged(n || []);
|
|
2130
2359
|
}
|
|
2360
|
+
/**
|
|
2361
|
+
* Handle mouse click events.
|
|
2362
|
+
*
|
|
2363
|
+
* @param {GeMouseEvent} evt - The mouse click event.
|
|
2364
|
+
* @param {GeMouseEvent | undefined} previousEvt - The previous mouse click event, if any.
|
|
2365
|
+
* @returns {void}
|
|
2366
|
+
*/
|
|
2131
2367
|
onMouseClicked(e, t) {
|
|
2132
2368
|
let s = this.selectionService.onMouseClicked(e, t);
|
|
2133
2369
|
if (!s && this.getFocusModel) {
|
|
@@ -2136,19 +2372,41 @@ class ne extends qe {
|
|
|
2136
2372
|
}
|
|
2137
2373
|
this.eventListener.onMouseClicked(e), s && this.debounce(this.repaint.bind(this), 10);
|
|
2138
2374
|
}
|
|
2375
|
+
/**
|
|
2376
|
+
* Updates the table (repaint) when an external filter is changed.
|
|
2377
|
+
*
|
|
2378
|
+
* @param {boolean} clearSelection - Indicates whether to clear the selection model or not. Default value is true.
|
|
2379
|
+
* @return {void}
|
|
2380
|
+
*/
|
|
2139
2381
|
externalFilterChanged(e = !0) {
|
|
2140
2382
|
const t = this.tableOptions.externalFilterFunction;
|
|
2141
2383
|
t && (e && this.clearSelectionModel(), this.tableModel.externalFilterChanged(t), this.scrollViewport.scrollTo(0, 0), this.tableModel.recalcHeightAndPadding(), this.resetSizeOfWrapperDiv(), this.repaint());
|
|
2142
2384
|
}
|
|
2385
|
+
/**
|
|
2386
|
+
* Handle the double click event on the table header.
|
|
2387
|
+
*
|
|
2388
|
+
* @param {MouseEvent} event - The mouse event that triggered the double click.
|
|
2389
|
+
* @param {number} _rowIdx - The row index of the header.
|
|
2390
|
+
* @param {number} colIdx - The column index of the header.
|
|
2391
|
+
*
|
|
2392
|
+
* @return {void}
|
|
2393
|
+
*/
|
|
2143
2394
|
onHeaderDblClicked(e, t, s) {
|
|
2144
|
-
var o,
|
|
2395
|
+
var o, r;
|
|
2145
2396
|
const i = this.tableModel.getColumnDef(s);
|
|
2146
2397
|
if (i != null && i.sortable && i.sortable()) {
|
|
2147
2398
|
e.preventDefault(), e.stopPropagation();
|
|
2148
|
-
const
|
|
2149
|
-
this.tableModel.doSort([d]) && ((o = this.tableModel.getColumnDefs()) == null || o.forEach((p) => p.sortState = ""), i.sortState = h), this.repaint(), (
|
|
2399
|
+
const n = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, a = i.sortState ?? "", h = n[(n.indexOf(a) + 1) % n.length], d = new Qe(s, h);
|
|
2400
|
+
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]);
|
|
2150
2401
|
}
|
|
2151
2402
|
}
|
|
2403
|
+
/**
|
|
2404
|
+
* Changes the focus cell using the specified deltas.
|
|
2405
|
+
*
|
|
2406
|
+
* @param {number} dx - The delta for the column index.
|
|
2407
|
+
* @param {number} dy - The delta for the row index.
|
|
2408
|
+
* @return {boolean} - True if the focus cell was changed, false otherwise.
|
|
2409
|
+
*/
|
|
2152
2410
|
changeFocusCell(e, t) {
|
|
2153
2411
|
if (!this.isEditing() && this.getFocusModel) {
|
|
2154
2412
|
const s = this.getFocusModel();
|
|
@@ -2159,9 +2417,19 @@ class ne extends qe {
|
|
|
2159
2417
|
}
|
|
2160
2418
|
return !1;
|
|
2161
2419
|
}
|
|
2420
|
+
/**
|
|
2421
|
+
* Resizes the column based on the mouse event.
|
|
2422
|
+
*
|
|
2423
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event that triggered the resize.
|
|
2424
|
+
*/
|
|
2162
2425
|
resizeColumn(e) {
|
|
2163
2426
|
this.tableModel.setColumnWidth(this.mouseStartColumnIndex, this.mouseStartWidth + e.draggingX), this.tableModel.recalcPadding(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows();
|
|
2164
2427
|
}
|
|
2428
|
+
/**
|
|
2429
|
+
* Clears the selection model, if available.
|
|
2430
|
+
*
|
|
2431
|
+
* @return {void}
|
|
2432
|
+
*/
|
|
2165
2433
|
clearSelectionModel() {
|
|
2166
2434
|
var e;
|
|
2167
2435
|
this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
|
|
@@ -2170,6 +2438,14 @@ class ne extends qe {
|
|
|
2170
2438
|
var s;
|
|
2171
2439
|
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);
|
|
2172
2440
|
}
|
|
2441
|
+
/**
|
|
2442
|
+
* Restores the scroll position of the table if auto restore options are enabled.
|
|
2443
|
+
*
|
|
2444
|
+
* @private
|
|
2445
|
+
* @memberof ClassName
|
|
2446
|
+
*
|
|
2447
|
+
* @returns {void}
|
|
2448
|
+
*/
|
|
2173
2449
|
autoRestoreScrollPosition() {
|
|
2174
2450
|
var e;
|
|
2175
2451
|
if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
|
|
@@ -2177,6 +2453,20 @@ class ne extends qe {
|
|
|
2177
2453
|
s && this.scrollViewport.scrollTo(...s);
|
|
2178
2454
|
}
|
|
2179
2455
|
}
|
|
2456
|
+
/**
|
|
2457
|
+
* Automatically restores the sorting state of the table.
|
|
2458
|
+
*
|
|
2459
|
+
* @private
|
|
2460
|
+
* @function autoRestoreSortingState
|
|
2461
|
+
* @memberof ClassName
|
|
2462
|
+
*
|
|
2463
|
+
* @description
|
|
2464
|
+
* This method checks if the autoRestoreSortingState option is enabled in the tableOptions.
|
|
2465
|
+
* If enabled, it uses the storeSortingService to retrieve the sort items array.
|
|
2466
|
+
* If there are sort items present, it applies them to the table's body model using the doSort method.
|
|
2467
|
+
*
|
|
2468
|
+
* @returns {void}
|
|
2469
|
+
*/
|
|
2180
2470
|
autoRestoreSortingState() {
|
|
2181
2471
|
var e, t;
|
|
2182
2472
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
|
|
@@ -2184,16 +2474,22 @@ class ne extends qe {
|
|
|
2184
2474
|
s != null && s.length && this.tableModel.getBodyModel().doSort(s);
|
|
2185
2475
|
}
|
|
2186
2476
|
}
|
|
2477
|
+
/**
|
|
2478
|
+
* Restores the collapsed/expanded state of the rows in the table based on the autoRestoreOptions
|
|
2479
|
+
* specified in the tableOptions. This method is private and should not be called directly.
|
|
2480
|
+
*
|
|
2481
|
+
* @private
|
|
2482
|
+
*/
|
|
2187
2483
|
autoRestoreCollapsedExpandedState() {
|
|
2188
2484
|
var e, t;
|
|
2189
2485
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
|
|
2190
2486
|
const s = this.tableOptions.autoRestoreOptions, i = s.getRowId;
|
|
2191
2487
|
if (s.autoRestoreCollapsedExpandedState && i) {
|
|
2192
|
-
const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(),
|
|
2193
|
-
if (ee(
|
|
2194
|
-
const
|
|
2488
|
+
const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), r = this.tableModel.getAreaModel("body");
|
|
2489
|
+
if (ee(r)) {
|
|
2490
|
+
const n = r, a = r.getRowCount();
|
|
2195
2491
|
for (let h = 0; h < a; h++) {
|
|
2196
|
-
const d =
|
|
2492
|
+
const d = r.getRowByIndex(h);
|
|
2197
2493
|
if (d)
|
|
2198
2494
|
if (o.allExpanded)
|
|
2199
2495
|
d.expanded = !0;
|
|
@@ -2204,70 +2500,70 @@ class ne extends qe {
|
|
|
2204
2500
|
o.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(c) : o.mode === "collapsed" && (d.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(c));
|
|
2205
2501
|
}
|
|
2206
2502
|
}
|
|
2207
|
-
|
|
2503
|
+
n.recalcVisibleTreeRows();
|
|
2208
2504
|
}
|
|
2209
2505
|
}
|
|
2210
2506
|
}
|
|
2211
2507
|
}
|
|
2212
2508
|
}
|
|
2213
|
-
const
|
|
2509
|
+
const ht = /* @__PURE__ */ We("<div>"), pt = (l) => {
|
|
2214
2510
|
let e;
|
|
2215
|
-
const t =
|
|
2511
|
+
const t = me({
|
|
2216
2512
|
tableModel: null,
|
|
2217
|
-
tableOptions: new
|
|
2513
|
+
tableOptions: new we()
|
|
2218
2514
|
}, l);
|
|
2219
|
-
return
|
|
2515
|
+
return Me(() => {
|
|
2220
2516
|
const s = {
|
|
2221
|
-
onCheckboxChanged: (
|
|
2222
|
-
const
|
|
2223
|
-
detail:
|
|
2517
|
+
onCheckboxChanged: (r) => {
|
|
2518
|
+
const n = new CustomEvent("checkboxChanged", {
|
|
2519
|
+
detail: r,
|
|
2224
2520
|
bubbles: !0
|
|
2225
2521
|
});
|
|
2226
|
-
e && e.dispatchEvent(
|
|
2522
|
+
e && e.dispatchEvent(n);
|
|
2227
2523
|
},
|
|
2228
|
-
onContextmenu: (
|
|
2229
|
-
const
|
|
2230
|
-
detail:
|
|
2524
|
+
onContextmenu: (r) => {
|
|
2525
|
+
const n = new CustomEvent("contextmenu", {
|
|
2526
|
+
detail: r,
|
|
2231
2527
|
bubbles: !0
|
|
2232
2528
|
});
|
|
2233
|
-
e && e.dispatchEvent(
|
|
2529
|
+
e && e.dispatchEvent(n);
|
|
2234
2530
|
},
|
|
2235
|
-
onModelChanged: (
|
|
2236
|
-
const
|
|
2237
|
-
detail:
|
|
2531
|
+
onModelChanged: (r) => {
|
|
2532
|
+
const n = new CustomEvent("modelChanged", {
|
|
2533
|
+
detail: r,
|
|
2238
2534
|
bubbles: !0
|
|
2239
2535
|
});
|
|
2240
|
-
e && e.dispatchEvent(
|
|
2536
|
+
e && e.dispatchEvent(n);
|
|
2241
2537
|
},
|
|
2242
|
-
onMouseClicked: (
|
|
2243
|
-
const
|
|
2244
|
-
detail:
|
|
2538
|
+
onMouseClicked: (r) => {
|
|
2539
|
+
const n = new CustomEvent("mouseClicked", {
|
|
2540
|
+
detail: r,
|
|
2245
2541
|
bubbles: !0
|
|
2246
2542
|
});
|
|
2247
|
-
e && e.dispatchEvent(
|
|
2543
|
+
e && e.dispatchEvent(n);
|
|
2248
2544
|
},
|
|
2249
|
-
onMouseDragging: (
|
|
2250
|
-
const
|
|
2251
|
-
detail:
|
|
2545
|
+
onMouseDragging: (r) => {
|
|
2546
|
+
const n = new CustomEvent("mouseDragging", {
|
|
2547
|
+
detail: r,
|
|
2252
2548
|
bubbles: !0
|
|
2253
2549
|
});
|
|
2254
|
-
e && e.dispatchEvent(
|
|
2550
|
+
e && e.dispatchEvent(n);
|
|
2255
2551
|
},
|
|
2256
|
-
onMouseDraggingEnd: (
|
|
2257
|
-
const
|
|
2258
|
-
detail:
|
|
2552
|
+
onMouseDraggingEnd: (r) => {
|
|
2553
|
+
const n = new CustomEvent("mouseDraggingEnd", {
|
|
2554
|
+
detail: r,
|
|
2259
2555
|
bubbles: !0
|
|
2260
2556
|
});
|
|
2261
|
-
e && e.dispatchEvent(
|
|
2557
|
+
e && e.dispatchEvent(n);
|
|
2262
2558
|
},
|
|
2263
|
-
onMouseMoved: (
|
|
2264
|
-
const
|
|
2265
|
-
detail:
|
|
2559
|
+
onMouseMoved: (r) => {
|
|
2560
|
+
const n = new CustomEvent("mouseMoved", {
|
|
2561
|
+
detail: r,
|
|
2266
2562
|
bubbles: !0
|
|
2267
2563
|
});
|
|
2268
|
-
e && e.dispatchEvent(
|
|
2564
|
+
e && e.dispatchEvent(n);
|
|
2269
2565
|
}
|
|
2270
|
-
}, i = new
|
|
2566
|
+
}, i = new re(e, t.tableModel, new ve(), t.tableOptions, s);
|
|
2271
2567
|
i.firstInit();
|
|
2272
2568
|
const o = new CustomEvent("tableReady", {
|
|
2273
2569
|
detail: i.getApi(),
|
|
@@ -2275,12 +2571,12 @@ const dt = /* @__PURE__ */ Pe("<div>"), ut = (l) => {
|
|
|
2275
2571
|
});
|
|
2276
2572
|
e && e.dispatchEvent(o);
|
|
2277
2573
|
}), (() => {
|
|
2278
|
-
const s =
|
|
2279
|
-
return typeof i == "function" ?
|
|
2574
|
+
const s = ht(), i = e;
|
|
2575
|
+
return typeof i == "function" ? He(i, s) : e = s, s;
|
|
2280
2576
|
})();
|
|
2281
2577
|
};
|
|
2282
2578
|
export {
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2579
|
+
ct as ComponentRendererWrapper,
|
|
2580
|
+
pt as GuiexpertTable,
|
|
2581
|
+
ut as GuiexpertTableProps
|
|
2286
2582
|
};
|