@guiexpert/svelte-table 1.0.11 → 4.0.1

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.
@@ -2,7 +2,7 @@ var me = Object.defineProperty;
2
2
  var ye = (a, e, t) => e in a ? me(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
3
  var N = (a, e, t) => (ye(a, typeof e != "symbol" ? e + "" : e, t), t);
4
4
  import { createEventDispatcher as ve, onMount as we } from "svelte";
5
- function $() {
5
+ function L() {
6
6
  }
7
7
  function de(a) {
8
8
  return a();
@@ -16,10 +16,10 @@ function V(a) {
16
16
  function ce(a) {
17
17
  return typeof a == "function";
18
18
  }
19
- function xe(a, e) {
19
+ function Ce(a, e) {
20
20
  return a != a ? e == e : a !== e || a && typeof a == "object" || typeof a == "function";
21
21
  }
22
- function Ce(a) {
22
+ function xe(a) {
23
23
  return Object.keys(a).length === 0;
24
24
  }
25
25
  function Ee(a, e, t) {
@@ -44,39 +44,39 @@ let J;
44
44
  function B(a) {
45
45
  J = a;
46
46
  }
47
- const O = [], X = [];
48
- let L = [];
47
+ const I = [], X = [];
48
+ let $ = [];
49
49
  const re = [], Te = /* @__PURE__ */ Promise.resolve();
50
50
  let K = !1;
51
51
  function De() {
52
52
  K || (K = !0, Te.then(ge));
53
53
  }
54
54
  function Y(a) {
55
- L.push(a);
55
+ $.push(a);
56
56
  }
57
57
  const j = /* @__PURE__ */ new Set();
58
- let I = 0;
58
+ let O = 0;
59
59
  function ge() {
60
- if (I !== 0)
60
+ if (O !== 0)
61
61
  return;
62
62
  const a = J;
63
63
  do {
64
64
  try {
65
- for (; I < O.length; ) {
66
- const e = O[I];
67
- I++, B(e), ke(e.$$);
65
+ for (; O < I.length; ) {
66
+ const e = I[O];
67
+ O++, B(e), ke(e.$$);
68
68
  }
69
69
  } catch (e) {
70
- throw O.length = 0, I = 0, e;
70
+ throw I.length = 0, O = 0, e;
71
71
  }
72
- for (B(null), O.length = 0, I = 0; X.length; )
72
+ for (B(null), I.length = 0, O = 0; X.length; )
73
73
  X.pop()();
74
- for (let e = 0; e < L.length; e += 1) {
75
- const t = L[e];
74
+ for (let e = 0; e < $.length; e += 1) {
75
+ const t = $[e];
76
76
  j.has(t) || (j.add(t), t());
77
77
  }
78
- L.length = 0;
79
- } while (O.length);
78
+ $.length = 0;
79
+ } while (I.length);
80
80
  for (; re.length; )
81
81
  re.pop()();
82
82
  K = !1, j.clear(), B(a);
@@ -88,27 +88,27 @@ function ke(a) {
88
88
  a.dirty = [-1], a.fragment && a.fragment.p(a.ctx, e), a.after_update.forEach(Y);
89
89
  }
90
90
  }
91
- function Ie(a) {
91
+ function Oe(a) {
92
92
  const e = [], t = [];
93
- L.forEach((o) => a.indexOf(o) === -1 ? e.push(o) : t.push(o)), t.forEach((o) => o()), L = e;
93
+ $.forEach((o) => a.indexOf(o) === -1 ? e.push(o) : t.push(o)), t.forEach((o) => o()), $ = e;
94
94
  }
95
- const Oe = /* @__PURE__ */ new Set();
95
+ const Ie = /* @__PURE__ */ new Set();
96
96
  function Fe(a, e) {
97
- a && a.i && (Oe.delete(a), a.i(e));
97
+ a && a.i && (Ie.delete(a), a.i(e));
98
98
  }
99
- function $e(a, e, t) {
99
+ function Le(a, e, t) {
100
100
  const { fragment: o, after_update: s } = a.$$;
101
101
  o && o.m(e, t), Y(() => {
102
102
  const i = a.$$.on_mount.map(de).filter(ce);
103
103
  a.$$.on_destroy ? a.$$.on_destroy.push(...i) : V(i), a.$$.on_mount = [];
104
104
  }), s.forEach(Y);
105
105
  }
106
- function Le(a, e) {
106
+ function $e(a, e) {
107
107
  const t = a.$$;
108
- t.fragment !== null && (Ie(t.after_update), V(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
108
+ t.fragment !== null && (Oe(t.after_update), V(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
109
109
  }
110
110
  function _e(a, e) {
111
- a.$$.dirty[0] === -1 && (O.push(a), De(), a.$$.dirty.fill(0)), a.$$.dirty[e / 31 | 0] |= 1 << e % 31;
111
+ a.$$.dirty[0] === -1 && (I.push(a), De(), a.$$.dirty.fill(0)), a.$$.dirty[e / 31 | 0] |= 1 << e % 31;
112
112
  }
113
113
  function Be(a, e, t, o, s, i, r = null, n = [-1]) {
114
114
  const l = J;
@@ -118,7 +118,7 @@ function Be(a, e, t, o, s, i, r = null, n = [-1]) {
118
118
  ctx: [],
119
119
  // state
120
120
  props: i,
121
- update: $,
121
+ update: L,
122
122
  not_equal: s,
123
123
  bound: ie(),
124
124
  // lifecycle
@@ -137,15 +137,15 @@ function Be(a, e, t, o, s, i, r = null, n = [-1]) {
137
137
  r && r(d.root);
138
138
  let c = !1;
139
139
  if (d.ctx = t ? t(a, e.props || {}, (h, g, ...f) => {
140
- const u = f.length ? f[0] : g;
141
- return d.ctx && s(d.ctx[h], d.ctx[h] = u) && (!d.skip_bound && d.bound[h] && d.bound[h](u), c && _e(a, h)), g;
140
+ const b = f.length ? f[0] : g;
141
+ return d.ctx && s(d.ctx[h], d.ctx[h] = b) && (!d.skip_bound && d.bound[h] && d.bound[h](b), c && _e(a, h)), g;
142
142
  }) : [], d.update(), c = !0, V(d.before_update), d.fragment = o ? o(d.ctx) : !1, e.target) {
143
143
  if (e.hydrate) {
144
144
  const h = Re(e.target);
145
145
  d.fragment && d.fragment.l(h), h.forEach(he);
146
146
  } else
147
147
  d.fragment && d.fragment.c();
148
- e.intro && Fe(a.$$.fragment), $e(a, e.target, e.anchor), ge();
148
+ e.intro && Fe(a.$$.fragment), Le(a, e.target, e.anchor), ge();
149
149
  }
150
150
  B(l);
151
151
  }
@@ -170,7 +170,7 @@ class Pe {
170
170
  }
171
171
  /** @returns {void} */
172
172
  $destroy() {
173
- Le(this, 1), this.$destroy = $;
173
+ $e(this, 1), this.$destroy = L;
174
174
  }
175
175
  /**
176
176
  * @template {Extract<keyof Events, string>} K
@@ -180,7 +180,7 @@ class Pe {
180
180
  */
181
181
  $on(e, t) {
182
182
  if (!ce(t))
183
- return $;
183
+ return L;
184
184
  const o = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
185
185
  return o.push(t), () => {
186
186
  const s = o.indexOf(t);
@@ -192,7 +192,7 @@ class Pe {
192
192
  * @returns {void}
193
193
  */
194
194
  $set(e) {
195
- this.$$set && !Ce(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
195
+ this.$$set && !xe(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
196
196
  }
197
197
  }
198
198
  const He = "4";
@@ -274,7 +274,7 @@ class pe {
274
274
  this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = o, this.arrowExpandCollapseAll = s;
275
275
  }
276
276
  }
277
- class be {
277
+ class ue {
278
278
  constructor(e = new D("↑", "", ["ge-header-sorted-asc"]), t = new D("↓", "", ["ge-header-sorted-desc"]), o = new D("↑", "color:transparent;", [])) {
279
279
  this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = o;
280
280
  }
@@ -365,10 +365,10 @@ class We {
365
365
  return this.domService.appendChild(e.child, l), l;
366
366
  }
367
367
  addColumnDiv(e) {
368
- const { parent: t, geo: o, rowIndex: s = -1, columnIndex: i = -1, areaIdent: r, sideIdent: n, text: l = "", treeArrow: d, tableOptions: c, checkedType: h = void 0, sortState: g } = e, f = c == null ? void 0 : c.treeOptions, u = c == null ? void 0 : c.showCheckboxWihoutExtraColumn, S = this.domService.createElement("div");
368
+ const { parent: t, geo: o, rowIndex: s = -1, columnIndex: i = -1, areaIdent: r, sideIdent: n, text: l = "", treeArrow: d, tableOptions: c, checkedType: h = void 0, sortState: g } = e, f = c == null ? void 0 : c.treeOptions, b = c == null ? void 0 : c.showCheckboxWihoutExtraColumn, S = this.domService.createElement("div");
369
369
  this.domService.addClass(S, "ge-table-col-div"), this.domService.addClass(S, `ge-table-col-div-${o.index}`), this.domService.setAttribute(S, "data-col-index", `${o.index}`), this.domService.setAttribute(S, "data-row-index", `${s}`), this.domService.setAttribute(S, "data-area", `${r}`);
370
- const b = ((o == null ? void 0 : o.index) ?? 0) % 2 === 0 ? "even" : "odd";
371
- if (r === "body" && n === "center" && this.domService.addClass(S, `ge-table-column-${b}`), this.domService.setStyle(S, "display", "clip"), this.domService.setStyle(S, "position", "absolute"), this.domService.setStyle(S, "left", `${o.left}px`), this.domService.setStyle(S, "top", `${o.top}px`), this.domService.setStyle(S, "width", `${o.width}px`), this.domService.setStyle(S, "height", `${o.height}px`), d && d !== "none" && (this.domService.addClass(S, "ge-table-col-tree"), this.addArrowDiv(S, d, f, s, i, r)), u && i === 0 && h && this.addCheckboxToDiv(S, h, r, s), l) {
370
+ const u = ((o == null ? void 0 : o.index) ?? 0) % 2 === 0 ? "even" : "odd";
371
+ if (r === "body" && n === "center" && this.domService.addClass(S, `ge-table-column-${u}`), this.domService.setStyle(S, "display", "clip"), this.domService.setStyle(S, "position", "absolute"), this.domService.setStyle(S, "left", `${o.left}px`), this.domService.setStyle(S, "top", `${o.top}px`), this.domService.setStyle(S, "width", `${o.width}px`), this.domService.setStyle(S, "height", `${o.height}px`), d && d !== "none" && (this.domService.addClass(S, "ge-table-col-tree"), this.addArrowDiv(S, d, f, s, i, r)), b && i === 0 && h && this.addCheckboxToDiv(S, h, r, s), l) {
372
372
  const p = d !== "none" && i === 0;
373
373
  this.addLabelDiv(S, l, p, s, i, r);
374
374
  }
@@ -399,7 +399,7 @@ class We {
399
399
  }
400
400
  return this.domService.appendChild(e, n), n;
401
401
  }
402
- addSortedIcon(e, t = "", o = new be(), s = -1) {
402
+ addSortedIcon(e, t = "", o = new ue(), s = -1) {
403
403
  const i = this.domService.createElement("div");
404
404
  this.domService.addClass(i, "ge-table-sorted-icon-div"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "top", "0"), this.domService.setStyle(i, "right", "0"), this.domService.setStyle(i, "width", "20px"), this.domService.setStyle(i, "background", "transparent"), this.domService.setStyle(i, "cursor", "pointer"), this.domService.setAttribute(i, "data-col-index", `${s}`), this.domService.setAttribute(i, "data-area", "header");
405
405
  let r;
@@ -513,7 +513,7 @@ class Ve {
513
513
  this.tableScope.toggleRowCheckbox(o.rowIdx, o.colIdx, o.areaIdent), e.preventDefault(), e.stopPropagation();
514
514
  else if (q(o.row) && o.areaModel) {
515
515
  const s = o.colIdx === this.getArrowColumnIndex() && e.altKey, i = o.className.includes("ge-table-tree-arrow-div");
516
- if (console.info(i, s), s || i) {
516
+ if (s || i) {
517
517
  e.preventDefault(), e.stopPropagation();
518
518
  const r = o.row;
519
519
  r.expanded = !r.expanded, "recalcVisibleTreeRows" in o.areaModel && o.areaModel.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(r);
@@ -1340,15 +1340,15 @@ class Je extends Ye {
1340
1340
  if (l.innerText = "", this.applyCssClasses(l, i), h)
1341
1341
  d = h.render(l, t, o, e, r, s, this.dom.domService), d && this.cleanupFunctions[e].push(d);
1342
1342
  else {
1343
- const u = `${s}`;
1344
- this.dom.addLabelDiv(l, u, !1, t, o, e);
1343
+ const b = `${s}`;
1344
+ this.dom.addLabelDiv(l, b, !1, t, o, e);
1345
1345
  }
1346
1346
  const g = r.getCustomClassesAt(t, o);
1347
1347
  g.length && this.dom.addClasses(g, l);
1348
1348
  const f = r.getCustomStyleAt(t, o);
1349
1349
  if (f)
1350
- for (const u in f)
1351
- this.dom.setStyle(l, u, f[u]);
1350
+ for (const b in f)
1351
+ this.dom.setStyle(l, b, f[b]);
1352
1352
  }
1353
1353
  }
1354
1354
  /**
@@ -1457,7 +1457,7 @@ class Je extends Ye {
1457
1457
  * @protected
1458
1458
  */
1459
1459
  adjustArea(e, t = 0) {
1460
- var b;
1460
+ var u;
1461
1461
  const o = this.getArea(e, "west"), s = this.getArea(e, "center"), i = this.getArea(e, "east"), r = s.child.clientHeight;
1462
1462
  o.child.innerText = "", s.child.innerText = "", i.child.innerText = "";
1463
1463
  const n = 0, l = this.areaBodyCenterGeo.width, d = this.tableModel.getPadding(), c = this.tableModel.getAreaModel(e), h = c.getRowCount();
@@ -1466,12 +1466,12 @@ class Je extends Ye {
1466
1466
  p && p();
1467
1467
  }
1468
1468
  let g = t;
1469
- const f = this.tableModel.getColumnCount(), u = this.tableModel.getFixedRightColumnCount(), S = this.tableModel.getFixedLeftColumnCount();
1469
+ const f = this.tableModel.getColumnCount(), b = this.tableModel.getFixedRightColumnCount(), S = this.tableModel.getFixedLeftColumnCount();
1470
1470
  for (let p = 0; p < h; p++) {
1471
- const v = g, w = p === h - 1, C = this.tableModel.getRowHeight(e, p);
1472
- if (v + C > 0) {
1471
+ const v = g, w = p === h - 1, x = this.tableModel.getRowHeight(e, p);
1472
+ if (v + x > 0) {
1473
1473
  this.firstVisibleRowIndex = p;
1474
- let y = { left: n, width: l, height: C, top: v, index: p }, m = this.dom.addRowDiv(s, y, p, e, "center");
1474
+ let y = { left: n, width: l, height: x, top: v, index: p }, m = this.dom.addRowDiv(s, y, p, e, "center");
1475
1475
  const R = S;
1476
1476
  if (this.adjustColumnsToRowParent({
1477
1477
  areaIdent: e,
@@ -1481,10 +1481,10 @@ class Je extends Ye {
1481
1481
  parent: m,
1482
1482
  rowIndex: p,
1483
1483
  columnIndexStart: R,
1484
- columnIndexEnd: f - u - 1,
1484
+ columnIndexEnd: f - b - 1,
1485
1485
  verticalFixed: !1,
1486
1486
  lastRowOfModel: w
1487
- }), d.left > 0 && (y = { left: n, width: this.areaBodyWestGeo.width, height: C, top: v, index: p }, m = this.dom.addRowDiv(o, y, p, e, "west"), this.adjustColumnsToRowParent({
1487
+ }), d.left > 0 && (y = { left: n, width: this.areaBodyWestGeo.width, height: x, top: v, index: p }, m = this.dom.addRowDiv(o, y, p, e, "west"), this.adjustColumnsToRowParent({
1488
1488
  areaIdent: e,
1489
1489
  sideIdent: "west",
1490
1490
  areaModel: c,
@@ -1495,14 +1495,14 @@ class Je extends Ye {
1495
1495
  columnIndexEnd: R - 1,
1496
1496
  verticalFixed: !0,
1497
1497
  lastRowOfModel: w
1498
- })), d.right > 0 && (y = { left: n, width: this.areaBodyEastGeo.width, height: C, top: v, index: p }, m = this.dom.addRowDiv(i, y, p, e, "east"), this.adjustColumnsToRowParent({
1498
+ })), d.right > 0 && (y = { left: n, width: this.areaBodyEastGeo.width, height: x, top: v, index: p }, m = this.dom.addRowDiv(i, y, p, e, "east"), this.adjustColumnsToRowParent({
1499
1499
  areaIdent: e,
1500
1500
  sideIdent: "east",
1501
1501
  areaModel: c,
1502
1502
  geo: y,
1503
1503
  parent: m,
1504
1504
  rowIndex: p,
1505
- columnIndexStart: f - u,
1505
+ columnIndexStart: f - b,
1506
1506
  columnIndexEnd: f - 1,
1507
1507
  verticalFixed: !0,
1508
1508
  lastRowOfModel: w
@@ -1521,23 +1521,23 @@ class Je extends Ye {
1521
1521
  }
1522
1522
  }
1523
1523
  }
1524
- if (g = g + C, g > r)
1524
+ if (g = g + x, g > r)
1525
1525
  break;
1526
1526
  }
1527
1527
  if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
1528
- const p = ((b = this.colAndRowspanModels[e]) == null ? void 0 : b.getRanges()) ?? [];
1528
+ const p = ((u = this.colAndRowspanModels[e]) == null ? void 0 : u.getRanges()) ?? [];
1529
1529
  if (p.length)
1530
1530
  for (const v of p) {
1531
- let w = 0, C = s.child, y = "center";
1531
+ let w = 0, x = s.child, y = "center";
1532
1532
  if (v.c1 < S)
1533
- C = o.child, y = "west";
1534
- else if (u > 0 && v.c1 >= f - u)
1535
- C = i.child, y = "east";
1533
+ x = o.child, y = "west";
1534
+ else if (b > 0 && v.c1 >= f - b)
1535
+ x = i.child, y = "east";
1536
1536
  else {
1537
1537
  const m = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1538
1538
  w = this.scrollFactorX * m - this.areaBodyWestGeo.width, y = "center";
1539
1539
  }
1540
- this.drawBigCell(v, w, t, c, C, y);
1540
+ this.drawBigCell(v, w, t, c, x, y);
1541
1541
  }
1542
1542
  }
1543
1543
  }
@@ -1552,13 +1552,13 @@ class Je extends Ye {
1552
1552
  * @protected
1553
1553
  */
1554
1554
  drawBigCell(e, t, o, s, i, r) {
1555
- const n = o + this.getRowHeights(0, e.r1 - 1, s).reduce((b, p) => b + p, 0), l = this.tableModel.getColumnCount(), d = this.tableModel.getFixedRightColumnCount();
1555
+ const n = o + this.getRowHeights(0, e.r1 - 1, s).reduce((u, p) => u + p, 0), l = this.tableModel.getColumnCount(), d = this.tableModel.getFixedRightColumnCount();
1556
1556
  let c = 0;
1557
1557
  d > 0 && e.c1 >= l - d && (c = l - d);
1558
- const h = t + this.getColumnWidths(c, e.c1 - 1).reduce((b, p) => b + p, 0), g = this.getRowHeights(e.r1, e.r2, s).reduce((b, p) => b + p, 0), f = this.getColumnWidths(e.c1, e.c2).reduce((b, p) => b + p, 0);
1559
- let u = !1;
1558
+ const h = t + this.getColumnWidths(c, e.c1 - 1).reduce((u, p) => u + p, 0), g = this.getRowHeights(e.r1, e.r2, s).reduce((u, p) => u + p, 0), f = this.getColumnWidths(e.c1, e.c2).reduce((u, p) => u + p, 0);
1559
+ let b = !1;
1560
1560
  const S = this.getSelectionModel ? this.getSelectionModel() : void 0;
1561
- S && (u = S.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? this.renderCell({
1561
+ S && (b = S.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? this.renderCell({
1562
1562
  areaModel: s,
1563
1563
  areaIdent: s.areaIdent,
1564
1564
  sideIdent: r,
@@ -1569,7 +1569,7 @@ class Je extends Ye {
1569
1569
  width: f,
1570
1570
  height: g,
1571
1571
  parent: i,
1572
- cellSelected: u,
1572
+ cellSelected: b,
1573
1573
  lastRowOfModel: !0,
1574
1574
  gammaRange: e.gammaRange
1575
1575
  }) : this.renderCell({
@@ -1583,7 +1583,7 @@ class Je extends Ye {
1583
1583
  width: f,
1584
1584
  height: g,
1585
1585
  parent: i,
1586
- cellSelected: u,
1586
+ cellSelected: b,
1587
1587
  lastRowOfModel: !0,
1588
1588
  gammaRange: e.gammaRange
1589
1589
  }), s.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
@@ -1639,32 +1639,32 @@ class Je extends Ye {
1639
1639
  this.scrollViewportLeft = this.scrollViewport.scrollLeft;
1640
1640
  let h = 0;
1641
1641
  if (!d) {
1642
- const b = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1643
- h = this.scrollFactorX * b;
1642
+ const u = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1643
+ h = this.scrollFactorX * u;
1644
1644
  }
1645
1645
  const g = 0, f = !!(e === "body" && t);
1646
- let u = h;
1647
- for (let b = n; b <= l; b++) {
1648
- const p = u, v = this.tableModel.getColumnWidth(b);
1646
+ let b = h;
1647
+ for (let u = n; u <= l; u++) {
1648
+ const p = b, v = this.tableModel.getColumnWidth(u);
1649
1649
  if (v > 0 && p + v > 0) {
1650
1650
  let w = s.height;
1651
- const C = o.getRowspanAt(r, b), y = o.getColspanAt(r, b);
1652
- C > 1 && (w = this.getRowHeights(r, r + C - 1, o).reduce((A, M) => A + M, 0));
1651
+ const x = o.getRowspanAt(r, u), y = o.getColspanAt(r, u);
1652
+ x > 1 && (w = this.getRowHeights(r, r + x - 1, o).reduce((A, M) => A + M, 0));
1653
1653
  let m = v;
1654
- y > 1 && (m = this.getColumnWidths(b, b + y - 1).reduce((A, M) => A + M, 0));
1654
+ y > 1 && (m = this.getColumnWidths(u, u + y - 1).reduce((A, M) => A + M, 0));
1655
1655
  let R = !1;
1656
- if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (S = this.colAndRowspanModels[e]) != null && S.isInRange(r, b) && (R = !0), this.draggingTargetColumnIndex === b && e !== "header") {
1656
+ if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (S = this.colAndRowspanModels[e]) != null && S.isInRange(r, u) && (R = !0), this.draggingTargetColumnIndex === u && e !== "header") {
1657
1657
  this.renderDragTargetDiv(i, p, g, m, w);
1658
1658
  const A = { left: p, top: g, width: m, height: w };
1659
1659
  this.dom.addColumnBorderDivs(this.tableOptions, i, A, e, t);
1660
1660
  } else {
1661
- const A = this.renderSelectedBackgroundDiv(R, f, t, o, r, b, i, p, g, m, w);
1662
- "gammaCells" in o && o.getValueAt(r, b) && (R = !1), R || this.renderCell({
1661
+ const A = this.renderSelectedBackgroundDiv(R, f, t, o, r, u, i, p, g, m, w);
1662
+ "gammaCells" in o && o.getValueAt(r, u) && (R = !1), R || this.renderCell({
1663
1663
  areaModel: o,
1664
1664
  areaIdent: e,
1665
1665
  sideIdent: t,
1666
1666
  rowIndex: r,
1667
- columnIndex: b,
1667
+ columnIndex: u,
1668
1668
  left: p,
1669
1669
  top: g,
1670
1670
  width: m,
@@ -1675,7 +1675,7 @@ class Je extends Ye {
1675
1675
  gammaRange: !0
1676
1676
  }), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
1677
1677
  rowIndex: r,
1678
- columnIndex: b,
1678
+ columnIndex: u,
1679
1679
  cellLeft: p,
1680
1680
  cellTop: g,
1681
1681
  cellWidth: m,
@@ -1684,10 +1684,10 @@ class Je extends Ye {
1684
1684
  });
1685
1685
  }
1686
1686
  }
1687
- if (u = u + v, u > this.areaBodyCenterGeo.width)
1687
+ if (b = b + v, b > this.areaBodyCenterGeo.width)
1688
1688
  break;
1689
1689
  }
1690
- this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(u - 1, 1, s.height, 0), i);
1690
+ this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(b - 1, 1, s.height, 0), i);
1691
1691
  }
1692
1692
  /**
1693
1693
  * Retrieves the column index of the tree arrow column in the table.
@@ -1715,27 +1715,27 @@ class Je extends Ye {
1715
1715
  lastRowOfModel: h
1716
1716
  }) {
1717
1717
  var se;
1718
- const f = this.editorRenderer && this.editorRendererRow === s && this.editorRendererColumn === i ? this.editorRenderer : e.getCellRenderer(s, i), u = { left: r, width: n, height: l, top: d, index: i }, S = e.getRowByIndex(s);
1719
- let b = "none";
1718
+ const f = this.editorRenderer && this.editorRendererRow === s && this.editorRendererColumn === i ? this.editorRenderer : e.getCellRenderer(s, i), b = { left: r, width: n, height: l, top: d, index: i }, S = e.getRowByIndex(s);
1719
+ let u = "none";
1720
1720
  if (i === this.getTreeArrowColumnIndex() && q(S)) {
1721
- const x = S;
1722
- (se = x.children) != null && se.length ? x.expanded ? b = "expanded" : b = "collapsed" : b = "hidden";
1721
+ const C = S;
1722
+ (se = C.children) != null && se.length ? C.expanded ? u = "expanded" : u = "collapsed" : u = "hidden";
1723
1723
  }
1724
1724
  let v;
1725
1725
  if (t === "header") {
1726
- const x = this.tableModel.getColumnDef(i);
1727
- (!(x != null && x.sortIconVisible) || x != null && x.sortIconVisible()) && (v = x == null ? void 0 : x.sortState);
1726
+ const C = this.tableModel.getColumnDef(i);
1727
+ (!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (v = C == null ? void 0 : C.sortState);
1728
1728
  }
1729
- const w = e.getValueAt(s, i), C = f ? "" : `${w}`, y = e.isRowChecked(s), m = this.dom.addColumnDiv(
1729
+ const w = e.getValueAt(s, i), x = f ? "" : `${w}`, y = e.isRowChecked(s), m = this.dom.addColumnDiv(
1730
1730
  {
1731
1731
  parent: c,
1732
- geo: u,
1732
+ geo: b,
1733
1733
  rowIndex: s,
1734
1734
  columnIndex: i,
1735
1735
  areaIdent: t,
1736
1736
  sideIdent: o,
1737
- text: C,
1738
- treeArrow: b,
1737
+ text: x,
1738
+ treeArrow: u,
1739
1739
  tableOptions: this.tableOptions,
1740
1740
  checkedType: y,
1741
1741
  sortState: v
@@ -1747,15 +1747,15 @@ class Je extends Ye {
1747
1747
  let M;
1748
1748
  f && (M = f.render(m, s, i, t, e, w, this.dom.domService));
1749
1749
  const P = e.getCustomClassesAt(s, i);
1750
- if (P.length && this.dom.addClasses(P, m), this.dom.addColumnBorderDivs(this.tableOptions, c, u, t, o), h && this.dom.addHorizontalBorder({ left: r, width: n, height: l, top: d + l }, c), this.getFocusModel && t === "body") {
1751
- const x = this.getFocusModel();
1752
- x != null && x.hasFocus(s, i) && this.dom.addFocusBorderDivs(c, u, {});
1750
+ if (P.length && this.dom.addClasses(P, m), this.dom.addColumnBorderDivs(this.tableOptions, c, b, t, o), h && this.dom.addHorizontalBorder({ left: r, width: n, height: l, top: d + l }, c), this.getFocusModel && t === "body") {
1751
+ const C = this.getFocusModel();
1752
+ C != null && C.hasFocus(s, i) && this.dom.addFocusBorderDivs(c, b, {});
1753
1753
  }
1754
1754
  t === "header" && this.dom.setAttribute(m, "data-ge-action", "drag-column");
1755
1755
  const z = e.getCustomStyleAt(s, i);
1756
1756
  if (z)
1757
- for (const x in z)
1758
- this.dom.setStyle(m, x, z[x]);
1757
+ for (const C in z)
1758
+ this.dom.setStyle(m, C, z[C]);
1759
1759
  return [m, M];
1760
1760
  }
1761
1761
  /**
@@ -1922,7 +1922,7 @@ class Je extends Ye {
1922
1922
  if (r) {
1923
1923
  const n = e.index ?? 0, l = this.draggingColumn;
1924
1924
  for (let d = 0; d < r; d++) {
1925
- const c = o, h = i.getRowHeight(d), g = { left: 0, width: e.width, height: h, top: c, index: d }, f = i.getValueAt(d, n), u = i.getCellRenderer(d, n), S = u ? "" : `${f}`, b = {
1925
+ const c = o, h = i.getRowHeight(d), g = { left: 0, width: e.width, height: h, top: c, index: d }, f = i.getValueAt(d, n), b = i.getCellRenderer(d, n), S = b ? "" : `${f}`, u = {
1926
1926
  parent: l,
1927
1927
  geo: g,
1928
1928
  rowIndex: d,
@@ -1930,13 +1930,13 @@ class Je extends Ye {
1930
1930
  areaIdent: t,
1931
1931
  sideIdent: s,
1932
1932
  text: S
1933
- }, p = this.dom.addColumnDiv(b);
1933
+ }, p = this.dom.addColumnDiv(u);
1934
1934
  let v;
1935
- u && (v = u.render(p, d, n, t, i, f, this.dom.domService), v && this.cleanupFunctions[t].push(v));
1935
+ b && (v = b.render(p, d, n, t, i, f, this.dom.domService), v && this.cleanupFunctions[t].push(v));
1936
1936
  const w = i.getCustomClassesAt(d, n);
1937
1937
  w.length && this.dom.addClasses(w, p);
1938
- const C = this.tableModel.getColumnDef(n);
1939
- C && C.classes[t] && this.dom.addClasses(C.classes[t], p), this.dom.addColumnBorderDivs(this.tableOptions, l, g, t, s);
1938
+ const x = this.tableModel.getColumnDef(n);
1939
+ x && x.classes[t] && this.dom.addClasses(x.classes[t], p), this.dom.addColumnBorderDivs(this.tableOptions, l, g, t, s);
1940
1940
  const y = i.getCustomStyleAt(d, n);
1941
1941
  if (y)
1942
1942
  for (const m in y)
@@ -1995,14 +1995,14 @@ class Je extends Ye {
1995
1995
  if (!e && t && s.isSelectable(i, r) && this.getSelectionModel) {
1996
1996
  const f = this.getSelectionModel();
1997
1997
  if (f) {
1998
- const u = f.getSelectionCount(i, r);
1999
- g = u > 0;
2000
- for (let S = 0; S < u; S++) {
2001
- const b = this.dom.applyStylePosistionAbsolute(
1998
+ const b = f.getSelectionCount(i, r);
1999
+ g = b > 0;
2000
+ for (let S = 0; S < b; S++) {
2001
+ const u = this.dom.applyStylePosistionAbsolute(
2002
2002
  // ge-table-body-west-selected-range
2003
2003
  this.dom.createDivWithClass(`ge-table-${s.areaIdent}-${o}-selected-range`, n)
2004
2004
  );
2005
- this.dom.setStyle(b, "left", `${l}px`), this.dom.setStyle(b, "top", `${d}px`), this.dom.setStyle(b, "width", `${c}px`), this.dom.setStyle(b, "height", `${h}px`);
2005
+ this.dom.setStyle(u, "left", `${l}px`), this.dom.setStyle(u, "top", `${d}px`), this.dom.setStyle(u, "width", `${c}px`), this.dom.setStyle(u, "height", `${h}px`);
2006
2006
  }
2007
2007
  }
2008
2008
  }
@@ -2041,7 +2041,7 @@ class Je extends Ye {
2041
2041
  cellSelected: h,
2042
2042
  lastRowOfModel: g
2043
2043
  }) {
2044
- const [f, u] = this.addAndRenderCellDiv({
2044
+ const [f, b] = this.addAndRenderCellDiv({
2045
2045
  areaModel: e,
2046
2046
  areaIdent: t,
2047
2047
  sideIdent: o,
@@ -2054,7 +2054,7 @@ class Je extends Ye {
2054
2054
  parent: c,
2055
2055
  lastRowOfModel: g
2056
2056
  });
2057
- h && this.dom.addClass(`ge-table-${t}-${o}-selected-range`, f), u && this.cleanupFunctions[t].push(u);
2057
+ h && this.dom.addClass(`ge-table-${t}-${o}-selected-range`, f), b && this.cleanupFunctions[t].push(b);
2058
2058
  }
2059
2059
  /**
2060
2060
  * Render the header cell resize handle.
@@ -2291,7 +2291,7 @@ class le {
2291
2291
  onFocusChanged(e) {
2292
2292
  }
2293
2293
  }
2294
- class ue {
2294
+ class be {
2295
2295
  setStyle(e, t, o) {
2296
2296
  return e.style[t] = o, e;
2297
2297
  }
@@ -2341,7 +2341,21 @@ class rt {
2341
2341
  }
2342
2342
  class lt {
2343
2343
  constructor(e = "none", t = "single") {
2344
- this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
2344
+ this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1, this.silent = !1, this.listenerArr = [];
2345
+ }
2346
+ getEventSelectionChangedListeners() {
2347
+ return this.listenerArr;
2348
+ }
2349
+ addEventSelectionChangedListener(e) {
2350
+ this.listenerArr.includes(e) || this.listenerArr.push(e);
2351
+ }
2352
+ removeEventSelectionChangedListener(e) {
2353
+ const t = this.listenerArr.indexOf(e, 0);
2354
+ t > -1 && this.listenerArr.splice(t, 1);
2355
+ }
2356
+ //@AvoidDoubleExecution(100)
2357
+ fireChangeEvent() {
2358
+ this.silent || this.listenerArr.forEach((e) => e.onSelectionChanged(this));
2345
2359
  }
2346
2360
  firstClick(e, t) {
2347
2361
  this.selectionType === "row" ? this.addRange(E.singleRow(e)) : this.selectionType === "column" && this.addRange(E.singleColumn(t));
@@ -2362,7 +2376,7 @@ class lt {
2362
2376
  return this.ranges;
2363
2377
  }
2364
2378
  clear() {
2365
- this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
2379
+ this.ranges = [], this.negativeRanges = [], this.allSelected = !1, this.fireChangeEvent();
2366
2380
  }
2367
2381
  hasSelection() {
2368
2382
  return this.allSelected || !!this.ranges.length;
@@ -2383,19 +2397,19 @@ class lt {
2383
2397
  return Array.from(e);
2384
2398
  }
2385
2399
  selectAll() {
2386
- this.allSelected = !0;
2400
+ this.allSelected = !0, this.fireChangeEvent();
2387
2401
  }
2388
2402
  isAllSelected() {
2389
2403
  return this.allSelected;
2390
2404
  }
2391
2405
  addSelection(e) {
2392
- this.addRange(e);
2406
+ this.addRange(e), this.fireChangeEvent();
2393
2407
  }
2394
2408
  removeSelection(e) {
2395
2409
  if (this.selectionType === "none")
2396
2410
  return;
2397
2411
  let t = e;
2398
- this.selectionType === "row" ? t = E.singleRow(e.r1) : this.selectionType === "column" && (t = E.singleColumn(e.c1)), this.negativeRanges.push(t);
2412
+ this.selectionType === "row" ? t = E.singleRow(e.r1) : this.selectionType === "column" && (t = E.singleColumn(e.c1)), this.negativeRanges.push(t), this.fireChangeEvent();
2399
2413
  }
2400
2414
  togglePoint(e, t) {
2401
2415
  this.getSelectionCount(e, t) > 0 ? this.removeSelection(E.singleCell(e, t)) : this.addSelection(E.singleCell(e, t));
@@ -2404,12 +2418,26 @@ class lt {
2404
2418
  return this.getSelectionCount(e, t) > 0;
2405
2419
  }
2406
2420
  addRange(e) {
2407
- 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));
2421
+ 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), this.fireChangeEvent());
2408
2422
  }
2409
2423
  }
2410
2424
  class at {
2411
2425
  constructor(e = "none") {
2412
- this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
2426
+ this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1, this.listenerArr = [];
2427
+ }
2428
+ getEventFocusChangedListeners() {
2429
+ return this.listenerArr;
2430
+ }
2431
+ addEventFocusChangedListener(e) {
2432
+ this.listenerArr.includes(e) || this.listenerArr.push(e);
2433
+ }
2434
+ removeEventFocusChangedListener(e) {
2435
+ const t = this.listenerArr.indexOf(e, 0);
2436
+ t > -1 && this.listenerArr.splice(t, 1);
2437
+ }
2438
+ //@AvoidDoubleExecution(100)
2439
+ fireChangeEvent() {
2440
+ this.listenerArr.forEach((e) => e.onFocusChanged(this));
2413
2441
  }
2414
2442
  clearChanged() {
2415
2443
  this.changed = !1;
@@ -2418,10 +2446,10 @@ class at {
2418
2446
  return this.changed;
2419
2447
  }
2420
2448
  clear() {
2421
- this.rowIndex = -1, this.columnIndex = -1;
2449
+ this.rowIndex = -1, this.columnIndex = -1, this.fireChangeEvent();
2422
2450
  }
2423
2451
  setFocus(e, t) {
2424
- (this.rowIndex !== e || this.columnIndex !== t) && (this.rowIndex = e, this.columnIndex = t, this.changed = !0);
2452
+ (this.rowIndex !== e || this.columnIndex !== t) && (this.rowIndex = e, this.columnIndex = t, this.changed = !0, this.fireChangeEvent());
2425
2453
  }
2426
2454
  hasFocus(e, t) {
2427
2455
  return this.rowIndex === e && this.columnIndex === t;
@@ -2451,7 +2479,7 @@ class Se {
2451
2479
  header: 34,
2452
2480
  body: 34,
2453
2481
  footer: 34
2454
- }, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new pe(), this.headerGroupOptions = new fe(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new be(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new rt(), this.getSelectionModel = () => nt, this.getFocusModel = () => dt;
2482
+ }, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new pe(), this.headerGroupOptions = new fe(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new ue(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new rt(), this.getSelectionModel = () => nt, this.getFocusModel = () => dt;
2455
2483
  }
2456
2484
  }
2457
2485
  const F = class F {
@@ -2541,17 +2569,16 @@ F.columnSeparatorChar = " ", F.rowSeparatorChar = `
2541
2569
  let H = F;
2542
2570
  class oe extends Je {
2543
2571
  constructor(e, t, o, s, i, r = new H()) {
2544
- var n;
2545
- if (super(
2546
- e,
2547
- t,
2548
- new We(o),
2549
- s
2550
- ), this.eventListener = i, this.copyService = r, this.licenseManager = k.getInstance(), this.selectionService = new tt(this), this.api = new ze(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 le()), (n = this.tableOptions) != null && n.autoRestoreOptions) {
2551
- const l = this.tableOptions.autoRestoreOptions, d = l.getStorageKeyFn;
2552
- d && (l.autoRestoreScrollPosition && (this.storeScrollPosStateService = new Ne(d)), l.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new Xe(d)), l.autoRestoreSortingState && (this.storeSortingService = new Ke(d)));
2572
+ var d;
2573
+ if (super(e, t, new We(o), s), this.eventListener = i, this.copyService = r, this.licenseManager = k.getInstance(), this.selectionService = new tt(this), this.api = new ze(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 le()), (d = this.tableOptions) != null && d.autoRestoreOptions) {
2574
+ const c = this.tableOptions.autoRestoreOptions, h = c.getStorageKeyFn;
2575
+ h && (c.autoRestoreScrollPosition && (this.storeScrollPosStateService = new Ne(h)), c.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new Xe(h)), c.autoRestoreSortingState && (this.storeSortingService = new Ke(h)));
2553
2576
  }
2554
2577
  this.mouseHandler = new Ve(this), this.inputHandler = new Ze(this), this.shortcutService = new it(this), this.shortcutService.addListener(this.selectionService);
2578
+ const n = this.getSelectionModel ? this.getSelectionModel() : void 0;
2579
+ n && n.addEventSelectionChangedListener(this);
2580
+ const l = this.getFocusModel ? this.getFocusModel() : void 0;
2581
+ l && l.addEventFocusChangedListener(this);
2555
2582
  }
2556
2583
  /**
2557
2584
  * Creates a TableScope instance.
@@ -2565,15 +2592,8 @@ class oe extends Je {
2565
2592
  *
2566
2593
  * @return {TableScope} - The newly created TableScope instance.
2567
2594
  */
2568
- static create(e, t, o = new Se(), s = new le(), i = new ue(), r = new H()) {
2569
- return new oe(
2570
- e,
2571
- t,
2572
- i,
2573
- o,
2574
- s,
2575
- r
2576
- );
2595
+ static create(e, t, o = new Se(), s = new le(), i = new be(), r = new H()) {
2596
+ return new oe(e, t, i, o, s, r);
2577
2597
  }
2578
2598
  /**
2579
2599
  * Triggers an action based on the provided actionId.
@@ -3223,9 +3243,9 @@ function ct(a) {
3223
3243
  m(t, o) {
3224
3244
  Ee(t, e, o), a[4](e);
3225
3245
  },
3226
- p: $,
3227
- i: $,
3228
- o: $,
3246
+ p: L,
3247
+ i: L,
3248
+ o: L,
3229
3249
  d(t) {
3230
3250
  t && he(e), a[4](null);
3231
3251
  }
@@ -3263,7 +3283,7 @@ function ht(a, e, t) {
3263
3283
  onMouseMoved: (h) => {
3264
3284
  n("mouseMoved", h);
3265
3285
  }
3266
- }, c = new oe(r, o, new ue(), s, d);
3286
+ }, c = new oe(r, o, new be(), s, d);
3267
3287
  c.firstInit(), n("tableReady", c.getApi()), i && k.getInstance().setLicenseKey(i);
3268
3288
  });
3269
3289
  function l(d) {
@@ -3275,16 +3295,16 @@ function ht(a, e, t) {
3275
3295
  "tableModel" in d && t(1, o = d.tableModel), "tableOptions" in d && t(2, s = d.tableOptions), "licenseKey" in d && t(3, i = d.licenseKey);
3276
3296
  }, [r, o, s, i, l];
3277
3297
  }
3278
- class bt extends Pe {
3298
+ class ut extends Pe {
3279
3299
  constructor(e) {
3280
- super(), Be(this, e, ht, ct, xe, {
3300
+ super(), Be(this, e, ht, ct, Ce, {
3281
3301
  tableModel: 1,
3282
3302
  tableOptions: 2,
3283
3303
  licenseKey: 3
3284
3304
  });
3285
3305
  }
3286
3306
  }
3287
- class ut {
3307
+ class bt {
3288
3308
  constructor(e) {
3289
3309
  this.Component = e;
3290
3310
  }
@@ -3306,6 +3326,6 @@ class ut {
3306
3326
  }
3307
3327
  }
3308
3328
  export {
3309
- ut as ComponentRendererWrapper,
3310
- bt as GuiexpertTable
3329
+ bt as ComponentRendererWrapper,
3330
+ ut as GuiexpertTable
3311
3331
  };