@guiexpert/svelte-table 4.1.78 → 4.1.79
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.cjs +9 -6
- package/index.js +181 -153
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -19,10 +19,10 @@ function pe(n) {
|
|
|
19
19
|
function Ae(n, e) {
|
|
20
20
|
return n != n ? e == e : n !== e || n && typeof n == "object" || typeof n == "function";
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Re(n) {
|
|
23
23
|
return Object.keys(n).length === 0;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Ee(n, e, t) {
|
|
26
26
|
n.insertBefore(e, t || null);
|
|
27
27
|
}
|
|
28
28
|
function ge(n) {
|
|
@@ -37,63 +37,63 @@ function Te(n, e, t) {
|
|
|
37
37
|
function De(n) {
|
|
38
38
|
return Array.from(n.childNodes);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function V(n, e, t, s) {
|
|
41
41
|
t == null ? n.style.removeProperty(e) : n.style.setProperty(e, t, "");
|
|
42
42
|
}
|
|
43
43
|
let Z;
|
|
44
|
-
function
|
|
44
|
+
function _(n) {
|
|
45
45
|
Z = n;
|
|
46
46
|
}
|
|
47
|
-
const
|
|
47
|
+
const L = [], K = [];
|
|
48
48
|
let P = [];
|
|
49
|
-
const ae = [],
|
|
49
|
+
const ae = [], Fe = /* @__PURE__ */ Promise.resolve();
|
|
50
50
|
let Y = !1;
|
|
51
|
-
function
|
|
52
|
-
Y || (Y = !0,
|
|
51
|
+
function Ie() {
|
|
52
|
+
Y || (Y = !0, Fe.then(fe));
|
|
53
53
|
}
|
|
54
54
|
function J(n) {
|
|
55
55
|
P.push(n);
|
|
56
56
|
}
|
|
57
57
|
const X = /* @__PURE__ */ new Set();
|
|
58
|
-
let
|
|
58
|
+
let k = 0;
|
|
59
59
|
function fe() {
|
|
60
|
-
if (
|
|
60
|
+
if (k !== 0)
|
|
61
61
|
return;
|
|
62
62
|
const n = Z;
|
|
63
63
|
do {
|
|
64
64
|
try {
|
|
65
|
-
for (;
|
|
66
|
-
const e =
|
|
67
|
-
|
|
65
|
+
for (; k < L.length; ) {
|
|
66
|
+
const e = L[k];
|
|
67
|
+
k++, _(e), ke(e.$$);
|
|
68
68
|
}
|
|
69
69
|
} catch (e) {
|
|
70
|
-
throw
|
|
70
|
+
throw L.length = 0, k = 0, e;
|
|
71
71
|
}
|
|
72
|
-
for (
|
|
72
|
+
for (_(null), L.length = 0, k = 0; K.length; ) K.pop()();
|
|
73
73
|
for (let e = 0; e < P.length; e += 1) {
|
|
74
74
|
const t = P[e];
|
|
75
75
|
X.has(t) || (X.add(t), t());
|
|
76
76
|
}
|
|
77
77
|
P.length = 0;
|
|
78
|
-
} while (
|
|
78
|
+
} while (L.length);
|
|
79
79
|
for (; ae.length; )
|
|
80
80
|
ae.pop()();
|
|
81
|
-
Y = !1, X.clear(),
|
|
81
|
+
Y = !1, X.clear(), _(n);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function ke(n) {
|
|
84
84
|
if (n.fragment !== null) {
|
|
85
85
|
n.update(), z(n.before_update);
|
|
86
86
|
const e = n.dirty;
|
|
87
87
|
n.dirty = [-1], n.fragment && n.fragment.p(n.ctx, e), n.after_update.forEach(J);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function Le(n) {
|
|
91
91
|
const e = [], t = [];
|
|
92
92
|
P.forEach((s) => n.indexOf(s) === -1 ? e.push(s) : t.push(s)), t.forEach((s) => s()), P = e;
|
|
93
93
|
}
|
|
94
|
-
const
|
|
94
|
+
const Oe = /* @__PURE__ */ new Set();
|
|
95
95
|
function Be(n, e) {
|
|
96
|
-
n && n.i && (
|
|
96
|
+
n && n.i && (Oe.delete(n), n.i(e));
|
|
97
97
|
}
|
|
98
98
|
function Pe(n, e, t) {
|
|
99
99
|
const { fragment: s, after_update: o } = n.$$;
|
|
@@ -102,16 +102,16 @@ function Pe(n, e, t) {
|
|
|
102
102
|
n.$$.on_destroy ? n.$$.on_destroy.push(...i) : z(i), n.$$.on_mount = [];
|
|
103
103
|
}), o.forEach(J);
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function Ve(n, e) {
|
|
106
106
|
const t = n.$$;
|
|
107
|
-
t.fragment !== null && (
|
|
107
|
+
t.fragment !== null && (Le(t.after_update), z(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
n.$$.dirty[0] === -1 && (
|
|
109
|
+
function _e(n, e) {
|
|
110
|
+
n.$$.dirty[0] === -1 && (L.push(n), Ie(), n.$$.dirty.fill(0)), n.$$.dirty[e / 31 | 0] |= 1 << e % 31;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function $e(n, e, t, s, o, i, r = null, a = [-1]) {
|
|
113
113
|
const l = Z;
|
|
114
|
-
|
|
114
|
+
_(n);
|
|
115
115
|
const c = n.$$ = {
|
|
116
116
|
fragment: null,
|
|
117
117
|
ctx: [],
|
|
@@ -135,9 +135,9 @@ function We(n, e, t, s, o, i, r = null, a = [-1]) {
|
|
|
135
135
|
};
|
|
136
136
|
r && r(c.root);
|
|
137
137
|
let h = !1;
|
|
138
|
-
if (c.ctx = t ? t(n, e.props || {}, (d, p, ...
|
|
139
|
-
const g =
|
|
140
|
-
return c.ctx && o(c.ctx[d], c.ctx[d] = g) && (!c.skip_bound && c.bound[d] && c.bound[d](g), h &&
|
|
138
|
+
if (c.ctx = t ? t(n, e.props || {}, (d, p, ...m) => {
|
|
139
|
+
const g = m.length ? m[0] : p;
|
|
140
|
+
return c.ctx && o(c.ctx[d], c.ctx[d] = g) && (!c.skip_bound && c.bound[d] && c.bound[d](g), h && _e(n, d)), p;
|
|
141
141
|
}) : [], c.update(), h = !0, z(c.before_update), c.fragment = s ? s(c.ctx) : !1, e.target) {
|
|
142
142
|
if (e.hydrate) {
|
|
143
143
|
const d = De(e.target);
|
|
@@ -146,9 +146,9 @@ function We(n, e, t, s, o, i, r = null, a = [-1]) {
|
|
|
146
146
|
c.fragment && c.fragment.c();
|
|
147
147
|
e.intro && Be(n.$$.fragment), Pe(n, e.target, e.anchor), fe();
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
_(l);
|
|
150
150
|
}
|
|
151
|
-
class
|
|
151
|
+
class We {
|
|
152
152
|
constructor() {
|
|
153
153
|
/**
|
|
154
154
|
* ### PRIVATE API
|
|
@@ -169,7 +169,7 @@ class He {
|
|
|
169
169
|
}
|
|
170
170
|
/** @returns {void} */
|
|
171
171
|
$destroy() {
|
|
172
|
-
|
|
172
|
+
Ve(this, 1), this.$destroy = B;
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
175
|
* @template {Extract<keyof Events, string>} K
|
|
@@ -191,11 +191,11 @@ class He {
|
|
|
191
191
|
* @returns {void}
|
|
192
192
|
*/
|
|
193
193
|
$set(e) {
|
|
194
|
-
this.$$set && !
|
|
194
|
+
this.$$set && !Re(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
const
|
|
198
|
-
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(
|
|
197
|
+
const He = "4";
|
|
198
|
+
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(He);
|
|
199
199
|
function Ne(n, e = 500) {
|
|
200
200
|
let t = null;
|
|
201
201
|
return function(...s) {
|
|
@@ -204,14 +204,14 @@ function Ne(n, e = 500) {
|
|
|
204
204
|
}, e);
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
|
-
class
|
|
207
|
+
class I {
|
|
208
208
|
// The constructor is private to prevent direct construction calls
|
|
209
209
|
// with the `new` operator
|
|
210
210
|
constructor() {
|
|
211
211
|
this.alreadySet = !1;
|
|
212
212
|
}
|
|
213
213
|
static getInstance() {
|
|
214
|
-
return
|
|
214
|
+
return I.instance || (I.instance = new I()), I.instance;
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
217
217
|
* Method to set the license key for the application.
|
|
@@ -229,7 +229,7 @@ class F {
|
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function W(n) {
|
|
233
233
|
return n && n.type === "TreeRow";
|
|
234
234
|
}
|
|
235
235
|
function q(n) {
|
|
@@ -372,12 +372,12 @@ class Ge {
|
|
|
372
372
|
return this.domService.appendChild(e.child, l), l;
|
|
373
373
|
}
|
|
374
374
|
addColumnDiv(e) {
|
|
375
|
-
const { parent: t, geo: s, rowIndex: o = -1, columnIndex: i = -1, areaIdent: r, sideIdent: a, text: l = "", treeArrow: c, tableOptions: h, checkedType: d = void 0, sortState: p } = e,
|
|
375
|
+
const { parent: t, geo: s, rowIndex: o = -1, columnIndex: i = -1, areaIdent: r, sideIdent: a, text: l = "", treeArrow: c, tableOptions: h, checkedType: d = void 0, sortState: p } = e, m = h == null ? void 0 : h.treeOptions, g = h == null ? void 0 : h.showCheckboxWihoutExtraColumn, b = this.domService.createElement("div");
|
|
376
376
|
this.domService.addClass(b, "ge-table-col-div"), g && this.domService.addClass(b, "ge-with-checkbox"), this.domService.addClass(b, `ge-table-col-div-${s.index}`), this.domService.setAttribute(b, "data-col-index", `${s.index}`), this.domService.setAttribute(b, "data-row-index", `${o}`), this.domService.setAttribute(b, "data-area", `${r}`);
|
|
377
377
|
const f = ((s == null ? void 0 : s.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
378
|
-
if (r === "body" && a === "center" && this.domService.addClass(b, `ge-table-column-${f}`), this.domService.setStyle(b, "display", "clip"), this.domService.setStyle(b, "position", "absolute"), this.domService.setStyle(b, "left", `${s.left}px`), this.domService.setStyle(b, "top", `${s.top}px`), this.domService.setStyle(b, "width", `${s.width}px`), this.domService.setStyle(b, "height", `${s.height}px`), c && c !== "none" && (this.domService.addClass(b, "ge-table-col-tree"), this.addArrowDiv(b, c,
|
|
379
|
-
const
|
|
380
|
-
this.addLabelDiv(b, l,
|
|
378
|
+
if (r === "body" && a === "center" && this.domService.addClass(b, `ge-table-column-${f}`), this.domService.setStyle(b, "display", "clip"), this.domService.setStyle(b, "position", "absolute"), this.domService.setStyle(b, "left", `${s.left}px`), this.domService.setStyle(b, "top", `${s.top}px`), this.domService.setStyle(b, "width", `${s.width}px`), this.domService.setStyle(b, "height", `${s.height}px`), c && c !== "none" && (this.domService.addClass(b, "ge-table-col-tree"), this.addArrowDiv(b, c, m, o, i, r)), g && i === 0 && d && this.addCheckboxToDiv(b, d, r, o), l) {
|
|
379
|
+
const u = c !== "none" && i === 0;
|
|
380
|
+
this.addLabelDiv(b, l, u, o, i, r);
|
|
381
381
|
}
|
|
382
382
|
return p && this.addSortedIcon(b, p, h == null ? void 0 : h.sortedOptions, i), this.domService.appendChild(t, b), b;
|
|
383
383
|
}
|
|
@@ -520,7 +520,7 @@ class Ue {
|
|
|
520
520
|
this.tableScope.toggleHeaderGroup(s), e.preventDefault(), e.stopPropagation();
|
|
521
521
|
else if (s.inputType === "checkbox" && s.areaIdent)
|
|
522
522
|
this.tableScope.toggleRowCheckbox(s.rowIdx, s.colIdx, s.areaIdent), e.preventDefault(), e.stopPropagation();
|
|
523
|
-
else if (
|
|
523
|
+
else if (W(s.row) && s.areaModel) {
|
|
524
524
|
const o = s.colIdx === this.getArrowColumnIndex() && e.altKey, i = s.className.includes("ge-table-tree-arrow-div");
|
|
525
525
|
if (o || i) {
|
|
526
526
|
e.preventDefault(), e.stopPropagation();
|
|
@@ -547,7 +547,7 @@ class Ue {
|
|
|
547
547
|
this.tableScope.tableModel.isSortable(r) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, i, r));
|
|
548
548
|
else if (t.getAttribute("data-row-index")) {
|
|
549
549
|
const l = a.getRowByIndex(i);
|
|
550
|
-
if (s && o === "body" && a.isEditable(i, r) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(i, r)),
|
|
550
|
+
if (s && o === "body" && a.isEditable(i, r) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(i, r)), W(l) && r === this.getArrowColumnIndex()) {
|
|
551
551
|
e.preventDefault(), e.stopPropagation();
|
|
552
552
|
const c = l;
|
|
553
553
|
c.expanded = !c.expanded, "recalcVisibleTreeRows" in a && a.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(c);
|
|
@@ -731,7 +731,7 @@ class Xe {
|
|
|
731
731
|
return s * ("" + e).localeCompare("" + t);
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
|
-
class
|
|
734
|
+
class F extends je {
|
|
735
735
|
constructor(e, t, s, o = [], i = "ge-selected-row", r = "ge-focused-row") {
|
|
736
736
|
super(e, o, s), this.areaIdent = e, this.rows = t, this.defaultRowHeight = s, this.columnDefs = o, this.selectedRowClass = i, this.focusedRowClass = r, this.sorterService = new Xe(), this._focusedRowIndex = 0, this.filteredRows = [...t], this.properties = o.map((a) => a.property);
|
|
737
737
|
}
|
|
@@ -757,7 +757,7 @@ class k extends je {
|
|
|
757
757
|
getValueAt(e, t) {
|
|
758
758
|
const s = this.properties[t];
|
|
759
759
|
let o = this.filteredRows[e];
|
|
760
|
-
return
|
|
760
|
+
return W(o) && (o = o.data), o ? this.getValueByT(o, s) : "";
|
|
761
761
|
}
|
|
762
762
|
/**
|
|
763
763
|
* Retrieves the filtered and sorted rows from the dataset.
|
|
@@ -1117,7 +1117,7 @@ class Ke {
|
|
|
1117
1117
|
*/
|
|
1118
1118
|
setRows(e) {
|
|
1119
1119
|
const t = this.getBodyModel();
|
|
1120
|
-
t instanceof
|
|
1120
|
+
t instanceof F ? t.setRows(e) : console.warn("setRows<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ", typeof t, t);
|
|
1121
1121
|
}
|
|
1122
1122
|
/**
|
|
1123
1123
|
* Adds new rows to the end of the table body.
|
|
@@ -1135,7 +1135,7 @@ class Ke {
|
|
|
1135
1135
|
*/
|
|
1136
1136
|
addRows(e) {
|
|
1137
1137
|
const t = this.getBodyModel();
|
|
1138
|
-
if (t instanceof
|
|
1138
|
+
if (t instanceof F) {
|
|
1139
1139
|
const s = t;
|
|
1140
1140
|
let o = s.getAllRows();
|
|
1141
1141
|
s.setRows([...o, ...e]);
|
|
@@ -1160,7 +1160,7 @@ class Ke {
|
|
|
1160
1160
|
*/
|
|
1161
1161
|
addRowsAt(e, t) {
|
|
1162
1162
|
const s = this.getBodyModel();
|
|
1163
|
-
if (s instanceof
|
|
1163
|
+
if (s instanceof F) {
|
|
1164
1164
|
const o = s;
|
|
1165
1165
|
let i = o.getAllRows();
|
|
1166
1166
|
o.setRows([...i.slice(0, t), ...e, ...i.slice(t)]);
|
|
@@ -1186,7 +1186,7 @@ class Ke {
|
|
|
1186
1186
|
*/
|
|
1187
1187
|
removeRows(e, t = (s, o) => s === o) {
|
|
1188
1188
|
const s = this.getBodyModel();
|
|
1189
|
-
if (s instanceof
|
|
1189
|
+
if (s instanceof F) {
|
|
1190
1190
|
const o = s, i = o.getAllRows().filter((r) => !e.some((a) => t(r, a)));
|
|
1191
1191
|
o.setRows(i);
|
|
1192
1192
|
} else
|
|
@@ -1227,7 +1227,7 @@ class Ke {
|
|
|
1227
1227
|
*/
|
|
1228
1228
|
findRows(e, t = (s, o) => s === o) {
|
|
1229
1229
|
const s = this.getBodyModel();
|
|
1230
|
-
return s instanceof
|
|
1230
|
+
return s instanceof F ? s.getAllRows().filter((i) => e.some((r) => t(i, r))) : (console.warn("findRows<T>(rows: T[], predicate: (a: T, b: T) => boolean) only works with AreaModelObjectArray<T>, but this body area model is ", typeof s, s), []);
|
|
1231
1231
|
}
|
|
1232
1232
|
/**
|
|
1233
1233
|
* Searches through the filtered rows of the table to find a row that matches specific criteria.
|
|
@@ -1284,7 +1284,7 @@ class Ke {
|
|
|
1284
1284
|
*/
|
|
1285
1285
|
findRowFromFilteredRowsByAllCriteria(e, t) {
|
|
1286
1286
|
const s = this.getBodyModel();
|
|
1287
|
-
if (s instanceof
|
|
1287
|
+
if (s instanceof F)
|
|
1288
1288
|
return s.getFilteredRows().find((i) => t(e, i));
|
|
1289
1289
|
console.warn("findRowFromFilteredRowsByAllCriteria(...) only works with AreaModelObjectArray<T>, but this body area model is ", typeof s, s);
|
|
1290
1290
|
}
|
|
@@ -1331,7 +1331,7 @@ class Ke {
|
|
|
1331
1331
|
*/
|
|
1332
1332
|
findRowFromAllRowsByAllCriteria(e, t) {
|
|
1333
1333
|
const s = this.getBodyModel();
|
|
1334
|
-
if (s instanceof
|
|
1334
|
+
if (s instanceof F)
|
|
1335
1335
|
return s.getAllRows().find((i) => t(e, i));
|
|
1336
1336
|
console.warn("findRowFromAllRowsByAllCriteria(...) only works with AreaModelObjectArray<T>, but this body area model is ", typeof s, s);
|
|
1337
1337
|
}
|
|
@@ -1356,7 +1356,7 @@ class Ke {
|
|
|
1356
1356
|
*/
|
|
1357
1357
|
updateRows(e, t = (s, o) => s === o) {
|
|
1358
1358
|
const s = this.getBodyModel();
|
|
1359
|
-
if (s instanceof
|
|
1359
|
+
if (s instanceof F) {
|
|
1360
1360
|
let i = s.getAllRows();
|
|
1361
1361
|
for (const r of i)
|
|
1362
1362
|
for (const a of e)
|
|
@@ -1525,6 +1525,21 @@ class Ke {
|
|
|
1525
1525
|
getFirstVisibleRowIndex() {
|
|
1526
1526
|
return this.tableScope.getFirstVisibleRowIndex();
|
|
1527
1527
|
}
|
|
1528
|
+
getFirstFullVisibleRowIndex() {
|
|
1529
|
+
return this.tableScope.getFirstFullVisibleRowIndex();
|
|
1530
|
+
}
|
|
1531
|
+
getLastVisibleRowIndex() {
|
|
1532
|
+
return this.tableScope.getLastVisibleRowIndex();
|
|
1533
|
+
}
|
|
1534
|
+
getLastFullVisibleRowIndex() {
|
|
1535
|
+
return this.tableScope.getLastFullVisibleRowIndex();
|
|
1536
|
+
}
|
|
1537
|
+
setLoggingActive(e) {
|
|
1538
|
+
this.tableScope.loggingActive = e;
|
|
1539
|
+
}
|
|
1540
|
+
isLoggingActive() {
|
|
1541
|
+
return this.tableScope.loggingActive;
|
|
1542
|
+
}
|
|
1528
1543
|
}
|
|
1529
1544
|
class te {
|
|
1530
1545
|
constructor(e) {
|
|
@@ -1927,11 +1942,11 @@ class tt {
|
|
|
1927
1942
|
class st extends Qe {
|
|
1928
1943
|
constructor(e, t, s, o) {
|
|
1929
1944
|
var r, a;
|
|
1930
|
-
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 = {
|
|
1945
|
+
super(e, t, s, o), this.firstVisibleRowIndex = -1, this.lastVisibleRowIndex = -1, this.firstFullVisibleRowIndex = -1, this.lastFullVisibleRowIndex = -1, this.displayedRowCount = 0, this.pixelLimitForFullVisible = 5, this.loggingActive = !1, this.dragging = !1, this.editing = !1, this.storedColumnWidths = [], this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
1931
1946
|
header: [],
|
|
1932
1947
|
body: [],
|
|
1933
1948
|
footer: []
|
|
1934
|
-
}, this.tree = !1, this.colAndRowspanModels = new tt(), this.
|
|
1949
|
+
}, this.tree = !1, this.colAndRowspanModels = new tt(), this.draggingTargetColumnIndex = -1, this.removables = [], this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (r = this.tableOptions) != null && r.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (a = this.tableOptions) != null && a.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), q(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
1935
1950
|
(l) => {
|
|
1936
1951
|
var c;
|
|
1937
1952
|
this.colAndRowspanModels[l] = new et(t, t.getAreaModel(l)), (c = this.colAndRowspanModels[l]) == null || c.init();
|
|
@@ -2084,12 +2099,27 @@ class st extends Qe {
|
|
|
2084
2099
|
}
|
|
2085
2100
|
const p = r.getCustomClassesAt(t, s);
|
|
2086
2101
|
p.length && this.dom.addClasses(p, l);
|
|
2087
|
-
const
|
|
2088
|
-
if (
|
|
2089
|
-
for (const g in
|
|
2090
|
-
this.dom.setStyle(l, g,
|
|
2102
|
+
const m = r.getCustomStyleAt(t, s);
|
|
2103
|
+
if (m)
|
|
2104
|
+
for (const g in m)
|
|
2105
|
+
this.dom.setStyle(l, g, m[g]);
|
|
2091
2106
|
}
|
|
2092
2107
|
}
|
|
2108
|
+
getFirstVisibleRowIndex() {
|
|
2109
|
+
return this.firstVisibleRowIndex;
|
|
2110
|
+
}
|
|
2111
|
+
getLastVisibleRowIndex() {
|
|
2112
|
+
return this.lastVisibleRowIndex;
|
|
2113
|
+
}
|
|
2114
|
+
getFirstFullVisibleRowIndex() {
|
|
2115
|
+
return this.firstFullVisibleRowIndex;
|
|
2116
|
+
}
|
|
2117
|
+
getLastFullVisibleRowIndex() {
|
|
2118
|
+
return this.lastFullVisibleRowIndex;
|
|
2119
|
+
}
|
|
2120
|
+
getDisplayedRowCount() {
|
|
2121
|
+
return this.displayedRowCount;
|
|
2122
|
+
}
|
|
2093
2123
|
/**
|
|
2094
2124
|
* Stores the widths of all columns in the table.
|
|
2095
2125
|
*
|
|
@@ -2190,16 +2220,17 @@ class st extends Qe {
|
|
|
2190
2220
|
s.child.innerText = "", o.child.innerText = "", i.child.innerText = "";
|
|
2191
2221
|
const a = 0, l = this.areaBodyCenterGeo.width, c = this.tableModel.getPadding(), h = this.tableModel.getAreaModel(e), d = h.getRowCount();
|
|
2192
2222
|
for (; this.cleanupFunctions[e].length; ) {
|
|
2193
|
-
const
|
|
2194
|
-
|
|
2223
|
+
const u = this.cleanupFunctions[e].shift();
|
|
2224
|
+
u && u();
|
|
2195
2225
|
}
|
|
2196
2226
|
let p = t;
|
|
2197
|
-
const
|
|
2198
|
-
|
|
2199
|
-
|
|
2227
|
+
const m = this.tableModel.getColumnCount(), g = this.tableModel.getFixedRightColumnCount(), b = this.tableModel.getFixedLeftColumnCount();
|
|
2228
|
+
e === "body" && (this.firstVisibleRowIndex = -1, this.firstFullVisibleRowIndex = -1, this.lastVisibleRowIndex = -1, this.lastFullVisibleRowIndex = -1);
|
|
2229
|
+
for (let u = 0; u < d; u++) {
|
|
2230
|
+
const w = p, x = u === d - 1, v = this.tableModel.getRowHeight(e, u);
|
|
2200
2231
|
if (w + v > 0) {
|
|
2201
|
-
this.firstVisibleRowIndex =
|
|
2202
|
-
let y = { left: a, width: l, height: v, top: w, index:
|
|
2232
|
+
e === "body" && this.firstVisibleRowIndex === -1 && (this.firstVisibleRowIndex = u, this.firstFullVisibleRowIndex = w < -this.pixelLimitForFullVisible ? this.firstVisibleRowIndex + 1 : this.firstVisibleRowIndex);
|
|
2233
|
+
let y = { left: a, width: l, height: v, top: w, index: u }, S = this.dom.addRowDiv(o, y, u, e, "center");
|
|
2203
2234
|
const M = b;
|
|
2204
2235
|
if (this.adjustColumnsToRowParent({
|
|
2205
2236
|
areaIdent: e,
|
|
@@ -2207,61 +2238,64 @@ class st extends Qe {
|
|
|
2207
2238
|
areaModel: h,
|
|
2208
2239
|
geo: y,
|
|
2209
2240
|
parent: S,
|
|
2210
|
-
rowIndex:
|
|
2241
|
+
rowIndex: u,
|
|
2211
2242
|
columnIndexStart: M,
|
|
2212
|
-
columnIndexEnd:
|
|
2243
|
+
columnIndexEnd: m - g - 1,
|
|
2213
2244
|
verticalFixed: !1,
|
|
2214
2245
|
lastRowOfModel: x
|
|
2215
|
-
}), c.left > 0 && (y = { left: a, width: this.areaBodyWestGeo.width, height: v, top: w, index:
|
|
2246
|
+
}), c.left > 0 && (y = { left: a, width: this.areaBodyWestGeo.width, height: v, top: w, index: u }, S = this.dom.addRowDiv(s, y, u, e, "west"), this.adjustColumnsToRowParent({
|
|
2216
2247
|
areaIdent: e,
|
|
2217
2248
|
sideIdent: "west",
|
|
2218
2249
|
areaModel: h,
|
|
2219
2250
|
geo: y,
|
|
2220
2251
|
parent: S,
|
|
2221
|
-
rowIndex:
|
|
2252
|
+
rowIndex: u,
|
|
2222
2253
|
columnIndexStart: 0,
|
|
2223
2254
|
columnIndexEnd: M - 1,
|
|
2224
2255
|
verticalFixed: !0,
|
|
2225
2256
|
lastRowOfModel: x
|
|
2226
|
-
})), c.right > 0 && (y = { left: a, width: this.areaBodyEastGeo.width, height: v, top: w, index:
|
|
2257
|
+
})), c.right > 0 && (y = { left: a, width: this.areaBodyEastGeo.width, height: v, top: w, index: u }, S = this.dom.addRowDiv(i, y, u, e, "east"), this.adjustColumnsToRowParent({
|
|
2227
2258
|
areaIdent: e,
|
|
2228
2259
|
sideIdent: "east",
|
|
2229
2260
|
areaModel: h,
|
|
2230
2261
|
geo: y,
|
|
2231
2262
|
parent: S,
|
|
2232
|
-
rowIndex:
|
|
2233
|
-
columnIndexStart:
|
|
2234
|
-
columnIndexEnd:
|
|
2263
|
+
rowIndex: u,
|
|
2264
|
+
columnIndexStart: m - g,
|
|
2265
|
+
columnIndexEnd: m - 1,
|
|
2235
2266
|
verticalFixed: !0,
|
|
2236
2267
|
lastRowOfModel: x
|
|
2237
|
-
})), e === "header" && this.tree &&
|
|
2238
|
-
const
|
|
2268
|
+
})), e === "header" && this.tree && u === d - 1) {
|
|
2269
|
+
const R = this.dom.applyStyle(
|
|
2239
2270
|
this.dom.setAttribute(
|
|
2240
2271
|
this.dom.addDiv(S, new T(16, 20, 20, 8)),
|
|
2241
2272
|
"data-ge-action",
|
|
2242
2273
|
"toggleExpandCollapseAll"
|
|
2243
2274
|
),
|
|
2244
2275
|
{ cursor: "pointer" }
|
|
2245
|
-
),
|
|
2246
|
-
if (
|
|
2247
|
-
const
|
|
2248
|
-
this.dom.domService.appendChild(
|
|
2276
|
+
), E = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
2277
|
+
if (E) {
|
|
2278
|
+
const $ = this.dom.domService.createText(E.content);
|
|
2279
|
+
this.dom.domService.appendChild(R, $), E.style && this.dom.applyStyleString(R, E.style);
|
|
2249
2280
|
}
|
|
2250
2281
|
}
|
|
2251
2282
|
}
|
|
2252
2283
|
if (p = p + v, p > r) {
|
|
2253
|
-
e === "body" && (this.displayedRowCount = this.
|
|
2284
|
+
e === "body" && (this.lastVisibleRowIndex = u, this.lastFullVisibleRowIndex = r - p < -this.pixelLimitForFullVisible ? u - 1 : u, this.displayedRowCount = this.lastFullVisibleRowIndex - this.firstFullVisibleRowIndex + 1);
|
|
2254
2285
|
break;
|
|
2255
2286
|
}
|
|
2256
2287
|
}
|
|
2257
|
-
if (this.
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2288
|
+
if (this.loggingActive && e === "body" && console.log("render scope: this.firstVisibleRowIndex <- " + this.firstVisibleRowIndex + `
|
|
2289
|
+
render scope: this.firstFullVisibleRowIndex <- ` + this.firstFullVisibleRowIndex + `
|
|
2290
|
+
render scope: this.lastVisibleRowIndex <- ` + this.lastVisibleRowIndex + `
|
|
2291
|
+
render scope: this.lastFullVisibleRowIndex <- ` + this.lastFullVisibleRowIndex), this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
2292
|
+
const u = ((f = this.colAndRowspanModels[e]) == null ? void 0 : f.getRanges()) ?? [];
|
|
2293
|
+
if (u.length)
|
|
2294
|
+
for (const w of u) {
|
|
2261
2295
|
let x = 0, v = o.child, y = "center";
|
|
2262
2296
|
if (w.c1 < b)
|
|
2263
2297
|
v = s.child, y = "west";
|
|
2264
|
-
else if (g > 0 && w.c1 >=
|
|
2298
|
+
else if (g > 0 && w.c1 >= m - g)
|
|
2265
2299
|
v = i.child, y = "east";
|
|
2266
2300
|
else {
|
|
2267
2301
|
const S = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
@@ -2282,10 +2316,10 @@ class st extends Qe {
|
|
|
2282
2316
|
* @protected
|
|
2283
2317
|
*/
|
|
2284
2318
|
drawBigCell(e, t, s, o, i, r) {
|
|
2285
|
-
const a = s + this.getRowHeights(0, e.r1 - 1, o).reduce((f,
|
|
2319
|
+
const a = s + this.getRowHeights(0, e.r1 - 1, o).reduce((f, u) => f + u, 0), l = this.tableModel.getColumnCount(), c = this.tableModel.getFixedRightColumnCount();
|
|
2286
2320
|
let h = 0;
|
|
2287
2321
|
c > 0 && e.c1 >= l - c && (h = l - c);
|
|
2288
|
-
const d = t + this.getColumnWidths(h, e.c1 - 1).reduce((f,
|
|
2322
|
+
const d = t + this.getColumnWidths(h, e.c1 - 1).reduce((f, u) => f + u, 0), p = this.getRowHeights(e.r1, e.r2, o).reduce((f, u) => f + u, 0), m = this.getColumnWidths(e.c1, e.c2).reduce((f, u) => f + u, 0);
|
|
2289
2323
|
let g = !1;
|
|
2290
2324
|
const b = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
2291
2325
|
b && (g = b.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? this.renderCell({
|
|
@@ -2296,7 +2330,7 @@ class st extends Qe {
|
|
|
2296
2330
|
columnIndex: e.c1,
|
|
2297
2331
|
left: d,
|
|
2298
2332
|
top: a,
|
|
2299
|
-
width:
|
|
2333
|
+
width: m,
|
|
2300
2334
|
height: p,
|
|
2301
2335
|
parent: i,
|
|
2302
2336
|
cellSelected: g,
|
|
@@ -2310,7 +2344,7 @@ class st extends Qe {
|
|
|
2310
2344
|
columnIndex: e.c1,
|
|
2311
2345
|
left: d,
|
|
2312
2346
|
top: a,
|
|
2313
|
-
width:
|
|
2347
|
+
width: m,
|
|
2314
2348
|
height: p,
|
|
2315
2349
|
parent: i,
|
|
2316
2350
|
cellSelected: g,
|
|
@@ -2321,7 +2355,7 @@ class st extends Qe {
|
|
|
2321
2355
|
columnIndex: e.c1,
|
|
2322
2356
|
cellLeft: d,
|
|
2323
2357
|
cellTop: a,
|
|
2324
|
-
cellWidth:
|
|
2358
|
+
cellWidth: m,
|
|
2325
2359
|
cellHeight: p,
|
|
2326
2360
|
parent: i
|
|
2327
2361
|
});
|
|
@@ -2372,41 +2406,41 @@ class st extends Qe {
|
|
|
2372
2406
|
const f = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
2373
2407
|
d = this.scrollFactorX * f;
|
|
2374
2408
|
}
|
|
2375
|
-
const p = 0,
|
|
2409
|
+
const p = 0, m = !!(e === "body" && t);
|
|
2376
2410
|
let g = d;
|
|
2377
2411
|
for (let f = a; f <= l; f++) {
|
|
2378
|
-
const
|
|
2379
|
-
if (w > 0 &&
|
|
2412
|
+
const u = g, w = this.tableModel.getColumnWidth(f);
|
|
2413
|
+
if (w > 0 && u + w > 0) {
|
|
2380
2414
|
let x = o.height;
|
|
2381
2415
|
const v = s.getRowspanAt(r, f), y = s.getColspanAt(r, f);
|
|
2382
|
-
v > 1 && (x = this.getRowHeights(r, r + v - 1, s).reduce((
|
|
2416
|
+
v > 1 && (x = this.getRowHeights(r, r + v - 1, s).reduce((R, E) => R + E, 0));
|
|
2383
2417
|
let S = w;
|
|
2384
|
-
y > 1 && (S = this.getColumnWidths(f, f + y - 1).reduce((
|
|
2418
|
+
y > 1 && (S = this.getColumnWidths(f, f + y - 1).reduce((R, E) => R + E, 0));
|
|
2385
2419
|
let M = !1;
|
|
2386
2420
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (b = this.colAndRowspanModels[e]) != null && b.isInRange(r, f) && (M = !0), this.draggingTargetColumnIndex === f && e !== "header") {
|
|
2387
|
-
this.renderDragTargetDiv(i,
|
|
2388
|
-
const
|
|
2389
|
-
this.dom.addColumnBorderDivs(this.tableOptions, i,
|
|
2421
|
+
this.renderDragTargetDiv(i, u, p, S, x);
|
|
2422
|
+
const R = { left: u, top: p, width: S, height: x };
|
|
2423
|
+
this.dom.addColumnBorderDivs(this.tableOptions, i, R, e, t);
|
|
2390
2424
|
} else {
|
|
2391
|
-
const
|
|
2425
|
+
const R = this.renderSelectedBackgroundDiv(M, m, t, s, r, f, i, u, p, S, x);
|
|
2392
2426
|
"gammaCells" in s && s.getValueAt(r, f) && (M = !1), M || this.renderCell({
|
|
2393
2427
|
areaModel: s,
|
|
2394
2428
|
areaIdent: e,
|
|
2395
2429
|
sideIdent: t,
|
|
2396
2430
|
rowIndex: r,
|
|
2397
2431
|
columnIndex: f,
|
|
2398
|
-
left:
|
|
2432
|
+
left: u,
|
|
2399
2433
|
top: p,
|
|
2400
2434
|
width: S,
|
|
2401
2435
|
height: x,
|
|
2402
2436
|
parent: i,
|
|
2403
|
-
cellSelected:
|
|
2437
|
+
cellSelected: R,
|
|
2404
2438
|
lastRowOfModel: h,
|
|
2405
2439
|
gammaRange: !0
|
|
2406
2440
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
2407
2441
|
rowIndex: r,
|
|
2408
2442
|
columnIndex: f,
|
|
2409
|
-
cellLeft:
|
|
2443
|
+
cellLeft: u,
|
|
2410
2444
|
cellTop: p,
|
|
2411
2445
|
cellWidth: S,
|
|
2412
2446
|
cellHeight: x,
|
|
@@ -2445,9 +2479,9 @@ class st extends Qe {
|
|
|
2445
2479
|
lastRowOfModel: d
|
|
2446
2480
|
}) {
|
|
2447
2481
|
var ie;
|
|
2448
|
-
const
|
|
2482
|
+
const m = this.editorRenderer && this.editorRendererRow === o && this.editorRendererColumn === i ? this.editorRenderer : e.getCellRenderer(o, i), g = { left: r, width: a, height: l, top: c, index: i }, b = e.getRowByIndex(o);
|
|
2449
2483
|
let f = "none";
|
|
2450
|
-
if (i === this.getTreeArrowColumnIndex() &&
|
|
2484
|
+
if (i === this.getTreeArrowColumnIndex() && W(b)) {
|
|
2451
2485
|
const C = b;
|
|
2452
2486
|
(ie = C.children) != null && ie.length ? C.expanded ? f = "expanded" : f = "collapsed" : f = "hidden";
|
|
2453
2487
|
}
|
|
@@ -2456,7 +2490,7 @@ class st extends Qe {
|
|
|
2456
2490
|
const C = this.tableModel.getColumnDef(i);
|
|
2457
2491
|
(!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (w = C == null ? void 0 : C.sortState);
|
|
2458
2492
|
}
|
|
2459
|
-
const x = e.getValueAt(o, i), v =
|
|
2493
|
+
const x = e.getValueAt(o, i), v = m ? "" : `${x}`, y = e.isRowChecked(o), S = this.dom.addColumnDiv(
|
|
2460
2494
|
{
|
|
2461
2495
|
parent: h,
|
|
2462
2496
|
geo: g,
|
|
@@ -2472,12 +2506,12 @@ class st extends Qe {
|
|
|
2472
2506
|
}
|
|
2473
2507
|
), M = e.getTooltipAt(o, i);
|
|
2474
2508
|
M && this.dom.setAttribute(S, "title", M);
|
|
2475
|
-
const
|
|
2476
|
-
|
|
2477
|
-
let
|
|
2478
|
-
|
|
2479
|
-
const
|
|
2480
|
-
if (
|
|
2509
|
+
const R = this.tableModel.getColumnDef(i);
|
|
2510
|
+
R && R.classes[t] && this.dom.addClasses(R.classes[t], S);
|
|
2511
|
+
let E;
|
|
2512
|
+
m && (E = m.render(S, o, i, t, e, x, this.dom.domService));
|
|
2513
|
+
const $ = e.getCustomClassesAt(o, i);
|
|
2514
|
+
if ($.length && this.dom.addClasses($, S), this.dom.addColumnBorderDivs(this.tableOptions, h, g, t, s), d && this.dom.addHorizontalBorder({ left: r, width: a, height: l, top: c + l }, h), this.getFocusModel && t === "body") {
|
|
2481
2515
|
const C = this.getFocusModel();
|
|
2482
2516
|
C != null && C.hasFocus(o, i) && this.dom.addFocusBorderDivs(h, g, {});
|
|
2483
2517
|
}
|
|
@@ -2486,7 +2520,7 @@ class st extends Qe {
|
|
|
2486
2520
|
if (U)
|
|
2487
2521
|
for (const C in U)
|
|
2488
2522
|
this.dom.setStyle(S, C, U[C]);
|
|
2489
|
-
return [S,
|
|
2523
|
+
return [S, E];
|
|
2490
2524
|
}
|
|
2491
2525
|
/**
|
|
2492
2526
|
* Applies CSS classes to an HTML element.
|
|
@@ -2652,7 +2686,7 @@ class st extends Qe {
|
|
|
2652
2686
|
if (r) {
|
|
2653
2687
|
const a = e.index ?? 0, l = this.draggingColumn;
|
|
2654
2688
|
for (let c = 0; c < r; c++) {
|
|
2655
|
-
const h = s, d = i.getRowHeight(c), p = { left: 0, width: e.width, height: d, top: h, index: c },
|
|
2689
|
+
const h = s, d = i.getRowHeight(c), p = { left: 0, width: e.width, height: d, top: h, index: c }, m = i.getValueAt(c, a), g = i.getCellRenderer(c, a), b = g ? "" : `${m}`, f = {
|
|
2656
2690
|
parent: l,
|
|
2657
2691
|
geo: p,
|
|
2658
2692
|
rowIndex: c,
|
|
@@ -2660,17 +2694,17 @@ class st extends Qe {
|
|
|
2660
2694
|
areaIdent: t,
|
|
2661
2695
|
sideIdent: o,
|
|
2662
2696
|
text: b
|
|
2663
|
-
},
|
|
2697
|
+
}, u = this.dom.addColumnDiv(f);
|
|
2664
2698
|
let w;
|
|
2665
|
-
g && (w = g.render(
|
|
2699
|
+
g && (w = g.render(u, c, a, t, i, m, this.dom.domService), w && this.cleanupFunctions[t].push(w));
|
|
2666
2700
|
const x = i.getCustomClassesAt(c, a);
|
|
2667
|
-
x.length && this.dom.addClasses(x,
|
|
2701
|
+
x.length && this.dom.addClasses(x, u);
|
|
2668
2702
|
const v = this.tableModel.getColumnDef(a);
|
|
2669
|
-
v && v.classes[t] && this.dom.addClasses(v.classes[t],
|
|
2703
|
+
v && v.classes[t] && this.dom.addClasses(v.classes[t], u), this.dom.addColumnBorderDivs(this.tableOptions, l, p, t, o);
|
|
2670
2704
|
const y = i.getCustomStyleAt(c, a);
|
|
2671
2705
|
if (y)
|
|
2672
2706
|
for (const S in y)
|
|
2673
|
-
this.dom.setStyle(
|
|
2707
|
+
this.dom.setStyle(u, S, y[S]);
|
|
2674
2708
|
s = s + d;
|
|
2675
2709
|
}
|
|
2676
2710
|
}
|
|
@@ -2723,9 +2757,9 @@ class st extends Qe {
|
|
|
2723
2757
|
renderSelectedBackgroundDiv(e, t, s, o, i, r, a, l, c, h, d) {
|
|
2724
2758
|
let p = !1;
|
|
2725
2759
|
if (!e && t && o.isSelectable(i, r) && this.getSelectionModel) {
|
|
2726
|
-
const
|
|
2727
|
-
if (
|
|
2728
|
-
const g =
|
|
2760
|
+
const m = this.getSelectionModel();
|
|
2761
|
+
if (m) {
|
|
2762
|
+
const g = m.getSelectionCount(i, r);
|
|
2729
2763
|
p = g > 0;
|
|
2730
2764
|
for (let b = 0; b < g; b++) {
|
|
2731
2765
|
const f = this.dom.applyStylePosistionAbsolute(
|
|
@@ -2771,7 +2805,7 @@ class st extends Qe {
|
|
|
2771
2805
|
cellSelected: d,
|
|
2772
2806
|
lastRowOfModel: p
|
|
2773
2807
|
}) {
|
|
2774
|
-
const [
|
|
2808
|
+
const [m, g] = this.addAndRenderCellDiv({
|
|
2775
2809
|
areaModel: e,
|
|
2776
2810
|
areaIdent: t,
|
|
2777
2811
|
sideIdent: s,
|
|
@@ -2784,7 +2818,7 @@ class st extends Qe {
|
|
|
2784
2818
|
parent: h,
|
|
2785
2819
|
lastRowOfModel: p
|
|
2786
2820
|
});
|
|
2787
|
-
d && this.dom.addClass(`ge-table-${t}-${s}-selected-range`,
|
|
2821
|
+
d && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, m), g && this.cleanupFunctions[t].push(g);
|
|
2788
2822
|
}
|
|
2789
2823
|
/**
|
|
2790
2824
|
* Render the header cell resize handle.
|
|
@@ -2854,8 +2888,8 @@ class at {
|
|
|
2854
2888
|
var i, r, a, l, c, h, d;
|
|
2855
2889
|
let s = !1, o = !1;
|
|
2856
2890
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
2857
|
-
const p = this.getSelectionModel(),
|
|
2858
|
-
p &&
|
|
2891
|
+
const p = this.getSelectionModel(), m = this.getFocusModel();
|
|
2892
|
+
p && m && (m.hasFocus(e.rowIndex, e.columnIndex) || (m.setFocus(e.rowIndex, e.columnIndex), this.tableScope.onFocusChanged(m), s = !0), (i = e.originalEvent) != null && i.shiftKey || p.hasSelection() && (p.clear(), s = !0), (r = e.originalEvent) != null && r.shiftKey && this.previousEvt ? (p.addSelection(this.createRangeByEvents(e, this.previousEvt)), o = !0, s = !0) : (a = e.originalEvent) != null && a.altKey && ((l = e.originalEvent) != null && l.ctrlKey || (c = e.originalEvent) != null && c.metaKey) ? (p.removeSelection(A.singleCell(e.rowIndex, e.columnIndex)), o = !0, s = !0) : (h = e.originalEvent) != null && h.ctrlKey || (d = e.originalEvent) != null && d.metaKey ? (p.addSelection(A.singleCell(e.rowIndex, e.columnIndex)), o = !0, s = !0) : (p.firstClick(e.rowIndex, e.columnIndex), s = !0), this.tableScope.onSelectionChanged(p));
|
|
2859
2893
|
}
|
|
2860
2894
|
return o ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
2861
2895
|
}
|
|
@@ -3250,7 +3284,7 @@ class ye {
|
|
|
3250
3284
|
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new ue(), this.headerGroupOptions = new Se(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new me(), this.sortOrder = ["asc", "desc"], this.shortcutActionsDisabled = !1, this.resizeEventDebounceDelay = 500, this.getEditRenderer = (e, t) => new ht(), this.getSelectionModel = () => ft, this.getFocusModel = () => ut;
|
|
3251
3285
|
}
|
|
3252
3286
|
}
|
|
3253
|
-
const
|
|
3287
|
+
const O = class O {
|
|
3254
3288
|
/**
|
|
3255
3289
|
* Returns the content to be copied based on the provided table model, selection model, and focus model.
|
|
3256
3290
|
*
|
|
@@ -3273,9 +3307,9 @@ const L = class L {
|
|
|
3273
3307
|
const d = t.isSelected(l, h) ? e.getBodyModel().getTextValueAt(l, h) : "";
|
|
3274
3308
|
c.push(d);
|
|
3275
3309
|
}
|
|
3276
|
-
a.push(c.join(
|
|
3310
|
+
a.push(c.join(O.columnSeparatorChar));
|
|
3277
3311
|
}
|
|
3278
|
-
return o(a.join(
|
|
3312
|
+
return o(a.join(O.rowSeparatorChar));
|
|
3279
3313
|
}
|
|
3280
3314
|
}
|
|
3281
3315
|
if (s) {
|
|
@@ -3332,9 +3366,9 @@ const L = class L {
|
|
|
3332
3366
|
return t;
|
|
3333
3367
|
}
|
|
3334
3368
|
};
|
|
3335
|
-
|
|
3369
|
+
O.columnSeparatorChar = " ", O.rowSeparatorChar = `
|
|
3336
3370
|
`;
|
|
3337
|
-
let
|
|
3371
|
+
let H = O;
|
|
3338
3372
|
class mt {
|
|
3339
3373
|
constructor(e, t = 500) {
|
|
3340
3374
|
this.tableScope = e, this.debounceDelay = t, new ResizeObserver(Ne(this.handleResize.bind(this), t)).observe(this.tableScope.hostElement);
|
|
@@ -3425,8 +3459,8 @@ class bt {
|
|
|
3425
3459
|
let s = 0;
|
|
3426
3460
|
const o = [];
|
|
3427
3461
|
e.forEach((d, p) => {
|
|
3428
|
-
const
|
|
3429
|
-
b.set([80, 75, 3, 4], 0), f.setUint16(4, 20, !0), f.setUint16(6, 0, !0), f.setUint16(8, 0, !0), f.setUint16(10, 0, !0), f.setUint16(12, 0, !0), f.setUint32(14, 0, !0), f.setUint32(18, g.length, !0), f.setUint32(22, g.length, !0), f.setUint16(26,
|
|
3462
|
+
const m = new TextEncoder().encode(p), g = new TextEncoder().encode(d), b = new Uint8Array(30 + m.length), f = new DataView(b.buffer);
|
|
3463
|
+
b.set([80, 75, 3, 4], 0), f.setUint16(4, 20, !0), f.setUint16(6, 0, !0), f.setUint16(8, 0, !0), f.setUint16(10, 0, !0), f.setUint16(12, 0, !0), f.setUint32(14, 0, !0), f.setUint32(18, g.length, !0), f.setUint32(22, g.length, !0), f.setUint16(26, m.length, !0), f.setUint16(28, 0, !0), b.set(m, 30), t.push(b, g), o.push({
|
|
3430
3464
|
path: p,
|
|
3431
3465
|
offset: s,
|
|
3432
3466
|
contentSize: g.length
|
|
@@ -3434,8 +3468,8 @@ class bt {
|
|
|
3434
3468
|
});
|
|
3435
3469
|
const i = s;
|
|
3436
3470
|
o.forEach((d) => {
|
|
3437
|
-
const p = new TextEncoder().encode(d.path),
|
|
3438
|
-
|
|
3471
|
+
const p = new TextEncoder().encode(d.path), m = new Uint8Array(46 + p.length), g = new DataView(m.buffer);
|
|
3472
|
+
m.set([80, 75, 1, 2], 0), g.setUint16(4, 20, !0), g.setUint16(6, 20, !0), g.setUint16(8, 0, !0), g.setUint16(10, 0, !0), g.setUint16(12, 0, !0), g.setUint16(14, 0, !0), g.setUint32(16, 0, !0), g.setUint32(20, d.contentSize, !0), g.setUint32(24, d.contentSize, !0), g.setUint16(28, p.length, !0), g.setUint16(30, 0, !0), g.setUint16(32, 0, !0), g.setUint16(34, 0, !0), g.setUint16(36, 0, !0), g.setUint32(38, 0, !0), g.setUint32(42, d.offset, !0), m.set(p, 46), t.push(m), s += m.length;
|
|
3439
3473
|
});
|
|
3440
3474
|
const r = new Uint8Array(22), a = new DataView(r.buffer);
|
|
3441
3475
|
r.set([80, 75, 5, 6], 0), a.setUint16(4, 0, !0), a.setUint16(6, 0, !0), a.setUint16(8, o.length, !0), a.setUint16(10, o.length, !0), a.setUint32(12, s - i, !0), a.setUint32(16, i, !0), a.setUint16(20, 0, !0), t.push(r);
|
|
@@ -3451,9 +3485,9 @@ class bt {
|
|
|
3451
3485
|
}
|
|
3452
3486
|
}
|
|
3453
3487
|
class oe extends st {
|
|
3454
|
-
constructor(e, t, s, o, i, r = new
|
|
3488
|
+
constructor(e, t, s, o, i, r = new H(), a = new bt()) {
|
|
3455
3489
|
var h;
|
|
3456
|
-
if (super(e, t, new Ge(s), o), this.eventListener = i, this.copyService = r, this.excelService = a, this.licenseManager =
|
|
3490
|
+
if (super(e, t, new Ge(s), o), this.eventListener = i, this.copyService = r, this.excelService = a, this.licenseManager = I.getInstance(), this.selectionService = new at(this), this.api = new Ke(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.lastDragFrom = -1, this.lastDragTo = -1, this.firstDraggingRendering = !0, this.lastContextmenu = Date.now(), t.setTableScope(this), i || (this.eventListener = new ne()), (h = this.tableOptions) != null && h.autoRestoreOptions) {
|
|
3457
3491
|
const d = this.tableOptions.autoRestoreOptions, p = d.getStorageKeyFn;
|
|
3458
3492
|
p && (d.autoRestoreScrollPosition && (this.storeScrollPosStateService = new Ye(p)), d.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new qe(p)), d.autoRestoreSortingState && (this.storeSortingService = new Ze(p)));
|
|
3459
3493
|
}
|
|
@@ -3475,7 +3509,7 @@ class oe extends st {
|
|
|
3475
3509
|
*
|
|
3476
3510
|
* @return {TableScope} - The newly created TableScope instance.
|
|
3477
3511
|
*/
|
|
3478
|
-
static create(e, t, s = new ye(), o = new ne(), i = new be(), r = new
|
|
3512
|
+
static create(e, t, s = new ye(), o = new ne(), i = new be(), r = new H()) {
|
|
3479
3513
|
return new oe(e, t, i, s, o, r);
|
|
3480
3514
|
}
|
|
3481
3515
|
/**
|
|
@@ -3878,9 +3912,6 @@ class oe extends st {
|
|
|
3878
3912
|
sort(e) {
|
|
3879
3913
|
this.tableModel.sort(e);
|
|
3880
3914
|
}
|
|
3881
|
-
getDisplayedRowCount() {
|
|
3882
|
-
return this.displayedRowCount;
|
|
3883
|
-
}
|
|
3884
3915
|
/**
|
|
3885
3916
|
* Ensures that a specific row is visible in the viewport by scrolling if necessary.
|
|
3886
3917
|
* This method checks if the target row is within the currently visible range and
|
|
@@ -3933,11 +3964,8 @@ class oe extends st {
|
|
|
3933
3964
|
* @see {@link getDisplayedRowCount} - Related method for getting visible row count
|
|
3934
3965
|
*/
|
|
3935
3966
|
ensureRowIsVisible(e) {
|
|
3936
|
-
const t = this.
|
|
3937
|
-
return e < t ? (this.scrollToIndex(0, e
|
|
3938
|
-
}
|
|
3939
|
-
getFirstVisibleRowIndex() {
|
|
3940
|
-
return this.firstVisibleRowIndex;
|
|
3967
|
+
const t = this.getFirstFullVisibleRowIndex(), s = this.getLastFullVisibleRowIndex(), o = this.getDisplayedRowCount();
|
|
3968
|
+
return e < t ? (this.scrollToIndex(0, e), !0) : e > s ? (this.scrollToIndex(0, e - o + 1), !0) : !1;
|
|
3941
3969
|
}
|
|
3942
3970
|
}
|
|
3943
3971
|
const N = class N {
|
|
@@ -4222,10 +4250,10 @@ function St(n) {
|
|
|
4222
4250
|
let e;
|
|
4223
4251
|
return {
|
|
4224
4252
|
c() {
|
|
4225
|
-
e = Me("div"), Te(e, "class", "ge-table"),
|
|
4253
|
+
e = Me("div"), Te(e, "class", "ge-table"), V(e, "width", "100%"), V(e, "height", "100%"), V(e, "background-color", "transparent"), V(e, "padding", "0"), V(e, "margin", "0");
|
|
4226
4254
|
},
|
|
4227
4255
|
m(t, s) {
|
|
4228
|
-
|
|
4256
|
+
Ee(t, e, s), n[4](e);
|
|
4229
4257
|
},
|
|
4230
4258
|
p: B,
|
|
4231
4259
|
i: B,
|
|
@@ -4268,7 +4296,7 @@ function yt(n, e, t) {
|
|
|
4268
4296
|
a("mouseMoved", d);
|
|
4269
4297
|
}
|
|
4270
4298
|
}, h = new oe(r, s, new be(), o, c);
|
|
4271
|
-
h.firstInit(), a("tableReady", h.getApi()), i &&
|
|
4299
|
+
h.firstInit(), a("tableReady", h.getApi()), i && I.getInstance().setLicenseKey(i);
|
|
4272
4300
|
});
|
|
4273
4301
|
function l(c) {
|
|
4274
4302
|
K[c ? "unshift" : "push"](() => {
|
|
@@ -4279,9 +4307,9 @@ function yt(n, e, t) {
|
|
|
4279
4307
|
"tableModel" in c && t(1, s = c.tableModel), "tableOptions" in c && t(2, o = c.tableOptions), "licenseKey" in c && t(3, i = c.licenseKey);
|
|
4280
4308
|
}, [r, s, o, i, l];
|
|
4281
4309
|
}
|
|
4282
|
-
class Ct extends
|
|
4310
|
+
class Ct extends We {
|
|
4283
4311
|
constructor(e) {
|
|
4284
|
-
super(),
|
|
4312
|
+
super(), $e(this, e, yt, St, Ae, {
|
|
4285
4313
|
tableModel: 1,
|
|
4286
4314
|
tableOptions: 2,
|
|
4287
4315
|
licenseKey: 3
|