@guiexpert/solid-table 1.0.12 → 1.0.14

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,101 +1,109 @@
1
- const Ce = (l, e) => l === e, q = Symbol("solid-proxy"), de = {
2
- equals: Ce
1
+ const De = (r, e) => r === e, te = Symbol("solid-proxy"), ue = {
2
+ equals: De
3
3
  };
4
- let ue = fe;
5
- const L = 1, k = 2, pe = {
4
+ let me = ve;
5
+ const L = 1, N = 2, ye = {
6
6
  owned: null,
7
7
  cleanups: null,
8
8
  context: null,
9
9
  owner: null
10
10
  };
11
- var A = null;
12
- let Y = null, b = null, x = null, F = null, X = 0;
13
- function xe(l, e) {
14
- const t = b, s = A, i = l.length === 0, o = e === void 0 ? s : e, r = i ? pe : {
11
+ var R = null;
12
+ let Z = null, w = null, M = null, F = null, q = 0;
13
+ function ke(r, e) {
14
+ const t = w, s = R, o = r.length === 0, i = e === void 0 ? s : e, l = o ? ye : {
15
15
  owned: null,
16
16
  cleanups: null,
17
- context: o ? o.context : null,
18
- owner: o
19
- }, n = i ? l : () => l(() => P(() => K(r)));
20
- A = r, b = null;
17
+ context: i ? i.context : null,
18
+ owner: i
19
+ }, n = o ? r : () => r(() => H(() => J(l)));
20
+ R = l, w = null;
21
21
  try {
22
- return H(n, !0);
22
+ return G(n, !0);
23
23
  } finally {
24
- b = t, A = s;
24
+ w = t, R = s;
25
25
  }
26
26
  }
27
- function J(l, e, t) {
28
- const s = te(l, e, !1, L);
27
+ function se(r, e, t) {
28
+ const s = re(r, e, !1, L);
29
29
  W(s);
30
30
  }
31
- function Ee(l, e, t) {
32
- ue = Oe;
33
- const s = te(l, e, !1, L);
31
+ function Oe(r, e, t) {
32
+ me = He;
33
+ const s = re(r, e, !1, L);
34
34
  (!t || !t.render) && (s.user = !0), F ? F.push(s) : W(s);
35
35
  }
36
- function Ae(l, e, t) {
37
- t = t ? Object.assign({}, de, t) : de;
38
- const s = te(l, e, !0, 0);
39
- return s.observers = null, s.observerSlots = null, s.comparator = t.equals || void 0, W(s), Re.bind(s);
36
+ function Ie(r, e, t) {
37
+ t = t ? Object.assign({}, ue, t) : ue;
38
+ const s = re(r, e, !0, 0);
39
+ return s.observers = null, s.observerSlots = null, s.comparator = t.equals || void 0, W(s), Le.bind(s);
40
40
  }
41
- function P(l) {
42
- if (b === null)
43
- return l();
44
- const e = b;
45
- b = null;
41
+ function H(r) {
42
+ if (w === null)
43
+ return r();
44
+ const e = w;
45
+ w = null;
46
46
  try {
47
- return l();
47
+ return r();
48
48
  } finally {
49
- b = e;
49
+ w = e;
50
50
  }
51
51
  }
52
- function Me(l) {
53
- Ee(() => P(l));
52
+ function Fe(r) {
53
+ Oe(() => H(r));
54
54
  }
55
- function Re() {
55
+ function Le() {
56
56
  if (this.sources && this.state)
57
57
  if (this.state === L)
58
58
  W(this);
59
59
  else {
60
- const l = x;
61
- x = null, H(() => N(this), !1), x = l;
60
+ const r = M;
61
+ M = null, G(() => j(this), !1), M = r;
62
62
  }
63
- if (b) {
64
- const l = this.observers ? this.observers.length : 0;
65
- b.sources ? (b.sources.push(this), b.sourceSlots.push(l)) : (b.sources = [this], b.sourceSlots = [l]), this.observers ? (this.observers.push(b), this.observerSlots.push(b.sources.length - 1)) : (this.observers = [b], this.observerSlots = [b.sources.length - 1]);
63
+ if (w) {
64
+ const r = this.observers ? this.observers.length : 0;
65
+ w.sources ? (w.sources.push(this), w.sourceSlots.push(r)) : (w.sources = [this], w.sourceSlots = [r]), this.observers ? (this.observers.push(w), this.observerSlots.push(w.sources.length - 1)) : (this.observers = [w], this.observerSlots = [w.sources.length - 1]);
66
66
  }
67
67
  return this.value;
68
68
  }
69
- function Te(l, e, t) {
70
- let s = l.value;
71
- return (!l.comparator || !l.comparator(s, e)) && (l.value = e, l.observers && l.observers.length && H(() => {
72
- for (let i = 0; i < l.observers.length; i += 1) {
73
- const o = l.observers[i], r = Y && Y.running;
74
- r && Y.disposed.has(o), (r ? !o.tState : !o.state) && (o.pure ? x.push(o) : F.push(o), o.observers && Se(o)), r || (o.state = L);
69
+ function $e(r, e, t) {
70
+ let s = r.value;
71
+ return (!r.comparator || !r.comparator(s, e)) && (r.value = e, r.observers && r.observers.length && G(() => {
72
+ for (let o = 0; o < r.observers.length; o += 1) {
73
+ const i = r.observers[o], l = Z && Z.running;
74
+ l && Z.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ? M.push(i) : F.push(i), i.observers && we(i)), l || (i.state = L);
75
75
  }
76
- if (x.length > 1e6)
77
- throw x = [], new Error();
76
+ if (M.length > 1e6)
77
+ throw M = [], new Error();
78
78
  }, !1)), e;
79
79
  }
80
- function W(l) {
81
- if (!l.fn)
80
+ function W(r) {
81
+ if (!r.fn)
82
82
  return;
83
- K(l);
84
- const e = A, t = b, s = X;
85
- b = A = l, De(l, l.value, s), b = t, A = e;
86
- }
87
- function De(l, e, t) {
83
+ J(r);
84
+ const e = q;
85
+ Be(
86
+ r,
87
+ r.value,
88
+ e
89
+ );
90
+ }
91
+ function Be(r, e, t) {
88
92
  let s;
93
+ const o = R, i = w;
94
+ w = R = r;
89
95
  try {
90
- s = l.fn(e);
91
- } catch (i) {
92
- return l.pure && (l.state = L, l.owned && l.owned.forEach(K), l.owned = null), l.updatedAt = t + 1, ge(i);
96
+ s = r.fn(e);
97
+ } catch (l) {
98
+ return r.pure && (r.state = L, r.owned && r.owned.forEach(J), r.owned = null), r.updatedAt = t + 1, Ce(l);
99
+ } finally {
100
+ w = i, R = o;
93
101
  }
94
- (!l.updatedAt || l.updatedAt <= t) && (l.updatedAt != null && "observers" in l ? Te(l, s) : l.value = s, l.updatedAt = t);
102
+ (!r.updatedAt || r.updatedAt <= t) && (r.updatedAt != null && "observers" in r ? $e(r, s) : r.value = s, r.updatedAt = t);
95
103
  }
96
- function te(l, e, t, s = L, i) {
97
- const o = {
98
- fn: l,
104
+ function re(r, e, t, s = L, o) {
105
+ const i = {
106
+ fn: r,
99
107
  state: s,
100
108
  updatedAt: null,
101
109
  owned: null,
@@ -103,388 +111,420 @@ function te(l, e, t, s = L, i) {
103
111
  sourceSlots: null,
104
112
  cleanups: null,
105
113
  value: e,
106
- owner: A,
107
- context: A ? A.context : null,
114
+ owner: R,
115
+ context: R ? R.context : null,
108
116
  pure: t
109
117
  };
110
- return A === null || A !== pe && (A.owned ? A.owned.push(o) : A.owned = [o]), o;
118
+ return R === null || R !== ye && (R.owned ? R.owned.push(i) : R.owned = [i]), i;
111
119
  }
112
- function G(l) {
113
- if (l.state === 0)
120
+ function z(r) {
121
+ if (r.state === 0)
114
122
  return;
115
- if (l.state === k)
116
- return N(l);
117
- if (l.suspense && P(l.suspense.inFallback))
118
- return l.suspense.effects.push(l);
119
- const e = [l];
120
- for (; (l = l.owner) && (!l.updatedAt || l.updatedAt < X); )
121
- l.state && e.push(l);
123
+ if (r.state === N)
124
+ return j(r);
125
+ if (r.suspense && H(r.suspense.inFallback))
126
+ return r.suspense.effects.push(r);
127
+ const e = [r];
128
+ for (; (r = r.owner) && (!r.updatedAt || r.updatedAt < q); )
129
+ r.state && e.push(r);
122
130
  for (let t = e.length - 1; t >= 0; t--)
123
- if (l = e[t], l.state === L)
124
- W(l);
125
- else if (l.state === k) {
126
- const s = x;
127
- x = null, H(() => N(l, e[0]), !1), x = s;
131
+ if (r = e[t], r.state === L)
132
+ W(r);
133
+ else if (r.state === N) {
134
+ const s = M;
135
+ M = null, G(() => j(r, e[0]), !1), M = s;
128
136
  }
129
137
  }
130
- function H(l, e) {
131
- if (x)
132
- return l();
138
+ function G(r, e) {
139
+ if (M)
140
+ return r();
133
141
  let t = !1;
134
- e || (x = []), F ? t = !0 : F = [], X++;
142
+ e || (M = []), F ? t = !0 : F = [], q++;
135
143
  try {
136
- const s = l();
137
- return Ie(t), s;
144
+ const s = r();
145
+ return Pe(t), s;
138
146
  } catch (s) {
139
- t || (F = null), x = null, ge(s);
147
+ t || (F = null), M = null, Ce(s);
140
148
  }
141
149
  }
142
- function Ie(l) {
143
- if (x && (fe(x), x = null), l)
150
+ function Pe(r) {
151
+ if (M && (ve(M), M = null), r)
144
152
  return;
145
153
  const e = F;
146
- F = null, e.length && H(() => ue(e), !1);
154
+ F = null, e.length && G(() => me(e), !1);
147
155
  }
148
- function fe(l) {
149
- for (let e = 0; e < l.length; e++)
150
- G(l[e]);
156
+ function ve(r) {
157
+ for (let e = 0; e < r.length; e++)
158
+ z(r[e]);
151
159
  }
152
- function Oe(l) {
160
+ function He(r) {
153
161
  let e, t = 0;
154
- for (e = 0; e < l.length; e++) {
155
- const s = l[e];
156
- s.user ? l[t++] = s : G(s);
162
+ for (e = 0; e < r.length; e++) {
163
+ const s = r[e];
164
+ s.user ? r[t++] = s : z(s);
157
165
  }
158
166
  for (e = 0; e < t; e++)
159
- G(l[e]);
167
+ z(r[e]);
160
168
  }
161
- function N(l, e) {
162
- l.state = 0;
163
- for (let t = 0; t < l.sources.length; t += 1) {
164
- const s = l.sources[t];
169
+ function j(r, e) {
170
+ r.state = 0;
171
+ for (let t = 0; t < r.sources.length; t += 1) {
172
+ const s = r.sources[t];
165
173
  if (s.sources) {
166
- const i = s.state;
167
- i === L ? s !== e && (!s.updatedAt || s.updatedAt < X) && G(s) : i === k && N(s, e);
174
+ const o = s.state;
175
+ o === L ? s !== e && (!s.updatedAt || s.updatedAt < q) && z(s) : o === N && j(s, e);
168
176
  }
169
177
  }
170
178
  }
171
- function Se(l) {
172
- for (let e = 0; e < l.observers.length; e += 1) {
173
- const t = l.observers[e];
174
- t.state || (t.state = k, t.pure ? x.push(t) : F.push(t), t.observers && Se(t));
179
+ function we(r) {
180
+ for (let e = 0; e < r.observers.length; e += 1) {
181
+ const t = r.observers[e];
182
+ t.state || (t.state = N, t.pure ? M.push(t) : F.push(t), t.observers && we(t));
175
183
  }
176
184
  }
177
- function K(l) {
185
+ function J(r) {
178
186
  let e;
179
- if (l.sources)
180
- for (; l.sources.length; ) {
181
- const t = l.sources.pop(), s = l.sourceSlots.pop(), i = t.observers;
182
- if (i && i.length) {
183
- const o = i.pop(), r = t.observerSlots.pop();
184
- s < i.length && (o.sourceSlots[r] = s, i[s] = o, t.observerSlots[s] = r);
187
+ if (r.sources)
188
+ for (; r.sources.length; ) {
189
+ const t = r.sources.pop(), s = r.sourceSlots.pop(), o = t.observers;
190
+ if (o && o.length) {
191
+ const i = o.pop(), l = t.observerSlots.pop();
192
+ s < o.length && (i.sourceSlots[l] = s, o[s] = i, t.observerSlots[s] = l);
185
193
  }
186
194
  }
187
- if (l.owned) {
188
- for (e = l.owned.length - 1; e >= 0; e--)
189
- K(l.owned[e]);
190
- l.owned = null;
195
+ if (r.owned) {
196
+ for (e = r.owned.length - 1; e >= 0; e--)
197
+ J(r.owned[e]);
198
+ r.owned = null;
191
199
  }
192
- if (l.cleanups) {
193
- for (e = l.cleanups.length - 1; e >= 0; e--)
194
- l.cleanups[e]();
195
- l.cleanups = null;
200
+ if (r.cleanups) {
201
+ for (e = r.cleanups.length - 1; e >= 0; e--)
202
+ r.cleanups[e]();
203
+ r.cleanups = null;
196
204
  }
197
- l.state = 0;
205
+ r.state = 0;
198
206
  }
199
- function Fe(l) {
200
- return l instanceof Error ? l : new Error(typeof l == "string" ? l : "Unknown error", {
201
- cause: l
207
+ function We(r) {
208
+ return r instanceof Error ? r : new Error(typeof r == "string" ? r : "Unknown error", {
209
+ cause: r
202
210
  });
203
211
  }
204
- function ge(l, e = A) {
205
- throw Fe(l);
212
+ function Ce(r, e = R) {
213
+ throw We(r);
206
214
  }
207
- function _() {
215
+ function V() {
208
216
  return !0;
209
217
  }
210
- const Le = {
211
- get(l, e, t) {
212
- return e === q ? t : l.get(e);
218
+ const Ge = {
219
+ get(r, e, t) {
220
+ return e === te ? t : r.get(e);
213
221
  },
214
- has(l, e) {
215
- return e === q ? !0 : l.has(e);
222
+ has(r, e) {
223
+ return e === te ? !0 : r.has(e);
216
224
  },
217
- set: _,
218
- deleteProperty: _,
219
- getOwnPropertyDescriptor(l, e) {
225
+ set: V,
226
+ deleteProperty: V,
227
+ getOwnPropertyDescriptor(r, e) {
220
228
  return {
221
229
  configurable: !0,
222
230
  enumerable: !0,
223
231
  get() {
224
- return l.get(e);
232
+ return r.get(e);
225
233
  },
226
- set: _,
227
- deleteProperty: _
234
+ set: V,
235
+ deleteProperty: V
228
236
  };
229
237
  },
230
- ownKeys(l) {
231
- return l.keys();
238
+ ownKeys(r) {
239
+ return r.keys();
232
240
  }
233
241
  };
234
- function U(l) {
235
- return (l = typeof l == "function" ? l() : l) ? l : {};
242
+ function ee(r) {
243
+ return (r = typeof r == "function" ? r() : r) ? r : {};
236
244
  }
237
- function $e() {
238
- for (let l = 0, e = this.length; l < e; ++l) {
239
- const t = this[l]();
245
+ function _e() {
246
+ for (let r = 0, e = this.length; r < e; ++r) {
247
+ const t = this[r]();
240
248
  if (t !== void 0)
241
249
  return t;
242
250
  }
243
251
  }
244
- function me(...l) {
252
+ function xe(...r) {
245
253
  let e = !1;
246
- for (let o = 0; o < l.length; o++) {
247
- const r = l[o];
248
- e = e || !!r && q in r, l[o] = typeof r == "function" ? (e = !0, Ae(r)) : r;
254
+ for (let i = 0; i < r.length; i++) {
255
+ const l = r[i];
256
+ e = e || !!l && te in l, r[i] = typeof l == "function" ? (e = !0, Ie(l)) : l;
249
257
  }
250
258
  if (e)
251
- return new Proxy({
252
- get(o) {
253
- for (let r = l.length - 1; r >= 0; r--) {
254
- const n = U(l[r])[o];
255
- if (n !== void 0)
256
- return n;
259
+ return new Proxy(
260
+ {
261
+ get(i) {
262
+ for (let l = r.length - 1; l >= 0; l--) {
263
+ const n = ee(r[l])[i];
264
+ if (n !== void 0)
265
+ return n;
266
+ }
267
+ },
268
+ has(i) {
269
+ for (let l = r.length - 1; l >= 0; l--)
270
+ if (i in ee(r[l]))
271
+ return !0;
272
+ return !1;
273
+ },
274
+ keys() {
275
+ const i = [];
276
+ for (let l = 0; l < r.length; l++)
277
+ i.push(...Object.keys(ee(r[l])));
278
+ return [...new Set(i)];
257
279
  }
258
280
  },
259
- has(o) {
260
- for (let r = l.length - 1; r >= 0; r--)
261
- if (o in U(l[r]))
262
- return !0;
263
- return !1;
264
- },
265
- keys() {
266
- const o = [];
267
- for (let r = 0; r < l.length; r++)
268
- o.push(...Object.keys(U(l[r])));
269
- return [...new Set(o)];
270
- }
271
- }, Le);
272
- const t = {}, s = {}, i = /* @__PURE__ */ new Set();
273
- for (let o = l.length - 1; o >= 0; o--) {
274
- const r = l[o];
275
- if (!r)
281
+ Ge
282
+ );
283
+ const t = {}, s = {}, o = /* @__PURE__ */ new Set();
284
+ for (let i = r.length - 1; i >= 0; i--) {
285
+ const l = r[i];
286
+ if (!l)
276
287
  continue;
277
- const n = Object.getOwnPropertyNames(r);
278
- for (let a = 0, h = n.length; a < h; a++) {
288
+ const n = Object.getOwnPropertyNames(l);
289
+ for (let a = 0, c = n.length; a < c; a++) {
279
290
  const d = n[a];
280
291
  if (d === "__proto__" || d === "constructor")
281
292
  continue;
282
- const c = Object.getOwnPropertyDescriptor(r, d);
283
- if (!i.has(d))
284
- c.get ? (i.add(d), Object.defineProperty(t, d, {
293
+ const h = Object.getOwnPropertyDescriptor(l, d);
294
+ if (!o.has(d))
295
+ h.get ? (o.add(d), Object.defineProperty(t, d, {
285
296
  enumerable: !0,
286
297
  configurable: !0,
287
- get: $e.bind(s[d] = [c.get.bind(r)])
288
- })) : (c.value !== void 0 && i.add(d), t[d] = c.value);
298
+ get: _e.bind(s[d] = [h.get.bind(l)])
299
+ })) : (h.value !== void 0 && o.add(d), t[d] = h.value);
289
300
  else {
290
- const p = s[d];
291
- p ? c.get ? p.push(c.get.bind(r)) : c.value !== void 0 && p.push(() => c.value) : t[d] === void 0 && (t[d] = c.value);
301
+ const g = s[d];
302
+ g ? h.get ? g.push(h.get.bind(l)) : h.value !== void 0 && g.push(() => h.value) : t[d] === void 0 && (t[d] = h.value);
292
303
  }
293
304
  }
294
305
  }
295
306
  return t;
296
307
  }
297
- function Be(l, e, t) {
298
- let s = t.length, i = e.length, o = s, r = 0, n = 0, a = e[i - 1].nextSibling, h = null;
299
- for (; r < i || n < o; ) {
300
- if (e[r] === t[n]) {
301
- r++, n++;
308
+ function Ve(r, e, t) {
309
+ let s = t.length, o = e.length, i = s, l = 0, n = 0, a = e[o - 1].nextSibling, c = null;
310
+ for (; l < o || n < i; ) {
311
+ if (e[l] === t[n]) {
312
+ l++, n++;
302
313
  continue;
303
314
  }
304
- for (; e[i - 1] === t[o - 1]; )
305
- i--, o--;
306
- if (i === r) {
307
- const d = o < s ? n ? t[n - 1].nextSibling : t[o - n] : a;
308
- for (; n < o; )
309
- l.insertBefore(t[n++], d);
310
- } else if (o === n)
311
- for (; r < i; )
312
- (!h || !h.has(e[r])) && e[r].remove(), r++;
313
- else if (e[r] === t[o - 1] && t[n] === e[i - 1]) {
314
- const d = e[--i].nextSibling;
315
- l.insertBefore(t[n++], e[r++].nextSibling), l.insertBefore(t[--o], d), e[i] = t[o];
315
+ for (; e[o - 1] === t[i - 1]; )
316
+ o--, i--;
317
+ if (o === l) {
318
+ const d = i < s ? n ? t[n - 1].nextSibling : t[i - n] : a;
319
+ for (; n < i; )
320
+ r.insertBefore(t[n++], d);
321
+ } else if (i === n)
322
+ for (; l < o; )
323
+ (!c || !c.has(e[l])) && e[l].remove(), l++;
324
+ else if (e[l] === t[i - 1] && t[n] === e[o - 1]) {
325
+ const d = e[--o].nextSibling;
326
+ r.insertBefore(t[n++], e[l++].nextSibling), r.insertBefore(t[--i], d), e[o] = t[i];
316
327
  } else {
317
- if (!h) {
318
- h = /* @__PURE__ */ new Map();
319
- let c = n;
320
- for (; c < o; )
321
- h.set(t[c], c++);
328
+ if (!c) {
329
+ c = /* @__PURE__ */ new Map();
330
+ let h = n;
331
+ for (; h < i; )
332
+ c.set(t[h], h++);
322
333
  }
323
- const d = h.get(e[r]);
334
+ const d = c.get(e[l]);
324
335
  if (d != null)
325
- if (n < d && d < o) {
326
- let c = r, p = 1, g;
327
- for (; ++c < i && c < o && !((g = h.get(e[c])) == null || g !== d + p); )
328
- p++;
329
- if (p > d - n) {
330
- const u = e[r];
336
+ if (n < d && d < i) {
337
+ let h = l, g = 1, f;
338
+ for (; ++h < o && h < i && !((f = c.get(e[h])) == null || f !== d + g); )
339
+ g++;
340
+ if (g > d - n) {
341
+ const b = e[l];
331
342
  for (; n < d; )
332
- l.insertBefore(t[n++], u);
343
+ r.insertBefore(t[n++], b);
333
344
  } else
334
- l.replaceChild(t[n++], e[r++]);
345
+ r.replaceChild(t[n++], e[l++]);
335
346
  } else
336
- r++;
347
+ l++;
337
348
  else
338
- e[r++].remove();
349
+ e[l++].remove();
339
350
  }
340
351
  }
341
352
  }
342
- function Pe(l, e, t, s = {}) {
343
- let i;
344
- return xe((o) => {
345
- i = o, e === document ? l() : Ve(e, l(), e.firstChild ? null : void 0, t);
353
+ function Ne(r, e, t, s = {}) {
354
+ let o;
355
+ return ke((i) => {
356
+ o = i, e === document ? r() : Xe(e, r(), e.firstChild ? null : void 0, t);
346
357
  }, s.owner), () => {
347
- i(), e.textContent = "";
358
+ o(), e.textContent = "";
348
359
  };
349
360
  }
350
- function We(l, e, t) {
361
+ function ze(r, e, t) {
351
362
  let s;
352
- const i = () => {
353
- const r = document.createElement("template");
354
- return r.innerHTML = l, t ? r.content.firstChild.firstChild : r.content.firstChild;
355
- }, o = e ? () => P(() => document.importNode(s || (s = i()), !0)) : () => (s || (s = i())).cloneNode(!0);
356
- return o.cloneNode = o, o;
363
+ const o = () => {
364
+ const l = document.createElement("template");
365
+ return l.innerHTML = r, t ? l.content.firstChild.firstChild : l.content.firstChild;
366
+ }, i = e ? () => H(() => document.importNode(s || (s = o()), !0)) : () => (s || (s = o())).cloneNode(!0);
367
+ return i.cloneNode = i, i;
357
368
  }
358
- function He(l, e, t) {
359
- return P(() => l(e, t));
369
+ function je(r, e, t) {
370
+ return H(() => r(e, t));
360
371
  }
361
- function Ve(l, e, t, s) {
372
+ function Xe(r, e, t, s) {
362
373
  if (t !== void 0 && !s && (s = []), typeof e != "function")
363
- return j(l, e, s, t);
364
- J((i) => j(l, e(), i, t), s);
374
+ return X(r, e, s, t);
375
+ se((o) => X(r, e(), o, t), s);
365
376
  }
366
- function j(l, e, t, s, i) {
377
+ function X(r, e, t, s, o) {
367
378
  for (; typeof t == "function"; )
368
379
  t = t();
369
380
  if (e === t)
370
381
  return t;
371
- const o = typeof e, r = s !== void 0;
372
- if (l = r && t[0] && t[0].parentNode || l, o === "string" || o === "number")
373
- if (o === "number" && (e = e.toString()), r) {
382
+ const i = typeof e, l = s !== void 0;
383
+ if (r = l && t[0] && t[0].parentNode || r, i === "string" || i === "number")
384
+ if (i === "number" && (e = e.toString()), l) {
374
385
  let n = t[0];
375
- n && n.nodeType === 3 ? n.data = e : n = document.createTextNode(e), t = B(l, t, s, n);
386
+ n && n.nodeType === 3 ? n.data = e : n = document.createTextNode(e), t = B(r, t, s, n);
376
387
  } else
377
- t !== "" && typeof t == "string" ? t = l.firstChild.data = e : t = l.textContent = e;
378
- else if (e == null || o === "boolean")
379
- t = B(l, t, s);
388
+ t !== "" && typeof t == "string" ? t = r.firstChild.data = e : t = r.textContent = e;
389
+ else if (e == null || i === "boolean")
390
+ t = B(r, t, s);
380
391
  else {
381
- if (o === "function")
382
- return J(() => {
392
+ if (i === "function")
393
+ return se(() => {
383
394
  let n = e();
384
395
  for (; typeof n == "function"; )
385
396
  n = n();
386
- t = j(l, n, t, s);
397
+ t = X(r, n, t, s);
387
398
  }), () => t;
388
399
  if (Array.isArray(e)) {
389
400
  const n = [], a = t && Array.isArray(t);
390
- if (Q(n, e, t, i))
391
- return J(() => t = j(l, n, t, s, !0)), () => t;
401
+ if (oe(n, e, t, o))
402
+ return se(() => t = X(r, n, t, s, !0)), () => t;
392
403
  if (n.length === 0) {
393
- if (t = B(l, t, s), r)
404
+ if (t = B(r, t, s), l)
394
405
  return t;
395
406
  } else
396
- a ? t.length === 0 ? he(l, n, s) : Be(l, t, n) : (t && B(l), he(l, n));
407
+ a ? t.length === 0 ? pe(r, n, s) : Ve(r, t, n) : (t && B(r), pe(r, n));
397
408
  t = n;
398
409
  } else if (e.nodeType) {
399
410
  if (Array.isArray(t)) {
400
- if (r)
401
- return t = B(l, t, s, e);
402
- B(l, t, null, e);
411
+ if (l)
412
+ return t = B(r, t, s, e);
413
+ B(r, t, null, e);
403
414
  } else
404
- t == null || t === "" || !l.firstChild ? l.appendChild(e) : l.replaceChild(e, l.firstChild);
415
+ t == null || t === "" || !r.firstChild ? r.appendChild(e) : r.replaceChild(e, r.firstChild);
405
416
  t = e;
406
417
  }
407
418
  }
408
419
  return t;
409
420
  }
410
- function Q(l, e, t, s) {
411
- let i = !1;
412
- for (let o = 0, r = e.length; o < r; o++) {
413
- let n = e[o], a = t && t[o], h;
421
+ function oe(r, e, t, s) {
422
+ let o = !1;
423
+ for (let i = 0, l = e.length; i < l; i++) {
424
+ let n = e[i], a = t && t[i], c;
414
425
  if (!(n == null || n === !0 || n === !1))
415
- if ((h = typeof n) == "object" && n.nodeType)
416
- l.push(n);
426
+ if ((c = typeof n) == "object" && n.nodeType)
427
+ r.push(n);
417
428
  else if (Array.isArray(n))
418
- i = Q(l, n, a) || i;
419
- else if (h === "function")
429
+ o = oe(r, n, a) || o;
430
+ else if (c === "function")
420
431
  if (s) {
421
432
  for (; typeof n == "function"; )
422
433
  n = n();
423
- i = Q(l, Array.isArray(n) ? n : [n], Array.isArray(a) ? a : [a]) || i;
434
+ o = oe(
435
+ r,
436
+ Array.isArray(n) ? n : [n],
437
+ Array.isArray(a) ? a : [a]
438
+ ) || o;
424
439
  } else
425
- l.push(n), i = !0;
440
+ r.push(n), o = !0;
426
441
  else {
427
442
  const d = String(n);
428
- a && a.nodeType === 3 && a.data === d ? l.push(a) : l.push(document.createTextNode(d));
443
+ a && a.nodeType === 3 && a.data === d ? r.push(a) : r.push(document.createTextNode(d));
429
444
  }
430
445
  }
431
- return i;
446
+ return o;
432
447
  }
433
- function he(l, e, t = null) {
434
- for (let s = 0, i = e.length; s < i; s++)
435
- l.insertBefore(e[s], t);
448
+ function pe(r, e, t = null) {
449
+ for (let s = 0, o = e.length; s < o; s++)
450
+ r.insertBefore(e[s], t);
436
451
  }
437
- function B(l, e, t, s) {
452
+ function B(r, e, t, s) {
438
453
  if (t === void 0)
439
- return l.textContent = "";
440
- const i = s || document.createTextNode("");
454
+ return r.textContent = "";
455
+ const o = s || document.createTextNode("");
441
456
  if (e.length) {
442
- let o = !1;
443
- for (let r = e.length - 1; r >= 0; r--) {
444
- const n = e[r];
445
- if (i !== n) {
446
- const a = n.parentNode === l;
447
- !o && !r ? a ? l.replaceChild(i, n) : l.insertBefore(i, t) : a && n.remove();
457
+ let i = !1;
458
+ for (let l = e.length - 1; l >= 0; l--) {
459
+ const n = e[l];
460
+ if (o !== n) {
461
+ const a = n.parentNode === r;
462
+ !i && !l ? a ? r.replaceChild(o, n) : r.insertBefore(o, t) : a && n.remove();
448
463
  } else
449
- o = !0;
464
+ i = !0;
450
465
  }
451
466
  } else
452
- l.insertBefore(i, t);
453
- return [i];
467
+ r.insertBefore(o, t);
468
+ return [o];
454
469
  }
455
- class ct {
470
+ class mt {
456
471
  constructor(e) {
457
472
  this.code = e;
458
473
  }
459
- render(e, t, s, i, o, r, n) {
460
- const a = me({
474
+ render(e, t, s, o, i, l, n) {
475
+ const a = xe({
461
476
  rowIndex: t,
462
477
  columnIndex: s,
463
- areaIdent: i,
464
- areaModel: o,
465
- cellValue: r
478
+ areaIdent: o,
479
+ areaModel: i,
480
+ cellValue: l
466
481
  });
467
- Pe(
482
+ Ne(
468
483
  () => this.code(a),
469
484
  e
470
485
  );
471
486
  }
472
487
  }
473
- const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
488
+ const yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
474
489
  __proto__: null
475
490
  }, Symbol.toStringTag, { value: "Module" }));
476
- function Z(l) {
477
- return l && l.type === "TreeRow";
491
+ class $ {
492
+ // The constructor is private to prevent direct construction calls
493
+ // with the `new` operator
494
+ constructor() {
495
+ this.alreadySet = !1;
496
+ }
497
+ static getInstance() {
498
+ return $.instance || ($.instance = new $()), $.instance;
499
+ }
500
+ /**
501
+ * Method to set the license key for the application.
502
+ * A 'meta' element is created with content as 'guiexperttable=<license key>'
503
+ * and appended into the head section of the document
504
+ *
505
+ * @param {string} key - The license key to set for the application.
506
+ *
507
+ * @return {void} - This method does not return anything
508
+ */
509
+ setLicenseKey(e) {
510
+ if (e && !this.alreadySet) {
511
+ const t = document.createElement("meta");
512
+ t.content = "license=" + e, t.name = "guiexperttable", document.getElementsByTagName("head")[0].appendChild(t), this.alreadySet = !0;
513
+ }
514
+ }
478
515
  }
479
- function ee(l) {
480
- return l && l.type === "AreaModelTree";
516
+ function ie(r) {
517
+ return r && r.type === "TreeRow";
481
518
  }
482
- class se {
483
- constructor(e = -1, t = -1, s = -1, i = -1, o, r, n, a = 0, h = 0, d = 0, c = "") {
484
- this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = i, this.areaIdent = o, this.sideIdent = r, this.originalEvent = n, this.clickCount = a, this.draggingX = h, this.draggingY = d, this.action = c;
519
+ function le(r) {
520
+ return r && r.type === "AreaModelTree";
521
+ }
522
+ class ne {
523
+ constructor(e = -1, t = -1, s = -1, o = -1, i, l, n, a = 0, c = 0, d = 0, h = "") {
524
+ this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = o, this.areaIdent = i, this.sideIdent = l, this.originalEvent = n, this.clickCount = a, this.draggingX = c, this.draggingY = d, this.action = h;
485
525
  }
486
526
  clone() {
487
- return new se(
527
+ return new ne(
488
528
  this.rowIndex,
489
529
  this.rowTop,
490
530
  this.columnIndex,
@@ -499,38 +539,38 @@ class se {
499
539
  );
500
540
  }
501
541
  }
502
- class $ {
542
+ class I {
503
543
  constructor(e = ">", t = "", s = []) {
504
544
  this.content = e, this.style = t, this.classes = s;
505
545
  }
506
546
  }
507
- class be {
508
- constructor(e = new $(
547
+ class Ee {
548
+ constructor(e = new I(
509
549
  ">",
510
550
  "transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
511
551
  ["gt-table-tree-arrow-expanded"]
512
- ), t = new $(
552
+ ), t = new I(
513
553
  ">",
514
554
  "",
515
555
  ["ge-table-tree-arrow-collapsed"]
516
- ), s = new $(
556
+ ), s = new I(
517
557
  ">",
518
558
  "color:transparent;",
519
559
  ["gt-table-tree-arrow-hidden"]
520
- ), i = new $(
560
+ ), o = new I(
521
561
  "↕",
522
562
  "",
523
563
  ["gt-table-tree-arrow-expanded-all"]
524
564
  )) {
525
- this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = i;
565
+ this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = o;
526
566
  }
527
567
  }
528
- class ye {
529
- constructor(e = new $("↑", "", ["ge-header-sorted-asc"]), t = new $("↓", "", ["ge-header-sorted-desc"]), s = new $("↑", "color:transparent;", [])) {
568
+ class Ae {
569
+ constructor(e = new I("↑", "", ["ge-header-sorted-asc"]), t = new I("↓", "", ["ge-header-sorted-desc"]), s = new I("↑", "color:transparent;", [])) {
530
570
  this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
531
571
  }
532
572
  }
533
- class _e {
573
+ class Ke {
534
574
  constructor(e) {
535
575
  this.domService = e;
536
576
  }
@@ -549,7 +589,7 @@ class _e {
549
589
  return this.domService.setStyle(e, "display", "block"), e;
550
590
  }
551
591
  applyStyleInPx(e, t) {
552
- return Object.entries(t).forEach(([s, i]) => this.domService.setStyle(e, s, i + "px")), e;
592
+ return Object.entries(t).forEach(([s, o]) => this.domService.setStyle(e, s, o + "px")), e;
553
593
  }
554
594
  applyStylePosistionRelative(e) {
555
595
  return this.domService.setStyle(e, "position", "relative"), this.domService.setStyle(e, "overflow", "clip"), e;
@@ -595,115 +635,116 @@ class _e {
595
635
  setAttribute(e, t, s) {
596
636
  return t && s && this.domService.setAttribute(e, t, s), e;
597
637
  }
598
- createAreaDivWithClass(e, t, s, i) {
599
- const o = this.domService.createElement("div");
600
- 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;
638
+ createAreaDivWithClass(e, t, s, o) {
639
+ const i = this.domService.createElement("div");
640
+ return this.addClass(e, i), this.domService.setAttribute(i, "data-area", s), this.domService.setAttribute(i, "data-side", o), this.domService.appendChild(t, i), i;
601
641
  }
602
642
  createDivWithClass(e, t) {
603
643
  const s = this.domService.createElement("div");
604
644
  return this.addClass(e, s), this.domService.appendChild(t, s), s;
605
645
  }
606
- addRowDiv(e, t, s = -1, i, o, r = "") {
646
+ addRowDiv(e, t, s = -1, o, i, l = "") {
607
647
  const n = t.index ?? -1, a = this.getDivOrCreateDiv(n, e);
608
- if (this.domService.addClass(a, "ge-table-row-div"), this.domService.addClass(a, `ge-table-row-div-${t.index}`), i === "body" && o === "center") {
609
- const h = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
610
- this.domService.addClass(a, `ge-table-row-${h}`);
648
+ if (this.domService.addClass(a, "ge-table-row-div"), this.domService.addClass(a, `ge-table-row-div-${t.index}`), o === "body" && i === "center") {
649
+ const c = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
650
+ this.domService.addClass(a, `ge-table-row-${c}`);
611
651
  }
612
- if (this.domService.setStyle(a, "display", "clip"), this.domService.setStyle(a, "position", "absolute"), this.domService.setStyle(a, "left", `${t.left}px`), this.domService.setStyle(a, "top", `${t.top}px`), this.domService.setStyle(a, "width", `${t.width}px`), this.domService.setStyle(a, "height", `${t.height}px`), this.domService.setAttribute(a, "data-row-index", `${s}`), this.domService.setAttribute(a, "data-area", `${i}`), r) {
613
- const h = this.domService.createText(r);
614
- this.domService.appendChild(a, h);
652
+ if (this.domService.setStyle(a, "display", "clip"), this.domService.setStyle(a, "position", "absolute"), this.domService.setStyle(a, "left", `${t.left}px`), this.domService.setStyle(a, "top", `${t.top}px`), this.domService.setStyle(a, "width", `${t.width}px`), this.domService.setStyle(a, "height", `${t.height}px`), this.domService.setAttribute(a, "data-row-index", `${s}`), this.domService.setAttribute(a, "data-area", `${o}`), l) {
653
+ const c = this.domService.createText(l);
654
+ this.domService.appendChild(a, c);
615
655
  }
616
656
  return this.domService.appendChild(e.child, a), a;
617
657
  }
618
- addColumnDiv(e, t, s = -1, i = -1, o, r, n = "", a, h, d = void 0, c) {
619
- const p = h == null ? void 0 : h.treeOptions, g = h == null ? void 0 : h.showCheckboxWihoutExtraColumn, u = this.domService.createElement("div");
620
- this.domService.addClass(u, "ge-table-col-div"), this.domService.addClass(u, `ge-table-col-div-${t.index}`), this.domService.setAttribute(u, "data-col-index", `${t.index}`), this.domService.setAttribute(u, "data-row-index", `${s}`), this.domService.setAttribute(u, "data-area", `${o}`);
621
- const m = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
622
- if (o === "body" && r === "center" && this.domService.addClass(u, `ge-table-column-${m}`), this.domService.setStyle(u, "display", "clip"), this.domService.setStyle(u, "position", "absolute"), this.domService.setStyle(u, "left", `${t.left}px`), this.domService.setStyle(u, "top", `${t.top}px`), this.domService.setStyle(u, "width", `${t.width}px`), this.domService.setStyle(u, "height", `${t.height}px`), a && a !== "none" && (this.domService.addClass(u, "ge-table-col-tree"), this.addArrowDiv(u, a, p, s, i, o)), g && i === 0 && d && this.addCheckboxToDiv(u, d, o, s), n) {
623
- const S = a !== "none" && i === 0;
624
- this.addLabelDiv(u, n, S, s, i, o);
658
+ addColumnDiv(e) {
659
+ const { parent: t, geo: s, rowIndex: o = -1, columnIndex: i = -1, areaIdent: l, sideIdent: n, text: a = "", treeArrow: c, tableOptions: d, checkedType: h = void 0, sortState: g } = e, f = d == null ? void 0 : d.treeOptions, b = d == null ? void 0 : d.showCheckboxWihoutExtraColumn, S = this.domService.createElement("div");
660
+ this.domService.addClass(S, "ge-table-col-div"), this.domService.addClass(S, `ge-table-col-div-${s.index}`), this.domService.setAttribute(S, "data-col-index", `${s.index}`), this.domService.setAttribute(S, "data-row-index", `${o}`), this.domService.setAttribute(S, "data-area", `${l}`);
661
+ const p = ((s == null ? void 0 : s.index) ?? 0) % 2 === 0 ? "even" : "odd";
662
+ if (l === "body" && n === "center" && this.domService.addClass(S, `ge-table-column-${p}`), this.domService.setStyle(S, "display", "clip"), this.domService.setStyle(S, "position", "absolute"), this.domService.setStyle(S, "left", `${s.left}px`), this.domService.setStyle(S, "top", `${s.top}px`), this.domService.setStyle(S, "width", `${s.width}px`), this.domService.setStyle(S, "height", `${s.height}px`), c && c !== "none" && (this.domService.addClass(S, "ge-table-col-tree"), this.addArrowDiv(S, c, f, o, i, l)), b && i === 0 && h && this.addCheckboxToDiv(S, h, l, o), a) {
663
+ const u = c !== "none" && i === 0;
664
+ this.addLabelDiv(S, a, u, o, i, l);
625
665
  }
626
- return c && this.addSortedIcon(u, c, h == null ? void 0 : h.sortedOptions, i), this.domService.appendChild(e, u), u;
666
+ return g && this.addSortedIcon(S, g, d == null ? void 0 : d.sortedOptions, i), this.domService.appendChild(t, S), S;
627
667
  }
628
- addCheckboxToDiv(e, t, s, i) {
629
- const o = this.domService.createElement("div"), r = t === "full" ? "checked" : "";
630
- return o.innerHTML = `
668
+ addCheckboxToDiv(e, t, s, o) {
669
+ const i = this.domService.createElement("div"), l = t === "full" ? "checked" : "";
670
+ return i.innerHTML = `
631
671
  <input
632
672
  type="checkbox"
633
673
  data-area="${s}"
634
- data-row-index="${i}"
674
+ data-row-index="${o}"
635
675
  data-input-type="checkbox"
636
- ${r}
637
- 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;
676
+ ${l}
677
+ class="ge-table-row-checkbox"> `, this.domService.setStyle(i, "display", "inline"), this.domService.setStyle(i, "width", "inherit"), this.domService.setAttribute(i, "data-row-index", `${o}`), this.domService.appendChild(e, i), i;
638
678
  }
639
- addLabelDiv(e, t = "", s = !1, i = -1, o = -1, r = "body") {
679
+ addLabelDiv(e, t = "", s = !1, o = -1, i = -1, l = "body") {
640
680
  const n = this.domService.createElement("div");
641
- if (this.domService.addClass(n, "ge-table-label-div"), this.domService.setStyle(n, "position", "relative"), this.domService.setStyle(n, "background", "transparent"), this.domService.setStyle(n, "width", "100%"), this.domService.setStyle(n, "height", "100%"), this.domService.setAttribute(n, "data-row-index", `${i}`), this.domService.setAttribute(n, "data-col-index", `${o}`), this.domService.setAttribute(n, "data-area", `${r}`), t)
681
+ if (this.domService.addClass(n, "ge-table-label-div"), this.domService.setStyle(n, "position", "relative"), this.domService.setStyle(n, "background", "transparent"), this.domService.setStyle(n, "width", "100%"), this.domService.setStyle(n, "height", "100%"), this.domService.setAttribute(n, "data-row-index", `${o}`), this.domService.setAttribute(n, "data-col-index", `${i}`), this.domService.setAttribute(n, "data-area", `${l}`), t)
642
682
  if (s) {
643
683
  const a = this.domService.createText(t);
644
684
  this.domService.appendChild(n, a);
645
685
  } else {
646
686
  const a = this.domService.createElement("div");
647
687
  this.domService.appendChild(n, a);
648
- const h = this.domService.createText(t);
649
- this.domService.addClass(a, "ge-table-label"), this.domService.appendChild(a, h), this.domService.setAttribute(a, "data-row-index", `${i}`), this.domService.setAttribute(a, "data-col-index", `${o}`), this.domService.setAttribute(a, "data-area", `${r}`);
688
+ const c = this.domService.createText(t);
689
+ this.domService.addClass(a, "ge-table-label"), this.domService.appendChild(a, c), this.domService.setAttribute(a, "data-row-index", `${o}`), this.domService.setAttribute(a, "data-col-index", `${i}`), this.domService.setAttribute(a, "data-area", `${l}`);
650
690
  }
651
691
  return this.domService.appendChild(e, n), n;
652
692
  }
653
- addSortedIcon(e, t = "", s = new ye(), i = -1) {
654
- const o = this.domService.createElement("div");
655
- 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");
656
- let r;
657
- t === "asc" ? r = s.iconAsc : t === "desc" ? r = s.iconDesc : r = s.iconPlaceholder;
658
- const n = r.content, a = this.domService.createText(n);
659
- this.domService.appendChild(o, a), r.style && this.applyStyleString(o, r.style);
660
- for (const h of r.classes)
661
- this.domService.addClass(o, h);
662
- return this.domService.appendChild(e, o), o;
663
- }
664
- addArrowDiv(e, t = "none", s = new be(), i = -1, o = -1, r = "body") {
693
+ addSortedIcon(e, t = "", s = new Ae(), o = -1) {
694
+ const i = this.domService.createElement("div");
695
+ this.domService.addClass(i, "ge-table-sorted-icon-div"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "top", "0"), this.domService.setStyle(i, "right", "0"), this.domService.setStyle(i, "width", "20px"), this.domService.setStyle(i, "background", "transparent"), this.domService.setStyle(i, "cursor", "pointer"), this.domService.setAttribute(i, "data-col-index", `${o}`), this.domService.setAttribute(i, "data-area", "header");
696
+ let l;
697
+ t === "asc" ? l = s.iconAsc : t === "desc" ? l = s.iconDesc : l = s.iconPlaceholder;
698
+ const n = l.content, a = this.domService.createText(n);
699
+ this.domService.appendChild(i, a), l.style && this.applyStyleString(i, l.style);
700
+ for (const c of l.classes)
701
+ this.domService.addClass(i, c);
702
+ return this.domService.appendChild(e, i), i;
703
+ }
704
+ addArrowDiv(e, t = "none", s = new Ee(), o = -1, i = -1, l = "body") {
665
705
  const n = this.domService.createElement("div");
666
- this.domService.addClass(n, "ge-table-tree-arrow-div"), this.domService.setStyle(n, "display", "inline-block"), this.domService.setStyle(n, "position", ""), this.domService.setStyle(n, "width", "20px"), this.domService.setStyle(n, "background", "transparent"), this.domService.setStyle(n, "cursor", "pointer"), this.domService.setAttribute(n, "data-row-index", `${i}`), this.domService.setAttribute(n, "data-col-index", `${o}`), this.domService.setAttribute(n, "data-area", `${r}`);
706
+ this.domService.addClass(n, "ge-table-tree-arrow-div"), this.domService.setStyle(n, "display", "inline-block"), this.domService.setStyle(n, "position", ""), this.domService.setStyle(n, "width", "20px"), this.domService.setStyle(n, "background", "transparent"), this.domService.setStyle(n, "cursor", "pointer"), this.domService.setAttribute(n, "data-row-index", `${o}`), this.domService.setAttribute(n, "data-col-index", `${i}`), this.domService.setAttribute(n, "data-area", `${l}`);
667
707
  let a;
668
708
  t === "expanded" ? a = s.arrowExpanded : t === "collapsed" ? a = s.arrowCollapsed : a = s.arrowPlaceholder;
669
- const h = a.content, d = this.domService.createText(h);
709
+ const c = a.content, d = this.domService.createText(c);
670
710
  this.domService.appendChild(n, d), a.style && this.applyStyleString(n, a.style);
671
- for (const c of a.classes)
672
- this.domService.addClass(n, c);
711
+ for (const h of a.classes)
712
+ this.domService.addClass(n, h);
673
713
  return this.domService.appendChild(e, n), n;
674
714
  }
675
- addColumnBorderDivs(e, t, s, i, o) {
715
+ addColumnBorderDivs(e, t, s, o, i) {
676
716
  if (e.verticalBorderVisible) {
677
- const r = `ge-table-${i}-${o}-vertical-border`;
678
- this.addVerticalBorder(s, t, r);
717
+ const l = `ge-table-${o}-${i}-vertical-border`;
718
+ this.addVerticalBorder(s, t, l);
679
719
  }
680
720
  if (e.horizontalBorderVisible) {
681
- const r = `ge-table-${i}-${o}-horizontal-border`;
682
- this.addHorizontalBorder(s, t, r);
721
+ const l = `ge-table-${o}-${i}-horizontal-border`;
722
+ this.addHorizontalBorder(s, t, l);
683
723
  }
684
724
  return t;
685
725
  }
686
726
  addHorizontalBorder(e, t, s = "ge-table-body-center-horizontal-border") {
687
- const i = this.domService.createElement("div");
688
- 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;
727
+ const o = this.domService.createElement("div");
728
+ return this.domService.addClass(o, s), this.domService.setStyle(o, "display", "clip"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "left", `${e.left}px`), this.domService.setStyle(o, "top", `${e.top}px`), this.domService.setStyle(o, "width", `${e.width}px`), this.domService.setStyle(o, "height", "1px"), this.domService.appendChild(t, o), o;
689
729
  }
690
730
  addFocusBorderDivs(e, t, s) {
691
- let i = this.domService.createElement("div");
692
- 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;
731
+ t = { ...t, width: t.width + 1, height: t.height + 1 };
732
+ let o = this.domService.createElement("div");
733
+ return this.domService.addClass(o, "ge-table-focus-border"), this.domService.setStyle(o, "display", "clip"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "left", `${t.left}px`), this.domService.setStyle(o, "top", `${t.top}px`), this.domService.setStyle(o, "width", "1px"), this.domService.setStyle(o, "height", `${t.height}px`), this.domService.setStyle(o, "z-index", "9999"), this.applyStyle(o, s), this.domService.appendChild(e, o), o = this.domService.createElement("div"), this.domService.addClass(o, "ge-table-focus-border"), this.domService.setStyle(o, "display", "clip"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "left", `${t.left + t.width - 1}px`), this.domService.setStyle(o, "top", `${t.top}px`), this.domService.setStyle(o, "width", "1px"), this.domService.setStyle(o, "height", `${t.height}px`), this.domService.setStyle(o, "z-index", "9999"), this.applyStyle(o, s), this.domService.appendChild(e, o), o = this.domService.createElement("div"), this.domService.addClass(o, "ge-table-focus-border"), this.domService.setStyle(o, "display", "clip"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "left", `${t.left}px`), this.domService.setStyle(o, "top", `${t.top}px`), this.domService.setStyle(o, "width", `${t.width}px`), this.domService.setStyle(o, "height", "1px"), this.domService.setStyle(o, "z-index", "9999"), this.applyStyle(o, s), this.domService.appendChild(e, o), o = this.domService.createElement("div"), this.domService.addClass(o, "ge-table-focus-border"), this.domService.setStyle(o, "display", "clip"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "left", `${t.left}px`), this.domService.setStyle(o, "top", `${t.top + t.height - 1}px`), this.domService.setStyle(o, "width", `${t.width}px`), this.domService.setStyle(o, "height", "1px"), this.domService.setStyle(o, "z-index", "9999"), this.applyStyle(o, s), this.domService.appendChild(e, o), e;
693
734
  }
694
735
  addVerticalBorder(e, t, s = "ge-table-body-center-vertical-border") {
695
- const i = this.domService.createElement("div");
696
- 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;
736
+ const o = this.domService.createElement("div");
737
+ return this.domService.addClass(o, s), this.domService.setStyle(o, "display", "clip"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "left", `${e.left}px`), this.domService.setStyle(o, "top", `${e.top}px`), this.domService.setStyle(o, "width", "1px"), this.domService.setStyle(o, "height", `${e.height}px`), this.domService.appendChild(t, o), o;
697
738
  }
698
739
  addDiv(e, t, s = "") {
699
- const i = this.domService.createElement("div");
700
- 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;
740
+ const o = this.domService.createElement("div");
741
+ return s && this.domService.addClass(o, s), this.domService.setStyle(o, "display", "clip"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "left", `${t.left}px`), this.domService.setStyle(o, "top", `${t.top}px`), this.domService.setStyle(o, "width", `${t.width}px`), this.domService.setStyle(o, "height", `${t.height}px`), this.domService.appendChild(e, o), o;
701
742
  }
702
743
  applyStyleString(e, t) {
703
- const s = t.split(";").map((i) => i.trim()).filter((i) => i);
704
- for (const i of s) {
705
- const [o, r] = i.split(":");
706
- this.domService.setStyle(e, o.trim(), r.trim());
744
+ const s = t.split(";").map((o) => o.trim()).filter((o) => o);
745
+ for (const o of s) {
746
+ const [i, l] = o.split(":");
747
+ this.domService.setStyle(e, i.trim(), l.trim());
707
748
  }
708
749
  }
709
750
  getDivOrCreateDiv(e, t) {
@@ -711,22 +752,22 @@ class _e {
711
752
  return s ? (s.innerText = "", s) : (s = this.domService.createElement("div"), t.cache[e] = s, s);
712
753
  }
713
754
  }
714
- const ie = (l) => l === "header" ? "header" : l === "footer" ? "footer" : "body";
715
- class ke {
755
+ const ae = (r) => r === "header" ? "header" : r === "footer" ? "footer" : "body";
756
+ class Ye {
716
757
  constructor(e, t) {
717
758
  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)) {
718
759
  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"));
719
760
  const s = e.getAttribute("data-area");
720
- if (s && (this.areaIdent = ie(s), this.areaModel = t.tableModel.getAreaModel(this.areaIdent), this.row = this.areaModel.getRowByIndex(this.rowIdx)), e instanceof HTMLInputElement) {
721
- const i = e;
722
- this.value = i.value;
761
+ if (s && (this.areaIdent = ae(s), this.areaModel = t.tableModel.getAreaModel(this.areaIdent), this.row = this.areaModel.getRowByIndex(this.rowIdx)), e instanceof HTMLInputElement) {
762
+ const o = e;
763
+ this.value = o.value;
723
764
  }
724
765
  }
725
766
  }
726
767
  }
727
- class Ge {
768
+ class Ue {
728
769
  constructor(e) {
729
- 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(
770
+ this.tableScope = e, this.doubleClickDelay = 500, this.expandedAll = !0, this.mouseDown = !1, this.dragging = !1, this.lastClicked = 0, this.tableScope.hostElement.addEventListener("click", this.onHostElementClicked.bind(this)), this.tableScope.hostElement.addEventListener("dblclick", this.onHostElementDblClicked.bind(this)), this.tableScope.hostElement.addEventListener("mousedown", this.onMouseDown.bind(this)), this.tableScope.hostElement.addEventListener("mousemove", this.onMouseMove.bind(this)), this.tableScope.hostElement.addEventListener("mouseup", this.onMouseUp.bind(this)), this.tableScope.hostElement.addEventListener("contextmenu", this.onContextmenu.bind(this)), this.tableScope.hostElement._MouseHandler = "true", this.tableScope.scrollViewport.addEventListener("scroll", this.tableScope.adjustAfterScrolling.bind(this.tableScope)), [window, this.tableScope.hostElement].forEach(
730
771
  (t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
731
772
  );
732
773
  }
@@ -750,22 +791,28 @@ class Ge {
750
791
  * @return {void}
751
792
  */
752
793
  onHostElementClicked(e) {
753
- const t = new ke(e.target, this.tableScope);
754
- if (t.action === "toggleExpandCollapseAll")
794
+ const t = Date.now();
795
+ if (t - this.lastClicked < this.doubleClickDelay)
796
+ return;
797
+ this.lastClicked = t;
798
+ const s = new Ye(e.target, this.tableScope);
799
+ if (s.action === "toggleExpandCollapseAll")
755
800
  this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
756
- else if (t.inputType === "checkbox" && t.areaIdent)
757
- this.tableScope.toggleRowCheckbox(t.rowIdx, t.colIdx, t.areaIdent), e.preventDefault(), e.stopPropagation();
758
- else if (Z(t.row) && t.areaModel) {
759
- const s = t.colIdx === this.getArrowColumnIndex() && e.altKey, i = t.className.includes("ge-table-tree-arrow-div");
760
- if (console.info(i, s), s || i) {
801
+ else if (s.action === "toggleHeaderGroup")
802
+ this.tableScope.toggleHeaderGroup(s), e.preventDefault(), e.stopPropagation();
803
+ else if (s.inputType === "checkbox" && s.areaIdent)
804
+ this.tableScope.toggleRowCheckbox(s.rowIdx, s.colIdx, s.areaIdent), e.preventDefault(), e.stopPropagation();
805
+ else if (ie(s.row) && s.areaModel) {
806
+ const o = s.colIdx === this.getArrowColumnIndex() && e.altKey, i = s.className.includes("ge-table-tree-arrow-div");
807
+ if (console.info(i, o), o || i) {
761
808
  e.preventDefault(), e.stopPropagation();
762
- const o = t.row;
763
- 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);
809
+ const l = s.row;
810
+ l.expanded = !l.expanded, "recalcVisibleTreeRows" in s.areaModel && s.areaModel.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(l);
764
811
  }
765
812
  }
766
- if (t.areaIdent === "body" && this.tableScope.tableOptions.getFocusModel) {
767
- const s = this.tableScope.tableOptions.getFocusModel();
768
- s == null || s.clear(), s == null || s.setFocus(t.rowIdx, t.colIdx);
813
+ if (s.areaIdent === "body" && this.tableScope.tableOptions.getFocusModel) {
814
+ const o = this.tableScope.tableOptions.getFocusModel();
815
+ o == null || o.clear(), o == null || o.setFocus(s.rowIdx, s.colIdx);
769
816
  }
770
817
  this.publishGeMouseEvent(e, 1);
771
818
  }
@@ -776,16 +823,16 @@ class Ge {
776
823
  * @param {MouseEvent} event - The double click event.
777
824
  */
778
825
  onHostElementDblClicked(e) {
779
- if (e.target instanceof HTMLElement) {
780
- const t = e.target, s = t.getAttribute("data-area"), i = ie(s), o = Number(t.getAttribute("data-row-index")), r = Number(t.getAttribute("data-col-index")), n = this.tableScope.tableModel.getAreaModel(i);
781
- if (s && i === "header")
782
- this.tableScope.tableModel.isSortable(r) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, o, r));
826
+ if (this.lastClicked = Date.now(), e.target instanceof HTMLElement) {
827
+ const t = e.target, s = t.getAttribute("data-area"), o = ae(s), i = Number(t.getAttribute("data-row-index")), l = Number(t.getAttribute("data-col-index")), n = this.tableScope.tableModel.getAreaModel(o);
828
+ if (s && o === "header")
829
+ this.tableScope.tableModel.isSortable(l) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, i, l));
783
830
  else if (t.getAttribute("data-row-index")) {
784
- const a = n.getRowByIndex(o);
785
- if (s && i === "body" && n.isEditable(o, r) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, r)), Z(a) && r === this.getArrowColumnIndex()) {
831
+ const a = n.getRowByIndex(i);
832
+ if (s && o === "body" && n.isEditable(i, l) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(i, l)), ie(a) && l === this.getArrowColumnIndex()) {
786
833
  e.preventDefault(), e.stopPropagation();
787
- const h = a;
788
- h.expanded = !h.expanded, "recalcVisibleTreeRows" in n && n.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(h);
834
+ const c = a;
835
+ c.expanded = !c.expanded, "recalcVisibleTreeRows" in n && n.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(c);
789
836
  }
790
837
  }
791
838
  }
@@ -801,7 +848,7 @@ class Ge {
801
848
  */
802
849
  publishGeMouseEvent(e, t) {
803
850
  var s;
804
- 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);
851
+ 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), this.tableScope.publishGeMouseEvent(this.geMouseEvent), t === 1 && this.tableScope.debounceRepaint();
805
852
  }
806
853
  /**
807
854
  * Update the collapsed/expanded state of a tree row.
@@ -810,30 +857,30 @@ class Ge {
810
857
  * @returns {void}
811
858
  */
812
859
  updateCollapsedExpandedState(e) {
813
- var s, i, o, r, n;
814
- const t = (i = (s = this.tableScope.tableOptions) == null ? void 0 : s.autoRestoreOptions) == null ? void 0 : i.getRowId;
860
+ var s, o, i, l, n;
861
+ const t = (o = (s = this.tableScope.tableOptions) == null ? void 0 : s.autoRestoreOptions) == null ? void 0 : o.getRowId;
815
862
  if (t) {
816
- const a = (o = this.tableScope.storeStateCollapsedExpandService) == null ? void 0 : o.collapsedExpandedStateGet().mode, h = a === "collapsed" && !e.expanded || a === "expanded" && e.expanded, d = a === "collapsed" && e.expanded || a === "expanded" && !e.expanded, c = t(e.data);
817
- h ? (r = this.tableScope.storeStateCollapsedExpandService) == null || r.collapsedStateIdsPush(c) : d && ((n = this.tableScope.storeStateCollapsedExpandService) == null || n.collapsedStateIdsRemove(c));
863
+ const a = (i = this.tableScope.storeStateCollapsedExpandService) == null ? void 0 : i.collapsedExpandedStateGet().mode, c = a === "collapsed" && !e.expanded || a === "expanded" && e.expanded, d = a === "collapsed" && e.expanded || a === "expanded" && !e.expanded, h = t(e.data);
864
+ c ? (l = this.tableScope.storeStateCollapsedExpandService) == null || l.collapsedStateIdsPush(h) : d && ((n = this.tableScope.storeStateCollapsedExpandService) == null || n.collapsedStateIdsRemove(h));
818
865
  }
819
866
  }
820
867
  getArrowColumnIndex() {
821
868
  return this.tableScope.tableModel.isRowCheckboxVisible() ? 1 : 0;
822
869
  }
823
870
  onMouseDown(e) {
824
- this.mouseEvent = e, this.startMouseEvent = this.tableScope.createGeMouseEvent(this.mouseEvent), this.tableScope.onMouseDown(this.startMouseEvent), this.mouseDown = !0;
871
+ this.dragging || (this.mouseEvent = e, this.startMouseEvent = this.tableScope.createGeMouseEvent(this.mouseEvent), this.tableScope.onMouseDown(this.startMouseEvent), this.mouseDown = !0);
825
872
  }
826
873
  onMouseMove(e) {
827
- this.mouseEvent = e, this.mouseDown ? (this.dragging = !0, requestAnimationFrame(this.mouseDraggingOnFrame.bind(this))) : requestAnimationFrame(this.mouseMoveOnFrame.bind(this));
874
+ this.mouseEvent = e, this.mouseDown ? (this.dragging || (this.dragging = !0, this.tableScope.setDragging(!0)), requestAnimationFrame(this.mouseDraggingOnFrame.bind(this))) : requestAnimationFrame(this.mouseMoveOnFrame.bind(this));
828
875
  }
829
876
  onMouseUp(e) {
830
- this.mouseEvent = e, this.dragging && requestAnimationFrame(this.mouseDraggingEndOnFrame.bind(this)), this.mouseDown = !1, this.dragging = !1;
877
+ this.mouseEvent = e, this.dragging && requestAnimationFrame(this.mouseDraggingEndOnFrame.bind(this)), this.mouseDown = !1, this.dragging = !1, this.tableScope.setDragging(!1);
831
878
  }
832
879
  mouseDraggingOnFrame() {
833
880
  var e;
834
881
  if (this.mouseEvent) {
835
882
  const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
836
- (e = this.startMouseEvent) != null && e.originalEvent && (t.draggingX = this.mouseEvent.clientX - this.startMouseEvent.originalEvent.clientX, t.draggingY = this.mouseEvent.clientY - this.startMouseEvent.originalEvent.clientY), this.tableScope.mouseDraggingOnFrame(t);
883
+ (e = this.startMouseEvent) != null && e.originalEvent && (t.draggingX = this.mouseEvent.clientX - this.startMouseEvent.originalEvent.clientX, t.draggingY = this.mouseEvent.clientY - this.startMouseEvent.originalEvent.clientY), this.tableScope.mouseDraggingOnFrame(t, this.startMouseEvent);
837
884
  }
838
885
  }
839
886
  mouseDraggingEndOnFrame() {
@@ -850,7 +897,7 @@ class Ge {
850
897
  }
851
898
  }
852
899
  }
853
- class Ne {
900
+ class qe {
854
901
  constructor(e) {
855
902
  this.tableScope = e;
856
903
  }
@@ -876,21 +923,23 @@ class Ne {
876
923
  /**
877
924
  * Scrolls the table body to the specified pixel coordinates.
878
925
  *
879
- * @param {number} _px - The horizontal pixel coordinate to scroll to. Defaults to 0.
880
- * @param {number} _py - The vertical pixel coordinate to scroll to. Defaults to 0.
926
+ * @param {number} px - The horizontal pixel coordinate to scroll to. Defaults to 0.
927
+ * @param {number} py - The vertical pixel coordinate to scroll to. Defaults to 0.
881
928
  * @return {void}
882
929
  */
883
930
  scrollToPixel(e = 0, t = 0) {
931
+ this.tableScope.scrollToPixel(e, t);
884
932
  }
885
933
  /**
886
934
  * Scrolls to the specified index in both horizontal and vertical directions.
887
935
  *
888
- * @param {number} _indexX - The index of the column to scroll to in the horizontal direction. Default is 0.
889
- * @param {number} _indexY - The index of the row to scroll to in the vertical direction. Default is 0.
936
+ * @param {number} indexX - The index of the column to scroll to in the horizontal direction. Default is 0.
937
+ * @param {number} indexY - The index of the row to scroll to in the vertical direction. Default is 0.
890
938
  *
891
939
  * @return undefined
892
940
  */
893
941
  scrollToIndex(e = 0, t = 0) {
942
+ this.tableScope.scrollToIndex(e, t);
894
943
  }
895
944
  /**
896
945
  * Sets whether the header is visible or not.
@@ -954,8 +1003,86 @@ class Ne {
954
1003
  repaint() {
955
1004
  this.tableScope.repaint();
956
1005
  }
1006
+ /**
1007
+ * Repaints the table scope with hard repaint.
1008
+ * Repaints the UI by resetting the size of the wrapper div,
1009
+ * adjusting the containers and rows, and performing additional adjustments
1010
+ * after scrolling.
1011
+ *
1012
+ * @return {void}
1013
+ */
1014
+ repaintHard() {
1015
+ this.tableScope.repaintHard();
1016
+ }
1017
+ /**
1018
+ * Clears the current selection of the table.
1019
+ * The table will be rendered automatically.
1020
+ *
1021
+ * @returns {void}
1022
+ */
1023
+ clearSelection() {
1024
+ this.tableScope.clearSelection(!0);
1025
+ }
1026
+ /**
1027
+ * Sets the selection model for the table scope.
1028
+ *
1029
+ * @param {SelectionModel} sm - The selection model to be set.
1030
+ * @param {boolean} [repaint=true] - Indicates whether the table should be repainted after setting the selection model. Default value is true.
1031
+ *
1032
+ * @return {void}
1033
+ */
1034
+ setSelectionModel(e, t = !0) {
1035
+ this.tableScope.setSelectionModel(e, t);
1036
+ }
1037
+ /**
1038
+ * Triggers the action with the given action ID.
1039
+ * This function can be invoked programmatically.
1040
+ *
1041
+ * @param {ActionId} actionId - The ID of the action to trigger.
1042
+ * @return {void}
1043
+ */
1044
+ triggerAction(e) {
1045
+ this.tableScope.onActionTriggered(e);
1046
+ }
1047
+ /**
1048
+ * Retrieves the mapping of shortcuts to corresponding action in the current table scope.
1049
+ *
1050
+ * @return {ShortcutActionIdMapping} The mapping of shortcuts to corresponding action.
1051
+ */
1052
+ getShortcutActionMapping() {
1053
+ return this.tableScope.shortcutService.getShortcutActionMapping();
1054
+ }
1055
+ /**
1056
+ * Copies the selected data from the table to the clipboard.
1057
+ *
1058
+ * @return {Promise<string>} - A promise that resolves with the copied data as a string.
1059
+ */
1060
+ copyToClipboard() {
1061
+ return this.tableScope.copyService.copyToClipboard(
1062
+ this.tableScope.tableModel,
1063
+ this.tableScope.selectionModel(),
1064
+ this.tableScope.focusModel()
1065
+ );
1066
+ }
1067
+ /**
1068
+ * Retrieves the current scope of the table.
1069
+ *
1070
+ * @returns {TableScope} The current scope of the table.
1071
+ */
1072
+ getTableScope() {
1073
+ return this.tableScope;
1074
+ }
1075
+ /**
1076
+ * Retrieves the selection model of the table.
1077
+ *
1078
+ * @return {SelectionModelIf | undefined} The selection model of the table,
1079
+ * or undefined if no selection model is available.
1080
+ */
1081
+ getSelectionModel() {
1082
+ return this.tableScope.selectionModel();
1083
+ }
957
1084
  }
958
- class oe {
1085
+ class de {
959
1086
  constructor(e) {
960
1087
  this.getStorageKeyFn = e;
961
1088
  }
@@ -963,12 +1090,12 @@ class oe {
963
1090
  const t = {};
964
1091
  if (e instanceof Map) {
965
1092
  const s = e;
966
- for (const i of [...s]) {
1093
+ for (const o of [...s]) {
967
1094
  const [
968
- o,
969
- r
970
- ] = i;
971
- t[o] = r;
1095
+ i,
1096
+ l
1097
+ ] = o;
1098
+ t[i] = l;
972
1099
  }
973
1100
  }
974
1101
  return t;
@@ -976,14 +1103,14 @@ class oe {
976
1103
  checkAndPersistItem(e, t) {
977
1104
  const s = this.getStorageKeyFn;
978
1105
  if (s) {
979
- const i = s();
980
- if (i) {
981
- const o = i + e;
1106
+ const o = s();
1107
+ if (o) {
1108
+ const i = o + e;
982
1109
  if ((t + "").includes("Map")) {
983
- const r = this.autoConvertMapToObject(t);
984
- this.persistItem(o, r);
1110
+ const l = this.autoConvertMapToObject(t);
1111
+ this.persistItem(i, l);
985
1112
  } else
986
- this.persistItem(o, t);
1113
+ this.persistItem(i, t);
987
1114
  }
988
1115
  }
989
1116
  }
@@ -1030,7 +1157,7 @@ class oe {
1030
1157
  // }
1031
1158
  // }
1032
1159
  }
1033
- class je extends oe {
1160
+ class Je extends de {
1034
1161
  constructor(e) {
1035
1162
  super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
1036
1163
  }
@@ -1046,20 +1173,20 @@ class je extends oe {
1046
1173
  const t = e();
1047
1174
  if (t) {
1048
1175
  const s = t + this.SCROLL_STATE;
1049
- let i = this.loadFromLocalStorage(s);
1050
- this.scrollOffset = i || [0, 0];
1176
+ let o = this.loadFromLocalStorage(s);
1177
+ this.scrollOffset = o || [0, 0];
1051
1178
  }
1052
1179
  }
1053
1180
  }
1054
1181
  }
1055
- class Xe {
1056
- constructor(e = "collapsed", t = [], s = !1, i = !1) {
1057
- this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = i;
1182
+ class Qe {
1183
+ constructor(e = "collapsed", t = [], s = !1, o = !1) {
1184
+ this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = o;
1058
1185
  }
1059
1186
  }
1060
- class Ke extends oe {
1187
+ class Ze extends de {
1061
1188
  constructor(e) {
1062
- super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new Xe(), this.load();
1189
+ super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new Qe(), this.load();
1063
1190
  }
1064
1191
  collapsedExpandedStateGet() {
1065
1192
  return this.collapsedExpandedState;
@@ -1082,8 +1209,8 @@ class Ke extends oe {
1082
1209
  if (e) {
1083
1210
  const t = e();
1084
1211
  if (t) {
1085
- const s = t + this.COLLAPSED_EXPANDED_STATE, i = this.loadFromLocalStorage(s);
1086
- i && (this.collapsedExpandedState = i);
1212
+ const s = t + this.COLLAPSED_EXPANDED_STATE, o = this.loadFromLocalStorage(s);
1213
+ o && (this.collapsedExpandedState = o);
1087
1214
  }
1088
1215
  }
1089
1216
  }
@@ -1091,7 +1218,7 @@ class Ke extends oe {
1091
1218
  this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
1092
1219
  }
1093
1220
  }
1094
- class ze extends oe {
1221
+ class et extends de {
1095
1222
  constructor(e) {
1096
1223
  super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
1097
1224
  }
@@ -1106,68 +1233,69 @@ class ze extends oe {
1106
1233
  if (e) {
1107
1234
  const t = e();
1108
1235
  if (t) {
1109
- const s = t + this.SORTING_STATE;
1110
- let i = this.loadFromLocalStorage(s);
1111
- this.sortItems = i || [];
1236
+ const s = t + this.SORTING_STATE, o = this.loadFromLocalStorage(s);
1237
+ this.sortItems = o || [];
1112
1238
  }
1113
1239
  }
1114
1240
  }
1115
1241
  }
1116
1242
  class O {
1117
- constructor(e = 0, t = 0, s = 0, i = 0, o) {
1118
- this.left = e, this.width = t, this.height = s, this.top = i, this.index = o;
1243
+ constructor(e = 0, t = 0, s = 0, o = 0, i) {
1244
+ this.left = e, this.width = t, this.height = s, this.top = o, this.index = i;
1119
1245
  }
1120
1246
  }
1121
- class Ye {
1122
- constructor(e, t, s, i) {
1123
- this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = i, this.scrollTop = 0, this.areaBodyWestGeo = new O(), this.areaBodyCenterGeo = new O(), this.areaBodyEastGeo = new O();
1124
- const o = this.hostElement;
1125
- o.innerText = "", this.dom.setAttribute(o, "tabindex", "0"), this.dom.setStyle(
1126
- this.dom.addClass("ge-table", o),
1247
+ class tt {
1248
+ constructor(e, t, s, o) {
1249
+ this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = o, this.scrollTop = 0, this.areaBodyWestGeo = new O(), this.areaBodyCenterGeo = new O(), this.areaBodyEastGeo = new O();
1250
+ const i = this.hostElement;
1251
+ i.innerText = "", this.dom.setAttribute(i, "tabindex", "0"), this.dom.setStyle(
1252
+ this.dom.addClass("ge-table", i),
1127
1253
  "position",
1128
1254
  "relative"
1129
1255
  ), this.hoverRow = s.applyStylePosistionAbsolute(
1130
- s.createDivWithClass("ge-table-hover-row", o)
1256
+ s.createDivWithClass("ge-table-hover-row", i)
1131
1257
  ), this.hoverColumn = s.applyStylePosistionAbsolute(
1132
- s.createDivWithClass("ge-table-hover-column", o)
1258
+ s.createDivWithClass("ge-table-hover-column", i)
1259
+ ), this.draggingColumn = s.applyStylePosistionAbsolute(
1260
+ s.createDivWithClass("ge-table-dragging-column", i)
1133
1261
  ), this.areaHeaderWest = s.appendRelativeChildDiv(
1134
1262
  s.applyStylePosistionAbsolute(
1135
- s.createAreaDivWithClass("ge-table-header ge-table-header-west", o, "header", "west")
1263
+ s.createAreaDivWithClass("ge-table-header ge-table-header-west", i, "header", "west")
1136
1264
  )
1137
1265
  ), this.areaHeaderCenter = s.appendRelativeChildDiv(
1138
1266
  s.applyStylePosistionAbsolute(
1139
- s.createAreaDivWithClass("ge-table-header ge-table-header-center", o, "header", "center")
1267
+ s.createAreaDivWithClass("ge-table-header ge-table-header-center", i, "header", "center")
1140
1268
  )
1141
1269
  ), this.areaHeaderEast = s.appendRelativeChildDiv(
1142
1270
  s.applyStylePosistionAbsolute(
1143
- s.createAreaDivWithClass("ge-table-header ge-table-header-east", o, "body", "east")
1271
+ s.createAreaDivWithClass("ge-table-header ge-table-header-east", i, "body", "east")
1144
1272
  )
1145
1273
  ), this.areaBodyWest = s.appendRelativeChildDiv(
1146
1274
  s.applyStylePosistionAbsolute(
1147
- s.createAreaDivWithClass("ge-table-body ge-table-body-west", o, "body", "west")
1275
+ s.createAreaDivWithClass("ge-table-body ge-table-body-west", i, "body", "west")
1148
1276
  )
1149
1277
  ), this.areaBodyEast = s.appendRelativeChildDiv(
1150
1278
  s.applyStylePosistionAbsolute(
1151
- s.createAreaDivWithClass("ge-table-body ge-table-body-east", o, "body", "east")
1279
+ s.createAreaDivWithClass("ge-table-body ge-table-body-east", i, "body", "east")
1152
1280
  )
1153
1281
  ), this.areaFooterWest = s.appendRelativeChildDiv(
1154
1282
  s.applyStylePosistionAbsolute(
1155
- s.createAreaDivWithClass("ge-table-footer ge-table-footer-west", o, "footer", "west")
1283
+ s.createAreaDivWithClass("ge-table-footer ge-table-footer-west", i, "footer", "west")
1156
1284
  )
1157
1285
  ), this.areaFooterCenter = s.appendRelativeChildDiv(
1158
1286
  s.applyStylePosistionAbsolute(
1159
- s.createAreaDivWithClass("ge-table-footer ge-table-footer-center", o, "footer", "center")
1287
+ s.createAreaDivWithClass("ge-table-footer ge-table-footer-center", i, "footer", "center")
1160
1288
  )
1161
1289
  ), this.areaFooterEast = s.appendRelativeChildDiv(
1162
1290
  s.applyStylePosistionAbsolute(
1163
- s.createAreaDivWithClass("ge-table-footer ge-table-footer-east", o, "footer", "east")
1291
+ s.createAreaDivWithClass("ge-table-footer ge-table-footer-east", i, "footer", "east")
1164
1292
  )
1165
1293
  ), this.scrollViewport = s.applyStyleOverflowAuto(
1166
1294
  this.tableOptions.overflowX ?? "auto",
1167
1295
  this.tableOptions.overflowY ?? "auto",
1168
1296
  s.applyStyleNoPadding(
1169
1297
  s.applyStylePosistionAbsolute(
1170
- s.createAreaDivWithClass("ge-table-scroll-viewport", o, "body", "center")
1298
+ s.createAreaDivWithClass("ge-table-scroll-viewport", i, "body", "center")
1171
1299
  )
1172
1300
  )
1173
1301
  ), this.contentWrapperDiv = s.applyStyleNoPadding(
@@ -1181,15 +1309,20 @@ class Ye {
1181
1309
  ), this.areaBodyCenter = s.appendRelativeChildDiv(
1182
1310
  s.createDivWithClass("ge-table-body-center", this.contentDiv)
1183
1311
  ), this.borderHeaderBottom = s.applyStylePosistionAbsolute(
1184
- s.createDivWithClass("ge-table-header-border", o)
1312
+ s.createDivWithClass("ge-table-header-border", i)
1185
1313
  ), this.borderFixedWest = s.applyStylePosistionAbsolute(
1186
- s.createDivWithClass("ge-table-west-fixed-column-border", o)
1314
+ s.createDivWithClass("ge-table-west-fixed-column-border", i)
1187
1315
  ), this.borderFixedEast = s.applyStylePosistionAbsolute(
1188
- s.createDivWithClass("ge-table-east-fixed-column-border", o)
1316
+ s.createDivWithClass("ge-table-east-fixed-column-border", i)
1189
1317
  ), this.borderFooterTop = s.applyStylePosistionAbsolute(
1190
- s.createDivWithClass("ge-table-footer-border", o)
1318
+ s.createDivWithClass("ge-table-footer-border", i)
1191
1319
  );
1192
1320
  }
1321
+ /**
1322
+ * Adjusts the containers and rows of the table based on the current state.
1323
+ *
1324
+ * @return {void}
1325
+ */
1193
1326
  adjustContainersAndRows() {
1194
1327
  const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth, s = this.hostElement.clientHeight;
1195
1328
  this.dom.applyStyle(this.scrollViewport, {
@@ -1262,14 +1395,27 @@ class Ye {
1262
1395
  })
1263
1396
  ) : this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.adjustAfterScrolling();
1264
1397
  }
1398
+ /**
1399
+ * Adjusts the position or appearance of elements after scrolling.
1400
+ * This method must be overwritten in child classes.
1401
+ *
1402
+ * @return {void}
1403
+ */
1265
1404
  adjustAfterScrolling() {
1266
1405
  }
1406
+ /**
1407
+ * Resets the size of the wrapper div based on the content dimensions.
1408
+ *
1409
+ * @protected
1410
+ *
1411
+ * @returns {void} Returns nothing.
1412
+ */
1267
1413
  resetSizeOfWrapperDiv() {
1268
1414
  const e = `${this.tableModel.getContentWidthInPixel()}px`, t = `${this.tableModel.getContentHeightInPixel() + 1}px`;
1269
1415
  this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", t);
1270
1416
  }
1271
1417
  }
1272
- class D {
1418
+ class A {
1273
1419
  /**
1274
1420
  * Represents a constructor for a class.
1275
1421
  * @constructor
@@ -1279,11 +1425,11 @@ class D {
1279
1425
  * @param {number} c2 - The value for c2.
1280
1426
  * @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
1281
1427
  */
1282
- constructor(e, t, s, i, o = !1) {
1283
- this.r1 = e, this.c1 = t, this.r2 = s, this.c2 = i, this.gammaRange = o;
1428
+ constructor(e, t, s, o, i = !1) {
1429
+ this.r1 = e, this.c1 = t, this.r2 = s, this.c2 = o, this.gammaRange = i;
1284
1430
  }
1285
1431
  static create(e) {
1286
- return e.gammaRange === void 0 && (e.gammaRange = !1), new D(
1432
+ return e.gammaRange === void 0 && (e.gammaRange = !1), new A(
1287
1433
  e.rowIndex1,
1288
1434
  e.columnIndex1,
1289
1435
  e.rowIndex2,
@@ -1292,19 +1438,19 @@ class D {
1292
1438
  );
1293
1439
  }
1294
1440
  static singleCell(e, t) {
1295
- return new D(e, t, e, t);
1441
+ return new A(e, t, e, t);
1296
1442
  }
1297
1443
  static singleRow(e) {
1298
- return new D(e, 0, e, Number.MAX_SAFE_INTEGER);
1444
+ return new A(e, 0, e, Number.MAX_SAFE_INTEGER);
1299
1445
  }
1300
1446
  static singleColumn(e) {
1301
- return new D(0, e, Number.MAX_SAFE_INTEGER, e);
1447
+ return new A(0, e, Number.MAX_SAFE_INTEGER, e);
1302
1448
  }
1303
1449
  isInRange(e, t) {
1304
1450
  return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
1305
1451
  }
1306
1452
  }
1307
- class Ue {
1453
+ class st {
1308
1454
  constructor(e, t) {
1309
1455
  this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
1310
1456
  }
@@ -1314,13 +1460,13 @@ class Ue {
1314
1460
  this.colAndRowspanRanges = [];
1315
1461
  const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
1316
1462
  for (let s = 0; s < e; s++)
1317
- for (let i = 0; i < t; i++) {
1318
- let o = this.areaModel.getColspanAt(s, i), r = this.areaModel.getRowspanAt(s, i);
1319
- if (o > 1 || r > 1) {
1320
- o === 0 && (o = 1), r === 0 && (r = 1);
1321
- const n = this.areaModel.hasOwnProperty("gammaCells");
1463
+ for (let o = 0; o < t; o++) {
1464
+ let i = this.areaModel.getColspanAt(s, o), l = this.areaModel.getRowspanAt(s, o);
1465
+ if (i > 1 || l > 1) {
1466
+ i === 0 && (i = 1), l === 0 && (l = 1);
1467
+ const n = "gammaCells" in this.areaModel;
1322
1468
  this.colAndRowspanRanges.push(
1323
- new D(s, i, s + r - 1, i + o - 1, n)
1469
+ new A(s, o, s + l - 1, o + i - 1, n)
1324
1470
  );
1325
1471
  }
1326
1472
  }
@@ -1337,51 +1483,91 @@ class Ue {
1337
1483
  return !1;
1338
1484
  }
1339
1485
  }
1340
- class qe {
1486
+ class ot {
1341
1487
  constructor(e, t, s) {
1342
1488
  this.header = e, this.body = t, this.footer = s;
1343
1489
  }
1344
1490
  }
1345
- class Je extends Ye {
1346
- constructor(e, t, s, i) {
1347
- var r, n;
1348
- super(e, t, s, i), this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
1491
+ class it extends tt {
1492
+ constructor(e, t, s, o) {
1493
+ var l, n;
1494
+ super(e, t, s, o), this.dragging = !1, this.editing = !1, this.storedColumnWidths = [], this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
1349
1495
  header: [],
1350
1496
  body: [],
1351
1497
  footer: []
1352
- }, this.tree = !1, this.colAndRowspanModels = new qe(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.editing = !1, this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (r = this.tableOptions) != null && r.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (n = this.tableOptions) != null && n.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), ee(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
1498
+ }, this.tree = !1, this.colAndRowspanModels = new ot(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (l = this.tableOptions) != null && l.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (n = this.tableOptions) != null && n.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), le(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
1353
1499
  (a) => {
1354
- var h;
1355
- this.colAndRowspanModels[a] = new Ue(t, t.getAreaModel(a)), (h = this.colAndRowspanModels[a]) == null || h.init();
1500
+ var c;
1501
+ this.colAndRowspanModels[a] = new st(t, t.getAreaModel(a)), (c = this.colAndRowspanModels[a]) == null || c.init();
1356
1502
  }
1357
1503
  );
1358
1504
  }
1359
1505
  isEditing() {
1360
1506
  return this.editing;
1361
1507
  }
1508
+ /**
1509
+ * Resets the editor renderer by clearing its values and state.
1510
+ *
1511
+ * @function resetEditorRenderer
1512
+ * @memberof ClassName
1513
+ *
1514
+ * @returns {void}
1515
+ */
1362
1516
  resetEditorRenderer() {
1363
1517
  this.editorRenderer = void 0, this.editorRendererRow = -1, this.editorRendererColumn = -1, this.editing = !1;
1364
1518
  }
1365
- clearSelection() {
1519
+ /**
1520
+ * Clears the selection in the component.
1521
+ *
1522
+ * @param {boolean} rerender - Indicates whether to rerender the component after clearing the selection. Default value is false.
1523
+ *
1524
+ * @return {void}
1525
+ */
1526
+ clearSelection(e = !1) {
1366
1527
  if (this.getSelectionModel) {
1367
- const e = this.getSelectionModel();
1368
- e == null || e.clear();
1528
+ const t = this.getSelectionModel();
1529
+ t == null || t.clear(), e && this.repaint();
1369
1530
  }
1370
1531
  }
1532
+ /**
1533
+ * Initializes and renders the editor for a specified row and column index.
1534
+ *
1535
+ * @param {number} rowIdx - The index of the row.
1536
+ * @param {number} colIdx - The index of the column.
1537
+ */
1371
1538
  initRenderEditor(e, t) {
1372
- var i;
1373
- let s = (i = this.tableModel.getColumnDef(t)) == null ? void 0 : i.getEditRenderer;
1539
+ var o;
1540
+ let s = (o = this.tableModel.getColumnDef(t)) == null ? void 0 : o.getEditRenderer;
1374
1541
  if (s || (s = this.tableOptions.getEditRenderer), s)
1375
1542
  if (this.editorRenderer = s(e, t), this.editorRenderer) {
1376
1543
  this.editorRendererRow = e, this.editorRendererColumn = t, this.editing = !0, this.repaint();
1377
- const o = document.querySelector("input.ge-table-cell-editor-input");
1378
- o && o.focus();
1544
+ const i = document.querySelector("input.ge-table-cell-editor-input");
1545
+ i && i.focus();
1379
1546
  } else
1380
1547
  this.resetEditorRenderer();
1381
1548
  }
1549
+ /**
1550
+ * Adjusts the content after scrolling and initiates a repaint of the component.
1551
+ *
1552
+ * @return {void}
1553
+ */
1382
1554
  repaint() {
1383
1555
  this.adjustAfterScrolling();
1384
1556
  }
1557
+ /**
1558
+ * Repaints the UI by resetting the size of the wrapper div,
1559
+ * adjusting the containers and rows, and performing additional adjustments
1560
+ * after scrolling.
1561
+ *
1562
+ * @return {void} This method does not return any value.
1563
+ */
1564
+ repaintHard() {
1565
+ this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.adjustAfterScrolling();
1566
+ }
1567
+ /**
1568
+ * Adjusts the table after scrolling. This method performs various adjustments
1569
+ * to the table's appearance and behavior after a scroll event occurs.
1570
+ */
1385
1571
  adjustAfterScrolling() {
1386
1572
  var e;
1387
1573
  for (const t of this.removables)
@@ -1404,10 +1590,23 @@ class Je extends Ye {
1404
1590
  "ge-table-body-west-vertical-border"
1405
1591
  ));
1406
1592
  }
1593
+ /**
1594
+ * Checks if the scroll position should be saved and saves it.
1595
+ *
1596
+ * @return {void}
1597
+ */
1407
1598
  checkForScrollPosSaving() {
1408
1599
  var e, t;
1409
1600
  this.storeScrollPosStateService && ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreScrollPosition) && this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
1410
1601
  }
1602
+ /**
1603
+ * Updates the cells in the table with the provided values and optionally repaints all cells.
1604
+ *
1605
+ * @param {TableCellUpdateEventIf[]} events - The array of events containing information about the cells to update.
1606
+ * @param {boolean} repaintAll - Optional. If true, repaints all cells after updating. Defaults to false.
1607
+ *
1608
+ * @returns {void}
1609
+ */
1411
1610
  updateCells(e, t = !1) {
1412
1611
  e.forEach(
1413
1612
  (s) => {
@@ -1415,6 +1614,45 @@ class Je extends Ye {
1415
1614
  }
1416
1615
  ), t && this.repaint();
1417
1616
  }
1617
+ /**
1618
+ * Rerenders the content of a table cell based on the given parameters.
1619
+ *
1620
+ * @param {TableCellUpdateEventIf} area - The area of the table.
1621
+ * @param {number} rowIndex - The index of the row.
1622
+ * @param {number} columnIndex - The index of the column.
1623
+ * @param {any} value - The new value to be displayed in the cell.
1624
+ * @param {string[]} cssClasses - An array of CSS classes to be applied to the cell.
1625
+ */
1626
+ rerenderCellContent({ area: e, rowIndex: t, columnIndex: s, value: o, cssClasses: i }) {
1627
+ const l = this.tableModel.getAreaModel(e), n = 'div[data-col-index="' + s + '"][data-row-index="' + t + '"][data-area="' + e + '"]', a = document.querySelector(n);
1628
+ if (a) {
1629
+ let c;
1630
+ const h = this.editorRenderer && this.editorRendererRow === t && this.editorRendererColumn === s ? this.editorRenderer : l.getCellRenderer(t, s);
1631
+ if (a.innerText = "", this.applyCssClasses(a, i), h)
1632
+ c = h.render(a, t, s, e, l, o, this.dom.domService), c && this.cleanupFunctions[e].push(c);
1633
+ else {
1634
+ const b = `${o}`;
1635
+ this.dom.addLabelDiv(a, b, !1, t, s, e);
1636
+ }
1637
+ const g = l.getCustomClassesAt(t, s);
1638
+ g.length && this.dom.addClasses(g, a);
1639
+ const f = l.getCustomStyleAt(t, s);
1640
+ if (f)
1641
+ for (const b in f)
1642
+ this.dom.setStyle(a, b, f[b]);
1643
+ }
1644
+ }
1645
+ /**
1646
+ * Stores the widths of all columns in the table.
1647
+ *
1648
+ * @protected
1649
+ * @function storeColumnWidths
1650
+ * @returns {void}
1651
+ */
1652
+ storeColumnWidths() {
1653
+ const e = this.tableModel.getColumnDefs();
1654
+ e != null && e.length && (this.storedColumnWidths = e.map((t, s) => this.tableModel.getColumnWidth(s)));
1655
+ }
1418
1656
  getAreaAndSideIdentByAttr(e) {
1419
1657
  if (e) {
1420
1658
  const t = this.getStringByAttr(e, "data-area"), s = this.getStringByAttr(e, "data-side");
@@ -1423,6 +1661,15 @@ class Je extends Ye {
1423
1661
  }
1424
1662
  return [void 0, void 0];
1425
1663
  }
1664
+ /**
1665
+ * Retrieves the specified area from the grid layout.
1666
+ *
1667
+ * @param {string} areaIdent - The identifier for the area ('header', 'body', or 'footer').
1668
+ * @param {string} sideIdent - The identifier for the side of the area ('west', 'center', or 'east').
1669
+ * @protected
1670
+ * @returns {HTMLElement} - The requested area element.
1671
+ * @throws {Error} - If the area identifier or side identifier is incorrect.
1672
+ */
1426
1673
  getArea(e, t) {
1427
1674
  if (e === "header") {
1428
1675
  if (t === "west")
@@ -1448,110 +1695,140 @@ class Je extends Ye {
1448
1695
  }
1449
1696
  throw Error(`Wrong area identifier: row:${e}, col:${t}`);
1450
1697
  }
1698
+ /**
1699
+ * Adjusts the body of the table.
1700
+ *
1701
+ * @protected
1702
+ * @return {void}
1703
+ */
1451
1704
  adjustBody() {
1452
1705
  const e = this.areaBodyCenterGeo.height - this.tableModel.getContentHeightInPixel(), t = this.scrollFactorY * e;
1453
1706
  this.dom.setStyle(this.contentDiv, "top", `${this.scrollTop}px`), this.dom.setStyle(this.contentDiv, "left", `${this.scrollViewport.scrollLeft}px`), this.adjustArea("body", t);
1454
1707
  }
1708
+ /**
1709
+ * Returns a number value extracted from the specified attribute of the source element.
1710
+ *
1711
+ * @param {HTMLElement} srcElement - The source element from which to extract the attribute value.
1712
+ * @param {string} key - The attribute key to extract the value from.
1713
+ * @returns {number} - The extracted number value, or -1 if the attribute was not found or not a valid number.
1714
+ * @protected
1715
+ */
1455
1716
  getNumberByAttr(e, t) {
1456
1717
  var s;
1457
1718
  if (e) {
1458
- const i = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
1459
- if (i)
1460
- return Number(i);
1719
+ const o = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
1720
+ if (o)
1721
+ return Number(o);
1461
1722
  }
1462
1723
  return -1;
1463
1724
  }
1725
+ /**
1726
+ * Retrieves the value of the specified attribute from the nearest ancestor element that has the attribute.
1727
+ *
1728
+ * @param {HTMLElement} srcElement - The source element from which to start searching for the nearest ancestor element.
1729
+ * @param {string} key - The name of the attribute to retrieve.
1730
+ * @returns {string} The value of the specified attribute, or an empty string if the attribute is not found.
1731
+ * @protected
1732
+ */
1464
1733
  getStringByAttr(e, t) {
1465
1734
  var s;
1466
1735
  if (e) {
1467
- const i = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
1468
- if (i)
1469
- return i;
1736
+ const o = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
1737
+ if (o)
1738
+ return o;
1470
1739
  }
1471
1740
  return "";
1472
1741
  }
1742
+ /**
1743
+ * Adjusts the layout and positioning of the specified area in the table.
1744
+ * This method is used internally and should not be called directly.
1745
+ *
1746
+ * @param {AreaIdent} areaIdent - The identifier of the area to adjust (e.g. header, body, footer).
1747
+ * @param {number} [yStart=0] - The starting y-position for the layout adjustments.
1748
+ * @protected
1749
+ */
1473
1750
  adjustArea(e, t = 0) {
1474
- var S;
1475
- const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"), r = i.child.clientHeight;
1476
- s.child.innerText = "", i.child.innerText = "", o.child.innerText = "";
1477
- const n = 0, a = this.areaBodyCenterGeo.width, h = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), c = d.getRowCount();
1751
+ var p;
1752
+ const s = this.getArea(e, "west"), o = this.getArea(e, "center"), i = this.getArea(e, "east"), l = o.child.clientHeight;
1753
+ s.child.innerText = "", o.child.innerText = "", i.child.innerText = "";
1754
+ const n = 0, a = this.areaBodyCenterGeo.width, c = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), h = d.getRowCount();
1478
1755
  for (; this.cleanupFunctions[e].length; ) {
1479
- const f = this.cleanupFunctions[e].shift();
1480
- f && f();
1481
- }
1482
- let p = t;
1483
- const g = this.tableModel.getColumnCount(), u = this.tableModel.getFixedRightColumnCount(), m = this.tableModel.getFixedLeftColumnCount();
1484
- for (let f = 0; f < c; f++) {
1485
- const M = p, C = f === c - 1, E = this.tableModel.getRowHeight(e, f);
1486
- if (M + E > 0) {
1487
- this.firstVisibleRowIndex = f;
1488
- let v = { left: n, width: a, height: E, top: M, index: f }, w = this.dom.addRowDiv(i, v, f, e, "center");
1489
- const R = m;
1756
+ const u = this.cleanupFunctions[e].shift();
1757
+ u && u();
1758
+ }
1759
+ let g = t;
1760
+ const f = this.tableModel.getColumnCount(), b = this.tableModel.getFixedRightColumnCount(), S = this.tableModel.getFixedLeftColumnCount();
1761
+ for (let u = 0; u < h; u++) {
1762
+ const v = g, C = u === h - 1, E = this.tableModel.getRowHeight(e, u);
1763
+ if (v + E > 0) {
1764
+ this.firstVisibleRowIndex = u;
1765
+ let y = { left: n, width: a, height: E, top: v, index: u }, m = this.dom.addRowDiv(o, y, u, e, "center");
1766
+ const k = S;
1490
1767
  if (this.adjustColumnsToRowParent({
1491
1768
  areaIdent: e,
1492
1769
  sideIdent: "center",
1493
1770
  areaModel: d,
1494
- geo: v,
1495
- parent: w,
1496
- rowIndex: f,
1497
- columnIndexStart: R,
1498
- columnIndexEnd: g - u - 1,
1771
+ geo: y,
1772
+ parent: m,
1773
+ rowIndex: u,
1774
+ columnIndexStart: k,
1775
+ columnIndexEnd: f - b - 1,
1499
1776
  verticalFixed: !1,
1500
1777
  lastRowOfModel: C
1501
- }), h.left > 0 && (v = { left: n, width: this.areaBodyWestGeo.width, height: E, top: M, index: f }, w = this.dom.addRowDiv(s, v, f, e, "west"), this.adjustColumnsToRowParent({
1778
+ }), c.left > 0 && (y = { left: n, width: this.areaBodyWestGeo.width, height: E, top: v, index: u }, m = this.dom.addRowDiv(s, y, u, e, "west"), this.adjustColumnsToRowParent({
1502
1779
  areaIdent: e,
1503
1780
  sideIdent: "west",
1504
1781
  areaModel: d,
1505
- geo: v,
1506
- parent: w,
1507
- rowIndex: f,
1782
+ geo: y,
1783
+ parent: m,
1784
+ rowIndex: u,
1508
1785
  columnIndexStart: 0,
1509
- columnIndexEnd: R - 1,
1786
+ columnIndexEnd: k - 1,
1510
1787
  verticalFixed: !0,
1511
1788
  lastRowOfModel: C
1512
- })), h.right > 0 && (v = { left: n, width: this.areaBodyEastGeo.width, height: E, top: M, index: f }, w = this.dom.addRowDiv(o, v, f, e, "east"), this.adjustColumnsToRowParent({
1789
+ })), c.right > 0 && (y = { left: n, width: this.areaBodyEastGeo.width, height: E, top: v, index: u }, m = this.dom.addRowDiv(i, y, u, e, "east"), this.adjustColumnsToRowParent({
1513
1790
  areaIdent: e,
1514
1791
  sideIdent: "east",
1515
1792
  areaModel: d,
1516
- geo: v,
1517
- parent: w,
1518
- rowIndex: f,
1519
- columnIndexStart: g - u,
1520
- columnIndexEnd: g - 1,
1793
+ geo: y,
1794
+ parent: m,
1795
+ rowIndex: u,
1796
+ columnIndexStart: f - b,
1797
+ columnIndexEnd: f - 1,
1521
1798
  verticalFixed: !0,
1522
1799
  lastRowOfModel: C
1523
- })), e === "header" && this.tree && f === c - 1) {
1800
+ })), e === "header" && this.tree && u === h - 1) {
1524
1801
  const T = this.dom.applyStyle(
1525
1802
  this.dom.setAttribute(
1526
- this.dom.addDiv(w, new O(16, 20, 20, 8)),
1803
+ this.dom.addDiv(m, new O(16, 20, 20, 8)),
1527
1804
  "data-ge-action",
1528
1805
  "toggleExpandCollapseAll"
1529
1806
  ),
1530
1807
  { cursor: "pointer" }
1531
- ), I = this.tableOptions.treeOptions.arrowExpandCollapseAll;
1532
- if (I) {
1533
- const V = this.dom.domService.createText(I.content);
1534
- this.dom.domService.appendChild(T, V), I.style && this.dom.applyStyleString(T, I.style);
1808
+ ), D = this.tableOptions.treeOptions.arrowExpandCollapseAll;
1809
+ if (D) {
1810
+ const _ = this.dom.domService.createText(D.content);
1811
+ this.dom.domService.appendChild(T, _), D.style && this.dom.applyStyleString(T, D.style);
1535
1812
  }
1536
1813
  }
1537
1814
  }
1538
- if (p = p + E, p > r)
1815
+ if (g = g + E, g > l)
1539
1816
  break;
1540
1817
  }
1541
1818
  if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
1542
- const f = ((S = this.colAndRowspanModels[e]) == null ? void 0 : S.getRanges()) ?? [];
1543
- if (f.length)
1544
- for (const M of f) {
1545
- let C = 0, E = i.child, v = "center";
1546
- if (M.c1 < m)
1547
- E = s.child, v = "west";
1548
- else if (u > 0 && M.c1 >= g - u)
1549
- E = o.child, v = "east";
1819
+ const u = ((p = this.colAndRowspanModels[e]) == null ? void 0 : p.getRanges()) ?? [];
1820
+ if (u.length)
1821
+ for (const v of u) {
1822
+ let C = 0, E = o.child, y = "center";
1823
+ if (v.c1 < S)
1824
+ E = s.child, y = "west";
1825
+ else if (b > 0 && v.c1 >= f - b)
1826
+ E = i.child, y = "east";
1550
1827
  else {
1551
- const w = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1552
- C = this.scrollFactorX * w - this.areaBodyWestGeo.width, v = "center";
1828
+ const m = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1829
+ C = this.scrollFactorX * m - this.areaBodyWestGeo.width, y = "center";
1553
1830
  }
1554
- this.drawBigCell(M, C, t, d, E, v);
1831
+ this.drawBigCell(v, C, t, d, E, y);
1555
1832
  }
1556
1833
  }
1557
1834
  }
@@ -1565,128 +1842,153 @@ class Je extends Ye {
1565
1842
  * @param sideIdent SideIdent (west,center,east)
1566
1843
  * @protected
1567
1844
  */
1568
- drawBigCell(e, t, s, i, o, r) {
1569
- const n = s + this.getRowHeights(0, e.r1 - 1, i).reduce((S, f) => S + f, 0), a = this.tableModel.getColumnCount(), h = this.tableModel.getFixedRightColumnCount();
1845
+ drawBigCell(e, t, s, o, i, l) {
1846
+ const n = s + this.getRowHeights(0, e.r1 - 1, o).reduce((p, u) => p + u, 0), a = this.tableModel.getColumnCount(), c = this.tableModel.getFixedRightColumnCount();
1570
1847
  let d = 0;
1571
- h > 0 && e.c1 >= a - h && (d = a - h);
1572
- const c = t + this.getColumnWidths(d, e.c1 - 1).reduce((S, f) => S + f, 0), p = this.getRowHeights(e.r1, e.r2, i).reduce((S, f) => S + f, 0), g = this.getColumnWidths(e.c1, e.c2).reduce((S, f) => S + f, 0);
1573
- let u = !1;
1574
- const m = this.getSelectionModel ? this.getSelectionModel() : void 0;
1575
- m && (u = m.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? (console.info("TODO here", e), this.renderCell({
1576
- areaModel: i,
1577
- areaIdent: i.areaIdent,
1578
- sideIdent: r,
1848
+ c > 0 && e.c1 >= a - c && (d = a - c);
1849
+ const h = t + this.getColumnWidths(d, e.c1 - 1).reduce((p, u) => p + u, 0), g = this.getRowHeights(e.r1, e.r2, o).reduce((p, u) => p + u, 0), f = this.getColumnWidths(e.c1, e.c2).reduce((p, u) => p + u, 0);
1850
+ let b = !1;
1851
+ const S = this.getSelectionModel ? this.getSelectionModel() : void 0;
1852
+ S && (b = S.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? this.renderCell({
1853
+ areaModel: o,
1854
+ areaIdent: o.areaIdent,
1855
+ sideIdent: l,
1579
1856
  rowIndex: e.r1,
1580
1857
  columnIndex: e.c1,
1581
- left: c,
1858
+ left: h,
1582
1859
  top: n,
1583
- width: g,
1584
- height: p,
1585
- parent: o,
1586
- cellSelected: u,
1860
+ width: f,
1861
+ height: g,
1862
+ parent: i,
1863
+ cellSelected: b,
1587
1864
  lastRowOfModel: !0,
1588
1865
  gammaRange: e.gammaRange
1589
- })) : this.renderCell({
1590
- areaModel: i,
1591
- areaIdent: i.areaIdent,
1592
- sideIdent: r,
1866
+ }) : this.renderCell({
1867
+ areaModel: o,
1868
+ areaIdent: o.areaIdent,
1869
+ sideIdent: l,
1593
1870
  rowIndex: e.r1,
1594
1871
  columnIndex: e.c1,
1595
- left: c,
1872
+ left: h,
1596
1873
  top: n,
1597
- width: g,
1598
- height: p,
1599
- parent: o,
1600
- cellSelected: u,
1874
+ width: f,
1875
+ height: g,
1876
+ parent: i,
1877
+ cellSelected: b,
1601
1878
  lastRowOfModel: !0,
1602
1879
  gammaRange: e.gammaRange
1603
- }), i.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
1880
+ }), o.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
1604
1881
  rowIndex: e.r1,
1605
1882
  columnIndex: e.c1,
1606
- cellLeft: c,
1883
+ cellLeft: h,
1607
1884
  cellTop: n,
1608
- cellWidth: g,
1609
- cellHeight: p,
1610
- parent: o
1885
+ cellWidth: f,
1886
+ cellHeight: g,
1887
+ parent: i
1611
1888
  });
1612
1889
  }
1890
+ /**
1891
+ * Finds the row index of an important rowspan cell in a given area model.
1892
+ *
1893
+ * @param {AreaModelIf} areaModel - The area model to search in.
1894
+ * @param {number} rowIndex - The current row index.
1895
+ * @param {number} colIndex - The current column index.
1896
+ * @returns {number} - The row index of the important rowspan cell, or -1 if not found.
1897
+ * @protected
1898
+ */
1613
1899
  findRowOfImportantRowspanCell(e, t, s) {
1614
- const i = e.getMaxRowspan();
1615
- for (let o = t - 1; o > -1; o--) {
1616
- const r = e.getRowspanAt(o, s);
1617
- if (r > 1 && o + r + 1 >= t)
1618
- return o;
1619
- if (t - o > i)
1900
+ const o = e.getMaxRowspan();
1901
+ for (let i = t - 1; i > -1; i--) {
1902
+ const l = e.getRowspanAt(i, s);
1903
+ if (l > 1 && i + l + 1 >= t)
1904
+ return i;
1905
+ if (t - i > o)
1620
1906
  return -1;
1621
1907
  }
1622
1908
  return -1;
1623
1909
  }
1910
+ /**
1911
+ * Adjusts the columns to fit the width of the row's parent element.
1912
+ *
1913
+ * @param {ArgsAdjustColumnsToRowParentParams} params - The parameters for adjusting the columns.
1914
+ * @protected
1915
+ * @return {void}
1916
+ */
1624
1917
  adjustColumnsToRowParent({
1625
1918
  areaIdent: e,
1626
1919
  sideIdent: t,
1627
1920
  areaModel: s,
1628
- geo: i,
1629
- parent: o,
1630
- rowIndex: r,
1921
+ geo: o,
1922
+ parent: i,
1923
+ rowIndex: l,
1631
1924
  columnIndexStart: n,
1632
1925
  columnIndexEnd: a,
1633
- verticalFixed: h = !1,
1926
+ verticalFixed: c = !1,
1634
1927
  lastRowOfModel: d = !1
1635
1928
  }) {
1636
- var m;
1929
+ var S;
1637
1930
  this.scrollViewportLeft = this.scrollViewport.scrollLeft;
1638
- let c = 0;
1639
- if (!h) {
1640
- const S = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1641
- c = this.scrollFactorX * S;
1642
- }
1643
- const p = 0, g = !!(e === "body" && t);
1644
- let u = c;
1645
- for (let S = n; S <= a; S++) {
1646
- const f = u, M = this.tableModel.getColumnWidth(S);
1647
- if (M > 0 && f + M > 0) {
1648
- let C = i.height;
1649
- const E = s.getRowspanAt(r, S), v = s.getColspanAt(r, S);
1650
- E > 1 && (C = this.getRowHeights(r, r + E - 1, s).reduce((T, I) => T + I, 0));
1651
- let w = M;
1652
- v > 1 && (w = this.getColumnWidths(S, S + v - 1).reduce((T, I) => T + I, 0));
1653
- let R = !1;
1654
- if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (m = this.colAndRowspanModels[e]) != null && m.isInRange(r, S) && (R = !0), this.draggingTargetColumnIndex === S && e !== "header") {
1655
- this.renderDragTargetDiv(o, f, p, w, C);
1656
- const T = { left: f, top: p, width: w, height: C };
1657
- this.dom.addColumnBorderDivs(this.tableOptions, o, T, e, t);
1931
+ let h = 0;
1932
+ if (!c) {
1933
+ const p = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1934
+ h = this.scrollFactorX * p;
1935
+ }
1936
+ const g = 0, f = !!(e === "body" && t);
1937
+ let b = h;
1938
+ for (let p = n; p <= a; p++) {
1939
+ const u = b, v = this.tableModel.getColumnWidth(p);
1940
+ if (v > 0 && u + v > 0) {
1941
+ let C = o.height;
1942
+ const E = s.getRowspanAt(l, p), y = s.getColspanAt(l, p);
1943
+ E > 1 && (C = this.getRowHeights(l, l + E - 1, s).reduce((T, D) => T + D, 0));
1944
+ let m = v;
1945
+ y > 1 && (m = this.getColumnWidths(p, p + y - 1).reduce((T, D) => T + D, 0));
1946
+ let k = !1;
1947
+ if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (S = this.colAndRowspanModels[e]) != null && S.isInRange(l, p) && (k = !0), this.draggingTargetColumnIndex === p && e !== "header") {
1948
+ this.renderDragTargetDiv(i, u, g, m, C);
1949
+ const T = { left: u, top: g, width: m, height: C };
1950
+ this.dom.addColumnBorderDivs(this.tableOptions, i, T, e, t);
1658
1951
  } else {
1659
- const T = this.renderSelectedBackgroundDiv(R, g, t, s, r, S, o, f, p, w, C);
1660
- R || this.renderCell({
1952
+ const T = this.renderSelectedBackgroundDiv(k, f, t, s, l, p, i, u, g, m, C);
1953
+ "gammaCells" in s && s.getValueAt(l, p) && (k = !1), k || this.renderCell({
1661
1954
  areaModel: s,
1662
1955
  areaIdent: e,
1663
1956
  sideIdent: t,
1664
- rowIndex: r,
1665
- columnIndex: S,
1666
- left: f,
1667
- top: p,
1668
- width: w,
1957
+ rowIndex: l,
1958
+ columnIndex: p,
1959
+ left: u,
1960
+ top: g,
1961
+ width: m,
1669
1962
  height: C,
1670
- parent: o,
1963
+ parent: i,
1671
1964
  cellSelected: T,
1672
1965
  lastRowOfModel: d,
1673
1966
  gammaRange: !0
1674
1967
  }), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
1675
- rowIndex: r,
1676
- columnIndex: S,
1677
- cellLeft: f,
1678
- cellTop: p,
1679
- cellWidth: w,
1968
+ rowIndex: l,
1969
+ columnIndex: p,
1970
+ cellLeft: u,
1971
+ cellTop: g,
1972
+ cellWidth: m,
1680
1973
  cellHeight: C,
1681
- parent: o
1974
+ parent: i
1682
1975
  });
1683
1976
  }
1684
1977
  }
1685
- if (u = u + M, u > this.areaBodyCenterGeo.width)
1978
+ if (b = b + v, b > this.areaBodyCenterGeo.width)
1686
1979
  break;
1687
1980
  }
1688
- this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new O(u - 1, 1, i.height, 0), o);
1981
+ this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new O(b - 1, 1, o.height, 0), i);
1689
1982
  }
1983
+ /**
1984
+ * Retrieves the column index of the tree arrow column in the table.
1985
+ *
1986
+ * @protected
1987
+ *
1988
+ * @returns {0 | 1} The column index of the tree arrow column.
1989
+ * Returns 0 if the checkbox is not visible,
1990
+ * otherwise returns 1.
1991
+ */
1690
1992
  getTreeArrowColumnIndex() {
1691
1993
  return this.tableOptions.showCheckboxWihoutExtraColumn ? 0 : this.tableModel.isRowCheckboxVisible() ? 1 : 0;
1692
1994
  }
@@ -1694,100 +1996,112 @@ class Je extends Ye {
1694
1996
  areaModel: e,
1695
1997
  areaIdent: t,
1696
1998
  sideIdent: s,
1697
- rowIndex: i,
1698
- index: o,
1699
- left: r,
1999
+ rowIndex: o,
2000
+ index: i,
2001
+ left: l,
1700
2002
  width: n,
1701
2003
  height: a,
1702
- top: h,
2004
+ top: c,
1703
2005
  parent: d,
1704
- lastRowOfModel: c,
1705
- gammaRange: p
2006
+ lastRowOfModel: h
1706
2007
  }) {
1707
- var ae;
1708
- const u = this.editorRenderer && this.editorRendererRow === i && this.editorRendererColumn === o ? this.editorRenderer : e.getCellRenderer(i, o), m = { left: r, width: n, height: a, top: h, index: o }, S = e.getRowByIndex(i);
1709
- let f = "none";
1710
- if (o === this.getTreeArrowColumnIndex() && Z(S)) {
1711
- const y = S;
1712
- (ae = y.children) != null && ae.length ? y.expanded ? f = "expanded" : f = "collapsed" : f = "hidden";
1713
- }
1714
- let C;
2008
+ var ge;
2009
+ const f = this.editorRenderer && this.editorRendererRow === o && this.editorRendererColumn === i ? this.editorRenderer : e.getCellRenderer(o, i), b = { left: l, width: n, height: a, top: c, index: i }, S = e.getRowByIndex(o);
2010
+ let p = "none";
2011
+ if (i === this.getTreeArrowColumnIndex() && ie(S)) {
2012
+ const x = S;
2013
+ (ge = x.children) != null && ge.length ? x.expanded ? p = "expanded" : p = "collapsed" : p = "hidden";
2014
+ }
2015
+ let v;
1715
2016
  if (t === "header") {
1716
- const y = this.tableModel.getColumnDef(o);
1717
- (!(y != null && y.sortIconVisible) || y != null && y.sortIconVisible()) && (C = y == null ? void 0 : y.sortState);
2017
+ const x = this.tableModel.getColumnDef(i);
2018
+ (!(x != null && x.sortIconVisible) || x != null && x.sortIconVisible()) && (v = x == null ? void 0 : x.sortState);
1718
2019
  }
1719
- const E = e.getValueAt(i, o), v = u ? "" : `${E}`, w = e.isRowChecked(i), R = this.dom.addColumnDiv(
1720
- d,
1721
- m,
1722
- i,
1723
- o,
1724
- t,
1725
- s,
1726
- v,
1727
- f,
1728
- this.tableOptions,
1729
- w,
1730
- C
1731
- ), T = e.getTooltipAt(i, o);
1732
- T && this.dom.setAttribute(R, "title", T);
1733
- const I = this.tableModel.getColumnDef(o);
1734
- I && I.classes[t] && this.dom.addClasses(I.classes[t], R);
1735
- let V;
1736
- u && (V = u.render(R, i, o, t, e, E, this.dom.domService));
1737
- const ne = e.getCustomClassesAt(i, o);
1738
- if (ne.length && this.dom.addClasses(ne, R), this.dom.addColumnBorderDivs(this.tableOptions, d, m, t, s), c && this.dom.addHorizontalBorder({ left: r, width: n, height: a, top: h + a }, d), this.getFocusModel && t === "body") {
1739
- const y = this.getFocusModel();
1740
- y != null && y.hasFocus(i, o) && this.dom.addFocusBorderDivs(d, m, {});
1741
- }
1742
- t === "header" && this.dom.setAttribute(R, "data-ge-action", "drag-column");
1743
- const z = e.getCustomStyleAt(i, o);
1744
- if (z)
1745
- for (const y in z)
1746
- this.dom.setStyle(R, y, z[y]);
1747
- return [R, V];
2020
+ const C = e.getValueAt(o, i), E = f ? "" : `${C}`, y = e.isRowChecked(o), m = this.dom.addColumnDiv(
2021
+ {
2022
+ parent: d,
2023
+ geo: b,
2024
+ rowIndex: o,
2025
+ columnIndex: i,
2026
+ areaIdent: t,
2027
+ sideIdent: s,
2028
+ text: E,
2029
+ treeArrow: p,
2030
+ tableOptions: this.tableOptions,
2031
+ checkedType: y,
2032
+ sortState: v
2033
+ }
2034
+ ), k = e.getTooltipAt(o, i);
2035
+ k && this.dom.setAttribute(m, "title", k);
2036
+ const T = this.tableModel.getColumnDef(i);
2037
+ T && T.classes[t] && this.dom.addClasses(T.classes[t], m);
2038
+ let D;
2039
+ f && (D = f.render(m, o, i, t, e, C, this.dom.domService));
2040
+ const _ = e.getCustomClassesAt(o, i);
2041
+ if (_.length && this.dom.addClasses(_, m), this.dom.addColumnBorderDivs(this.tableOptions, d, b, t, s), h && this.dom.addHorizontalBorder({ left: l, width: n, height: a, top: c + a }, d), this.getFocusModel && t === "body") {
2042
+ const x = this.getFocusModel();
2043
+ x != null && x.hasFocus(o, i) && this.dom.addFocusBorderDivs(d, b, {});
2044
+ }
2045
+ t === "header" && this.dom.setAttribute(m, "data-ge-action", "drag-column");
2046
+ const Q = e.getCustomStyleAt(o, i);
2047
+ if (Q)
2048
+ for (const x in Q)
2049
+ this.dom.setStyle(m, x, Q[x]);
2050
+ return [m, D];
1748
2051
  }
2052
+ /**
2053
+ * Applies CSS classes to an HTML element.
2054
+ *
2055
+ * @param {HTMLDivElement} ele - The HTML element to which CSS classes will be applied.
2056
+ * @param {Object.<string, boolean>} cssClasses - An object containing CSS class names as keys and boolean values indicating whether to apply or remove the class.
2057
+ * @protected
2058
+ */
1749
2059
  applyCssClasses(e, t = {}) {
1750
- e && Object.entries(t).forEach(([s, i]) => {
1751
- i ? this.dom.addClass(s, e) : this.dom.removeClass(s, e);
2060
+ e && Object.entries(t).forEach(([s, o]) => {
2061
+ o ? this.dom.addClass(s, e) : this.dom.removeClass(s, e);
1752
2062
  });
1753
2063
  }
1754
- rerenderCellContent({ area: e, rowIndex: t, columnIndex: s, value: i, cssClasses: o }) {
1755
- const r = this.tableModel.getAreaModel(e), n = 'div[data-col-index="' + s + '"][data-row-index="' + t + '"][data-area="' + e + '"]', a = document.querySelector(n);
1756
- if (a) {
1757
- let h;
1758
- const c = this.editorRenderer && this.editorRendererRow === t && this.editorRendererColumn === s ? this.editorRenderer : r.getCellRenderer(t, s);
1759
- if (a.innerText = "", this.applyCssClasses(a, o), c)
1760
- h = c.render(a, t, s, e, r, i, this.dom.domService), h && this.cleanupFunctions[e].push(h);
1761
- else {
1762
- const u = `${i}`;
1763
- this.dom.addLabelDiv(a, u, !1, t, s, e);
1764
- }
1765
- const p = r.getCustomClassesAt(t, s);
1766
- p.length && this.dom.addClasses(p, a);
1767
- const g = r.getCustomStyleAt(t, s);
1768
- if (g)
1769
- for (const u in g)
1770
- this.dom.setStyle(a, u, g[u]);
1771
- }
1772
- }
2064
+ /**
2065
+ * Retrieves the column widths of a table within a specified range.
2066
+ *
2067
+ * @param {number} startIndex - The index of the first column to retrieve the width of.
2068
+ * @param {number} endIndex - The index of the last column to retrieve the width of.
2069
+ *
2070
+ * @return {number[]} An array containing the widths of the columns within the specified range.
2071
+ */
1773
2072
  getColumnWidths(e, t) {
1774
2073
  const s = [];
1775
- for (let i = e; i <= t; i++)
1776
- s.push(this.tableModel.getColumnWidth(i));
2074
+ for (let o = e; o <= t; o++)
2075
+ s.push(this.tableModel.getColumnWidth(o));
1777
2076
  return s;
1778
2077
  }
2078
+ /**
2079
+ * Retrieves the heights of rows within a specified range.
2080
+ *
2081
+ * @param {number} startIndex - The index of the first row in the range.
2082
+ * @param {number} endIndex - The index of the last row in the range.
2083
+ * @param {AreaModelIf} areaModel - The area model.
2084
+ * @return {number[]} - An array containing the heights of the rows within the specified range.
2085
+ */
1779
2086
  getRowHeights(e, t, s) {
1780
- const i = [];
1781
- for (let o = e; o <= t; o++)
1782
- i.push(s.getRowHeight(o));
1783
- return i;
2087
+ const o = [];
2088
+ for (let i = e; i <= t; i++)
2089
+ o.push(s.getRowHeight(i));
2090
+ return o;
1784
2091
  }
2092
+ /**
2093
+ * Adjusts the position and size of the hover row based on the mouse move event.
2094
+ *
2095
+ * @param {GeMouseEvent} mouseMoveEvent - The mouse move event.
2096
+ *
2097
+ * @return {void}
2098
+ */
1785
2099
  adjustHoverRows(e) {
1786
2100
  if (this.tableOptions.hoverRowVisible && e.rowIndex > -1) {
1787
- const t = this.hostElement.clientWidth, s = this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex), i = e.rowTop + this.areaHeaderCenter.parent.clientHeight - this.scrollTop;
2101
+ const t = this.hostElement.clientWidth, s = this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex), o = e.rowTop + this.areaHeaderCenter.parent.clientHeight - this.scrollTop;
1788
2102
  this.dom.applyStyle(this.hoverRow, {
1789
2103
  left: "0",
1790
- top: i + "px",
2104
+ top: o + "px",
1791
2105
  width: t + "px",
1792
2106
  height: s + "px",
1793
2107
  display: "block"
@@ -1795,16 +2109,31 @@ class Je extends Ye {
1795
2109
  } else
1796
2110
  this.hideHoverRow();
1797
2111
  }
2112
+ /**
2113
+ * Hides the hover row by applying 'display: none' style to it.
2114
+ *
2115
+ * @protected
2116
+ * @function
2117
+ * @name hideHoverRow
2118
+ * @memberof ClassName
2119
+ *
2120
+ * @returns {void}
2121
+ */
1798
2122
  hideHoverRow() {
1799
2123
  this.dom.applyStyle(this.hoverRow, {
1800
2124
  display: "none"
1801
2125
  });
1802
2126
  }
2127
+ /**
2128
+ * Adjusts the position and size of the hover column based on the mouse move event.
2129
+ *
2130
+ * @param {GeMouseEvent} mouseMoveEvent - The mouse move event object.
2131
+ */
1803
2132
  adjustHoverColumns(e) {
1804
2133
  if (this.tableOptions.hoverColumnVisible && e.rowIndex > -1) {
1805
- 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;
2134
+ const t = this.hostElement.clientHeight, s = this.tableModel.getColumnWidth(e.columnIndex), o = this.areaBodyWestGeo.width, i = e.columnLeft + this.tableModel.getPadding().left - this.scrollLeft - o;
1806
2135
  this.dom.applyStyle(this.hoverColumn, {
1807
- left: o + "px",
2136
+ left: i + "px",
1808
2137
  top: "0px",
1809
2138
  width: s + "px",
1810
2139
  height: t + "px",
@@ -1813,80 +2142,236 @@ class Je extends Ye {
1813
2142
  } else
1814
2143
  this.hideHoverColumn();
1815
2144
  }
2145
+ /**
2146
+ * Hide hover column.
2147
+ *
2148
+ * This method hides the hover column by applying a style of 'display: none'
2149
+ * to the element representing the hover column.
2150
+ *
2151
+ * @protected
2152
+ * @memberof ClassName
2153
+ */
1816
2154
  hideHoverColumn() {
1817
2155
  this.dom.applyStyle(this.hoverColumn, {
1818
2156
  display: "none"
1819
2157
  });
1820
2158
  }
2159
+ /**
2160
+ * Executes a function after a specified delay, ensuring that the function is called only once within that delay period.
2161
+ *
2162
+ * @param {() => void} fn - The function to be executed.
2163
+ * @param {number} [delay=1000] - The delay in milliseconds before executing the function.
2164
+ *
2165
+ * @return {undefined}
2166
+ */
1821
2167
  debounce(e, t = 1e3) {
1822
2168
  this.debounceTimeout && clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(e.bind(this), t);
1823
2169
  }
1824
- renderDragTargetDiv(e, t, s, i, o) {
1825
- const r = this.dom.applyStylePosistionAbsolute(
2170
+ /**
2171
+ * Adjusts the dragging column during a mouse move event.
2172
+ *
2173
+ * @param {GeMouseEvent} mouseMoveEvent - The mouse move event.
2174
+ * @param {number} sourceColumnIndex - The index of the source column.
2175
+ * @param {boolean} firstDraggingRendering - Indicates if it's the first rendering of the dragging column.
2176
+ */
2177
+ adjustDraggingColumn(e, t, s) {
2178
+ var o, i;
2179
+ if (this.dragging) {
2180
+ const l = this.hostElement.clientHeight, n = this.storedColumnWidths[t];
2181
+ if ((o = e.originalEvent) != null && o.clientX) {
2182
+ const d = { left: ((i = e.originalEvent) == null ? void 0 : i.clientX) - n / 2, width: n, height: l, top: 0, index: t };
2183
+ this.dom.applyStyle(this.draggingColumn, {
2184
+ background: "rgba(128,128,128,0.2)",
2185
+ display: "block",
2186
+ overfllow: "clip"
2187
+ }), this.dom.applyStyleInPx(this.draggingColumn, d), s && this.renderContentOfDraggingColumn(d);
2188
+ }
2189
+ } else
2190
+ this.hideDraggingColumn();
2191
+ }
2192
+ /**
2193
+ * Renders the content of a dragging column.
2194
+ *
2195
+ * @param {GeoData} columnGeo - The geographic data of the column.
2196
+ *
2197
+ * @returns {number} The y-coordinate of the rendered content.
2198
+ */
2199
+ renderContentOfDraggingColumn(e) {
2200
+ const t = this.renderContentOfDraggingColumnForArea(e, "header", 0);
2201
+ this.renderContentOfDraggingColumnForArea(e, "body", t);
2202
+ }
2203
+ /**
2204
+ * Renders the content of the dragging column for a specific area.
2205
+ *
2206
+ * @param {GeoData} columnGeo - The geometry data of the dragging column.
2207
+ * @param {AreaIdent} areaIdent - The identifier of the area.
2208
+ * @param {number} [y=0] - The starting y-position.
2209
+ * @return {number} The final y-position after rendering all the content.
2210
+ */
2211
+ renderContentOfDraggingColumnForArea(e, t, s = 0) {
2212
+ const o = "center", i = this.tableModel.getAreaModel(t), l = i == null ? void 0 : i.getRowCount();
2213
+ if (l) {
2214
+ const n = e.index ?? 0, a = this.draggingColumn;
2215
+ for (let c = 0; c < l; c++) {
2216
+ const d = s, h = i.getRowHeight(c), g = { left: 0, width: e.width, height: h, top: d, index: c }, f = i.getValueAt(c, n), b = i.getCellRenderer(c, n), S = b ? "" : `${f}`, p = {
2217
+ parent: a,
2218
+ geo: g,
2219
+ rowIndex: c,
2220
+ columnIndex: n,
2221
+ areaIdent: t,
2222
+ sideIdent: o,
2223
+ text: S
2224
+ }, u = this.dom.addColumnDiv(p);
2225
+ let v;
2226
+ b && (v = b.render(u, c, n, t, i, f, this.dom.domService), v && this.cleanupFunctions[t].push(v));
2227
+ const C = i.getCustomClassesAt(c, n);
2228
+ C.length && this.dom.addClasses(C, u);
2229
+ const E = this.tableModel.getColumnDef(n);
2230
+ E && E.classes[t] && this.dom.addClasses(E.classes[t], u), this.dom.addColumnBorderDivs(this.tableOptions, a, g, t, o);
2231
+ const y = i.getCustomStyleAt(c, n);
2232
+ if (y)
2233
+ for (const m in y)
2234
+ this.dom.setStyle(u, m, y[m]);
2235
+ s = s + h;
2236
+ }
2237
+ }
2238
+ return s;
2239
+ }
2240
+ /**
2241
+ * Hides the dragging column by applying a 'display: none' style to it.
2242
+ * This method is protected and can only be accessed within the class.
2243
+ *
2244
+ * @return {void}
2245
+ */
2246
+ hideDraggingColumn() {
2247
+ this.dom.applyStyle(this.draggingColumn, {
2248
+ display: "none"
2249
+ });
2250
+ }
2251
+ /**
2252
+ * Renders a draggable target div element.
2253
+ *
2254
+ * @param {HTMLDivElement} parent - The parent element where the target div will be appended to.
2255
+ * @param {number} left - The left position of the target div in pixels.
2256
+ * @param {number} top - The top position of the target div in pixels.
2257
+ * @param {number} width - The width of the target div in pixels.
2258
+ * @param {number} height - The height of the target div in pixels.
2259
+ * @return {HTMLDivElement} - The rendered draggable target div element.
2260
+ */
2261
+ renderDragTargetDiv(e, t, s, o, i) {
2262
+ const l = this.dom.applyStylePosistionAbsolute(
1826
2263
  this.dom.createDivWithClass("ge-table-drop-zone", e)
1827
2264
  );
1828
- 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;
1829
- }
1830
- renderSelectedBackgroundDiv(e, t, s, i, o, r, n, a, h, d, c) {
1831
- let p = !1;
1832
- if (!e && t && i.isSelectable(o, r) && this.getSelectionModel) {
1833
- const g = this.getSelectionModel();
1834
- if (g) {
1835
- const u = g.getSelectionCount(o, r);
1836
- p = u > 0;
1837
- for (let m = 0; m < u; m++) {
1838
- const S = this.dom.applyStylePosistionAbsolute(
2265
+ return this.dom.setStyle(l, "left", `${t}px`), this.dom.setStyle(l, "top", `${s}px`), this.dom.setStyle(l, "width", `${o}px`), this.dom.setStyle(l, "height", `${i}px`), l;
2266
+ }
2267
+ /**
2268
+ * Render selected background div.
2269
+ *
2270
+ * @private
2271
+ * @param {boolean} skip - Whether to skip rendering.
2272
+ * @param {boolean} renderSelection - Whether to render the selection.
2273
+ * @param {SideIdent} sideIdent - The side identifier.
2274
+ * @param {AreaModelIf} areaModel - The area model.
2275
+ * @param {number} rowIndex - The row index.
2276
+ * @param {number} index - The index.
2277
+ * @param {HTMLDivElement} parent - The parent div element.
2278
+ * @param {number} left - The left position.
2279
+ * @param {number} top - The top position.
2280
+ * @param {number} width - The width of the div.
2281
+ * @param {number} height - The height of the div.
2282
+ * @returns {boolean} - Whether the cell is selected.
2283
+ */
2284
+ renderSelectedBackgroundDiv(e, t, s, o, i, l, n, a, c, d, h) {
2285
+ let g = !1;
2286
+ if (!e && t && o.isSelectable(i, l) && this.getSelectionModel) {
2287
+ const f = this.getSelectionModel();
2288
+ if (f) {
2289
+ const b = f.getSelectionCount(i, l);
2290
+ g = b > 0;
2291
+ for (let S = 0; S < b; S++) {
2292
+ const p = this.dom.applyStylePosistionAbsolute(
1839
2293
  // ge-table-body-west-selected-range
1840
- this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`, n)
2294
+ this.dom.createDivWithClass(`ge-table-${o.areaIdent}-${s}-selected-range`, n)
1841
2295
  );
1842
- this.dom.setStyle(S, "left", `${a}px`), this.dom.setStyle(S, "top", `${h}px`), this.dom.setStyle(S, "width", `${d}px`), this.dom.setStyle(S, "height", `${c}px`);
2296
+ this.dom.setStyle(p, "left", `${a}px`), this.dom.setStyle(p, "top", `${c}px`), this.dom.setStyle(p, "width", `${d}px`), this.dom.setStyle(p, "height", `${h}px`);
1843
2297
  }
1844
2298
  }
1845
2299
  }
1846
- return p;
2300
+ return g;
1847
2301
  }
2302
+ /**
2303
+ * Renders a cell in the grid.
2304
+ *
2305
+ * @param {ArgsRenderCell} args - The arguments for rendering the cell.
2306
+ * @param {AreaModel} args.areaModel - The area model of the grid.
2307
+ * @param {string} args.areaIdent - The identifier of the area.
2308
+ * @param {string} args.sideIdent - The identifier of the side.
2309
+ * @param {number} args.rowIndex - The index of the row.
2310
+ * @param {number} args.columnIndex - The index of the column.
2311
+ * @param {number} args.left - The left position of the cell.
2312
+ * @param {number} args.top - The top position of the cell.
2313
+ * @param {number} args.width - The width of the cell.
2314
+ * @param {number} args.height - The height of the cell.
2315
+ * @param {HTMLElement} args.parent - The parent element of the cell.
2316
+ * @param {boolean} args.cellSelected - Indicates if the cell is selected.
2317
+ * @param {boolean} args.lastRowOfModel - Indicates if the cell is in the last row of the model.
2318
+ *
2319
+ * @returns {void}
2320
+ */
1848
2321
  renderCell({
1849
2322
  areaModel: e,
1850
2323
  areaIdent: t,
1851
2324
  sideIdent: s,
1852
- rowIndex: i,
1853
- columnIndex: o,
1854
- left: r,
2325
+ rowIndex: o,
2326
+ columnIndex: i,
2327
+ left: l,
1855
2328
  top: n,
1856
2329
  width: a,
1857
- height: h,
2330
+ height: c,
1858
2331
  parent: d,
1859
- cellSelected: c,
1860
- lastRowOfModel: p,
1861
- gammaRange: g
2332
+ cellSelected: h,
2333
+ lastRowOfModel: g
1862
2334
  }) {
1863
- const [u, m] = this.addAndRenderCellDiv({
2335
+ const [f, b] = this.addAndRenderCellDiv({
1864
2336
  areaModel: e,
1865
2337
  areaIdent: t,
1866
2338
  sideIdent: s,
1867
- rowIndex: i,
1868
- index: o,
1869
- left: r,
2339
+ rowIndex: o,
2340
+ index: i,
2341
+ left: l,
1870
2342
  width: a,
1871
- height: h,
2343
+ height: c,
1872
2344
  top: n,
1873
2345
  parent: d,
1874
- lastRowOfModel: p,
1875
- gammaRange: g
2346
+ lastRowOfModel: g
1876
2347
  });
1877
- c && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, u), m && this.cleanupFunctions[t].push(m);
2348
+ h && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, f), b && this.cleanupFunctions[t].push(b);
1878
2349
  }
1879
- renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight: r, parent: n }) {
1880
- const a = this.dom.domService, h = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = a.createElement("div");
1881
- a.setAttribute(d, "data-col-index", `${t}`), a.setAttribute(d, "data-row-index", `${e}`), a.setAttribute(d, "data-area", "header"), a.setAttribute(d, "data-ge-action", "resize-column"), a.addClass(d, "ge-table-column-resize-handle"), a.setStyle(d, "display", "clip"), a.setStyle(d, "position", "absolute"), a.setStyle(d, "cursor", "col-resize"), a.setStyle(d, "left", `${s + o - h}px`), a.setStyle(d, "top", `${i}px`), a.setStyle(d, "width", `${h}px`), a.setStyle(d, "height", `${r}px`), a.appendChild(n, d);
2350
+ /**
2351
+ * Render the header cell resize handle.
2352
+ *
2353
+ * @param {ArgsRenderHeaderCellResizeHandle} args - The arguments for rendering the handle.
2354
+ * @param {number} args.rowIndex - The index of the row.
2355
+ * @param {number} args.columnIndex - The index of the column.
2356
+ * @param {number} args.cellLeft - The left position of the cell.
2357
+ * @param {number} args.cellTop - The top position of the cell.
2358
+ * @param {number} args.cellWidth - The width of the cell.
2359
+ * @param {number} args.cellHeight - The height of the cell.
2360
+ * @param {HTMLElement} args.parent - The parent element to append the handle to.
2361
+ *
2362
+ * @return {void}
2363
+ */
2364
+ renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: o, cellWidth: i, cellHeight: l, parent: n }) {
2365
+ const a = this.dom.domService, c = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = a.createElement("div");
2366
+ a.setAttribute(d, "data-col-index", `${t}`), a.setAttribute(d, "data-row-index", `${e}`), a.setAttribute(d, "data-area", "header"), a.setAttribute(d, "data-ge-action", "resize-column"), a.addClass(d, "ge-table-column-resize-handle"), a.setStyle(d, "display", "clip"), a.setStyle(d, "position", "absolute"), a.setStyle(d, "cursor", "col-resize"), a.setStyle(d, "left", `${s + i - c}px`), a.setStyle(d, "top", `${o}px`), a.setStyle(d, "width", `${c}px`), a.setStyle(d, "height", `${l}px`), a.appendChild(n, d);
1882
2367
  }
1883
2368
  }
1884
- class Qe {
2369
+ class lt {
1885
2370
  constructor(e, t) {
1886
2371
  this.columnIndex = e, this.sortState = t;
1887
2372
  }
1888
2373
  }
1889
- class Ze {
2374
+ class rt {
1890
2375
  constructor(e) {
1891
2376
  this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
1892
2377
  }
@@ -1900,40 +2385,40 @@ class Ze {
1900
2385
  */
1901
2386
  onHostElementChanged(e) {
1902
2387
  if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
1903
- const t = e.target, s = t.getAttribute("data-area"), i = t.getAttribute("data-row-index"), o = t.getAttribute("data-col-index");
1904
- if (s && i && o) {
1905
- const r = ie(s), n = Number(i), a = Number(o);
1906
- this.tableScope.updateModelValueAfterEdit(r, n, a, t.value);
2388
+ const t = e.target, s = t.getAttribute("data-area"), o = t.getAttribute("data-row-index"), i = t.getAttribute("data-col-index");
2389
+ if (s && o && i) {
2390
+ const l = ae(s), n = Number(o), a = Number(i);
2391
+ this.tableScope.updateModelValueAfterEdit(l, n, a, t.value);
1907
2392
  }
1908
2393
  }
1909
2394
  }
1910
2395
  }
1911
- class et {
2396
+ class nt {
1912
2397
  constructor(e = -1, t = -1) {
1913
2398
  this.rowIndex = e, this.columnIndex = t;
1914
2399
  }
1915
2400
  }
1916
- class le {
2401
+ class ce {
1917
2402
  constructor(e) {
1918
2403
  this.cells = e;
1919
2404
  }
1920
2405
  static createSingle(e, t) {
1921
- return new le([new et(e, t)]);
2406
+ return new ce([new nt(e, t)]);
1922
2407
  }
1923
2408
  }
1924
- class tt {
2409
+ class at {
1925
2410
  constructor(e) {
1926
2411
  var t, s;
1927
2412
  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);
1928
2413
  }
1929
2414
  onMouseClicked(e, t) {
1930
- var o, r, n, a, h, d, c;
1931
- let s = !1, i = !1;
2415
+ var i, l, n, a, c, d, h;
2416
+ let s = !1, o = !1;
1932
2417
  if (this.getSelectionModel && this.getFocusModel) {
1933
- const p = this.getSelectionModel(), g = this.getFocusModel();
1934
- p && g && (g.hasFocus(e.rowIndex, e.columnIndex) || (g.setFocus(e.rowIndex, e.columnIndex), s = !0), (o = e.originalEvent) != null && o.shiftKey || p.hasSelection() && (p.clear(), s = !0), (r = e.originalEvent) != null && r.shiftKey && this.previousEvt ? (p.addSelection(this.createRangeByEvents(e, this.previousEvt)), i = !0, s = !0) : (n = e.originalEvent) != null && n.ctrlKey || (a = e.originalEvent) != null && a.metaKey ? (p.addSelection(D.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0) : (h = e.originalEvent) != null && h.altKey && ((d = e.originalEvent) != null && d.ctrlKey || (c = e.originalEvent) != null && c.metaKey) && (p.removeSelection(D.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0));
2418
+ const g = this.getSelectionModel(), f = this.getFocusModel();
2419
+ g && f && (f.hasFocus(e.rowIndex, e.columnIndex) || (f.setFocus(e.rowIndex, e.columnIndex), this.tableScope.onFocusChanged(f), s = !0), (i = e.originalEvent) != null && i.shiftKey || g.hasSelection() && (g.clear(), s = !0), (l = e.originalEvent) != null && l.shiftKey && this.previousEvt ? (g.addSelection(this.createRangeByEvents(e, this.previousEvt)), o = !0, s = !0) : (n = e.originalEvent) != null && n.altKey && ((a = e.originalEvent) != null && a.ctrlKey || (c = e.originalEvent) != null && c.metaKey) ? (g.removeSelection(A.singleCell(e.rowIndex, e.columnIndex)), o = !0, s = !0) : (d = e.originalEvent) != null && d.ctrlKey || (h = e.originalEvent) != null && h.metaKey ? (g.addSelection(A.singleCell(e.rowIndex, e.columnIndex)), o = !0, s = !0) : (g.firstClick(e.rowIndex, e.columnIndex), s = !0), this.tableScope.onSelectionChanged(g));
1935
2420
  }
1936
- return i ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
2421
+ return o ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
1937
2422
  }
1938
2423
  onActionTriggered(e) {
1939
2424
  if (this.getSelectionModel && this.getFocusModel) {
@@ -1944,8 +2429,8 @@ class tt {
1944
2429
  if (e === "DESELECT_ALL")
1945
2430
  return t.clear(), this.tableScope.repaint(), !0;
1946
2431
  if (e === "TOGGLE_SELECTION") {
1947
- const [i, o] = s.getFocus();
1948
- return t.togglePoint(i, o), this.tableScope.repaint(), !0;
2432
+ const [o, i] = s.getFocus();
2433
+ return t.togglePoint(o, i), this.tableScope.repaint(), !0;
1949
2434
  }
1950
2435
  }
1951
2436
  }
@@ -1953,16 +2438,16 @@ class tt {
1953
2438
  }
1954
2439
  createRangeByEvents(e, t) {
1955
2440
  t || (t = e);
1956
- 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);
1957
- return D.create({
2441
+ const s = Math.min(e.rowIndex, t == null ? void 0 : t.rowIndex), o = Math.max(e.rowIndex, t == null ? void 0 : t.rowIndex), i = Math.min(e.columnIndex, t == null ? void 0 : t.columnIndex), l = Math.max(e.columnIndex, t == null ? void 0 : t.columnIndex);
2442
+ return A.create({
1958
2443
  rowIndex1: s,
1959
- columnIndex1: o,
1960
- rowIndex2: i,
1961
- columnIndex2: r
2444
+ columnIndex1: i,
2445
+ rowIndex2: o,
2446
+ columnIndex2: l
1962
2447
  });
1963
2448
  }
1964
2449
  }
1965
- class st {
2450
+ class dt {
1966
2451
  get() {
1967
2452
  return {
1968
2453
  f2: "START_EDITING",
@@ -1972,43 +2457,60 @@ class st {
1972
2457
  "ctrl+shift+a": "DESELECT_ALL",
1973
2458
  "ctrl+x": "DESELECT_ALL",
1974
2459
  "ctrl+num_subtract": "DESELECT_ALL",
1975
- "cmd -": "DESELECT_ALL",
2460
+ "meta -": "DESELECT_ALL",
1976
2461
  arrowup: "NAVIGATE_UP",
1977
2462
  arrowdown: "NAVIGATE_DOWN",
1978
2463
  arrowleft: "NAVIGATE_LEFT",
1979
- arrowright: "NAVIGATE_RIGHT"
2464
+ arrowright: "NAVIGATE_RIGHT",
2465
+ "meta+c": "COPY_2_CLIPBOARD",
2466
+ "ctrl+c": "COPY_2_CLIPBOARD"
1980
2467
  };
1981
2468
  }
1982
2469
  }
1983
- class it {
2470
+ class ct {
1984
2471
  get() {
1985
2472
  return {
1986
2473
  f2: "START_EDITING",
1987
2474
  space: "TOGGLE_SELECTION",
1988
2475
  "ctrl+num_add": "SELECT_ALL",
1989
- "cmd+a": "SELECT_ALL",
2476
+ "meta+a": "SELECT_ALL",
1990
2477
  "ctrl+a": "SELECT_ALL",
1991
- "cmd+x": "DESELECT_ALL",
1992
- "cmd+shift+a": "DESELECT_ALL",
2478
+ "meta+x": "DESELECT_ALL",
2479
+ "meta+shift+a": "DESELECT_ALL",
1993
2480
  "ctrl+shift+a": "DESELECT_ALL",
1994
2481
  "ctrl+num_subtract": "DESELECT_ALL",
1995
2482
  "ctrl -": "DESELECT_ALL",
1996
2483
  arrowup: "NAVIGATE_UP",
1997
2484
  arrowdown: "NAVIGATE_DOWN",
1998
2485
  arrowleft: "NAVIGATE_LEFT",
1999
- arrowright: "NAVIGATE_RIGHT"
2486
+ arrowright: "NAVIGATE_RIGHT",
2487
+ "meta+c": "COPY_2_CLIPBOARD",
2488
+ "ctrl+c": "COPY_2_CLIPBOARD"
2000
2489
  };
2001
2490
  }
2002
2491
  }
2003
- class ot {
2492
+ class ht {
2004
2493
  constructor(e) {
2005
2494
  this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
2006
2495
  }
2496
+ /**
2497
+ * Adds a listener to the list of listeners.
2498
+ *
2499
+ * @param {OnActionTriggeredIf} listener - The listener to be added.
2500
+ * @returns {void}
2501
+ */
2007
2502
  addListener(e) {
2008
2503
  this.listener.includes(e) || this.listener.push(e);
2009
2504
  }
2505
+ /**
2506
+ * Initializes the ShortcutService by assigning shortcut action id mappings based on the current operating system.
2507
+ * Also adds key down event listener to the table host element.
2508
+ */
2010
2509
  init() {
2011
- this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new it().get()) : Object.assign(this.shortcutActionIdMapping, new st().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));
2510
+ this.assignPredefinedSystemShortcutMappings(), Object.assign(this.shortcutActionIdMapping, this.tableScope.tableOptions.shortcutActionIdMapping), this.isDebug() && console.debug("ShortcutService", this.shortcutActionIdMapping), this.tableScope.hostElement.addEventListener("keydown", this.onKeyDown.bind(this));
2511
+ }
2512
+ assignPredefinedSystemShortcutMappings() {
2513
+ this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new ct().get()) : Object.assign(this.shortcutActionIdMapping, new dt().get());
2012
2514
  }
2013
2515
  isMacintosh() {
2014
2516
  return navigator.platform.indexOf("Mac") > -1;
@@ -2020,22 +2522,22 @@ class ot {
2020
2522
  return location.hostname === "localhost" || location.hostname === "127.0.0.1";
2021
2523
  }
2022
2524
  onKeyDown(e) {
2023
- const t = this.findEnty(e);
2525
+ const t = this.findEntity(e);
2024
2526
  t && this.emit(t) && (e.preventDefault(), e.stopPropagation());
2025
2527
  }
2026
2528
  emit(e) {
2027
- this.isDebug() && console.debug("ShortcutService emit:", e);
2529
+ this.isDebug() && console.debug("ShortcutService emit :", e);
2028
2530
  let t = !1;
2029
2531
  for (const s of this.listener)
2030
2532
  s.onActionTriggered(e) && (t = !0);
2031
2533
  return t;
2032
2534
  }
2033
- findEnty(e) {
2535
+ findEntity(e) {
2034
2536
  const t = this.getTokenByEvent(e);
2035
- this.isDebug() && console.debug("ShortcutService tokens:", t);
2537
+ this.isDebug() && console.debug("ShortcutService tokens :", t);
2036
2538
  for (const s in this.shortcutActionIdMapping) {
2037
- const i = s.replace(/opt/g, "alt").replace(/cmd/g, "meta").split(/[\+ ]/g).sort();
2038
- if (this.areTokensEquals(t, i))
2539
+ const o = s.replace(/opt/g, "alt").replace(/cmd/g, "meta").split(/[+ ]/g).sort();
2540
+ if (this.areTokensEquals(t, o))
2039
2541
  return this.shortcutActionIdMapping[s];
2040
2542
  }
2041
2543
  }
@@ -2051,8 +2553,16 @@ class ot {
2051
2553
  const t = [];
2052
2554
  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();
2053
2555
  }
2556
+ /**
2557
+ * Retrieves the shortcut action mapping object.
2558
+ *
2559
+ * @returns {ShortcutActionIdMapping} - The shortcut action mapping object.
2560
+ */
2561
+ getShortcutActionMapping() {
2562
+ return this.shortcutActionIdMapping;
2563
+ }
2054
2564
  }
2055
- class ce {
2565
+ class be {
2056
2566
  onCheckboxChanged(e) {
2057
2567
  }
2058
2568
  onContextmenu(e) {
@@ -2067,8 +2577,12 @@ class ce {
2067
2577
  }
2068
2578
  onMouseMoved(e) {
2069
2579
  }
2580
+ onSelectionChanged(e) {
2581
+ }
2582
+ onFocusChanged(e) {
2583
+ }
2070
2584
  }
2071
- class ve {
2585
+ class Me {
2072
2586
  setStyle(e, t, s) {
2073
2587
  return e.style[t] = s, e;
2074
2588
  }
@@ -2095,11 +2609,11 @@ class ve {
2095
2609
  e.setAttribute(t, s);
2096
2610
  }
2097
2611
  }
2098
- class lt {
2099
- render(e, t, s, i, o, r, n) {
2100
- if (o.isEditable(t, s)) {
2612
+ class gt {
2613
+ render(e, t, s, o, i, l, n) {
2614
+ if (i.isEditable(t, s)) {
2101
2615
  n.addClass(e, "ge-table-row-input-div");
2102
- const a = o.getValueAt(t, s);
2616
+ const a = i.getValueAt(t, s);
2103
2617
  e.innerHTML = `
2104
2618
  <input
2105
2619
  type="text"
@@ -2107,7 +2621,7 @@ class lt {
2107
2621
  autofocus
2108
2622
  onfocus="this.setSelectionRange(0, this.value.length)"
2109
2623
  data-listen="change"
2110
- data-area="${i}"
2624
+ data-area="${o}"
2111
2625
  data-row-index="${t}"
2112
2626
  data-col-index="${s}"
2113
2627
  data-input-type="text"
@@ -2116,14 +2630,17 @@ class lt {
2116
2630
  }
2117
2631
  }
2118
2632
  }
2119
- class rt {
2633
+ class ut {
2120
2634
  constructor(e = "none", t = "single") {
2121
2635
  this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
2122
2636
  }
2637
+ firstClick(e, t) {
2638
+ this.selectionType === "row" ? this.addRange(A.singleRow(e)) : this.selectionType === "column" && this.addRange(A.singleColumn(t));
2639
+ }
2123
2640
  getSelectionCount(e, t) {
2124
2641
  let s = 0;
2125
- for (const i of this.ranges)
2126
- i.isInRange(e, t) && s++;
2642
+ for (const o of this.ranges)
2643
+ o.isInRange(e, t) && s++;
2127
2644
  return this.allSelected && s++, this.isInNegativeRange(e, t) && (s = 0), s;
2128
2645
  }
2129
2646
  isInNegativeRange(e, t) {
@@ -2139,11 +2656,29 @@ class rt {
2139
2656
  this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
2140
2657
  }
2141
2658
  hasSelection() {
2142
- return !!this.ranges.length;
2659
+ return this.allSelected || !!this.ranges.length;
2660
+ }
2661
+ hasNoSelection() {
2662
+ return !this.hasSelection();
2663
+ }
2664
+ /**
2665
+ * Retrieves the merged row indices from the given range selection.
2666
+ *
2667
+ * @returns {number[]} Array of merged row indices
2668
+ */
2669
+ getMergedRowIndices() {
2670
+ const e = /* @__PURE__ */ new Set();
2671
+ for (const t of this.ranges)
2672
+ for (let s = t.r1; s <= t.r2; s++)
2673
+ !e.has(s) && !this.isInNegativeRange(s, 0) && e.add(s);
2674
+ return Array.from(e);
2143
2675
  }
2144
2676
  selectAll() {
2145
2677
  this.allSelected = !0;
2146
2678
  }
2679
+ isAllSelected() {
2680
+ return this.allSelected;
2681
+ }
2147
2682
  addSelection(e) {
2148
2683
  this.addRange(e);
2149
2684
  }
@@ -2151,16 +2686,19 @@ class rt {
2151
2686
  if (this.selectionType === "none")
2152
2687
  return;
2153
2688
  let t = e;
2154
- this.selectionType === "row" ? t = D.singleRow(e.r1) : this.selectionType === "column" && (t = D.singleColumn(e.c1)), this.negativeRanges.push(t);
2689
+ this.selectionType === "row" ? t = A.singleRow(e.r1) : this.selectionType === "column" && (t = A.singleColumn(e.c1)), this.negativeRanges.push(t);
2155
2690
  }
2156
2691
  togglePoint(e, t) {
2157
- this.getSelectionCount(e, t) > 0 ? this.removeSelection(D.singleCell(e, t)) : this.addSelection(D.singleCell(e, t));
2692
+ this.getSelectionCount(e, t) > 0 ? this.removeSelection(A.singleCell(e, t)) : this.addSelection(A.singleCell(e, t));
2693
+ }
2694
+ isSelected(e, t) {
2695
+ return this.getSelectionCount(e, t) > 0;
2158
2696
  }
2159
2697
  addRange(e) {
2160
2698
  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));
2161
2699
  }
2162
2700
  }
2163
- class nt {
2701
+ class pt {
2164
2702
  constructor(e = "none") {
2165
2703
  this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
2166
2704
  }
@@ -2183,29 +2721,128 @@ class nt {
2183
2721
  return [this.rowIndex, this.columnIndex];
2184
2722
  }
2185
2723
  }
2186
- const at = new rt(), dt = new nt("cell");
2187
- class we {
2724
+ class Re {
2725
+ constructor(e = new I(
2726
+ "❯",
2727
+ "",
2728
+ ["gt-table-icon-expanded"]
2729
+ ), t = new I(
2730
+ "❯",
2731
+ "transform: rotate(180deg) translate(-100%, -100%); transform-origin: 0 0;",
2732
+ ["ge-table-icon-collapsed"]
2733
+ )) {
2734
+ this.iconExpanded = e, this.iconCollapsed = t;
2735
+ }
2736
+ // `⊖ `, `⊕ `;
2737
+ }
2738
+ const bt = new ut(), ft = new pt("cell");
2739
+ class Te {
2188
2740
  constructor() {
2189
2741
  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 = {
2190
2742
  header: 34,
2191
2743
  body: 34,
2192
2744
  footer: 34
2193
- }, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new be(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new ye(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new lt(), this.getSelectionModel = () => at, this.getFocusModel = () => dt;
2745
+ }, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new Ee(), this.headerGroupOptions = new Re(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new Ae(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new gt(), this.getSelectionModel = () => bt, this.getFocusModel = () => ft;
2194
2746
  }
2195
2747
  }
2196
- class re extends Je {
2197
- constructor(e, t, s, i, o) {
2198
- var r;
2748
+ const P = class P {
2749
+ /**
2750
+ * Returns the content to be copied based on the provided table model, selection model, and focus model.
2751
+ *
2752
+ * @param {TableModelIf} tableModel - The table model for data retrieval.
2753
+ * @param {SelectionModelIf} selectionModel - The selection model to determine the selected range.
2754
+ * @param {FocusModelIf} focusModel - The focus model to determine the focused cell.
2755
+ * @return {Promise<string>} A promise that resolves to the copied content as a string.
2756
+ * @throws {string} Throws an error if neither selection nor focus is defined.
2757
+ */
2758
+ createContent(e, t, s) {
2759
+ return new Promise((o, i) => {
2760
+ if (t != null && t.hasSelection()) {
2761
+ const l = this.mergeRanges(t.getRanges());
2762
+ if (l) {
2763
+ l.c2 = Math.min(l.c2, e.getColumnCount() - 1), l.r2 = Math.min(l.r2, e.getBodyModel().getRowCount() - 1);
2764
+ const n = [];
2765
+ for (let a = l.r1; a <= l.r2; a++) {
2766
+ const c = [];
2767
+ for (let d = l.c1; d <= l.c2; d++) {
2768
+ const h = t.isSelected(a, d) ? e.getBodyModel().getTextValueAt(a, d) : "";
2769
+ c.push(h);
2770
+ }
2771
+ n.push(c.join(P.columnSeparatorChar));
2772
+ }
2773
+ return o(n.join(P.rowSeparatorChar));
2774
+ }
2775
+ }
2776
+ if (s) {
2777
+ const [l, n] = s.getFocus(), a = e.getBodyModel().getTextValueAt(l, n);
2778
+ return o(a);
2779
+ }
2780
+ i("Cannot copy, neither selection nor focus defined.");
2781
+ });
2782
+ }
2783
+ /**
2784
+ * Copy the provided content to the clipboard.
2785
+ *
2786
+ * @param {string} content - The content to be copied.
2787
+ * @return {Promise<void>} A promise that resolves when the content has been successfully copied to the clipboard.
2788
+ */
2789
+ copyContent(e) {
2790
+ return navigator.clipboard.writeText(e);
2791
+ }
2792
+ /**
2793
+ * Asynchronously copies the content of a table to the clipboard.
2794
+ *
2795
+ * @param {TableModelIf} tableModel - The table model to copy from.
2796
+ * @param {SelectionModelIf} selectionModel - The selection model of the table.
2797
+ * @param {FocusModelIf} focusModel - The focus model of the table.
2798
+ * @returns {Promise<string>} A promise that resolves with the copied text if successful, or rejects if an error occurs.
2799
+ */
2800
+ copyToClipboard(e, t, s) {
2801
+ return new Promise((o, i) => {
2802
+ this.createContent(
2803
+ e,
2804
+ t,
2805
+ s
2806
+ ).then((l) => {
2807
+ l && this.copyContent(l).then((n) => {
2808
+ o(l);
2809
+ }).catch((n) => {
2810
+ i();
2811
+ });
2812
+ }).catch((l) => {
2813
+ i();
2814
+ });
2815
+ });
2816
+ }
2817
+ /**
2818
+ * Merges an array of CellRanges into a single merged CellRange.
2819
+ *
2820
+ * @param {CellRange[]} ranges - The array of CellRanges to be merged.
2821
+ * @return {CellRange | undefined} - The merged CellRange, or undefined if the ranges array is empty.
2822
+ */
2823
+ mergeRanges(e) {
2824
+ let t;
2825
+ for (const s of e)
2826
+ t ? (t.r1 = Math.min(t.r1, s.r1), t.c1 = Math.min(t.c1, s.c1), t.r2 = Math.max(t.r2, s.r2), t.c2 = Math.max(t.c2, s.c2)) : t = new A(s.r1, s.c1, s.r2, s.c2);
2827
+ return t;
2828
+ }
2829
+ };
2830
+ P.columnSeparatorChar = " ", P.rowSeparatorChar = `
2831
+ `;
2832
+ let K = P;
2833
+ class he extends it {
2834
+ constructor(e, t, s, o, i, l = new K()) {
2835
+ var n;
2199
2836
  if (super(
2200
2837
  e,
2201
2838
  t,
2202
- new _e(s),
2203
- i
2204
- ), this.eventListener = o, this.selectionService = new tt(this), this.api = new Ne(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new ce()), (r = this.tableOptions) != null && r.autoRestoreOptions) {
2205
- const n = this.tableOptions.autoRestoreOptions, a = n.getStorageKeyFn;
2206
- a && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new je(a)), n.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new Ke(a)), n.autoRestoreSortingState && (this.storeSortingService = new ze(a)));
2839
+ new Ke(s),
2840
+ o
2841
+ ), this.eventListener = i, this.copyService = l, this.licenseManager = $.getInstance(), this.selectionService = new at(this), this.api = new qe(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.lastDragFrom = -1, this.lastDragTo = -1, this.firstDraggingRendering = !0, i || (this.eventListener = new be()), (n = this.tableOptions) != null && n.autoRestoreOptions) {
2842
+ const a = this.tableOptions.autoRestoreOptions, c = a.getStorageKeyFn;
2843
+ c && (a.autoRestoreScrollPosition && (this.storeScrollPosStateService = new Je(c)), a.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new Ze(c)), a.autoRestoreSortingState && (this.storeSortingService = new et(c)));
2207
2844
  }
2208
- this.mouseHandler = new Ge(this), this.inputHandler = new Ze(this), this.shortcutService = new ot(this), this.shortcutService.addListener(this.selectionService);
2845
+ this.mouseHandler = new Ue(this), this.inputHandler = new rt(this), this.shortcutService = new ht(this), this.shortcutService.addListener(this.selectionService);
2209
2846
  }
2210
2847
  /**
2211
2848
  * Creates a TableScope instance.
@@ -2215,33 +2852,47 @@ class re extends Je {
2215
2852
  * @param {TableOptionsIf} [tableOptions=new TableOptions()] - The optional table options object.
2216
2853
  * @param {EventListenerIf} [eventListener=new EventAdapter()] - The optional event listener object.
2217
2854
  * @param {DomServiceIf} [domService=new SimpleDomService()] - The optional DOM service object.
2855
+ * @param {CopyServiceIf} [copyService=new CopyService()] - The optional copy service object.
2218
2856
  *
2219
2857
  * @return {TableScope} - The newly created TableScope instance.
2220
2858
  */
2221
- static create(e, t, s = new we(), i = new ce(), o = new ve()) {
2222
- return new re(
2859
+ static create(e, t, s = new Te(), o = new be(), i = new Me(), l = new K()) {
2860
+ return new he(
2223
2861
  e,
2224
2862
  t,
2225
- o,
2863
+ i,
2226
2864
  s,
2227
- i
2865
+ o,
2866
+ l
2228
2867
  );
2229
2868
  }
2869
+ /**
2870
+ * Triggers an action based on the provided actionId.
2871
+ *
2872
+ * This function can be invoked manually via the table API or by keyboard shortcuts.
2873
+ *
2874
+ * @param {ActionId} actionId - The identifier of the action to be triggered.
2875
+ * @return {boolean} - Returns true if the action was triggered successfully, false otherwise.
2876
+ */
2230
2877
  onActionTriggered(e) {
2231
2878
  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))
2232
2879
  return !0;
2233
2880
  if (e === "START_EDITING" && this.getFocusModel) {
2234
2881
  const t = this.getFocusModel();
2235
2882
  if (t) {
2236
- const [s, i] = t.getFocus();
2237
- this.tableModel.getBodyModel().isEditable(s, i) && (this.clearSelection(), this.initRenderEditor(s, i));
2883
+ const [s, o] = t.getFocus();
2884
+ this.tableModel.getBodyModel().isEditable(s, o) && (this.clearSelection(), this.initRenderEditor(s, o));
2238
2885
  }
2239
2886
  return !0;
2240
2887
  }
2888
+ if (e === "COPY_2_CLIPBOARD") {
2889
+ const t = this.getSelectionModel ? this.getSelectionModel() : void 0, s = this.getFocusModel ? this.getFocusModel() : void 0;
2890
+ this.copyService.createContent(this.tableModel, t, s).then((o) => this.copyService.copyContent(o));
2891
+ }
2241
2892
  return !1;
2242
2893
  }
2243
- updateModelValueAfterEdit(e, t, s, i) {
2244
- e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, i) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(le.createSingle(t, s)), this.hostElement.focus());
2894
+ updateModelValueAfterEdit(e, t, s, o) {
2895
+ e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, o) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(ce.createSingle(t, s)), this.hostElement.focus());
2245
2896
  }
2246
2897
  /**
2247
2898
  * Retrieves the TableApi object.
@@ -2270,16 +2921,16 @@ class re extends Je {
2270
2921
  * @return {GeMouseEvent} - The created GeMouseEvent object.
2271
2922
  */
2272
2923
  createGeMouseEvent(e) {
2273
- const t = new se();
2924
+ const t = new ne();
2274
2925
  if (t.originalEvent = e, e) {
2275
2926
  const s = e.target;
2276
2927
  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) {
2277
- const i = this.tableModel.getAreaModel(t.areaIdent);
2278
- t.rowTop = i.getYPosByRowIndex(t.rowIndex);
2928
+ const o = this.tableModel.getAreaModel(t.areaIdent);
2929
+ t.rowTop = o.getYPosByRowIndex(t.rowIndex);
2279
2930
  }
2280
2931
  if (t.columnLeft = this.tableModel.getXPosByColumnIndex(t.columnIndex), e.ctrlKey && e.altKey) {
2281
- const i = e.clientY - this.hostElement.offsetTop - this.areaHeaderCenter.parent.clientHeight, o = e.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width;
2282
- this.debugOnce(o, i);
2932
+ const o = e.clientY - this.hostElement.offsetTop - this.areaHeaderCenter.parent.clientHeight, i = e.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width;
2933
+ this.debugOnce(i, o);
2283
2934
  }
2284
2935
  }
2285
2936
  return t;
@@ -2291,15 +2942,16 @@ class re extends Je {
2291
2942
  * @return {void}
2292
2943
  */
2293
2944
  onMouseDown(e) {
2294
- e.columnIndex > -1 && e.action && ["resize-column", "drag-column"].includes(e.action) && (this.mouseStartWidth = this.tableModel.getColumnWidth(e.columnIndex), this.mouseStartAction = e.action, this.mouseStartColumnIndex = e.columnIndex, this.mouseStartAction === "drag-column" && (this.dragFrom = this.mouseStartColumnIndex));
2945
+ e.columnIndex > -1 && e.action && ["resize-column", "drag-column"].includes(e.action) && (this.mouseStartWidth = this.tableModel.getColumnWidth(e.columnIndex), this.mouseStartAction = e.action, this.mouseStartColumnIndex = e.columnIndex, this.mouseStartAction === "drag-column" && (this.firstDraggingRendering = !0, this.dragFrom = this.mouseStartColumnIndex));
2295
2946
  }
2296
2947
  /**
2297
2948
  * Handles mouse dragging on the frame.
2298
2949
  *
2299
2950
  * @param {GeMouseEvent} mouseEvent - The mouse event object.
2951
+ * @param startMouseEvent
2300
2952
  */
2301
- mouseDraggingOnFrame(e) {
2302
- this.eventListener.onMouseDragging(e), this.mouseEvent = e, this.mouseStartColumnIndex > -1 && this.mouseStartAction === "resize-column" && this.tableOptions.columnsResizable ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && e.columnIndex > -1 && this.tableOptions.columnsDraggable && (this.draggingTargetColumnIndex = e.columnIndex, this.dragTo = this.draggingTargetColumnIndex, this.dragFrom > -1 && this.dragTo > -1 && this.dragFrom !== this.dragTo && (this.tableModel.changeColumnOrder(this.dragFrom, this.dragTo), this.dragFrom = this.dragTo, this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows()), this.repaint());
2953
+ mouseDraggingOnFrame(e, t) {
2954
+ this.eventListener.onMouseDragging(e), this.mouseEvent = e, this.mouseStartColumnIndex > -1 && this.mouseStartAction === "resize-column" && this.tableOptions.columnsResizable ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && e.columnIndex > -1 && this.tableOptions.columnsDraggable && (this.draggingTargetColumnIndex = e.columnIndex, this.dragTo = this.draggingTargetColumnIndex, this.dragFrom > -1 && this.dragTo > -1 && this.dragFrom !== this.dragTo && (this.lastDragFrom === this.dragTo && this.lastDragTo === this.dragFrom || (this.tableModel.changeColumnOrder(this.dragFrom, this.dragTo), this.lastDragFrom = this.dragFrom, this.lastDragTo = this.dragTo, this.dragFrom = this.dragTo, this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows())), t && (this.adjustDraggingColumn(e, t.columnIndex, this.firstDraggingRendering), this.firstDraggingRendering = !1), this.repaint());
2303
2955
  }
2304
2956
  /**
2305
2957
  * Handles the end of mouse dragging event on a frame.
@@ -2309,7 +2961,7 @@ class re extends Je {
2309
2961
  * @returns {void}
2310
2962
  */
2311
2963
  mouseDraggingEndOnFrame(e) {
2312
- this.eventListener.onMouseDraggingEnd(e), this.draggingTargetColumnIndex = -1, this.mouseStartAction === "resize-column" ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && this.repaint(), this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.mouseStartAction = "";
2964
+ this.eventListener.onMouseDraggingEnd(e), this.draggingTargetColumnIndex = -1, this.mouseStartAction === "resize-column" ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && (this.hideDraggingColumn(), this.repaint()), this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.firstDraggingRendering = !0, this.mouseStartAction = "";
2313
2965
  }
2314
2966
  /**
2315
2967
  * Handles the mouse move event.
@@ -2339,7 +2991,7 @@ class re extends Je {
2339
2991
  toggleExpandCollapseAll(e = !0) {
2340
2992
  var s;
2341
2993
  const t = this.tableModel.getBodyModel();
2342
- ee(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
2994
+ le(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
2343
2995
  }
2344
2996
  /**
2345
2997
  * Toggles the checkbox state of a specific row in a table.
@@ -2352,9 +3004,9 @@ class re extends Je {
2352
3004
  */
2353
3005
  toggleRowCheckbox(e, t, s) {
2354
3006
  var a;
2355
- const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e), r = o === void 0 || o === "semi" || o === "none";
2356
- i.setRowChecked(e, r), this.repaint();
2357
- const n = (a = i.rowSelectionModel) == null ? void 0 : a.getCheckedRows();
3007
+ const o = this.tableModel.getAreaModel(s), i = o.isRowChecked(e), l = i === void 0 || i === "semi" || i === "none";
3008
+ o.setRowChecked(e, l), this.repaint();
3009
+ const n = (a = o.rowSelectionModel) == null ? void 0 : a.getCheckedRows();
2358
3010
  this.eventListener.onCheckboxChanged(n || []);
2359
3011
  }
2360
3012
  /**
@@ -2367,10 +3019,23 @@ class re extends Je {
2367
3019
  onMouseClicked(e, t) {
2368
3020
  let s = this.selectionService.onMouseClicked(e, t);
2369
3021
  if (!s && this.getFocusModel) {
2370
- const i = this.getFocusModel();
2371
- i && (s = i.hasChanged(), i.clearChanged(), s && this.resetEditorRenderer());
3022
+ this.resetEditorRenderer();
3023
+ const o = this.getFocusModel();
3024
+ o && (s = o.hasChanged(), o.clearChanged());
2372
3025
  }
2373
- this.eventListener.onMouseClicked(e), s && this.debounce(this.repaint.bind(this), 10);
3026
+ return s;
3027
+ }
3028
+ debounceRepaint() {
3029
+ this.debounce(this.repaint.bind(this), 1);
3030
+ }
3031
+ publishGeMouseEvent(e) {
3032
+ this.eventListener.onMouseClicked(e);
3033
+ }
3034
+ onFocusChanged(e) {
3035
+ this.eventListener.onFocusChanged(e);
3036
+ }
3037
+ onSelectionChanged(e) {
3038
+ this.eventListener.onSelectionChanged(e);
2374
3039
  }
2375
3040
  /**
2376
3041
  * Updates the table (repaint) when an external filter is changed.
@@ -2392,14 +3057,72 @@ class re extends Je {
2392
3057
  * @return {void}
2393
3058
  */
2394
3059
  onHeaderDblClicked(e, t, s) {
2395
- var o, r;
2396
- const i = this.tableModel.getColumnDef(s);
2397
- if (i != null && i.sortable && i.sortable()) {
3060
+ var i, l;
3061
+ const o = this.tableModel.getColumnDef(s);
3062
+ if (o != null && o.sortable && o.sortable()) {
2398
3063
  e.preventDefault(), e.stopPropagation();
2399
- const n = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, a = i.sortState ?? "", h = n[(n.indexOf(a) + 1) % n.length], d = new Qe(s, h);
2400
- this.tableModel.doSort([d]) && ((o = this.tableModel.getColumnDefs()) == null || o.forEach((p) => p.sortState = ""), i.sortState = h), this.repaint(), (r = this.storeSortingService) == null || r.setSortItems([d]);
3064
+ const n = o.sortStatesOrder ? o.sortStatesOrder : this.tableOptions.sortOrder, a = o.sortState ?? "", c = n[(n.indexOf(a) + 1) % n.length], d = new lt(s, c);
3065
+ this.tableModel.doSort([d]) && ((i = this.tableModel.getColumnDefs()) == null || i.forEach((g) => g.sortState = ""), o.sortState = c), this.repaint(), (l = this.storeSortingService) == null || l.setSortItems([d]);
2401
3066
  }
2402
3067
  }
3068
+ /**
3069
+ * Scrolls the viewport to the specified pixel coordinates.
3070
+ *
3071
+ * @param {number} px - The horizontal pixel coordinate to scroll to.
3072
+ * @param {number} py - The vertical pixel coordinate to scroll to.
3073
+ *
3074
+ * @return {void}
3075
+ */
3076
+ scrollToPixel(e, t) {
3077
+ this.scrollViewport.scrollTo(e, t);
3078
+ }
3079
+ /**
3080
+ * Scrolls to the specified index in the table.
3081
+ *
3082
+ * @param {number} _indexX - The horizontal index of the table where scrolling is needed.
3083
+ * @param {number} indexY - The vertical index of the table where scrolling is needed.
3084
+ * @return {void}
3085
+ */
3086
+ scrollToIndex(e, t) {
3087
+ const o = this.tableModel.getAreaModel("body").getYPosByRowIndex(t);
3088
+ this.scrollToPixel(0, o);
3089
+ }
3090
+ /**
3091
+ * Sets the selection model for the table.
3092
+ *
3093
+ * @param {SelectionModel} sm - The selection model to be set.
3094
+ * @param {boolean} rerender - Optional parameter indicating whether to rerender the table after setting the selection model. Default value is false.
3095
+ *
3096
+ * @return {void} - This method does not return any value.
3097
+ */
3098
+ setSelectionModel(e, t = !1) {
3099
+ const s = () => e;
3100
+ this.tableOptions.getSelectionModel = s, this.getSelectionModel = s, this.selectionService.getSelectionModel = s, t && this.repaint();
3101
+ }
3102
+ toggleHeaderGroup(e) {
3103
+ const t = this.tableModel.getAreaModel("header");
3104
+ "columnDefs" in this.tableModel && (this.tableModel.columnDefs = t.toggleHeaderGroup(e), console.info("####### !!!!!! *******, this.tableModel.columnDefs")), this.firstInit();
3105
+ }
3106
+ /**
3107
+ * Retrieves the selection model.
3108
+ * @returns {SelectionModelIf | undefined} The selection model if available, otherwise undefined.
3109
+ */
3110
+ selectionModel() {
3111
+ if (this != null && this.getSelectionModel)
3112
+ return this.getSelectionModel();
3113
+ }
3114
+ /**
3115
+ * Retrieves the focus model.
3116
+ *
3117
+ * @returns {FocusModelIf | undefined} The focus model if it exists, or undefined otherwise.
3118
+ */
3119
+ focusModel() {
3120
+ if (this != null && this.getFocusModel)
3121
+ return this.getFocusModel();
3122
+ }
3123
+ setDragging(e) {
3124
+ this.dragging = e, this.dragging ? (this.storeColumnWidths(), this.lastDragFrom = -1, this.lastDragTo = -1) : this.storedColumnWidths = [];
3125
+ }
2403
3126
  /**
2404
3127
  * Changes the focus cell using the specified deltas.
2405
3128
  *
@@ -2411,8 +3134,8 @@ class re extends Je {
2411
3134
  if (!this.isEditing() && this.getFocusModel) {
2412
3135
  const s = this.getFocusModel();
2413
3136
  if (s) {
2414
- const [i, o] = s.getFocus();
2415
- return s.setFocus(i + t, o + e), this.repaint(), !0;
3137
+ const [o, i] = s.getFocus();
3138
+ return s.setFocus(o + t, i + e), this.repaint(), !0;
2416
3139
  }
2417
3140
  }
2418
3141
  return !1;
@@ -2441,8 +3164,6 @@ class re extends Je {
2441
3164
  /**
2442
3165
  * Restores the scroll position of the table if auto restore options are enabled.
2443
3166
  *
2444
- * @private
2445
- * @memberof ClassName
2446
3167
  *
2447
3168
  * @returns {void}
2448
3169
  */
@@ -2483,21 +3204,21 @@ class re extends Je {
2483
3204
  autoRestoreCollapsedExpandedState() {
2484
3205
  var e, t;
2485
3206
  if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
2486
- const s = this.tableOptions.autoRestoreOptions, i = s.getRowId;
2487
- if (s.autoRestoreCollapsedExpandedState && i) {
2488
- const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), r = this.tableModel.getAreaModel("body");
2489
- if (ee(r)) {
2490
- const n = r, a = r.getRowCount();
2491
- for (let h = 0; h < a; h++) {
2492
- const d = r.getRowByIndex(h);
3207
+ const s = this.tableOptions.autoRestoreOptions, o = s.getRowId;
3208
+ if (s.autoRestoreCollapsedExpandedState && o) {
3209
+ const i = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), l = this.tableModel.getAreaModel("body");
3210
+ if (le(l)) {
3211
+ const n = l, a = l.getRowCount();
3212
+ for (let c = 0; c < a; c++) {
3213
+ const d = l.getRowByIndex(c);
2493
3214
  if (d)
2494
- if (o.allExpanded)
3215
+ if (i.allExpanded)
2495
3216
  d.expanded = !0;
2496
- else if (o.allCollapsed)
3217
+ else if (i.allCollapsed)
2497
3218
  d.expanded = !1;
2498
3219
  else {
2499
- const c = i(d.data);
2500
- o.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(c) : o.mode === "collapsed" && (d.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(c));
3220
+ const h = o(d.data);
3221
+ i.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h) : i.mode === "collapsed" && (d.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h));
2501
3222
  }
2502
3223
  }
2503
3224
  n.recalcVisibleTreeRows();
@@ -2506,77 +3227,369 @@ class re extends Je {
2506
3227
  }
2507
3228
  }
2508
3229
  }
2509
- const ht = /* @__PURE__ */ We("<div>"), pt = (l) => {
3230
+ const Y = class Y {
3231
+ };
3232
+ Y.themes = ["light", "combat", "paper", "blackboard"], Y.vars = {
3233
+ light: `html[data-theme="light"] {
3234
+ --ge-table-bg: rgba(255,255,255, 0.5);
3235
+ --ge-table-header-west-bg: rgba(233, 233, 233, 0.5);
3236
+ --ge-table-header-center-bg: rgba(233, 233, 233, 0.5);
3237
+ --ge-table-header-east-bg: rgba(233, 233, 233, 0.5);
3238
+ --ge-table-header-west-text: #000;
3239
+ --ge-table-header-center-text: #000;
3240
+ --ge-table-header-east-text: #000;
3241
+ --ge-table-header-west-horizontal-border: #ddd;
3242
+ --ge-table-header-west-vertical-border: #ccc;
3243
+ --ge-table-header-center-horizontal-border: #ddd;
3244
+ --ge-table-header-center-vertical-border: #ccc;
3245
+ --ge-table-header-east-horizontal-border: #ddd;
3246
+ --ge-table-header-east-vertical-border: #ccc;
3247
+ --ge-table-body-west-bg: rgba(233, 233, 233, 0.5);
3248
+ --ge-table-body-center-bg: rgba(255,255,255, 0.5);
3249
+ --ge-table-body-east-bg: rgba(233, 233, 233, 0.5);
3250
+ --ge-table-body-west-text: #000;
3251
+ --ge-table-body-center-text: #000;
3252
+ --ge-table-body-east-text: #000;
3253
+ --ge-table-body-west-horizontal-border: #ddd;
3254
+ --ge-table-body-west-vertical-border: #ccc;
3255
+ --ge-table-body-center-horizontal-border: #bbb;
3256
+ --ge-table-body-center-vertical-border: #ddd;
3257
+ --ge-table-body-east-horizontal-border: #ddd;
3258
+ --ge-table-body-east-vertical-border: #ccc;
3259
+ --ge-table-body-west-selected-range-bg: rgba(0, 152, 219, 0.4);
3260
+ --ge-table-body-center-selected-range-bg: rgba(0, 152, 219, 0.4);
3261
+ --ge-table-body-east-selected-range-bg: rgba(0, 152, 219, 0.4);
3262
+ --ge-table-body-west-selected-range-text: #000;
3263
+ --ge-table-body-center-selected-range-text: #000;
3264
+ --ge-table-body-east-selected-range-text: #000;
3265
+ --ge-table-footer-west-bg: rgba(233, 233, 233, 0.5);
3266
+ --ge-table-footer-center-bg: rgba(233, 233, 233, 0.5);
3267
+ --ge-table-footer-east-bg: rgba(233, 233, 233, 0.5);
3268
+ --ge-table-footer-west-text: #000;
3269
+ --ge-table-footer-center-text: #000;
3270
+ --ge-table-footer-east-text: #000;
3271
+ --ge-table-footer-west-horizontal-border: #ddd;
3272
+ --ge-table-footer-west-vertical-border: #ccc;
3273
+ --ge-table-footer-center-horizontal-border: #ddd;
3274
+ --ge-table-footer-center-vertical-border: #ccc;
3275
+ --ge-table-footer-east-horizontal-border: #ddd;
3276
+ --ge-table-footer-east-vertical-border: #ccc;
3277
+ --ge-table-border: #ccc;
3278
+ --ge-table-row-odd-bg: transparent;
3279
+ --ge-table-row-even-bg: transparent;
3280
+ --ge-table-column-odd-bg: transparent;
3281
+ --ge-table-column-even-bg: transparent;
3282
+ --ge-table-hover-column-bg: rgba(0, 224, 255, 0.27);
3283
+ --ge-table-hover-row-bg: rgba(0, 224, 255, 0.27);
3284
+ --ge-table-focus-border: rgb(0, 255, 255);
3285
+ --ge-table-color-error-text: #e00034;
3286
+ --ge-table-tree-arrow-collapsed-color: #e00034;
3287
+ --ge-table-column-resize-handle-border: rgb(0, 255, 255);
3288
+ --ge-table-dragged-col-div-bg: lightcyan;
3289
+ --ge-table-drop-zone-bg: rgba(244, 255, 242, 0.6);
3290
+ }`,
3291
+ combat: `html[data-theme="combat"] {
3292
+ --ge-table-bg: #101010;
3293
+ --ge-table-header-west-bg: #101010;
3294
+ --ge-table-header-center-bg: #101010;
3295
+ --ge-table-header-east-bg: #101010;
3296
+ --ge-table-header-west-text: oklch(100% 0 0);
3297
+ --ge-table-header-center-text: oklch(100% 0 0);
3298
+ --ge-table-header-east-text: oklch(100% 0 0);
3299
+ --ge-table-header-west-horizontal-border: oklch(100% 0 0 / 0%);
3300
+ --ge-table-header-west-vertical-border: oklch(100% 0 0 / 0%);
3301
+ --ge-table-header-center-horizontal-border: oklch(100% 0 0 / 0%);
3302
+ --ge-table-header-center-vertical-border: oklch(100% 0 0 / 0%);
3303
+ --ge-table-header-east-horizontal-border: oklch(100% 0 0 / 0%);
3304
+ --ge-table-header-east-vertical-border: oklch(100% 0 0 / 0%);
3305
+ --ge-table-body-west-bg: #101010;
3306
+ --ge-table-body-center-bg: #101010;
3307
+ --ge-table-body-east-bg: #101010;
3308
+ --ge-table-body-west-text: #b6b4b4;
3309
+ --ge-table-body-center-text: #b6b4b4;
3310
+ --ge-table-body-east-text: #b6b4b4;
3311
+ --ge-table-body-west-horizontal-border: oklch(100% 0 0 / 0%);
3312
+ --ge-table-body-west-vertical-border: oklch(100% 0 0 / 0%);
3313
+ --ge-table-body-center-horizontal-border: oklch(100% 0 0 / 0%);
3314
+ --ge-table-body-center-vertical-border: oklch(100% 0 0 / 0%);
3315
+ --ge-table-body-east-horizontal-border: oklch(100% 0 0 / 0%);
3316
+ --ge-table-body-east-vertical-border: oklch(100% 0 0 / 0%);
3317
+ --ge-table-body-west-selected-range-bg: oklch(20% 0.2 39.6 / 37%);
3318
+ --ge-table-body-center-selected-range-bg: oklch(20% 0.2 39.6 / 37%);
3319
+ --ge-table-body-east-selected-range-bg: oklch(20% 0.2 39.6 / 37%);
3320
+ --ge-table-body-west-selected-range-text: #f00032;
3321
+ --ge-table-body-center-selected-range-text: #f00032;
3322
+ --ge-table-body-east-selected-range-text: #f00032;
3323
+ --ge-table-footer-west-bg: #101010;
3324
+ --ge-table-footer-center-bg: #101010;
3325
+ --ge-table-footer-east-bg: #101010;
3326
+ --ge-table-footer-west-text: oklch(100% 0 0);
3327
+ --ge-table-footer-center-text: oklch(100% 0 0);
3328
+ --ge-table-footer-east-text: oklch(100% 0 0);
3329
+ --ge-table-footer-west-horizontal-border: oklch(100% 0 0 / 0%);
3330
+ --ge-table-footer-west-vertical-border: oklch(100% 0 0 / 0%);
3331
+ --ge-table-footer-center-horizontal-border: oklch(100% 0 0 / 0%);
3332
+ --ge-table-footer-center-vertical-border: oklch(100% 0 0 / 0%);
3333
+ --ge-table-footer-east-horizontal-border: oklch(100% 0 0 / 0%);
3334
+ --ge-table-footer-east-vertical-border: oklch(100% 0 0 / 0%);
3335
+ --ge-table-border: oklch(100% 0 0 / 0%);
3336
+ --ge-table-row-odd-bg: oklch(100% 0 0 / 0%);
3337
+ --ge-table-row-even-bg: oklch(100% 0 0 / 0%);
3338
+ --ge-table-column-odd-bg: oklch(100% 0 0 / 0%);
3339
+ --ge-table-column-even-bg: oklch(100% 0 0 / 0%);
3340
+ --ge-table-hover-column-bg: oklch(34% 0.25 3.6 / 27%);
3341
+ --ge-table-hover-row-bg: oklch(34% 0.25 3.6 / 27%);
3342
+ --ge-table-focus-border: oklch(40% 0.25 3.6);
3343
+ --ge-table-color-error-text: oklch(65% 0.31 43.2);
3344
+ --ge-table-tree-arrow-collapsed-color: #e00034;
3345
+ --ge-table-column-resize-handle-border: oklch(63% 0.31 43.2);
3346
+ --ge-table-dragged-col-div-bg: #2c2e33;
3347
+ --ge-table-drop-zone-bg: #101010;
3348
+ }`,
3349
+ paper: `html[data-theme="paper"] {
3350
+ --ge-table-bg: #e7e5df;
3351
+ --ge-table-header-west-bg: oklch(80% 0.02 99 / 48%);
3352
+ --ge-table-header-center-bg: oklch(80% 0.02 99 / 48%);
3353
+ --ge-table-header-east-bg: oklch(80% 0.02 99 / 48%);
3354
+ --ge-table-header-west-text: #111;
3355
+ --ge-table-header-center-text: #111;
3356
+ --ge-table-header-east-text: #111;
3357
+ --ge-table-header-west-horizontal-border: oklch(100% 0 0 / 0%);
3358
+ --ge-table-header-west-vertical-border: oklch(100% 0 0 / 0%);
3359
+ --ge-table-header-center-horizontal-border: oklch(100% 0 0 / 0%);
3360
+ --ge-table-header-center-vertical-border: oklch(100% 0 0 / 0%);
3361
+ --ge-table-header-east-horizontal-border: oklch(100% 0 0 / 0%);
3362
+ --ge-table-header-east-vertical-border: oklch(100% 0 0 / 0%);
3363
+ --ge-table-body-west-bg: oklch(80% 0.02 99 / 48%);
3364
+ --ge-table-body-center-bg: #e7e5df;
3365
+ --ge-table-body-east-bg: oklch(80% 0.02 99 / 48%);
3366
+ --ge-table-body-west-text: #000;
3367
+ --ge-table-body-center-text: #000;
3368
+ --ge-table-body-east-text: #000;
3369
+ --ge-table-body-west-horizontal-border: oklch(100% 0 0 / 0%);
3370
+ --ge-table-body-west-vertical-border: oklch(100% 0 0 / 0%);
3371
+ --ge-table-body-center-horizontal-border: oklch(100% 0 0 / 0%);
3372
+ --ge-table-body-center-vertical-border: oklch(100% 0 0 / 0%);
3373
+ --ge-table-body-east-horizontal-border: oklch(100% 0 0 / 0%);
3374
+ --ge-table-body-east-vertical-border: oklch(100% 0 0 / 0%);
3375
+ --ge-table-body-west-selected-range-bg: #cfcdc2;
3376
+ --ge-table-body-center-selected-range-bg: #cfcdc2;
3377
+ --ge-table-body-east-selected-range-bg: #cfcdc2;
3378
+ --ge-table-body-west-selected-range-text: #000;
3379
+ --ge-table-body-center-selected-range-text: #000;
3380
+ --ge-table-body-east-selected-range-text: #000;
3381
+ --ge-table-footer-west-bg: oklch(80% 0.02 99 / 48%);
3382
+ --ge-table-footer-center-bg: oklch(80% 0.02 99 / 48%);
3383
+ --ge-table-footer-east-bg: oklch(80% 0.02 99 / 48%);
3384
+ --ge-table-footer-west-text: #111;
3385
+ --ge-table-footer-center-text: #111;
3386
+ --ge-table-footer-east-text: #111;
3387
+ --ge-table-footer-west-horizontal-border: oklch(100% 0 0 / 0%);
3388
+ --ge-table-footer-west-vertical-border: oklch(100% 0 0 / 0%);
3389
+ --ge-table-footer-center-horizontal-border: oklch(100% 0 0 / 0%);
3390
+ --ge-table-footer-center-vertical-border: oklch(100% 0 0 / 0%);
3391
+ --ge-table-footer-east-horizontal-border: oklch(100% 0 0 / 0%);
3392
+ --ge-table-footer-east-vertical-border: oklch(100% 0 0 / 0%);
3393
+ --ge-table-border: oklch(100% 0 0 / 0%);
3394
+ --ge-table-row-odd-bg: oklch(100% 0 0 / 0%);
3395
+ --ge-table-row-even-bg: oklch(100% 0 0 / 0%);
3396
+ --ge-table-column-odd-bg: oklch(100% 0 0 / 0%);
3397
+ --ge-table-column-even-bg: oklch(100% 0 0 / 0%);
3398
+ --ge-table-hover-column-bg: oklch(5% 0.2 266.40000000000003 / 9%);
3399
+ --ge-table-hover-row-bg: oklch(5% 0.2 266.40000000000003 / 9%);
3400
+ --ge-table-focus-border: oklch(100% 0.19 205.20000000000002);
3401
+ --ge-table-color-error-text: oklch(45% 0.25 43.2);
3402
+ --ge-table-tree-arrow-collapsed-color: #e00034;
3403
+ --ge-table-column-resize-handle-border: oklch(100% 0.19 205.20000000000002 / 71%);
3404
+ --ge-table-dragged-col-div-bg: #2c2e33;
3405
+ --ge-table-drop-zone-bg: #e7e5df;
3406
+ }`,
3407
+ blackboard: `html[data-theme="dark"] {
3408
+ --ge-table-bg: #0c1021;
3409
+ --ge-table-header-west-bg: #0c1021;
3410
+ --ge-table-header-center-bg: #0c1021;
3411
+ --ge-table-header-east-bg: #0c1021;
3412
+ --ge-table-header-west-text: #e0df85;
3413
+ --ge-table-header-center-text: #e0df85;
3414
+ --ge-table-header-east-text: #e0df85;
3415
+ --ge-table-header-west-horizontal-border: transparent;
3416
+ --ge-table-header-west-vertical-border: transparent;
3417
+ --ge-table-header-center-horizontal-border: transparent;
3418
+ --ge-table-header-center-vertical-border: transparent;
3419
+ --ge-table-header-east-horizontal-border: transparent;
3420
+ --ge-table-header-east-vertical-border: transparent;
3421
+ --ge-table-body-west-bg: #0c1021;
3422
+ --ge-table-body-center-bg: #0c1021;
3423
+ --ge-table-body-east-bg: #0c1021;
3424
+ --ge-table-body-west-text: #a7a7a7;
3425
+ --ge-table-body-center-text: #a7a7a7;
3426
+ --ge-table-body-east-text: #a7a7a7;
3427
+ --ge-table-body-west-horizontal-border: transparent;
3428
+ --ge-table-body-west-vertical-border: transparent;
3429
+ --ge-table-body-center-horizontal-border: transparent;
3430
+ --ge-table-body-center-vertical-border: transparent;
3431
+ --ge-table-body-east-horizontal-border: transparent;
3432
+ --ge-table-body-east-vertical-border: transparent;
3433
+ --ge-table-body-west-selected-range-bg: #758129;
3434
+ --ge-table-body-center-selected-range-bg: #758129;
3435
+ --ge-table-body-east-selected-range-bg: #758129;
3436
+ --ge-table-body-west-selected-range-text: oklch(100% 0 0);
3437
+ --ge-table-body-center-selected-range-text: oklch(100% 0 0);
3438
+ --ge-table-body-east-selected-range-text: oklch(100% 0 0);
3439
+ --ge-table-footer-west-bg: #0c1021;
3440
+ --ge-table-footer-center-bg: #0c1021;
3441
+ --ge-table-footer-east-bg: #0c1021;
3442
+ --ge-table-footer-west-text: #e0df85;
3443
+ --ge-table-footer-center-text: #e0df85;
3444
+ --ge-table-footer-east-text: #e0df85;
3445
+ --ge-table-footer-west-horizontal-border: transparent;
3446
+ --ge-table-footer-west-vertical-border: transparent;
3447
+ --ge-table-footer-center-horizontal-border: transparent;
3448
+ --ge-table-footer-center-vertical-border: otransparent;
3449
+ --ge-table-footer-east-horizontal-border: transparent;
3450
+ --ge-table-footer-east-vertical-border: transparent;
3451
+ --ge-table-border: oklch(0% 0 0);
3452
+ --ge-table-row-odd-bg: oklch(100% 0 0 / 0%);
3453
+ --ge-table-row-even-bg: oklch(100% 0 0 / 0%);
3454
+ --ge-table-column-odd-bg: oklch(100% 0 0 / 0%);
3455
+ --ge-table-column-even-bg: oklch(100% 0 0 / 0%);
3456
+ --ge-table-hover-column-bg: #a9a9a9;
3457
+ --ge-table-hover-row-bg: #a9a9a9;
3458
+ --ge-table-focus-border: #e1ff00;
3459
+ --ge-table-color-error-text: #ff0040;
3460
+ --ge-table-tree-arrow-collapsed-color: #e00034;
3461
+ --ge-table-column-resize-handle-border: oklch(0% 0 0);
3462
+ --ge-table-dragged-col-div-bg: #2c2e33;
3463
+ --ge-table-drop-zone-bg: #758129;
3464
+ }`
3465
+ };
3466
+ let fe = Y;
3467
+ const U = class U {
3468
+ constructor(e = new Re()) {
3469
+ this.headerGroupOptions = e;
3470
+ }
3471
+ render(e, t, s, o, i, l, n) {
3472
+ const a = l != null && l.data ? l.data : "";
3473
+ if (l) {
3474
+ const { toggle: c, visibility: d, closed: h } = l, g = c ? U.toggleHeaderGroup : "";
3475
+ this.addText(e, o, t, s, a, g), c && d !== "always" && this.addArrowDiv(n, e, !h, t, s, o, g);
3476
+ } else
3477
+ this.addText(e, o, t, s, a, "");
3478
+ }
3479
+ addText(e, t, s, o, i, l) {
3480
+ e.innerHTML = `<span
3481
+ data-ge-action="${l}"
3482
+ data-area="${t}"
3483
+ data-row-index="${s}"
3484
+ data-col-index="${o}"
3485
+ >${i}</span>`;
3486
+ }
3487
+ addArrowDiv(e, t, s = !0, o = -1, i = -1, l = "header", n) {
3488
+ const a = e.createElement("div");
3489
+ e.addClass(a, "ge-table-toggle-icon-div"), e.setStyle(a, "display", "inline-block"), e.setStyle(a, "position", ""), e.setStyle(a, "width", "20px"), e.setStyle(a, "background", "transparent"), e.setStyle(a, "cursor", "pointer"), e.setAttribute(a, "data-row-index", `${o}`), e.setAttribute(a, "data-col-index", `${i}`), e.setAttribute(a, "data-area", `${l}`), e.setAttribute(a, "data-ge-action", `${n}`);
3490
+ let c;
3491
+ s ? c = this.headerGroupOptions.iconExpanded : c = this.headerGroupOptions.iconCollapsed;
3492
+ const d = c.content, h = e.createText(d);
3493
+ e.appendChild(a, h), c.style && this.applyStyleString(e, a, c.style);
3494
+ for (const g of c.classes)
3495
+ e.addClass(a, g);
3496
+ return e.appendChild(t, a), a;
3497
+ }
3498
+ applyStyleString(e, t, s) {
3499
+ const o = s.split(";").map((i) => i.trim()).filter((i) => i);
3500
+ for (const i of o) {
3501
+ const [l, n] = i.split(":");
3502
+ e.setStyle(t, l.trim(), n.trim());
3503
+ }
3504
+ }
3505
+ };
3506
+ U.toggleHeaderGroup = "toggleHeaderGroup";
3507
+ let Se = U;
3508
+ const St = /* @__PURE__ */ ze("<div>"), vt = (r) => {
2510
3509
  let e;
2511
- const t = me({
3510
+ const t = xe({
2512
3511
  tableModel: null,
2513
- tableOptions: new we()
2514
- }, l);
2515
- return Me(() => {
3512
+ tableOptions: new Te()
3513
+ }, r);
3514
+ return Fe(() => {
2516
3515
  const s = {
2517
- onCheckboxChanged: (r) => {
3516
+ onSelectionChanged(l) {
3517
+ const n = new CustomEvent("selectionChanged", {
3518
+ detail: l,
3519
+ bubbles: !0
3520
+ });
3521
+ e && e.dispatchEvent(n);
3522
+ },
3523
+ onFocusChanged(l) {
3524
+ const n = new CustomEvent("focusChanged", {
3525
+ detail: l,
3526
+ bubbles: !0
3527
+ });
3528
+ e && e.dispatchEvent(n);
3529
+ },
3530
+ onCheckboxChanged: (l) => {
2518
3531
  const n = new CustomEvent("checkboxChanged", {
2519
- detail: r,
3532
+ detail: l,
2520
3533
  bubbles: !0
2521
3534
  });
2522
3535
  e && e.dispatchEvent(n);
2523
3536
  },
2524
- onContextmenu: (r) => {
3537
+ onContextmenu: (l) => {
2525
3538
  const n = new CustomEvent("contextmenu", {
2526
- detail: r,
3539
+ detail: l,
2527
3540
  bubbles: !0
2528
3541
  });
2529
3542
  e && e.dispatchEvent(n);
2530
3543
  },
2531
- onModelChanged: (r) => {
3544
+ onModelChanged: (l) => {
2532
3545
  const n = new CustomEvent("modelChanged", {
2533
- detail: r,
3546
+ detail: l,
2534
3547
  bubbles: !0
2535
3548
  });
2536
3549
  e && e.dispatchEvent(n);
2537
3550
  },
2538
- onMouseClicked: (r) => {
3551
+ onMouseClicked: (l) => {
2539
3552
  const n = new CustomEvent("mouseClicked", {
2540
- detail: r,
3553
+ detail: l,
2541
3554
  bubbles: !0
2542
3555
  });
2543
3556
  e && e.dispatchEvent(n);
2544
3557
  },
2545
- onMouseDragging: (r) => {
3558
+ onMouseDragging: (l) => {
2546
3559
  const n = new CustomEvent("mouseDragging", {
2547
- detail: r,
3560
+ detail: l,
2548
3561
  bubbles: !0
2549
3562
  });
2550
3563
  e && e.dispatchEvent(n);
2551
3564
  },
2552
- onMouseDraggingEnd: (r) => {
3565
+ onMouseDraggingEnd: (l) => {
2553
3566
  const n = new CustomEvent("mouseDraggingEnd", {
2554
- detail: r,
3567
+ detail: l,
2555
3568
  bubbles: !0
2556
3569
  });
2557
3570
  e && e.dispatchEvent(n);
2558
3571
  },
2559
- onMouseMoved: (r) => {
3572
+ onMouseMoved: (l) => {
2560
3573
  const n = new CustomEvent("mouseMoved", {
2561
- detail: r,
3574
+ detail: l,
2562
3575
  bubbles: !0
2563
3576
  });
2564
3577
  e && e.dispatchEvent(n);
2565
3578
  }
2566
- }, i = new re(e, t.tableModel, new ve(), t.tableOptions, s);
2567
- i.firstInit();
2568
- const o = new CustomEvent("tableReady", {
2569
- detail: i.getApi(),
3579
+ }, o = new he(e, t.tableModel, new Me(), t.tableOptions, s);
3580
+ o.firstInit();
3581
+ const i = new CustomEvent("tableReady", {
3582
+ detail: o.getApi(),
2570
3583
  bubbles: !0
2571
3584
  });
2572
- e && e.dispatchEvent(o);
3585
+ e && e.dispatchEvent(i), t.licenseKey && $.getInstance().setLicenseKey(t.licenseKey);
2573
3586
  }), (() => {
2574
- const s = ht(), i = e;
2575
- return typeof i == "function" ? He(i, s) : e = s, s;
3587
+ const s = St(), o = e;
3588
+ return typeof o == "function" ? je(o, s) : e = s, s;
2576
3589
  })();
2577
3590
  };
2578
3591
  export {
2579
- ct as ComponentRendererWrapper,
2580
- pt as GuiexpertTable,
2581
- ut as GuiexpertTableProps
3592
+ mt as ComponentRendererWrapper,
3593
+ vt as GuiexpertTable,
3594
+ yt as GuiexpertTableProps
2582
3595
  };