@guiexpert/react-table 0.0.1 → 1.0.3

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.mjs CHANGED
@@ -1,12 +1,12 @@
1
- import { jsx as W } from "react/jsx-runtime";
2
- import { useRef as V, useEffect as G } from "react";
3
- import N from "react-dom";
4
- class $ {
5
- constructor(e = -1, t = -1, s = -1, i = -1, o, r, l, n = 0, d = 0, h = 0, S = "") {
6
- this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = i, this.areaIdent = o, this.sideIdent = r, this.originalEvent = l, this.clickCount = n, this.draggingX = d, this.draggingY = h, this.action = S;
1
+ import { jsx as z } from "react/jsx-runtime";
2
+ import { useRef as j, useEffect as X } from "react";
3
+ import K from "react-dom";
4
+ class P {
5
+ constructor(e = -1, t = -1, i = -1, s = -1, o, r, n, l = 0, a = 0, d = 0, S = "") {
6
+ this.rowIndex = e, this.rowTop = t, this.columnIndex = i, this.columnLeft = s, this.areaIdent = o, this.sideIdent = r, this.originalEvent = n, this.clickCount = l, this.draggingX = a, this.draggingY = d, this.action = S;
7
7
  }
8
8
  clone() {
9
- return new $(
9
+ return new P(
10
10
  this.rowIndex,
11
11
  this.rowTop,
12
12
  this.columnIndex,
@@ -21,47 +21,47 @@ class $ {
21
21
  );
22
22
  }
23
23
  }
24
- class A {
25
- constructor(e = ">", t = "", s = []) {
26
- this.content = e, this.style = t, this.classes = s;
24
+ class I {
25
+ constructor(e = ">", t = "", i = []) {
26
+ this.content = e, this.style = t, this.classes = i;
27
27
  }
28
28
  }
29
- class H {
30
- constructor(e = new A(
29
+ class G {
30
+ constructor(e = new I(
31
31
  ">",
32
32
  "transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
33
- ["gt-tree-arrow-expanded"]
34
- ), t = new A(
33
+ ["gt-table-tree-arrow-expanded"]
34
+ ), t = new I(
35
35
  ">",
36
36
  "",
37
- ["ge-tree-arrow-collapsed"]
38
- ), s = new A(
37
+ ["ge-table-tree-arrow-collapsed"]
38
+ ), i = new I(
39
39
  ">",
40
40
  "color:transparent;",
41
- ["gt-tree-arrow-hidden"]
42
- ), i = new A(
41
+ ["gt-table-tree-arrow-hidden"]
42
+ ), s = new I(
43
43
  "↕",
44
44
  "",
45
- ["gt-tree-arrow-expanded-all"]
45
+ ["gt-table-tree-arrow-expanded-all"]
46
46
  )) {
47
- this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = i;
47
+ this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = i, this.arrowExpandCollapseAll = s;
48
48
  }
49
49
  }
50
- class _ {
51
- constructor(e = new A("↑", "", ["ge-header-sorted-asc"]), t = new A("↓", "", ["ge-header-sorted-desc"]), s = new A("↑", "color:transparent;", [])) {
52
- this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
50
+ class N {
51
+ constructor(e = new I("↑", "", ["ge-header-sorted-asc"]), t = new I("↓", "", ["ge-header-sorted-desc"]), i = new I("↑", "color:transparent;", [])) {
52
+ this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = i;
53
53
  }
54
54
  }
55
- class j {
55
+ class Y {
56
56
  constructor(e) {
57
57
  this.domService = e;
58
58
  }
59
- setStyle(e, t, s) {
60
- return this.domService.setStyle(e, t, s), e;
59
+ setStyle(e, t, i) {
60
+ return this.domService.setStyle(e, t, i), e;
61
61
  }
62
62
  applyStyle(e, t) {
63
- for (const s in t)
64
- this.domService.setStyle(e, s, t[s]);
63
+ for (const i in t)
64
+ this.domService.setStyle(e, i, t[i]);
65
65
  return e;
66
66
  }
67
67
  applyDisplayNoneStyle(e) {
@@ -71,7 +71,7 @@ class j {
71
71
  return this.domService.setStyle(e, "display", "block"), e;
72
72
  }
73
73
  applyStyleInPx(e, t) {
74
- return Object.entries(t).forEach(([s, i]) => this.domService.setStyle(e, s, i + "px")), e;
74
+ return Object.entries(t).forEach(([i, s]) => this.domService.setStyle(e, i, s + "px")), e;
75
75
  }
76
76
  applyStylePosistionRelative(e) {
77
77
  return this.domService.setStyle(e, "position", "relative"), this.domService.setStyle(e, "overflow", "clip"), e;
@@ -82,8 +82,8 @@ class j {
82
82
  applyStyleFullSize(e) {
83
83
  return this.domService.setStyle(e, "width", "100%"), this.domService.setStyle(e, "height", "100%"), e;
84
84
  }
85
- applyStyleOverflowAuto(e = "auto", t = "auto", s) {
86
- return this.domService.setStyle(s, "overflow-x", e), this.domService.setStyle(s, "overflow-y", t), s;
85
+ applyStyleOverflowAuto(e = "auto", t = "auto", i) {
86
+ return this.domService.setStyle(i, "overflow-x", e), this.domService.setStyle(i, "overflow-y", t), i;
87
87
  }
88
88
  applyStyleNoPadding(e) {
89
89
  return this.domService.setStyle(e, "padding", "0"), this.domService.setStyle(e, "margin", "0"), this.domService.setStyle(e, "border", "0"), e;
@@ -99,136 +99,158 @@ class j {
99
99
  return this.domService.appendChild(e, t), this.applyStylePosistionAbsolute(e), { parent: e, child: t, cache: {} };
100
100
  }
101
101
  appendText(e, t) {
102
- const s = this.domService.createText(t);
103
- return this.domService.appendChild(e, s), s;
102
+ const i = this.domService.createText(t);
103
+ return this.domService.appendChild(e, i), i;
104
104
  }
105
105
  addClass(e, t) {
106
- return e.includes(" ") ? e.split(" ").forEach((s) => this.domService.addClass(t, s)) : this.domService.addClass(t, e), t;
106
+ return e.includes(" ") ? e.split(" ").forEach((i) => this.domService.addClass(t, i)) : this.domService.addClass(t, e), t;
107
107
  }
108
108
  addClasses(e, t) {
109
109
  if (e)
110
- for (const s of e)
111
- this.domService.addClass(t, s);
110
+ for (const i of e)
111
+ this.domService.addClass(t, i);
112
112
  return t;
113
113
  }
114
- setAttribute(e, t, s) {
115
- return t && s && this.domService.setAttribute(e, t, s), e;
114
+ setAttribute(e, t, i) {
115
+ return t && i && this.domService.setAttribute(e, t, i), e;
116
116
  }
117
- createAreaDivWithClass(e, t, s, i) {
117
+ createAreaDivWithClass(e, t, i, s) {
118
118
  const o = this.domService.createElement("div");
119
- 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;
119
+ return this.addClass(e, o), this.domService.setAttribute(o, "data-area", i), this.domService.setAttribute(o, "data-side", s), this.domService.appendChild(t, o), o;
120
120
  }
121
121
  createDivWithClass(e, t) {
122
- const s = this.domService.createElement("div");
123
- return this.addClass(e, s), this.domService.appendChild(t, s), s;
124
- }
125
- addRowDiv(e, t, s = -1, i, o = "") {
126
- const r = t.index ?? -1, l = this.getDivOrCreateDiv(r, e);
127
- this.domService.addClass(l, "ge-table-row-div"), this.domService.addClass(l, `ge-table-row-div-${t.index}`);
128
- const n = (t?.index ?? 0) % 2 === 0 ? "even" : "odd";
129
- if (this.domService.addClass(l, `ge-table-row-${n}`), this.domService.setStyle(l, "display", "clip"), this.domService.setStyle(l, "position", "absolute"), this.domService.setStyle(l, "left", `${t.left}px`), this.domService.setStyle(l, "top", `${t.top}px`), this.domService.setStyle(l, "width", `${t.width}px`), this.domService.setStyle(l, "height", `${t.height}px`), this.domService.setAttribute(l, "data-row-index", `${s}`), this.domService.setAttribute(l, "data-area", `${i}`), o) {
130
- const d = this.domService.createText(o);
131
- this.domService.appendChild(l, d);
122
+ const i = this.domService.createElement("div");
123
+ return this.addClass(e, i), this.domService.appendChild(t, i), i;
124
+ }
125
+ addRowDiv(e, t, i = -1, s, o, r = "") {
126
+ const n = t.index ?? -1, l = this.getDivOrCreateDiv(n, e);
127
+ if (this.domService.addClass(l, "ge-table-row-div"), this.domService.addClass(l, `ge-table-row-div-${t.index}`), s === "body" && o === "center") {
128
+ const a = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
129
+ this.domService.addClass(l, `ge-table-row-${a}`);
130
+ }
131
+ 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", `${i}`), this.domService.setAttribute(l, "data-area", `${s}`), r) {
132
+ const a = this.domService.createText(r);
133
+ this.domService.appendChild(l, a);
132
134
  }
133
135
  return this.domService.appendChild(e.child, l), l;
134
136
  }
135
- addColumnDiv(e, t, s = -1, i = -1, o, r = "", l, n, d = void 0, h) {
136
- const S = n?.treeOptions, f = n?.showCheckboxWihoutExtraColumn, p = this.domService.createElement("div");
137
- this.domService.addClass(p, "ge-table-col-div"), this.domService.addClass(p, `ge-table-col-div-${t.index}`), this.domService.setAttribute(p, "data-col-index", `${t.index}`), this.domService.setAttribute(p, "data-row-index", `${s}`), this.domService.setAttribute(p, "data-area", `${o}`);
138
- const u = (t?.index ?? 0) % 2 === 0 ? "even" : "odd";
139
- if (this.domService.addClass(p, `ge-table-col-${u}`), this.domService.setStyle(p, "display", "clip"), this.domService.setStyle(p, "position", "absolute"), this.domService.setStyle(p, "left", `${t.left}px`), this.domService.setStyle(p, "top", `${t.top}px`), this.domService.setStyle(p, "width", `${t.width}px`), this.domService.setStyle(p, "height", `${t.height}px`), l && l !== "none" && (this.domService.addClass(p, "ge-table-col-tree"), this.addArrowDiv(p, l, S, s, i, o)), f && i === 0 && d && this.addCheckboxToDiv(p, d, o, s), r) {
140
- const g = l !== "none" && i === 0;
141
- this.addLabelDiv(p, r, g, s, i, o);
137
+ addColumnDiv(e, t, i = -1, s = -1, o, r, n = "", l, a, d = void 0, S) {
138
+ const g = a == null ? void 0 : a.treeOptions, f = a == null ? void 0 : a.showCheckboxWihoutExtraColumn, c = this.domService.createElement("div");
139
+ 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", `${i}`), this.domService.setAttribute(c, "data-area", `${o}`);
140
+ const b = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
141
+ if (o === "body" && r === "center" && this.domService.addClass(c, `ge-table-column-${b}`), 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`), l && l !== "none" && (this.domService.addClass(c, "ge-table-col-tree"), this.addArrowDiv(c, l, g, i, s, o)), f && s === 0 && d && this.addCheckboxToDiv(c, d, o, i), n) {
142
+ const h = l !== "none" && s === 0;
143
+ this.addLabelDiv(c, n, h, i, s, o);
142
144
  }
143
- return h && this.addSortedIcon(p, h, n?.sortedOptions, i), this.domService.appendChild(e, p), p;
145
+ return S && this.addSortedIcon(c, S, a == null ? void 0 : a.sortedOptions, s), this.domService.appendChild(e, c), c;
144
146
  }
145
- addCheckboxToDiv(e, t, s, i) {
147
+ addCheckboxToDiv(e, t, i, s) {
146
148
  const o = this.domService.createElement("div"), r = t === "full" ? "checked" : "";
147
149
  return o.innerHTML = `
148
150
  <input
149
151
  type="checkbox"
150
- data-area="${s}"
151
- data-row-index="${i}"
152
+ data-area="${i}"
153
+ data-row-index="${s}"
152
154
  data-input-type="checkbox"
153
155
  ${r}
154
- 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;
156
+ class="ge-table-row-checkbox"> `, this.domService.setStyle(o, "display", "inline"), this.domService.setStyle(o, "width", "inherit"), this.domService.setAttribute(o, "data-row-index", `${s}`), this.domService.appendChild(e, o), o;
155
157
  }
156
- addLabelDiv(e, t = "", s = !1, i = -1, o = -1, r = "body") {
157
- const l = this.domService.createElement("div");
158
- if (this.domService.addClass(l, "ge-table-label-div"), this.domService.setStyle(l, "position", "relative"), this.domService.setStyle(l, "background", "transparent"), this.domService.setStyle(l, "width", "100%"), this.domService.setStyle(l, "height", "100%"), this.domService.setAttribute(l, "data-row-index", `${i}`), this.domService.setAttribute(l, "data-col-index", `${o}`), this.domService.setAttribute(l, "data-area", `${r}`), t)
159
- if (s) {
160
- const n = this.domService.createText(t);
161
- this.domService.appendChild(l, n);
158
+ addLabelDiv(e, t = "", i = !1, s = -1, o = -1, r = "body") {
159
+ const n = this.domService.createElement("div");
160
+ 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", `${s}`), this.domService.setAttribute(n, "data-col-index", `${o}`), this.domService.setAttribute(n, "data-area", `${r}`), t)
161
+ if (i) {
162
+ const l = this.domService.createText(t);
163
+ this.domService.appendChild(n, l);
162
164
  } else {
163
- const n = this.domService.createElement("div");
164
- this.domService.appendChild(l, n);
165
- const d = this.domService.createText(t);
166
- this.domService.addClass(n, "ge-table-label"), this.domService.appendChild(n, d), this.domService.setAttribute(n, "data-row-index", `${i}`), this.domService.setAttribute(n, "data-col-index", `${o}`), this.domService.setAttribute(n, "data-area", `${r}`);
165
+ const l = this.domService.createElement("div");
166
+ this.domService.appendChild(n, l);
167
+ const a = this.domService.createText(t);
168
+ this.domService.addClass(l, "ge-table-label"), this.domService.appendChild(l, a), this.domService.setAttribute(l, "data-row-index", `${s}`), this.domService.setAttribute(l, "data-col-index", `${o}`), this.domService.setAttribute(l, "data-area", `${r}`);
167
169
  }
168
- return this.domService.appendChild(e, l), l;
170
+ return this.domService.appendChild(e, n), n;
169
171
  }
170
- addSortedIcon(e, t = "", s = new _(), i = -1) {
172
+ addSortedIcon(e, t = "", i = new N(), s = -1) {
171
173
  const o = this.domService.createElement("div");
172
- 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");
174
+ 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", `${s}`), this.domService.setAttribute(o, "data-area", "header");
173
175
  let r;
174
- t === "asc" ? r = s.iconAsc : t === "desc" ? r = s.iconDesc : r = s.iconPlaceholder;
175
- const l = r.content, n = this.domService.createText(l);
176
- this.domService.appendChild(o, n), r.style && this.applyStyleString(o, r.style);
177
- for (const d of r.classes)
178
- this.domService.addClass(o, d);
176
+ t === "asc" ? r = i.iconAsc : t === "desc" ? r = i.iconDesc : r = i.iconPlaceholder;
177
+ const n = r.content, l = this.domService.createText(n);
178
+ this.domService.appendChild(o, l), r.style && this.applyStyleString(o, r.style);
179
+ for (const a of r.classes)
180
+ this.domService.addClass(o, a);
179
181
  return this.domService.appendChild(e, o), o;
180
182
  }
181
- addArrowDiv(e, t = "none", s = new H(), i = -1, o = -1, r = "body") {
182
- const l = this.domService.createElement("div");
183
- this.domService.addClass(l, "ge-table-tree-arrow-div"), this.domService.setStyle(l, "display", "inline-block"), this.domService.setStyle(l, "position", ""), this.domService.setStyle(l, "width", "20px"), this.domService.setStyle(l, "background", "transparent"), this.domService.setStyle(l, "cursor", "pointer"), this.domService.setAttribute(l, "data-row-index", `${i}`), this.domService.setAttribute(l, "data-col-index", `${o}`), this.domService.setAttribute(l, "data-area", `${r}`);
184
- let n;
185
- t === "expanded" ? n = s.arrowExpanded : t === "collapsed" ? n = s.arrowCollapsed : n = s.arrowPlaceholder;
186
- const d = n.content, h = this.domService.createText(d);
187
- this.domService.appendChild(l, h), n.style && this.applyStyleString(l, n.style);
188
- for (const S of n.classes)
189
- this.domService.addClass(l, S);
190
- return this.domService.appendChild(e, l), l;
191
- }
192
- addColumnBorderDivs(e, t) {
193
- return this.addVerticalBorder(t, e), this.addHorizontalBorder(t, e), e;
194
- }
195
- addHorizontalBorder(e, t, s = "ge-table-row-border") {
196
- const i = this.domService.createElement("div");
197
- 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;
183
+ addArrowDiv(e, t = "none", i = new G(), s = -1, o = -1, r = "body") {
184
+ const n = this.domService.createElement("div");
185
+ 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", `${s}`), this.domService.setAttribute(n, "data-col-index", `${o}`), this.domService.setAttribute(n, "data-area", `${r}`);
186
+ let l;
187
+ t === "expanded" ? l = i.arrowExpanded : t === "collapsed" ? l = i.arrowCollapsed : l = i.arrowPlaceholder;
188
+ const a = l.content, d = this.domService.createText(a);
189
+ this.domService.appendChild(n, d), l.style && this.applyStyleString(n, l.style);
190
+ for (const S of l.classes)
191
+ this.domService.addClass(n, S);
192
+ return this.domService.appendChild(e, n), n;
193
+ }
194
+ addColumnBorderDivs(e, t, i, s, o) {
195
+ if (e.verticalBorderVisible) {
196
+ const r = `ge-table-${s}-${o}-vertical-border`;
197
+ this.addVerticalBorder(i, t, r);
198
+ }
199
+ if (e.horizontalBorderVisible) {
200
+ const r = `ge-table-${s}-${o}-horizontal-border`;
201
+ this.addHorizontalBorder(i, t, r);
202
+ }
203
+ return t;
198
204
  }
199
- addFocusBorderDivs(e, t, s) {
200
- let i = this.domService.createElement("div");
201
- 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;
205
+ addHorizontalBorder(e, t, i = "ge-table-body-center-horizontal-border") {
206
+ const s = this.domService.createElement("div");
207
+ return this.domService.addClass(s, i), 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;
202
208
  }
203
- addVerticalBorder(e, t, s = "ge-table-column-border") {
204
- const i = this.domService.createElement("div");
205
- 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;
209
+ addFocusBorderDivs(e, t, i) {
210
+ let s = this.domService.createElement("div");
211
+ 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.applyStyle(s, i), 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.applyStyle(s, i), 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.applyStyle(s, i), 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.applyStyle(s, i), this.domService.appendChild(e, s), e;
206
212
  }
207
- addDiv(e, t, s = "") {
208
- const i = this.domService.createElement("div");
209
- 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;
213
+ addVerticalBorder(e, t, i = "ge-table-body-center-vertical-border") {
214
+ const s = this.domService.createElement("div");
215
+ return this.domService.addClass(s, i), 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;
216
+ }
217
+ addDiv(e, t, i = "") {
218
+ const s = this.domService.createElement("div");
219
+ return i && this.domService.addClass(s, i), 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;
210
220
  }
211
221
  applyStyleString(e, t) {
212
- const s = t.split(";").map((i) => i.trim()).filter((i) => i);
213
- for (const i of s) {
214
- const [o, r] = i.split(":");
222
+ const i = t.split(";").map((s) => s.trim()).filter((s) => s);
223
+ for (const s of i) {
224
+ const [o, r] = s.split(":");
215
225
  this.domService.setStyle(e, o.trim(), r.trim());
216
226
  }
217
227
  }
218
228
  getDivOrCreateDiv(e, t) {
219
- let s = t.cache[e];
220
- return s ? (s.innerText = "", s) : (s = this.domService.createElement("div"), t.cache[e] = s, s);
229
+ let i = t.cache[e];
230
+ return i ? (i.innerText = "", i) : (i = this.domService.createElement("div"), t.cache[e] = i, i);
221
231
  }
222
232
  }
223
- class I {
224
- constructor(e, t = !0, s, i, o = 0, r = !1, l = !1) {
225
- this.data = e, this.expanded = t, this.children = s, this.parent = i, this.deep = o, this.checked = r, this.keep = l;
233
+ class L {
234
+ constructor(e, t = !0, i, s, o = 0, r = !1, n = !1) {
235
+ this.data = e, this.expanded = t, this.children = i, this.parent = s, this.deep = o, this.checked = r, this.keep = n;
236
+ }
237
+ }
238
+ const V = (p) => p === "header" ? "header" : p === "footer" ? "footer" : "body";
239
+ class q {
240
+ constructor(e, t) {
241
+ 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)) {
242
+ 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"));
243
+ const i = e.getAttribute("data-area");
244
+ if (i && (this.areaIdent = V(i), this.areaModel = t.tableModel.getAreaModel(this.areaIdent), this.row = this.areaModel.getRowByIndex(this.rowIdx)), e instanceof HTMLInputElement) {
245
+ const s = e;
246
+ this.value = s.value;
247
+ }
248
+ }
226
249
  }
227
250
  }
228
- const F = (c) => c === "header" ? "header" : c === "footer" ? "footer" : "body";
229
- class X {
251
+ class U {
230
252
  constructor(e) {
231
- 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.scrollViewport.addEventListener("scroll", this.tableScope.adjustAfterScrolling.bind(this.tableScope)), [window, this.tableScope.hostElement].forEach(
253
+ 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(
232
254
  (t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
233
255
  );
234
256
  }
@@ -238,57 +260,51 @@ class X {
238
260
  this.tableScope.contextmenu(t);
239
261
  }
240
262
  onHostElementClicked(e) {
241
- if (e.target instanceof HTMLElement) {
242
- const t = e.target;
243
- if (t.getAttribute("data-ge-action") === "toggleExpandCollapseAll") {
244
- this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault();
245
- return;
246
- }
247
- if (t.getAttribute("data-row-index")) {
248
- const s = Number(t.getAttribute("data-row-index")), i = Number(t.getAttribute("data-col-index")), o = t.getAttribute("data-area");
249
- if (o) {
250
- const r = F(o), l = this.tableScope.tableModel.getAreaModel(r), n = l.getRowByIndex(s);
251
- if (t.getAttribute("data-input-type") === "checkbox") {
252
- this.tableScope.toggleRowCheckbox(s, i, r), e.preventDefault();
253
- return;
254
- }
255
- if (n instanceof I) {
256
- const d = i === this.getArrowColumnIndex() && e.altKey, h = t.className.includes("ge-table-tree-arrow-div");
257
- if (d || h) {
258
- e.preventDefault();
259
- const S = n;
260
- S.expanded = !S.expanded, "recalcVisibleTreeRows" in l && l.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(S);
261
- }
262
- }
263
- }
263
+ const t = new q(e.target, this.tableScope);
264
+ if (t.action === "toggleExpandCollapseAll")
265
+ this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
266
+ else if (t.inputType === "checkbox" && t.areaIdent)
267
+ this.tableScope.toggleRowCheckbox(t.rowIdx, t.colIdx, t.areaIdent), e.preventDefault(), e.stopPropagation();
268
+ else if (t.row instanceof L && t.areaModel) {
269
+ const i = t.colIdx === this.getArrowColumnIndex() && e.altKey, s = t.className.includes("ge-table-tree-arrow-div");
270
+ if (console.info(s, i), i || s) {
271
+ e.preventDefault(), e.stopPropagation();
272
+ const o = t.row;
273
+ 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);
264
274
  }
265
275
  }
276
+ if (t.areaIdent === "body" && this.tableScope.tableOptions.getFocusModel) {
277
+ const i = this.tableScope.tableOptions.getFocusModel();
278
+ i == null || i.clear(), i == null || i.setFocus(t.rowIdx, t.colIdx);
279
+ }
266
280
  this.publishGeMouseEvent(e, 1);
267
281
  }
268
282
  onHostElementDblClicked(e) {
269
283
  if (e.target instanceof HTMLElement) {
270
- const t = e.target, s = t.getAttribute("data-area"), i = F(s), o = Number(t.getAttribute("data-row-index")), r = Number(t.getAttribute("data-col-index")), l = this.tableScope.tableModel.getAreaModel(i);
271
- if (s && i === "header")
284
+ const t = e.target, i = t.getAttribute("data-area"), s = V(i), o = Number(t.getAttribute("data-row-index")), r = Number(t.getAttribute("data-col-index")), n = this.tableScope.tableModel.getAreaModel(s);
285
+ if (i && s === "header")
272
286
  this.tableScope.tableModel.isSortable(r) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, o, r));
273
287
  else if (t.getAttribute("data-row-index")) {
274
- const n = l.getRowByIndex(o);
275
- if (s && i === "body" && l.isEditable(o, r) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, r)), n instanceof I && r === this.getArrowColumnIndex()) {
276
- e.preventDefault();
277
- const d = n;
278
- d.expanded = !d.expanded, "recalcVisibleTreeRows" in l && l.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(d);
288
+ const l = n.getRowByIndex(o);
289
+ if (i && s === "body" && n.isEditable(o, r) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, r)), l instanceof L && r === this.getArrowColumnIndex()) {
290
+ e.preventDefault(), e.stopPropagation();
291
+ const a = l;
292
+ a.expanded = !a.expanded, "recalcVisibleTreeRows" in n && n.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(a);
279
293
  }
280
294
  }
281
295
  }
282
296
  this.publishGeMouseEvent(e, 2);
283
297
  }
284
298
  publishGeMouseEvent(e, t) {
285
- this.mouseEvent = e, this.geMouseEventOld = this.geMouseEvent?.clone(), this.geMouseEvent = this.tableScope.createGeMouseEvent(e), this.geMouseEvent && (this.geMouseEvent.clickCount = t), this.tableScope.onMouseClicked(this.geMouseEvent, this.geMouseEventOld);
299
+ var i;
300
+ this.mouseEvent = e, this.geMouseEventOld = (i = this.geMouseEvent) == null ? void 0 : i.clone(), this.geMouseEvent = this.tableScope.createGeMouseEvent(e), this.geMouseEvent && (this.geMouseEvent.clickCount = t), this.tableScope.onMouseClicked(this.geMouseEvent, this.geMouseEventOld);
286
301
  }
287
302
  updateCollapsedExpandedState(e) {
288
- const t = this.tableScope.tableOptions?.autoRestoreOptions?.getRowId;
303
+ var i, s, o, r, n;
304
+ const t = (s = (i = this.tableScope.tableOptions) == null ? void 0 : i.autoRestoreOptions) == null ? void 0 : s.getRowId;
289
305
  if (t) {
290
- const s = this.tableScope.storeStateCollapsedExpandService?.collapsedExpandedStateGet().mode, i = s === "collapsed" && !e.expanded || s === "expanded" && e.expanded, o = s === "collapsed" && e.expanded || s === "expanded" && !e.expanded, r = t(e.data);
291
- i ? this.tableScope.storeStateCollapsedExpandService?.collapsedStateIdsPush(r) : o && this.tableScope.storeStateCollapsedExpandService?.collapsedStateIdsRemove(r);
306
+ const l = (o = this.tableScope.storeStateCollapsedExpandService) == null ? void 0 : o.collapsedExpandedStateGet().mode, a = l === "collapsed" && !e.expanded || l === "expanded" && e.expanded, d = l === "collapsed" && e.expanded || l === "expanded" && !e.expanded, S = t(e.data);
307
+ a ? (r = this.tableScope.storeStateCollapsedExpandService) == null || r.collapsedStateIdsPush(S) : d && ((n = this.tableScope.storeStateCollapsedExpandService) == null || n.collapsedStateIdsRemove(S));
292
308
  }
293
309
  }
294
310
  getArrowColumnIndex() {
@@ -304,15 +320,17 @@ class X {
304
320
  this.mouseEvent = e, this.dragging && requestAnimationFrame(this.mouseDraggingEndOnFrame.bind(this)), this.mouseDown = !1, this.dragging = !1;
305
321
  }
306
322
  mouseDraggingOnFrame() {
323
+ var e;
307
324
  if (this.mouseEvent) {
308
- const e = this.tableScope.createGeMouseEvent(this.mouseEvent);
309
- this.startMouseEvent?.originalEvent && (e.draggingX = this.mouseEvent.clientX - this.startMouseEvent.originalEvent.clientX, e.draggingY = this.mouseEvent.clientY - this.startMouseEvent.originalEvent.clientY), this.tableScope.mouseDraggingOnFrame(e);
325
+ const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
326
+ (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);
310
327
  }
311
328
  }
312
329
  mouseDraggingEndOnFrame() {
330
+ var e;
313
331
  if (this.mouseEvent) {
314
- const e = this.tableScope.createGeMouseEvent(this.mouseEvent);
315
- this.startMouseEvent?.originalEvent && (e.draggingX = this.mouseEvent.clientX - this.startMouseEvent.originalEvent.clientX, e.draggingY = this.mouseEvent.clientY - this.startMouseEvent.originalEvent.clientY), this.tableScope.mouseDraggingEndOnFrame(e);
332
+ const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
333
+ (e = this.startMouseEvent) != null && e.originalEvent && (t.draggingX = this.mouseEvent.clientX - this.startMouseEvent.originalEvent.clientX, t.draggingY = this.mouseEvent.clientY - this.startMouseEvent.originalEvent.clientY), this.tableScope.mouseDraggingEndOnFrame(t);
316
334
  }
317
335
  }
318
336
  mouseMoveOnFrame() {
@@ -322,10 +340,13 @@ class X {
322
340
  }
323
341
  }
324
342
  }
325
- class z {
343
+ class J {
326
344
  constructor(e) {
327
345
  this.tableScope = e;
328
346
  }
347
+ updateCells(e) {
348
+ this.tableScope.updateCells(e);
349
+ }
329
350
  externalFilterChanged() {
330
351
  this.tableScope.externalFilterChanged();
331
352
  }
@@ -352,19 +373,20 @@ class z {
352
373
  this.tableScope.repaint();
353
374
  }
354
375
  }
355
- class K {
376
+ class Q {
356
377
  flattenTree(e, t = []) {
378
+ var i;
357
379
  for (const s of e)
358
- this.isVisible(s) && t.push(s), s.children?.length && this.flattenTree(s.children, t);
380
+ this.isVisible(s) && t.push(s), (i = s.children) != null && i.length && this.flattenTree(s.children, t);
359
381
  return t;
360
382
  }
361
383
  isVisible(e) {
362
384
  return e.parent ? e.parent.expanded ? this.isVisible(e.parent) : !1 : !0;
363
385
  }
364
386
  }
365
- class Y {
366
- constructor(e, t = [], s = -1) {
367
- this.areaIdent = e, this.columnDefs = t, this.overridingRowHeight = s, this.rowSelectionModel = void 0, this.yPositions = [], this.cellRenderers = t.map((i) => i.rendererMap[e]);
387
+ class Z {
388
+ constructor(e, t = [], i = -1) {
389
+ this.areaIdent = e, this.columnDefs = t, this.defaultRowHeight = i, this.rowSelectionModel = void 0, this.yPositions = [], this.cellRenderers = t.map((s) => s.rendererMap[e]);
368
390
  }
369
391
  getTooltipAt(e, t) {
370
392
  return "";
@@ -379,6 +401,8 @@ class Y {
379
401
  getCustomClassesAt(e, t) {
380
402
  return [];
381
403
  }
404
+ getCustomStyleAt(e, t) {
405
+ }
382
406
  getRowspanAt(e, t) {
383
407
  return 0;
384
408
  }
@@ -388,13 +412,14 @@ class Y {
388
412
  return !0;
389
413
  }
390
414
  isRowChecked(e) {
415
+ var i;
391
416
  const t = this.getRowByIndex(e);
392
- return this.rowSelectionModel?.isRowChecked(t);
417
+ return (i = this.rowSelectionModel) == null ? void 0 : i.isRowChecked(t);
393
418
  }
394
419
  setRowChecked(e, t) {
395
420
  if (this.rowSelectionModel) {
396
- const s = this.getRowByIndex(e);
397
- this.rowSelectionModel.checkRow(s, t);
421
+ const i = this.getRowByIndex(e);
422
+ this.rowSelectionModel.checkRow(i, t);
398
423
  }
399
424
  }
400
425
  getMaxColspan() {
@@ -404,10 +429,10 @@ class Y {
404
429
  return 31;
405
430
  }
406
431
  getYPosByRowIndex(e) {
407
- return this.overridingRowHeight > 0 ? this.overridingRowHeight * e : this.yPositions[e];
432
+ return this.defaultRowHeight > 0 ? this.defaultRowHeight * e : this.yPositions[e];
408
433
  }
409
434
  init() {
410
- !this.yPositions.length && this.getRowCount() !== void 0 && this.overridingRowHeight === -1 && this.calcYPositions();
435
+ !this.yPositions.length && this.getRowCount() !== void 0 && this.defaultRowHeight === -1 && this.calcYPositions();
411
436
  }
412
437
  isFilterable() {
413
438
  return this.areaIdent === "body";
@@ -418,9 +443,12 @@ class Y {
418
443
  isEditable(e, t) {
419
444
  return this.columnDefs && t < this.columnDefs.length && this.columnDefs[t].editable ? this.columnDefs[t].editable() : !1;
420
445
  }
421
- setValue(e, t, s, i) {
446
+ setValue(e, t, i) {
447
+ var n;
448
+ const s = (n = this.columnDefs[t]) == null ? void 0 : n.editInputPipe;
449
+ s && (i = s(i, e, t));
422
450
  const o = this.getRowByIndex(e), r = this.columnDefs[t].property;
423
- return o[r] = s, !0;
451
+ return r.includes(".") ? this.setPropertyValue(o, r.split("."), i) : (o[r] = i, !0);
424
452
  }
425
453
  isSelectable(e, t) {
426
454
  return !0;
@@ -428,9 +456,17 @@ class Y {
428
456
  changeColumnOrder(e, t) {
429
457
  this.arrayMove(this.cellRenderers, e, t);
430
458
  }
431
- arrayMove(e, t, s) {
432
- const i = e.splice(t, 1)[0];
433
- return e.splice(s, 0, i), e;
459
+ setPropertyValue(e, t, i) {
460
+ const s = t.shift();
461
+ if (s) {
462
+ let o = e[s];
463
+ return o && t.length ? this.setPropertyValue(o, t, i) : (e[s] = i, !0);
464
+ }
465
+ return !1;
466
+ }
467
+ arrayMove(e, t, i) {
468
+ const s = e.splice(t, 1)[0];
469
+ return e.splice(i, 0, s), e;
434
470
  }
435
471
  calcYPositions() {
436
472
  const e = this.getRowCount();
@@ -439,27 +475,27 @@ class Y {
439
475
  this.yPositions[t + 1] = this.getRowHeight(t) + this.yPositions[t];
440
476
  }
441
477
  }
442
- class q {
443
- genericSortComparator(e, t, s) {
478
+ class ee {
479
+ genericSortComparator(e, t, i) {
444
480
  if (typeof e == "number" && typeof t == "number")
445
- return s * (e - t);
481
+ return i * (e - t);
446
482
  if (typeof e == "string" && typeof t == "string")
447
- return s * e.localeCompare(t);
483
+ return i * e.localeCompare(t);
448
484
  if (typeof e == "boolean" && typeof t == "boolean")
449
- return s * ((e ? -1 : 1) - (t ? -1 : 1));
485
+ return i * ((e ? -1 : 1) - (t ? -1 : 1));
450
486
  if (e instanceof Date && t instanceof Date)
451
- return s * (e.getTime() - t.getTime());
487
+ return i * (e.getTime() - t.getTime());
452
488
  if (e instanceof Array && t instanceof Array) {
453
- const i = e, o = t;
454
- if (i.length && o.length)
455
- return this.genericSortComparator(i[0], o[0], s);
489
+ const s = e, o = t;
490
+ if (s.length && o.length)
491
+ return this.genericSortComparator(s[0], o[0], i);
456
492
  }
457
- return s * ("" + e).localeCompare("" + t);
493
+ return i * ("" + e).localeCompare("" + t);
458
494
  }
459
495
  }
460
- class O extends Y {
461
- constructor(e, t, s, i = []) {
462
- super(e, i, s), this.areaIdent = e, this.rows = t, this.defaultRowHeight = s, this.columnDefs = i, this.sorterService = new q(), this.service = new K(), this.properties = i.map((o) => o.property), this.flattenRows = this.service.flattenTree(t), this.filteredFlattenRows = [...this.flattenRows];
496
+ class B extends Z {
497
+ constructor(e, t, i, s = []) {
498
+ super(e, s, i), this.areaIdent = e, this.rows = t, this.defaultRowHeight = i, this.columnDefs = s, this.sorterService = new ee(), this.service = new Q(), this.properties = s.map((o) => o.property), this.flattenRows = this.service.flattenTree(t), this.filteredFlattenRows = [...this.flattenRows];
463
499
  }
464
500
  changeColumnOrder(e, t) {
465
501
  this.arrayMove(this.properties, e, t), super.changeColumnOrder(e, t);
@@ -477,11 +513,11 @@ class O extends Y {
477
513
  return e;
478
514
  }
479
515
  getValueAt(e, t) {
480
- const s = this.getRowByIndex(e);
481
- if (s) {
482
- const i = this.properties[t];
483
- if (i)
484
- return i.includes(".") ? this.getPropertyValue(s.data, i.split(".")) : s.data[i];
516
+ const i = this.getRowByIndex(e);
517
+ if (i) {
518
+ const s = this.properties[t];
519
+ if (s)
520
+ return s.includes(".") ? this.getPropertyValue(i.data, s.split(".")) : i.data[s];
485
521
  }
486
522
  return "";
487
523
  }
@@ -501,8 +537,8 @@ class O extends Y {
501
537
  this.lastPredictFn = e, this.doFiltering();
502
538
  }
503
539
  doSort(e) {
504
- const { columnIndex: t, sortState: s } = e[e.length - 1], i = s === "asc" ? 1 : s === "desc" ? -1 : 0, o = this.properties[t];
505
- return this.treeSort(this.rows, o, i), this.flattenRows = this.service.flattenTree(this.rows), this.filteredFlattenRows = [...this.flattenRows], !0;
540
+ const { columnIndex: t, sortState: i } = e[e.length - 1], s = i === "asc" ? 1 : i === "desc" ? -1 : 0, o = this.properties[t];
541
+ return this.treeSort(this.rows, o, s), this.flattenRows = this.service.flattenTree(this.rows), this.filteredFlattenRows = [...this.flattenRows], !0;
506
542
  }
507
543
  toggleExpandCollapseAll(e) {
508
544
  this.expandAllRecursive(this.rows, e), this.flattenRows = this.service.flattenTree(this.rows), this.doFiltering();
@@ -510,23 +546,26 @@ class O extends Y {
510
546
  setAllParentsOk(e) {
511
547
  return e.parent && (e.parent.keep = !0, this.setAllParentsOk(e.parent)), !1;
512
548
  }
513
- setValue(e, t, s) {
514
- const i = this.getRowByIndex(e);
515
- if (i) {
516
- const o = i.data, r = this.columnDefs[t].property;
517
- return o[r] = s, !0;
549
+ setValue(e, t, i) {
550
+ var r;
551
+ const s = (r = this.columnDefs[t]) == null ? void 0 : r.editInputPipe;
552
+ s && (i = s(i, e, t));
553
+ const o = this.getRowByIndex(e);
554
+ if (o) {
555
+ const n = o.data, l = this.columnDefs[t].property;
556
+ return l.includes(".") ? this.setPropertyValue(n, l.split("."), i) : (n[l] = i, !0);
518
557
  }
519
558
  return !1;
520
559
  }
521
560
  genericTreeTableSortComparator(e, t) {
522
- return (s, i) => {
523
- const o = this.getValueByT(s.data, e), r = this.getValueByT(i.data, e);
561
+ return (i, s) => {
562
+ const o = this.getValueByT(i.data, e), r = this.getValueByT(s.data, e);
524
563
  return this.sorterService.genericSortComparator(o, r, t);
525
564
  };
526
565
  }
527
566
  expandAllRecursive(e, t) {
528
- for (const s of e)
529
- s.expanded = t, s.children && this.expandAllRecursive(s.children, t);
567
+ for (const i of e)
568
+ i.expanded = t, i.children && this.expandAllRecursive(i.children, t);
530
569
  }
531
570
  doFiltering() {
532
571
  if (!this.lastPredictFn)
@@ -534,54 +573,54 @@ class O extends Y {
534
573
  else {
535
574
  this.flattenRows || (this.flattenRows = []);
536
575
  let e = 0;
537
- this.flattenRows.forEach((s) => {
538
- e = Math.max(e, s.deep);
576
+ this.flattenRows.forEach((i) => {
577
+ e = Math.max(e, i.deep);
539
578
  });
540
579
  const t = this.flattenRows.filter(
541
- (s, i, o) => this.lastPredictFn(s, i, o)
580
+ (i, s, o) => this.lastPredictFn(i, s, o)
542
581
  );
543
- this.flattenRows.forEach((s) => s.keep = !1), this.flattenRows.forEach((s) => {
544
- t.includes(s) && (s.keep = !0, this.setAllParentsOk(s));
582
+ this.flattenRows.forEach((i) => i.keep = !1), this.flattenRows.forEach((i) => {
583
+ t.includes(i) && (i.keep = !0, this.setAllParentsOk(i));
545
584
  }), this.filteredFlattenRows = this.flattenRows.filter(
546
- (s, i, o) => s.keep
585
+ (i, s, o) => i.keep
547
586
  );
548
587
  }
549
588
  }
550
589
  getPropertyValue(e, t) {
551
- const s = t.shift();
552
- let i = e[s];
553
- return i && t.length ? this.getPropertyValue(i, t) : i;
590
+ const i = t.shift();
591
+ let s = e[i];
592
+ return s && t.length ? this.getPropertyValue(s, t) : s;
554
593
  }
555
- treeSort(e, t, s) {
556
- e.sort(this.genericTreeTableSortComparator(t, s));
557
- for (const i of e)
558
- i.children && this.treeSort(i.children, t, s);
594
+ treeSort(e, t, i) {
595
+ e.sort(this.genericTreeTableSortComparator(t, i));
596
+ for (const s of e)
597
+ s.children && this.treeSort(s.children, t, i);
559
598
  }
560
599
  }
561
- class B {
600
+ class H {
562
601
  constructor(e) {
563
602
  this.getStorageKeyFn = e;
564
603
  }
565
604
  autoConvertMapToObject(e) {
566
605
  const t = {};
567
606
  if (e instanceof Map) {
568
- const s = e;
569
- for (const i of [...s]) {
607
+ const i = e;
608
+ for (const s of [...i]) {
570
609
  const [
571
610
  o,
572
611
  r
573
- ] = i;
612
+ ] = s;
574
613
  t[o] = r;
575
614
  }
576
615
  }
577
616
  return t;
578
617
  }
579
618
  checkAndPersistItem(e, t) {
580
- const s = this.getStorageKeyFn;
581
- if (s) {
582
- const i = s();
583
- if (i) {
584
- const o = i + e;
619
+ const i = this.getStorageKeyFn;
620
+ if (i) {
621
+ const s = i();
622
+ if (s) {
623
+ const o = s + e;
585
624
  if ((t + "").includes("Map")) {
586
625
  const r = this.autoConvertMapToObject(t);
587
626
  this.persistItem(o, r);
@@ -633,7 +672,7 @@ class B {
633
672
  // }
634
673
  // }
635
674
  }
636
- class U extends B {
675
+ class te extends H {
637
676
  constructor(e) {
638
677
  super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
639
678
  }
@@ -648,21 +687,21 @@ class U extends B {
648
687
  if (e) {
649
688
  const t = e();
650
689
  if (t) {
651
- const s = t + this.SCROLL_STATE;
652
- let i = this.loadFromLocalStorage(s);
653
- this.scrollOffset = i || [0, 0];
690
+ const i = t + this.SCROLL_STATE;
691
+ let s = this.loadFromLocalStorage(i);
692
+ this.scrollOffset = s || [0, 0];
654
693
  }
655
694
  }
656
695
  }
657
696
  }
658
- class J {
659
- constructor(e = "collapsed", t = [], s = !1, i = !1) {
660
- this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = i;
697
+ class ie {
698
+ constructor(e = "collapsed", t = [], i = !1, s = !1) {
699
+ this.mode = e, this.rowIds = t, this.allCollapsed = i, this.allExpanded = s;
661
700
  }
662
701
  }
663
- class Q extends B {
702
+ class se extends H {
664
703
  constructor(e) {
665
- super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new J(), this.load();
704
+ super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new ie(), this.load();
666
705
  }
667
706
  collapsedExpandedStateGet() {
668
707
  return this.collapsedExpandedState;
@@ -685,8 +724,8 @@ class Q extends B {
685
724
  if (e) {
686
725
  const t = e();
687
726
  if (t) {
688
- const s = t + this.COLLAPSED_EXPANDED_STATE, i = this.loadFromLocalStorage(s);
689
- i && (this.collapsedExpandedState = i);
727
+ const i = t + this.COLLAPSED_EXPANDED_STATE, s = this.loadFromLocalStorage(i);
728
+ s && (this.collapsedExpandedState = s);
690
729
  }
691
730
  }
692
731
  }
@@ -694,7 +733,7 @@ class Q extends B {
694
733
  this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
695
734
  }
696
735
  }
697
- class Z extends B {
736
+ class oe extends H {
698
737
  constructor(e) {
699
738
  super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
700
739
  }
@@ -709,95 +748,95 @@ class Z extends B {
709
748
  if (e) {
710
749
  const t = e();
711
750
  if (t) {
712
- const s = t + this.SORTING_STATE;
713
- let i = this.loadFromLocalStorage(s);
714
- this.sortItems = i || [];
751
+ const i = t + this.SORTING_STATE;
752
+ let s = this.loadFromLocalStorage(i);
753
+ this.sortItems = s || [];
715
754
  }
716
755
  }
717
756
  }
718
757
  }
719
- class M {
720
- constructor(e = 0, t = 0, s = 0, i = 0, o) {
721
- this.left = e, this.width = t, this.height = s, this.top = i, this.index = o;
758
+ class T {
759
+ constructor(e = 0, t = 0, i = 0, s = 0, o) {
760
+ this.left = e, this.width = t, this.height = i, this.top = s, this.index = o;
722
761
  }
723
762
  }
724
- class ee {
725
- constructor(e, t, s, i) {
726
- this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = i, this.scrollTop = 0, this.areaBodyWestGeo = new M(), this.areaBodyCenterGeo = new M(), this.areaBodyEastGeo = new M();
763
+ class re {
764
+ constructor(e, t, i, s) {
765
+ this.hostElement = e, this.tableModel = t, this.dom = i, this.tableOptions = s, this.scrollTop = 0, this.areaBodyWestGeo = new T(), this.areaBodyCenterGeo = new T(), this.areaBodyEastGeo = new T();
727
766
  const o = this.hostElement;
728
767
  o.innerText = "", this.dom.setAttribute(o, "tabindex", "0"), this.dom.setStyle(
729
768
  this.dom.addClass("ge-table", o),
730
769
  "position",
731
770
  "relative"
732
- ), this.hoverRow = s.applyStylePosistionAbsolute(
733
- s.createDivWithClass("ge-table-hover-row", o)
734
- ), this.hoverColumn = s.applyStylePosistionAbsolute(
735
- s.createDivWithClass("ge-table-hover-column", o)
736
- ), this.areaHeaderWest = s.appendRelativeChildDiv(
737
- s.applyStylePosistionAbsolute(
738
- s.createAreaDivWithClass("ge-table-header ge-table-header-west", o, "header", "west")
771
+ ), this.hoverRow = i.applyStylePosistionAbsolute(
772
+ i.createDivWithClass("ge-table-hover-row", o)
773
+ ), this.hoverColumn = i.applyStylePosistionAbsolute(
774
+ i.createDivWithClass("ge-table-hover-column", o)
775
+ ), this.areaHeaderWest = i.appendRelativeChildDiv(
776
+ i.applyStylePosistionAbsolute(
777
+ i.createAreaDivWithClass("ge-table-header ge-table-header-west", o, "header", "west")
739
778
  )
740
- ), this.areaHeaderCenter = s.appendRelativeChildDiv(
741
- s.applyStylePosistionAbsolute(
742
- s.createAreaDivWithClass("ge-table-header ge-table-header-center", o, "header", "center")
779
+ ), this.areaHeaderCenter = i.appendRelativeChildDiv(
780
+ i.applyStylePosistionAbsolute(
781
+ i.createAreaDivWithClass("ge-table-header ge-table-header-center", o, "header", "center")
743
782
  )
744
- ), this.areaHeaderEast = s.appendRelativeChildDiv(
745
- s.applyStylePosistionAbsolute(
746
- s.createAreaDivWithClass("ge-table-header ge-table-header-east", o, "body", "east")
783
+ ), this.areaHeaderEast = i.appendRelativeChildDiv(
784
+ i.applyStylePosistionAbsolute(
785
+ i.createAreaDivWithClass("ge-table-header ge-table-header-east", o, "body", "east")
747
786
  )
748
- ), this.areaBodyWest = s.appendRelativeChildDiv(
749
- s.applyStylePosistionAbsolute(
750
- s.createAreaDivWithClass("ge-table-body ge-table-body-west", o, "body", "west")
787
+ ), this.areaBodyWest = i.appendRelativeChildDiv(
788
+ i.applyStylePosistionAbsolute(
789
+ i.createAreaDivWithClass("ge-table-body ge-table-body-west", o, "body", "west")
751
790
  )
752
- ), this.areaBodyEast = s.appendRelativeChildDiv(
753
- s.applyStylePosistionAbsolute(
754
- s.createAreaDivWithClass("ge-table-body ge-table-body-east", o, "body", "east")
791
+ ), this.areaBodyEast = i.appendRelativeChildDiv(
792
+ i.applyStylePosistionAbsolute(
793
+ i.createAreaDivWithClass("ge-table-body ge-table-body-east", o, "body", "east")
755
794
  )
756
- ), this.areaFooterWest = s.appendRelativeChildDiv(
757
- s.applyStylePosistionAbsolute(
758
- s.createAreaDivWithClass("ge-table-footer ge-table-footer-west", o, "footer", "west")
795
+ ), this.areaFooterWest = i.appendRelativeChildDiv(
796
+ i.applyStylePosistionAbsolute(
797
+ i.createAreaDivWithClass("ge-table-footer ge-table-footer-west", o, "footer", "west")
759
798
  )
760
- ), this.areaFooterCenter = s.appendRelativeChildDiv(
761
- s.applyStylePosistionAbsolute(
762
- s.createAreaDivWithClass("ge-table-footer ge-table-footer-center", o, "footer", "center")
799
+ ), this.areaFooterCenter = i.appendRelativeChildDiv(
800
+ i.applyStylePosistionAbsolute(
801
+ i.createAreaDivWithClass("ge-table-footer ge-table-footer-center", o, "footer", "center")
763
802
  )
764
- ), this.areaFooterEast = s.appendRelativeChildDiv(
765
- s.applyStylePosistionAbsolute(
766
- s.createAreaDivWithClass("ge-table-footer ge-table-footer-east", o, "footer", "east")
803
+ ), this.areaFooterEast = i.appendRelativeChildDiv(
804
+ i.applyStylePosistionAbsolute(
805
+ i.createAreaDivWithClass("ge-table-footer ge-table-footer-east", o, "footer", "east")
767
806
  )
768
- ), this.scrollViewport = s.applyStyleOverflowAuto(
807
+ ), this.scrollViewport = i.applyStyleOverflowAuto(
769
808
  this.tableOptions.overflowX ?? "auto",
770
809
  this.tableOptions.overflowY ?? "auto",
771
- s.applyStyleNoPadding(
772
- s.applyStylePosistionAbsolute(
773
- s.createAreaDivWithClass("ge-table-scroll-viewport", o, "body", "center")
810
+ i.applyStyleNoPadding(
811
+ i.applyStylePosistionAbsolute(
812
+ i.createAreaDivWithClass("ge-table-scroll-viewport", o, "body", "center")
774
813
  )
775
814
  )
776
- ), this.contentWrapperDiv = s.applyStyleNoPadding(
777
- s.applyStylePosistionRelative(
778
- s.createDivWithClass("ge-table-scroll-content-wrapper", this.scrollViewport)
815
+ ), this.contentWrapperDiv = i.applyStyleNoPadding(
816
+ i.applyStylePosistionRelative(
817
+ i.createDivWithClass("ge-table-scroll-content-wrapper", this.scrollViewport)
779
818
  )
780
- ), this.contentDiv = s.applyStyleNoPadding(
781
- s.applyStylePosistionRelative(
782
- s.createDivWithClass("ge-table-scroll-content", this.contentWrapperDiv)
819
+ ), this.contentDiv = i.applyStyleNoPadding(
820
+ i.applyStylePosistionRelative(
821
+ i.createDivWithClass("ge-table-scroll-content", this.contentWrapperDiv)
783
822
  )
784
- ), this.areaBodyCenter = s.appendRelativeChildDiv(
785
- s.createDivWithClass("ge-table-body-center", this.contentDiv)
786
- ), this.borderHeaderBottom = s.applyStylePosistionAbsolute(
787
- s.createDivWithClass("ge-table-header-border", o)
788
- ), this.borderFixedWest = s.applyStylePosistionAbsolute(
789
- s.createDivWithClass("ge-table-west-fixed-column-border", o)
790
- ), this.borderFixedEast = s.applyStylePosistionAbsolute(
791
- s.createDivWithClass("ge-table-east-fixed-column-border", o)
792
- ), this.borderFooterTop = s.applyStylePosistionAbsolute(
793
- s.createDivWithClass("ge-table-footer-border", o)
823
+ ), this.areaBodyCenter = i.appendRelativeChildDiv(
824
+ i.createDivWithClass("ge-table-body-center", this.contentDiv)
825
+ ), this.borderHeaderBottom = i.applyStylePosistionAbsolute(
826
+ i.createDivWithClass("ge-table-header-border", o)
827
+ ), this.borderFixedWest = i.applyStylePosistionAbsolute(
828
+ i.createDivWithClass("ge-table-west-fixed-column-border", o)
829
+ ), this.borderFixedEast = i.applyStylePosistionAbsolute(
830
+ i.createDivWithClass("ge-table-east-fixed-column-border", o)
831
+ ), this.borderFooterTop = i.applyStylePosistionAbsolute(
832
+ i.createDivWithClass("ge-table-footer-border", o)
794
833
  );
795
834
  }
796
835
  adjustContainersAndRows() {
797
- const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth, s = this.hostElement.clientHeight;
836
+ const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth, i = this.hostElement.clientHeight;
798
837
  this.dom.applyStyle(this.scrollViewport, {
799
838
  width: `${t - e.left}px`,
800
- height: `${s - e.top}px`,
839
+ height: `${i - e.top}px`,
801
840
  top: `${e.top}px`,
802
841
  left: `${e.left}px`
803
842
  }), this.scrollTop = this.scrollViewport.scrollTop, this.dom.applyStyle(this.contentDiv, {
@@ -805,21 +844,21 @@ class ee {
805
844
  height: `${this.scrollViewport.clientHeight}px`,
806
845
  top: `${this.scrollTop}px`,
807
846
  left: `${this.scrollViewport.scrollLeft}px`
808
- }), 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.tableModel.getFixedLeftColumnCount() ? this.dom.applyDisplayBlockStyle(
847
+ }), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height = i - 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(
809
848
  this.dom.applyStyle(this.borderFixedWest, {
810
849
  width: "1px",
811
850
  height: `${this.areaBodyWestGeo.height}px`,
812
851
  top: `${this.areaBodyWestGeo.top}px`,
813
852
  left: `${this.areaBodyWestGeo.width}px`
814
853
  })
815
- ) : 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.tableModel.getFixedLeftColumnCount() ? this.dom.applyDisplayBlockStyle(
854
+ ) : this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height = i - 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(
816
855
  this.dom.applyStyle(this.borderFixedEast, {
817
856
  width: "1px",
818
857
  height: `${this.areaBodyEastGeo.height}px`,
819
858
  top: `${this.areaBodyEastGeo.top}px`,
820
859
  left: `${this.areaBodyEastGeo.left}px`
821
860
  })
822
- ) : 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, {
861
+ ) : this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = t - e.left - e.right, this.areaBodyCenterGeo.height = i - 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, {
823
862
  width: `${t - e.left - e.right}px`,
824
863
  height: `${e.top}px`,
825
864
  top: "0",
@@ -834,7 +873,7 @@ class ee {
834
873
  height: `${e.top}px`,
835
874
  top: "0",
836
875
  left: `${t - e.right}px`
837
- }), this.tableModel.isHeaderVisibe() ? this.dom.applyDisplayBlockStyle(
876
+ }), this.tableOptions.headerSeparatorBorderVisible && this.tableModel.isHeaderVisibe() ? this.dom.applyDisplayBlockStyle(
838
877
  this.dom.applyStyle(this.borderHeaderBottom, {
839
878
  width: `${t}px`,
840
879
  height: "1px",
@@ -844,23 +883,23 @@ class ee {
844
883
  ) : this.dom.applyDisplayNoneStyle(this.borderHeaderBottom), this.dom.applyStyle(this.areaFooterWest.parent, {
845
884
  width: `${e.left}px`,
846
885
  height: `${e.bottom}px`,
847
- top: `${s - e.bottom}px`,
886
+ top: `${i - e.bottom}px`,
848
887
  left: "0"
849
888
  }), this.dom.applyStyle(this.areaFooterCenter.parent, {
850
889
  width: `${t - e.left - e.right}px`,
851
890
  height: `${e.bottom}px`,
852
- top: `${s - e.bottom}px`,
891
+ top: `${i - e.bottom}px`,
853
892
  left: `${e.left}px`
854
893
  }), this.dom.applyStyle(this.areaFooterEast.parent, {
855
894
  width: `${e.right}px`,
856
895
  height: `${e.bottom}px`,
857
- top: `${s - e.bottom}px`,
896
+ top: `${i - e.bottom}px`,
858
897
  left: `${t - e.right}px`
859
- }), this.tableModel.isFooterVisibe() ? this.dom.applyDisplayBlockStyle(
898
+ }), this.tableOptions.footerSeparatorBorderVisible && this.tableModel.isFooterVisibe() ? this.dom.applyDisplayBlockStyle(
860
899
  this.dom.applyStyle(this.borderFooterTop, {
861
900
  width: `${t}px`,
862
901
  height: "1px",
863
- top: `${s - e.bottom}px`,
902
+ top: `${i - e.bottom}px`,
864
903
  left: "0px"
865
904
  })
866
905
  ) : this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.adjustAfterScrolling();
@@ -868,36 +907,37 @@ class ee {
868
907
  adjustAfterScrolling() {
869
908
  }
870
909
  resetSizeOfWrapperDiv() {
871
- const e = `${this.tableModel.getContentWidthInPixel()}px`, t = `${this.tableModel.getContentHeightInPixel()}px`;
910
+ const e = `${this.tableModel.getContentWidthInPixel()}px`, t = `${this.tableModel.getContentHeightInPixel() + 1}px`;
872
911
  this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", t);
873
912
  }
874
913
  }
875
- class w {
876
- constructor(e, t, s, i) {
877
- this.r1 = e, this.c1 = t, this.r2 = s, this.c2 = i;
914
+ class A {
915
+ constructor(e, t, i, s, o = !1) {
916
+ this.r1 = e, this.c1 = t, this.r2 = i, this.c2 = s, this.gammaRange = o;
878
917
  }
879
918
  static create(e) {
880
- return new w(
919
+ return e.gammaRange === void 0 && (e.gammaRange = !1), new A(
881
920
  e.rowIndex1,
882
921
  e.columnIndex1,
883
922
  e.rowIndex2,
884
- e.columnIndex2
923
+ e.columnIndex2,
924
+ e.gammaRange
885
925
  );
886
926
  }
887
927
  static singleCell(e, t) {
888
- return new w(e, t, e, t);
928
+ return new A(e, t, e, t);
889
929
  }
890
930
  static singleRow(e) {
891
- return new w(e, 0, e, Number.MAX_SAFE_INTEGER);
931
+ return new A(e, 0, e, Number.MAX_SAFE_INTEGER);
892
932
  }
893
933
  static singleColumn(e) {
894
- return new w(0, e, Number.MAX_SAFE_INTEGER, e);
934
+ return new A(0, e, Number.MAX_SAFE_INTEGER, e);
895
935
  }
896
936
  isInRange(e, t) {
897
937
  return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
898
938
  }
899
939
  }
900
- class te {
940
+ class le {
901
941
  constructor(e, t) {
902
942
  this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
903
943
  }
@@ -906,12 +946,16 @@ class te {
906
946
  return;
907
947
  this.colAndRowspanRanges = [];
908
948
  const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
909
- for (let s = 0; s < e; s++)
910
- for (let i = 0; i < t; i++) {
911
- let o = this.areaModel.getColspanAt(s, i), r = this.areaModel.getRowspanAt(s, i);
912
- (o > 1 || r > 1) && (o === 0 && (o = 1), r === 0 && (r = 1), this.colAndRowspanRanges.push(
913
- new w(s, i, s + r - 1, i + o - 1)
914
- ));
949
+ for (let i = 0; i < e; i++)
950
+ for (let s = 0; s < t; s++) {
951
+ let o = this.areaModel.getColspanAt(i, s), r = this.areaModel.getRowspanAt(i, s);
952
+ if (o > 1 || r > 1) {
953
+ o === 0 && (o = 1), r === 0 && (r = 1);
954
+ const n = this.areaModel.hasOwnProperty("gammaCells");
955
+ this.colAndRowspanRanges.push(
956
+ new A(i, s, i + r - 1, s + o - 1, n)
957
+ );
958
+ }
915
959
  }
916
960
  }
917
961
  getRanges() {
@@ -919,70 +963,94 @@ class te {
919
963
  }
920
964
  isInRange(e, t) {
921
965
  if (this.colAndRowspanRanges) {
922
- for (const s of this.colAndRowspanRanges)
923
- if (s.isInRange(e, t))
966
+ for (const i of this.colAndRowspanRanges)
967
+ if (i.isInRange(e, t))
924
968
  return !0;
925
969
  }
926
970
  return !1;
927
971
  }
928
972
  }
929
- class se {
930
- constructor(e, t, s) {
931
- this.header = e, this.body = t, this.footer = s;
973
+ class ne {
974
+ constructor(e, t, i) {
975
+ this.header = e, this.body = t, this.footer = i;
932
976
  }
933
977
  }
934
- class ie extends ee {
935
- constructor(e, t, s, i) {
936
- super(e, t, s, i), this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
978
+ class ae extends re {
979
+ constructor(e, t, i, s) {
980
+ var r, n;
981
+ super(e, t, i, s), this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
937
982
  header: [],
938
983
  body: [],
939
984
  footer: []
940
- }, this.tree = !1, this.rangeEles = [], this.colAndRowspanModels = new se(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.tableOptions?.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), this.tableOptions?.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), t.getAreaModel("body") instanceof O && (this.tree = !0), ["header", "body", "footer"].forEach(
941
- (r) => {
942
- this.colAndRowspanModels[r] = new te(t, t.getAreaModel(r)), this.colAndRowspanModels[r]?.init();
985
+ }, this.tree = !1, this.colAndRowspanModels = new ne(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.editing = !1, this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (r = this.tableOptions) != null && r.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (n = this.tableOptions) != null && n.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), t.getAreaModel("body") instanceof B && (this.tree = !0), ["header", "body", "footer"].forEach(
986
+ (l) => {
987
+ var a;
988
+ this.colAndRowspanModels[l] = new le(t, t.getAreaModel(l)), (a = this.colAndRowspanModels[l]) == null || a.init();
943
989
  }
944
990
  );
945
991
  }
992
+ isEditing() {
993
+ return this.editing;
994
+ }
946
995
  resetEditorRenderer() {
947
- this.editorRenderer = void 0, this.editorRendererRow = -1, this.editorRendererColumn = -1;
996
+ this.editorRenderer = void 0, this.editorRendererRow = -1, this.editorRendererColumn = -1, this.editing = !1;
948
997
  }
949
998
  clearSelection() {
950
- this.getSelectionModel && this.getSelectionModel()?.clear();
999
+ if (this.getSelectionModel) {
1000
+ const e = this.getSelectionModel();
1001
+ e == null || e.clear();
1002
+ }
951
1003
  }
952
1004
  initRenderEditor(e, t) {
953
- let s = this.tableModel.getColumnDef(t)?.getEditRenderer;
954
- if (s || (s = this.tableOptions.getEditRenderer), s)
955
- if (this.editorRenderer = s(e, t), this.editorRenderer) {
956
- this.editorRendererRow = e, this.editorRendererColumn = t, this.repaint();
957
- const i = document.querySelector("input.ge-table-cell-editor-input");
958
- i && i.focus();
1005
+ var s;
1006
+ let i = (s = this.tableModel.getColumnDef(t)) == null ? void 0 : s.getEditRenderer;
1007
+ if (i || (i = this.tableOptions.getEditRenderer), i)
1008
+ if (this.editorRenderer = i(e, t), this.editorRenderer) {
1009
+ this.editorRendererRow = e, this.editorRendererColumn = t, this.editing = !0, this.repaint();
1010
+ const o = document.querySelector("input.ge-table-cell-editor-input");
1011
+ o && o.focus();
959
1012
  } else
960
- this.editorRendererRow = -1, this.editorRendererColumn = -1;
1013
+ this.resetEditorRenderer();
961
1014
  }
962
1015
  repaint() {
963
1016
  this.adjustAfterScrolling();
964
1017
  }
965
1018
  adjustAfterScrolling() {
966
- for (const e of this.removables)
967
- e.remove();
1019
+ var e;
1020
+ for (const t of this.removables)
1021
+ t.remove();
968
1022
  this.hideHoverRow(), this.hideHoverColumn(), this.scrollTop = this.scrollViewport.scrollTop, this.scrollLeft = this.scrollViewport.scrollLeft, this.debounce(this.checkForScrollPosSaving.bind(this)), this.scrollFactorY = this.scrollTop / (this.scrollViewport.scrollHeight - this.scrollViewport.clientHeight), this.scrollFactorX = this.scrollLeft / (this.scrollViewport.scrollWidth - this.scrollViewport.clientWidth), isNaN(this.scrollFactorY) && (this.scrollFactorY = 0), isNaN(this.scrollFactorX) && (this.scrollFactorX = 0), this.adjustBody(), this.adjustArea("footer"), this.adjustArea("header"), this.tableOptions.tableTopBorderVisible && this.removables.push(this.dom.addHorizontalBorder(
969
- new M(0, this.hostElement.clientWidth, 1, 0),
1023
+ new T(0, this.hostElement.clientWidth, 1, 0),
970
1024
  this.hostElement,
971
- "ge-table-row-border"
1025
+ "ge-table-border"
972
1026
  )), this.tableOptions.tableBottomBorderVisible && this.removables.push(this.dom.addHorizontalBorder(
973
- new M(0, this.hostElement.clientWidth, 1, this.hostElement.clientHeight - 1),
1027
+ new T(0, this.hostElement.clientWidth, 1, this.hostElement.clientHeight - 1),
974
1028
  this.hostElement,
975
- "ge-table-row-border"
1029
+ "ge-table-border"
1030
+ )), this.tableModel.getFixedLeftColumnCount() > 0 && this.removables.push(this.dom.addVerticalBorder(
1031
+ new T(this.areaBodyWest.child.clientWidth, 1, this.hostElement.clientHeight, 0),
1032
+ this.hostElement,
1033
+ "ge-table-body-west-vertical-border"
1034
+ )), ((e = this.tableModel.getAreaModel("header")) == null ? void 0 : e.getRowCount()) > 0 && this.removables.push(this.dom.addHorizontalBorder(
1035
+ new T(0, this.hostElement.clientWidth, 1, this.areaHeaderCenter.child.clientHeight),
1036
+ this.hostElement,
1037
+ "ge-table-body-west-vertical-border"
976
1038
  ));
977
1039
  }
978
1040
  checkForScrollPosSaving() {
979
- this.storeScrollPosStateService && this.tableOptions?.autoRestoreOptions?.autoRestoreScrollPosition && this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
1041
+ var e, t;
1042
+ this.storeScrollPosStateService && ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreScrollPosition) && this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
1043
+ }
1044
+ updateCells(e) {
1045
+ e.forEach(
1046
+ (t) => this.tableModel.getAreaModel(t.area).setValue(t.rowIndex, t.columnIndex, t.value)
1047
+ ), this.repaint();
980
1048
  }
981
1049
  getAreaAndSideIdentByAttr(e) {
982
1050
  if (e) {
983
- const t = this.getStringByAttr(e, "data-area"), s = this.getStringByAttr(e, "data-side");
984
- if (s && t)
985
- return [t, s];
1051
+ const t = this.getStringByAttr(e, "data-area"), i = this.getStringByAttr(e, "data-side");
1052
+ if (i && t)
1053
+ return [t, i];
986
1054
  }
987
1055
  return [void 0, void 0];
988
1056
  }
@@ -1016,170 +1084,239 @@ class ie extends ee {
1016
1084
  this.dom.setStyle(this.contentDiv, "top", `${this.scrollTop}px`), this.dom.setStyle(this.contentDiv, "left", `${this.scrollViewport.scrollLeft}px`), this.adjustArea("body", t);
1017
1085
  }
1018
1086
  getNumberByAttr(e, t) {
1087
+ var i;
1019
1088
  if (e) {
1020
- const s = e.closest("[" + t + "]")?.getAttribute(t);
1089
+ const s = (i = e.closest("[" + t + "]")) == null ? void 0 : i.getAttribute(t);
1021
1090
  if (s)
1022
1091
  return Number(s);
1023
1092
  }
1024
1093
  return -1;
1025
1094
  }
1026
1095
  getStringByAttr(e, t) {
1096
+ var i;
1027
1097
  if (e) {
1028
- const s = e.closest("[" + t + "]")?.getAttribute(t);
1098
+ const s = (i = e.closest("[" + t + "]")) == null ? void 0 : i.getAttribute(t);
1029
1099
  if (s)
1030
1100
  return s;
1031
1101
  }
1032
1102
  return "";
1033
1103
  }
1034
1104
  adjustArea(e, t = 0) {
1035
- const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"), r = i.child.clientHeight;
1036
- s.child.innerText = "", i.child.innerText = "", o.child.innerText = "";
1037
- const l = 0, n = this.areaBodyCenterGeo.width, d = this.tableModel.getPadding(), h = this.tableModel.getAreaModel(e), S = h.getRowCount();
1105
+ var h;
1106
+ const i = this.getArea(e, "west"), s = this.getArea(e, "center"), o = this.getArea(e, "east"), r = s.child.clientHeight;
1107
+ i.child.innerText = "", s.child.innerText = "", o.child.innerText = "";
1108
+ const n = 0, l = this.areaBodyCenterGeo.width, a = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), S = d.getRowCount();
1038
1109
  for (; this.cleanupFunctions[e].length; ) {
1039
- const a = this.cleanupFunctions[e].shift();
1040
- a && a();
1110
+ const u = this.cleanupFunctions[e].shift();
1111
+ u && u();
1041
1112
  }
1042
- let f = t;
1043
- const p = this.tableModel.getColumnCount(), u = this.tableModel.getFixedRightColumnCount(), g = this.tableModel.getFixedLeftColumnCount();
1044
- for (let a = 0; a < S; a++) {
1045
- const b = f, y = this.tableModel.getRowHeight(e, a);
1046
- if (b + y > 0) {
1047
- this.firstVisibleRowIndex = a;
1048
- let v = { left: l, width: n, height: y, top: b, index: a }, m = this.dom.addRowDiv(i, v, a, e);
1049
- const E = g;
1113
+ let g = t;
1114
+ const f = this.tableModel.getColumnCount(), c = this.tableModel.getFixedRightColumnCount(), b = this.tableModel.getFixedLeftColumnCount();
1115
+ for (let u = 0; u < S; u++) {
1116
+ const v = g, x = u === S - 1, C = this.tableModel.getRowHeight(e, u);
1117
+ if (v + C > 0) {
1118
+ this.firstVisibleRowIndex = u;
1119
+ let w = { left: n, width: l, height: C, top: v, index: u }, m = this.dom.addRowDiv(s, w, u, e, "center");
1120
+ const M = b;
1050
1121
  if (this.adjustColumnsToRowParent({
1051
1122
  areaIdent: e,
1052
1123
  sideIdent: "center",
1053
- areaModel: h,
1054
- geo: v,
1124
+ areaModel: d,
1125
+ geo: w,
1055
1126
  parent: m,
1056
- rowIndex: a,
1057
- columnIndexStart: E,
1058
- columnIndexEnd: p - u - 1,
1059
- verticalFixed: !1
1060
- }), d.left > 0 && (v = { left: l, width: this.areaBodyWestGeo.width, height: y, top: b, index: a }, m = this.dom.addRowDiv(s, v, a, e), this.adjustColumnsToRowParent({
1127
+ rowIndex: u,
1128
+ columnIndexStart: M,
1129
+ columnIndexEnd: f - c - 1,
1130
+ verticalFixed: !1,
1131
+ lastRowOfModel: x
1132
+ }), a.left > 0 && (w = { left: n, width: this.areaBodyWestGeo.width, height: C, top: v, index: u }, m = this.dom.addRowDiv(i, w, u, e, "west"), this.adjustColumnsToRowParent({
1061
1133
  areaIdent: e,
1062
1134
  sideIdent: "west",
1063
- areaModel: h,
1064
- geo: v,
1135
+ areaModel: d,
1136
+ geo: w,
1065
1137
  parent: m,
1066
- rowIndex: a,
1138
+ rowIndex: u,
1067
1139
  columnIndexStart: 0,
1068
- columnIndexEnd: E - 1,
1069
- verticalFixed: !0
1070
- })), d.right > 0 && (v = { left: l, width: this.areaBodyEastGeo.width, height: y, top: b, index: a }, m = this.dom.addRowDiv(o, v, a, e), this.adjustColumnsToRowParent({
1140
+ columnIndexEnd: M - 1,
1141
+ verticalFixed: !0,
1142
+ lastRowOfModel: x
1143
+ })), a.right > 0 && (w = { left: n, width: this.areaBodyEastGeo.width, height: C, top: v, index: u }, m = this.dom.addRowDiv(o, w, u, e, "east"), this.adjustColumnsToRowParent({
1071
1144
  areaIdent: e,
1072
1145
  sideIdent: "east",
1073
- areaModel: h,
1074
- geo: v,
1146
+ areaModel: d,
1147
+ geo: w,
1075
1148
  parent: m,
1076
- rowIndex: a,
1077
- columnIndexStart: p - u,
1078
- columnIndexEnd: p - 1,
1079
- verticalFixed: !0
1080
- })), e === "header" && this.tree && a === S - 1) {
1081
- const x = this.dom.applyStyle(
1149
+ rowIndex: u,
1150
+ columnIndexStart: f - c,
1151
+ columnIndexEnd: f - 1,
1152
+ verticalFixed: !0,
1153
+ lastRowOfModel: x
1154
+ })), e === "header" && this.tree && u === S - 1) {
1155
+ const E = this.dom.applyStyle(
1082
1156
  this.dom.setAttribute(
1083
- this.dom.addDiv(m, new M(16, 20, 20, 8)),
1157
+ this.dom.addDiv(m, new T(16, 20, 20, 8)),
1084
1158
  "data-ge-action",
1085
1159
  "toggleExpandCollapseAll"
1086
1160
  ),
1087
1161
  { cursor: "pointer" }
1088
- ), C = this.tableOptions.treeOptions.arrowExpandCollapseAll;
1089
- if (C) {
1090
- const T = this.dom.domService.createText(C.content);
1091
- this.dom.domService.appendChild(x, T), C.style && this.dom.applyStyleString(x, C.style);
1162
+ ), R = this.tableOptions.treeOptions.arrowExpandCollapseAll;
1163
+ if (R) {
1164
+ const D = this.dom.domService.createText(R.content);
1165
+ this.dom.domService.appendChild(E, D), R.style && this.dom.applyStyleString(E, R.style);
1092
1166
  }
1093
1167
  }
1094
1168
  }
1095
- if (f = f + y, f > r)
1169
+ if (g = g + C, g > r)
1096
1170
  break;
1097
1171
  }
1098
1172
  if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
1099
- const a = this.colAndRowspanModels[e]?.getRanges() ?? [];
1100
- if (a.length)
1101
- for (const b of a) {
1102
- let y = 0, v = i.child;
1103
- if (b.c1 < g)
1104
- v = s.child;
1105
- else if (u > 0 && b.c1 >= p - u)
1106
- v = o.child;
1173
+ const u = ((h = this.colAndRowspanModels[e]) == null ? void 0 : h.getRanges()) ?? [];
1174
+ if (u.length)
1175
+ for (const v of u) {
1176
+ let x = 0, C = s.child, w = "center";
1177
+ if (v.c1 < b)
1178
+ C = i.child, w = "west";
1179
+ else if (c > 0 && v.c1 >= f - c)
1180
+ C = o.child, w = "east";
1107
1181
  else {
1108
1182
  const m = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1109
- y = this.scrollFactorX * m - this.areaBodyWestGeo.width;
1183
+ x = this.scrollFactorX * m - this.areaBodyWestGeo.width, w = "center";
1110
1184
  }
1111
- this.drawBigCell(b, y, t, h, v);
1185
+ this.drawBigCell(v, x, t, d, C, w);
1112
1186
  }
1113
1187
  }
1114
1188
  }
1115
1189
  /**
1116
1190
  * Draws big cells (rowspan and or colspan) in body/center
1117
- * @param range:CellRange
1191
+ * @param range CellRange
1118
1192
  * @param xStart X position in pixel for top left corner
1119
1193
  * @param yStart Y position in pixel for top left corner
1120
1194
  * @param areaModel AreaModelIf
1121
1195
  * @param parentDiv Parent div as HTMLDivElement
1196
+ * @param sideIdent SideIdent (west,center,east)
1122
1197
  * @protected
1123
1198
  */
1124
- drawBigCell(e, t, s, i, o) {
1125
- const r = s + this.getRowHeights(0, e.r1 - 1, i).reduce((g, a) => g + a, 0), l = this.tableModel.getColumnCount(), n = this.tableModel.getFixedRightColumnCount();
1199
+ drawBigCell(e, t, i, s, o, r) {
1200
+ const n = i + this.getRowHeights(0, e.r1 - 1, s).reduce((h, u) => h + u, 0), l = this.tableModel.getColumnCount(), a = this.tableModel.getFixedRightColumnCount();
1126
1201
  let d = 0;
1127
- n > 0 && e.c1 >= l - n && (d = l - n);
1128
- const h = t + this.getColumnWidths(d, e.c1 - 1).reduce((g, a) => g + a, 0), S = this.getRowHeights(e.r1, e.r2, i).reduce((g, a) => g + a, 0), f = this.getColumnWidths(e.c1, e.c2).reduce((g, a) => g + a, 0);
1129
- let p = !1;
1130
- const u = this.getSelectionModel ? this.getSelectionModel() : void 0;
1131
- u && (p = u.getSelectionCount(e.r1, e.c1) > 0), this.renderCell(i, i.areaIdent, e.r1, e.c1, h, r, f, S, o, p), i.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle(e.r1, e.c1, h, r, f, S, o);
1132
- }
1133
- findRowOfImportantRowspanCell(e, t, s) {
1134
- const i = e.getMaxRowspan();
1202
+ a > 0 && e.c1 >= l - a && (d = l - a);
1203
+ const S = t + this.getColumnWidths(d, e.c1 - 1).reduce((h, u) => h + u, 0), g = this.getRowHeights(e.r1, e.r2, s).reduce((h, u) => h + u, 0), f = this.getColumnWidths(e.c1, e.c2).reduce((h, u) => h + u, 0);
1204
+ let c = !1;
1205
+ const b = this.getSelectionModel ? this.getSelectionModel() : void 0;
1206
+ b && (c = b.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? (console.info("TODO here", e), this.renderCell({
1207
+ areaModel: s,
1208
+ areaIdent: s.areaIdent,
1209
+ sideIdent: r,
1210
+ rowIndex: e.r1,
1211
+ columnIndex: e.c1,
1212
+ left: S,
1213
+ top: n,
1214
+ width: f,
1215
+ height: g,
1216
+ parent: o,
1217
+ cellSelected: c,
1218
+ lastRowOfModel: !0,
1219
+ gammaRange: e.gammaRange
1220
+ })) : this.renderCell({
1221
+ areaModel: s,
1222
+ areaIdent: s.areaIdent,
1223
+ sideIdent: r,
1224
+ rowIndex: e.r1,
1225
+ columnIndex: e.c1,
1226
+ left: S,
1227
+ top: n,
1228
+ width: f,
1229
+ height: g,
1230
+ parent: o,
1231
+ cellSelected: c,
1232
+ lastRowOfModel: !0,
1233
+ gammaRange: e.gammaRange
1234
+ }), s.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
1235
+ rowIndex: e.r1,
1236
+ columnIndex: e.c1,
1237
+ cellLeft: S,
1238
+ cellTop: n,
1239
+ cellWidth: f,
1240
+ cellHeight: g,
1241
+ parent: o
1242
+ });
1243
+ }
1244
+ findRowOfImportantRowspanCell(e, t, i) {
1245
+ const s = e.getMaxRowspan();
1135
1246
  for (let o = t - 1; o > -1; o--) {
1136
- const r = e.getRowspanAt(o, s);
1247
+ const r = e.getRowspanAt(o, i);
1137
1248
  if (r > 1 && o + r + 1 >= t)
1138
1249
  return o;
1139
- if (t - o > i)
1250
+ if (t - o > s)
1140
1251
  return -1;
1141
1252
  }
1142
1253
  return -1;
1143
1254
  }
1144
- // TODO skip cols in header because of colspan
1145
1255
  adjustColumnsToRowParent({
1146
1256
  areaIdent: e,
1147
1257
  sideIdent: t,
1148
- areaModel: s,
1149
- geo: i,
1258
+ areaModel: i,
1259
+ geo: s,
1150
1260
  parent: o,
1151
1261
  rowIndex: r,
1152
- columnIndexStart: l,
1153
- columnIndexEnd: n,
1154
- verticalFixed: d = !1
1262
+ columnIndexStart: n,
1263
+ columnIndexEnd: l,
1264
+ verticalFixed: a = !1,
1265
+ lastRowOfModel: d = !1
1155
1266
  }) {
1267
+ var b;
1156
1268
  this.scrollViewportLeft = this.scrollViewport.scrollLeft;
1157
- let h = 0;
1158
- if (!d) {
1159
- const u = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1160
- h = this.scrollFactorX * u;
1269
+ let S = 0;
1270
+ if (!a) {
1271
+ const h = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1272
+ S = this.scrollFactorX * h;
1161
1273
  }
1162
- const S = 0, f = !!(e === "body" && t);
1163
- let p = h;
1164
- for (let u = l; u <= n; u++) {
1165
- const g = p, a = this.tableModel.getColumnWidth(u);
1166
- if (g + a > 0) {
1167
- let b = i.height, y = s.getRowspanAt(r, u), v = s.getColspanAt(r, u);
1168
- y > 1 && (b = this.getRowHeights(r, r + y - 1, s).reduce((x, C) => x + C, 0));
1169
- let m = a;
1170
- v > 1 && (m = this.getColumnWidths(u, u + v - 1).reduce((x, C) => x + C, 0));
1171
- let E = !1;
1172
- if (this.colAndRowspanModels && this.colAndRowspanModels[e] && this.colAndRowspanModels[e]?.isInRange(r, u) && (E = !0), this.draggingTargetColumnIndex === u && e !== "header")
1173
- this.renderDragTargetDiv(o, g, S, m, b), this.dom.addColumnBorderDivs(o, { left: g, top: S, width: m, height: b });
1174
- else {
1175
- let x = this.renderSelectedBackgroundDiv(E, f, s, r, u, o, g, S, m, b);
1176
- E || this.renderCell(s, e, r, u, g, S, m, b, o, x), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle(r, u, g, S, m, b, o);
1274
+ const g = 0, f = !!(e === "body" && t);
1275
+ let c = S;
1276
+ for (let h = n; h <= l; h++) {
1277
+ const u = c, v = this.tableModel.getColumnWidth(h);
1278
+ if (v > 0 && u + v > 0) {
1279
+ let x = s.height;
1280
+ const C = i.getRowspanAt(r, h), w = i.getColspanAt(r, h);
1281
+ C > 1 && (x = this.getRowHeights(r, r + C - 1, i).reduce((E, R) => E + R, 0));
1282
+ let m = v;
1283
+ w > 1 && (m = this.getColumnWidths(h, h + w - 1).reduce((E, R) => E + R, 0));
1284
+ let M = !1;
1285
+ if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (b = this.colAndRowspanModels[e]) != null && b.isInRange(r, h) && (M = !0), this.draggingTargetColumnIndex === h && e !== "header") {
1286
+ this.renderDragTargetDiv(o, u, g, m, x);
1287
+ const E = { left: u, top: g, width: m, height: x };
1288
+ this.dom.addColumnBorderDivs(this.tableOptions, o, E, e, t);
1289
+ } else {
1290
+ const E = this.renderSelectedBackgroundDiv(M, f, t, i, r, h, o, u, g, m, x);
1291
+ M || this.renderCell({
1292
+ areaModel: i,
1293
+ areaIdent: e,
1294
+ sideIdent: t,
1295
+ rowIndex: r,
1296
+ columnIndex: h,
1297
+ left: u,
1298
+ top: g,
1299
+ width: m,
1300
+ height: x,
1301
+ parent: o,
1302
+ cellSelected: E,
1303
+ lastRowOfModel: d,
1304
+ gammaRange: !0
1305
+ }), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
1306
+ rowIndex: r,
1307
+ columnIndex: h,
1308
+ cellLeft: u,
1309
+ cellTop: g,
1310
+ cellWidth: m,
1311
+ cellHeight: x,
1312
+ parent: o
1313
+ });
1177
1314
  }
1178
1315
  }
1179
- if (p = p + a, p > this.areaBodyCenterGeo.width)
1316
+ if (c = c + v, c > this.areaBodyCenterGeo.width)
1180
1317
  break;
1181
1318
  }
1182
- this.dom.addVerticalBorder(new M(p - 1, 1, i.height, 0), o);
1319
+ this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(c - 1, 1, s.height, 0), o);
1183
1320
  }
1184
1321
  getTreeArrowColumnIndex() {
1185
1322
  return this.tableOptions.showCheckboxWihoutExtraColumn ? 0 : this.tableModel.isRowCheckboxVisible() ? 1 : 0;
@@ -1187,54 +1324,78 @@ class ie extends ee {
1187
1324
  addAndRenderCellDiv({
1188
1325
  areaModel: e,
1189
1326
  areaIdent: t,
1327
+ sideIdent: i,
1190
1328
  rowIndex: s,
1191
- index: i,
1192
- left: o,
1193
- width: r,
1329
+ index: o,
1330
+ left: r,
1331
+ width: n,
1194
1332
  height: l,
1195
- top: n,
1196
- parent: d
1333
+ top: a,
1334
+ parent: d,
1335
+ lastRowOfModel: S
1197
1336
  }) {
1198
- const S = this.editorRenderer && this.editorRendererRow === s && this.editorRendererColumn === i ? this.editorRenderer : e.getCellRenderer(s, i), f = { left: o, width: r, height: l, top: n, index: i }, p = e.getRowByIndex(s);
1199
- let u = "none";
1200
- if (i === this.getTreeArrowColumnIndex() && p instanceof I) {
1201
- const R = p;
1202
- R.children?.length ? R.expanded ? u = "expanded" : u = "collapsed" : u = "hidden";
1337
+ var W;
1338
+ const f = this.editorRenderer && this.editorRendererRow === s && this.editorRendererColumn === o ? this.editorRenderer : e.getCellRenderer(s, o), c = { left: r, width: n, height: l, top: a, index: o }, b = e.getRowByIndex(s);
1339
+ let h = "none";
1340
+ if (o === this.getTreeArrowColumnIndex() && b instanceof L) {
1341
+ const y = b;
1342
+ (W = y.children) != null && W.length ? y.expanded ? h = "expanded" : h = "collapsed" : h = "hidden";
1203
1343
  }
1204
- let a;
1344
+ let v;
1205
1345
  if (t === "header") {
1206
- const R = this.tableModel.getColumnDef(i);
1207
- (!R?.sortIconVisible || R?.sortIconVisible()) && (a = R?.sortState);
1346
+ const y = this.tableModel.getColumnDef(o);
1347
+ (!(y != null && y.sortIconVisible) || y != null && y.sortIconVisible()) && (v = y == null ? void 0 : y.sortState);
1348
+ }
1349
+ const x = e.getValueAt(s, o), C = f ? "" : `${x}`, w = e.isRowChecked(s), m = this.dom.addColumnDiv(
1350
+ d,
1351
+ c,
1352
+ s,
1353
+ o,
1354
+ t,
1355
+ i,
1356
+ C,
1357
+ h,
1358
+ this.tableOptions,
1359
+ w,
1360
+ v
1361
+ ), M = e.getTooltipAt(s, o);
1362
+ M && this.dom.setAttribute(m, "title", M);
1363
+ const E = this.tableModel.getColumnDef(o);
1364
+ E && E.classes[t] && this.dom.addClasses(E.classes[t], m);
1365
+ let R;
1366
+ f && (R = f.render(m, s, o, t, e, x, this.dom.domService));
1367
+ const D = e.getCustomClassesAt(s, o);
1368
+ if (D.length && this.dom.addClasses(D, m), this.dom.addColumnBorderDivs(this.tableOptions, d, c, t, i), S && this.dom.addHorizontalBorder({ left: r, width: n, height: l, top: a + l }, d), this.getFocusModel && t === "body") {
1369
+ const y = this.getFocusModel();
1370
+ y != null && y.hasFocus(s, o) && this.dom.addFocusBorderDivs(d, c, {});
1208
1371
  }
1209
- const b = e.getValueAt(s, i), y = S ? "" : `${b}`, v = e.isRowChecked(s), m = this.dom.addColumnDiv(d, f, s, i, t, y, u, this.tableOptions, v, a), E = e.getTooltipAt(s, i);
1210
- E && this.dom.setAttribute(m, "title", E);
1211
- const x = this.tableModel.getColumnDef(i);
1212
- x && x.classes[t] && this.dom.addClasses(x.classes[t], m);
1213
- let C;
1214
- S && (C = S.render(m, s, i, t, e, b, this.dom.domService));
1215
- const T = e.getCustomClassesAt(s, i);
1216
- return T.length && this.dom.addClasses(T, m), this.dom.addColumnBorderDivs(d, f), this.getFocusModel && t === "body" && this.getFocusModel()?.hasFocus(s, i) && this.dom.addFocusBorderDivs(d, f, {}), t === "header" && this.dom.setAttribute(m, "data-ge-action", "drag-column"), [m, C];
1372
+ t === "header" && this.dom.setAttribute(m, "data-ge-action", "drag-column");
1373
+ const O = e.getCustomStyleAt(s, o);
1374
+ if (O)
1375
+ for (const y in O)
1376
+ this.dom.setStyle(m, y, O[y]);
1377
+ return [m, R];
1217
1378
  }
1218
1379
  getColumnWidths(e, t) {
1219
- const s = [];
1220
- for (let i = e; i <= t; i++)
1221
- s.push(this.tableModel.getColumnWidth(i));
1222
- return s;
1223
- }
1224
- getRowHeights(e, t, s) {
1225
1380
  const i = [];
1226
- for (let o = e; o <= t; o++)
1227
- i.push(s.getRowHeight(o));
1381
+ for (let s = e; s <= t; s++)
1382
+ i.push(this.tableModel.getColumnWidth(s));
1228
1383
  return i;
1229
1384
  }
1385
+ getRowHeights(e, t, i) {
1386
+ const s = [];
1387
+ for (let o = e; o <= t; o++)
1388
+ s.push(i.getRowHeight(o));
1389
+ return s;
1390
+ }
1230
1391
  adjustHoverRows(e) {
1231
1392
  if (this.tableOptions.hoverRowVisible && e.rowIndex > -1) {
1232
- const t = this.hostElement.clientWidth, s = this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex), i = e.rowTop + this.areaHeaderCenter.parent.clientHeight - this.scrollTop;
1393
+ const t = this.hostElement.clientWidth, i = this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex), s = e.rowTop + this.areaHeaderCenter.parent.clientHeight - this.scrollTop;
1233
1394
  this.dom.applyStyle(this.hoverRow, {
1234
1395
  left: "0",
1235
- top: i + "px",
1396
+ top: s + "px",
1236
1397
  width: t + "px",
1237
- height: s + "px",
1398
+ height: i + "px",
1238
1399
  display: "block"
1239
1400
  });
1240
1401
  } else
@@ -1247,11 +1408,11 @@ class ie extends ee {
1247
1408
  }
1248
1409
  adjustHoverColumns(e) {
1249
1410
  if (this.tableOptions.hoverColumnVisible && e.rowIndex > -1) {
1250
- const t = this.hostElement.clientHeight, s = this.tableModel.getColumnWidth(e.columnIndex), i = e.columnLeft + this.tableModel.getPadding().left - this.scrollLeft;
1411
+ const t = this.hostElement.clientHeight, i = this.tableModel.getColumnWidth(e.columnIndex), s = this.areaBodyWestGeo.width, o = e.columnLeft + this.tableModel.getPadding().left - this.scrollLeft - s;
1251
1412
  this.dom.applyStyle(this.hoverColumn, {
1252
- left: i + "px",
1413
+ left: o + "px",
1253
1414
  top: "0px",
1254
- width: s + "px",
1415
+ width: i + "px",
1255
1416
  height: t + "px",
1256
1417
  display: "block"
1257
1418
  });
@@ -1266,103 +1427,123 @@ class ie extends ee {
1266
1427
  debounce(e, t = 1e3) {
1267
1428
  this.debounceTimeout && clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(e.bind(this), t);
1268
1429
  }
1269
- renderDragTargetDiv(e, t, s, i, o) {
1430
+ renderDragTargetDiv(e, t, i, s, o) {
1270
1431
  const r = this.dom.applyStylePosistionAbsolute(
1271
1432
  this.dom.createDivWithClass("ge-table-drop-zone", e)
1272
1433
  );
1273
- return this.dom.setStyle(r, "left", `${t}px`), this.dom.setStyle(r, "top", `${s}px`), this.dom.setStyle(r, "width", `${i}px`), this.dom.setStyle(r, "height", `${o}px`), r;
1434
+ return this.dom.setStyle(r, "left", `${t}px`), this.dom.setStyle(r, "top", `${i}px`), this.dom.setStyle(r, "width", `${s}px`), this.dom.setStyle(r, "height", `${o}px`), r;
1274
1435
  }
1275
- renderSelectedBackgroundDiv(e, t, s, i, o, r, l, n, d, h) {
1276
- let S = !1;
1277
- if (!e && t && s.isSelectable(i, o) && this.getSelectionModel) {
1436
+ renderSelectedBackgroundDiv(e, t, i, s, o, r, n, l, a, d, S) {
1437
+ let g = !1;
1438
+ if (!e && t && s.isSelectable(o, r) && this.getSelectionModel) {
1278
1439
  const f = this.getSelectionModel();
1279
1440
  if (f) {
1280
- const p = f.getSelectionCount(i, o);
1281
- S = p > 0;
1282
- for (let u = 0; u < p; u++) {
1283
- const g = this.dom.applyStylePosistionAbsolute(
1284
- this.dom.createDivWithClass("ge-table-selected-range", r)
1441
+ const c = f.getSelectionCount(o, r);
1442
+ g = c > 0;
1443
+ for (let b = 0; b < c; b++) {
1444
+ const h = this.dom.applyStylePosistionAbsolute(
1445
+ // ge-table-body-west-selected-range
1446
+ this.dom.createDivWithClass(`ge-table-${s.areaIdent}-${i}-selected-range`, n)
1285
1447
  );
1286
- this.dom.setStyle(g, "left", `${l}px`), this.dom.setStyle(g, "top", `${n}px`), this.dom.setStyle(g, "width", `${d}px`), this.dom.setStyle(g, "height", `${h}px`);
1448
+ this.dom.setStyle(h, "left", `${l}px`), this.dom.setStyle(h, "top", `${a}px`), this.dom.setStyle(h, "width", `${d}px`), this.dom.setStyle(h, "height", `${S}px`);
1287
1449
  }
1288
1450
  }
1289
1451
  }
1290
- return S;
1452
+ return g;
1291
1453
  }
1292
- renderCell(e, t, s, i, o, r, l, n, d, h) {
1293
- const [S, f] = this.addAndRenderCellDiv({
1454
+ renderCell({
1455
+ areaModel: e,
1456
+ areaIdent: t,
1457
+ sideIdent: i,
1458
+ rowIndex: s,
1459
+ columnIndex: o,
1460
+ left: r,
1461
+ top: n,
1462
+ width: l,
1463
+ height: a,
1464
+ parent: d,
1465
+ cellSelected: S,
1466
+ lastRowOfModel: g,
1467
+ gammaRange: f
1468
+ }) {
1469
+ const [c, b] = this.addAndRenderCellDiv({
1294
1470
  areaModel: e,
1295
1471
  areaIdent: t,
1472
+ sideIdent: i,
1296
1473
  rowIndex: s,
1297
- index: i,
1298
- left: o,
1474
+ index: o,
1475
+ left: r,
1299
1476
  width: l,
1300
- height: n,
1301
- top: r,
1302
- parent: d
1477
+ height: a,
1478
+ top: n,
1479
+ parent: d,
1480
+ lastRowOfModel: g,
1481
+ gammaRange: f
1303
1482
  });
1304
- h && this.dom.addClass("ge-cell-selected", S), f && this.cleanupFunctions[t].push(f);
1483
+ S && this.dom.addClass(`ge-table-${t}-${i}-selected-range`, c), b && this.cleanupFunctions[t].push(b);
1305
1484
  }
1306
- renderHeaderCellResizeHandle(e, t, s, i, o, r, l) {
1307
- const n = this.dom.domService, d = this.tableOptions.columnResizeHandleWidthInPx ?? 3, h = n.createElement("div");
1308
- n.setAttribute(h, "data-col-index", `${t}`), n.setAttribute(h, "data-row-index", `${e}`), n.setAttribute(h, "data-area", "header"), n.setAttribute(h, "data-ge-action", "resize-column"), n.addClass(h, "ge-table-col-resize-handle"), n.setStyle(h, "display", "clip"), n.setStyle(h, "position", "absolute"), n.setStyle(h, "cursor", "col-resize"), n.setStyle(h, "left", `${s + o - d}px`), n.setStyle(h, "top", `${i}px`), n.setStyle(h, "width", `${d}px`), n.setStyle(h, "height", `${r}px`), n.appendChild(l, h);
1485
+ renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: i, cellTop: s, cellWidth: o, cellHeight: r, parent: n }) {
1486
+ const l = this.dom.domService, a = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = l.createElement("div");
1487
+ 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", `${i + o - a}px`), l.setStyle(d, "top", `${s}px`), l.setStyle(d, "width", `${a}px`), l.setStyle(d, "height", `${r}px`), l.appendChild(n, d);
1309
1488
  }
1310
1489
  }
1311
- class oe {
1490
+ class de {
1312
1491
  constructor(e, t) {
1313
1492
  this.columnIndex = e, this.sortState = t;
1314
1493
  }
1315
1494
  }
1316
- class re {
1495
+ class he {
1317
1496
  constructor(e) {
1318
1497
  this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
1319
1498
  }
1320
1499
  onHostElementChanged(e) {
1321
1500
  if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
1322
- const t = e.target, s = t.getAttribute("data-area"), i = t.getAttribute("data-row-index"), o = t.getAttribute("data-col-index");
1323
- if (s && i && o) {
1324
- const r = F(s), l = Number(i), n = Number(o);
1325
- this.tableScope.updateModelValue(r, l, n, t.value);
1501
+ const t = e.target, i = t.getAttribute("data-area"), s = t.getAttribute("data-row-index"), o = t.getAttribute("data-col-index");
1502
+ if (i && s && o) {
1503
+ const r = V(i), n = Number(s), l = Number(o);
1504
+ this.tableScope.updateModelValueAfterEdit(r, n, l, t.value);
1326
1505
  }
1327
1506
  }
1328
1507
  }
1329
1508
  }
1330
- class le {
1509
+ class ce {
1331
1510
  constructor(e = -1, t = -1) {
1332
1511
  this.rowIndex = e, this.columnIndex = t;
1333
1512
  }
1334
1513
  }
1335
- class P {
1514
+ class _ {
1336
1515
  constructor(e) {
1337
1516
  this.cells = e;
1338
1517
  }
1339
1518
  static createSingle(e, t) {
1340
- return new P([new le(e, t)]);
1519
+ return new _([new ce(e, t)]);
1341
1520
  }
1342
1521
  }
1343
- class ne {
1522
+ class pe {
1344
1523
  constructor(e) {
1345
- this.tableScope = e, this.tableScope.tableOptions?.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), this.tableScope.tableOptions?.getFocusModel && (this.getFocusModel = this.tableScope.tableOptions.getFocusModel);
1524
+ var t, i;
1525
+ this.tableScope = e, (t = this.tableScope.tableOptions) != null && t.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), (i = this.tableScope.tableOptions) != null && i.getFocusModel && (this.getFocusModel = this.tableScope.tableOptions.getFocusModel);
1346
1526
  }
1347
1527
  onMouseClicked(e, t) {
1348
- let s = !1, i = !1;
1528
+ var o, r, n, l, a, d, S;
1529
+ let i = !1, s = !1;
1349
1530
  if (this.getSelectionModel && this.getFocusModel) {
1350
- const o = this.getSelectionModel(), r = this.getFocusModel();
1351
- o && r && (r.hasFocus(e.rowIndex, e.columnIndex) || (r.setFocus(e.rowIndex, e.columnIndex), s = !0), e.originalEvent?.shiftKey || o.hasSelection() && (o.clear(), s = !0), e.originalEvent?.shiftKey && this.previousEvt ? (o.addSelection(this.createRangeByEvents(e, this.previousEvt)), i = !0, s = !0) : e.originalEvent?.ctrlKey || e.originalEvent?.metaKey ? (o.addSelection(w.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0) : e.originalEvent?.altKey && (e.originalEvent?.ctrlKey || e.originalEvent?.metaKey) && (o.removeSelection(w.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0));
1531
+ const g = this.getSelectionModel(), f = this.getFocusModel();
1532
+ g && f && (f.hasFocus(e.rowIndex, e.columnIndex) || (f.setFocus(e.rowIndex, e.columnIndex), i = !0), (o = e.originalEvent) != null && o.shiftKey || g.hasSelection() && (g.clear(), i = !0), (r = e.originalEvent) != null && r.shiftKey && this.previousEvt ? (g.addSelection(this.createRangeByEvents(e, this.previousEvt)), s = !0, i = !0) : (n = e.originalEvent) != null && n.ctrlKey || (l = e.originalEvent) != null && l.metaKey ? (g.addSelection(A.singleCell(e.rowIndex, e.columnIndex)), s = !0, i = !0) : (a = e.originalEvent) != null && a.altKey && ((d = e.originalEvent) != null && d.ctrlKey || (S = e.originalEvent) != null && S.metaKey) && (g.removeSelection(A.singleCell(e.rowIndex, e.columnIndex)), s = !0, i = !0));
1352
1533
  }
1353
- return i ? this.previousEvt = void 0 : this.previousEvt = e?.clone(), s;
1534
+ return s ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), i;
1354
1535
  }
1355
1536
  onActionTriggered(e) {
1356
1537
  if (this.getSelectionModel && this.getFocusModel) {
1357
- const t = this.getSelectionModel(), s = this.getFocusModel();
1358
- if (t && s) {
1538
+ const t = this.getSelectionModel(), i = this.getFocusModel();
1539
+ if (t && i) {
1359
1540
  if (e === "SELECT_ALL")
1360
1541
  return t.selectAll(), this.tableScope.repaint(), !0;
1361
1542
  if (e === "DESELECT_ALL")
1362
1543
  return t.clear(), this.tableScope.repaint(), !0;
1363
1544
  if (e === "TOGGLE_SELECTION") {
1364
- const [i, o] = s.getFocus();
1365
- return t.togglePoint(i, o), this.tableScope.repaint(), !0;
1545
+ const [s, o] = i.getFocus();
1546
+ return t.togglePoint(s, o), this.tableScope.repaint(), !0;
1366
1547
  }
1367
1548
  }
1368
1549
  }
@@ -1370,16 +1551,16 @@ class ne {
1370
1551
  }
1371
1552
  createRangeByEvents(e, t) {
1372
1553
  t || (t = e);
1373
- const s = Math.min(e.rowIndex, t?.rowIndex), i = Math.max(e.rowIndex, t?.rowIndex), o = Math.min(e.columnIndex, t?.columnIndex), r = Math.max(e.columnIndex, t?.columnIndex);
1374
- return w.create({
1375
- rowIndex1: s,
1554
+ const i = Math.min(e.rowIndex, t == null ? void 0 : t.rowIndex), s = Math.max(e.rowIndex, t == null ? void 0 : t.rowIndex), o = Math.min(e.columnIndex, t == null ? void 0 : t.columnIndex), r = Math.max(e.columnIndex, t == null ? void 0 : t.columnIndex);
1555
+ return A.create({
1556
+ rowIndex1: i,
1376
1557
  columnIndex1: o,
1377
- rowIndex2: i,
1558
+ rowIndex2: s,
1378
1559
  columnIndex2: r
1379
1560
  });
1380
1561
  }
1381
1562
  }
1382
- class ae {
1563
+ class ue {
1383
1564
  get() {
1384
1565
  return {
1385
1566
  f2: "START_EDITING",
@@ -1389,11 +1570,15 @@ class ae {
1389
1570
  "ctrl+shift+a": "DESELECT_ALL",
1390
1571
  "ctrl+x": "DESELECT_ALL",
1391
1572
  "ctrl+num_subtract": "DESELECT_ALL",
1392
- "cmd -": "DESELECT_ALL"
1573
+ "cmd -": "DESELECT_ALL",
1574
+ arrowup: "NAVIGATE_UP",
1575
+ arrowdown: "NAVIGATE_DOWN",
1576
+ arrowleft: "NAVIGATE_LEFT",
1577
+ arrowright: "NAVIGATE_RIGHT"
1393
1578
  };
1394
1579
  }
1395
1580
  }
1396
- class de {
1581
+ class Se {
1397
1582
  get() {
1398
1583
  return {
1399
1584
  f2: "START_EDITING",
@@ -1405,11 +1590,15 @@ class de {
1405
1590
  "cmd+shift+a": "DESELECT_ALL",
1406
1591
  "ctrl+shift+a": "DESELECT_ALL",
1407
1592
  "ctrl+num_subtract": "DESELECT_ALL",
1408
- "ctrl -": "DESELECT_ALL"
1593
+ "ctrl -": "DESELECT_ALL",
1594
+ arrowup: "NAVIGATE_UP",
1595
+ arrowdown: "NAVIGATE_DOWN",
1596
+ arrowleft: "NAVIGATE_LEFT",
1597
+ arrowright: "NAVIGATE_RIGHT"
1409
1598
  };
1410
1599
  }
1411
1600
  }
1412
- class he {
1601
+ class ge {
1413
1602
  constructor(e) {
1414
1603
  this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
1415
1604
  }
@@ -1417,38 +1606,42 @@ class he {
1417
1606
  this.listener.includes(e) || this.listener.push(e);
1418
1607
  }
1419
1608
  init() {
1420
- this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new de().get()) : Object.assign(this.shortcutActionIdMapping, new ae().get()), Object.assign(this.shortcutActionIdMapping, this.tableScope.tableOptions.shortcutActionIdMapping), this.isLocalhost() && console.info("ShortcutService", this.shortcutActionIdMapping), this.tableScope.hostElement.addEventListener("keydown", this.onKeyDown.bind(this));
1609
+ this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new Se().get()) : Object.assign(this.shortcutActionIdMapping, new ue().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));
1421
1610
  }
1422
1611
  isMacintosh() {
1423
1612
  return navigator.platform.indexOf("Mac") > -1;
1424
1613
  }
1614
+ isDebug() {
1615
+ return this.isLocalhost();
1616
+ }
1425
1617
  isLocalhost() {
1426
1618
  return location.hostname === "localhost" || location.hostname === "127.0.0.1";
1427
1619
  }
1428
1620
  onKeyDown(e) {
1429
1621
  const t = this.findEnty(e);
1430
- t && this.emit(t) && e.preventDefault();
1622
+ t && this.emit(t) && (e.preventDefault(), e.stopPropagation());
1431
1623
  }
1432
1624
  emit(e) {
1433
- this.isLocalhost() && console.info("ShortcutService emit:", e);
1625
+ this.isDebug() && console.debug("ShortcutService emit:", e);
1434
1626
  let t = !1;
1435
- for (const s of this.listener)
1436
- s.onActionTriggered(e) && (t = !0);
1627
+ for (const i of this.listener)
1628
+ i.onActionTriggered(e) && (t = !0);
1437
1629
  return t;
1438
1630
  }
1439
1631
  findEnty(e) {
1440
1632
  const t = this.getTokenByEvent(e);
1441
- for (const s in this.shortcutActionIdMapping) {
1442
- const i = s.replace(/opt/g, "alt").replace(/cmd/g, "meta").split(/[\+ ]/g).sort();
1443
- if (this.areTokensEquals(t, i))
1444
- return this.shortcutActionIdMapping[s];
1633
+ this.isDebug() && console.debug("ShortcutService tokens:", t);
1634
+ for (const i in this.shortcutActionIdMapping) {
1635
+ const s = i.replace(/opt/g, "alt").replace(/cmd/g, "meta").split(/[\+ ]/g).sort();
1636
+ if (this.areTokensEquals(t, s))
1637
+ return this.shortcutActionIdMapping[i];
1445
1638
  }
1446
1639
  }
1447
1640
  areTokensEquals(e, t) {
1448
1641
  if (e.length !== t.length || e.length === 0)
1449
1642
  return !1;
1450
- for (let s = 0; s < e.length; s++)
1451
- if (e[s] !== t[s])
1643
+ for (let i = 0; i < e.length; i++)
1644
+ if (e[i] !== t[i])
1452
1645
  return !1;
1453
1646
  return !0;
1454
1647
  }
@@ -1457,7 +1650,7 @@ class he {
1457
1650
  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();
1458
1651
  }
1459
1652
  }
1460
- class ce {
1653
+ class fe {
1461
1654
  onCheckboxChanged(e) {
1462
1655
  }
1463
1656
  onContextmenu(e) {
@@ -1473,31 +1666,35 @@ class ce {
1473
1666
  onMouseMoved(e) {
1474
1667
  }
1475
1668
  }
1476
- class pe extends ie {
1477
- constructor(e, t, s, i, o) {
1669
+ class me extends ae {
1670
+ constructor(e, t, i, s, o) {
1671
+ var r;
1478
1672
  if (super(
1479
1673
  e,
1480
1674
  t,
1481
- new j(s),
1482
- i
1483
- ), this.eventListener = o, this.selectionService = new ne(this), this.api = new z(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new ce()), this.tableOptions?.autoRestoreOptions) {
1484
- const r = this.tableOptions.autoRestoreOptions, l = r.getStorageKeyFn;
1485
- l && (r.autoRestoreScrollPosition && (this.storeScrollPosStateService = new U(l)), r.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new Q(l)), r.autoRestoreSortingState && (this.storeSortingService = new Z(l)));
1675
+ new Y(i),
1676
+ s
1677
+ ), this.eventListener = o, this.selectionService = new pe(this), this.api = new J(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new fe()), (r = this.tableOptions) != null && r.autoRestoreOptions) {
1678
+ const n = this.tableOptions.autoRestoreOptions, l = n.getStorageKeyFn;
1679
+ l && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new te(l)), n.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new se(l)), n.autoRestoreSortingState && (this.storeSortingService = new oe(l)));
1486
1680
  }
1487
- this.mouseHandler = new X(this), this.inputHandler = new re(this), this.shortcutService = new he(this), this.shortcutService.addListener(this.selectionService);
1681
+ this.mouseHandler = new U(this), this.inputHandler = new he(this), this.shortcutService = new ge(this), this.shortcutService.addListener(this.selectionService);
1488
1682
  }
1489
1683
  onActionTriggered(e) {
1684
+ 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))
1685
+ return !0;
1490
1686
  if (e === "START_EDITING" && this.getFocusModel) {
1491
1687
  const t = this.getFocusModel();
1492
1688
  if (t) {
1493
- const [s, i] = t.getFocus();
1494
- this.tableModel.getBodyModel().isEditable(s, i) && (this.clearSelection(), this.initRenderEditor(s, i));
1689
+ const [i, s] = t.getFocus();
1690
+ this.tableModel.getBodyModel().isEditable(i, s) && (this.clearSelection(), this.initRenderEditor(i, s));
1495
1691
  }
1692
+ return !0;
1496
1693
  }
1497
1694
  return !1;
1498
1695
  }
1499
- updateModelValue(e, t, s, i) {
1500
- e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, i, this.tableModel) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(P.createSingle(t, s)));
1696
+ updateModelValueAfterEdit(e, t, i, s) {
1697
+ e === "body" && this.tableModel.getAreaModel(e).setValue(t, i, s) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(_.createSingle(t, i)), this.hostElement.focus());
1501
1698
  }
1502
1699
  getApi() {
1503
1700
  return this.api;
@@ -1506,19 +1703,20 @@ class pe extends ie {
1506
1703
  * Called by the table component
1507
1704
  */
1508
1705
  firstInit() {
1509
- this.tableModel.init(), this.autoRestoreCollapsedExpandedState(), this.autoRestoreSortingState(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.autoRestoreScrollPosition();
1706
+ var e;
1707
+ this.tableModel.init(), (e = this.tableOptions) != null && e.externalFilterFunction && this.externalFilterChanged(!1), this.autoRestoreCollapsedExpandedState(), this.autoRestoreSortingState(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.autoRestoreScrollPosition();
1510
1708
  }
1511
1709
  createGeMouseEvent(e) {
1512
- const t = new $();
1710
+ const t = new P();
1513
1711
  if (t.originalEvent = e, e) {
1514
- const s = e.target;
1515
- 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"), e.clientY - this.hostElement.offsetTop - this.areaHeaderCenter.parent.clientHeight, e.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width, t.areaIdent) {
1516
- const i = this.tableModel.getAreaModel(t.areaIdent);
1517
- t.rowTop = i.getYPosByRowIndex(t.rowIndex);
1712
+ const i = e.target;
1713
+ if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(i), t.rowIndex = this.getNumberByAttr(i, "data-row-index"), t.columnIndex = this.getNumberByAttr(i, "data-col-index"), t.action = this.getStringByAttr(i, "data-ge-action"), t.areaIdent) {
1714
+ const s = this.tableModel.getAreaModel(t.areaIdent);
1715
+ t.rowTop = s.getYPosByRowIndex(t.rowIndex);
1518
1716
  }
1519
1717
  if (t.columnLeft = this.tableModel.getXPosByColumnIndex(t.columnIndex), e.ctrlKey && e.altKey) {
1520
- const i = e.clientY - this.hostElement.offsetTop - this.areaHeaderCenter.parent.clientHeight, o = e.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width;
1521
- this.debugOnce(o, i);
1718
+ const s = e.clientY - this.hostElement.offsetTop - this.areaHeaderCenter.parent.clientHeight, o = e.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width;
1719
+ this.debugOnce(o, s);
1522
1720
  }
1523
1721
  }
1524
1722
  return t;
@@ -1532,9 +1730,6 @@ class pe extends ie {
1532
1730
  mouseDraggingEndOnFrame(e) {
1533
1731
  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 = "";
1534
1732
  }
1535
- resizeColumn(e) {
1536
- this.tableModel.setColumnWidth(this.mouseStartColumnIndex, this.mouseStartWidth + e.draggingX), this.tableModel.recalcPadding(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows();
1537
- }
1538
1733
  mouseMove(e) {
1539
1734
  this.eventListener.onMouseMoved(e), this.adjustHoverRows(e), this.adjustHoverColumns(e);
1540
1735
  }
@@ -1542,111 +1737,133 @@ class pe extends ie {
1542
1737
  this.eventListener.onContextmenu(e);
1543
1738
  }
1544
1739
  toggleExpandCollapseAll(e = !0) {
1740
+ var i;
1545
1741
  const t = this.tableModel.getBodyModel();
1546
- t instanceof O && (t.toggleExpandCollapseAll(e), this.repaint(), this.storeStateCollapsedExpandService?.collapsedStateAll(e));
1742
+ t instanceof B && (t.toggleExpandCollapseAll(e), this.repaint(), (i = this.storeStateCollapsedExpandService) == null || i.collapsedStateAll(e));
1547
1743
  }
1548
- toggleRowCheckbox(e, t, s) {
1549
- const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e), r = o === void 0 || o === "semi" || o === "none";
1550
- i.setRowChecked(e, r), this.repaint();
1551
- const l = i.rowSelectionModel?.getCheckedRows();
1552
- this.eventListener.onCheckboxChanged(l || []);
1744
+ toggleRowCheckbox(e, t, i) {
1745
+ var l;
1746
+ const s = this.tableModel.getAreaModel(i), o = s.isRowChecked(e), r = o === void 0 || o === "semi" || o === "none";
1747
+ s.setRowChecked(e, r), this.repaint();
1748
+ const n = (l = s.rowSelectionModel) == null ? void 0 : l.getCheckedRows();
1749
+ this.eventListener.onCheckboxChanged(n || []);
1553
1750
  }
1554
1751
  onMouseClicked(e, t) {
1555
- const s = this.selectionService.onMouseClicked(e, t);
1556
- this.eventListener.onMouseClicked(e), s && this.debounce(this.repaint.bind(this), 10);
1752
+ let i = this.selectionService.onMouseClicked(e, t);
1753
+ if (!i && this.getFocusModel) {
1754
+ const s = this.getFocusModel();
1755
+ s && (i = s.hasChanged(), s.clearChanged(), i && this.resetEditorRenderer());
1756
+ }
1757
+ this.eventListener.onMouseClicked(e), i && this.debounce(this.repaint.bind(this), 10);
1758
+ }
1759
+ externalFilterChanged(e = !0) {
1760
+ const t = this.tableOptions.externalFilterFunction;
1761
+ t && (e && this.clearSelectionModel(), this.tableModel.externalFilterChanged(t), this.scrollViewport.scrollTo(0, 0), this.tableModel.recalcHeightAndPadding(), this.resetSizeOfWrapperDiv(), this.repaint());
1762
+ }
1763
+ onHeaderDblClicked(e, t, i) {
1764
+ var o, r;
1765
+ const s = this.tableModel.getColumnDef(i);
1766
+ if (s != null && s.sortable && s.sortable()) {
1767
+ e.preventDefault(), e.stopPropagation();
1768
+ const n = s.sortStatesOrder ? s.sortStatesOrder : this.tableOptions.sortOrder, l = s.sortState ?? "", a = n[(n.indexOf(l) + 1) % n.length], d = new de(i, a);
1769
+ this.tableModel.doSort([d]) && ((o = this.tableModel.getColumnDefs()) == null || o.forEach((g) => g.sortState = ""), s.sortState = a), this.repaint(), (r = this.storeSortingService) == null || r.setSortItems([d]);
1770
+ }
1557
1771
  }
1558
- externalFilterChanged() {
1559
- const e = this.tableOptions.externalFilterFunction;
1560
- e && (this.clearSelectionModel(), this.tableModel.externalFilterChanged(e), this.repaint());
1561
- }
1562
- onHeaderDblClicked(e, t, s) {
1563
- const i = this.tableModel.getColumnDef(s);
1564
- if (i?.sortable && i.sortable()) {
1565
- e.preventDefault();
1566
- const o = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, r = i.sortState ?? "", l = o[(o.indexOf(r) + 1) % o.length], n = new oe(s, l);
1567
- this.tableModel.doSort([n]) && (this.tableModel.getColumnDefs()?.forEach((h) => h.sortState = ""), i.sortState = l), this.repaint(), this.storeSortingService?.setSortItems([n]);
1772
+ changeFocusCell(e, t) {
1773
+ if (!this.isEditing() && this.getFocusModel) {
1774
+ const i = this.getFocusModel();
1775
+ if (i) {
1776
+ const [s, o] = i.getFocus();
1777
+ return i.setFocus(s + t, o + e), this.repaint(), !0;
1778
+ }
1568
1779
  }
1780
+ return !1;
1569
1781
  }
1570
- onKeyEvent(e) {
1571
- this.keyEvent = e, console.info(this.keyEvent), this.keyEvent.status === "up" && this.keyEvent.originalEvent?.code === "F2" && (this.keyEvent.originalEvent.stopPropagation(), console.info("F2..."));
1782
+ resizeColumn(e) {
1783
+ this.tableModel.setColumnWidth(this.mouseStartColumnIndex, this.mouseStartWidth + e.draggingX), this.tableModel.recalcPadding(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows();
1572
1784
  }
1573
1785
  clearSelectionModel() {
1574
- this.getSelectionModel && this.getSelectionModel()?.clear();
1786
+ var e;
1787
+ this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
1575
1788
  }
1576
1789
  debugOnce(e, t) {
1577
- 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", this.mouseHandler.mouseEvent?.clientX), console.info("this.hostElement.offsetLeft", this.hostElement.offsetLeft), console.info("this.areaBodyWestGeo.width", this.areaBodyWestGeo.width);
1790
+ var i;
1791
+ 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", (i = this.mouseHandler.mouseEvent) == null ? void 0 : i.clientX), console.info("this.hostElement.offsetLeft", this.hostElement.offsetLeft), console.info("this.areaBodyWestGeo.width", this.areaBodyWestGeo.width);
1578
1792
  }
1579
1793
  autoRestoreScrollPosition() {
1580
- if (this.tableOptions?.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
1581
- const t = this.storeScrollPosStateService.getScrollOffset();
1582
- t && this.scrollViewport.scrollTo(...t);
1794
+ var e;
1795
+ if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
1796
+ const i = this.storeScrollPosStateService.getScrollOffset();
1797
+ i && this.scrollViewport.scrollTo(...i);
1583
1798
  }
1584
1799
  }
1585
1800
  autoRestoreSortingState() {
1586
- if (this.tableOptions?.autoRestoreOptions?.autoRestoreSortingState && this.storeSortingService) {
1587
- const e = this.storeSortingService.getSortItems();
1588
- e?.length && this.tableModel.getBodyModel().doSort(e);
1801
+ var e, t;
1802
+ if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
1803
+ const i = this.storeSortingService.getSortItems();
1804
+ i != null && i.length && this.tableModel.getBodyModel().doSort(i);
1589
1805
  }
1590
1806
  }
1591
1807
  autoRestoreCollapsedExpandedState() {
1592
- if (this.tableOptions?.autoRestoreOptions?.getRowId && this.storeStateCollapsedExpandService) {
1593
- const e = this.tableOptions.autoRestoreOptions, t = e.getRowId;
1594
- if (e.autoRestoreCollapsedExpandedState && t) {
1595
- const s = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), i = this.tableModel.getAreaModel("body");
1596
- if (i instanceof O) {
1597
- const o = i, r = i.getRowCount();
1598
- for (let l = 0; l < r; l++) {
1599
- const n = i.getRowByIndex(l);
1600
- if (n)
1601
- if (s.allExpanded)
1602
- n.expanded = !0;
1603
- else if (s.allCollapsed)
1604
- n.expanded = !1;
1808
+ var e, t;
1809
+ if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
1810
+ const i = this.tableOptions.autoRestoreOptions, s = i.getRowId;
1811
+ if (i.autoRestoreCollapsedExpandedState && s) {
1812
+ const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), r = this.tableModel.getAreaModel("body");
1813
+ if (r instanceof B) {
1814
+ const n = r, l = r.getRowCount();
1815
+ for (let a = 0; a < l; a++) {
1816
+ const d = r.getRowByIndex(a);
1817
+ if (d)
1818
+ if (o.allExpanded)
1819
+ d.expanded = !0;
1820
+ else if (o.allCollapsed)
1821
+ d.expanded = !1;
1605
1822
  else {
1606
- const d = t(n.data);
1607
- s.mode === "expanded" ? n.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(d) : s.mode === "collapsed" && (n.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(d));
1823
+ const S = s(d.data);
1824
+ o.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(S) : o.mode === "collapsed" && (d.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(S));
1608
1825
  }
1609
1826
  }
1610
- o.recalcVisibleTreeRows();
1827
+ n.recalcVisibleTreeRows();
1611
1828
  }
1612
1829
  }
1613
1830
  }
1614
1831
  }
1615
1832
  }
1616
- class ue {
1617
- render(e, t, s, i, o, r, l) {
1618
- if (o.isEditable(t, s)) {
1619
- l.addClass(e, "ge-table-row-input-div");
1620
- const n = o.getValueAt(t, s);
1833
+ class be {
1834
+ render(e, t, i, s, o, r, n) {
1835
+ if (o.isEditable(t, i)) {
1836
+ n.addClass(e, "ge-table-row-input-div");
1837
+ const l = o.getValueAt(t, i);
1621
1838
  e.innerHTML = `
1622
1839
  <input
1623
1840
  type="text"
1624
- value="${n}"
1841
+ value="${l}"
1625
1842
  autofocus
1626
1843
  onfocus="this.setSelectionRange(0, this.value.length)"
1627
1844
  data-listen="change"
1628
- data-area="${i}"
1845
+ data-area="${s}"
1629
1846
  data-row-index="${t}"
1630
- data-col-index="${s}"
1847
+ data-col-index="${i}"
1631
1848
  data-input-type="text"
1632
- style="width:100%;height:100%;border:0;padding:0 0 0 8px;"
1849
+ style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
1633
1850
  class="ge-table-cell-editor-input">`;
1634
1851
  }
1635
1852
  }
1636
1853
  }
1637
- class Se {
1854
+ class ye {
1638
1855
  constructor(e = "none", t = "single") {
1639
1856
  this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
1640
1857
  }
1641
1858
  getSelectionCount(e, t) {
1642
- let s = 0;
1643
- for (const i of this.ranges)
1644
- i.isInRange(e, t) && s++;
1645
- return this.allSelected && s++, this.isInNegativeRange(e, t) && (s = 0), s;
1859
+ let i = 0;
1860
+ for (const s of this.ranges)
1861
+ s.isInRange(e, t) && i++;
1862
+ return this.allSelected && i++, this.isInNegativeRange(e, t) && (i = 0), i;
1646
1863
  }
1647
1864
  isInNegativeRange(e, t) {
1648
- for (const s of this.negativeRanges)
1649
- if (s.isInRange(e, t))
1865
+ for (const i of this.negativeRanges)
1866
+ if (i.isInRange(e, t))
1650
1867
  return !0;
1651
1868
  return !1;
1652
1869
  }
@@ -1669,24 +1886,30 @@ class Se {
1669
1886
  if (this.selectionType === "none")
1670
1887
  return;
1671
1888
  let t = e;
1672
- this.selectionType === "row" ? t = w.singleRow(e.r1) : this.selectionType === "column" && (t = w.singleColumn(e.c1)), this.negativeRanges.push(t);
1889
+ this.selectionType === "row" ? t = A.singleRow(e.r1) : this.selectionType === "column" && (t = A.singleColumn(e.c1)), this.negativeRanges.push(t);
1673
1890
  }
1674
1891
  togglePoint(e, t) {
1675
- this.getSelectionCount(e, t) > 0 ? this.removeSelection(w.singleCell(e, t)) : this.addSelection(w.singleCell(e, t));
1892
+ this.getSelectionCount(e, t) > 0 ? this.removeSelection(A.singleCell(e, t)) : this.addSelection(A.singleCell(e, t));
1676
1893
  }
1677
1894
  addRange(e) {
1678
1895
  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));
1679
1896
  }
1680
1897
  }
1681
- class ge {
1898
+ class we {
1682
1899
  constructor(e = "none") {
1683
- this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1;
1900
+ this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
1901
+ }
1902
+ clearChanged() {
1903
+ this.changed = !1;
1904
+ }
1905
+ hasChanged() {
1906
+ return this.changed;
1684
1907
  }
1685
1908
  clear() {
1686
1909
  this.rowIndex = -1, this.columnIndex = -1;
1687
1910
  }
1688
1911
  setFocus(e, t) {
1689
- this.rowIndex = e, this.columnIndex = t;
1912
+ (this.rowIndex !== e || this.columnIndex !== t) && (this.rowIndex = e, this.columnIndex = t, this.changed = !0);
1690
1913
  }
1691
1914
  hasFocus(e, t) {
1692
1915
  return this.rowIndex === e && this.columnIndex === t;
@@ -1695,26 +1918,26 @@ class ge {
1695
1918
  return [this.rowIndex, this.columnIndex];
1696
1919
  }
1697
1920
  }
1698
- const fe = new Se(), me = new ge("cell");
1699
- class be {
1921
+ const ve = new ye(), xe = new we("cell");
1922
+ class Ce {
1700
1923
  constructor() {
1701
- this.overflowX = "auto", this.overflowY = "auto", this.tableTopBorderVisible = !0, this.tableBottomBorderVisible = !0, this.hoverRowVisible = !0, this.hoverColumnVisible = !0, this.columnsResizable = !0, this.columnsDraggable = !0, this.columnResizeHandleWidthInPx = 4, this.defaultRowHeights = {
1924
+ 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 = {
1702
1925
  header: 34,
1703
1926
  body: 34,
1704
1927
  footer: 34
1705
- }, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new H(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new _(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new ue(), this.getSelectionModel = () => fe, this.getFocusModel = () => me;
1928
+ }, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new G(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new N(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new be(), this.getSelectionModel = () => ve, this.getFocusModel = () => xe;
1706
1929
  }
1707
1930
  }
1708
- class ve {
1709
- setStyle(e, t, s) {
1710
- return e.style[t] = s, e;
1931
+ class Ee {
1932
+ setStyle(e, t, i) {
1933
+ return e.style[t] = i, e;
1711
1934
  }
1712
1935
  appendText(e, t) {
1713
- const s = this.createText(t);
1714
- return this.appendChild(e, s), s;
1936
+ const i = this.createText(t);
1937
+ return this.appendChild(e, i), i;
1715
1938
  }
1716
1939
  addClass(e, t) {
1717
- return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.add(s)) : e.classList.add(t), e;
1940
+ return t.includes(" ") ? t.split(" ").forEach((i) => e.classList.add(i)) : e.classList.add(t), e;
1718
1941
  }
1719
1942
  appendChild(e, t) {
1720
1943
  e.appendChild(t);
@@ -1725,63 +1948,63 @@ class ve {
1725
1948
  createText(e) {
1726
1949
  return document.createTextNode(e);
1727
1950
  }
1728
- setAttribute(e, t, s) {
1729
- e.setAttribute(t, s);
1951
+ setAttribute(e, t, i) {
1952
+ e.setAttribute(t, i);
1730
1953
  }
1731
1954
  }
1732
- function Ce({
1733
- tableModel: c,
1734
- tableOptions: e = new be(),
1955
+ function Te({
1956
+ tableModel: p,
1957
+ tableOptions: e = new Ce(),
1735
1958
  mouseMoved: t,
1736
- checkboxChanged: s,
1737
- contextmenu: i,
1959
+ checkboxChanged: i,
1960
+ contextmenu: s,
1738
1961
  modelChanged: o,
1739
1962
  mouseClicked: r,
1740
- mouseDragging: l,
1741
- mouseDraggingEnd: n,
1742
- tableReady: d
1963
+ mouseDragging: n,
1964
+ mouseDraggingEnd: l,
1965
+ tableReady: a
1743
1966
  }) {
1744
- const h = V(null);
1967
+ const d = j(null);
1745
1968
  let S = !1;
1746
- G(() => {
1747
- h.current && !S && (f(h.current), S = !0);
1969
+ X(() => {
1970
+ d.current && !S && (g(d.current), S = !0);
1748
1971
  });
1749
- const f = (p) => {
1750
- const u = {
1751
- onCheckboxChanged: (a) => {
1752
- s && s(a);
1972
+ const g = (f) => {
1973
+ const c = {
1974
+ onCheckboxChanged: (h) => {
1975
+ i && i(h);
1753
1976
  },
1754
- onContextmenu: (a) => {
1755
- i && i(a);
1977
+ onContextmenu: (h) => {
1978
+ s && s(h);
1756
1979
  },
1757
- onModelChanged: (a) => {
1758
- o && o(a);
1980
+ onModelChanged: (h) => {
1981
+ o && o(h);
1759
1982
  },
1760
- onMouseClicked: (a) => {
1761
- r && r(a);
1983
+ onMouseClicked: (h) => {
1984
+ r && r(h);
1762
1985
  },
1763
- onMouseDragging: (a) => {
1764
- l && l(a);
1986
+ onMouseDragging: (h) => {
1987
+ n && n(h);
1765
1988
  },
1766
- onMouseDraggingEnd: (a) => {
1767
- n && n(a);
1989
+ onMouseDraggingEnd: (h) => {
1990
+ l && l(h);
1768
1991
  },
1769
- onMouseMoved: (a) => {
1770
- t && t(a);
1992
+ onMouseMoved: (h) => {
1993
+ t && t(h);
1771
1994
  }
1772
- }, g = new pe(
1995
+ }, b = new me(
1996
+ f,
1773
1997
  p,
1774
- c,
1775
- new ve(),
1998
+ new Ee(),
1776
1999
  e,
1777
- u
2000
+ c
1778
2001
  );
1779
- g.firstInit(), d && d(g.getApi());
2002
+ b.firstInit(), a && a(b.getApi());
1780
2003
  };
1781
- return /* @__PURE__ */ W(
2004
+ return /* @__PURE__ */ z(
1782
2005
  "div",
1783
2006
  {
1784
- ref: h,
2007
+ ref: d,
1785
2008
  className: "container-div",
1786
2009
  style: {
1787
2010
  width: "100%",
@@ -1793,58 +2016,39 @@ function Ce({
1793
2016
  }
1794
2017
  );
1795
2018
  }
1796
- var L, D = N;
2019
+ var $, F = K;
1797
2020
  if (process.env.NODE_ENV === "production")
1798
- L = D.createRoot, D.hydrateRoot;
2021
+ $ = F.createRoot, F.hydrateRoot;
1799
2022
  else {
1800
- var k = D.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
1801
- L = function(c, e) {
2023
+ var k = F.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2024
+ $ = function(p, e) {
1802
2025
  k.usingClientEntryPoint = !0;
1803
2026
  try {
1804
- return D.createRoot(c, e);
2027
+ return F.createRoot(p, e);
1805
2028
  } finally {
1806
2029
  k.usingClientEntryPoint = !1;
1807
2030
  }
1808
2031
  };
1809
2032
  }
1810
- class Ee {
2033
+ class Ie {
1811
2034
  constructor(e) {
1812
2035
  this.Component = e, console.info(e);
1813
2036
  }
1814
- render(e, t, s, i, o, r, l) {
1815
- const n = {
2037
+ render(e, t, i, s, o, r, n) {
2038
+ const l = {
1816
2039
  cellDiv: e,
1817
2040
  rowIndex: t,
1818
- columnIndex: s,
1819
- areaIdent: i,
2041
+ columnIndex: i,
2042
+ areaIdent: s,
1820
2043
  areaModel: o,
1821
2044
  cellValue: r
1822
- }, d = L(e, {});
1823
- return d.render(this.Component(n)), () => {
1824
- d.unmount();
2045
+ }, a = $(e, {});
2046
+ return a.render(this.Component(l)), () => {
2047
+ a.unmount();
1825
2048
  };
1826
2049
  }
1827
- // private mount(
1828
- // component: any,
1829
- // props: (Data & VNodeProps) | null,
1830
- // appContext: AppContext | null,
1831
- // cellDiv: HTMLDivElement
1832
- // ) {
1833
- // let vNode: VNode = createVNode(component, props);
1834
- //
1835
- // vNode.appContext = appContext;
1836
- // render(vNode, cellDiv);
1837
- //
1838
- // const cleanupFn = () => {
1839
- // if (cellDiv) {
1840
- // render(null, cellDiv);
1841
- // }
1842
- // };
1843
- //
1844
- // return cleanupFn;
1845
- // }
1846
2050
  }
1847
2051
  export {
1848
- Ee as ComponentRendererWrapper,
1849
- Ce as ReactTable
2052
+ Ie as ComponentRendererWrapper,
2053
+ Te as GuiexpertTable
1850
2054
  };