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