@guiexpert/solid-table 1.0.13 → 1.0.15

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