@guiexpert/vue3-table 3.0.1 → 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,12 +1,12 @@
1
- import { defineComponent as Y, ref as q, onMounted as U, openBlock as J, createElementBlock as Q, createVNode as Z, render as G } from "vue";
2
- class D {
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
3
  // The constructor is private to prevent direct construction calls
4
4
  // with the `new` operator
5
5
  constructor() {
6
6
  this.alreadySet = !1;
7
7
  }
8
8
  static getInstance() {
9
- return D.instance || (D.instance = new D()), D.instance;
9
+ return k.instance || (k.instance = new k()), k.instance;
10
10
  }
11
11
  /**
12
12
  * Method to set the license key for the application.
@@ -24,18 +24,18 @@ class D {
24
24
  }
25
25
  }
26
26
  }
27
- function O(h) {
28
- return h && h.type === "TreeRow";
27
+ function H(c) {
28
+ return c && c.type === "TreeRow";
29
29
  }
30
- function $(h) {
31
- return h && h.type === "AreaModelTree";
30
+ function P(c) {
31
+ return c && c.type === "AreaModelTree";
32
32
  }
33
- class B {
34
- constructor(e = -1, t = -1, s = -1, i = -1, o, l, n, r = 0, a = 0, d = 0, u = "") {
35
- 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;
36
36
  }
37
37
  clone() {
38
- return new B(
38
+ return new W(
39
39
  this.rowIndex,
40
40
  this.rowTop,
41
41
  this.columnIndex,
@@ -50,47 +50,47 @@ class B {
50
50
  );
51
51
  }
52
52
  }
53
- class I {
54
- constructor(e = ">", t = "", s = []) {
55
- this.content = e, this.style = t, this.classes = s;
53
+ class D {
54
+ constructor(e = ">", t = "", o = []) {
55
+ this.content = e, this.style = t, this.classes = o;
56
56
  }
57
57
  }
58
- class j {
59
- constructor(e = new I(
58
+ class q {
59
+ constructor(e = new D(
60
60
  ">",
61
61
  "transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
62
62
  ["gt-table-tree-arrow-expanded"]
63
- ), t = new I(
63
+ ), t = new D(
64
64
  ">",
65
65
  "",
66
66
  ["ge-table-tree-arrow-collapsed"]
67
- ), s = new I(
67
+ ), o = new D(
68
68
  ">",
69
69
  "color:transparent;",
70
70
  ["gt-table-tree-arrow-hidden"]
71
- ), i = new I(
71
+ ), s = new D(
72
72
  "↕",
73
73
  "",
74
74
  ["gt-table-tree-arrow-expanded-all"]
75
75
  )) {
76
- 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;
77
77
  }
78
78
  }
79
- class X {
80
- constructor(e = new I("↑", "", ["ge-header-sorted-asc"]), t = new I("↓", "", ["ge-header-sorted-desc"]), s = new I("↑", "color:transparent;", [])) {
81
- 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;
82
82
  }
83
83
  }
84
- class ee {
84
+ class le {
85
85
  constructor(e) {
86
86
  this.domService = e;
87
87
  }
88
- setStyle(e, t, s) {
89
- return this.domService.setStyle(e, t, s), e;
88
+ setStyle(e, t, o) {
89
+ return this.domService.setStyle(e, t, o), e;
90
90
  }
91
91
  applyStyle(e, t) {
92
- for (const s in t)
93
- this.domService.setStyle(e, s, t[s]);
92
+ for (const o in t)
93
+ this.domService.setStyle(e, o, t[o]);
94
94
  return e;
95
95
  }
96
96
  applyDisplayNoneStyle(e) {
@@ -100,7 +100,7 @@ class ee {
100
100
  return this.domService.setStyle(e, "display", "block"), e;
101
101
  }
102
102
  applyStyleInPx(e, t) {
103
- 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;
104
104
  }
105
105
  applyStylePosistionRelative(e) {
106
106
  return this.domService.setStyle(e, "position", "relative"), this.domService.setStyle(e, "overflow", "clip"), e;
@@ -111,8 +111,8 @@ class ee {
111
111
  applyStyleFullSize(e) {
112
112
  return this.domService.setStyle(e, "width", "100%"), this.domService.setStyle(e, "height", "100%"), e;
113
113
  }
114
- applyStyleOverflowAuto(e = "auto", t = "auto", s) {
115
- 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;
116
116
  }
117
117
  applyStyleNoPadding(e) {
118
118
  return this.domService.setStyle(e, "padding", "0"), this.domService.setStyle(e, "margin", "0"), this.domService.setStyle(e, "border", "0"), e;
@@ -128,156 +128,157 @@ class ee {
128
128
  return this.domService.appendChild(e, t), this.applyStylePosistionAbsolute(e), { parent: e, child: t, cache: {} };
129
129
  }
130
130
  appendText(e, t) {
131
- const s = this.domService.createText(t);
132
- return this.domService.appendChild(e, s), s;
131
+ const o = this.domService.createText(t);
132
+ return this.domService.appendChild(e, o), o;
133
133
  }
134
134
  addClass(e, t) {
135
- 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;
136
136
  }
137
137
  removeClass(e, t) {
138
- 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;
139
139
  }
140
140
  addClasses(e, t) {
141
141
  if (e)
142
- for (const s of e)
143
- this.domService.addClass(t, s);
142
+ for (const o of e)
143
+ this.domService.addClass(t, o);
144
144
  return t;
145
145
  }
146
- setAttribute(e, t, s) {
147
- 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;
148
148
  }
149
- createAreaDivWithClass(e, t, s, i) {
150
- const o = this.domService.createElement("div");
151
- 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;
152
152
  }
153
153
  createDivWithClass(e, t) {
154
- const s = this.domService.createElement("div");
155
- 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;
156
156
  }
157
- addRowDiv(e, t, s = -1, i, o, l = "") {
158
- const n = t.index ?? -1, r = this.getDivOrCreateDiv(n, e);
159
- if (this.domService.addClass(r, "ge-table-row-div"), this.domService.addClass(r, `ge-table-row-div-${t.index}`), i === "body" && o === "center") {
160
- const a = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
161
- 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}`);
162
162
  }
163
- 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) {
164
- const a = this.domService.createText(l);
165
- 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);
166
166
  }
167
- return this.domService.appendChild(e.child, r), r;
168
- }
169
- addColumnDiv(e, t, s = -1, i = -1, o, l, n = "", r, a, d = void 0, u) {
170
- const g = a == null ? void 0 : a.treeOptions, m = a == null ? void 0 : a.showCheckboxWihoutExtraColumn, c = this.domService.createElement("div");
171
- 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}`);
172
- const f = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
173
- 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) {
174
- const S = r !== "none" && i === 0;
175
- 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);
176
176
  }
177
- 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;
178
178
  }
179
- addCheckboxToDiv(e, t, s, i) {
180
- const o = this.domService.createElement("div"), l = t === "full" ? "checked" : "";
181
- return o.innerHTML = `
179
+ addCheckboxToDiv(e, t, o, s) {
180
+ const i = this.domService.createElement("div"), r = t === "full" ? "checked" : "";
181
+ return i.innerHTML = `
182
182
  <input
183
183
  type="checkbox"
184
- data-area="${s}"
185
- data-row-index="${i}"
184
+ data-area="${o}"
185
+ data-row-index="${s}"
186
186
  data-input-type="checkbox"
187
- ${l}
188
- 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;
189
- }
190
- addLabelDiv(e, t = "", s = !1, i = -1, o = -1, l = "body") {
191
- const n = this.domService.createElement("div");
192
- 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)
193
- if (s) {
194
- const r = this.domService.createText(t);
195
- 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);
196
196
  } else {
197
- const r = this.domService.createElement("div");
198
- this.domService.appendChild(n, r);
199
- const a = this.domService.createText(t);
200
- 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}`);
201
201
  }
202
- return this.domService.appendChild(e, n), n;
202
+ return this.domService.appendChild(e, a), a;
203
203
  }
204
- addSortedIcon(e, t = "", s = new X(), i = -1) {
205
- const o = this.domService.createElement("div");
206
- 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");
207
- let l;
208
- t === "asc" ? l = s.iconAsc : t === "desc" ? l = s.iconDesc : l = s.iconPlaceholder;
209
- const n = l.content, r = this.domService.createText(n);
210
- this.domService.appendChild(o, r), l.style && this.applyStyleString(o, l.style);
211
- for (const a of l.classes)
212
- this.domService.addClass(o, a);
213
- return this.domService.appendChild(e, o), o;
214
- }
215
- addArrowDiv(e, t = "none", s = new j(), i = -1, o = -1, l = "body") {
216
- const n = this.domService.createElement("div");
217
- 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");
218
207
  let r;
219
- t === "expanded" ? r = s.arrowExpanded : t === "collapsed" ? r = s.arrowCollapsed : r = s.arrowPlaceholder;
220
- const a = r.content, d = this.domService.createText(a);
221
- this.domService.appendChild(n, d), r.style && this.applyStyleString(n, r.style);
222
- for (const u of r.classes)
223
- this.domService.addClass(n, u);
224
- return this.domService.appendChild(e, n), n;
225
- }
226
- 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) {
227
227
  if (e.verticalBorderVisible) {
228
- const l = `ge-table-${i}-${o}-vertical-border`;
229
- this.addVerticalBorder(s, t, l);
228
+ const r = `ge-table-${s}-${i}-vertical-border`;
229
+ this.addVerticalBorder(o, t, r);
230
230
  }
231
231
  if (e.horizontalBorderVisible) {
232
- const l = `ge-table-${i}-${o}-horizontal-border`;
233
- this.addHorizontalBorder(s, t, l);
232
+ const r = `ge-table-${s}-${i}-horizontal-border`;
233
+ this.addHorizontalBorder(o, t, r);
234
234
  }
235
235
  return t;
236
236
  }
237
- addHorizontalBorder(e, t, s = "ge-table-body-center-horizontal-border") {
238
- const i = this.domService.createElement("div");
239
- 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;
240
240
  }
241
- addFocusBorderDivs(e, t, s) {
242
- let i = this.domService.createElement("div");
243
- 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;
244
245
  }
245
- addVerticalBorder(e, t, s = "ge-table-body-center-vertical-border") {
246
- const i = this.domService.createElement("div");
247
- 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;
248
249
  }
249
- addDiv(e, t, s = "") {
250
- const i = this.domService.createElement("div");
251
- 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;
252
253
  }
253
254
  applyStyleString(e, t) {
254
- const s = t.split(";").map((i) => i.trim()).filter((i) => i);
255
- for (const i of s) {
256
- const [o, l] = i.split(":");
257
- 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());
258
259
  }
259
260
  }
260
261
  getDivOrCreateDiv(e, t) {
261
- let s = t.cache[e];
262
- 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);
263
264
  }
264
265
  }
265
- const W = (h) => h === "header" ? "header" : h === "footer" ? "footer" : "body";
266
- class te {
266
+ const G = (c) => c === "header" ? "header" : c === "footer" ? "footer" : "body";
267
+ class ae {
267
268
  constructor(e, t) {
268
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)) {
269
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"));
270
- const s = e.getAttribute("data-area");
271
- if (s && (this.areaIdent = W(s), this.areaModel = t.tableModel.getAreaModel(this.areaIdent), this.row = this.areaModel.getRowByIndex(this.rowIdx)), e instanceof HTMLInputElement) {
272
- const i = e;
273
- 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;
274
275
  }
275
276
  }
276
277
  }
277
278
  }
278
- class se {
279
+ class ne {
279
280
  constructor(e) {
280
- 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(
281
282
  (t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
282
283
  );
283
284
  }
@@ -301,22 +302,28 @@ class se {
301
302
  * @return {void}
302
303
  */
303
304
  onHostElementClicked(e) {
304
- const t = new te(e.target, this.tableScope);
305
- 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")
306
311
  this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
307
- else if (t.inputType === "checkbox" && t.areaIdent)
308
- this.tableScope.toggleRowCheckbox(t.rowIdx, t.colIdx, t.areaIdent), e.preventDefault(), e.stopPropagation();
309
- else if (O(t.row) && t.areaModel) {
310
- 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");
311
318
  if (console.info(i, s), s || i) {
312
319
  e.preventDefault(), e.stopPropagation();
313
- const o = t.row;
314
- 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);
315
322
  }
316
323
  }
317
- if (t.areaIdent === "body" && this.tableScope.tableOptions.getFocusModel) {
324
+ if (o.areaIdent === "body" && this.tableScope.tableOptions.getFocusModel) {
318
325
  const s = this.tableScope.tableOptions.getFocusModel();
319
- 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);
320
327
  }
321
328
  this.publishGeMouseEvent(e, 1);
322
329
  }
