@guiexpert/solid-table 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.cjs +3 -3
  2. package/index.js +502 -238
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -1,17 +1,17 @@
1
- const we = (l, e) => l === e, q = Symbol("solid-proxy"), ae = {
2
- equals: we
1
+ const Ce = (l, e) => l === e, q = Symbol("solid-proxy"), de = {
2
+ equals: Ce
3
3
  };
4
- let ce = pe;
5
- const L = 1, k = 2, ue = {
4
+ let ue = fe;
5
+ const L = 1, k = 2, pe = {
6
6
  owned: null,
7
7
  cleanups: null,
8
8
  context: null,
9
9
  owner: null
10
10
  };
11
11
  var A = null;
12
- let Y = null, b = null, E = null, F = null, X = 0;
13
- function Ce(l, e) {
14
- const t = b, s = A, i = l.length === 0, o = e === void 0 ? s : e, r = i ? ue : {
12
+ let Y = null, b = null, x = null, F = null, X = 0;
13
+ function xe(l, e) {
14
+ const t = b, s = A, i = l.length === 0, o = e === void 0 ? s : e, r = i ? pe : {
15
15
  owned: null,
16
16
  cleanups: null,
17
17
  context: o ? o.context : null,
@@ -28,15 +28,15 @@ function J(l, e, t) {
28
28
  const s = te(l, e, !1, L);
29
29
  W(s);
30
30
  }
31
- function xe(l, e, t) {
32
- ce = Ie;
31
+ function Ee(l, e, t) {
32
+ ue = Oe;
33
33
  const s = te(l, e, !1, L);
34
34
  (!t || !t.render) && (s.user = !0), F ? F.push(s) : W(s);
35
35
  }
36
- function Ee(l, e, t) {
37
- t = t ? Object.assign({}, ae, t) : ae;
36
+ function Ae(l, e, t) {
37
+ t = t ? Object.assign({}, de, t) : de;
38
38
  const s = te(l, e, !0, 0);
39
- return s.observers = null, s.observerSlots = null, s.comparator = t.equals || void 0, W(s), Me.bind(s);
39
+ return s.observers = null, s.observerSlots = null, s.comparator = t.equals || void 0, W(s), Re.bind(s);
40
40
  }
41
41
  function P(l) {
42
42
  if (b === null)
@@ -49,16 +49,16 @@ function P(l) {
49
49
  b = e;
50
50
  }
51
51
  }
52
- function Ae(l) {
53
- xe(() => P(l));
52
+ function Me(l) {
53
+ Ee(() => P(l));
54
54
  }
55
- function Me() {
55
+ function Re() {
56
56
  if (this.sources && this.state)
57
57
  if (this.state === L)
58
58
  W(this);
59
59
  else {
60
- const l = E;
61
- E = null, H(() => N(this), !1), E = l;
60
+ const l = x;
61
+ x = null, H(() => N(this), !1), x = l;
62
62
  }
63
63
  if (b) {
64
64
  const l = this.observers ? this.observers.length : 0;
@@ -66,15 +66,15 @@ function Me() {
66
66
  }
67
67
  return this.value;
68
68
  }
69
- function Re(l, e, t) {
69
+ function Te(l, e, t) {
70
70
  let s = l.value;
71
71
  return (!l.comparator || !l.comparator(s, e)) && (l.value = e, l.observers && l.observers.length && H(() => {
72
72
  for (let i = 0; i < l.observers.length; i += 1) {
73
73
  const o = l.observers[i], r = Y && Y.running;
74
- r && Y.disposed.has(o), (r ? !o.tState : !o.state) && (o.pure ? E.push(o) : F.push(o), o.observers && fe(o)), r || (o.state = L);
74
+ r && Y.disposed.has(o), (r ? !o.tState : !o.state) && (o.pure ? x.push(o) : F.push(o), o.observers && Se(o)), r || (o.state = L);
75
75
  }
76
- if (E.length > 1e6)
77
- throw E = [], new Error();
76
+ if (x.length > 1e6)
77
+ throw x = [], new Error();
78
78
  }, !1)), e;
79
79
  }
80
80
  function W(l) {
@@ -82,16 +82,16 @@ function W(l) {
82
82
  return;
83
83
  K(l);
84
84
  const e = A, t = b, s = X;
85
- b = A = l, Te(l, l.value, s), b = t, A = e;
85
+ b = A = l, De(l, l.value, s), b = t, A = e;
86
86
  }
87
- function Te(l, e, t) {
87
+ function De(l, e, t) {
88
88
  let s;
89
89
  try {
90
90
  s = l.fn(e);
91
91
  } catch (i) {
92
- return l.pure && (l.state = L, l.owned && l.owned.forEach(K), l.owned = null), l.updatedAt = t + 1, Se(i);
92
+ return l.pure && (l.state = L, l.owned && l.owned.forEach(K), l.owned = null), l.updatedAt = t + 1, ge(i);
93
93
  }
94
- (!l.updatedAt || l.updatedAt <= t) && (l.updatedAt != null && "observers" in l ? Re(l, s) : l.value = s, l.updatedAt = t);
94
+ (!l.updatedAt || l.updatedAt <= t) && (l.updatedAt != null && "observers" in l ? Te(l, s) : l.value = s, l.updatedAt = t);
95
95
  }
96
96
  function te(l, e, t, s = L, i) {
97
97
  const o = {
@@ -107,7 +107,7 @@ function te(l, e, t, s = L, i) {
107
107
  context: A ? A.context : null,
108
108
  pure: t
109
109
  };
110
- return A === null || A !== ue && (A.owned ? A.owned.push(o) : A.owned = [o]), o;
110
+ return A === null || A !== pe && (A.owned ? A.owned.push(o) : A.owned = [o]), o;
111
111
  }
112
112
  function G(l) {
113
113
  if (l.state === 0)
@@ -123,33 +123,33 @@ function G(l) {
123
123
  if (l = e[t], l.state === L)
124
124
  W(l);
125
125
  else if (l.state === k) {
126
- const s = E;
127
- E = null, H(() => N(l, e[0]), !1), E = s;
126
+ const s = x;
127
+ x = null, H(() => N(l, e[0]), !1), x = s;
128
128
  }
129
129
  }
130
130
  function H(l, e) {
131
- if (E)
131
+ if (x)
132
132
  return l();
133
133
  let t = !1;
134
- e || (E = []), F ? t = !0 : F = [], X++;
134
+ e || (x = []), F ? t = !0 : F = [], X++;
135
135
  try {
136
136
  const s = l();
137
- return De(t), s;
137
+ return Ie(t), s;
138
138
  } catch (s) {
139
- t || (F = null), E = null, Se(s);
139
+ t || (F = null), x = null, ge(s);
140
140
  }
141
141
  }
142
- function De(l) {
143
- if (E && (pe(E), E = null), l)
142
+ function Ie(l) {
143
+ if (x && (fe(x), x = null), l)
144
144
  return;
145
145
  const e = F;
146
- F = null, e.length && H(() => ce(e), !1);
146
+ F = null, e.length && H(() => ue(e), !1);
147
147
  }
148
- function pe(l) {
148
+ function fe(l) {
149
149
  for (let e = 0; e < l.length; e++)
150
150
  G(l[e]);
151
151
  }
152
- function Ie(l) {
152
+ function Oe(l) {
153
153
  let e, t = 0;
154
154
  for (e = 0; e < l.length; e++) {
155
155
  const s = l[e];
@@ -168,10 +168,10 @@ function N(l, e) {
168
168
  }
169
169
  }
170
170
  }
171
- function fe(l) {
171
+ function Se(l) {
172
172
  for (let e = 0; e < l.observers.length; e += 1) {
173
173
  const t = l.observers[e];
174
- t.state || (t.state = k, t.pure ? E.push(t) : F.push(t), t.observers && fe(t));
174
+ t.state || (t.state = k, t.pure ? x.push(t) : F.push(t), t.observers && Se(t));
175
175
  }
176
176
  }
177
177
  function K(l) {
@@ -196,18 +196,18 @@ function K(l) {
196
196
  }
197
197
  l.state = 0;
198
198
  }
199
- function Oe(l) {
199
+ function Fe(l) {
200
200
  return l instanceof Error ? l : new Error(typeof l == "string" ? l : "Unknown error", {
201
201
  cause: l
202
202
  });
203
203
  }
204
- function Se(l, e = A) {
205
- throw Oe(l);
204
+ function ge(l, e = A) {
205
+ throw Fe(l);
206
206
  }
207
207
  function _() {
208
208
  return !0;
209
209
  }
210
- const Fe = {
210
+ const Le = {
211
211
  get(l, e, t) {
212
212
  return e === q ? t : l.get(e);
213
213
  },
@@ -234,18 +234,18 @@ const Fe = {
234
234
  function U(l) {
235
235
  return (l = typeof l == "function" ? l() : l) ? l : {};
236
236
  }
237
- function Le() {
237
+ function $e() {
238
238
  for (let l = 0, e = this.length; l < e; ++l) {
239
239
  const t = this[l]();
240
240
  if (t !== void 0)
241
241
  return t;
242
242
  }
243
243
  }
244
- function ge(...l) {
244
+ function me(...l) {
245
245
  let e = !1;
246
246
  for (let o = 0; o < l.length; o++) {
247
247
  const r = l[o];
248
- e = e || !!r && q in r, l[o] = typeof r == "function" ? (e = !0, Ee(r)) : r;
248
+ e = e || !!r && q in r, l[o] = typeof r == "function" ? (e = !0, Ae(r)) : r;
249
249
  }
250
250
  if (e)
251
251
  return new Proxy({
@@ -268,7 +268,7 @@ function ge(...l) {
268
268
  o.push(...Object.keys(U(l[r])));
269
269
  return [...new Set(o)];
270
270
  }
271
- }, Fe);
271
+ }, Le);
272
272
  const t = {}, s = {}, i = /* @__PURE__ */ new Set();
273
273
  for (let o = l.length - 1; o >= 0; o--) {
274
274
  const r = l[o];
@@ -284,7 +284,7 @@ function ge(...l) {
284
284
  c.get ? (i.add(d), Object.defineProperty(t, d, {
285
285
  enumerable: !0,
286
286
  configurable: !0,
287
- get: Le.bind(s[d] = [c.get.bind(r)])
287
+ get: $e.bind(s[d] = [c.get.bind(r)])
288
288
  })) : (c.value !== void 0 && i.add(d), t[d] = c.value);
289
289
  else {
290
290
  const p = s[d];
@@ -294,7 +294,7 @@ function ge(...l) {
294
294
  }
295
295
  return t;
296
296
  }
297
- function $e(l, e, t) {
297
+ function Be(l, e, t) {
298
298
  let s = t.length, i = e.length, o = s, r = 0, n = 0, a = e[i - 1].nextSibling, h = null;
299
299
  for (; r < i || n < o; ) {
300
300
  if (e[r] === t[n]) {
@@ -339,15 +339,15 @@ function $e(l, e, t) {
339
339
  }
340
340
  }
341
341
  }
342
- function Be(l, e, t, s = {}) {
342
+ function Pe(l, e, t, s = {}) {
343
343
  let i;
344
- return Ce((o) => {
345
- i = o, e === document ? l() : He(e, l(), e.firstChild ? null : void 0, t);
344
+ return xe((o) => {
345
+ i = o, e === document ? l() : Ve(e, l(), e.firstChild ? null : void 0, t);
346
346
  }, s.owner), () => {
347
347
  i(), e.textContent = "";
348
348
  };
349
349
  }
350
- function Pe(l, e, t) {
350
+ function We(l, e, t) {
351
351
  let s;
352
352
  const i = () => {
353
353
  const r = document.createElement("template");
@@ -355,10 +355,10 @@ function Pe(l, e, t) {
355
355
  }, o = e ? () => P(() => document.importNode(s || (s = i()), !0)) : () => (s || (s = i())).cloneNode(!0);
356
356
  return o.cloneNode = o, o;
357
357
  }
358
- function We(l, e, t) {
358
+ function He(l, e, t) {
359
359
  return P(() => l(e, t));
360
360
  }
361
- function He(l, e, t, s) {
361
+ function Ve(l, e, t, s) {
362
362
  if (t !== void 0 && !s && (s = []), typeof e != "function")
363
363
  return j(l, e, s, t);
364
364
  J((i) => j(l, e(), i, t), s);
@@ -393,7 +393,7 @@ function j(l, e, t, s, i) {
393
393
  if (t = B(l, t, s), r)
394
394
  return t;
395
395
  } else
396
- a ? t.length === 0 ? de(l, n, s) : $e(l, t, n) : (t && B(l), de(l, n));
396
+ a ? t.length === 0 ? he(l, n, s) : Be(l, t, n) : (t && B(l), he(l, n));
397
397
  t = n;
398
398
  } else if (e.nodeType) {
399
399
  if (Array.isArray(t)) {
@@ -430,7 +430,7 @@ function Q(l, e, t, s) {
430
430
  }
431
431
  return i;
432
432
  }
433
- function de(l, e, t = null) {
433
+ function he(l, e, t = null) {
434
434
  for (let s = 0, i = e.length; s < i; s++)
435
435
  l.insertBefore(e[s], t);
436
436
  }
@@ -452,25 +452,25 @@ function B(l, e, t, s) {
452
452
  l.insertBefore(i, t);
453
453
  return [i];
454
454
  }
455
- class ht {
455
+ class ct {
456
456
  constructor(e) {
457
457
  this.code = e;
458
458
  }
459
459
  render(e, t, s, i, o, r, n) {
460
- const a = ge({
460
+ const a = me({
461
461
  rowIndex: t,
462
462
  columnIndex: s,
463
463
  areaIdent: i,
464
464
  areaModel: o,
465
465
  cellValue: r
466
466
  });
467
- Be(
467
+ Pe(
468
468
  () => this.code(a),
469
469
  e
470
470
  );
471
471
  }
472
472
  }
473
- const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
473
+ const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
474
474
  __proto__: null
475
475
  }, Symbol.toStringTag, { value: "Module" }));
476
476
  function Z(l) {
@@ -504,7 +504,7 @@ class $ {
504
504
  this.content = e, this.style = t, this.classes = s;
505
505
  }
506
506
  }
507
- class me {
507
+ class be {
508
508
  constructor(e = new $(
509
509
  ">",
510
510
  "transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
@@ -525,12 +525,12 @@ class me {
525
525
  this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = i;
526
526
  }
527
527
  }
528
- class be {
528
+ class ye {
529
529
  constructor(e = new $("↑", "", ["ge-header-sorted-asc"]), t = new $("↓", "", ["ge-header-sorted-desc"]), s = new $("↑", "color:transparent;", [])) {
530
530
  this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
531
531
  }
532
532
  }
533
- class Ve {
533
+ class _e {
534
534
  constructor(e) {
535
535
  this.domService = e;
536
536
  }
@@ -618,10 +618,10 @@ class Ve {
618
618
  addColumnDiv(e, t, s = -1, i = -1, o, r, n = "", a, h, d = void 0, c) {
619
619
  const p = h == null ? void 0 : h.treeOptions, g = h == null ? void 0 : h.showCheckboxWihoutExtraColumn, u = this.domService.createElement("div");
620
620
  this.domService.addClass(u, "ge-table-col-div"), this.domService.addClass(u, `ge-table-col-div-${t.index}`), this.domService.setAttribute(u, "data-col-index", `${t.index}`), this.domService.setAttribute(u, "data-row-index", `${s}`), this.domService.setAttribute(u, "data-area", `${o}`);
621
- const y = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
622
- if (o === "body" && r === "center" && this.domService.addClass(u, `ge-table-column-${y}`), this.domService.setStyle(u, "display", "clip"), this.domService.setStyle(u, "position", "absolute"), this.domService.setStyle(u, "left", `${t.left}px`), this.domService.setStyle(u, "top", `${t.top}px`), this.domService.setStyle(u, "width", `${t.width}px`), this.domService.setStyle(u, "height", `${t.height}px`), a && a !== "none" && (this.domService.addClass(u, "ge-table-col-tree"), this.addArrowDiv(u, a, p, s, i, o)), g && i === 0 && d && this.addCheckboxToDiv(u, d, o, s), n) {
623
- const f = a !== "none" && i === 0;
624
- this.addLabelDiv(u, n, f, s, i, o);
621
+ const m = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
622
+ if (o === "body" && r === "center" && this.domService.addClass(u, `ge-table-column-${m}`), this.domService.setStyle(u, "display", "clip"), this.domService.setStyle(u, "position", "absolute"), this.domService.setStyle(u, "left", `${t.left}px`), this.domService.setStyle(u, "top", `${t.top}px`), this.domService.setStyle(u, "width", `${t.width}px`), this.domService.setStyle(u, "height", `${t.height}px`), a && a !== "none" && (this.domService.addClass(u, "ge-table-col-tree"), this.addArrowDiv(u, a, p, s, i, o)), g && i === 0 && d && this.addCheckboxToDiv(u, d, o, s), n) {
623
+ const S = a !== "none" && i === 0;
624
+ this.addLabelDiv(u, n, S, s, i, o);
625
625
  }
626
626
  return c && this.addSortedIcon(u, c, h == null ? void 0 : h.sortedOptions, i), this.domService.appendChild(e, u), u;
627
627
  }
@@ -650,7 +650,7 @@ class Ve {
650
650
  }
651
651
  return this.domService.appendChild(e, n), n;
652
652
  }
653
- addSortedIcon(e, t = "", s = new be(), i = -1) {
653
+ addSortedIcon(e, t = "", s = new ye(), i = -1) {
654
654
  const o = this.domService.createElement("div");
655
655
  this.domService.addClass(o, "ge-table-sorted-icon-div"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "top", "0"), this.domService.setStyle(o, "right", "0"), this.domService.setStyle(o, "width", "20px"), this.domService.setStyle(o, "background", "transparent"), this.domService.setStyle(o, "cursor", "pointer"), this.domService.setAttribute(o, "data-col-index", `${i}`), this.domService.setAttribute(o, "data-area", "header");
656
656
  let r;
@@ -661,7 +661,7 @@ class Ve {
661
661
  this.domService.addClass(o, h);
662
662
  return this.domService.appendChild(e, o), o;
663
663
  }
664
- addArrowDiv(e, t = "none", s = new me(), i = -1, o = -1, r = "body") {
664
+ addArrowDiv(e, t = "none", s = new be(), i = -1, o = -1, r = "body") {
665
665
  const n = this.domService.createElement("div");
666
666
  this.domService.addClass(n, "ge-table-tree-arrow-div"), this.domService.setStyle(n, "display", "inline-block"), this.domService.setStyle(n, "position", ""), this.domService.setStyle(n, "width", "20px"), this.domService.setStyle(n, "background", "transparent"), this.domService.setStyle(n, "cursor", "pointer"), this.domService.setAttribute(n, "data-row-index", `${i}`), this.domService.setAttribute(n, "data-col-index", `${o}`), this.domService.setAttribute(n, "data-area", `${r}`);
667
667
  let a;
@@ -712,7 +712,7 @@ class Ve {
712
712
  }
713
713
  }
714
714
  const ie = (l) => l === "header" ? "header" : l === "footer" ? "footer" : "body";
715
- class _e {
715
+ class ke {
716
716
  constructor(e, t) {
717
717
  if (this.rowIdx = -1, this.colIdx = -1, this.action = null, this.inputType = null, this.className = "", e !== null && (e instanceof HTMLDivElement || e instanceof HTMLSpanElement || e instanceof HTMLInputElement)) {
718
718
  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"));
@@ -724,19 +724,33 @@ class _e {
724
724
  }
725
725
  }
726
726
  }
727
- class ke {
727
+ class Ge {
728
728
  constructor(e) {
729
729
  this.tableScope = e, this.expandedAll = !0, this.mouseDown = !1, this.dragging = !1, this.tableScope.hostElement.addEventListener("click", this.onHostElementClicked.bind(this)), this.tableScope.hostElement.addEventListener("dblclick", this.onHostElementDblClicked.bind(this)), this.tableScope.hostElement.addEventListener("mousedown", this.onMouseDown.bind(this)), this.tableScope.hostElement.addEventListener("mousemove", this.onMouseMove.bind(this)), this.tableScope.hostElement.addEventListener("mouseup", this.onMouseUp.bind(this)), this.tableScope.hostElement.addEventListener("contextmenu", this.onContextmenu.bind(this)), this.tableScope.hostElement._MouseHandler = "true", this.tableScope.scrollViewport.addEventListener("scroll", this.tableScope.adjustAfterScrolling.bind(this.tableScope)), [window, this.tableScope.hostElement].forEach(
730
730
  (t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
731
731
  );
732
732
  }
733
+ /**
734
+ * Handles the "contextmenu" event.
735
+ *
736
+ * @private
737
+ * @param {MouseEvent} evt - The mouse event object.
738
+ * @return {void}
739
+ */
733
740
  onContextmenu(e) {
734
741
  this.mouseEvent = e;
735
742
  const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
736
743
  this.tableScope.contextmenu(t);
737
744
  }
745
+ /**
746
+ * Handles the click event on the host element.
747
+ *
748
+ * @param {MouseEvent} event - The click event.
749
+ *
750
+ * @return {void}
751
+ */
738
752
  onHostElementClicked(e) {
739
- const t = new _e(e.target, this.tableScope);
753
+ const t = new ke(e.target, this.tableScope);
740
754
  if (t.action === "toggleExpandCollapseAll")
741
755
  this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
742
756
  else if (t.inputType === "checkbox" && t.areaIdent)
@@ -755,6 +769,12 @@ class ke {
755
769
  }
756
770
  this.publishGeMouseEvent(e, 1);
757
771
  }
772
+ /**
773
+ * Handles the double click event on the host element.
774
+ * This method is private.
775
+ *
776
+ * @param {MouseEvent} event - The double click event.
777
+ */
758
778
  onHostElementDblClicked(e) {
759
779
  if (e.target instanceof HTMLElement) {
760
780
  const t = e.target, s = t.getAttribute("data-area"), i = ie(s), o = Number(t.getAttribute("data-row-index")), r = Number(t.getAttribute("data-col-index")), n = this.tableScope.tableModel.getAreaModel(i);
@@ -771,10 +791,24 @@ class ke {
771
791
  }
772
792
  this.publishGeMouseEvent(e, 2);
773
793
  }
794
+ /**
795
+ * Publishes a GeMouseEvent.
796
+ *
797
+ * @param {MouseEvent} event - The MouseEvent to publish.
798
+ * @param {number} clickCount - The number of clicks for the GeMouseEvent.
799
+ *
800
+ * @return {void}
801
+ */
774
802
  publishGeMouseEvent(e, t) {
775
803
  var s;
776
804
  this.mouseEvent = e, this.geMouseEventOld = (s = this.geMouseEvent) == null ? void 0 : s.clone(), this.geMouseEvent = this.tableScope.createGeMouseEvent(e), this.geMouseEvent && (this.geMouseEvent.clickCount = t), this.tableScope.onMouseClicked(this.geMouseEvent, this.geMouseEventOld);
777
805
  }
806
+ /**
807
+ * Update the collapsed/expanded state of a tree row.
808
+ *
809
+ * @param {TreeRowIf<any>} tr - The tree row object.
810
+ * @returns {void}
811
+ */
778
812
  updateCollapsedExpandedState(e) {
779
813
  var s, i, o, r, n;
780
814
  const t = (i = (s = this.tableScope.tableOptions) == null ? void 0 : s.autoRestoreOptions) == null ? void 0 : i.getRowId;
@@ -816,35 +850,107 @@ class ke {
816
850
  }
817
851
  }
818
852
  }
819
- class Ge {
853
+ class Ne {
820
854
  constructor(e) {
821
855
  this.tableScope = e;
822
856
  }
857
+ /**
858
+ * Updates the cells in the table based on the provided events.
859
+ *
860
+ * @param {TableCellUpdateEventIf[]} events - The array of events representing the updates to perform on the cells.
861
+ * @param {boolean} [repaintAll=false] - Optional parameter indicating whether to repaint all cells or not. Default value is false. If true, the full table will be rendered. If false, the table cell will be rendered immediately.
862
+ *
863
+ * @return {void} - This method doesn't return anything.
864
+ */
823
865
  updateCells(e, t = !1) {
824
866
  this.tableScope.updateCells(e, t);
825
867
  }
868
+ /**
869
+ * Notifies that the external filter has changed.
870
+ *
871
+ * @return {void}
872
+ */
826
873
  externalFilterChanged() {
827
874
  this.tableScope.externalFilterChanged();
828
875
  }
876
+ /**
877
+ * Scrolls the table body to the specified pixel coordinates.
878
+ *
879
+ * @param {number} _px - The horizontal pixel coordinate to scroll to. Defaults to 0.
880
+ * @param {number} _py - The vertical pixel coordinate to scroll to. Defaults to 0.
881
+ * @return {void}
882
+ */
829
883
  scrollToPixel(e = 0, t = 0) {
830
884
  }
885
+ /**
886
+ * Scrolls to the specified index in both horizontal and vertical directions.
887
+ *
888
+ * @param {number} _indexX - The index of the column to scroll to in the horizontal direction. Default is 0.
889
+ * @param {number} _indexY - The index of the row to scroll to in the vertical direction. Default is 0.
890
+ *
891
+ * @return undefined
892
+ */
831
893
  scrollToIndex(e = 0, t = 0) {
832
894
  }
895
+ /**
896
+ * Sets whether the header is visible or not.
897
+ *
898
+ * @param _visible - A boolean value indicating whether the header should be visible. Default value is true.
899
+ *
900
+ * @return undefined
901
+ */
833
902
  setHeaderVisible(e = !0) {
834
903
  }
904
+ /**
905
+ * Sets the visibility of a column in the table.
906
+ *
907
+ * @param {_column} - The column index or column definition to set visibility for.
908
+ * @param {_visible=true} - The flag to set visibility to. true for visible, false for hidden.
909
+ *
910
+ * @return {void} - There is no return value.
911
+ */
835
912
  setColumnVisible(e, t = !0) {
836
913
  }
914
+ /**
915
+ * Returns whether a column is visible or not.
916
+ *
917
+ * @param {number | ColumnDefIf} _column - The column index or the column definition.
918
+ * @return {boolean} - True if the column is visible, false otherwise.
919
+ */
837
920
  isColumnVisible(e) {
838
921
  return !0;
839
922
  }
923
+ /**
924
+ * Checks if the header is visible.
925
+ *
926
+ * @return {boolean} - Returns true if the header is visible, otherwise returns false.
927
+ */
840
928
  isHeaderVisible() {
841
929
  return !0;
842
930
  }
931
+ /**
932
+ * Sets the visibility of the footer.
933
+ *
934
+ * @param {boolean} _visible - Indicates whether the footer should be visible or not. Default value is true.
935
+ *
936
+ * @return {void} - This method does not return any value.
937
+ */
843
938
  setFooterVisible(e = !0) {
844
939
  }
940
+ /**
941
+ * Determines if the footer is visible.
942
+ *
943
+ * @returns {boolean} True if the footer is visible, false otherwise.
944
+ */
845
945
  isFooterVisible() {
846
946
  return !0;
847
947
  }
948
+ /**
949
+ * Repaints the table.
950
+ *
951
+ * This method calls the repaint method of the tableScope object
952
+ * to update and redraw the table based on the latest data.
953
+ */
848
954
  repaint() {
849
955
  this.tableScope.repaint();
850
956
  }
@@ -924,7 +1030,7 @@ class oe {
924
1030
  // }
925
1031
  // }
926
1032
  }
927
- class Ne extends oe {
1033
+ class je extends oe {
928
1034
  constructor(e) {
929
1035
  super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
930
1036
  }
@@ -946,14 +1052,14 @@ class Ne extends oe {
946
1052
  }
947
1053
  }
948
1054
  }
949
- class je {
1055
+ class Xe {
950
1056
  constructor(e = "collapsed", t = [], s = !1, i = !1) {
951
1057
  this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = i;
952
1058
  }
953
1059
  }
954
- class Xe extends oe {
1060
+ class Ke extends oe {
955
1061
  constructor(e) {
956
- super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new je(), this.load();
1062
+ super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new Xe(), this.load();
957
1063
  }
958
1064
  collapsedExpandedStateGet() {
959
1065
  return this.collapsedExpandedState;
@@ -985,7 +1091,7 @@ class Xe extends oe {
985
1091
  this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
986
1092
  }
987
1093
  }
988
- class Ke extends oe {
1094
+ class ze extends oe {
989
1095
  constructor(e) {
990
1096
  super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
991
1097
  }
@@ -1012,7 +1118,7 @@ class O {
1012
1118
  this.left = e, this.width = t, this.height = s, this.top = i, this.index = o;
1013
1119
  }
1014
1120
  }
1015
- class ze {
1121
+ class Ye {
1016
1122
  constructor(e, t, s, i) {
1017
1123
  this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = i, this.scrollTop = 0, this.areaBodyWestGeo = new O(), this.areaBodyCenterGeo = new O(), this.areaBodyEastGeo = new O();
1018
1124
  const o = this.hostElement;
@@ -1163,12 +1269,21 @@ class ze {
1163
1269
  this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", t);
1164
1270
  }
1165
1271
  }
1166
- class T {
1272
+ class D {
1273
+ /**
1274
+ * Represents a constructor for a class.
1275
+ * @constructor
1276
+ * @param {number} r1 - The value for r1.
1277
+ * @param {number} c1 - The value for c1.
1278
+ * @param {number} r2 - The value for r2.
1279
+ * @param {number} c2 - The value for c2.
1280
+ * @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
1281
+ */
1167
1282
  constructor(e, t, s, i, o = !1) {
1168
1283
  this.r1 = e, this.c1 = t, this.r2 = s, this.c2 = i, this.gammaRange = o;
1169
1284
  }
1170
1285
  static create(e) {
1171
- return e.gammaRange === void 0 && (e.gammaRange = !1), new T(
1286
+ return e.gammaRange === void 0 && (e.gammaRange = !1), new D(
1172
1287
  e.rowIndex1,
1173
1288
  e.columnIndex1,
1174
1289
  e.rowIndex2,
@@ -1177,19 +1292,19 @@ class T {
1177
1292
  );
1178
1293
  }
1179
1294
  static singleCell(e, t) {
1180
- return new T(e, t, e, t);
1295
+ return new D(e, t, e, t);
1181
1296
  }
1182
1297
  static singleRow(e) {
1183
- return new T(e, 0, e, Number.MAX_SAFE_INTEGER);
1298
+ return new D(e, 0, e, Number.MAX_SAFE_INTEGER);
1184
1299
  }
1185
1300
  static singleColumn(e) {
1186
- return new T(0, e, Number.MAX_SAFE_INTEGER, e);
1301
+ return new D(0, e, Number.MAX_SAFE_INTEGER, e);
1187
1302
  }
1188
1303
  isInRange(e, t) {
1189
1304
  return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
1190
1305
  }
1191
1306
  }
1192
- class Ye {
1307
+ class Ue {
1193
1308
  constructor(e, t) {
1194
1309
  this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
1195
1310
  }
@@ -1205,7 +1320,7 @@ class Ye {
1205
1320
  o === 0 && (o = 1), r === 0 && (r = 1);
1206
1321
  const n = this.areaModel.hasOwnProperty("gammaCells");
1207
1322
  this.colAndRowspanRanges.push(
1208
- new T(s, i, s + r - 1, i + o - 1, n)
1323
+ new D(s, i, s + r - 1, i + o - 1, n)
1209
1324
  );
1210
1325
  }
1211
1326
  }
@@ -1222,22 +1337,22 @@ class Ye {
1222
1337
  return !1;
1223
1338
  }
1224
1339
  }
1225
- class Ue {
1340
+ class qe {
1226
1341
  constructor(e, t, s) {
1227
1342
  this.header = e, this.body = t, this.footer = s;
1228
1343
  }
1229
1344
  }
1230
- class qe extends ze {
1345
+ class Je extends Ye {
1231
1346
  constructor(e, t, s, i) {
1232
1347
  var r, n;
1233
1348
  super(e, t, s, i), this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
1234
1349
  header: [],
1235
1350
  body: [],
1236
1351
  footer: []
1237
- }, this.tree = !1, this.colAndRowspanModels = new Ue(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.editing = !1, this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (r = this.tableOptions) != null && r.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (n = this.tableOptions) != null && n.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), ee(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
1352
+ }, this.tree = !1, this.colAndRowspanModels = new qe(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.editing = !1, this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (r = this.tableOptions) != null && r.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (n = this.tableOptions) != null && n.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), ee(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
1238
1353
  (a) => {
1239
1354
  var h;
1240
- this.colAndRowspanModels[a] = new Ye(t, t.getAreaModel(a)), (h = this.colAndRowspanModels[a]) == null || h.init();
1355
+ this.colAndRowspanModels[a] = new Ue(t, t.getAreaModel(a)), (h = this.colAndRowspanModels[a]) == null || h.init();
1241
1356
  }
1242
1357
  );
1243
1358
  }
@@ -1356,87 +1471,87 @@ class qe extends ze {
1356
1471
  return "";
1357
1472
  }
1358
1473
  adjustArea(e, t = 0) {
1359
- var f;
1474
+ var S;
1360
1475
  const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"), r = i.child.clientHeight;
1361
1476
  s.child.innerText = "", i.child.innerText = "", o.child.innerText = "";
1362
1477
  const n = 0, a = this.areaBodyCenterGeo.width, h = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), c = d.getRowCount();
1363
1478
  for (; this.cleanupFunctions[e].length; ) {
1364
- const S = this.cleanupFunctions[e].shift();
1365
- S && S();
1479
+ const f = this.cleanupFunctions[e].shift();
1480
+ f && f();
1366
1481
  }
1367
1482
  let p = t;
1368
- const g = this.tableModel.getColumnCount(), u = this.tableModel.getFixedRightColumnCount(), y = this.tableModel.getFixedLeftColumnCount();
1369
- for (let S = 0; S < c; S++) {
1370
- const C = p, x = S === c - 1, M = this.tableModel.getRowHeight(e, S);
1371
- if (C + M > 0) {
1372
- this.firstVisibleRowIndex = S;
1373
- let w = { left: n, width: a, height: M, top: C, index: S }, m = this.dom.addRowDiv(i, w, S, e, "center");
1374
- const I = y;
1483
+ const g = this.tableModel.getColumnCount(), u = this.tableModel.getFixedRightColumnCount(), m = this.tableModel.getFixedLeftColumnCount();
1484
+ for (let f = 0; f < c; f++) {
1485
+ const M = p, C = f === c - 1, E = this.tableModel.getRowHeight(e, f);
1486
+ if (M + E > 0) {
1487
+ this.firstVisibleRowIndex = f;
1488
+ let v = { left: n, width: a, height: E, top: M, index: f }, w = this.dom.addRowDiv(i, v, f, e, "center");
1489
+ const R = m;
1375
1490
  if (this.adjustColumnsToRowParent({
1376
1491
  areaIdent: e,
1377
1492
  sideIdent: "center",
1378
1493
  areaModel: d,
1379
- geo: w,
1380
- parent: m,
1381
- rowIndex: S,
1382
- columnIndexStart: I,
1494
+ geo: v,
1495
+ parent: w,
1496
+ rowIndex: f,
1497
+ columnIndexStart: R,
1383
1498
  columnIndexEnd: g - u - 1,
1384
1499
  verticalFixed: !1,
1385
- lastRowOfModel: x
1386
- }), h.left > 0 && (w = { left: n, width: this.areaBodyWestGeo.width, height: M, top: C, index: S }, m = this.dom.addRowDiv(s, w, S, e, "west"), this.adjustColumnsToRowParent({
1500
+ lastRowOfModel: C
1501
+ }), h.left > 0 && (v = { left: n, width: this.areaBodyWestGeo.width, height: E, top: M, index: f }, w = this.dom.addRowDiv(s, v, f, e, "west"), this.adjustColumnsToRowParent({
1387
1502
  areaIdent: e,
1388
1503
  sideIdent: "west",
1389
1504
  areaModel: d,
1390
- geo: w,
1391
- parent: m,
1392
- rowIndex: S,
1505
+ geo: v,
1506
+ parent: w,
1507
+ rowIndex: f,
1393
1508
  columnIndexStart: 0,
1394
- columnIndexEnd: I - 1,
1509
+ columnIndexEnd: R - 1,
1395
1510
  verticalFixed: !0,
1396
- lastRowOfModel: x
1397
- })), h.right > 0 && (w = { left: n, width: this.areaBodyEastGeo.width, height: M, top: C, index: S }, m = this.dom.addRowDiv(o, w, S, e, "east"), this.adjustColumnsToRowParent({
1511
+ lastRowOfModel: C
1512
+ })), h.right > 0 && (v = { left: n, width: this.areaBodyEastGeo.width, height: E, top: M, index: f }, w = this.dom.addRowDiv(o, v, f, e, "east"), this.adjustColumnsToRowParent({
1398
1513
  areaIdent: e,
1399
1514
  sideIdent: "east",
1400
1515
  areaModel: d,
1401
- geo: w,
1402
- parent: m,
1403
- rowIndex: S,
1516
+ geo: v,
1517
+ parent: w,
1518
+ rowIndex: f,
1404
1519
  columnIndexStart: g - u,
1405
1520
  columnIndexEnd: g - 1,
1406
1521
  verticalFixed: !0,
1407
- lastRowOfModel: x
1408
- })), e === "header" && this.tree && S === c - 1) {
1409
- const R = this.dom.applyStyle(
1522
+ lastRowOfModel: C
1523
+ })), e === "header" && this.tree && f === c - 1) {
1524
+ const T = this.dom.applyStyle(
1410
1525
  this.dom.setAttribute(
1411
- this.dom.addDiv(m, new O(16, 20, 20, 8)),
1526
+ this.dom.addDiv(w, new O(16, 20, 20, 8)),
1412
1527
  "data-ge-action",
1413
1528
  "toggleExpandCollapseAll"
1414
1529
  ),
1415
1530
  { cursor: "pointer" }
1416
- ), D = this.tableOptions.treeOptions.arrowExpandCollapseAll;
1417
- if (D) {
1418
- const V = this.dom.domService.createText(D.content);
1419
- this.dom.domService.appendChild(R, V), D.style && this.dom.applyStyleString(R, D.style);
1531
+ ), I = this.tableOptions.treeOptions.arrowExpandCollapseAll;
1532
+ if (I) {
1533
+ const V = this.dom.domService.createText(I.content);
1534
+ this.dom.domService.appendChild(T, V), I.style && this.dom.applyStyleString(T, I.style);
1420
1535
  }
1421
1536
  }
1422
1537
  }
1423
- if (p = p + M, p > r)
1538
+ if (p = p + E, p > r)
1424
1539
  break;
1425
1540
  }
1426
1541
  if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
1427
- const S = ((f = this.colAndRowspanModels[e]) == null ? void 0 : f.getRanges()) ?? [];
1428
- if (S.length)
1429
- for (const C of S) {
1430
- let x = 0, M = i.child, w = "center";
1431
- if (C.c1 < y)
1432
- M = s.child, w = "west";
1433
- else if (u > 0 && C.c1 >= g - u)
1434
- M = o.child, w = "east";
1542
+ const f = ((S = this.colAndRowspanModels[e]) == null ? void 0 : S.getRanges()) ?? [];
1543
+ if (f.length)
1544
+ for (const M of f) {
1545
+ let C = 0, E = i.child, v = "center";
1546
+ if (M.c1 < m)
1547
+ E = s.child, v = "west";
1548
+ else if (u > 0 && M.c1 >= g - u)
1549
+ E = o.child, v = "east";
1435
1550
  else {
1436
- const m = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1437
- x = this.scrollFactorX * m - this.areaBodyWestGeo.width, w = "center";
1551
+ const w = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1552
+ C = this.scrollFactorX * w - this.areaBodyWestGeo.width, v = "center";
1438
1553
  }
1439
- this.drawBigCell(C, x, t, d, M, w);
1554
+ this.drawBigCell(M, C, t, d, E, v);
1440
1555
  }
1441
1556
  }
1442
1557
  }
@@ -1451,13 +1566,13 @@ class qe extends ze {
1451
1566
  * @protected
1452
1567
  */
1453
1568
  drawBigCell(e, t, s, i, o, r) {
1454
- const n = s + this.getRowHeights(0, e.r1 - 1, i).reduce((f, S) => f + S, 0), a = this.tableModel.getColumnCount(), h = this.tableModel.getFixedRightColumnCount();
1569
+ const n = s + this.getRowHeights(0, e.r1 - 1, i).reduce((S, f) => S + f, 0), a = this.tableModel.getColumnCount(), h = this.tableModel.getFixedRightColumnCount();
1455
1570
  let d = 0;
1456
1571
  h > 0 && e.c1 >= a - h && (d = a - h);
1457
- const c = t + this.getColumnWidths(d, e.c1 - 1).reduce((f, S) => f + S, 0), p = this.getRowHeights(e.r1, e.r2, i).reduce((f, S) => f + S, 0), g = this.getColumnWidths(e.c1, e.c2).reduce((f, S) => f + S, 0);
1572
+ const c = t + this.getColumnWidths(d, e.c1 - 1).reduce((S, f) => S + f, 0), p = this.getRowHeights(e.r1, e.r2, i).reduce((S, f) => S + f, 0), g = this.getColumnWidths(e.c1, e.c2).reduce((S, f) => S + f, 0);
1458
1573
  let u = !1;
1459
- const y = this.getSelectionModel ? this.getSelectionModel() : void 0;
1460
- y && (u = y.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? (console.info("TODO here", e), this.renderCell({
1574
+ const m = this.getSelectionModel ? this.getSelectionModel() : void 0;
1575
+ m && (u = m.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? (console.info("TODO here", e), this.renderCell({
1461
1576
  areaModel: i,
1462
1577
  areaIdent: i.areaIdent,
1463
1578
  sideIdent: r,
@@ -1518,56 +1633,56 @@ class qe extends ze {
1518
1633
  verticalFixed: h = !1,
1519
1634
  lastRowOfModel: d = !1
1520
1635
  }) {
1521
- var y;
1636
+ var m;
1522
1637
  this.scrollViewportLeft = this.scrollViewport.scrollLeft;
1523
1638
  let c = 0;
1524
1639
  if (!h) {
1525
- const f = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1526
- c = this.scrollFactorX * f;
1640
+ const S = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1641
+ c = this.scrollFactorX * S;
1527
1642
  }
1528
1643
  const p = 0, g = !!(e === "body" && t);
1529
1644
  let u = c;
1530
- for (let f = n; f <= a; f++) {
1531
- const S = u, C = this.tableModel.getColumnWidth(f);
1532
- if (C > 0 && S + C > 0) {
1533
- let x = i.height;
1534
- const M = s.getRowspanAt(r, f), w = s.getColspanAt(r, f);
1535
- M > 1 && (x = this.getRowHeights(r, r + M - 1, s).reduce((R, D) => R + D, 0));
1536
- let m = C;
1537
- w > 1 && (m = this.getColumnWidths(f, f + w - 1).reduce((R, D) => R + D, 0));
1538
- let I = !1;
1539
- if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (y = this.colAndRowspanModels[e]) != null && y.isInRange(r, f) && (I = !0), this.draggingTargetColumnIndex === f && e !== "header") {
1540
- this.renderDragTargetDiv(o, S, p, m, x);
1541
- const R = { left: S, top: p, width: m, height: x };
1542
- this.dom.addColumnBorderDivs(this.tableOptions, o, R, e, t);
1645
+ for (let S = n; S <= a; S++) {
1646
+ const f = u, M = this.tableModel.getColumnWidth(S);
1647
+ if (M > 0 && f + M > 0) {
1648
+ let C = i.height;
1649
+ const E = s.getRowspanAt(r, S), v = s.getColspanAt(r, S);
1650
+ E > 1 && (C = this.getRowHeights(r, r + E - 1, s).reduce((T, I) => T + I, 0));
1651
+ let w = M;
1652
+ v > 1 && (w = this.getColumnWidths(S, S + v - 1).reduce((T, I) => T + I, 0));
1653
+ let R = !1;
1654
+ if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (m = this.colAndRowspanModels[e]) != null && m.isInRange(r, S) && (R = !0), this.draggingTargetColumnIndex === S && e !== "header") {
1655
+ this.renderDragTargetDiv(o, f, p, w, C);
1656
+ const T = { left: f, top: p, width: w, height: C };
1657
+ this.dom.addColumnBorderDivs(this.tableOptions, o, T, e, t);
1543
1658
  } else {
1544
- const R = this.renderSelectedBackgroundDiv(I, g, t, s, r, f, o, S, p, m, x);
1545
- I || this.renderCell({
1659
+ const T = this.renderSelectedBackgroundDiv(R, g, t, s, r, S, o, f, p, w, C);
1660
+ R || this.renderCell({
1546
1661
  areaModel: s,
1547
1662
  areaIdent: e,
1548
1663
  sideIdent: t,
1549
1664
  rowIndex: r,
1550
- columnIndex: f,
1551
- left: S,
1665
+ columnIndex: S,
1666
+ left: f,
1552
1667
  top: p,
1553
- width: m,
1554
- height: x,
1668
+ width: w,
1669
+ height: C,
1555
1670
  parent: o,
1556
- cellSelected: R,
1671
+ cellSelected: T,
1557
1672
  lastRowOfModel: d,
1558
1673
  gammaRange: !0
1559
1674
  }), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
1560
1675
  rowIndex: r,
1561
- columnIndex: f,
1562
- cellLeft: S,
1676
+ columnIndex: S,
1677
+ cellLeft: f,
1563
1678
  cellTop: p,
1564
- cellWidth: m,
1565
- cellHeight: x,
1679
+ cellWidth: w,
1680
+ cellHeight: C,
1566
1681
  parent: o
1567
1682
  });
1568
1683
  }
1569
1684
  }
1570
- if (u = u + C, u > this.areaBodyCenterGeo.width)
1685
+ if (u = u + M, u > this.areaBodyCenterGeo.width)
1571
1686
  break;
1572
1687
  }
1573
1688
  this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new O(u - 1, 1, i.height, 0), o);
@@ -1586,49 +1701,50 @@ class qe extends ze {
1586
1701
  height: a,
1587
1702
  top: h,
1588
1703
  parent: d,
1589
- lastRowOfModel: c
1704
+ lastRowOfModel: c,
1705
+ gammaRange: p
1590
1706
  }) {
1591
- var ne;
1592
- const g = this.editorRenderer && this.editorRendererRow === i && this.editorRendererColumn === o ? this.editorRenderer : e.getCellRenderer(i, o), u = { left: r, width: n, height: a, top: h, index: o }, y = e.getRowByIndex(i);
1707
+ var ae;
1708
+ const u = this.editorRenderer && this.editorRendererRow === i && this.editorRendererColumn === o ? this.editorRenderer : e.getCellRenderer(i, o), m = { left: r, width: n, height: a, top: h, index: o }, S = e.getRowByIndex(i);
1593
1709
  let f = "none";
1594
- if (o === this.getTreeArrowColumnIndex() && Z(y)) {
1595
- const v = y;
1596
- (ne = v.children) != null && ne.length ? v.expanded ? f = "expanded" : f = "collapsed" : f = "hidden";
1710
+ if (o === this.getTreeArrowColumnIndex() && Z(S)) {
1711
+ const y = S;
1712
+ (ae = y.children) != null && ae.length ? y.expanded ? f = "expanded" : f = "collapsed" : f = "hidden";
1597
1713
  }
1598
1714
  let C;
1599
1715
  if (t === "header") {
1600
- const v = this.tableModel.getColumnDef(o);
1601
- (!(v != null && v.sortIconVisible) || v != null && v.sortIconVisible()) && (C = v == null ? void 0 : v.sortState);
1716
+ const y = this.tableModel.getColumnDef(o);
1717
+ (!(y != null && y.sortIconVisible) || y != null && y.sortIconVisible()) && (C = y == null ? void 0 : y.sortState);
1602
1718
  }
1603
- const x = e.getValueAt(i, o), M = g ? "" : `${x}`, w = e.isRowChecked(i), m = this.dom.addColumnDiv(
1719
+ const E = e.getValueAt(i, o), v = u ? "" : `${E}`, w = e.isRowChecked(i), R = this.dom.addColumnDiv(
1604
1720
  d,
1605
- u,
1721
+ m,
1606
1722
  i,
1607
1723
  o,
1608
1724
  t,
1609
1725
  s,
1610
- M,
1726
+ v,
1611
1727
  f,
1612
1728
  this.tableOptions,
1613
1729
  w,
1614
1730
  C
1615
- ), I = e.getTooltipAt(i, o);
1616
- I && this.dom.setAttribute(m, "title", I);
1617
- const R = this.tableModel.getColumnDef(o);
1618
- R && R.classes[t] && this.dom.addClasses(R.classes[t], m);
1619
- let D;
1620
- g && (D = g.render(m, i, o, t, e, x, this.dom.domService));
1621
- const V = e.getCustomClassesAt(i, o);
1622
- if (V.length && this.dom.addClasses(V, m), this.dom.addColumnBorderDivs(this.tableOptions, d, u, t, s), c && this.dom.addHorizontalBorder({ left: r, width: n, height: a, top: h + a }, d), this.getFocusModel && t === "body") {
1623
- const v = this.getFocusModel();
1624
- v != null && v.hasFocus(i, o) && this.dom.addFocusBorderDivs(d, u, {});
1731
+ ), T = e.getTooltipAt(i, o);
1732
+ T && this.dom.setAttribute(R, "title", T);
1733
+ const I = this.tableModel.getColumnDef(o);
1734
+ I && I.classes[t] && this.dom.addClasses(I.classes[t], R);
1735
+ let V;
1736
+ u && (V = u.render(R, i, o, t, e, E, this.dom.domService));
1737
+ const ne = e.getCustomClassesAt(i, o);
1738
+ if (ne.length && this.dom.addClasses(ne, R), this.dom.addColumnBorderDivs(this.tableOptions, d, m, t, s), c && this.dom.addHorizontalBorder({ left: r, width: n, height: a, top: h + a }, d), this.getFocusModel && t === "body") {
1739
+ const y = this.getFocusModel();
1740
+ y != null && y.hasFocus(i, o) && this.dom.addFocusBorderDivs(d, m, {});
1625
1741
  }
1626
- t === "header" && this.dom.setAttribute(m, "data-ge-action", "drag-column");
1742
+ t === "header" && this.dom.setAttribute(R, "data-ge-action", "drag-column");
1627
1743
  const z = e.getCustomStyleAt(i, o);
1628
1744
  if (z)
1629
- for (const v in z)
1630
- this.dom.setStyle(m, v, z[v]);
1631
- return [m, D];
1745
+ for (const y in z)
1746
+ this.dom.setStyle(R, y, z[y]);
1747
+ return [R, V];
1632
1748
  }
1633
1749
  applyCssClasses(e, t = {}) {
1634
1750
  e && Object.entries(t).forEach(([s, i]) => {
@@ -1718,12 +1834,12 @@ class qe extends ze {
1718
1834
  if (g) {
1719
1835
  const u = g.getSelectionCount(o, r);
1720
1836
  p = u > 0;
1721
- for (let y = 0; y < u; y++) {
1722
- const f = this.dom.applyStylePosistionAbsolute(
1837
+ for (let m = 0; m < u; m++) {
1838
+ const S = this.dom.applyStylePosistionAbsolute(
1723
1839
  // ge-table-body-west-selected-range
1724
1840
  this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`, n)
1725
1841
  );
1726
- this.dom.setStyle(f, "left", `${a}px`), this.dom.setStyle(f, "top", `${h}px`), this.dom.setStyle(f, "width", `${d}px`), this.dom.setStyle(f, "height", `${c}px`);
1842
+ this.dom.setStyle(S, "left", `${a}px`), this.dom.setStyle(S, "top", `${h}px`), this.dom.setStyle(S, "width", `${d}px`), this.dom.setStyle(S, "height", `${c}px`);
1727
1843
  }
1728
1844
  }
1729
1845
  }
@@ -1744,7 +1860,7 @@ class qe extends ze {
1744
1860
  lastRowOfModel: p,
1745
1861
  gammaRange: g
1746
1862
  }) {
1747
- const [u, y] = this.addAndRenderCellDiv({
1863
+ const [u, m] = this.addAndRenderCellDiv({
1748
1864
  areaModel: e,
1749
1865
  areaIdent: t,
1750
1866
  sideIdent: s,
@@ -1758,22 +1874,30 @@ class qe extends ze {
1758
1874
  lastRowOfModel: p,
1759
1875
  gammaRange: g
1760
1876
  });
1761
- c && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, u), y && this.cleanupFunctions[t].push(y);
1877
+ c && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, u), m && this.cleanupFunctions[t].push(m);
1762
1878
  }
1763
1879
  renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight: r, parent: n }) {
1764
1880
  const a = this.dom.domService, h = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = a.createElement("div");
1765
1881
  a.setAttribute(d, "data-col-index", `${t}`), a.setAttribute(d, "data-row-index", `${e}`), a.setAttribute(d, "data-area", "header"), a.setAttribute(d, "data-ge-action", "resize-column"), a.addClass(d, "ge-table-column-resize-handle"), a.setStyle(d, "display", "clip"), a.setStyle(d, "position", "absolute"), a.setStyle(d, "cursor", "col-resize"), a.setStyle(d, "left", `${s + o - h}px`), a.setStyle(d, "top", `${i}px`), a.setStyle(d, "width", `${h}px`), a.setStyle(d, "height", `${r}px`), a.appendChild(n, d);
1766
1882
  }
1767
1883
  }
1768
- class Je {
1884
+ class Qe {
1769
1885
  constructor(e, t) {
1770
1886
  this.columnIndex = e, this.sortState = t;
1771
1887
  }
1772
1888
  }
1773
- class Qe {
1889
+ class Ze {
1774
1890
  constructor(e) {
1775
1891
  this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
1776
1892
  }
1893
+ /**
1894
+ * Handles the onHostElementChanged event.
1895
+ * In case that the element is an input field, the tableScope.updateModelValueAfterEdit() method is triggered.
1896
+ *
1897
+ * @param {Event} event - The event object.
1898
+ *
1899
+ * @return {void}
1900
+ */
1777
1901
  onHostElementChanged(e) {
1778
1902
  if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
1779
1903
  const t = e.target, s = t.getAttribute("data-area"), i = t.getAttribute("data-row-index"), o = t.getAttribute("data-col-index");
@@ -1784,7 +1908,7 @@ class Qe {
1784
1908
  }
1785
1909
  }
1786
1910
  }
1787
- class Ze {
1911
+ class et {
1788
1912
  constructor(e = -1, t = -1) {
1789
1913
  this.rowIndex = e, this.columnIndex = t;
1790
1914
  }
@@ -1794,10 +1918,10 @@ class le {
1794
1918
  this.cells = e;
1795
1919
  }
1796
1920
  static createSingle(e, t) {
1797
- return new le([new Ze(e, t)]);
1921
+ return new le([new et(e, t)]);
1798
1922
  }
1799
1923
  }
1800
- class et {
1924
+ class tt {
1801
1925
  constructor(e) {
1802
1926
  var t, s;
1803
1927
  this.tableScope = e, (t = this.tableScope.tableOptions) != null && t.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), (s = this.tableScope.tableOptions) != null && s.getFocusModel && (this.getFocusModel = this.tableScope.tableOptions.getFocusModel);
@@ -1807,7 +1931,7 @@ class et {
1807
1931
  let s = !1, i = !1;
1808
1932
  if (this.getSelectionModel && this.getFocusModel) {
1809
1933
  const p = this.getSelectionModel(), g = this.getFocusModel();
1810
- p && g && (g.hasFocus(e.rowIndex, e.columnIndex) || (g.setFocus(e.rowIndex, e.columnIndex), s = !0), (o = e.originalEvent) != null && o.shiftKey || p.hasSelection() && (p.clear(), s = !0), (r = e.originalEvent) != null && r.shiftKey && this.previousEvt ? (p.addSelection(this.createRangeByEvents(e, this.previousEvt)), i = !0, s = !0) : (n = e.originalEvent) != null && n.ctrlKey || (a = e.originalEvent) != null && a.metaKey ? (p.addSelection(T.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0) : (h = e.originalEvent) != null && h.altKey && ((d = e.originalEvent) != null && d.ctrlKey || (c = e.originalEvent) != null && c.metaKey) && (p.removeSelection(T.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0));
1934
+ p && g && (g.hasFocus(e.rowIndex, e.columnIndex) || (g.setFocus(e.rowIndex, e.columnIndex), s = !0), (o = e.originalEvent) != null && o.shiftKey || p.hasSelection() && (p.clear(), s = !0), (r = e.originalEvent) != null && r.shiftKey && this.previousEvt ? (p.addSelection(this.createRangeByEvents(e, this.previousEvt)), i = !0, s = !0) : (n = e.originalEvent) != null && n.ctrlKey || (a = e.originalEvent) != null && a.metaKey ? (p.addSelection(D.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0) : (h = e.originalEvent) != null && h.altKey && ((d = e.originalEvent) != null && d.ctrlKey || (c = e.originalEvent) != null && c.metaKey) && (p.removeSelection(D.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0));
1811
1935
  }
1812
1936
  return i ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
1813
1937
  }
@@ -1830,7 +1954,7 @@ class et {
1830
1954
  createRangeByEvents(e, t) {
1831
1955
  t || (t = e);
1832
1956
  const s = Math.min(e.rowIndex, t == null ? void 0 : t.rowIndex), i = Math.max(e.rowIndex, t == null ? void 0 : t.rowIndex), o = Math.min(e.columnIndex, t == null ? void 0 : t.columnIndex), r = Math.max(e.columnIndex, t == null ? void 0 : t.columnIndex);
1833
- return T.create({
1957
+ return D.create({
1834
1958
  rowIndex1: s,
1835
1959
  columnIndex1: o,
1836
1960
  rowIndex2: i,
@@ -1838,7 +1962,7 @@ class et {
1838
1962
  });
1839
1963
  }
1840
1964
  }
1841
- class tt {
1965
+ class st {
1842
1966
  get() {
1843
1967
  return {
1844
1968
  f2: "START_EDITING",
@@ -1856,7 +1980,7 @@ class tt {
1856
1980
  };
1857
1981
  }
1858
1982
  }
1859
- class st {
1983
+ class it {
1860
1984
  get() {
1861
1985
  return {
1862
1986
  f2: "START_EDITING",
@@ -1876,7 +2000,7 @@ class st {
1876
2000
  };
1877
2001
  }
1878
2002
  }
1879
- class it {
2003
+ class ot {
1880
2004
  constructor(e) {
1881
2005
  this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
1882
2006
  }
@@ -1884,7 +2008,7 @@ class it {
1884
2008
  this.listener.includes(e) || this.listener.push(e);
1885
2009
  }
1886
2010
  init() {
1887
- this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new st().get()) : Object.assign(this.shortcutActionIdMapping, new tt().get()), Object.assign(this.shortcutActionIdMapping, this.tableScope.tableOptions.shortcutActionIdMapping), this.isDebug() && console.debug("ShortcutService", this.shortcutActionIdMapping), this.tableScope.hostElement.addEventListener("keydown", this.onKeyDown.bind(this));
2011
+ this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new it().get()) : Object.assign(this.shortcutActionIdMapping, new st().get()), Object.assign(this.shortcutActionIdMapping, this.tableScope.tableOptions.shortcutActionIdMapping), this.isDebug() && console.debug("ShortcutService", this.shortcutActionIdMapping), this.tableScope.hostElement.addEventListener("keydown", this.onKeyDown.bind(this));
1888
2012
  }
1889
2013
  isMacintosh() {
1890
2014
  return navigator.platform.indexOf("Mac") > -1;
@@ -1928,7 +2052,7 @@ class it {
1928
2052
  return e.altKey && t.push("alt"), e.shiftKey && t.push("shift"), e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), e.code && t.push(e.code.toLowerCase().replace(/key/g, "")), t.sort();
1929
2053
  }
1930
2054
  }
1931
- class he {
2055
+ class ce {
1932
2056
  onCheckboxChanged(e) {
1933
2057
  }
1934
2058
  onContextmenu(e) {
@@ -1944,7 +2068,7 @@ class he {
1944
2068
  onMouseMoved(e) {
1945
2069
  }
1946
2070
  }
1947
- class ye {
2071
+ class ve {
1948
2072
  setStyle(e, t, s) {
1949
2073
  return e.style[t] = s, e;
1950
2074
  }
@@ -1971,7 +2095,7 @@ class ye {
1971
2095
  e.setAttribute(t, s);
1972
2096
  }
1973
2097
  }
1974
- class ot {
2098
+ class lt {
1975
2099
  render(e, t, s, i, o, r, n) {
1976
2100
  if (o.isEditable(t, s)) {
1977
2101
  n.addClass(e, "ge-table-row-input-div");
@@ -1992,7 +2116,7 @@ class ot {
1992
2116
  }
1993
2117
  }
1994
2118
  }
1995
- class lt {
2119
+ class rt {
1996
2120
  constructor(e = "none", t = "single") {
1997
2121
  this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
1998
2122
  }
@@ -2027,16 +2151,16 @@ class lt {
2027
2151
  if (this.selectionType === "none")
2028
2152
  return;
2029
2153
  let t = e;
2030
- this.selectionType === "row" ? t = T.singleRow(e.r1) : this.selectionType === "column" && (t = T.singleColumn(e.c1)), this.negativeRanges.push(t);
2154
+ this.selectionType === "row" ? t = D.singleRow(e.r1) : this.selectionType === "column" && (t = D.singleColumn(e.c1)), this.negativeRanges.push(t);
2031
2155
  }
2032
2156
  togglePoint(e, t) {
2033
- this.getSelectionCount(e, t) > 0 ? this.removeSelection(T.singleCell(e, t)) : this.addSelection(T.singleCell(e, t));
2157
+ this.getSelectionCount(e, t) > 0 ? this.removeSelection(D.singleCell(e, t)) : this.addSelection(D.singleCell(e, t));
2034
2158
  }
2035
2159
  addRange(e) {
2036
2160
  this.selectionType !== "none" && (this.allSelected = !1, this.selectionMode === "single" && (this.ranges = []), this.selectionType === "row" ? (e.c1 = 0, e.c2 = Number.MAX_SAFE_INTEGER) : this.selectionType === "column" ? (e.r1 = 0, e.r2 = Number.MAX_SAFE_INTEGER) : this.selectionType === "cell" ? (e.r2 = e.r1, e.c2 = e.c1) : this.selectionType, this.ranges.push(e));
2037
2161
  }
2038
2162
  }
2039
- class rt {
2163
+ class nt {
2040
2164
  constructor(e = "none") {
2041
2165
  this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
2042
2166
  }
@@ -2059,31 +2183,42 @@ class rt {
2059
2183
  return [this.rowIndex, this.columnIndex];
2060
2184
  }
2061
2185
  }
2062
- const nt = new lt(), at = new rt("cell");
2063
- class ve {
2186
+ const at = new rt(), dt = new nt("cell");
2187
+ class we {
2064
2188
  constructor() {
2065
2189
  this.overflowX = "auto", this.overflowY = "auto", this.horizontalBorderVisible = !0, this.verticalBorderVisible = !0, this.footerSeparatorBorderVisible = !0, this.headerSeparatorBorderVisible = !0, this.fixedEastSeparatorBorderVisible = !0, this.fixedWestSeparatorBorderVisible = !0, this.tableTopBorderVisible = !0, this.tableBottomBorderVisible = !0, this.hoverRowVisible = !0, this.hoverColumnVisible = !0, this.columnsResizable = !0, this.columnsDraggable = !0, this.columnResizeHandleWidthInPx = 4, this.defaultRowHeights = {
2066
2190
  header: 34,
2067
2191
  body: 34,
2068
2192
  footer: 34
2069
- }, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new me(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new be(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new ot(), this.getSelectionModel = () => nt, this.getFocusModel = () => at;
2193
+ }, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new be(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new ye(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new lt(), this.getSelectionModel = () => at, this.getFocusModel = () => dt;
2070
2194
  }
2071
2195
  }
2072
- class re extends qe {
2196
+ class re extends Je {
2073
2197
  constructor(e, t, s, i, o) {
2074
2198
  var r;
2075
2199
  if (super(
2076
2200
  e,
2077
2201
  t,
2078
- new Ve(s),
2202
+ new _e(s),
2079
2203
  i
2080
- ), this.eventListener = o, this.selectionService = new et(this), this.api = new Ge(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new he()), (r = this.tableOptions) != null && r.autoRestoreOptions) {
2204
+ ), this.eventListener = o, this.selectionService = new tt(this), this.api = new Ne(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new ce()), (r = this.tableOptions) != null && r.autoRestoreOptions) {
2081
2205
  const n = this.tableOptions.autoRestoreOptions, a = n.getStorageKeyFn;
2082
- a && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new Ne(a)), n.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new Xe(a)), n.autoRestoreSortingState && (this.storeSortingService = new Ke(a)));
2206
+ a && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new je(a)), n.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new Ke(a)), n.autoRestoreSortingState && (this.storeSortingService = new ze(a)));
2083
2207
  }
2084
- this.mouseHandler = new ke(this), this.inputHandler = new Qe(this), this.shortcutService = new it(this), this.shortcutService.addListener(this.selectionService);
2208
+ this.mouseHandler = new Ge(this), this.inputHandler = new Ze(this), this.shortcutService = new ot(this), this.shortcutService.addListener(this.selectionService);
2085
2209
  }
2086
- static create(e, t, s = new ve(), i = new he(), o = new ye()) {
2210
+ /**
2211
+ * Creates a TableScope instance.
2212
+ *
2213
+ * @param {HTMLDivElement} hostElement - The HTML div element that will contain the table.
2214
+ * @param {TableModelIf} tableModel - The table model object.
2215
+ * @param {TableOptionsIf} [tableOptions=new TableOptions()] - The optional table options object.
2216
+ * @param {EventListenerIf} [eventListener=new EventAdapter()] - The optional event listener object.
2217
+ * @param {DomServiceIf} [domService=new SimpleDomService()] - The optional DOM service object.
2218
+ *
2219
+ * @return {TableScope} - The newly created TableScope instance.
2220
+ */
2221
+ static create(e, t, s = new we(), i = new ce(), o = new ve()) {
2087
2222
  return new re(
2088
2223
  e,
2089
2224
  t,
@@ -2108,16 +2243,32 @@ class re extends qe {
2108
2243
  updateModelValueAfterEdit(e, t, s, i) {
2109
2244
  e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, i) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(le.createSingle(t, s)), this.hostElement.focus());
2110
2245
  }
2246
+ /**
2247
+ * Retrieves the TableApi object.
2248
+ *
2249
+ * @return {TableApi} The TableApi object.
2250
+ */
2111
2251
  getApi() {
2112
2252
  return this.api;
2113
2253
  }
2114
- /*
2115
- * Called by the table component
2254
+ /**
2255
+ * Initializes the table. Called by the table component.
2256
+ *
2257
+ * @function firstInit
2258
+ * @memberof TableScope
2259
+ *
2260
+ * @returns {TableScope} This instance of the table scope.
2116
2261
  */
2117
2262
  firstInit() {
2118
2263
  var e;
2119
2264
  return this.tableModel.init(), (e = this.tableOptions) != null && e.externalFilterFunction && this.externalFilterChanged(!1), this.autoRestoreCollapsedExpandedState(), this.autoRestoreSortingState(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.autoRestoreScrollPosition(), this;
2120
2265
  }
2266
+ /**
2267
+ * Creates a GeMouseEvent object based on a MouseEvent.
2268
+ *
2269
+ * @param {MouseEvent} mouseEvent - The MouseEvent object to create the GeMouseEvent from.
2270
+ * @return {GeMouseEvent} - The created GeMouseEvent object.
2271
+ */
2121
2272
  createGeMouseEvent(e) {
2122
2273
  const t = new se();
2123
2274
  if (t.originalEvent = e, e) {
@@ -2133,26 +2284,72 @@ class re extends qe {
2133
2284
  }
2134
2285
  return t;
2135
2286
  }
2287
+ /**
2288
+ * Handles the mouse down event.
2289
+ *
2290
+ * @param {GeMouseEvent} mouseEvent - The mouse event object.
2291
+ * @return {void}
2292
+ */
2136
2293
  onMouseDown(e) {
2137
2294
  e.columnIndex > -1 && e.action && ["resize-column", "drag-column"].includes(e.action) && (this.mouseStartWidth = this.tableModel.getColumnWidth(e.columnIndex), this.mouseStartAction = e.action, this.mouseStartColumnIndex = e.columnIndex, this.mouseStartAction === "drag-column" && (this.dragFrom = this.mouseStartColumnIndex));
2138
2295
  }
2296
+ /**
2297
+ * Handles mouse dragging on the frame.
2298
+ *
2299
+ * @param {GeMouseEvent} mouseEvent - The mouse event object.
2300
+ */
2139
2301
  mouseDraggingOnFrame(e) {
2140
2302
  this.eventListener.onMouseDragging(e), this.mouseEvent = e, this.mouseStartColumnIndex > -1 && this.mouseStartAction === "resize-column" && this.tableOptions.columnsResizable ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && e.columnIndex > -1 && this.tableOptions.columnsDraggable && (this.draggingTargetColumnIndex = e.columnIndex, this.dragTo = this.draggingTargetColumnIndex, this.dragFrom > -1 && this.dragTo > -1 && this.dragFrom !== this.dragTo && (this.tableModel.changeColumnOrder(this.dragFrom, this.dragTo), this.dragFrom = this.dragTo, this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows()), this.repaint());
2141
2303
  }
2304
+ /**
2305
+ * Handles the end of mouse dragging event on a frame.
2306
+ *
2307
+ * @param {GeMouseEvent} mouseEvent - The mouse event object.
2308
+ *
2309
+ * @returns {void}
2310
+ */
2142
2311
  mouseDraggingEndOnFrame(e) {
2143
2312
  this.eventListener.onMouseDraggingEnd(e), this.draggingTargetColumnIndex = -1, this.mouseStartAction === "resize-column" ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && this.repaint(), this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.mouseStartAction = "";
2144
2313
  }
2314
+ /**
2315
+ * Handles the mouse move event.
2316
+ *
2317
+ * @param {GeMouseEvent} mouseMoveEvent - The mouse move event object.
2318
+ * @return {void}
2319
+ */
2145
2320
  mouseMove(e) {
2146
2321
  this.eventListener.onMouseMoved(e), this.adjustHoverRows(e), this.adjustHoverColumns(e);
2147
2322
  }
2323
+ /**
2324
+ * Triggers the context menu event based on the mouse move event.
2325
+ *
2326
+ * @param {GeMouseEvent} mouseMoveEvent - The mouse move event object.
2327
+ * @return {void}
2328
+ */
2148
2329
  contextmenu(e) {
2149
2330
  this.eventListener.onContextmenu(e);
2150
2331
  }
2332
+ /**
2333
+ * Toggles the expand or collapse state of all items in the body area model.
2334
+ *
2335
+ * @param {boolean} [expand=true] - Whether to expand or collapse all items. Default is true.
2336
+ *
2337
+ * @return {void}
2338
+ */
2151
2339
  toggleExpandCollapseAll(e = !0) {
2152
2340
  var s;
2153
2341
  const t = this.tableModel.getBodyModel();
2154
2342
  ee(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
2155
2343
  }
2344
+ /**
2345
+ * Toggles the checkbox state of a specific row in a table.
2346
+ *
2347
+ * @param {number} rowIdx - The index of the row to toggle the checkbox state.
2348
+ * @param {number} _colIdx - The index of the column. This parameter is unused.
2349
+ * @param {AreaIdent} areaIdent - The identifier of the table area.
2350
+ *
2351
+ * @return {void} - This method does not return anything.
2352
+ */
2156
2353
  toggleRowCheckbox(e, t, s) {
2157
2354
  var a;
2158
2355
  const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e), r = o === void 0 || o === "semi" || o === "none";
@@ -2160,6 +2357,13 @@ class re extends qe {
2160
2357
  const n = (a = i.rowSelectionModel) == null ? void 0 : a.getCheckedRows();
2161
2358
  this.eventListener.onCheckboxChanged(n || []);
2162
2359
  }
2360
+ /**
2361
+ * Handle mouse click events.
2362
+ *
2363
+ * @param {GeMouseEvent} evt - The mouse click event.
2364
+ * @param {GeMouseEvent | undefined} previousEvt - The previous mouse click event, if any.
2365
+ * @returns {void}
2366
+ */
2163
2367
  onMouseClicked(e, t) {
2164
2368
  let s = this.selectionService.onMouseClicked(e, t);
2165
2369
  if (!s && this.getFocusModel) {
@@ -2168,19 +2372,41 @@ class re extends qe {
2168
2372
  }
2169
2373
  this.eventListener.onMouseClicked(e), s && this.debounce(this.repaint.bind(this), 10);
2170
2374
  }
2375
+ /**
2376
+ * Updates the table (repaint) when an external filter is changed.
2377
+ *
2378
+ * @param {boolean} clearSelection - Indicates whether to clear the selection model or not. Default value is true.
2379
+ * @return {void}
2380
+ */
2171
2381
  externalFilterChanged(e = !0) {
2172
2382
  const t = this.tableOptions.externalFilterFunction;
2173
2383
  t && (e && this.clearSelectionModel(), this.tableModel.externalFilterChanged(t), this.scrollViewport.scrollTo(0, 0), this.tableModel.recalcHeightAndPadding(), this.resetSizeOfWrapperDiv(), this.repaint());
2174
2384
  }
2385
+ /**
2386
+ * Handle the double click event on the table header.
2387
+ *
2388
+ * @param {MouseEvent} event - The mouse event that triggered the double click.
2389
+ * @param {number} _rowIdx - The row index of the header.
2390
+ * @param {number} colIdx - The column index of the header.
2391
+ *
2392
+ * @return {void}
2393
+ */
2175
2394
  onHeaderDblClicked(e, t, s) {
2176
2395
  var o, r;
2177
2396
  const i = this.tableModel.getColumnDef(s);
2178
2397
  if (i != null && i.sortable && i.sortable()) {
2179
2398
  e.preventDefault(), e.stopPropagation();
2180
- const n = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, a = i.sortState ?? "", h = n[(n.indexOf(a) + 1) % n.length], d = new Je(s, h);
2399
+ const n = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, a = i.sortState ?? "", h = n[(n.indexOf(a) + 1) % n.length], d = new Qe(s, h);
2181
2400
  this.tableModel.doSort([d]) && ((o = this.tableModel.getColumnDefs()) == null || o.forEach((p) => p.sortState = ""), i.sortState = h), this.repaint(), (r = this.storeSortingService) == null || r.setSortItems([d]);
2182
2401
  }
2183
2402
  }
2403
+ /**
2404
+ * Changes the focus cell using the specified deltas.
2405
+ *
2406
+ * @param {number} dx - The delta for the column index.
2407
+ * @param {number} dy - The delta for the row index.
2408
+ * @return {boolean} - True if the focus cell was changed, false otherwise.
2409
+ */
2184
2410
  changeFocusCell(e, t) {
2185
2411
  if (!this.isEditing() && this.getFocusModel) {
2186
2412
  const s = this.getFocusModel();
@@ -2191,9 +2417,19 @@ class re extends qe {
2191
2417
  }
2192
2418
  return !1;
2193
2419
  }
2420
+ /**
2421
+ * Resizes the column based on the mouse event.
2422
+ *
2423
+ * @param {GeMouseEvent} mouseEvent - The mouse event that triggered the resize.
2424
+ */
2194
2425
  resizeColumn(e) {
2195
2426
  this.tableModel.setColumnWidth(this.mouseStartColumnIndex, this.mouseStartWidth + e.draggingX), this.tableModel.recalcPadding(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows();
2196
2427
  }
2428
+ /**
2429
+ * Clears the selection model, if available.
2430
+ *
2431
+ * @return {void}
2432
+ */
2197
2433
  clearSelectionModel() {
2198
2434
  var e;
2199
2435
  this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
@@ -2202,6 +2438,14 @@ class re extends qe {
2202
2438
  var s;
2203
2439
  console.clear(), console.info("this.hostElement.offsetTop", this.hostElement.offsetTop), console.info("this.hostElement.scrollHeight", this.hostElement.scrollHeight), console.info("this.scrollViewportTop", this.scrollTop), console.info("this.areaHeaderCenter.parent.clientHeight", this.areaHeaderCenter.parent.clientHeight), console.info("bodyY", t), console.info("bodyX", e), console.info("rows", this.firstVisibleRowIndex), console.info(""), console.info("this.tableModel", this.tableModel), console.info(""), console.info("this.mouseMoveEvent.clientX", (s = this.mouseHandler.mouseEvent) == null ? void 0 : s.clientX), console.info("this.hostElement.offsetLeft", this.hostElement.offsetLeft), console.info("this.areaBodyWestGeo.width", this.areaBodyWestGeo.width);
2204
2440
  }
2441
+ /**
2442
+ * Restores the scroll position of the table if auto restore options are enabled.
2443
+ *
2444
+ * @private
2445
+ * @memberof ClassName
2446
+ *
2447
+ * @returns {void}
2448
+ */
2205
2449
  autoRestoreScrollPosition() {
2206
2450
  var e;
2207
2451
  if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
@@ -2209,6 +2453,20 @@ class re extends qe {
2209
2453
  s && this.scrollViewport.scrollTo(...s);
2210
2454
  }
2211
2455
  }
2456
+ /**
2457
+ * Automatically restores the sorting state of the table.
2458
+ *
2459
+ * @private
2460
+ * @function autoRestoreSortingState
2461
+ * @memberof ClassName
2462
+ *
2463
+ * @description
2464
+ * This method checks if the autoRestoreSortingState option is enabled in the tableOptions.
2465
+ * If enabled, it uses the storeSortingService to retrieve the sort items array.
2466
+ * If there are sort items present, it applies them to the table's body model using the doSort method.
2467
+ *
2468
+ * @returns {void}
2469
+ */
2212
2470
  autoRestoreSortingState() {
2213
2471
  var e, t;
2214
2472
  if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
@@ -2216,6 +2474,12 @@ class re extends qe {
2216
2474
  s != null && s.length && this.tableModel.getBodyModel().doSort(s);
2217
2475
  }
2218
2476
  }
2477
+ /**
2478
+ * Restores the collapsed/expanded state of the rows in the table based on the autoRestoreOptions
2479
+ * specified in the tableOptions. This method is private and should not be called directly.
2480
+ *
2481
+ * @private
2482
+ */
2219
2483
  autoRestoreCollapsedExpandedState() {
2220
2484
  var e, t;
2221
2485
  if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
@@ -2242,13 +2506,13 @@ class re extends qe {
2242
2506
  }
2243
2507
  }
2244
2508
  }
2245
- const dt = /* @__PURE__ */ Pe("<div>"), ut = (l) => {
2509
+ const ht = /* @__PURE__ */ We("<div>"), pt = (l) => {
2246
2510
  let e;
2247
- const t = ge({
2511
+ const t = me({
2248
2512
  tableModel: null,
2249
- tableOptions: new ve()
2513
+ tableOptions: new we()
2250
2514
  }, l);
2251
- return Ae(() => {
2515
+ return Me(() => {
2252
2516
  const s = {
2253
2517
  onCheckboxChanged: (r) => {
2254
2518
  const n = new CustomEvent("checkboxChanged", {
@@ -2299,7 +2563,7 @@ const dt = /* @__PURE__ */ Pe("<div>"), ut = (l) => {
2299
2563
  });
2300
2564
  e && e.dispatchEvent(n);
2301
2565
  }
2302
- }, i = new re(e, t.tableModel, new ye(), t.tableOptions, s);
2566
+ }, i = new re(e, t.tableModel, new ve(), t.tableOptions, s);
2303
2567
  i.firstInit();
2304
2568
  const o = new CustomEvent("tableReady", {
2305
2569
  detail: i.getApi(),
@@ -2307,12 +2571,12 @@ const dt = /* @__PURE__ */ Pe("<div>"), ut = (l) => {
2307
2571
  });
2308
2572
  e && e.dispatchEvent(o);
2309
2573
  }), (() => {
2310
- const s = dt(), i = e;
2311
- return typeof i == "function" ? We(i, s) : e = s, s;
2574
+ const s = ht(), i = e;
2575
+ return typeof i == "function" ? He(i, s) : e = s, s;
2312
2576
  })();
2313
2577
  };
2314
2578
  export {
2315
- ht as ComponentRendererWrapper,
2316
- ut as GuiexpertTable,
2317
- ct as GuiexpertTableProps
2579
+ ct as ComponentRendererWrapper,
2580
+ pt as GuiexpertTable,
2581
+ ut as GuiexpertTableProps
2318
2582
  };