@guiexpert/solid-table 1.0.9 → 1.0.10
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/README.md +1 -1
- package/index.cjs +3 -3
- package/index.js +580 -798
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
const
|
|
2
|
-
equals:
|
|
1
|
+
const we = (l, e) => l === e, q = Symbol("solid-proxy"), ae = {
|
|
2
|
+
equals: we
|
|
3
3
|
};
|
|
4
|
-
let
|
|
5
|
-
const L = 1,
|
|
4
|
+
let ce = pe;
|
|
5
|
+
const L = 1, _ = 2, ue = {
|
|
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, E = null,
|
|
13
|
-
function
|
|
14
|
-
const t = b, s = A, i = l.length === 0, o = e === void 0 ? s : e,
|
|
12
|
+
let Y = null, b = null, E = null, F = null, z = 0;
|
|
13
|
+
function xe(l, e) {
|
|
14
|
+
const t = b, s = A, i = l.length === 0, o = e === void 0 ? s : e, n = i ? ue : {
|
|
15
15
|
owned: null,
|
|
16
16
|
cleanups: null,
|
|
17
17
|
context: o ? o.context : null,
|
|
18
18
|
owner: o
|
|
19
|
-
},
|
|
20
|
-
A =
|
|
19
|
+
}, r = i ? l : () => l(() => P(() => X(n)));
|
|
20
|
+
A = n, b = null;
|
|
21
21
|
try {
|
|
22
|
-
return
|
|
22
|
+
return H(r, !0);
|
|
23
23
|
} finally {
|
|
24
24
|
b = t, A = s;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
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 Ce(l, e, t) {
|
|
32
|
+
ce = Ie;
|
|
33
33
|
const s = te(l, e, !1, L);
|
|
34
|
-
(!t || !t.render) && (s.user = !0),
|
|
34
|
+
(!t || !t.render) && (s.user = !0), F ? F.push(s) : W(s);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
t = t ? Object.assign({},
|
|
36
|
+
function Ee(l, e, t) {
|
|
37
|
+
t = t ? Object.assign({}, ae, t) : ae;
|
|
38
38
|
const s = te(l, e, !0, 0);
|
|
39
|
-
return s.observers = null, s.observerSlots = null, s.comparator = t.equals || void 0,
|
|
39
|
+
return s.observers = null, s.observerSlots = null, s.comparator = t.equals || void 0, W(s), Me.bind(s);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function P(l) {
|
|
42
42
|
if (b === null)
|
|
43
43
|
return l();
|
|
44
44
|
const e = b;
|
|
@@ -49,16 +49,16 @@ function $(l) {
|
|
|
49
49
|
b = e;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
52
|
+
function Ae(l) {
|
|
53
|
+
Ce(() => P(l));
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Me() {
|
|
56
56
|
if (this.sources && this.state)
|
|
57
57
|
if (this.state === L)
|
|
58
|
-
|
|
58
|
+
W(this);
|
|
59
59
|
else {
|
|
60
60
|
const l = E;
|
|
61
|
-
E = null,
|
|
61
|
+
E = null, H(() => N(this), !1), E = l;
|
|
62
62
|
}
|
|
63
63
|
if (b) {
|
|
64
64
|
const l = this.observers ? this.observers.length : 0;
|
|
@@ -66,32 +66,32 @@ function xe() {
|
|
|
66
66
|
}
|
|
67
67
|
return this.value;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Re(l, e, t) {
|
|
70
70
|
let s = l.value;
|
|
71
|
-
return (!l.comparator || !l.comparator(s, e)) && (l.value = e, l.observers && l.observers.length &&
|
|
71
|
+
return (!l.comparator || !l.comparator(s, e)) && (l.value = e, l.observers && l.observers.length && 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], n = Y && Y.running;
|
|
74
|
+
n && Y.disposed.has(o), (n ? !o.tState : !o.state) && (o.pure ? E.push(o) : F.push(o), o.observers && fe(o)), n || (o.state = L);
|
|
75
75
|
}
|
|
76
76
|
if (E.length > 1e6)
|
|
77
77
|
throw E = [], new Error();
|
|
78
78
|
}, !1)), e;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function W(l) {
|
|
81
81
|
if (!l.fn)
|
|
82
82
|
return;
|
|
83
83
|
X(l);
|
|
84
84
|
const e = A, t = b, s = z;
|
|
85
|
-
b = A = l,
|
|
85
|
+
b = A = l, Te(l, l.value, s), b = t, A = e;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function Te(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(X), l.owned = null), l.updatedAt = t + 1,
|
|
92
|
+
return l.pure && (l.state = L, l.owned && l.owned.forEach(X), l.owned = null), l.updatedAt = t + 1, Se(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 ? Re(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 !== ue && (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 === _)
|
|
116
116
|
return N(l);
|
|
117
|
-
if (l.suspense &&
|
|
117
|
+
if (l.suspense && P(l.suspense.inFallback))
|
|
118
118
|
return l.suspense.effects.push(l);
|
|
119
119
|
const e = [l];
|
|
120
120
|
for (; (l = l.owner) && (!l.updatedAt || l.updatedAt < z); )
|
|
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
|
-
|
|
125
|
-
else if (l.state ===
|
|
124
|
+
W(l);
|
|
125
|
+
else if (l.state === _) {
|
|
126
126
|
const s = E;
|
|
127
|
-
E = null,
|
|
127
|
+
E = null, H(() => N(l, e[0]), !1), E = s;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function H(l, e) {
|
|
131
131
|
if (E)
|
|
132
132
|
return l();
|
|
133
133
|
let t = !1;
|
|
134
|
-
e || (E = []),
|
|
134
|
+
e || (E = []), F ? t = !0 : F = [], z++;
|
|
135
135
|
try {
|
|
136
136
|
const s = l();
|
|
137
|
-
return
|
|
137
|
+
return De(t), s;
|
|
138
138
|
} catch (s) {
|
|
139
|
-
t || (
|
|
139
|
+
t || (F = null), E = null, Se(s);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
if (E && (
|
|
142
|
+
function De(l) {
|
|
143
|
+
if (E && (pe(E), E = null), l)
|
|
144
144
|
return;
|
|
145
|
-
const e =
|
|
146
|
-
|
|
145
|
+
const e = F;
|
|
146
|
+
F = null, e.length && H(() => ce(e), !1);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function pe(l) {
|
|
149
149
|
for (let e = 0; e < l.length; e++)
|
|
150
150
|
G(l[e]);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function Ie(l) {
|
|
153
153
|
let e, t = 0;
|
|
154
154
|
for (e = 0; e < l.length; e++) {
|
|
155
155
|
const s = l[e];
|
|
@@ -164,14 +164,14 @@ 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 < z) && G(s) : i ===
|
|
167
|
+
i === L ? s !== e && (!s.updatedAt || s.updatedAt < z) && G(s) : i === _ && N(s, e);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function fe(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 = _, t.pure ? E.push(t) : F.push(t), t.observers && fe(t));
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
function X(l) {
|
|
@@ -180,8 +180,8 @@ function X(l) {
|
|
|
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(), n = t.observerSlots.pop();
|
|
184
|
+
s < i.length && (o.sourceSlots[n] = s, i[s] = o, t.observerSlots[s] = n);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
if (l.owned) {
|
|
@@ -196,26 +196,26 @@ function X(l) {
|
|
|
196
196
|
}
|
|
197
197
|
l.state = 0;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function Oe(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 Se(l, e = A) {
|
|
205
|
+
throw Oe(l);
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function k() {
|
|
208
208
|
return !0;
|
|
209
209
|
}
|
|
210
|
-
const
|
|
210
|
+
const Fe = {
|
|
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: k,
|
|
218
|
+
deleteProperty: k,
|
|
219
219
|
getOwnPropertyDescriptor(l, e) {
|
|
220
220
|
return {
|
|
221
221
|
configurable: !0,
|
|
@@ -223,8 +223,8 @@ const Te = {
|
|
|
223
223
|
get() {
|
|
224
224
|
return l.get(e);
|
|
225
225
|
},
|
|
226
|
-
set:
|
|
227
|
-
deleteProperty:
|
|
226
|
+
set: k,
|
|
227
|
+
deleteProperty: k
|
|
228
228
|
};
|
|
229
229
|
},
|
|
230
230
|
ownKeys(l) {
|
|
@@ -234,131 +234,131 @@ const Te = {
|
|
|
234
234
|
function U(l) {
|
|
235
235
|
return (l = typeof l == "function" ? l() : l) ? l : {};
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function Le() {
|
|
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 ge(...l) {
|
|
245
245
|
let e = !1;
|
|
246
246
|
for (let o = 0; o < l.length; o++) {
|
|
247
|
-
const
|
|
248
|
-
e = e || !!
|
|
247
|
+
const n = l[o];
|
|
248
|
+
e = e || !!n && q in n, l[o] = typeof n == "function" ? (e = !0, Ee(n)) : n;
|
|
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 n = l.length - 1; n >= 0; n--) {
|
|
254
|
+
const r = U(l[n])[o];
|
|
255
|
+
if (r !== void 0)
|
|
256
|
+
return r;
|
|
257
257
|
}
|
|
258
258
|
},
|
|
259
259
|
has(o) {
|
|
260
|
-
for (let
|
|
261
|
-
if (o in U(l[
|
|
260
|
+
for (let n = l.length - 1; n >= 0; n--)
|
|
261
|
+
if (o in U(l[n]))
|
|
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 n = 0; n < l.length; n++)
|
|
268
|
+
o.push(...Object.keys(U(l[n])));
|
|
269
269
|
return [...new Set(o)];
|
|
270
270
|
}
|
|
271
|
-
},
|
|
271
|
+
}, Fe);
|
|
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 n = l[o];
|
|
275
|
+
if (!n)
|
|
276
276
|
continue;
|
|
277
|
-
const
|
|
278
|
-
for (let a = 0, h =
|
|
279
|
-
const d =
|
|
277
|
+
const r = Object.getOwnPropertyNames(n);
|
|
278
|
+
for (let a = 0, h = r.length; a < h; a++) {
|
|
279
|
+
const d = r[a];
|
|
280
280
|
if (d === "__proto__" || d === "constructor")
|
|
281
281
|
continue;
|
|
282
|
-
const c = Object.getOwnPropertyDescriptor(
|
|
282
|
+
const c = Object.getOwnPropertyDescriptor(n, 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: Le.bind(s[d] = [c.get.bind(n)])
|
|
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(n)) : 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 $e(l, e, t) {
|
|
298
|
+
let s = t.length, i = e.length, o = s, n = 0, r = 0, a = e[i - 1].nextSibling, h = null;
|
|
299
|
+
for (; n < i || r < o; ) {
|
|
300
|
+
if (e[n] === t[r]) {
|
|
301
|
+
n++, r++;
|
|
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 === n) {
|
|
307
|
+
const d = o < s ? r ? t[r - 1].nextSibling : t[o - r] : a;
|
|
308
|
+
for (; r < o; )
|
|
309
|
+
l.insertBefore(t[r++], d);
|
|
310
|
+
} else if (o === r)
|
|
311
|
+
for (; n < i; )
|
|
312
|
+
(!h || !h.has(e[n])) && e[n].remove(), n++;
|
|
313
|
+
else if (e[n] === t[o - 1] && t[r] === e[i - 1]) {
|
|
314
314
|
const d = e[--i].nextSibling;
|
|
315
|
-
l.insertBefore(t[
|
|
315
|
+
l.insertBefore(t[r++], e[n++].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 = r;
|
|
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[n]);
|
|
324
324
|
if (d != null)
|
|
325
|
-
if (
|
|
326
|
-
let c =
|
|
327
|
-
for (; ++c < i && c < o && !((
|
|
325
|
+
if (r < d && d < o) {
|
|
326
|
+
let c = n, p = 1, g;
|
|
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 - r) {
|
|
330
|
+
const u = e[n];
|
|
331
|
+
for (; r < d; )
|
|
332
|
+
l.insertBefore(t[r++], u);
|
|
333
333
|
} else
|
|
334
|
-
l.replaceChild(t[
|
|
334
|
+
l.replaceChild(t[r++], e[n++]);
|
|
335
335
|
} else
|
|
336
|
-
|
|
336
|
+
n++;
|
|
337
337
|
else
|
|
338
|
-
e[
|
|
338
|
+
e[n++].remove();
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function Be(l, e, t, s = {}) {
|
|
343
343
|
let i;
|
|
344
|
-
return
|
|
345
|
-
i = o, e === document ? l() :
|
|
344
|
+
return xe((o) => {
|
|
345
|
+
i = o, e === document ? l() : He(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 Pe(l, e, t) {
|
|
351
351
|
let s;
|
|
352
352
|
const i = () => {
|
|
353
|
-
const
|
|
354
|
-
return
|
|
355
|
-
}, o = e ? () =>
|
|
353
|
+
const n = document.createElement("template");
|
|
354
|
+
return n.innerHTML = l, t ? n.content.firstChild.firstChild : n.content.firstChild;
|
|
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
|
|
359
|
-
return
|
|
358
|
+
function We(l, e, t) {
|
|
359
|
+
return P(() => l(e, t));
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function He(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,38 +368,38 @@ 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, n = s !== void 0;
|
|
372
|
+
if (l = n && t[0] && t[0].parentNode || l, o === "string" || o === "number")
|
|
373
|
+
if (o === "number" && (e = e.toString()), n) {
|
|
374
|
+
let r = t[0];
|
|
375
|
+
r && r.nodeType === 3 ? r.data = e : r = document.createTextNode(e), t = B(l, t, s, r);
|
|
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")
|
|
379
|
-
t =
|
|
379
|
+
t = B(l, t, s);
|
|
380
380
|
else {
|
|
381
381
|
if (o === "function")
|
|
382
382
|
return J(() => {
|
|
383
|
-
let
|
|
384
|
-
for (; typeof
|
|
385
|
-
|
|
386
|
-
t = j(l,
|
|
383
|
+
let r = e();
|
|
384
|
+
for (; typeof r == "function"; )
|
|
385
|
+
r = r();
|
|
386
|
+
t = j(l, r, 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 =
|
|
389
|
+
const r = [], a = t && Array.isArray(t);
|
|
390
|
+
if (Q(r, e, t, i))
|
|
391
|
+
return J(() => t = j(l, r, t, s, !0)), () => t;
|
|
392
|
+
if (r.length === 0) {
|
|
393
|
+
if (t = B(l, t, s), n)
|
|
394
394
|
return t;
|
|
395
395
|
} else
|
|
396
|
-
a ? t.length === 0 ?
|
|
397
|
-
t =
|
|
396
|
+
a ? t.length === 0 ? de(l, r, s) : $e(l, t, r) : (t && B(l), de(l, r));
|
|
397
|
+
t = r;
|
|
398
398
|
} else if (e.nodeType) {
|
|
399
399
|
if (Array.isArray(t)) {
|
|
400
|
-
if (
|
|
401
|
-
return t =
|
|
402
|
-
|
|
400
|
+
if (n)
|
|
401
|
+
return t = B(l, t, s, e);
|
|
402
|
+
B(l, t, null, e);
|
|
403
403
|
} else
|
|
404
404
|
t == null || t === "" || !l.firstChild ? l.appendChild(e) : l.replaceChild(e, l.firstChild);
|
|
405
405
|
t = e;
|
|
@@ -409,42 +409,42 @@ 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, n = e.length; o < n; o++) {
|
|
413
|
+
let r = e[o], a = t && t[o], h;
|
|
414
|
+
if (!(r == null || r === !0 || r === !1))
|
|
415
|
+
if ((h = typeof r) == "object" && r.nodeType)
|
|
416
|
+
l.push(r);
|
|
417
|
+
else if (Array.isArray(r))
|
|
418
|
+
i = Q(l, r, 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 r == "function"; )
|
|
422
|
+
r = r();
|
|
423
|
+
i = Q(l, Array.isArray(r) ? r : [r], Array.isArray(a) ? a : [a]) || i;
|
|
424
424
|
} else
|
|
425
|
-
l.push(
|
|
425
|
+
l.push(r), i = !0;
|
|
426
426
|
else {
|
|
427
|
-
const d = String(
|
|
427
|
+
const d = String(r);
|
|
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 de(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
|
}
|
|
437
|
-
function
|
|
437
|
+
function B(l, e, t, s) {
|
|
438
438
|
if (t === void 0)
|
|
439
439
|
return l.textContent = "";
|
|
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 n = e.length - 1; n >= 0; n--) {
|
|
444
|
+
const r = e[n];
|
|
445
|
+
if (i !== r) {
|
|
446
|
+
const a = r.parentNode === l;
|
|
447
|
+
!o && !n ? a ? l.replaceChild(i, r) : l.insertBefore(i, t) : a && r.remove();
|
|
448
448
|
} else
|
|
449
449
|
o = !0;
|
|
450
450
|
}
|
|
@@ -452,30 +452,36 @@ function P(l, e, t, s) {
|
|
|
452
452
|
l.insertBefore(i, t);
|
|
453
453
|
return [i];
|
|
454
454
|
}
|
|
455
|
-
class
|
|
455
|
+
class ht {
|
|
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, n, r) {
|
|
460
|
+
const a = ge({
|
|
461
461
|
rowIndex: t,
|
|
462
462
|
columnIndex: s,
|
|
463
463
|
areaIdent: i,
|
|
464
464
|
areaModel: o,
|
|
465
|
-
cellValue:
|
|
465
|
+
cellValue: n
|
|
466
466
|
});
|
|
467
|
-
|
|
467
|
+
Be(
|
|
468
468
|
() => this.code(a),
|
|
469
469
|
e
|
|
470
470
|
);
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
|
-
const
|
|
473
|
+
const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
474
474
|
__proto__: null
|
|
475
475
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
476
|
+
function Z(l) {
|
|
477
|
+
return l && l.type === "TreeRow";
|
|
478
|
+
}
|
|
479
|
+
function ee(l) {
|
|
480
|
+
return l && l.type === "AreaModelTree";
|
|
481
|
+
}
|
|
476
482
|
class se {
|
|
477
|
-
constructor(e = -1, t = -1, s = -1, i = -1, o,
|
|
478
|
-
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, n, r, 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 = n, this.originalEvent = r, this.clickCount = a, this.draggingX = h, this.draggingY = d, this.action = c;
|
|
479
485
|
}
|
|
480
486
|
clone() {
|
|
481
487
|
return new se(
|
|
@@ -493,25 +499,25 @@ class se {
|
|
|
493
499
|
);
|
|
494
500
|
}
|
|
495
501
|
}
|
|
496
|
-
class
|
|
502
|
+
class $ {
|
|
497
503
|
constructor(e = ">", t = "", s = []) {
|
|
498
504
|
this.content = e, this.style = t, this.classes = s;
|
|
499
505
|
}
|
|
500
506
|
}
|
|
501
|
-
class
|
|
502
|
-
constructor(e = new
|
|
507
|
+
class me {
|
|
508
|
+
constructor(e = new $(
|
|
503
509
|
">",
|
|
504
510
|
"transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
|
|
505
511
|
["gt-table-tree-arrow-expanded"]
|
|
506
|
-
), t = new
|
|
512
|
+
), t = new $(
|
|
507
513
|
">",
|
|
508
514
|
"",
|
|
509
515
|
["ge-table-tree-arrow-collapsed"]
|
|
510
|
-
), s = new
|
|
516
|
+
), s = new $(
|
|
511
517
|
">",
|
|
512
518
|
"color:transparent;",
|
|
513
519
|
["gt-table-tree-arrow-hidden"]
|
|
514
|
-
), i = new
|
|
520
|
+
), i = new $(
|
|
515
521
|
"↕",
|
|
516
522
|
"",
|
|
517
523
|
["gt-table-tree-arrow-expanded-all"]
|
|
@@ -519,12 +525,12 @@ class ge {
|
|
|
519
525
|
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = i;
|
|
520
526
|
}
|
|
521
527
|
}
|
|
522
|
-
class
|
|
523
|
-
constructor(e = new
|
|
528
|
+
class be {
|
|
529
|
+
constructor(e = new $("↑", "", ["ge-header-sorted-asc"]), t = new $("↓", "", ["ge-header-sorted-desc"]), s = new $("↑", "color:transparent;", [])) {
|
|
524
530
|
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
|
|
525
531
|
}
|
|
526
532
|
}
|
|
527
|
-
class
|
|
533
|
+
class Ve {
|
|
528
534
|
constructor(e) {
|
|
529
535
|
this.domService = e;
|
|
530
536
|
}
|
|
@@ -594,83 +600,83 @@ class Pe {
|
|
|
594
600
|
const s = this.domService.createElement("div");
|
|
595
601
|
return this.addClass(e, s), this.domService.appendChild(t, s), s;
|
|
596
602
|
}
|
|
597
|
-
addRowDiv(e, t, s = -1, i, o,
|
|
598
|
-
const
|
|
603
|
+
addRowDiv(e, t, s = -1, i, o, n = "") {
|
|
604
|
+
const r = t.index ?? -1, a = this.getDivOrCreateDiv(r, e);
|
|
599
605
|
if (this.domService.addClass(a, "ge-table-row-div"), this.domService.addClass(a, `ge-table-row-div-${t.index}`), i === "body" && o === "center") {
|
|
600
606
|
const h = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
601
607
|
this.domService.addClass(a, `ge-table-row-${h}`);
|
|
602
608
|
}
|
|
603
|
-
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}`),
|
|
604
|
-
const h = this.domService.createText(
|
|
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}`), n) {
|
|
610
|
+
const h = this.domService.createText(n);
|
|
605
611
|
this.domService.appendChild(a, h);
|
|
606
612
|
}
|
|
607
613
|
return this.domService.appendChild(e.child, a), a;
|
|
608
614
|
}
|
|
609
|
-
addColumnDiv(e, t, s = -1, i = -1, o,
|
|
610
|
-
const p = h == null ? void 0 : h.treeOptions,
|
|
615
|
+
addColumnDiv(e, t, s = -1, i = -1, o, n, r = "", a, h, d = void 0, c) {
|
|
616
|
+
const p = h == null ? void 0 : h.treeOptions, g = h == null ? void 0 : h.showCheckboxWihoutExtraColumn, u = this.domService.createElement("div");
|
|
611
617
|
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}`);
|
|
612
618
|
const y = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
613
|
-
if (o === "body" &&
|
|
619
|
+
if (o === "body" && n === "center" && this.domService.addClass(u, `ge-table-column-${y}`), 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), r) {
|
|
614
620
|
const f = a !== "none" && i === 0;
|
|
615
|
-
this.addLabelDiv(u,
|
|
621
|
+
this.addLabelDiv(u, r, f, s, i, o);
|
|
616
622
|
}
|
|
617
623
|
return c && this.addSortedIcon(u, c, h == null ? void 0 : h.sortedOptions, i), this.domService.appendChild(e, u), u;
|
|
618
624
|
}
|
|
619
625
|
addCheckboxToDiv(e, t, s, i) {
|
|
620
|
-
const o = this.domService.createElement("div"),
|
|
626
|
+
const o = this.domService.createElement("div"), n = t === "full" ? "checked" : "";
|
|
621
627
|
return o.innerHTML = `
|
|
622
628
|
<input
|
|
623
629
|
type="checkbox"
|
|
624
630
|
data-area="${s}"
|
|
625
631
|
data-row-index="${i}"
|
|
626
632
|
data-input-type="checkbox"
|
|
627
|
-
${
|
|
633
|
+
${n}
|
|
628
634
|
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;
|
|
629
635
|
}
|
|
630
|
-
addLabelDiv(e, t = "", s = !1, i = -1, o = -1,
|
|
631
|
-
const
|
|
632
|
-
if (this.domService.addClass(
|
|
636
|
+
addLabelDiv(e, t = "", s = !1, i = -1, o = -1, n = "body") {
|
|
637
|
+
const r = this.domService.createElement("div");
|
|
638
|
+
if (this.domService.addClass(r, "ge-table-label-div"), this.domService.setStyle(r, "position", "relative"), this.domService.setStyle(r, "background", "transparent"), this.domService.setStyle(r, "width", "100%"), this.domService.setStyle(r, "height", "100%"), this.domService.setAttribute(r, "data-row-index", `${i}`), this.domService.setAttribute(r, "data-col-index", `${o}`), this.domService.setAttribute(r, "data-area", `${n}`), t)
|
|
633
639
|
if (s) {
|
|
634
640
|
const a = this.domService.createText(t);
|
|
635
|
-
this.domService.appendChild(
|
|
641
|
+
this.domService.appendChild(r, a);
|
|
636
642
|
} else {
|
|
637
643
|
const a = this.domService.createElement("div");
|
|
638
|
-
this.domService.appendChild(
|
|
644
|
+
this.domService.appendChild(r, a);
|
|
639
645
|
const h = this.domService.createText(t);
|
|
640
|
-
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", `${
|
|
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", `${n}`);
|
|
641
647
|
}
|
|
642
|
-
return this.domService.appendChild(e,
|
|
648
|
+
return this.domService.appendChild(e, r), r;
|
|
643
649
|
}
|
|
644
|
-
addSortedIcon(e, t = "", s = new
|
|
650
|
+
addSortedIcon(e, t = "", s = new be(), i = -1) {
|
|
645
651
|
const o = this.domService.createElement("div");
|
|
646
652
|
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");
|
|
647
|
-
let
|
|
648
|
-
t === "asc" ?
|
|
649
|
-
const
|
|
650
|
-
this.domService.appendChild(o, a),
|
|
651
|
-
for (const h of
|
|
653
|
+
let n;
|
|
654
|
+
t === "asc" ? n = s.iconAsc : t === "desc" ? n = s.iconDesc : n = s.iconPlaceholder;
|
|
655
|
+
const r = n.content, a = this.domService.createText(r);
|
|
656
|
+
this.domService.appendChild(o, a), n.style && this.applyStyleString(o, n.style);
|
|
657
|
+
for (const h of n.classes)
|
|
652
658
|
this.domService.addClass(o, h);
|
|
653
659
|
return this.domService.appendChild(e, o), o;
|
|
654
660
|
}
|
|
655
|
-
addArrowDiv(e, t = "none", s = new
|
|
656
|
-
const
|
|
657
|
-
this.domService.addClass(
|
|
661
|
+
addArrowDiv(e, t = "none", s = new me(), i = -1, o = -1, n = "body") {
|
|
662
|
+
const r = this.domService.createElement("div");
|
|
663
|
+
this.domService.addClass(r, "ge-table-tree-arrow-div"), this.domService.setStyle(r, "display", "inline-block"), this.domService.setStyle(r, "position", ""), this.domService.setStyle(r, "width", "20px"), this.domService.setStyle(r, "background", "transparent"), this.domService.setStyle(r, "cursor", "pointer"), this.domService.setAttribute(r, "data-row-index", `${i}`), this.domService.setAttribute(r, "data-col-index", `${o}`), this.domService.setAttribute(r, "data-area", `${n}`);
|
|
658
664
|
let a;
|
|
659
665
|
t === "expanded" ? a = s.arrowExpanded : t === "collapsed" ? a = s.arrowCollapsed : a = s.arrowPlaceholder;
|
|
660
666
|
const h = a.content, d = this.domService.createText(h);
|
|
661
|
-
this.domService.appendChild(
|
|
667
|
+
this.domService.appendChild(r, d), a.style && this.applyStyleString(r, a.style);
|
|
662
668
|
for (const c of a.classes)
|
|
663
|
-
this.domService.addClass(
|
|
664
|
-
return this.domService.appendChild(e,
|
|
669
|
+
this.domService.addClass(r, c);
|
|
670
|
+
return this.domService.appendChild(e, r), r;
|
|
665
671
|
}
|
|
666
672
|
addColumnBorderDivs(e, t, s, i, o) {
|
|
667
673
|
if (e.verticalBorderVisible) {
|
|
668
|
-
const
|
|
669
|
-
this.addVerticalBorder(s, t,
|
|
674
|
+
const n = `ge-table-${i}-${o}-vertical-border`;
|
|
675
|
+
this.addVerticalBorder(s, t, n);
|
|
670
676
|
}
|
|
671
677
|
if (e.horizontalBorderVisible) {
|
|
672
|
-
const
|
|
673
|
-
this.addHorizontalBorder(s, t,
|
|
678
|
+
const n = `ge-table-${i}-${o}-horizontal-border`;
|
|
679
|
+
this.addHorizontalBorder(s, t, n);
|
|
674
680
|
}
|
|
675
681
|
return t;
|
|
676
682
|
}
|
|
@@ -693,8 +699,8 @@ class Pe {
|
|
|
693
699
|
applyStyleString(e, t) {
|
|
694
700
|
const s = t.split(";").map((i) => i.trim()).filter((i) => i);
|
|
695
701
|
for (const i of s) {
|
|
696
|
-
const [o,
|
|
697
|
-
this.domService.setStyle(e, o.trim(),
|
|
702
|
+
const [o, n] = i.split(":");
|
|
703
|
+
this.domService.setStyle(e, o.trim(), n.trim());
|
|
698
704
|
}
|
|
699
705
|
}
|
|
700
706
|
getDivOrCreateDiv(e, t) {
|
|
@@ -702,13 +708,8 @@ class Pe {
|
|
|
702
708
|
return s ? (s.innerText = "", s) : (s = this.domService.createElement("div"), t.cache[e] = s, s);
|
|
703
709
|
}
|
|
704
710
|
}
|
|
705
|
-
class Z {
|
|
706
|
-
constructor(e, t = !0, s, i, o = 0, r = !1, n = !1) {
|
|
707
|
-
this.data = e, this.expanded = t, this.children = s, this.parent = i, this.deep = o, this.checked = r, this.keep = n;
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
711
|
const ie = (l) => l === "header" ? "header" : l === "footer" ? "footer" : "body";
|
|
711
|
-
class
|
|
712
|
+
class ke {
|
|
712
713
|
constructor(e, t) {
|
|
713
714
|
if (this.rowIdx = -1, this.colIdx = -1, this.action = null, this.inputType = null, this.className = "", e !== null && (e instanceof HTMLDivElement || e instanceof HTMLSpanElement || e instanceof HTMLInputElement)) {
|
|
714
715
|
this.className = e.className, this.action = e.getAttribute("data-ge-action"), this.inputType = e.getAttribute("data-input-type"), this.rowIdx = Number(e.getAttribute("data-row-index")), this.colIdx = Number(e.getAttribute("data-col-index"));
|
|
@@ -720,7 +721,7 @@ class $e {
|
|
|
720
721
|
}
|
|
721
722
|
}
|
|
722
723
|
}
|
|
723
|
-
class
|
|
724
|
+
class _e {
|
|
724
725
|
constructor(e) {
|
|
725
726
|
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(
|
|
726
727
|
(t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
|
|
@@ -732,12 +733,12 @@ class He {
|
|
|
732
733
|
this.tableScope.contextmenu(t);
|
|
733
734
|
}
|
|
734
735
|
onHostElementClicked(e) {
|
|
735
|
-
const t = new
|
|
736
|
+
const t = new ke(e.target, this.tableScope);
|
|
736
737
|
if (t.action === "toggleExpandCollapseAll")
|
|
737
738
|
this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
|
|
738
739
|
else if (t.inputType === "checkbox" && t.areaIdent)
|
|
739
740
|
this.tableScope.toggleRowCheckbox(t.rowIdx, t.colIdx, t.areaIdent), e.preventDefault(), e.stopPropagation();
|
|
740
|
-
else if (t.row
|
|
741
|
+
else if (Z(t.row) && t.areaModel) {
|
|
741
742
|
const s = t.colIdx === this.getArrowColumnIndex() && e.altKey, i = t.className.includes("ge-table-tree-arrow-div");
|
|
742
743
|
if (console.info(i, s), s || i) {
|
|
743
744
|
e.preventDefault(), e.stopPropagation();
|
|
@@ -753,15 +754,15 @@ class He {
|
|
|
753
754
|
}
|
|
754
755
|
onHostElementDblClicked(e) {
|
|
755
756
|
if (e.target instanceof HTMLElement) {
|
|
756
|
-
const t = e.target, s = t.getAttribute("data-area"), i = ie(s), o = Number(t.getAttribute("data-row-index")),
|
|
757
|
+
const t = e.target, s = t.getAttribute("data-area"), i = ie(s), o = Number(t.getAttribute("data-row-index")), n = Number(t.getAttribute("data-col-index")), r = this.tableScope.tableModel.getAreaModel(i);
|
|
757
758
|
if (s && i === "header")
|
|
758
|
-
this.tableScope.tableModel.isSortable(
|
|
759
|
+
this.tableScope.tableModel.isSortable(n) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, o, n));
|
|
759
760
|
else if (t.getAttribute("data-row-index")) {
|
|
760
|
-
const a =
|
|
761
|
-
if (s && i === "body" &&
|
|
761
|
+
const a = r.getRowByIndex(o);
|
|
762
|
+
if (s && i === "body" && r.isEditable(o, n) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, n)), Z(a) && n === this.getArrowColumnIndex()) {
|
|
762
763
|
e.preventDefault(), e.stopPropagation();
|
|
763
764
|
const h = a;
|
|
764
|
-
h.expanded = !h.expanded, "recalcVisibleTreeRows" in
|
|
765
|
+
h.expanded = !h.expanded, "recalcVisibleTreeRows" in r && r.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(h);
|
|
765
766
|
}
|
|
766
767
|
}
|
|
767
768
|
}
|
|
@@ -772,11 +773,11 @@ class He {
|
|
|
772
773
|
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);
|
|
773
774
|
}
|
|
774
775
|
updateCollapsedExpandedState(e) {
|
|
775
|
-
var s, i, o,
|
|
776
|
+
var s, i, o, n, r;
|
|
776
777
|
const t = (i = (s = this.tableScope.tableOptions) == null ? void 0 : s.autoRestoreOptions) == null ? void 0 : i.getRowId;
|
|
777
778
|
if (t) {
|
|
778
779
|
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);
|
|
779
|
-
h ? (
|
|
780
|
+
h ? (n = this.tableScope.storeStateCollapsedExpandService) == null || n.collapsedStateIdsPush(c) : d && ((r = this.tableScope.storeStateCollapsedExpandService) == null || r.collapsedStateIdsRemove(c));
|
|
780
781
|
}
|
|
781
782
|
}
|
|
782
783
|
getArrowColumnIndex() {
|
|
@@ -812,7 +813,7 @@ class He {
|
|
|
812
813
|
}
|
|
813
814
|
}
|
|
814
815
|
}
|
|
815
|
-
class
|
|
816
|
+
class Ge {
|
|
816
817
|
constructor(e) {
|
|
817
818
|
this.tableScope = e;
|
|
818
819
|
}
|
|
@@ -845,230 +846,6 @@ class Ve {
|
|
|
845
846
|
this.tableScope.repaint();
|
|
846
847
|
}
|
|
847
848
|
}
|
|
848
|
-
class _e {
|
|
849
|
-
flattenTree(e, t = []) {
|
|
850
|
-
var s;
|
|
851
|
-
for (const i of e)
|
|
852
|
-
this.isVisible(i) && t.push(i), (s = i.children) != null && s.length && this.flattenTree(i.children, t);
|
|
853
|
-
return t;
|
|
854
|
-
}
|
|
855
|
-
isVisible(e) {
|
|
856
|
-
return e.parent ? e.parent.expanded ? this.isVisible(e.parent) : !1 : !0;
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
class We {
|
|
860
|
-
constructor(e, t = [], s = -1) {
|
|
861
|
-
this.areaIdent = e, this.columnDefs = t, this.defaultRowHeight = s, this.rowSelectionModel = void 0, this.yPositions = [], this.cellRenderers = t.map((i) => i.rendererMap[e]);
|
|
862
|
-
}
|
|
863
|
-
getTooltipAt(e, t) {
|
|
864
|
-
return "";
|
|
865
|
-
}
|
|
866
|
-
getCellRenderer(e, t) {
|
|
867
|
-
if (t < this.cellRenderers.length)
|
|
868
|
-
return this.cellRenderers[t];
|
|
869
|
-
}
|
|
870
|
-
getColspanAt(e, t) {
|
|
871
|
-
return 0;
|
|
872
|
-
}
|
|
873
|
-
getCustomClassesAt(e, t) {
|
|
874
|
-
return [];
|
|
875
|
-
}
|
|
876
|
-
getCustomStyleAt(e, t) {
|
|
877
|
-
}
|
|
878
|
-
getRowspanAt(e, t) {
|
|
879
|
-
return 0;
|
|
880
|
-
}
|
|
881
|
-
getRowByIndex(e) {
|
|
882
|
-
}
|
|
883
|
-
isRowCheckable(e) {
|
|
884
|
-
return !0;
|
|
885
|
-
}
|
|
886
|
-
isRowChecked(e) {
|
|
887
|
-
var s;
|
|
888
|
-
const t = this.getRowByIndex(e);
|
|
889
|
-
return (s = this.rowSelectionModel) == null ? void 0 : s.isRowChecked(t);
|
|
890
|
-
}
|
|
891
|
-
setRowChecked(e, t) {
|
|
892
|
-
if (this.rowSelectionModel) {
|
|
893
|
-
const s = this.getRowByIndex(e);
|
|
894
|
-
this.rowSelectionModel.checkRow(s, t);
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
getMaxColspan() {
|
|
898
|
-
return 31;
|
|
899
|
-
}
|
|
900
|
-
getMaxRowspan() {
|
|
901
|
-
return 31;
|
|
902
|
-
}
|
|
903
|
-
getYPosByRowIndex(e) {
|
|
904
|
-
return this.defaultRowHeight > 0 ? this.defaultRowHeight * e : this.yPositions[e];
|
|
905
|
-
}
|
|
906
|
-
init() {
|
|
907
|
-
!this.yPositions.length && this.getRowCount() !== void 0 && this.defaultRowHeight === -1 && this.calcYPositions();
|
|
908
|
-
}
|
|
909
|
-
isFilterable() {
|
|
910
|
-
return this.areaIdent === "body";
|
|
911
|
-
}
|
|
912
|
-
doSort(e) {
|
|
913
|
-
return !1;
|
|
914
|
-
}
|
|
915
|
-
isEditable(e, t) {
|
|
916
|
-
return this.columnDefs && t < this.columnDefs.length && this.columnDefs[t].editable ? this.columnDefs[t].editable() : !1;
|
|
917
|
-
}
|
|
918
|
-
setValue(e, t, s) {
|
|
919
|
-
var n;
|
|
920
|
-
const i = (n = this.columnDefs[t]) == null ? void 0 : n.editInputPipe;
|
|
921
|
-
i && (s = i(s, e, t));
|
|
922
|
-
const o = this.getRowByIndex(e), r = this.columnDefs[t].property;
|
|
923
|
-
return r.includes(".") ? this.setPropertyValue(o, r.split("."), s) : (o[r] = s, !0);
|
|
924
|
-
}
|
|
925
|
-
isSelectable(e, t) {
|
|
926
|
-
return !0;
|
|
927
|
-
}
|
|
928
|
-
changeColumnOrder(e, t) {
|
|
929
|
-
this.arrayMove(this.cellRenderers, e, t);
|
|
930
|
-
}
|
|
931
|
-
setPropertyValue(e, t, s) {
|
|
932
|
-
const i = t.shift();
|
|
933
|
-
if (i) {
|
|
934
|
-
let o = e[i];
|
|
935
|
-
return o && t.length ? this.setPropertyValue(o, t, s) : (e[i] = s, !0);
|
|
936
|
-
}
|
|
937
|
-
return !1;
|
|
938
|
-
}
|
|
939
|
-
arrayMove(e, t, s) {
|
|
940
|
-
const i = e.splice(t, 1)[0];
|
|
941
|
-
return e.splice(s, 0, i), e;
|
|
942
|
-
}
|
|
943
|
-
calcYPositions() {
|
|
944
|
-
const e = this.getRowCount();
|
|
945
|
-
this.yPositions = new Array(e + 1), this.yPositions[0] = 0;
|
|
946
|
-
for (let t = 0; t < e; t++)
|
|
947
|
-
this.yPositions[t + 1] = this.getRowHeight(t) + this.yPositions[t];
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
class ke {
|
|
951
|
-
genericSortComparator(e, t, s) {
|
|
952
|
-
if (typeof e == "number" && typeof t == "number")
|
|
953
|
-
return s * (e - t);
|
|
954
|
-
if (typeof e == "string" && typeof t == "string")
|
|
955
|
-
return s * e.localeCompare(t);
|
|
956
|
-
if (typeof e == "boolean" && typeof t == "boolean")
|
|
957
|
-
return s * ((e ? -1 : 1) - (t ? -1 : 1));
|
|
958
|
-
if (e instanceof Date && t instanceof Date)
|
|
959
|
-
return s * (e.getTime() - t.getTime());
|
|
960
|
-
if (e instanceof Array && t instanceof Array) {
|
|
961
|
-
const i = e, o = t;
|
|
962
|
-
if (i.length && o.length)
|
|
963
|
-
return this.genericSortComparator(i[0], o[0], s);
|
|
964
|
-
}
|
|
965
|
-
return s * ("" + e).localeCompare("" + t);
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
class ee extends We {
|
|
969
|
-
constructor(e, t, s, i = []) {
|
|
970
|
-
super(e, i, s), this.areaIdent = e, this.rows = t, this.defaultRowHeight = s, this.columnDefs = i, this.sorterService = new ke(), this.service = new _e(), this.properties = i.map((o) => o.property), this.flattenRows = this.service.flattenTree(t), this.filteredFlattenRows = [...this.flattenRows];
|
|
971
|
-
}
|
|
972
|
-
changeColumnOrder(e, t) {
|
|
973
|
-
this.arrayMove(this.properties, e, t), super.changeColumnOrder(e, t);
|
|
974
|
-
}
|
|
975
|
-
recalcVisibleTreeRows() {
|
|
976
|
-
this.filteredFlattenRows = this.service.flattenTree(this.rows);
|
|
977
|
-
}
|
|
978
|
-
getFilteredFlattenRows() {
|
|
979
|
-
return this.filteredFlattenRows;
|
|
980
|
-
}
|
|
981
|
-
getRowCount() {
|
|
982
|
-
let e = 0;
|
|
983
|
-
for (const t of this.filteredFlattenRows)
|
|
984
|
-
this.service.isVisible(t) && e++;
|
|
985
|
-
return e;
|
|
986
|
-
}
|
|
987
|
-
getValueAt(e, t) {
|
|
988
|
-
const s = this.getRowByIndex(e);
|
|
989
|
-
if (s) {
|
|
990
|
-
const i = this.properties[t];
|
|
991
|
-
if (i)
|
|
992
|
-
return i.includes(".") ? this.getPropertyValue(s.data, i.split(".")) : s.data[i];
|
|
993
|
-
}
|
|
994
|
-
return "";
|
|
995
|
-
}
|
|
996
|
-
getRowHeight(e) {
|
|
997
|
-
return this.defaultRowHeight;
|
|
998
|
-
}
|
|
999
|
-
getCustomClassesAt(e, t) {
|
|
1000
|
-
return ["ge-table-tree-cell", "ge-table-tree-deep-" + this.filteredFlattenRows[e].deep];
|
|
1001
|
-
}
|
|
1002
|
-
getRowByIndex(e) {
|
|
1003
|
-
return this.filteredFlattenRows[e];
|
|
1004
|
-
}
|
|
1005
|
-
getValueByT(e, t) {
|
|
1006
|
-
return t.includes(".") ? this.getPropertyValue(e, t.split(".")) : e[t];
|
|
1007
|
-
}
|
|
1008
|
-
externalFilterChanged(e) {
|
|
1009
|
-
this.lastPredictFn = e, this.doFiltering();
|
|
1010
|
-
}
|
|
1011
|
-
doSort(e) {
|
|
1012
|
-
const { columnIndex: t, sortState: s } = e[e.length - 1], i = s === "asc" ? 1 : s === "desc" ? -1 : 0, o = this.properties[t];
|
|
1013
|
-
return this.treeSort(this.rows, o, i), this.flattenRows = this.service.flattenTree(this.rows), this.filteredFlattenRows = [...this.flattenRows], !0;
|
|
1014
|
-
}
|
|
1015
|
-
toggleExpandCollapseAll(e) {
|
|
1016
|
-
this.expandAllRecursive(this.rows, e), this.flattenRows = this.service.flattenTree(this.rows), this.doFiltering();
|
|
1017
|
-
}
|
|
1018
|
-
setAllParentsOk(e) {
|
|
1019
|
-
return e.parent && (e.parent.keep = !0, this.setAllParentsOk(e.parent)), !1;
|
|
1020
|
-
}
|
|
1021
|
-
setValue(e, t, s) {
|
|
1022
|
-
var r;
|
|
1023
|
-
const i = (r = this.columnDefs[t]) == null ? void 0 : r.editInputPipe;
|
|
1024
|
-
i && (s = i(s, e, t));
|
|
1025
|
-
const o = this.getRowByIndex(e);
|
|
1026
|
-
if (o) {
|
|
1027
|
-
const n = o.data, a = this.columnDefs[t].property;
|
|
1028
|
-
return a.includes(".") ? this.setPropertyValue(n, a.split("."), s) : (n[a] = s, !0);
|
|
1029
|
-
}
|
|
1030
|
-
return !1;
|
|
1031
|
-
}
|
|
1032
|
-
genericTreeTableSortComparator(e, t) {
|
|
1033
|
-
return (s, i) => {
|
|
1034
|
-
const o = this.getValueByT(s.data, e), r = this.getValueByT(i.data, e);
|
|
1035
|
-
return this.sorterService.genericSortComparator(o, r, t);
|
|
1036
|
-
};
|
|
1037
|
-
}
|
|
1038
|
-
expandAllRecursive(e, t) {
|
|
1039
|
-
for (const s of e)
|
|
1040
|
-
s.expanded = t, s.children && this.expandAllRecursive(s.children, t);
|
|
1041
|
-
}
|
|
1042
|
-
doFiltering() {
|
|
1043
|
-
if (!this.lastPredictFn)
|
|
1044
|
-
this.filteredFlattenRows = [...this.flattenRows ? this.flattenRows : []];
|
|
1045
|
-
else {
|
|
1046
|
-
this.flattenRows || (this.flattenRows = []);
|
|
1047
|
-
let e = 0;
|
|
1048
|
-
this.flattenRows.forEach((s) => {
|
|
1049
|
-
e = Math.max(e, s.deep);
|
|
1050
|
-
});
|
|
1051
|
-
const t = this.flattenRows.filter(
|
|
1052
|
-
(s, i, o) => this.lastPredictFn(s, i, o)
|
|
1053
|
-
);
|
|
1054
|
-
this.flattenRows.forEach((s) => s.keep = !1), this.flattenRows.forEach((s) => {
|
|
1055
|
-
t.includes(s) && (s.keep = !0, this.setAllParentsOk(s));
|
|
1056
|
-
}), this.filteredFlattenRows = this.flattenRows.filter(
|
|
1057
|
-
(s, i, o) => s.keep
|
|
1058
|
-
);
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
getPropertyValue(e, t) {
|
|
1062
|
-
const s = t.shift();
|
|
1063
|
-
let i = e[s];
|
|
1064
|
-
return i && t.length ? this.getPropertyValue(i, t) : i;
|
|
1065
|
-
}
|
|
1066
|
-
treeSort(e, t, s) {
|
|
1067
|
-
e.sort(this.genericTreeTableSortComparator(t, s));
|
|
1068
|
-
for (const i of e)
|
|
1069
|
-
i.children && this.treeSort(i.children, t, s);
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
849
|
class oe {
|
|
1073
850
|
constructor(e) {
|
|
1074
851
|
this.getStorageKeyFn = e;
|
|
@@ -1080,9 +857,9 @@ class oe {
|
|
|
1080
857
|
for (const i of [...s]) {
|
|
1081
858
|
const [
|
|
1082
859
|
o,
|
|
1083
|
-
|
|
860
|
+
n
|
|
1084
861
|
] = i;
|
|
1085
|
-
t[o] =
|
|
862
|
+
t[o] = n;
|
|
1086
863
|
}
|
|
1087
864
|
}
|
|
1088
865
|
return t;
|
|
@@ -1094,8 +871,8 @@ class oe {
|
|
|
1094
871
|
if (i) {
|
|
1095
872
|
const o = i + e;
|
|
1096
873
|
if ((t + "").includes("Map")) {
|
|
1097
|
-
const
|
|
1098
|
-
this.persistItem(o,
|
|
874
|
+
const n = this.autoConvertMapToObject(t);
|
|
875
|
+
this.persistItem(o, n);
|
|
1099
876
|
} else
|
|
1100
877
|
this.persistItem(o, t);
|
|
1101
878
|
}
|
|
@@ -1144,7 +921,7 @@ class oe {
|
|
|
1144
921
|
// }
|
|
1145
922
|
// }
|
|
1146
923
|
}
|
|
1147
|
-
class
|
|
924
|
+
class Ne extends oe {
|
|
1148
925
|
constructor(e) {
|
|
1149
926
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
1150
927
|
}
|
|
@@ -1166,14 +943,14 @@ class Ge extends oe {
|
|
|
1166
943
|
}
|
|
1167
944
|
}
|
|
1168
945
|
}
|
|
1169
|
-
class
|
|
946
|
+
class je {
|
|
1170
947
|
constructor(e = "collapsed", t = [], s = !1, i = !1) {
|
|
1171
948
|
this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = i;
|
|
1172
949
|
}
|
|
1173
950
|
}
|
|
1174
|
-
class
|
|
951
|
+
class ze extends oe {
|
|
1175
952
|
constructor(e) {
|
|
1176
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
953
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new je(), this.load();
|
|
1177
954
|
}
|
|
1178
955
|
collapsedExpandedStateGet() {
|
|
1179
956
|
return this.collapsedExpandedState;
|
|
@@ -1205,7 +982,7 @@ class je extends oe {
|
|
|
1205
982
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
1206
983
|
}
|
|
1207
984
|
}
|
|
1208
|
-
class
|
|
985
|
+
class Xe extends oe {
|
|
1209
986
|
constructor(e) {
|
|
1210
987
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
1211
988
|
}
|
|
@@ -1227,14 +1004,14 @@ class ze extends oe {
|
|
|
1227
1004
|
}
|
|
1228
1005
|
}
|
|
1229
1006
|
}
|
|
1230
|
-
class
|
|
1007
|
+
class O {
|
|
1231
1008
|
constructor(e = 0, t = 0, s = 0, i = 0, o) {
|
|
1232
1009
|
this.left = e, this.width = t, this.height = s, this.top = i, this.index = o;
|
|
1233
1010
|
}
|
|
1234
1011
|
}
|
|
1235
|
-
class
|
|
1012
|
+
class Ke {
|
|
1236
1013
|
constructor(e, t, s, i) {
|
|
1237
|
-
this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = i, this.scrollTop = 0, this.areaBodyWestGeo = new
|
|
1014
|
+
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();
|
|
1238
1015
|
const o = this.hostElement;
|
|
1239
1016
|
o.innerText = "", this.dom.setAttribute(o, "tabindex", "0"), this.dom.setStyle(
|
|
1240
1017
|
this.dom.addClass("ge-table", o),
|
|
@@ -1409,7 +1186,7 @@ class T {
|
|
|
1409
1186
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
1410
1187
|
}
|
|
1411
1188
|
}
|
|
1412
|
-
class
|
|
1189
|
+
class Ye {
|
|
1413
1190
|
constructor(e, t) {
|
|
1414
1191
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
1415
1192
|
}
|
|
@@ -1420,12 +1197,12 @@ class Ke {
|
|
|
1420
1197
|
const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
|
|
1421
1198
|
for (let s = 0; s < e; s++)
|
|
1422
1199
|
for (let i = 0; i < t; i++) {
|
|
1423
|
-
let o = this.areaModel.getColspanAt(s, i),
|
|
1424
|
-
if (o > 1 ||
|
|
1425
|
-
o === 0 && (o = 1),
|
|
1426
|
-
const
|
|
1200
|
+
let o = this.areaModel.getColspanAt(s, i), n = this.areaModel.getRowspanAt(s, i);
|
|
1201
|
+
if (o > 1 || n > 1) {
|
|
1202
|
+
o === 0 && (o = 1), n === 0 && (n = 1);
|
|
1203
|
+
const r = this.areaModel.hasOwnProperty("gammaCells");
|
|
1427
1204
|
this.colAndRowspanRanges.push(
|
|
1428
|
-
new T(s, i, s +
|
|
1205
|
+
new T(s, i, s + n - 1, i + o - 1, r)
|
|
1429
1206
|
);
|
|
1430
1207
|
}
|
|
1431
1208
|
}
|
|
@@ -1442,22 +1219,22 @@ class Ke {
|
|
|
1442
1219
|
return !1;
|
|
1443
1220
|
}
|
|
1444
1221
|
}
|
|
1445
|
-
class
|
|
1222
|
+
class Ue {
|
|
1446
1223
|
constructor(e, t, s) {
|
|
1447
1224
|
this.header = e, this.body = t, this.footer = s;
|
|
1448
1225
|
}
|
|
1449
1226
|
}
|
|
1450
|
-
class
|
|
1227
|
+
class qe extends Ke {
|
|
1451
1228
|
constructor(e, t, s, i) {
|
|
1452
|
-
var
|
|
1229
|
+
var n, r;
|
|
1453
1230
|
super(e, t, s, i), this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
1454
1231
|
header: [],
|
|
1455
1232
|
body: [],
|
|
1456
1233
|
footer: []
|
|
1457
|
-
}, this.tree = !1, this.colAndRowspanModels = new
|
|
1234
|
+
}, this.tree = !1, this.colAndRowspanModels = new Ue(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.editing = !1, this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (n = this.tableOptions) != null && n.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (r = this.tableOptions) != null && r.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), ee(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
1458
1235
|
(a) => {
|
|
1459
1236
|
var h;
|
|
1460
|
-
this.colAndRowspanModels[a] = new
|
|
1237
|
+
this.colAndRowspanModels[a] = new Ye(t, t.getAreaModel(a)), (h = this.colAndRowspanModels[a]) == null || h.init();
|
|
1461
1238
|
}
|
|
1462
1239
|
);
|
|
1463
1240
|
}
|
|
@@ -1492,19 +1269,19 @@ class Ue extends Xe {
|
|
|
1492
1269
|
for (const t of this.removables)
|
|
1493
1270
|
t.remove();
|
|
1494
1271
|
this.hideHoverRow(), this.hideHoverColumn(), this.scrollTop = this.scrollViewport.scrollTop, this.scrollLeft = this.scrollViewport.scrollLeft, this.debounce(this.checkForScrollPosSaving.bind(this)), this.scrollFactorY = this.scrollTop / (this.scrollViewport.scrollHeight - this.scrollViewport.clientHeight), this.scrollFactorX = this.scrollLeft / (this.scrollViewport.scrollWidth - this.scrollViewport.clientWidth), isNaN(this.scrollFactorY) && (this.scrollFactorY = 0), isNaN(this.scrollFactorX) && (this.scrollFactorX = 0), this.adjustBody(), this.adjustArea("footer"), this.adjustArea("header"), this.tableOptions.tableTopBorderVisible && this.removables.push(this.dom.addHorizontalBorder(
|
|
1495
|
-
new
|
|
1272
|
+
new O(0, this.hostElement.clientWidth, 1, 0),
|
|
1496
1273
|
this.hostElement,
|
|
1497
1274
|
"ge-table-border"
|
|
1498
1275
|
)), this.tableOptions.tableBottomBorderVisible && this.removables.push(this.dom.addHorizontalBorder(
|
|
1499
|
-
new
|
|
1276
|
+
new O(0, this.hostElement.clientWidth, 1, this.hostElement.clientHeight - 1),
|
|
1500
1277
|
this.hostElement,
|
|
1501
1278
|
"ge-table-border"
|
|
1502
1279
|
)), this.tableModel.getFixedLeftColumnCount() > 0 && this.removables.push(this.dom.addVerticalBorder(
|
|
1503
|
-
new
|
|
1280
|
+
new O(this.areaBodyWest.child.clientWidth, 1, this.hostElement.clientHeight, 0),
|
|
1504
1281
|
this.hostElement,
|
|
1505
1282
|
"ge-table-body-west-vertical-border"
|
|
1506
1283
|
)), ((e = this.tableModel.getAreaModel("header")) == null ? void 0 : e.getRowCount()) > 0 && this.removables.push(this.dom.addHorizontalBorder(
|
|
1507
|
-
new
|
|
1284
|
+
new O(0, this.hostElement.clientWidth, 1, this.areaHeaderCenter.child.clientHeight),
|
|
1508
1285
|
this.hostElement,
|
|
1509
1286
|
"ge-table-body-west-vertical-border"
|
|
1510
1287
|
));
|
|
@@ -1575,86 +1352,86 @@ class Ue extends Xe {
|
|
|
1575
1352
|
}
|
|
1576
1353
|
adjustArea(e, t = 0) {
|
|
1577
1354
|
var f;
|
|
1578
|
-
const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"),
|
|
1355
|
+
const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"), n = i.child.clientHeight;
|
|
1579
1356
|
s.child.innerText = "", i.child.innerText = "", o.child.innerText = "";
|
|
1580
|
-
const
|
|
1357
|
+
const r = 0, a = this.areaBodyCenterGeo.width, h = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), c = d.getRowCount();
|
|
1581
1358
|
for (; this.cleanupFunctions[e].length; ) {
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1359
|
+
const S = this.cleanupFunctions[e].shift();
|
|
1360
|
+
S && S();
|
|
1584
1361
|
}
|
|
1585
1362
|
let p = t;
|
|
1586
|
-
const
|
|
1587
|
-
for (let
|
|
1588
|
-
const x = p, C =
|
|
1589
|
-
if (x +
|
|
1590
|
-
this.firstVisibleRowIndex =
|
|
1591
|
-
let
|
|
1592
|
-
const
|
|
1363
|
+
const g = this.tableModel.getColumnCount(), u = this.tableModel.getFixedRightColumnCount(), y = this.tableModel.getFixedLeftColumnCount();
|
|
1364
|
+
for (let S = 0; S < c; S++) {
|
|
1365
|
+
const x = p, C = S === c - 1, M = this.tableModel.getRowHeight(e, S);
|
|
1366
|
+
if (x + M > 0) {
|
|
1367
|
+
this.firstVisibleRowIndex = S;
|
|
1368
|
+
let w = { left: r, width: a, height: M, top: x, index: S }, m = this.dom.addRowDiv(i, w, S, e, "center");
|
|
1369
|
+
const I = y;
|
|
1593
1370
|
if (this.adjustColumnsToRowParent({
|
|
1594
1371
|
areaIdent: e,
|
|
1595
1372
|
sideIdent: "center",
|
|
1596
1373
|
areaModel: d,
|
|
1597
|
-
geo:
|
|
1374
|
+
geo: w,
|
|
1598
1375
|
parent: m,
|
|
1599
|
-
rowIndex:
|
|
1600
|
-
columnIndexStart:
|
|
1601
|
-
columnIndexEnd:
|
|
1376
|
+
rowIndex: S,
|
|
1377
|
+
columnIndexStart: I,
|
|
1378
|
+
columnIndexEnd: g - u - 1,
|
|
1602
1379
|
verticalFixed: !1,
|
|
1603
1380
|
lastRowOfModel: C
|
|
1604
|
-
}), h.left > 0 && (
|
|
1381
|
+
}), h.left > 0 && (w = { left: r, width: this.areaBodyWestGeo.width, height: M, top: x, index: S }, m = this.dom.addRowDiv(s, w, S, e, "west"), this.adjustColumnsToRowParent({
|
|
1605
1382
|
areaIdent: e,
|
|
1606
1383
|
sideIdent: "west",
|
|
1607
1384
|
areaModel: d,
|
|
1608
|
-
geo:
|
|
1385
|
+
geo: w,
|
|
1609
1386
|
parent: m,
|
|
1610
|
-
rowIndex:
|
|
1387
|
+
rowIndex: S,
|
|
1611
1388
|
columnIndexStart: 0,
|
|
1612
|
-
columnIndexEnd:
|
|
1389
|
+
columnIndexEnd: I - 1,
|
|
1613
1390
|
verticalFixed: !0,
|
|
1614
1391
|
lastRowOfModel: C
|
|
1615
|
-
})), h.right > 0 && (
|
|
1392
|
+
})), h.right > 0 && (w = { left: r, width: this.areaBodyEastGeo.width, height: M, top: x, index: S }, m = this.dom.addRowDiv(o, w, S, e, "east"), this.adjustColumnsToRowParent({
|
|
1616
1393
|
areaIdent: e,
|
|
1617
1394
|
sideIdent: "east",
|
|
1618
1395
|
areaModel: d,
|
|
1619
|
-
geo:
|
|
1396
|
+
geo: w,
|
|
1620
1397
|
parent: m,
|
|
1621
|
-
rowIndex:
|
|
1622
|
-
columnIndexStart:
|
|
1623
|
-
columnIndexEnd:
|
|
1398
|
+
rowIndex: S,
|
|
1399
|
+
columnIndexStart: g - u,
|
|
1400
|
+
columnIndexEnd: g - 1,
|
|
1624
1401
|
verticalFixed: !0,
|
|
1625
1402
|
lastRowOfModel: C
|
|
1626
|
-
})), e === "header" && this.tree &&
|
|
1627
|
-
const
|
|
1403
|
+
})), e === "header" && this.tree && S === c - 1) {
|
|
1404
|
+
const R = this.dom.applyStyle(
|
|
1628
1405
|
this.dom.setAttribute(
|
|
1629
|
-
this.dom.addDiv(m, new
|
|
1406
|
+
this.dom.addDiv(m, new O(16, 20, 20, 8)),
|
|
1630
1407
|
"data-ge-action",
|
|
1631
1408
|
"toggleExpandCollapseAll"
|
|
1632
1409
|
),
|
|
1633
1410
|
{ cursor: "pointer" }
|
|
1634
|
-
),
|
|
1635
|
-
if (
|
|
1636
|
-
const
|
|
1637
|
-
this.dom.domService.appendChild(
|
|
1411
|
+
), D = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1412
|
+
if (D) {
|
|
1413
|
+
const V = this.dom.domService.createText(D.content);
|
|
1414
|
+
this.dom.domService.appendChild(R, V), D.style && this.dom.applyStyleString(R, D.style);
|
|
1638
1415
|
}
|
|
1639
1416
|
}
|
|
1640
1417
|
}
|
|
1641
|
-
if (p = p +
|
|
1418
|
+
if (p = p + M, p > n)
|
|
1642
1419
|
break;
|
|
1643
1420
|
}
|
|
1644
1421
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1645
|
-
const
|
|
1646
|
-
if (
|
|
1647
|
-
for (const x of
|
|
1648
|
-
let C = 0,
|
|
1422
|
+
const S = ((f = this.colAndRowspanModels[e]) == null ? void 0 : f.getRanges()) ?? [];
|
|
1423
|
+
if (S.length)
|
|
1424
|
+
for (const x of S) {
|
|
1425
|
+
let C = 0, M = i.child, w = "center";
|
|
1649
1426
|
if (x.c1 < y)
|
|
1650
|
-
|
|
1651
|
-
else if (u > 0 && x.c1 >=
|
|
1652
|
-
|
|
1427
|
+
M = s.child, w = "west";
|
|
1428
|
+
else if (u > 0 && x.c1 >= g - u)
|
|
1429
|
+
M = o.child, w = "east";
|
|
1653
1430
|
else {
|
|
1654
1431
|
const m = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1655
|
-
C = this.scrollFactorX * m - this.areaBodyWestGeo.width,
|
|
1432
|
+
C = this.scrollFactorX * m - this.areaBodyWestGeo.width, w = "center";
|
|
1656
1433
|
}
|
|
1657
|
-
this.drawBigCell(x, C, t, d,
|
|
1434
|
+
this.drawBigCell(x, C, t, d, M, w);
|
|
1658
1435
|
}
|
|
1659
1436
|
}
|
|
1660
1437
|
}
|
|
@@ -1668,22 +1445,22 @@ class Ue extends Xe {
|
|
|
1668
1445
|
* @param sideIdent SideIdent (west,center,east)
|
|
1669
1446
|
* @protected
|
|
1670
1447
|
*/
|
|
1671
|
-
drawBigCell(e, t, s, i, o,
|
|
1672
|
-
const
|
|
1448
|
+
drawBigCell(e, t, s, i, o, n) {
|
|
1449
|
+
const r = s + this.getRowHeights(0, e.r1 - 1, i).reduce((f, S) => f + S, 0), a = this.tableModel.getColumnCount(), h = this.tableModel.getFixedRightColumnCount();
|
|
1673
1450
|
let d = 0;
|
|
1674
1451
|
h > 0 && e.c1 >= a - h && (d = a - h);
|
|
1675
|
-
const c = t + this.getColumnWidths(d, e.c1 - 1).reduce((f,
|
|
1452
|
+
const c = t + this.getColumnWidths(d, e.c1 - 1).reduce((f, S) => f + S, 0), p = this.getRowHeights(e.r1, e.r2, i).reduce((f, S) => f + S, 0), g = this.getColumnWidths(e.c1, e.c2).reduce((f, S) => f + S, 0);
|
|
1676
1453
|
let u = !1;
|
|
1677
1454
|
const y = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
1678
1455
|
y && (u = y.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? (console.info("TODO here", e), this.renderCell({
|
|
1679
1456
|
areaModel: i,
|
|
1680
1457
|
areaIdent: i.areaIdent,
|
|
1681
|
-
sideIdent:
|
|
1458
|
+
sideIdent: n,
|
|
1682
1459
|
rowIndex: e.r1,
|
|
1683
1460
|
columnIndex: e.c1,
|
|
1684
1461
|
left: c,
|
|
1685
|
-
top:
|
|
1686
|
-
width:
|
|
1462
|
+
top: r,
|
|
1463
|
+
width: g,
|
|
1687
1464
|
height: p,
|
|
1688
1465
|
parent: o,
|
|
1689
1466
|
cellSelected: u,
|
|
@@ -1692,12 +1469,12 @@ class Ue extends Xe {
|
|
|
1692
1469
|
})) : this.renderCell({
|
|
1693
1470
|
areaModel: i,
|
|
1694
1471
|
areaIdent: i.areaIdent,
|
|
1695
|
-
sideIdent:
|
|
1472
|
+
sideIdent: n,
|
|
1696
1473
|
rowIndex: e.r1,
|
|
1697
1474
|
columnIndex: e.c1,
|
|
1698
1475
|
left: c,
|
|
1699
|
-
top:
|
|
1700
|
-
width:
|
|
1476
|
+
top: r,
|
|
1477
|
+
width: g,
|
|
1701
1478
|
height: p,
|
|
1702
1479
|
parent: o,
|
|
1703
1480
|
cellSelected: u,
|
|
@@ -1707,8 +1484,8 @@ class Ue extends Xe {
|
|
|
1707
1484
|
rowIndex: e.r1,
|
|
1708
1485
|
columnIndex: e.c1,
|
|
1709
1486
|
cellLeft: c,
|
|
1710
|
-
cellTop:
|
|
1711
|
-
cellWidth:
|
|
1487
|
+
cellTop: r,
|
|
1488
|
+
cellWidth: g,
|
|
1712
1489
|
cellHeight: p,
|
|
1713
1490
|
parent: o
|
|
1714
1491
|
});
|
|
@@ -1716,8 +1493,8 @@ class Ue extends Xe {
|
|
|
1716
1493
|
findRowOfImportantRowspanCell(e, t, s) {
|
|
1717
1494
|
const i = e.getMaxRowspan();
|
|
1718
1495
|
for (let o = t - 1; o > -1; o--) {
|
|
1719
|
-
const
|
|
1720
|
-
if (
|
|
1496
|
+
const n = e.getRowspanAt(o, s);
|
|
1497
|
+
if (n > 1 && o + n + 1 >= t)
|
|
1721
1498
|
return o;
|
|
1722
1499
|
if (t - o > i)
|
|
1723
1500
|
return -1;
|
|
@@ -1730,8 +1507,8 @@ class Ue extends Xe {
|
|
|
1730
1507
|
areaModel: s,
|
|
1731
1508
|
geo: i,
|
|
1732
1509
|
parent: o,
|
|
1733
|
-
rowIndex:
|
|
1734
|
-
columnIndexStart:
|
|
1510
|
+
rowIndex: n,
|
|
1511
|
+
columnIndexStart: r,
|
|
1735
1512
|
columnIndexEnd: a,
|
|
1736
1513
|
verticalFixed: h = !1,
|
|
1737
1514
|
lastRowOfModel: d = !1
|
|
@@ -1743,41 +1520,41 @@ class Ue extends Xe {
|
|
|
1743
1520
|
const f = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1744
1521
|
c = this.scrollFactorX * f;
|
|
1745
1522
|
}
|
|
1746
|
-
const p = 0,
|
|
1523
|
+
const p = 0, g = !!(e === "body" && t);
|
|
1747
1524
|
let u = c;
|
|
1748
|
-
for (let f =
|
|
1749
|
-
const
|
|
1750
|
-
if (x > 0 &&
|
|
1525
|
+
for (let f = r; f <= a; f++) {
|
|
1526
|
+
const S = u, x = this.tableModel.getColumnWidth(f);
|
|
1527
|
+
if (x > 0 && S + x > 0) {
|
|
1751
1528
|
let C = i.height;
|
|
1752
|
-
const
|
|
1753
|
-
|
|
1529
|
+
const M = s.getRowspanAt(n, f), w = s.getColspanAt(n, f);
|
|
1530
|
+
M > 1 && (C = this.getRowHeights(n, n + M - 1, s).reduce((R, D) => R + D, 0));
|
|
1754
1531
|
let m = x;
|
|
1755
|
-
|
|
1756
|
-
let
|
|
1757
|
-
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (y = this.colAndRowspanModels[e]) != null && y.isInRange(
|
|
1758
|
-
this.renderDragTargetDiv(o,
|
|
1759
|
-
const
|
|
1760
|
-
this.dom.addColumnBorderDivs(this.tableOptions, o,
|
|
1532
|
+
w > 1 && (m = this.getColumnWidths(f, f + w - 1).reduce((R, D) => R + D, 0));
|
|
1533
|
+
let I = !1;
|
|
1534
|
+
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (y = this.colAndRowspanModels[e]) != null && y.isInRange(n, f) && (I = !0), this.draggingTargetColumnIndex === f && e !== "header") {
|
|
1535
|
+
this.renderDragTargetDiv(o, S, p, m, C);
|
|
1536
|
+
const R = { left: S, top: p, width: m, height: C };
|
|
1537
|
+
this.dom.addColumnBorderDivs(this.tableOptions, o, R, e, t);
|
|
1761
1538
|
} else {
|
|
1762
|
-
const
|
|
1763
|
-
|
|
1539
|
+
const R = this.renderSelectedBackgroundDiv(I, g, t, s, n, f, o, S, p, m, C);
|
|
1540
|
+
I || this.renderCell({
|
|
1764
1541
|
areaModel: s,
|
|
1765
1542
|
areaIdent: e,
|
|
1766
1543
|
sideIdent: t,
|
|
1767
|
-
rowIndex:
|
|
1544
|
+
rowIndex: n,
|
|
1768
1545
|
columnIndex: f,
|
|
1769
|
-
left:
|
|
1546
|
+
left: S,
|
|
1770
1547
|
top: p,
|
|
1771
1548
|
width: m,
|
|
1772
1549
|
height: C,
|
|
1773
1550
|
parent: o,
|
|
1774
|
-
cellSelected:
|
|
1551
|
+
cellSelected: R,
|
|
1775
1552
|
lastRowOfModel: d,
|
|
1776
1553
|
gammaRange: !0
|
|
1777
1554
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1778
|
-
rowIndex:
|
|
1555
|
+
rowIndex: n,
|
|
1779
1556
|
columnIndex: f,
|
|
1780
|
-
cellLeft:
|
|
1557
|
+
cellLeft: S,
|
|
1781
1558
|
cellTop: p,
|
|
1782
1559
|
cellWidth: m,
|
|
1783
1560
|
cellHeight: C,
|
|
@@ -1788,7 +1565,7 @@ class Ue extends Xe {
|
|
|
1788
1565
|
if (u = u + x, u > this.areaBodyCenterGeo.width)
|
|
1789
1566
|
break;
|
|
1790
1567
|
}
|
|
1791
|
-
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new
|
|
1568
|
+
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new O(u - 1, 1, i.height, 0), o);
|
|
1792
1569
|
}
|
|
1793
1570
|
getTreeArrowColumnIndex() {
|
|
1794
1571
|
return this.tableOptions.showCheckboxWihoutExtraColumn ? 0 : this.tableModel.isRowCheckboxVisible() ? 1 : 0;
|
|
@@ -1799,54 +1576,54 @@ class Ue extends Xe {
|
|
|
1799
1576
|
sideIdent: s,
|
|
1800
1577
|
rowIndex: i,
|
|
1801
1578
|
index: o,
|
|
1802
|
-
left:
|
|
1803
|
-
width:
|
|
1579
|
+
left: n,
|
|
1580
|
+
width: r,
|
|
1804
1581
|
height: a,
|
|
1805
1582
|
top: h,
|
|
1806
1583
|
parent: d,
|
|
1807
1584
|
lastRowOfModel: c
|
|
1808
1585
|
}) {
|
|
1809
1586
|
var re;
|
|
1810
|
-
const
|
|
1587
|
+
const g = this.editorRenderer && this.editorRendererRow === i && this.editorRendererColumn === o ? this.editorRenderer : e.getCellRenderer(i, o), u = { left: n, width: r, height: a, top: h, index: o }, y = e.getRowByIndex(i);
|
|
1811
1588
|
let f = "none";
|
|
1812
|
-
if (o === this.getTreeArrowColumnIndex() && y
|
|
1813
|
-
const
|
|
1814
|
-
(re =
|
|
1589
|
+
if (o === this.getTreeArrowColumnIndex() && Z(y)) {
|
|
1590
|
+
const v = y;
|
|
1591
|
+
(re = v.children) != null && re.length ? v.expanded ? f = "expanded" : f = "collapsed" : f = "hidden";
|
|
1815
1592
|
}
|
|
1816
1593
|
let x;
|
|
1817
1594
|
if (t === "header") {
|
|
1818
|
-
const
|
|
1819
|
-
(!(
|
|
1595
|
+
const v = this.tableModel.getColumnDef(o);
|
|
1596
|
+
(!(v != null && v.sortIconVisible) || v != null && v.sortIconVisible()) && (x = v == null ? void 0 : v.sortState);
|
|
1820
1597
|
}
|
|
1821
|
-
const C = e.getValueAt(i, o),
|
|
1598
|
+
const C = e.getValueAt(i, o), M = g ? "" : `${C}`, w = e.isRowChecked(i), m = this.dom.addColumnDiv(
|
|
1822
1599
|
d,
|
|
1823
1600
|
u,
|
|
1824
1601
|
i,
|
|
1825
1602
|
o,
|
|
1826
1603
|
t,
|
|
1827
1604
|
s,
|
|
1828
|
-
|
|
1605
|
+
M,
|
|
1829
1606
|
f,
|
|
1830
1607
|
this.tableOptions,
|
|
1831
|
-
|
|
1608
|
+
w,
|
|
1832
1609
|
x
|
|
1833
|
-
),
|
|
1834
|
-
|
|
1835
|
-
const
|
|
1836
|
-
|
|
1837
|
-
let
|
|
1838
|
-
|
|
1839
|
-
const
|
|
1840
|
-
if (
|
|
1841
|
-
const
|
|
1842
|
-
|
|
1610
|
+
), I = e.getTooltipAt(i, o);
|
|
1611
|
+
I && this.dom.setAttribute(m, "title", I);
|
|
1612
|
+
const R = this.tableModel.getColumnDef(o);
|
|
1613
|
+
R && R.classes[t] && this.dom.addClasses(R.classes[t], m);
|
|
1614
|
+
let D;
|
|
1615
|
+
g && (D = g.render(m, i, o, t, e, C, this.dom.domService));
|
|
1616
|
+
const V = e.getCustomClassesAt(i, o);
|
|
1617
|
+
if (V.length && this.dom.addClasses(V, m), this.dom.addColumnBorderDivs(this.tableOptions, d, u, t, s), c && this.dom.addHorizontalBorder({ left: n, width: r, height: a, top: h + a }, d), this.getFocusModel && t === "body") {
|
|
1618
|
+
const v = this.getFocusModel();
|
|
1619
|
+
v != null && v.hasFocus(i, o) && this.dom.addFocusBorderDivs(d, u, {});
|
|
1843
1620
|
}
|
|
1844
1621
|
t === "header" && this.dom.setAttribute(m, "data-ge-action", "drag-column");
|
|
1845
1622
|
const K = e.getCustomStyleAt(i, o);
|
|
1846
1623
|
if (K)
|
|
1847
|
-
for (const
|
|
1848
|
-
this.dom.setStyle(m,
|
|
1849
|
-
return [m,
|
|
1624
|
+
for (const v in K)
|
|
1625
|
+
this.dom.setStyle(m, v, K[v]);
|
|
1626
|
+
return [m, D];
|
|
1850
1627
|
}
|
|
1851
1628
|
getColumnWidths(e, t) {
|
|
1852
1629
|
const s = [];
|
|
@@ -1900,22 +1677,22 @@ class Ue extends Xe {
|
|
|
1900
1677
|
this.debounceTimeout && clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(e.bind(this), t);
|
|
1901
1678
|
}
|
|
1902
1679
|
renderDragTargetDiv(e, t, s, i, o) {
|
|
1903
|
-
const
|
|
1680
|
+
const n = this.dom.applyStylePosistionAbsolute(
|
|
1904
1681
|
this.dom.createDivWithClass("ge-table-drop-zone", e)
|
|
1905
1682
|
);
|
|
1906
|
-
return this.dom.setStyle(
|
|
1683
|
+
return this.dom.setStyle(n, "left", `${t}px`), this.dom.setStyle(n, "top", `${s}px`), this.dom.setStyle(n, "width", `${i}px`), this.dom.setStyle(n, "height", `${o}px`), n;
|
|
1907
1684
|
}
|
|
1908
|
-
renderSelectedBackgroundDiv(e, t, s, i, o,
|
|
1685
|
+
renderSelectedBackgroundDiv(e, t, s, i, o, n, r, a, h, d, c) {
|
|
1909
1686
|
let p = !1;
|
|
1910
|
-
if (!e && t && i.isSelectable(o,
|
|
1911
|
-
const
|
|
1912
|
-
if (
|
|
1913
|
-
const u =
|
|
1687
|
+
if (!e && t && i.isSelectable(o, n) && this.getSelectionModel) {
|
|
1688
|
+
const g = this.getSelectionModel();
|
|
1689
|
+
if (g) {
|
|
1690
|
+
const u = g.getSelectionCount(o, n);
|
|
1914
1691
|
p = u > 0;
|
|
1915
1692
|
for (let y = 0; y < u; y++) {
|
|
1916
1693
|
const f = this.dom.applyStylePosistionAbsolute(
|
|
1917
1694
|
// ge-table-body-west-selected-range
|
|
1918
|
-
this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`,
|
|
1695
|
+
this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`, r)
|
|
1919
1696
|
);
|
|
1920
1697
|
this.dom.setStyle(f, "left", `${a}px`), this.dom.setStyle(f, "top", `${h}px`), this.dom.setStyle(f, "width", `${d}px`), this.dom.setStyle(f, "height", `${c}px`);
|
|
1921
1698
|
}
|
|
@@ -1929,14 +1706,14 @@ class Ue extends Xe {
|
|
|
1929
1706
|
sideIdent: s,
|
|
1930
1707
|
rowIndex: i,
|
|
1931
1708
|
columnIndex: o,
|
|
1932
|
-
left:
|
|
1933
|
-
top:
|
|
1709
|
+
left: n,
|
|
1710
|
+
top: r,
|
|
1934
1711
|
width: a,
|
|
1935
1712
|
height: h,
|
|
1936
1713
|
parent: d,
|
|
1937
1714
|
cellSelected: c,
|
|
1938
1715
|
lastRowOfModel: p,
|
|
1939
|
-
gammaRange:
|
|
1716
|
+
gammaRange: g
|
|
1940
1717
|
}) {
|
|
1941
1718
|
const [u, y] = this.addAndRenderCellDiv({
|
|
1942
1719
|
areaModel: e,
|
|
@@ -1944,27 +1721,27 @@ class Ue extends Xe {
|
|
|
1944
1721
|
sideIdent: s,
|
|
1945
1722
|
rowIndex: i,
|
|
1946
1723
|
index: o,
|
|
1947
|
-
left:
|
|
1724
|
+
left: n,
|
|
1948
1725
|
width: a,
|
|
1949
1726
|
height: h,
|
|
1950
|
-
top:
|
|
1727
|
+
top: r,
|
|
1951
1728
|
parent: d,
|
|
1952
1729
|
lastRowOfModel: p,
|
|
1953
|
-
gammaRange:
|
|
1730
|
+
gammaRange: g
|
|
1954
1731
|
});
|
|
1955
1732
|
c && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, u), y && this.cleanupFunctions[t].push(y);
|
|
1956
1733
|
}
|
|
1957
|
-
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight:
|
|
1734
|
+
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight: n, parent: r }) {
|
|
1958
1735
|
const a = this.dom.domService, h = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = a.createElement("div");
|
|
1959
|
-
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", `${
|
|
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", `${n}px`), a.appendChild(r, d);
|
|
1960
1737
|
}
|
|
1961
1738
|
}
|
|
1962
|
-
class
|
|
1739
|
+
class Je {
|
|
1963
1740
|
constructor(e, t) {
|
|
1964
1741
|
this.columnIndex = e, this.sortState = t;
|
|
1965
1742
|
}
|
|
1966
1743
|
}
|
|
1967
|
-
class
|
|
1744
|
+
class Qe {
|
|
1968
1745
|
constructor(e) {
|
|
1969
1746
|
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
1970
1747
|
}
|
|
@@ -1972,13 +1749,13 @@ class Je {
|
|
|
1972
1749
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1973
1750
|
const t = e.target, s = t.getAttribute("data-area"), i = t.getAttribute("data-row-index"), o = t.getAttribute("data-col-index");
|
|
1974
1751
|
if (s && i && o) {
|
|
1975
|
-
const
|
|
1976
|
-
this.tableScope.updateModelValueAfterEdit(
|
|
1752
|
+
const n = ie(s), r = Number(i), a = Number(o);
|
|
1753
|
+
this.tableScope.updateModelValueAfterEdit(n, r, a, t.value);
|
|
1977
1754
|
}
|
|
1978
1755
|
}
|
|
1979
1756
|
}
|
|
1980
1757
|
}
|
|
1981
|
-
class
|
|
1758
|
+
class Ze {
|
|
1982
1759
|
constructor(e = -1, t = -1) {
|
|
1983
1760
|
this.rowIndex = e, this.columnIndex = t;
|
|
1984
1761
|
}
|
|
@@ -1988,20 +1765,20 @@ class le {
|
|
|
1988
1765
|
this.cells = e;
|
|
1989
1766
|
}
|
|
1990
1767
|
static createSingle(e, t) {
|
|
1991
|
-
return new le([new
|
|
1768
|
+
return new le([new Ze(e, t)]);
|
|
1992
1769
|
}
|
|
1993
1770
|
}
|
|
1994
|
-
class
|
|
1771
|
+
class et {
|
|
1995
1772
|
constructor(e) {
|
|
1996
1773
|
var t, s;
|
|
1997
1774
|
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);
|
|
1998
1775
|
}
|
|
1999
1776
|
onMouseClicked(e, t) {
|
|
2000
|
-
var o,
|
|
1777
|
+
var o, n, r, a, h, d, c;
|
|
2001
1778
|
let s = !1, i = !1;
|
|
2002
1779
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
2003
|
-
const p = this.getSelectionModel(),
|
|
2004
|
-
p &&
|
|
1780
|
+
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), (n = e.originalEvent) != null && n.shiftKey && this.previousEvt ? (p.addSelection(this.createRangeByEvents(e, this.previousEvt)), i = !0, s = !0) : (r = e.originalEvent) != null && r.ctrlKey || (a = e.originalEvent) != null && a.metaKey ? (p.addSelection(T.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(T.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0));
|
|
2005
1782
|
}
|
|
2006
1783
|
return i ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
2007
1784
|
}
|
|
@@ -2023,16 +1800,16 @@ class Ze {
|
|
|
2023
1800
|
}
|
|
2024
1801
|
createRangeByEvents(e, t) {
|
|
2025
1802
|
t || (t = e);
|
|
2026
|
-
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),
|
|
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), n = Math.max(e.columnIndex, t == null ? void 0 : t.columnIndex);
|
|
2027
1804
|
return T.create({
|
|
2028
1805
|
rowIndex1: s,
|
|
2029
1806
|
columnIndex1: o,
|
|
2030
1807
|
rowIndex2: i,
|
|
2031
|
-
columnIndex2:
|
|
1808
|
+
columnIndex2: n
|
|
2032
1809
|
});
|
|
2033
1810
|
}
|
|
2034
1811
|
}
|
|
2035
|
-
class
|
|
1812
|
+
class tt {
|
|
2036
1813
|
get() {
|
|
2037
1814
|
return {
|
|
2038
1815
|
f2: "START_EDITING",
|
|
@@ -2050,7 +1827,7 @@ class et {
|
|
|
2050
1827
|
};
|
|
2051
1828
|
}
|
|
2052
1829
|
}
|
|
2053
|
-
class
|
|
1830
|
+
class st {
|
|
2054
1831
|
get() {
|
|
2055
1832
|
return {
|
|
2056
1833
|
f2: "START_EDITING",
|
|
@@ -2070,7 +1847,7 @@ class tt {
|
|
|
2070
1847
|
};
|
|
2071
1848
|
}
|
|
2072
1849
|
}
|
|
2073
|
-
class
|
|
1850
|
+
class it {
|
|
2074
1851
|
constructor(e) {
|
|
2075
1852
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
2076
1853
|
}
|
|
@@ -2078,7 +1855,7 @@ class st {
|
|
|
2078
1855
|
this.listener.includes(e) || this.listener.push(e);
|
|
2079
1856
|
}
|
|
2080
1857
|
init() {
|
|
2081
|
-
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new
|
|
1858
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new st().get()) : Object.assign(this.shortcutActionIdMapping, new tt().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));
|
|
2082
1859
|
}
|
|
2083
1860
|
isMacintosh() {
|
|
2084
1861
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -2122,7 +1899,7 @@ class st {
|
|
|
2122
1899
|
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();
|
|
2123
1900
|
}
|
|
2124
1901
|
}
|
|
2125
|
-
class
|
|
1902
|
+
class he {
|
|
2126
1903
|
onCheckboxChanged(e) {
|
|
2127
1904
|
}
|
|
2128
1905
|
onContextmenu(e) {
|
|
@@ -2138,19 +1915,150 @@ class it {
|
|
|
2138
1915
|
onMouseMoved(e) {
|
|
2139
1916
|
}
|
|
2140
1917
|
}
|
|
2141
|
-
class
|
|
1918
|
+
class ye {
|
|
1919
|
+
setStyle(e, t, s) {
|
|
1920
|
+
return e.style[t] = s, e;
|
|
1921
|
+
}
|
|
1922
|
+
appendText(e, t) {
|
|
1923
|
+
const s = this.createText(t);
|
|
1924
|
+
return this.appendChild(e, s), s;
|
|
1925
|
+
}
|
|
1926
|
+
addClass(e, t) {
|
|
1927
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.add(s)) : e.classList.add(t), e;
|
|
1928
|
+
}
|
|
1929
|
+
appendChild(e, t) {
|
|
1930
|
+
e.appendChild(t);
|
|
1931
|
+
}
|
|
1932
|
+
createElement(e) {
|
|
1933
|
+
return document.createElement(e);
|
|
1934
|
+
}
|
|
1935
|
+
createText(e) {
|
|
1936
|
+
return document.createTextNode(e);
|
|
1937
|
+
}
|
|
1938
|
+
setAttribute(e, t, s) {
|
|
1939
|
+
e.setAttribute(t, s);
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
class ot {
|
|
1943
|
+
render(e, t, s, i, o, n, r) {
|
|
1944
|
+
if (o.isEditable(t, s)) {
|
|
1945
|
+
r.addClass(e, "ge-table-row-input-div");
|
|
1946
|
+
const a = o.getValueAt(t, s);
|
|
1947
|
+
e.innerHTML = `
|
|
1948
|
+
<input
|
|
1949
|
+
type="text"
|
|
1950
|
+
value="${a}"
|
|
1951
|
+
autofocus
|
|
1952
|
+
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
1953
|
+
data-listen="change"
|
|
1954
|
+
data-area="${i}"
|
|
1955
|
+
data-row-index="${t}"
|
|
1956
|
+
data-col-index="${s}"
|
|
1957
|
+
data-input-type="text"
|
|
1958
|
+
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
1959
|
+
class="ge-table-cell-editor-input">`;
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
class lt {
|
|
1964
|
+
constructor(e = "none", t = "single") {
|
|
1965
|
+
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1966
|
+
}
|
|
1967
|
+
getSelectionCount(e, t) {
|
|
1968
|
+
let s = 0;
|
|
1969
|
+
for (const i of this.ranges)
|
|
1970
|
+
i.isInRange(e, t) && s++;
|
|
1971
|
+
return this.allSelected && s++, this.isInNegativeRange(e, t) && (s = 0), s;
|
|
1972
|
+
}
|
|
1973
|
+
isInNegativeRange(e, t) {
|
|
1974
|
+
for (const s of this.negativeRanges)
|
|
1975
|
+
if (s.isInRange(e, t))
|
|
1976
|
+
return !0;
|
|
1977
|
+
return !1;
|
|
1978
|
+
}
|
|
1979
|
+
getRanges() {
|
|
1980
|
+
return this.ranges;
|
|
1981
|
+
}
|
|
1982
|
+
clear() {
|
|
1983
|
+
this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1984
|
+
}
|
|
1985
|
+
hasSelection() {
|
|
1986
|
+
return !!this.ranges.length;
|
|
1987
|
+
}
|
|
1988
|
+
selectAll() {
|
|
1989
|
+
this.allSelected = !0;
|
|
1990
|
+
}
|
|
1991
|
+
addSelection(e) {
|
|
1992
|
+
this.addRange(e);
|
|
1993
|
+
}
|
|
1994
|
+
removeSelection(e) {
|
|
1995
|
+
if (this.selectionType === "none")
|
|
1996
|
+
return;
|
|
1997
|
+
let t = e;
|
|
1998
|
+
this.selectionType === "row" ? t = T.singleRow(e.r1) : this.selectionType === "column" && (t = T.singleColumn(e.c1)), this.negativeRanges.push(t);
|
|
1999
|
+
}
|
|
2000
|
+
togglePoint(e, t) {
|
|
2001
|
+
this.getSelectionCount(e, t) > 0 ? this.removeSelection(T.singleCell(e, t)) : this.addSelection(T.singleCell(e, t));
|
|
2002
|
+
}
|
|
2003
|
+
addRange(e) {
|
|
2004
|
+
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));
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
class nt {
|
|
2008
|
+
constructor(e = "none") {
|
|
2009
|
+
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
|
|
2010
|
+
}
|
|
2011
|
+
clearChanged() {
|
|
2012
|
+
this.changed = !1;
|
|
2013
|
+
}
|
|
2014
|
+
hasChanged() {
|
|
2015
|
+
return this.changed;
|
|
2016
|
+
}
|
|
2017
|
+
clear() {
|
|
2018
|
+
this.rowIndex = -1, this.columnIndex = -1;
|
|
2019
|
+
}
|
|
2020
|
+
setFocus(e, t) {
|
|
2021
|
+
(this.rowIndex !== e || this.columnIndex !== t) && (this.rowIndex = e, this.columnIndex = t, this.changed = !0);
|
|
2022
|
+
}
|
|
2023
|
+
hasFocus(e, t) {
|
|
2024
|
+
return this.rowIndex === e && this.columnIndex === t;
|
|
2025
|
+
}
|
|
2026
|
+
getFocus() {
|
|
2027
|
+
return [this.rowIndex, this.columnIndex];
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
const rt = new lt(), at = new nt("cell");
|
|
2031
|
+
class ve {
|
|
2032
|
+
constructor() {
|
|
2033
|
+
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
|
+
header: 34,
|
|
2035
|
+
body: 34,
|
|
2036
|
+
footer: 34
|
|
2037
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new me(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new be(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new ot(), this.getSelectionModel = () => rt, this.getFocusModel = () => at;
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
class ne extends qe {
|
|
2142
2041
|
constructor(e, t, s, i, o) {
|
|
2143
|
-
var
|
|
2042
|
+
var n;
|
|
2144
2043
|
if (super(
|
|
2145
2044
|
e,
|
|
2146
2045
|
t,
|
|
2147
|
-
new
|
|
2046
|
+
new Ve(s),
|
|
2148
2047
|
i
|
|
2149
|
-
), this.eventListener = o, this.selectionService = new
|
|
2150
|
-
const
|
|
2151
|
-
a && (
|
|
2048
|
+
), this.eventListener = o, this.selectionService = new et(this), this.api = new Ge(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new he()), (n = this.tableOptions) != null && n.autoRestoreOptions) {
|
|
2049
|
+
const r = this.tableOptions.autoRestoreOptions, a = r.getStorageKeyFn;
|
|
2050
|
+
a && (r.autoRestoreScrollPosition && (this.storeScrollPosStateService = new Ne(a)), r.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new ze(a)), r.autoRestoreSortingState && (this.storeSortingService = new Xe(a)));
|
|
2152
2051
|
}
|
|
2153
|
-
this.mouseHandler = new
|
|
2052
|
+
this.mouseHandler = new _e(this), this.inputHandler = new Qe(this), this.shortcutService = new it(this), this.shortcutService.addListener(this.selectionService);
|
|
2053
|
+
}
|
|
2054
|
+
static create(e, t, s = new ve(), i = new he(), o = new ye()) {
|
|
2055
|
+
return new ne(
|
|
2056
|
+
e,
|
|
2057
|
+
t,
|
|
2058
|
+
o,
|
|
2059
|
+
s,
|
|
2060
|
+
i
|
|
2061
|
+
);
|
|
2154
2062
|
}
|
|
2155
2063
|
onActionTriggered(e) {
|
|
2156
2064
|
if (e === "NAVIGATE_DOWN" && this.changeFocusCell(0, 1) || e === "NAVIGATE_UP" && this.changeFocusCell(0, -1) || e === "NAVIGATE_LEFT" && this.changeFocusCell(-1, 0) || e === "NAVIGATE_RIGHT" && this.changeFocusCell(1, 0))
|
|
@@ -2176,7 +2084,7 @@ class ot extends Ue {
|
|
|
2176
2084
|
*/
|
|
2177
2085
|
firstInit() {
|
|
2178
2086
|
var e;
|
|
2179
|
-
this.tableModel.init(), (e = this.tableOptions) != null && e.externalFilterFunction && this.externalFilterChanged(!1), this.autoRestoreCollapsedExpandedState(), this.autoRestoreSortingState(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.autoRestoreScrollPosition();
|
|
2087
|
+
return this.tableModel.init(), (e = this.tableOptions) != null && e.externalFilterFunction && this.externalFilterChanged(!1), this.autoRestoreCollapsedExpandedState(), this.autoRestoreSortingState(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.autoRestoreScrollPosition(), this;
|
|
2180
2088
|
}
|
|
2181
2089
|
createGeMouseEvent(e) {
|
|
2182
2090
|
const t = new se();
|
|
@@ -2211,14 +2119,14 @@ class ot extends Ue {
|
|
|
2211
2119
|
toggleExpandCollapseAll(e = !0) {
|
|
2212
2120
|
var s;
|
|
2213
2121
|
const t = this.tableModel.getBodyModel();
|
|
2214
|
-
t
|
|
2122
|
+
ee(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
2215
2123
|
}
|
|
2216
2124
|
toggleRowCheckbox(e, t, s) {
|
|
2217
2125
|
var a;
|
|
2218
|
-
const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e),
|
|
2219
|
-
i.setRowChecked(e,
|
|
2220
|
-
const
|
|
2221
|
-
this.eventListener.onCheckboxChanged(
|
|
2126
|
+
const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e), n = o === void 0 || o === "semi" || o === "none";
|
|
2127
|
+
i.setRowChecked(e, n), this.repaint();
|
|
2128
|
+
const r = (a = i.rowSelectionModel) == null ? void 0 : a.getCheckedRows();
|
|
2129
|
+
this.eventListener.onCheckboxChanged(r || []);
|
|
2222
2130
|
}
|
|
2223
2131
|
onMouseClicked(e, t) {
|
|
2224
2132
|
let s = this.selectionService.onMouseClicked(e, t);
|
|
@@ -2233,12 +2141,12 @@ class ot extends Ue {
|
|
|
2233
2141
|
t && (e && this.clearSelectionModel(), this.tableModel.externalFilterChanged(t), this.scrollViewport.scrollTo(0, 0), this.tableModel.recalcHeightAndPadding(), this.resetSizeOfWrapperDiv(), this.repaint());
|
|
2234
2142
|
}
|
|
2235
2143
|
onHeaderDblClicked(e, t, s) {
|
|
2236
|
-
var o,
|
|
2144
|
+
var o, n;
|
|
2237
2145
|
const i = this.tableModel.getColumnDef(s);
|
|
2238
2146
|
if (i != null && i.sortable && i.sortable()) {
|
|
2239
2147
|
e.preventDefault(), e.stopPropagation();
|
|
2240
|
-
const
|
|
2241
|
-
this.tableModel.doSort([d]) && ((o = this.tableModel.getColumnDefs()) == null || o.forEach((p) => p.sortState = ""), i.sortState = h), this.repaint(), (
|
|
2148
|
+
const r = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, a = i.sortState ?? "", h = r[(r.indexOf(a) + 1) % r.length], d = new Je(s, h);
|
|
2149
|
+
this.tableModel.doSort([d]) && ((o = this.tableModel.getColumnDefs()) == null || o.forEach((p) => p.sortState = ""), i.sortState = h), this.repaint(), (n = this.storeSortingService) == null || n.setSortItems([d]);
|
|
2242
2150
|
}
|
|
2243
2151
|
}
|
|
2244
2152
|
changeFocusCell(e, t) {
|
|
@@ -2281,11 +2189,11 @@ class ot extends Ue {
|
|
|
2281
2189
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
|
|
2282
2190
|
const s = this.tableOptions.autoRestoreOptions, i = s.getRowId;
|
|
2283
2191
|
if (s.autoRestoreCollapsedExpandedState && i) {
|
|
2284
|
-
const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(),
|
|
2285
|
-
if (
|
|
2286
|
-
const
|
|
2192
|
+
const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), n = this.tableModel.getAreaModel("body");
|
|
2193
|
+
if (ee(n)) {
|
|
2194
|
+
const r = n, a = n.getRowCount();
|
|
2287
2195
|
for (let h = 0; h < a; h++) {
|
|
2288
|
-
const d =
|
|
2196
|
+
const d = n.getRowByIndex(h);
|
|
2289
2197
|
if (d)
|
|
2290
2198
|
if (o.allExpanded)
|
|
2291
2199
|
d.expanded = !0;
|
|
@@ -2296,209 +2204,83 @@ class ot extends Ue {
|
|
|
2296
2204
|
o.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(c) : o.mode === "collapsed" && (d.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(c));
|
|
2297
2205
|
}
|
|
2298
2206
|
}
|
|
2299
|
-
|
|
2207
|
+
r.recalcVisibleTreeRows();
|
|
2300
2208
|
}
|
|
2301
2209
|
}
|
|
2302
2210
|
}
|
|
2303
2211
|
}
|
|
2304
2212
|
}
|
|
2305
|
-
|
|
2306
|
-
render(e, t, s, i, o, r, n) {
|
|
2307
|
-
if (o.isEditable(t, s)) {
|
|
2308
|
-
n.addClass(e, "ge-table-row-input-div");
|
|
2309
|
-
const a = o.getValueAt(t, s);
|
|
2310
|
-
e.innerHTML = `
|
|
2311
|
-
<input
|
|
2312
|
-
type="text"
|
|
2313
|
-
value="${a}"
|
|
2314
|
-
autofocus
|
|
2315
|
-
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
2316
|
-
data-listen="change"
|
|
2317
|
-
data-area="${i}"
|
|
2318
|
-
data-row-index="${t}"
|
|
2319
|
-
data-col-index="${s}"
|
|
2320
|
-
data-input-type="text"
|
|
2321
|
-
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
2322
|
-
class="ge-table-cell-editor-input">`;
|
|
2323
|
-
}
|
|
2324
|
-
}
|
|
2325
|
-
}
|
|
2326
|
-
class rt {
|
|
2327
|
-
constructor(e = "none", t = "single") {
|
|
2328
|
-
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
2329
|
-
}
|
|
2330
|
-
getSelectionCount(e, t) {
|
|
2331
|
-
let s = 0;
|
|
2332
|
-
for (const i of this.ranges)
|
|
2333
|
-
i.isInRange(e, t) && s++;
|
|
2334
|
-
return this.allSelected && s++, this.isInNegativeRange(e, t) && (s = 0), s;
|
|
2335
|
-
}
|
|
2336
|
-
isInNegativeRange(e, t) {
|
|
2337
|
-
for (const s of this.negativeRanges)
|
|
2338
|
-
if (s.isInRange(e, t))
|
|
2339
|
-
return !0;
|
|
2340
|
-
return !1;
|
|
2341
|
-
}
|
|
2342
|
-
getRanges() {
|
|
2343
|
-
return this.ranges;
|
|
2344
|
-
}
|
|
2345
|
-
clear() {
|
|
2346
|
-
this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
2347
|
-
}
|
|
2348
|
-
hasSelection() {
|
|
2349
|
-
return !!this.ranges.length;
|
|
2350
|
-
}
|
|
2351
|
-
selectAll() {
|
|
2352
|
-
this.allSelected = !0;
|
|
2353
|
-
}
|
|
2354
|
-
addSelection(e) {
|
|
2355
|
-
this.addRange(e);
|
|
2356
|
-
}
|
|
2357
|
-
removeSelection(e) {
|
|
2358
|
-
if (this.selectionType === "none")
|
|
2359
|
-
return;
|
|
2360
|
-
let t = e;
|
|
2361
|
-
this.selectionType === "row" ? t = T.singleRow(e.r1) : this.selectionType === "column" && (t = T.singleColumn(e.c1)), this.negativeRanges.push(t);
|
|
2362
|
-
}
|
|
2363
|
-
togglePoint(e, t) {
|
|
2364
|
-
this.getSelectionCount(e, t) > 0 ? this.removeSelection(T.singleCell(e, t)) : this.addSelection(T.singleCell(e, t));
|
|
2365
|
-
}
|
|
2366
|
-
addRange(e) {
|
|
2367
|
-
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));
|
|
2368
|
-
}
|
|
2369
|
-
}
|
|
2370
|
-
class nt {
|
|
2371
|
-
constructor(e = "none") {
|
|
2372
|
-
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
|
|
2373
|
-
}
|
|
2374
|
-
clearChanged() {
|
|
2375
|
-
this.changed = !1;
|
|
2376
|
-
}
|
|
2377
|
-
hasChanged() {
|
|
2378
|
-
return this.changed;
|
|
2379
|
-
}
|
|
2380
|
-
clear() {
|
|
2381
|
-
this.rowIndex = -1, this.columnIndex = -1;
|
|
2382
|
-
}
|
|
2383
|
-
setFocus(e, t) {
|
|
2384
|
-
(this.rowIndex !== e || this.columnIndex !== t) && (this.rowIndex = e, this.columnIndex = t, this.changed = !0);
|
|
2385
|
-
}
|
|
2386
|
-
hasFocus(e, t) {
|
|
2387
|
-
return this.rowIndex === e && this.columnIndex === t;
|
|
2388
|
-
}
|
|
2389
|
-
getFocus() {
|
|
2390
|
-
return [this.rowIndex, this.columnIndex];
|
|
2391
|
-
}
|
|
2392
|
-
}
|
|
2393
|
-
const at = new rt(), dt = new nt("cell");
|
|
2394
|
-
class ht {
|
|
2395
|
-
constructor() {
|
|
2396
|
-
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 = {
|
|
2397
|
-
header: 34,
|
|
2398
|
-
body: 34,
|
|
2399
|
-
footer: 34
|
|
2400
|
-
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new ge(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new Se(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new lt(), this.getSelectionModel = () => at, this.getFocusModel = () => dt;
|
|
2401
|
-
}
|
|
2402
|
-
}
|
|
2403
|
-
class ct {
|
|
2404
|
-
setStyle(e, t, s) {
|
|
2405
|
-
return e.style[t] = s, e;
|
|
2406
|
-
}
|
|
2407
|
-
appendText(e, t) {
|
|
2408
|
-
const s = this.createText(t);
|
|
2409
|
-
return this.appendChild(e, s), s;
|
|
2410
|
-
}
|
|
2411
|
-
addClass(e, t) {
|
|
2412
|
-
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.add(s)) : e.classList.add(t), e;
|
|
2413
|
-
}
|
|
2414
|
-
appendChild(e, t) {
|
|
2415
|
-
e.appendChild(t);
|
|
2416
|
-
}
|
|
2417
|
-
createElement(e) {
|
|
2418
|
-
return document.createElement(e);
|
|
2419
|
-
}
|
|
2420
|
-
createText(e) {
|
|
2421
|
-
return document.createTextNode(e);
|
|
2422
|
-
}
|
|
2423
|
-
setAttribute(e, t, s) {
|
|
2424
|
-
e.setAttribute(t, s);
|
|
2425
|
-
}
|
|
2426
|
-
}
|
|
2427
|
-
const ut = /* @__PURE__ */ Oe("<div>"), gt = (l) => {
|
|
2213
|
+
const dt = /* @__PURE__ */ Pe("<div>"), ut = (l) => {
|
|
2428
2214
|
let e;
|
|
2429
|
-
const t =
|
|
2215
|
+
const t = ge({
|
|
2430
2216
|
tableModel: null,
|
|
2431
|
-
tableOptions: new
|
|
2217
|
+
tableOptions: new ve()
|
|
2432
2218
|
}, l);
|
|
2433
|
-
return
|
|
2434
|
-
if (console.info("... onMount() ref", e), !e)
|
|
2435
|
-
throw setTimeout(() => {
|
|
2436
|
-
console.info("ref after 2 secs", e);
|
|
2437
|
-
}, 2222), new Error("ref is undefined in onMount()!");
|
|
2219
|
+
return Ae(() => {
|
|
2438
2220
|
const s = {
|
|
2439
|
-
onCheckboxChanged: (
|
|
2440
|
-
const
|
|
2441
|
-
detail:
|
|
2221
|
+
onCheckboxChanged: (n) => {
|
|
2222
|
+
const r = new CustomEvent("checkboxChanged", {
|
|
2223
|
+
detail: n,
|
|
2442
2224
|
bubbles: !0
|
|
2443
2225
|
});
|
|
2444
|
-
e.dispatchEvent(
|
|
2226
|
+
e && e.dispatchEvent(r);
|
|
2445
2227
|
},
|
|
2446
|
-
onContextmenu: (
|
|
2447
|
-
const
|
|
2448
|
-
detail:
|
|
2228
|
+
onContextmenu: (n) => {
|
|
2229
|
+
const r = new CustomEvent("contextmenu", {
|
|
2230
|
+
detail: n,
|
|
2449
2231
|
bubbles: !0
|
|
2450
2232
|
});
|
|
2451
|
-
e.dispatchEvent(
|
|
2233
|
+
e && e.dispatchEvent(r);
|
|
2452
2234
|
},
|
|
2453
|
-
onModelChanged: (
|
|
2454
|
-
const
|
|
2455
|
-
detail:
|
|
2235
|
+
onModelChanged: (n) => {
|
|
2236
|
+
const r = new CustomEvent("modelChanged", {
|
|
2237
|
+
detail: n,
|
|
2456
2238
|
bubbles: !0
|
|
2457
2239
|
});
|
|
2458
|
-
e.dispatchEvent(
|
|
2240
|
+
e && e.dispatchEvent(r);
|
|
2459
2241
|
},
|
|
2460
|
-
onMouseClicked: (
|
|
2461
|
-
const
|
|
2462
|
-
detail:
|
|
2242
|
+
onMouseClicked: (n) => {
|
|
2243
|
+
const r = new CustomEvent("mouseClicked", {
|
|
2244
|
+
detail: n,
|
|
2463
2245
|
bubbles: !0
|
|
2464
2246
|
});
|
|
2465
|
-
e.dispatchEvent(
|
|
2247
|
+
e && e.dispatchEvent(r);
|
|
2466
2248
|
},
|
|
2467
|
-
onMouseDragging: (
|
|
2468
|
-
const
|
|
2469
|
-
detail:
|
|
2249
|
+
onMouseDragging: (n) => {
|
|
2250
|
+
const r = new CustomEvent("mouseDragging", {
|
|
2251
|
+
detail: n,
|
|
2470
2252
|
bubbles: !0
|
|
2471
2253
|
});
|
|
2472
|
-
e.dispatchEvent(
|
|
2254
|
+
e && e.dispatchEvent(r);
|
|
2473
2255
|
},
|
|
2474
|
-
onMouseDraggingEnd: (
|
|
2475
|
-
const
|
|
2476
|
-
detail:
|
|
2256
|
+
onMouseDraggingEnd: (n) => {
|
|
2257
|
+
const r = new CustomEvent("mouseDraggingEnd", {
|
|
2258
|
+
detail: n,
|
|
2477
2259
|
bubbles: !0
|
|
2478
2260
|
});
|
|
2479
|
-
e.dispatchEvent(
|
|
2261
|
+
e && e.dispatchEvent(r);
|
|
2480
2262
|
},
|
|
2481
|
-
onMouseMoved: (
|
|
2482
|
-
const
|
|
2483
|
-
detail:
|
|
2263
|
+
onMouseMoved: (n) => {
|
|
2264
|
+
const r = new CustomEvent("mouseMoved", {
|
|
2265
|
+
detail: n,
|
|
2484
2266
|
bubbles: !0
|
|
2485
2267
|
});
|
|
2486
|
-
e.dispatchEvent(
|
|
2268
|
+
e && e.dispatchEvent(r);
|
|
2487
2269
|
}
|
|
2488
|
-
}, i = new
|
|
2489
|
-
|
|
2270
|
+
}, i = new ne(e, t.tableModel, new ye(), t.tableOptions, s);
|
|
2271
|
+
i.firstInit();
|
|
2490
2272
|
const o = new CustomEvent("tableReady", {
|
|
2491
2273
|
detail: i.getApi(),
|
|
2492
2274
|
bubbles: !0
|
|
2493
2275
|
});
|
|
2494
|
-
e.dispatchEvent(o);
|
|
2276
|
+
e && e.dispatchEvent(o);
|
|
2495
2277
|
}), (() => {
|
|
2496
|
-
const s =
|
|
2497
|
-
return typeof i == "function" ?
|
|
2278
|
+
const s = dt(), i = e;
|
|
2279
|
+
return typeof i == "function" ? We(i, s) : e = s, s;
|
|
2498
2280
|
})();
|
|
2499
2281
|
};
|
|
2500
2282
|
export {
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2283
|
+
ht as ComponentRendererWrapper,
|
|
2284
|
+
ut as GuiexpertTable,
|
|
2285
|
+
ct as GuiexpertTableProps
|
|
2504
2286
|
};
|