@@ -327,16 +334,16 @@ class se {
327
334
  * @param {MouseEvent} event - The double click event.
328
335
  */
329
336
  onHostElementDblClicked(e) {
330
- if (e.target instanceof HTMLElement) {
331
- const t = e.target, s = t.getAttribute("data-area"), i = W(s), o = Number(t.getAttribute("data-row-index")), l = Number(t.getAttribute("data-col-index")), n = this.tableScope.tableModel.getAreaModel(i);
332
- if (s && i === "header")
333
- 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));
334
341
  else if (t.getAttribute("data-row-index")) {
335
- const r = n.getRowByIndex(o);
336
- if (s && i === "body" && n.isEditable(o, l) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, l)), O(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()) {
337
344
  e.preventDefault(), e.stopPropagation();
338
- const a = r;
339
- 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);
340
347
  }
341
348
  }
342
349
  }
@@ -351,8 +358,8 @@ class se {
351
358
  * @return {void}
352
359
  */
353
360
  publishGeMouseEvent(e, t) {
354
- var s;
355
- 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();
356
363
  }
357
364
  /**
358
365
  * Update the collapsed/expanded state of a tree row.
@@ -361,30 +368,30 @@ class se {
361
368
  * @returns {void}
362
369
  */
363
370
  updateCollapsedExpandedState(e) {
364
- var s, i, o, l, n;
365
- 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;
366
373
  if (t) {
367
- 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);
368
- 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));
369
376
  }
370
377
  }
371
378
  getArrowColumnIndex() {
372
379
  return this.tableScope.tableModel.isRowCheckboxVisible() ? 1 : 0;
373
380
  }
374
381
  onMouseDown(e) {
375
- 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);
376
383
  }
377
384
  onMouseMove(e) {
378
- 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));
379
386
  }
380
387
  onMouseUp(e) {
381
- 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);
382
389
  }
383
390
  mouseDraggingOnFrame() {
384
391
  var e;
385
392
  if (this.mouseEvent) {
386
393
  const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
387
- (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);
388
395
  }
389
396
  }
390
397
  mouseDraggingEndOnFrame() {
@@ -401,7 +408,7 @@ class se {
401
408
  }
402
409
  }
403
410
  }
