@guiexpert/svelte-table 1.0.5 → 1.0.7

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