@guiexpert/react-table 18.0.0 → 18.0.2

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