404
- class ie {
411
+ class de {
405
412
  constructor(e) {
406
413
  this.tableScope = e;
407
414
  }
@@ -507,36 +514,114 @@ class ie {
507
514
  repaint() {
508
515
  this.tableScope.repaint();
509
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
+ }
510
595
  }
511
- class H {
596
+ class _ {
512
597
  constructor(e) {
513
598
  this.getStorageKeyFn = e;
514
599
  }
515
600
  autoConvertMapToObject(e) {
516
601
  const t = {};
517
602
  if (e instanceof Map) {
518
- const s = e;
519
- for (const i of [...s]) {
603
+ const o = e;
604
+ for (const s of [...o]) {
520
605
  const [
521
- o,
522
- l
523
- ] = i;
524
- t[o] = l;
606
+ i,
607
+ r
608
+ ] = s;
609
+ t[i] = r;
525
610
  }
526
611
  }
527
612
  return t;
528
613
  }
529
614
  checkAndPersistItem(e, t) {
530
- const s = this.getStorageKeyFn;
531
- if (s) {
532
- const i = s();
533
- if (i) {
534
- const o = i + e;
615
+ const o = this.getStorageKeyFn;
616
+ if (o) {
617
+ const s = o();
618
+ if (s) {
619
+ const i = s + e;
535
620
  if ((t + "").includes("Map")) {
536
- const l = this.autoConvertMapToObject(t);
537
- this.persistItem(o, l);
621
+ const r = this.autoConvertMapToObject(t);
622
+ this.persistItem(i, r);
538
623
  } else
539
- this.persistItem(o, t);
624
+ this.persistItem(i, t);
540
625
  }
541
626
  }
542
627
  }
@@ -583,7 +668,7 @@ class H {
583
668
  // }
584
669
  // }
585
670
  }
586
- class oe extends H {
671
+ class ce extends _ {
587
672
  constructor(e) {
588
673
  super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
589
674
  }
@@ -598,21 +683,21 @@ class oe extends H {
598
683
  if (e) {
599
684
  const t = e();
600
685
  if (t) {
601
- const s = t + this.SCROLL_STATE;
602
- let i = this.loadFromLocalStorage(s);
603
- this.scrollOffset = i || [0, 0];
686
+ const o = t + this.SCROLL_STATE;
687
+ let s = this.loadFromLocalStorage(o);
688
+ this.scrollOffset = s || [0, 0];
604
689
  }
605
690
  }
606
691
  }
607
692
  }
608
- class le {
609
- constructor(e = "collapsed", t = [], s = !1, i = !1) {
610
- 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;
611
696
  }
612
697
  }
613
- class re extends H {
698
+ class ge extends _ {
614
699
  constructor(e) {
615
- super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new le(), this.load();
700
+ super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new he(), this.load();
616
701
  }
617
702
  collapsedExpandedStateGet() {
618
703
  return this.collapsedExpandedState;
@@ -635,8 +720,8 @@ class re extends H {
635
720
  if (e) {
636
721
  const t = e();
637
722
  if (t) {
638
- const s = t + this.COLLAPSED_EXPANDED_STATE, i = this.loadFromLocalStorage(s);
639
- i && (this.collapsedExpandedState = i);
723
+ const o = t + this.COLLAPSED_EXPANDED_STATE, s = this.loadFromLocalStorage(o);
724
+ s && (this.collapsedExpandedState = s);
640
725
  }
641
726
  }
642
727
  }
@@ -644,7 +729,7 @@ class re extends H {
644
729
  this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
645
730
  }
646
731
  }
647
- class ne extends H {
732
+ class pe extends _ {
648
733
  constructor(e) {
649
734
  super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
650
735
  }
@@ -659,95 +744,101 @@ class ne extends H {
659
744
  if (e) {
660
745
  const t = e();
661
746
  if (t) {
662
- const s = t + this.SORTING_STATE;
663
- let i = this.loadFromLocalStorage(s);
664
- this.sortItems = i || [];
747
+ const o = t + this.SORTING_STATE, s = this.loadFromLocalStorage(o);
748
+ this.sortItems = s || [];
665
749
  }
666
750
  }
667
751
  }
668
752
  }
669
753
  class T {
670
- constructor(e = 0, t = 0, s = 0, i = 0, o) {
671
- 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;
672
756
  }
673
757
  }
674
- class ae {
675
- constructor(e, t, s, i) {
676
- 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();
677
- const o = this.hostElement;
678
- o.innerText = "", this.dom.setAttribute(o, "tabindex", "0"), this.dom.setStyle(
679
- 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),
680
764
  "position",
681
765
  "relative"
682
- ), this.hoverRow = s.applyStylePosistionAbsolute(
683
- s.createDivWithClass("ge-table-hover-row", o)
684
- ), this.hoverColumn = s.applyStylePosistionAbsolute(
685
- s.createDivWithClass("ge-table-hover-column", o)
686
- ), this.areaHeaderWest = s.appendRelativeChildDiv(
687
- s.applyStylePosistionAbsolute(
688
- 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")
689
775
  )
690
- ), this.areaHeaderCenter = s.appendRelativeChildDiv(
691
- s.applyStylePosistionAbsolute(
692
- 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")
693
779
  )
694
- ), this.areaHeaderEast = s.appendRelativeChildDiv(
695
- s.applyStylePosistionAbsolute(
696
- 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")
697
783
  )
698
- ), this.areaBodyWest = s.appendRelativeChildDiv(
699
- s.applyStylePosistionAbsolute(
700
- 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")
701
787
  )
702
- ), this.areaBodyEast = s.appendRelativeChildDiv(
703
- s.applyStylePosistionAbsolute(
704
- 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")
705
791
  )
706
- ), this.areaFooterWest = s.appendRelativeChildDiv(
707
- s.applyStylePosistionAbsolute(
708
- 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")
709
795
  )
710
- ), this.areaFooterCenter = s.appendRelativeChildDiv(
711
- s.applyStylePosistionAbsolute(
712
- 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")
713
799
  )
714
- ), this.areaFooterEast = s.appendRelativeChildDiv(
715
- s.applyStylePosistionAbsolute(
716
- 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")
717
803
  )
718
- ), this.scrollViewport = s.applyStyleOverflowAuto(
804
+ ), this.scrollViewport = o.applyStyleOverflowAuto(
719
805
  this.tableOptions.overflowX ?? "auto",
720
806
  this.tableOptions.overflowY ?? "auto",
721
- s.applyStyleNoPadding(
722
- s.applyStylePosistionAbsolute(
723
- 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")
724
810
  )
725
811
  )
726
- ), this.contentWrapperDiv = s.applyStyleNoPadding(
727
- s.applyStylePosistionRelative(
728
- 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)
729
815
  )
730
- ), this.contentDiv = s.applyStyleNoPadding(
731
- s.applyStylePosistionRelative(
732
- 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)
733
819
  )
734
- ), this.areaBodyCenter = s.appendRelativeChildDiv(
735
- s.createDivWithClass("ge-table-body-center", this.contentDiv)
736
- ), this.borderHeaderBottom = s.applyStylePosistionAbsolute(
737
- s.createDivWithClass("ge-table-header-border", o)
738
- ), this.borderFixedWest = s.applyStylePosistionAbsolute(
739
- s.createDivWithClass("ge-table-west-fixed-column-border", o)
740
- ), this.borderFixedEast = s.applyStylePosistionAbsolute(
741
- s.createDivWithClass("ge-table-east-fixed-column-border", o)
742
- ), this.borderFooterTop = s.applyStylePosistionAbsolute(
743
- 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)
744
830
  );
745
831
  }
832
+ /**
833
+ * Adjusts the containers and rows of the table based on the current state.
834
+ *
835
+ * @return {void}
836
+ */
746
837
  adjustContainersAndRows() {
747
- 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;
748
839
  this.dom.applyStyle(this.scrollViewport, {
749
840
  width: `${t - e.left}px`,
750
- height: `${s - e.top}px`,
841
+ height: `${o - e.top}px`,
751
842
  top: `${e.top}px`,
752
843
  left: `${e.left}px`
753
844
  }), this.scrollTop = this.scrollViewport.scrollTop, this.dom.applyStyle(this.contentDiv, {
@@ -755,21 +846,21 @@ class ae {
755
846
  height: `${this.scrollViewport.clientHeight}px`,
756
847
  top: `${this.scrollTop}px`,
757
848
  left: `${this.scrollViewport.scrollLeft}px`
758
- }), 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(
759
850
  this.dom.applyStyle(this.borderFixedWest, {
760
851
  width: "1px",
761
852
  height: `${this.areaBodyWestGeo.height}px`,
762
853
  top: `${this.areaBodyWestGeo.top}px`,
763
854
  left: `${this.areaBodyWestGeo.width}px`
764
855
  })
765
- ) : 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(
766
857
  this.dom.applyStyle(this.borderFixedEast, {
767
858
  width: "1px",
768
859
  height: `${this.areaBodyEastGeo.height}px`,
769
860
  top: `${this.areaBodyEastGeo.top}px`,
770
861
  left: `${this.areaBodyEastGeo.left}px`
771
862
  })
772
- ) : 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, {
773
864
  width: `${t - e.left - e.right}px`,
774
865
  height: `${e.top}px`,
775
866
  top: "0",
@@ -794,35 +885,48 @@ class ae {
794
885
  ) : this.dom.applyDisplayNoneStyle(this.borderHeaderBottom), this.dom.applyStyle(this.areaFooterWest.parent, {
795
886
  width: `${e.left}px`,
796
887
  height: `${e.bottom}px`,
797
- top: `${s - e.bottom}px`,
888
+ top: `${o - e.bottom}px`,
798
889
  left: "0"
799
890
  }), this.dom.applyStyle(this.areaFooterCenter.parent, {
800
891
  width: `${t - e.left - e.right}px`,
801
892
  height: `${e.bottom}px`,
802
- top: `${s - e.bottom}px`,
893
+ top: `${o - e.bottom}px`,
803
894
  left: `${e.left}px`
804
895
  }), this.dom.applyStyle(this.areaFooterEast.parent, {
805
896
  width: `${e.right}px`,
806
897
  height: `${e.bottom}px`,
807
- top: `${s - e.bottom}px`,
898
+ top: `${o - e.bottom}px`,
808
899
  left: `${t - e.right}px`
809
900
  }), this.tableOptions.footerSeparatorBorderVisible && this.tableModel.isFooterVisibe() ? this.dom.applyDisplayBlockStyle(
810
901
  this.dom.applyStyle(this.borderFooterTop, {
811
902
  width: `${t}px`,
812
903
  height: "1px",
813
- top: `${s - e.bottom}px`,
904
+ top: `${o - e.bottom}px`,
814
905
  left: "0px"
815
906
  })
816
907
  ) : this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.adjustAfterScrolling();
817
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
+ */
818
915
  adjustAfterScrolling() {
819
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
+ */
820
924
  resetSizeOfWrapperDiv() {
821
925
  const e = `${this.tableModel.getContentWidthInPixel()}px`, t = `${this.tableModel.getContentHeightInPixel() + 1}px`;
822
926
  this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", t);
823
927
  }
824
928
  }
825
- class M {
929
+ class E {
826
930
  /**
827
931
  * Represents a constructor for a class.
828
932
  * @constructor
@@ -832,11 +936,11 @@ class M {
832
936
  * @param {number} c2 - The value for c2.
833
937
  * @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
834
938
  */
835
- constructor(e, t, s, i, o = !1) {
836
- 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;
837
941
  }
838
942
  static create(e) {
839
- return e.gammaRange === void 0 && (e.gammaRange = !1), new M(
943
+ return e.gammaRange === void 0 && (e.gammaRange = !1), new E(
840
944
  e.rowIndex1,
841
945
  e.columnIndex1,
842
946
  e.rowIndex2,
@@ -845,19 +949,19 @@ class M {
845
949
  );
846
950
  }
847
951
  static singleCell(e, t) {
848
- return new M(e, t, e, t);
952
+ return new E(e, t, e, t);
849
953
  }
850
954
  static singleRow(e) {
851
- return new M(e, 0, e, Number.MAX_SAFE_INTEGER);
955
+ return new E(e, 0, e, Number.MAX_SAFE_INTEGER);
852
956
  }
853
957
  static singleColumn(e) {
854
- return new M(0, e, Number.MAX_SAFE_INTEGER, e);
958
+ return new E(0, e, Number.MAX_SAFE_INTEGER, e);
855
959
  }
856
960
  isInRange(e, t) {
857
961
  return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
858
962
  }
859
963
  }
860
- class de {
964
+ class ue {
861
965
  constructor(e, t) {
862
966
  this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
863
967
  }
@@ -866,14 +970,14 @@ class de {
866
970
  return;
867
971
  this.colAndRowspanRanges = [];
868
972
  const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
869
- for (let s = 0; s < e; s++)
870
- for (let i = 0; i < t; i++) {
871
- let o = this.areaModel.getColspanAt(s, i), l = this.areaModel.getRowspanAt(s, i);
872
- if (o > 1 || l > 1) {
873
- o === 0 && (o = 1), l === 0 && (l = 1);
874
- 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;
875
979
  this.colAndRowspanRanges.push(
876
- new M(s, i, s + l - 1, i + o - 1, n)
980
+ new E(o, s, o + r - 1, s + i - 1, a)
877
981
  );
878
982
  }
879
983
  }
@@ -883,58 +987,98 @@ class de {
883
987
  }
884
988
  isInRange(e, t) {
885
989
  if (this.colAndRowspanRanges) {
886
- for (const s of this.colAndRowspanRanges)
887
- if (s.isInRange(e, t))
990
+ for (const o of this.colAndRowspanRanges)
991
+ if (o.isInRange(e, t))
888
992
  return !0;
889
993
  }
890
994
  return !1;
891
995
  }
892
996
  }
893
- class he {
894
- constructor(e, t, s) {
895
- 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;
896
1000
  }
897
1001
  }
898
- class ce extends ae {
899
- constructor(e, t, s, i) {
900
- var l, n;
901
- 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 = {
902
1006
  header: [],
903
1007
  body: [],
904
1008
  footer: []
905
- }, this.tree = !1, this.colAndRowspanModels = new he(), 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), $(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
906
- (r) => {
907
- var a;
908
- this.colAndRowspanModels[r] = new de(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();
909
1013
  }
910
1014
  );
911
1015
  }
912
1016
  isEditing() {
913
1017
  return this.editing;
914
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
+ */
915
1027
  resetEditorRenderer() {
916
1028
  this.editorRenderer = void 0, this.editorRendererRow = -1, this.editorRendererColumn = -1, this.editing = !1;
917
1029
  }
918
- 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) {
919
1038
  if (this.getSelectionModel) {
920
- const e = this.getSelectionModel();
921
- e == null || e.clear();
1039
+ const t = this.getSelectionModel();
1040
+ t == null || t.clear(), e && this.repaint();
922
1041
  }
923
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
+ */
924
1049
  initRenderEditor(e, t) {
925
- var i;
926
- let s = (i = this.tableModel.getColumnDef(t)) == null ? void 0 : i.getEditRenderer;
927
- if (s || (s = this.tableOptions.getEditRenderer), s)
928
- 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) {
929
1054
  this.editorRendererRow = e, this.editorRendererColumn = t, this.editing = !0, this.repaint();
930
- const o = document.querySelector("input.ge-table-cell-editor-input");
931
- o && o.focus();
1055
+ const i = document.querySelector("input.ge-table-cell-editor-input");
1056
+ i && i.focus();
932
1057
  } else
933
1058
  this.resetEditorRenderer();
934
1059
  }
1060
+ /**
1061
+ * Adjusts the content after scrolling and initiates a repaint of the component.
1062
+ *
1063
+ * @return {void}
1064
+ */
935
1065
  repaint() {
936
1066
  this.adjustAfterScrolling();
937
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
+ */
938
1082
  adjustAfterScrolling() {
939
1083
  var e;
940
1084
  for (const t of this.removables)
@@ -957,25 +1101,86 @@ class ce extends ae {
957
1101
  "ge-table-body-west-vertical-border"
958
1102
  ));
959
1103
  }
1104
+ /**
1105
+ * Checks if the scroll position should be saved and saves it.
1106
+ *
1107
+ * @return {void}
1108
+ */
960
1109
  checkForScrollPosSaving() {
961
1110
  var e, t;
962
1111
  this.storeScrollPosStateService && ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreScrollPosition) && this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
963
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
+ */
964
1121
  updateCells(e, t = !1) {
965
1122
  e.forEach(
966
- (s) => {
967
- 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);
968
1125
  }
969
1126
  ), t && this.repaint();
970
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
+ }
971
1167
  getAreaAndSideIdentByAttr(e) {
972
1168
  if (e) {
973
- const t = this.getStringByAttr(e, "data-area"), s = this.getStringByAttr(e, "data-side");
974
- if (s && t)
975
- 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];
976
1172
  }
977
1173
  return [void 0, void 0];
978
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
+ */
979
1184
  getArea(e, t) {
980
1185
  if (e === "header") {
981
1186
  if (t === "west")
@@ -1001,110 +1206,140 @@ class ce extends ae {
1001
1206
  }
1002
1207
  throw Error(`Wrong area identifier: row:${e}, col:${t}`);
1003
1208
  }
1209
+ /**
1210
+ * Adjusts the body of the table.
1211
+ *
1212
+ * @protected
1213
+ * @return {void}
1214
+ */
1004
1215
  adjustBody() {
1005
1216
  const e = this.areaBodyCenterGeo.height - this.tableModel.getContentHeightInPixel(), t = this.scrollFactorY * e;
1006
1217
  this.dom.setStyle(this.contentDiv, "top", `${this.scrollTop}px`), this.dom.setStyle(this.contentDiv, "left", `${this.scrollViewport.scrollLeft}px`), this.adjustArea("body", t);
1007
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
+ */
1008
1227
  getNumberByAttr(e, t) {
1009
- var s;
1228
+ var o;
1010
1229
  if (e) {
1011
- const i = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
1012
- if (i)
1013
- return Number(i);
1230
+ const s = (o = e.closest("[" + t + "]")) == null ? void 0 : o.getAttribute(t);
1231
+ if (s)
1232
+ return Number(s);
1014
1233
  }
1015
1234
  return -1;
1016
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
+ */
1017
1244
  getStringByAttr(e, t) {
1018
- var s;
1245
+ var o;
1019
1246
  if (e) {
1020
- const i = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
1021
- if (i)
1022
- return i;
1247
+ const s = (o = e.closest("[" + t + "]")) == null ? void 0 : o.getAttribute(t);
1248
+ if (s)
1249
+ return s;
1023
1250
  }
1024
1251
  return "";
1025
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
+ */
1026
1261
  adjustArea(e, t = 0) {
1027
- var S;
1028
- const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"), l = i.child.clientHeight;
1029
- s.child.innerText = "", i.child.innerText = "", o.child.innerText = "";
1030
- 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();
1031
1266
  for (; this.cleanupFunctions[e].length; ) {
1032
1267
  const p = this.cleanupFunctions[e].shift();
1033
1268
  p && p();
1034
1269
  }
1035
1270
  let g = t;
1036
- const m = this.tableModel.getColumnCount(), c = this.tableModel.getFixedRightColumnCount(), f = this.tableModel.getFixedLeftColumnCount();
1037
- for (let p = 0; p < u; p++) {
1038
- const w = g, C = p === u - 1, x = this.tableModel.getRowHeight(e, p);
1039
- 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) {
1040
1275
  this.firstVisibleRowIndex = p;
1041
- let y = { left: n, width: r, height: x, top: w, index: p }, v = this.dom.addRowDiv(i, y, p, e, "center");
1042
- 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;
1043
1278
  if (this.adjustColumnsToRowParent({
1044
1279
  areaIdent: e,
1045
1280
  sideIdent: "center",
1046
1281
  areaModel: d,
1047
1282
  geo: y,
1048
- parent: v,
1283
+ parent: m,
1049
1284
  rowIndex: p,
1050
- columnIndexStart: E,
1051
- columnIndexEnd: m - c - 1,
1285
+ columnIndexStart: R,
1286
+ columnIndexEnd: f - S - 1,
1052
1287
  verticalFixed: !1,
1053
- lastRowOfModel: C
1054
- }), 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({
1055
1290
  areaIdent: e,
1056
1291
  sideIdent: "west",
1057
1292
  areaModel: d,
1058
1293
  geo: y,
1059
- parent: v,
1294
+ parent: m,
1060
1295
  rowIndex: p,
1061
1296
  columnIndexStart: 0,
1062
- columnIndexEnd: E - 1,
1297
+ columnIndexEnd: R - 1,
1063
1298
  verticalFixed: !0,
1064
- lastRowOfModel: C
1065
- })), 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({
1066
1301
  areaIdent: e,
1067
1302
  sideIdent: "east",
1068
1303
  areaModel: d,
1069
1304
  geo: y,
1070
- parent: v,
1305
+ parent: m,
1071
1306
  rowIndex: p,
1072
- columnIndexStart: m - c,
1073
- columnIndexEnd: m - 1,
1307
+ columnIndexStart: f - S,
1308
+ columnIndexEnd: f - 1,
1074
1309
  verticalFixed: !0,
1075
- lastRowOfModel: C
1076
- })), e === "header" && this.tree && p === u - 1) {
1310
+ lastRowOfModel: w
1311
+ })), e === "header" && this.tree && p === h - 1) {
1077
1312
  const A = this.dom.applyStyle(
1078
1313
  this.dom.setAttribute(
1079
- this.dom.addDiv(v, new T(16, 20, 20, 8)),
1314
+ this.dom.addDiv(m, new T(16, 20, 20, 8)),
1080
1315
  "data-ge-action",
1081
1316
  "toggleExpandCollapseAll"
1082
1317
  ),
1083
1318
  { cursor: "pointer" }
1084
- ), R = this.tableOptions.treeOptions.arrowExpandCollapseAll;
1085
- if (R) {
1086
- const F = this.dom.domService.createText(R.content);
1087
- 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);
1088
1323
  }
1089
1324
  }
1090
1325
  }
1091
- if (g = g + x, g > l)
1326
+ if (g = g + x, g > r)
1092
1327
  break;
1093
1328
  }
1094
1329
  if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
1095
- const p = ((S = this.colAndRowspanModels[e]) == null ? void 0 : S.getRanges()) ?? [];
1330
+ const p = ((b = this.colAndRowspanModels[e]) == null ? void 0 : b.getRanges()) ?? [];
1096
1331
  if (p.length)
1097
- for (const w of p) {
1098
- let C = 0, x = i.child, y = "center";
1099
- if (w.c1 < f)
1100
- x = s.child, y = "west";
1101
- else if (c > 0 && w.c1 >= m - c)
1102
- 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";
1103
1338
  else {
1104
- const v = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1105
- 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";
1106
1341
  }
1107
- this.drawBigCell(w, C, t, d, x, y);
1342
+ this.drawBigCell(v, w, t, d, x, y);
1108
1343
  }
1109
1344
  }
1110
1345
  }
@@ -1118,328 +1353,536 @@ class ce extends ae {
1118
1353
  * @param sideIdent SideIdent (west,center,east)
1119
1354
  * @protected
1120
1355
  */
1121
- drawBigCell(e, t, s, i, o, l) {
1122
- 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();
1123
1358
  let d = 0;
1124
- a > 0 && e.c1 >= r - a && (d = r - a);
1125
- 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);
1126
- let c = !1;
1127
- const f = this.getSelectionModel ? this.getSelectionModel() : void 0;
1128
- f && (c = f.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? (console.info("TODO here", e), this.renderCell({
1129
- areaModel: i,
1130
- areaIdent: i.areaIdent,
1131
- 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,
1132
1367
  rowIndex: e.r1,
1133
1368
  columnIndex: e.c1,
1134
- left: u,
1135
- top: n,
1136
- width: m,
1369
+ left: h,
1370
+ top: a,
1371
+ width: f,
1137
1372
  height: g,
1138
- parent: o,
1139
- cellSelected: c,
1373
+ parent: i,
1374
+ cellSelected: S,
1140
1375
  lastRowOfModel: !0,
1141
1376
  gammaRange: e.gammaRange
1142
- })) : this.renderCell({
1143
- areaModel: i,
1144
- areaIdent: i.areaIdent,
1145
- sideIdent: l,
1377
+ }) : this.renderCell({
1378
+ areaModel: s,
1379
+ areaIdent: s.areaIdent,
1380
+ sideIdent: r,
1146
1381
  rowIndex: e.r1,
1147
1382
  columnIndex: e.c1,
1148
- left: u,
1149
- top: n,
1150
- width: m,
1383
+ left: h,
1384
+ top: a,
1385
+ width: f,
1151
1386
  height: g,
1152
- parent: o,
1153
- cellSelected: c,
1387
+ parent: i,
1388
+ cellSelected: S,
1154
1389
  lastRowOfModel: !0,
1155
1390
  gammaRange: e.gammaRange
1156
- }), i.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
1391
+ }), s.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
1157
1392
  rowIndex: e.r1,
1158
1393
  columnIndex: e.c1,
1159
- cellLeft: u,
1160
- cellTop: n,
1161
- cellWidth: m,
1394
+ cellLeft: h,
1395
+ cellTop: a,
1396
+ cellWidth: f,
1162
1397
  cellHeight: g,
1163
- parent: o
1398
+ parent: i
1164
1399
  });
1165
1400
  }
1166
- findRowOfImportantRowspanCell(e, t, s) {
1167
- const i = e.getMaxRowspan();
1168
- for (let o = t - 1; o > -1; o--) {
1169
- const l = e.getRowspanAt(o, s);
1170
- if (l > 1 && o + l + 1 >= t)
1171
- return o;
1172
- 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)
1173
1417
  return -1;
1174
1418
  }
1175
1419
  return -1;
1176
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
+ */
1177
1428
  adjustColumnsToRowParent({
1178
1429
  areaIdent: e,
1179
1430
  sideIdent: t,
1180
- areaModel: s,
1181
- geo: i,
1182
- parent: o,
1183
- rowIndex: l,
1184
- columnIndexStart: n,
1185
- columnIndexEnd: r,
1186
- 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,
1187
1438
  lastRowOfModel: d = !1
1188
1439
  }) {
1189
- var f;
1440
+ var u;
1190
1441
  this.scrollViewportLeft = this.scrollViewport.scrollLeft;
1191
- let u = 0;
1192
- if (!a) {
1193
- const S = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1194
- 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;
1195
1446
  }
1196
- const g = 0, m = !!(e === "body" && t);
1197
- let c = u;
1198
- for (let S = n; S <= r; S++) {
1199
- const p = c, w = this.tableModel.getColumnWidth(S);
1200
- if (w > 0 && p + w > 0) {
1201
- let C = i.height;
1202
- const x = s.getRowspanAt(l, S), y = s.getColspanAt(l, S);
1203
- x > 1 && (C = this.getRowHeights(l, l + x - 1, s).reduce((A, R) => A + R, 0));
1204
- let v = w;
1205
- y > 1 && (v = this.getColumnWidths(S, S + y - 1).reduce((A, R) => A + R, 0));
1206
- let E = !1;
1207
- if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (f = this.colAndRowspanModels[e]) != null && f.isInRange(l, S) && (E = !0), this.draggingTargetColumnIndex === S && e !== "header") {
1208
- this.renderDragTargetDiv(o, p, g, v, C);
1209
- const A = { left: p, top: g, width: v, height: C };
1210
- 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);
1211
1462
  } else {
1212
- const A = this.renderSelectedBackgroundDiv(E, m, t, s, l, S, o, p, g, v, C);
1213
- E || this.renderCell({
1214
- 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,
1215
1466
  areaIdent: e,
1216
1467
  sideIdent: t,
1217
- rowIndex: l,
1218
- columnIndex: S,
1468
+ rowIndex: r,
1469
+ columnIndex: b,
1219
1470
  left: p,
1220
1471
  top: g,
1221
- width: v,
1222
- height: C,
1223
- parent: o,
1472
+ width: m,
1473
+ height: w,
1474
+ parent: i,
1224
1475
  cellSelected: A,
1225
1476
  lastRowOfModel: d,
1226
1477
  gammaRange: !0
1227
1478
  }), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
1228
- rowIndex: l,
1229
- columnIndex: S,
1479
+ rowIndex: r,
1480
+ columnIndex: b,
1230
1481
  cellLeft: p,
1231
1482
  cellTop: g,
1232
- cellWidth: v,
1233
- cellHeight: C,
1234
- parent: o
1483
+ cellWidth: m,
1484
+ cellHeight: w,
1485
+ parent: i
1235
1486
  });
1236
1487
  }
1237
1488
  }
1238
- if (c = c + w, c > this.areaBodyCenterGeo.width)
1489
+ if (S = S + v, S > this.areaBodyCenterGeo.width)
1239
1490
  break;
1240
1491
  }
1241
- 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);
1242
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
+ */
1243
1503
  getTreeArrowColumnIndex() {
1244
1504
  return this.tableOptions.showCheckboxWihoutExtraColumn ? 0 : this.tableModel.isRowCheckboxVisible() ? 1 : 0;
1245
1505
  }
1246
1506
  addAndRenderCellDiv({
1247
1507
  areaModel: e,
1248
1508
  areaIdent: t,
1249
- sideIdent: s,
1250
- rowIndex: i,
1251
- index: o,
1252
- left: l,
1253
- width: n,
1254
- height: r,
1255
- top: a,
1509
+ sideIdent: o,
1510
+ rowIndex: s,
1511
+ index: i,
1512
+ left: r,
1513
+ width: a,
1514
+ height: l,
1515
+ top: n,
1256
1516
  parent: d,
1257
- lastRowOfModel: u,
1258
- gammaRange: g
1517
+ lastRowOfModel: h
1259
1518
  }) {
1260
- var _;
1261
- 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);
1262
- let p = "none";
1263
- if (o === this.getTreeArrowColumnIndex() && O(S)) {
1264
- const b = S;
1265
- (_ = b.children) != null && _.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";
1266
1525
  }
1267
- let C;
1526
+ let v;
1268
1527
  if (t === "header") {
1269
- const b = this.tableModel.getColumnDef(o);
1270
- (!(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);
1271
1530
  }
1272
- const x = e.getValueAt(i, o), y = c ? "" : `${x}`, v = e.isRowChecked(i), E = this.dom.addColumnDiv(
1273
- d,
1274
- f,
1275
- i,
1276
- o,
1277
- t,
1278
- s,
1279
- y,
1280
- p,
1281
- this.tableOptions,
1282
- v,
1283
- C
1284
- ), A = e.getTooltipAt(i, o);
1285
- A && this.dom.setAttribute(E, "title", A);
1286
- const R = this.tableModel.getColumnDef(o);
1287
- R && R.classes[t] && this.dom.addClasses(R.classes[t], E);
1288
- let F;
1289
- c && (F = c.render(E, i, o, t, e, x, this.dom.domService));
1290
- const V = e.getCustomClassesAt(i, o);
1291
- if (V.length && this.dom.addClasses(V, 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") {
1292
- const b = this.getFocusModel();
1293
- 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, {});
1294
1555
  }
1295
- t === "header" && this.dom.setAttribute(E, "data-ge-action", "drag-column");
1296
- const L = e.getCustomStyleAt(i, o);
1297
- if (L)
1298
- for (const b in L)
1299
- this.dom.setStyle(E, b, L[b]);
1300
- 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];
1301
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
+ */
1302
1570
  applyCssClasses(e, t = {}) {
1303
- e && Object.entries(t).forEach(([s, i]) => {
1304
- 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);
1305
1573
  });
1306
1574
  }
1307
- rerenderCellContent({ area: e, rowIndex: t, columnIndex: s, value: i, cssClasses: o }) {
1308
- const l = this.tableModel.getAreaModel(e), n = 'div[data-col-index="' + s + '"][data-row-index="' + t + '"][data-area="' + e + '"]', r = document.querySelector(n);
1309
- if (r) {
1310
- let a;
1311
- const u = this.editorRenderer && this.editorRendererRow === t && this.editorRendererColumn === s ? this.editorRenderer : l.getCellRenderer(t, s);
1312
- if (r.innerText = "", this.applyCssClasses(r, o), u)
1313
- a = u.render(r, t, s, e, l, i, this.dom.domService), a && this.cleanupFunctions[e].push(a);
1314
- else {
1315
- const c = `${i}`;
1316
- this.dom.addLabelDiv(r, c, !1, t, s, e);
1317
- }
1318
- const g = l.getCustomClassesAt(t, s);
1319
- g.length && this.dom.addClasses(g, r);
1320
- const m = l.getCustomStyleAt(t, s);
1321
- if (m)
1322
- for (const c in m)
1323
- this.dom.setStyle(r, c, m[c]);
1324
- }
1325
- }
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
+ */
1326
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) {
1327
1598
  const s = [];
1328
1599
  for (let i = e; i <= t; i++)
1329
- s.push(this.tableModel.getColumnWidth(i));
1600
+ s.push(o.getRowHeight(i));
1330
1601
  return s;
1331
1602
  }
1332
- getRowHeights(e, t, s) {
1333
- const i = [];
1334
- for (let o = e; o <= t; o++)
1335
- i.push(s.getRowHeight(o));
1336
- return i;
1337
- }
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
+ */
1338
1610
  adjustHoverRows(e) {
1339
1611
  if (this.tableOptions.hoverRowVisible && e.rowIndex > -1) {
1340
- 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;
1341
1613
  this.dom.applyStyle(this.hoverRow, {
1342
1614
  left: "0",
1343
- top: i + "px",
1615
+ top: s + "px",
1344
1616
  width: t + "px",
1345
- height: s + "px",
1617
+ height: o + "px",
1346
1618
  display: "block"
1347
1619
  });
1348
1620
  } else
1349
1621
  this.hideHoverRow();
1350
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
+ */
1351
1633
  hideHoverRow() {
1352
1634
  this.dom.applyStyle(this.hoverRow, {
1353
1635
  display: "none"
1354
1636
  });
1355
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
+ */
1356
1643
  adjustHoverColumns(e) {
1357
1644
  if (this.tableOptions.hoverColumnVisible && e.rowIndex > -1) {
1358
- 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;
1359
1646
  this.dom.applyStyle(this.hoverColumn, {
1360
- left: o + "px",
1647
+ left: i + "px",
1361
1648
  top: "0px",
1362
- width: s + "px",
1649
+ width: o + "px",
1363
1650
  height: t + "px",
1364
1651
  display: "block"
1365
1652
  });
1366
1653
  } else
1367
1654
  this.hideHoverColumn();
1368
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
+ */
1369
1665
  hideHoverColumn() {
1370
1666
  this.dom.applyStyle(this.hoverColumn, {
1371
1667
  display: "none"
1372
1668
  });
1373
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
+ */
1374
1678
  debounce(e, t = 1e3) {
1375
1679
  this.debounceTimeout && clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(e.bind(this), t);
1376
1680
  }
1377
- renderDragTargetDiv(e, t, s, i, o) {
1378
- 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(
1379
1774
  this.dom.createDivWithClass("ge-table-drop-zone", e)
1380
1775
  );
1381
- 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;
1382
1777
  }
1383
- 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) {
1384
1796
  let g = !1;
1385
- if (!e && t && i.isSelectable(o, l) && this.getSelectionModel) {
1386
- const m = this.getSelectionModel();
1387
- if (m) {
1388
- const c = m.getSelectionCount(o, l);
1389
- g = c > 0;
1390
- for (let f = 0; f < c; f++) {
1391
- 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(
1392
1804
  // ge-table-body-west-selected-range
1393
- this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`, n)
1805
+ this.dom.createDivWithClass(`ge-table-${s.areaIdent}-${o}-selected-range`, a)
1394
1806
  );
1395
- 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`);
1396
1808
  }
1397
1809
  }
1398
1810
  }
1399
1811
  return g;
1400
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
+ */
1401
1832
  renderCell({
1402
1833
  areaModel: e,
1403
1834
  areaIdent: t,
1404
- sideIdent: s,
1405
- rowIndex: i,
1406
- columnIndex: o,
1407
- left: l,
1408
- top: n,
1409
- width: r,
1410
- height: a,
1835
+ sideIdent: o,
1836
+ rowIndex: s,
1837
+ columnIndex: i,
1838
+ left: r,
1839
+ top: a,
1840
+ width: l,
1841
+ height: n,
1411
1842
  parent: d,
1412
- cellSelected: u,
1413
- lastRowOfModel: g,
1414
- gammaRange: m
1843
+ cellSelected: h,
1844
+ lastRowOfModel: g
1415
1845
  }) {
1416
- const [c, f] = this.addAndRenderCellDiv({
1846
+ const [f, S] = this.addAndRenderCellDiv({
1417
1847
  areaModel: e,
1418
1848
  areaIdent: t,
1419
- sideIdent: s,
1420
- rowIndex: i,
1421
- index: o,
1422
- left: l,
1423
- width: r,
1424
- height: a,
1425
- top: n,
1849
+ sideIdent: o,
1850
+ rowIndex: s,
1851
+ index: i,
1852
+ left: r,
1853
+ width: l,
1854
+ height: n,
1855
+ top: a,
1426
1856
  parent: d,
1427
- lastRowOfModel: g,
1428
- gammaRange: m
1857
+ lastRowOfModel: g
1429
1858
  });
1430
- 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);
1431
1860
  }
1432
- renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight: l, parent: n }) {
1433
- const r = this.dom.domService, a = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = r.createElement("div");
1434
- 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);
1435
1878
  }
1436
1879
  }
1437
- class pe {
1880
+ class me {
1438
1881
  constructor(e, t) {
1439
1882
  this.columnIndex = e, this.sortState = t;
1440
1883
  }
1441
1884
  }
1442
- class ue {
1885
+ class ye {
1443
1886
  constructor(e) {
1444
1887
  this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
1445
1888
  }
@@ -1453,52 +1896,52 @@ class ue {
1453
1896
  */
1454
1897
  onHostElementChanged(e) {
1455
1898
  if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
1456
- const t = e.target, s = t.getAttribute("data-area"), i = t.getAttribute("data-row-index"), o = t.getAttribute("data-col-index");
1457
- if (s && i && o) {
1458
- const l = W(s), n = Number(i), r = Number(o);
1459
- 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);
1460
1903
  }
1461
1904
  }
1462
1905
  }
1463
1906
  }
1464
- class Se {
1907
+ class ve {
1465
1908
  constructor(e = -1, t = -1) {
1466
1909
  this.rowIndex = e, this.columnIndex = t;
1467
1910
  }
1468
1911
  }
1469
- class P {
1912
+ class V {
1470
1913
  constructor(e) {
1471
1914
  this.cells = e;
1472
1915
  }
1473
1916
  static createSingle(e, t) {
1474
- return new P([new Se(e, t)]);
1917
+ return new V([new ve(e, t)]);
1475
1918
  }
1476
1919
  }
1477
- class ge {
1920
+ class we {
1478
1921
  constructor(e) {
1479
- var t, s;
1480
- 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);
1481
1924
  }
1482
1925
  onMouseClicked(e, t) {
1483
- var o, l, n, r, a, d, u;
1484
- let s = !1, i = !1;
1926
+ var i, r, a, l, n, d, h;
1927
+ let o = !1, s = !1;
1485
1928
  if (this.getSelectionModel && this.getFocusModel) {
1486
- const g = this.getSelectionModel(), m = this.getFocusModel();
1487
- 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));
1488
1931
  }
1489
- 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;
1490
1933
  }
1491
1934
  onActionTriggered(e) {
1492
1935
  if (this.getSelectionModel && this.getFocusModel) {
1493
- const t = this.getSelectionModel(), s = this.getFocusModel();
1494
- if (t && s) {
1936
+ const t = this.getSelectionModel(), o = this.getFocusModel();
1937
+ if (t && o) {
1495
1938
  if (e === "SELECT_ALL")
1496
1939
  return t.selectAll(), this.tableScope.repaint(), !0;
1497
1940
  if (e === "DESELECT_ALL")
1498
1941
  return t.clear(), this.tableScope.repaint(), !0;
1499
1942
  if (e === "TOGGLE_SELECTION") {
1500
- const [i, o] = s.getFocus();
1501
- 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;
1502
1945
  }
1503
1946
  }
1504
1947
  }
@@ -1506,16 +1949,16 @@ class ge {
1506
1949
  }
1507
1950
  createRangeByEvents(e, t) {
1508
1951
  t || (t = e);
1509
- 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);
1510
- return M.create({
1511
- rowIndex1: s,
1512
- columnIndex1: o,
1513
- rowIndex2: i,
1514
- 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
1515
1958
  });
1516
1959
  }
1517
1960
  }
1518
- class me {
1961
+ class Ce {
1519
1962
  get() {
1520
1963
  return {
1521
1964
  f2: "START_EDITING",
@@ -1525,43 +1968,60 @@ class me {
1525
1968
  "ctrl+shift+a": "DESELECT_ALL",
1526
1969
  "ctrl+x": "DESELECT_ALL",
1527
1970
  "ctrl+num_subtract": "DESELECT_ALL",
1528
- "cmd -": "DESELECT_ALL",
1971
+ "meta -": "DESELECT_ALL",
1529
1972
  arrowup: "NAVIGATE_UP",
1530
1973
  arrowdown: "NAVIGATE_DOWN",
1531
1974
  arrowleft: "NAVIGATE_LEFT",
1532
- arrowright: "NAVIGATE_RIGHT"
1975
+ arrowright: "NAVIGATE_RIGHT",
1976
+ "meta+c": "COPY_2_CLIPBOARD",
1977
+ "ctrl+c": "COPY_2_CLIPBOARD"
1533
1978
  };
1534
1979
  }
1535
1980
  }
1536
- class fe {
1981
+ class xe {
1537
1982
  get() {
1538
1983
  return {
1539
1984
  f2: "START_EDITING",
1540
1985
  space: "TOGGLE_SELECTION",
1541
1986
  "ctrl+num_add": "SELECT_ALL",
1542
- "cmd+a": "SELECT_ALL",
1987
+ "meta+a": "SELECT_ALL",
1543
1988
  "ctrl+a": "SELECT_ALL",
1544
- "cmd+x": "DESELECT_ALL",
1545
- "cmd+shift+a": "DESELECT_ALL",
1989
+ "meta+x": "DESELECT_ALL",
1990
+ "meta+shift+a": "DESELECT_ALL",
1546
1991
  "ctrl+shift+a": "DESELECT_ALL",
1547
1992
  "ctrl+num_subtract": "DESELECT_ALL",
1548
1993
  "ctrl -": "DESELECT_ALL",
1549
1994
  arrowup: "NAVIGATE_UP",
1550
1995
  arrowdown: "NAVIGATE_DOWN",
1551
1996
  arrowleft: "NAVIGATE_LEFT",
1552
- arrowright: "NAVIGATE_RIGHT"
1997
+ arrowright: "NAVIGATE_RIGHT",
1998
+ "meta+c": "COPY_2_CLIPBOARD",
1999
+ "ctrl+c": "COPY_2_CLIPBOARD"
1553
2000
  };
1554
2001
  }
1555
2002
  }
1556
- class be {
2003
+ class Ee {
1557
2004
  constructor(e) {
1558
2005
  this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
1559
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
+ */
1560
2013
  addListener(e) {
1561
2014
  this.listener.includes(e) || this.listener.push(e);
1562
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
+ */
1563
2020
  init() {
1564
- this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new fe().get()) : Object.assign(this.shortcutActionIdMapping, new me().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());
1565
2025
  }
1566
2026
  isMacintosh() {
1567
2027
  return navigator.platform.indexOf("Mac") > -1;
@@ -1573,30 +2033,30 @@ class be {
1573
2033
  return location.hostname === "localhost" || location.hostname === "127.0.0.1";
1574
2034
  }
1575
2035
  onKeyDown(e) {
1576
- const t = this.findEnty(e);
2036
+ const t = this.findEntity(e);
1577
2037
  t && this.emit(t) && (e.preventDefault(), e.stopPropagation());
1578
2038
  }
1579
2039
  emit(e) {
1580
- this.isDebug() && console.debug("ShortcutService emit:", e);
2040
+ this.isDebug() && console.debug("ShortcutService emit :", e);
1581
2041
  let t = !1;
1582
- for (const s of this.listener)
1583
- s.onActionTriggered(e) && (t = !0);
2042
+ for (const o of this.listener)
2043
+ o.onActionTriggered(e) && (t = !0);
1584
2044
  return t;
1585
2045
  }
1586
- findEnty(e) {
2046
+ findEntity(e) {
1587
2047
  const t = this.getTokenByEvent(e);
1588
- this.isDebug() && console.debug("ShortcutService tokens:", t);
1589
- for (const s in this.shortcutActionIdMapping) {
1590
- const i = s.replace(/opt/g, "alt").replace(/cmd/g, "meta").split(/[\+ ]/g).sort();
1591
- if (this.areTokensEquals(t, i))
1592
- 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];
1593
2053
  }
1594
2054
  }
1595
2055
  areTokensEquals(e, t) {
1596
2056
  if (e.length !== t.length || e.length === 0)
1597
2057
  return !1;
1598
- for (let s = 0; s < e.length; s++)
1599
- if (e[s] !== t[s])
2058
+ for (let o = 0; o < e.length; o++)
2059
+ if (e[o] !== t[o])
1600
2060
  return !1;
1601
2061
  return !0;
1602
2062
  }
@@ -1604,8 +2064,16 @@ class be {
1604
2064
  const t = [];
1605
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();
1606
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
+ }
1607
2075
  }
1608
- class N {
2076
+ class X {
1609
2077
  onCheckboxChanged(e) {
1610
2078
  }
1611
2079
  onContextmenu(e) {
@@ -1620,20 +2088,24 @@ class N {
1620
2088
  }
1621
2089
  onMouseMoved(e) {
1622
2090
  }
2091
+ onSelectionChanged(e) {
2092
+ }
2093
+ onFocusChanged(e) {
2094
+ }
1623
2095
  }
1624
- class K {
1625
- setStyle(e, t, s) {
1626
- return e.style[t] = s, e;
2096
+ class J {
2097
+ setStyle(e, t, o) {
2098
+ return e.style[t] = o, e;
1627
2099
  }
1628
2100
  appendText(e, t) {
1629
- const s = this.createText(t);
1630
- return this.appendChild(e, s), s;
2101
+ const o = this.createText(t);
2102
+ return this.appendChild(e, o), o;
1631
2103
  }
1632
2104
  addClass(e, t) {
1633
- 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;
1634
2106
  }
1635
2107
  removeClass(e, t) {
1636
- 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;
1637
2109
  }
1638
2110
  appendChild(e, t) {
1639
2111
  e.appendChild(t);
@@ -1644,44 +2116,47 @@ class K {
1644
2116
  createText(e) {
1645
2117
  return document.createTextNode(e);
1646
2118
  }
1647
- setAttribute(e, t, s) {
1648
- e.setAttribute(t, s);
2119
+ setAttribute(e, t, o) {
2120
+ e.setAttribute(t, o);
1649
2121
  }
1650
2122
  }
1651
- class ye {
1652
- render(e, t, s, i, o, l, n) {
1653
- if (o.isEditable(t, s)) {
1654
- n.addClass(e, "ge-table-row-input-div");
1655
- 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);
1656
2128
  e.innerHTML = `
1657
2129
  <input
1658
2130
  type="text"
1659
- value="${r}"
2131
+ value="${l}"
1660
2132
  autofocus
1661
2133
  onfocus="this.setSelectionRange(0, this.value.length)"
1662
2134
  data-listen="change"
1663
- data-area="${i}"
2135
+ data-area="${s}"
1664
2136
  data-row-index="${t}"
1665
- data-col-index="${s}"
2137
+ data-col-index="${o}"
1666
2138
  data-input-type="text"
1667
2139
  style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
1668
2140
  class="ge-table-cell-editor-input">`;
1669
2141
  }
1670
2142
  }
1671
2143
  }
1672
- class ve {
2144
+ class Me {
1673
2145
  constructor(e = "none", t = "single") {
1674
2146
  this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
1675
2147
  }
2148
+ firstClick(e, t) {
2149
+ this.selectionType === "row" ? this.addRange(E.singleRow(e)) : this.selectionType === "column" && this.addRange(E.singleColumn(t));
2150
+ }
1676
2151
  getSelectionCount(e, t) {
1677
- let s = 0;
1678
- for (const i of this.ranges)
1679
- i.isInRange(e, t) && s++;
1680
- 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;
1681
2156
  }
1682
2157
  isInNegativeRange(e, t) {
1683
- for (const s of this.negativeRanges)
1684
- if (s.isInRange(e, t))
2158
+ for (const o of this.negativeRanges)
2159
+ if (o.isInRange(e, t))
1685
2160
  return !0;
1686
2161
  return !1;
1687
2162
  }
@@ -1692,11 +2167,29 @@ class ve {
1692
2167
  this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
1693
2168
  }
1694
2169
  hasSelection() {
1695
- 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);
1696
2186
  }
1697
2187
  selectAll() {
1698
2188
  this.allSelected = !0;
1699
2189
  }
2190
+ isAllSelected() {
2191
+ return this.allSelected;
2192
+ }
1700
2193
  addSelection(e) {
1701
2194
  this.addRange(e);
1702
2195
  }
@@ -1704,16 +2197,19 @@ class ve {
1704
2197
  if (this.selectionType === "none")
1705
2198
  return;
1706
2199
  let t = e;
1707
- 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);
1708
2201
  }
1709
2202
  togglePoint(e, t) {
1710
- 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;
1711
2207
  }
1712
2208
  addRange(e) {
1713
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));
1714
2210
  }
1715
2211
  }
1716
- class Ce {
2212
+ class Re {
1717
2213
  constructor(e = "none") {
1718
2214
  this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
1719
2215
  }
@@ -1736,29 +2232,128 @@ class Ce {
1736
2232
  return [this.rowIndex, this.columnIndex];
1737
2233
  }
1738
2234
  }
1739
- const xe = new ve(), we = new Ce("cell");
1740
- 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 {
1741
2251
  constructor() {
1742
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 = {
1743
2253
  header: 34,
1744
2254
  body: 34,
1745
2255
  footer: 34
1746
- }, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new j(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new X(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new ye(), this.getSelectionModel = () => xe, this.getFocusModel = () => we;
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;
1747
2257
  }
1748
2258
  }
1749
- class k extends ce {
1750
- constructor(e, t, s, i, o) {
1751
- 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;
1752
2347
  if (super(
1753
2348
  e,
1754
2349
  t,
1755
- new ee(s),
1756
- i
1757
- ), this.eventListener = o, this.licenseManager = D.getInstance(), this.selectionService = new ge(this), this.api = new ie(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new N()), (l = this.tableOptions) != null && l.autoRestoreOptions) {
1758
- const n = this.tableOptions.autoRestoreOptions, r = n.getStorageKeyFn;
1759
- r && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new oe(r)), n.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new re(r)), n.autoRestoreSortingState && (this.storeSortingService = new ne(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)));
1760
2355
  }
1761
- this.mouseHandler = new se(this), this.inputHandler = new ue(this), this.shortcutService = new be(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);
1762
2357
  }
1763
2358
  /**
1764
2359
  * Creates a TableScope instance.
@@ -1768,33 +2363,47 @@ class k extends ce {
1768
2363
  * @param {TableOptionsIf} [tableOptions=new TableOptions()] - The optional table options object.
1769
2364
  * @param {EventListenerIf} [eventListener=new EventAdapter()] - The optional event listener object.
1770
2365
  * @param {DomServiceIf} [domService=new SimpleDomService()] - The optional DOM service object.
2366
+ * @param {CopyServiceIf} [copyService=new CopyService()] - The optional copy service object.
1771
2367
  *
1772
2368
  * @return {TableScope} - The newly created TableScope instance.
1773
2369
  */
1774
- static create(e, t, s = new z(), i = new N(), o = new K()) {
1775
- return new k(
2370
+ static create(e, t, o = new Z(), s = new X(), i = new J(), r = new O()) {
2371
+ return new z(
1776
2372
  e,
1777
2373
  t,
2374
+ i,
1778
2375
  o,
1779
2376
  s,
1780
- i
2377
+ r
1781
2378
  );
1782
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
+ */
1783
2388
  onActionTriggered(e) {
1784
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))
1785
2390
  return !0;
1786
2391
  if (e === "START_EDITING" && this.getFocusModel) {
1787
2392
  const t = this.getFocusModel();
1788
2393
  if (t) {
1789
- const [s, i] = t.getFocus();
1790
- 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));
1791
2396
  }
1792
2397
  return !0;
1793
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
+ }
1794
2403
  return !1;
1795
2404
  }
1796
- updateModelValueAfterEdit(e, t, s, i) {
1797
- e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, i) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(P.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());
1798
2407
  }
1799
2408
  /**
1800
2409
  * Retrieves the TableApi object.
@@ -1823,16 +2432,16 @@ class k extends ce {
1823
2432
  * @return {GeMouseEvent} - The created GeMouseEvent object.
1824
2433
  */
1825
2434
  createGeMouseEvent(e) {
1826
- const t = new B();
2435
+ const t = new W();
1827
2436
  if (t.originalEvent = e, e) {
1828
- const s = e.target;
1829
- 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) {
1830
- const i = this.tableModel.getAreaModel(t.areaIdent);
1831
- 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);
1832
2441
  }
1833
2442
  if (t.columnLeft = this.tableModel.getXPosByColumnIndex(t.columnIndex), e.ctrlKey && e.altKey) {
1834
- const i = e.clientY - this.hostElement.offsetTop - this.areaHeaderCenter.parent.clientHeight, o = e.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width;
1835
- 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);
1836
2445
  }
1837
2446
  }
1838
2447
  return t;
@@ -1844,15 +2453,16 @@ class k extends ce {
1844
2453
  * @return {void}
1845
2454
  */
1846
2455
  onMouseDown(e) {
1847
- 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));
1848
2457
  }
1849
2458
  /**
1850
2459
  * Handles mouse dragging on the frame.
1851
2460
  *
1852
2461
  * @param {GeMouseEvent} mouseEvent - The mouse event object.
2462
+ * @param startMouseEvent
1853
2463
  */
1854
- mouseDraggingOnFrame(e) {
1855
- 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());
1856
2466
  }
1857
2467
  /**
1858
2468
  * Handles the end of mouse dragging event on a frame.
@@ -1862,7 +2472,7 @@ class k extends ce {
1862
2472
  * @returns {void}
1863
2473
  */
1864
2474
  mouseDraggingEndOnFrame(e) {
1865
- 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 = "";
1866
2476
  }
1867
2477
  /**
1868
2478
  * Handles the mouse move event.
@@ -1890,9 +2500,9 @@ class k extends ce {
1890
2500
  * @return {void}
1891
2501
  */
1892
2502
  toggleExpandCollapseAll(e = !0) {
1893
- var s;
2503
+ var o;
1894
2504
  const t = this.tableModel.getBodyModel();
1895
- $(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));
1896
2506
  }
1897
2507
  /**
1898
2508
  * Toggles the checkbox state of a specific row in a table.
@@ -1903,12 +2513,12 @@ class k extends ce {
1903
2513
  *
1904
2514
  * @return {void} - This method does not return anything.
1905
2515
  */
1906
- toggleRowCheckbox(e, t, s) {
1907
- var r;
1908
- const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e), l = o === void 0 || o === "semi" || o === "none";
1909
- i.setRowChecked(e, l), this.repaint();
1910
- const n = (r = i.rowSelectionModel) == null ? void 0 : r.getCheckedRows();
1911
- 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 || []);
1912
2522
  }
1913
2523
  /**
1914
2524
  * Handle mouse click events.
@@ -1918,12 +2528,25 @@ class k extends ce {
1918
2528
  * @returns {void}
1919
2529
  */
1920
2530
  onMouseClicked(e, t) {
1921
- let s = this.selectionService.onMouseClicked(e, t);
1922
- if (!s && this.getFocusModel) {
1923
- const i = this.getFocusModel();
1924
- 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());
1925
2536
  }
1926
- 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);
1927
2550
  }
1928
2551
  /**
1929
2552
  * Updates the table (repaint) when an external filter is changed.
@@ -1944,15 +2567,73 @@ class k extends ce {
1944
2567
  *
1945
2568
  * @return {void}
1946
2569
  */
1947
- onHeaderDblClicked(e, t, s) {
1948
- var o, l;
1949
- const i = this.tableModel.getColumnDef(s);
1950
- 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()) {
1951
2574
  e.preventDefault(), e.stopPropagation();
1952
- const n = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, r = i.sortState ?? "", a = n[(n.indexOf(r) + 1) % n.length], d = new pe(s, a);
1953
- 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]);
1954
2577
  }
1955
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
+ }
1956
2637
  /**
1957
2638
  * Changes the focus cell using the specified deltas.
1958
2639
  *
@@ -1962,10 +2643,10 @@ class k extends ce {
1962
2643
  */
1963
2644
  changeFocusCell(e, t) {
1964
2645
  if (!this.isEditing() && this.getFocusModel) {
1965
- const s = this.getFocusModel();
1966
- if (s) {
1967
- const [i, o] = s.getFocus();
1968
- 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;
1969
2650
  }
1970
2651
  }
1971
2652
  return !1;
@@ -1988,22 +2669,20 @@ class k extends ce {
1988
2669
  this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
1989
2670
  }
1990
2671
  debugOnce(e, t) {
1991
- var s;
1992
- 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);
1993
2674
  }
1994
2675
  /**
1995
2676
  * Restores the scroll position of the table if auto restore options are enabled.
1996
2677
  *
1997
- * @private
1998
- * @memberof ClassName
1999
2678
  *
2000
2679
  * @returns {void}
2001
2680
  */
2002
2681
  autoRestoreScrollPosition() {
2003
2682
  var e;
2004
2683
  if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
2005
- const s = this.storeScrollPosStateService.getScrollOffset();
2006
- s && this.scrollViewport.scrollTo(...s);
2684
+ const o = this.storeScrollPosStateService.getScrollOffset();
2685
+ o && this.scrollViewport.scrollTo(...o);
2007
2686
  }
2008
2687
  }
