@guiexpert/svelte-table 1.0.6 → 1.0.8

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