2009
2688
  /**
@@ -2023,8 +2702,8 @@ class k extends ce {
2023
2702
  autoRestoreSortingState() {
2024
2703
  var e, t;
2025
2704
  if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
2026
- const s = this.storeSortingService.getSortItems();
2027
- 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);
2028
2707
  }
2029
2708
  }
2030
2709
  /**
@@ -2036,52 +2715,308 @@ class k extends ce {
2036
2715
  autoRestoreCollapsedExpandedState() {
2037
2716
  var e, t;
2038
2717
  if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
2039
- const s = this.tableOptions.autoRestoreOptions, i = s.getRowId;
2040
- if (s.autoRestoreCollapsedExpandedState && i) {
2041
- const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), l = this.tableModel.getAreaModel("body");
2042
- if ($(l)) {
2043
- const n = l, r = l.getRowCount();
2044
- for (let a = 0; a < r; a++) {
2045
- 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);
2046
2725
  if (d)
2047
- if (o.allExpanded)
2726
+ if (i.allExpanded)
2048
2727
  d.expanded = !0;
2049
- else if (o.allCollapsed)
2728
+ else if (i.allCollapsed)
2050
2729
  d.expanded = !1;
2051
2730
  else {
2052
- const u = i(d.data);
2053
- 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));
2054
2733
  }
2055
2734
  }
2056
- n.recalcVisibleTreeRows();
2735
+ a.recalcVisibleTreeRows();
2057
2736
  }
2058
2737
  }
2059
2738
  }
2060
2739
  }
2061
- /**
2062
- * Scrolls the viewport to the specified pixel coordinates.
2063
- *
2064
- * @param {number} px - The horizontal pixel coordinate to scroll to.
2065
- * @param {number} py - The vertical pixel coordinate to scroll to.
2066
- *
2067
- * @return {void}
2068
- */
2069
- scrollToPixel(e, t) {
2070
- this.scrollViewport.scrollTo(e, t);
2740
+ }
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;
2071
2981
  }
2072
- /**
2073
- * Scrolls to the specified index in the table.
2074
- *
2075
- * @param {number} _indexX - The horizontal index of the table where scrolling is needed.
2076
- * @param {number} indexY - The vertical index of the table where scrolling is needed.
2077
- * @return {void}
2078
- */
2079
- scrollToIndex(e, t) {
2080
- const i = this.tableModel.getAreaModel("body").getYPosByRowIndex(t);
2081
- this.scrollToPixel(0, i);
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, "");
2082
2989
  }
2083
- }
2084
- const Ee = Y({
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({
2085
3020
  inheritAttrs: !1,
2086
3021
  props: {
2087
3022
  tableModel: {
@@ -2089,7 +3024,7 @@ const Ee = Y({
2089
3024
  },
2090
3025
  tableOptions: {
2091
3026
  required: !1,
2092
- default: new z()
3027
+ default: new Z()
2093
3028
  },
2094
3029
  debounceMouseClickDelay: {
2095
3030
  required: !1,
@@ -2107,96 +3042,103 @@ const Ee = Y({
2107
3042
  "checkboxChanged",
2108
3043
  "contextmenu",
2109
3044
  "modelChanged",
3045
+ "focusChanged",
3046
+ "selectionChanged",
2110
3047
  "mouseDraggingEnd",
2111
3048
  "mouseMoved"
2112
3049
  ],
2113
- setup(h, { emit: e }) {
2114
- const t = q(null), s = (i) => {
2115
- const o = {
2116
- onCheckboxChanged: (n) => {
2117
- 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);
2118
3055
  },
2119
- onContextmenu: (n) => {
2120
- e("contextmenu", n);
3056
+ onFocusChanged: (a) => {
3057
+ e("focusChanged", a);
2121
3058
  },
2122
- onModelChanged: (n) => {
2123
- e("modelChanged", n);
3059
+ onCheckboxChanged: (a) => {
3060
+ e("checkboxChanged", a);
2124
3061
  },
2125
- onMouseClicked: (n) => {
2126
- e("mouseClicked", n);
3062
+ onContextmenu: (a) => {
3063
+ e("contextmenu", a);
2127
3064
  },
2128
- onMouseDragging: (n) => {
2129
- e("mouseDragging", n);
3065
+ onModelChanged: (a) => {
3066
+ e("modelChanged", a);
2130
3067
  },
2131
- onMouseDraggingEnd: (n) => {
2132
- e("mouseDraggingEnd", n);
3068
+ onMouseClicked: (a) => {
3069
+ e("mouseClicked", a);
2133
3070
  },
2134
- onMouseMoved: (n) => {
2135
- 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);
2136
3079
  }
2137
- }, l = new k(
2138
- i,
2139
- h.tableModel,
2140
- new K(),
2141
- h.tableOptions,
2142
- o
3080
+ }, r = new z(
3081
+ s,
3082
+ c.tableModel,
3083
+ new J(),
3084
+ c.tableOptions,
3085
+ i
2143
3086
  );
2144
- l.firstInit(), e("tableReady", l.getApi());
3087
+ r.firstInit(), e("tableReady", r.getApi());
2145
3088
  };
2146
- return U(() => {
2147
- t.value && s(t.value);
2148
- }), h.licenseKey && D.getInstance().setLicenseKey(h.licenseKey), {
3089
+ return oe(() => {
3090
+ t.value && o(t.value);
3091
+ }), c.licenseKey && k.getInstance().setLicenseKey(c.licenseKey), {
2149
3092
  root: t
2150
3093
  };
2151
3094
  }
2152
- });
2153
- const Ae = (h, e) => {
2154
- const t = h.__vccOpts || h;
2155
- for (const [s, i] of e)
2156
- t[s] = i;
3095
+ }), Ie = (c, e) => {
3096
+ const t = c.__vccOpts || c;
3097
+ for (const [o, s] of e)
3098
+ t[o] = s;
2157
3099
  return t;
2158
- }, Me = {
3100
+ }, Fe = {
2159
3101
  ref: "root",
2160
3102
  class: "container-div",
2161
3103
  style: { width: "100%", height: "100%", "background-color": "transparent", padding: "0", margin: "0" }
2162
3104
  };
2163
- function Re(h, e, t, s, i, o) {
2164
- return J(), Q("div", Me, null, 512);
3105
+ function Oe(c, e, t, o, s, i) {
3106
+ return se(), ie("div", Fe, null, 512);
2165
3107
  }
2166
- const Te = /* @__PURE__ */ Ae(Ee, [["render", Re]]);
2167
- class Ie {
3108
+ const Le = /* @__PURE__ */ Ie(ke, [["render", Oe]]);
3109
+ class Be {
2168
3110
  constructor(e, t) {
2169
3111
  this.component = e, this.appContext = t;
2170
3112
  }
2171
- render(e, t, s, i, o, l, n) {
3113
+ render(e, t, o, s, i, r, a) {
2172
3114
  return this.mount(
2173
3115
  this.component,
2174
3116
  {
2175
3117
  cellDiv: e,
2176
3118
  rowIndex: t,
2177
- columnIndex: s,
2178
- areaIdent: i,
2179
- areaModel: o,
2180
- cellValue: l
3119
+ columnIndex: o,
3120
+ areaIdent: s,
3121
+ areaModel: i,
3122
+ cellValue: r
2181
3123
  },
2182
3124
  this.appContext,
2183
3125
  e
2184
3126
  );
2185
3127
  }
2186
- mount(e, t, s, i) {
2187
- let o = Z(e, t);
2188
- return o.appContext = s, G(o, i), () => {
2189
- i && G(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);
2190
3132
  };
2191
3133
  }
2192
3134
  }
2193
- const Fe = {
2194
- install: (h, e = { img: "" }) => {
2195
- h.component("GuiexpertTable", Te);
3135
+ const He = {
3136
+ install: (c, e = { img: "" }) => {
3137
+ c.component("GuiexpertTable", Le);
2196
3138
  }
2197
3139
  };
2198
3140
  export {
2199
- Ie as ComponentRendererWrapper,
2200
- Te as GuiexpertTable,
2201
- Fe as default
3141
+ Be as ComponentRendererWrapper,
3142
+ Le as GuiexpertTable,
3143
+ He as default
2202
3144
  };