@guiexpert/svelte-table 4.0.10 → 4.0.12
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 +31 -15
- package/index.js +1038 -904
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
var
|
|
2
|
-
var ye = (
|
|
3
|
-
var
|
|
4
|
-
import { createEventDispatcher as
|
|
5
|
-
function
|
|
1
|
+
var Se = Object.defineProperty;
|
|
2
|
+
var ye = (n, e, t) => e in n ? Se(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var z = (n, e, t) => (ye(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { createEventDispatcher as xe, onMount as ve } from "svelte";
|
|
5
|
+
function O() {
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
return
|
|
7
|
+
function ce(n) {
|
|
8
|
+
return n();
|
|
9
9
|
}
|
|
10
10
|
function ie() {
|
|
11
11
|
return /* @__PURE__ */ Object.create(null);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
13
|
+
function G(n) {
|
|
14
|
+
n.forEach(ce);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return typeof
|
|
16
|
+
function de(n) {
|
|
17
|
+
return typeof n == "function";
|
|
18
18
|
}
|
|
19
|
-
function Ce(
|
|
20
|
-
return
|
|
19
|
+
function Ce(n, e) {
|
|
20
|
+
return n != n ? e == e : n !== e || n && typeof n == "object" || typeof n == "function";
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
return Object.keys(
|
|
22
|
+
function we(n) {
|
|
23
|
+
return Object.keys(n).length === 0;
|
|
24
24
|
}
|
|
25
|
-
function Ee(
|
|
26
|
-
|
|
25
|
+
function Ee(n, e, t) {
|
|
26
|
+
n.insertBefore(e, t || null);
|
|
27
27
|
}
|
|
28
|
-
function he(
|
|
29
|
-
|
|
28
|
+
function he(n) {
|
|
29
|
+
n.parentNode && n.parentNode.removeChild(n);
|
|
30
30
|
}
|
|
31
|
-
function Ae(
|
|
32
|
-
return document.createElement(
|
|
31
|
+
function Ae(n) {
|
|
32
|
+
return document.createElement(n);
|
|
33
33
|
}
|
|
34
|
-
function Me(
|
|
35
|
-
t == null ?
|
|
34
|
+
function Me(n, e, t) {
|
|
35
|
+
t == null ? n.removeAttribute(e) : n.getAttribute(e) !== t && n.setAttribute(e, t);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return Array.from(
|
|
37
|
+
function Te(n) {
|
|
38
|
+
return Array.from(n.childNodes);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
t == null ?
|
|
40
|
+
function P(n, e, t, s) {
|
|
41
|
+
t == null ? n.style.removeProperty(e) : n.style.setProperty(e, t, s ? "important" : "");
|
|
42
42
|
}
|
|
43
|
-
let
|
|
44
|
-
function
|
|
45
|
-
|
|
43
|
+
let q;
|
|
44
|
+
function $(n) {
|
|
45
|
+
q = n;
|
|
46
46
|
}
|
|
47
|
-
const I = [],
|
|
48
|
-
let
|
|
49
|
-
const
|
|
50
|
-
let
|
|
47
|
+
const I = [], j = [];
|
|
48
|
+
let B = [];
|
|
49
|
+
const ae = [], Re = /* @__PURE__ */ Promise.resolve();
|
|
50
|
+
let X = !1;
|
|
51
51
|
function De() {
|
|
52
|
-
|
|
52
|
+
X || (X = !0, Re.then(pe));
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
|
|
54
|
+
function K(n) {
|
|
55
|
+
B.push(n);
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
let
|
|
59
|
-
function
|
|
60
|
-
if (
|
|
57
|
+
const U = /* @__PURE__ */ new Set();
|
|
58
|
+
let F = 0;
|
|
59
|
+
function pe() {
|
|
60
|
+
if (F !== 0)
|
|
61
61
|
return;
|
|
62
|
-
const
|
|
62
|
+
const n = q;
|
|
63
63
|
do {
|
|
64
64
|
try {
|
|
65
|
-
for (;
|
|
66
|
-
const e = I[
|
|
67
|
-
|
|
65
|
+
for (; F < I.length; ) {
|
|
66
|
+
const e = I[F];
|
|
67
|
+
F++, $(e), ke(e.$$);
|
|
68
68
|
}
|
|
69
69
|
} catch (e) {
|
|
70
|
-
throw I.length = 0,
|
|
70
|
+
throw I.length = 0, F = 0, e;
|
|
71
71
|
}
|
|
72
|
-
for (
|
|
73
|
-
|
|
74
|
-
for (let e = 0; e <
|
|
75
|
-
const t =
|
|
76
|
-
|
|
72
|
+
for ($(null), I.length = 0, F = 0; j.length; )
|
|
73
|
+
j.pop()();
|
|
74
|
+
for (let e = 0; e < B.length; e += 1) {
|
|
75
|
+
const t = B[e];
|
|
76
|
+
U.has(t) || (U.add(t), t());
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
B.length = 0;
|
|
79
79
|
} while (I.length);
|
|
80
|
-
for (;
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
for (; ae.length; )
|
|
81
|
+
ae.pop()();
|
|
82
|
+
X = !1, U.clear(), $(n);
|
|
83
83
|
}
|
|
84
|
-
function ke(
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
const e =
|
|
88
|
-
|
|
84
|
+
function ke(n) {
|
|
85
|
+
if (n.fragment !== null) {
|
|
86
|
+
n.update(), G(n.before_update);
|
|
87
|
+
const e = n.dirty;
|
|
88
|
+
n.dirty = [-1], n.fragment && n.fragment.p(n.ctx, e), n.after_update.forEach(K);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function Fe(n) {
|
|
92
92
|
const e = [], t = [];
|
|
93
|
-
|
|
93
|
+
B.forEach((s) => n.indexOf(s) === -1 ? e.push(s) : t.push(s)), t.forEach((s) => s()), B = e;
|
|
94
94
|
}
|
|
95
95
|
const Ie = /* @__PURE__ */ new Set();
|
|
96
|
-
function
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
function
|
|
100
|
-
const { fragment:
|
|
101
|
-
|
|
102
|
-
const i =
|
|
103
|
-
|
|
104
|
-
}),
|
|
105
|
-
}
|
|
106
|
-
function
|
|
107
|
-
const t =
|
|
108
|
-
t.fragment !== null && (
|
|
109
|
-
}
|
|
110
|
-
function
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
function
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
const
|
|
96
|
+
function Le(n, e) {
|
|
97
|
+
n && n.i && (Ie.delete(n), n.i(e));
|
|
98
|
+
}
|
|
99
|
+
function Oe(n, e, t) {
|
|
100
|
+
const { fragment: s, after_update: o } = n.$$;
|
|
101
|
+
s && s.m(e, t), K(() => {
|
|
102
|
+
const i = n.$$.on_mount.map(ce).filter(de);
|
|
103
|
+
n.$$.on_destroy ? n.$$.on_destroy.push(...i) : G(i), n.$$.on_mount = [];
|
|
104
|
+
}), o.forEach(K);
|
|
105
|
+
}
|
|
106
|
+
function Be(n, e) {
|
|
107
|
+
const t = n.$$;
|
|
108
|
+
t.fragment !== null && (Fe(t.after_update), G(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
|
|
109
|
+
}
|
|
110
|
+
function Pe(n, e) {
|
|
111
|
+
n.$$.dirty[0] === -1 && (I.push(n), De(), n.$$.dirty.fill(0)), n.$$.dirty[e / 31 | 0] |= 1 << e % 31;
|
|
112
|
+
}
|
|
113
|
+
function $e(n, e, t, s, o, i, a = null, l = [-1]) {
|
|
114
|
+
const r = q;
|
|
115
|
+
$(n);
|
|
116
|
+
const c = n.$$ = {
|
|
117
117
|
fragment: null,
|
|
118
118
|
ctx: [],
|
|
119
119
|
// state
|
|
120
120
|
props: i,
|
|
121
|
-
update:
|
|
122
|
-
not_equal:
|
|
121
|
+
update: O,
|
|
122
|
+
not_equal: o,
|
|
123
123
|
bound: ie(),
|
|
124
124
|
// lifecycle
|
|
125
125
|
on_mount: [],
|
|
@@ -127,29 +127,29 @@ function Be(a, e, t, o, s, i, r = null, n = [-1]) {
|
|
|
127
127
|
on_disconnect: [],
|
|
128
128
|
before_update: [],
|
|
129
129
|
after_update: [],
|
|
130
|
-
context: new Map(e.context || (
|
|
130
|
+
context: new Map(e.context || (r ? r.$$.context : [])),
|
|
131
131
|
// everything else
|
|
132
132
|
callbacks: ie(),
|
|
133
|
-
dirty:
|
|
133
|
+
dirty: l,
|
|
134
134
|
skip_bound: !1,
|
|
135
|
-
root: e.target ||
|
|
135
|
+
root: e.target || r.$$.root
|
|
136
136
|
};
|
|
137
|
-
|
|
138
|
-
let
|
|
139
|
-
if (
|
|
140
|
-
const
|
|
141
|
-
return
|
|
142
|
-
}) : [],
|
|
137
|
+
a && a(c.root);
|
|
138
|
+
let h = !1;
|
|
139
|
+
if (c.ctx = t ? t(n, e.props || {}, (d, p, ...u) => {
|
|
140
|
+
const g = u.length ? u[0] : p;
|
|
141
|
+
return c.ctx && o(c.ctx[d], c.ctx[d] = g) && (!c.skip_bound && c.bound[d] && c.bound[d](g), h && Pe(n, d)), p;
|
|
142
|
+
}) : [], c.update(), h = !0, G(c.before_update), c.fragment = s ? s(c.ctx) : !1, e.target) {
|
|
143
143
|
if (e.hydrate) {
|
|
144
|
-
const
|
|
145
|
-
|
|
144
|
+
const d = Te(e.target);
|
|
145
|
+
c.fragment && c.fragment.l(d), d.forEach(he);
|
|
146
146
|
} else
|
|
147
|
-
|
|
148
|
-
e.intro &&
|
|
147
|
+
c.fragment && c.fragment.c();
|
|
148
|
+
e.intro && Le(n.$$.fragment), Oe(n, e.target, e.anchor), pe();
|
|
149
149
|
}
|
|
150
|
-
|
|
150
|
+
$(r);
|
|
151
151
|
}
|
|
152
|
-
class
|
|
152
|
+
class He {
|
|
153
153
|
constructor() {
|
|
154
154
|
/**
|
|
155
155
|
* ### PRIVATE API
|
|
@@ -158,7 +158,7 @@ class Pe {
|
|
|
158
158
|
*
|
|
159
159
|
* @type {any}
|
|
160
160
|
*/
|
|
161
|
-
|
|
161
|
+
z(this, "$$");
|
|
162
162
|
/**
|
|
163
163
|
* ### PRIVATE API
|
|
164
164
|
*
|
|
@@ -166,11 +166,11 @@ class Pe {
|
|
|
166
166
|
*
|
|
167
167
|
* @type {any}
|
|
168
168
|
*/
|
|
169
|
-
|
|
169
|
+
z(this, "$$set");
|
|
170
170
|
}
|
|
171
171
|
/** @returns {void} */
|
|
172
172
|
$destroy() {
|
|
173
|
-
|
|
173
|
+
Be(this, 1), this.$destroy = O;
|
|
174
174
|
}
|
|
175
175
|
/**
|
|
176
176
|
* @template {Extract<keyof Events, string>} K
|
|
@@ -179,12 +179,12 @@ class Pe {
|
|
|
179
179
|
* @returns {() => void}
|
|
180
180
|
*/
|
|
181
181
|
$on(e, t) {
|
|
182
|
-
if (!
|
|
183
|
-
return
|
|
184
|
-
const
|
|
185
|
-
return
|
|
186
|
-
const
|
|
187
|
-
|
|
182
|
+
if (!de(t))
|
|
183
|
+
return O;
|
|
184
|
+
const s = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
|
|
185
|
+
return s.push(t), () => {
|
|
186
|
+
const o = s.indexOf(t);
|
|
187
|
+
o !== -1 && s.splice(o, 1);
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
190
|
/**
|
|
@@ -192,16 +192,16 @@ class Pe {
|
|
|
192
192
|
* @returns {void}
|
|
193
193
|
*/
|
|
194
194
|
$set(e) {
|
|
195
|
-
this.$$set && !
|
|
195
|
+
this.$$set && !we(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
const
|
|
199
|
-
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(
|
|
200
|
-
function We(
|
|
198
|
+
const _e = "4";
|
|
199
|
+
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(_e);
|
|
200
|
+
function We(n, e = 500) {
|
|
201
201
|
let t = null;
|
|
202
|
-
return function(...
|
|
202
|
+
return function(...s) {
|
|
203
203
|
t && window.clearTimeout(t), t = window.setTimeout(() => {
|
|
204
|
-
|
|
204
|
+
n.apply(this, s), t = null;
|
|
205
205
|
}, e);
|
|
206
206
|
};
|
|
207
207
|
}
|
|
@@ -230,18 +230,18 @@ class k {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
return
|
|
233
|
+
function Y(n) {
|
|
234
|
+
return n && n.type === "TreeRow";
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
return
|
|
236
|
+
function J(n) {
|
|
237
|
+
return n && n.type === "AreaModelTree";
|
|
238
238
|
}
|
|
239
|
-
class
|
|
240
|
-
constructor(e = -1, t = -1,
|
|
241
|
-
this.rowIndex = e, this.rowTop = t, this.columnIndex =
|
|
239
|
+
class Z {
|
|
240
|
+
constructor(e = -1, t = -1, s = -1, o = -1, i, a, l, r = 0, c = 0, h = 0, d = "") {
|
|
241
|
+
this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = o, this.areaIdent = i, this.sideIdent = a, this.originalEvent = l, this.clickCount = r, this.draggingX = c, this.draggingY = h, this.action = d;
|
|
242
242
|
}
|
|
243
243
|
clone() {
|
|
244
|
-
return new
|
|
244
|
+
return new Z(
|
|
245
245
|
this.rowIndex,
|
|
246
246
|
this.rowTop,
|
|
247
247
|
this.columnIndex,
|
|
@@ -257,11 +257,11 @@ class Q {
|
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
class D {
|
|
260
|
-
constructor(e = ">", t = "",
|
|
261
|
-
this.content = e, this.style = t, this.classes =
|
|
260
|
+
constructor(e = ">", t = "", s = []) {
|
|
261
|
+
this.content = e, this.style = t, this.classes = s;
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
class
|
|
264
|
+
class ge {
|
|
265
265
|
constructor(e = new D(
|
|
266
266
|
">",
|
|
267
267
|
"transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
|
|
@@ -270,33 +270,33 @@ class pe {
|
|
|
270
270
|
">",
|
|
271
271
|
"",
|
|
272
272
|
["ge-table-tree-arrow-collapsed"]
|
|
273
|
-
),
|
|
273
|
+
), s = new D(
|
|
274
274
|
">",
|
|
275
275
|
"color:transparent;",
|
|
276
276
|
["gt-table-tree-arrow-hidden"]
|
|
277
|
-
),
|
|
277
|
+
), o = new D(
|
|
278
278
|
"↕",
|
|
279
279
|
"",
|
|
280
280
|
["gt-table-tree-arrow-expanded-all"]
|
|
281
281
|
)) {
|
|
282
|
-
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder =
|
|
282
|
+
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = o;
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
|
-
class
|
|
286
|
-
constructor(e = new D("↑", "", ["ge-header-sorted-asc"]), t = new D("↓", "", ["ge-header-sorted-desc"]),
|
|
287
|
-
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder =
|
|
285
|
+
class fe {
|
|
286
|
+
constructor(e = new D("↑", "", ["ge-header-sorted-asc"]), t = new D("↓", "", ["ge-header-sorted-desc"]), s = new D("↑", "color:transparent;", [])) {
|
|
287
|
+
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
class
|
|
290
|
+
class Ve {
|
|
291
291
|
constructor(e) {
|
|
292
292
|
this.domService = e;
|
|
293
293
|
}
|
|
294
|
-
setStyle(e, t,
|
|
295
|
-
return this.domService.setStyle(e, t,
|
|
294
|
+
setStyle(e, t, s) {
|
|
295
|
+
return this.domService.setStyle(e, t, s), e;
|
|
296
296
|
}
|
|
297
297
|
applyStyle(e, t) {
|
|
298
|
-
for (const
|
|
299
|
-
this.domService.setStyle(e,
|
|
298
|
+
for (const s in t)
|
|
299
|
+
this.domService.setStyle(e, s, t[s]);
|
|
300
300
|
return e;
|
|
301
301
|
}
|
|
302
302
|
applyDisplayNoneStyle(e) {
|
|
@@ -306,7 +306,7 @@ class Ge {
|
|
|
306
306
|
return this.domService.setStyle(e, "display", "block"), e;
|
|
307
307
|
}
|
|
308
308
|
applyStyleInPx(e, t) {
|
|
309
|
-
return Object.entries(t).forEach(([
|
|
309
|
+
return Object.entries(t).forEach(([s, o]) => this.domService.setStyle(e, s, o + "px")), e;
|
|
310
310
|
}
|
|
311
311
|
applyStylePosistionRelative(e) {
|
|
312
312
|
return this.domService.setStyle(e, "position", "relative"), this.domService.setStyle(e, "overflow", "clip"), e;
|
|
@@ -317,8 +317,8 @@ class Ge {
|
|
|
317
317
|
applyStyleFullSize(e) {
|
|
318
318
|
return this.domService.setStyle(e, "width", "100%"), this.domService.setStyle(e, "height", "100%"), e;
|
|
319
319
|
}
|
|
320
|
-
applyStyleOverflowAuto(e = "auto", t = "auto",
|
|
321
|
-
return this.domService.setStyle(
|
|
320
|
+
applyStyleOverflowAuto(e = "auto", t = "auto", s) {
|
|
321
|
+
return this.domService.setStyle(s, "overflow-x", e), this.domService.setStyle(s, "overflow-y", t), s;
|
|
322
322
|
}
|
|
323
323
|
applyStyleNoPadding(e) {
|
|
324
324
|
return this.domService.setStyle(e, "padding", "0"), this.domService.setStyle(e, "margin", "0"), this.domService.setStyle(e, "border", "0"), e;
|
|
@@ -334,155 +334,155 @@ class Ge {
|
|
|
334
334
|
return this.domService.appendChild(e, t), this.applyStylePosistionAbsolute(e), { parent: e, child: t, cache: {} };
|
|
335
335
|
}
|
|
336
336
|
appendText(e, t) {
|
|
337
|
-
const
|
|
338
|
-
return this.domService.appendChild(e,
|
|
337
|
+
const s = this.domService.createText(t);
|
|
338
|
+
return this.domService.appendChild(e, s), s;
|
|
339
339
|
}
|
|
340
340
|
addClass(e, t) {
|
|
341
|
-
return e.includes(" ") ? e.split(" ").forEach((
|
|
341
|
+
return e.includes(" ") ? e.split(" ").forEach((s) => this.domService.addClass(t, s)) : this.domService.addClass(t, e), t;
|
|
342
342
|
}
|
|
343
343
|
removeClass(e, t) {
|
|
344
|
-
return e.includes(" ") ? e.split(" ").forEach((
|
|
344
|
+
return e.includes(" ") ? e.split(" ").forEach((s) => this.domService.removeClass(t, s)) : this.domService.removeClass(t, e), t;
|
|
345
345
|
}
|
|
346
346
|
addClasses(e, t) {
|
|
347
347
|
if (e)
|
|
348
|
-
for (const
|
|
349
|
-
this.domService.addClass(t,
|
|
348
|
+
for (const s of e)
|
|
349
|
+
this.domService.addClass(t, s);
|
|
350
350
|
return t;
|
|
351
351
|
}
|
|
352
|
-
setAttribute(e, t,
|
|
353
|
-
return t &&
|
|
352
|
+
setAttribute(e, t, s) {
|
|
353
|
+
return t && s && this.domService.setAttribute(e, t, s), e;
|
|
354
354
|
}
|
|
355
|
-
createAreaDivWithClass(e, t,
|
|
355
|
+
createAreaDivWithClass(e, t, s, o) {
|
|
356
356
|
const i = this.domService.createElement("div");
|
|
357
|
-
return this.addClass(e, i), this.domService.setAttribute(i, "data-area",
|
|
357
|
+
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;
|
|
358
358
|
}
|
|
359
359
|
createDivWithClass(e, t) {
|
|
360
|
-
const
|
|
361
|
-
return this.addClass(e,
|
|
360
|
+
const s = this.domService.createElement("div");
|
|
361
|
+
return this.addClass(e, s), this.domService.appendChild(t, s), s;
|
|
362
362
|
}
|
|
363
|
-
addRowDiv(e, t,
|
|
364
|
-
const
|
|
365
|
-
if (this.domService.addClass(
|
|
366
|
-
const
|
|
367
|
-
this.domService.addClass(
|
|
363
|
+
addRowDiv(e, t, s = -1, o, i, a = "") {
|
|
364
|
+
const l = t.index ?? -1, r = this.getDivOrCreateDiv(l, e);
|
|
365
|
+
if (this.domService.addClass(r, "ge-table-row-div"), this.domService.addClass(r, `ge-table-row-div-${t.index}`), o === "body" && i === "center") {
|
|
366
|
+
const c = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
367
|
+
this.domService.addClass(r, `ge-table-row-${c}`);
|
|
368
368
|
}
|
|
369
|
-
if (this.domService.setStyle(
|
|
370
|
-
const
|
|
371
|
-
this.domService.appendChild(
|
|
369
|
+
if (this.domService.setStyle(r, "display", "clip"), this.domService.setStyle(r, "position", "absolute"), this.domService.setStyle(r, "left", `${t.left}px`), this.domService.setStyle(r, "top", `${t.top}px`), this.domService.setStyle(r, "width", `${t.width}px`), this.domService.setStyle(r, "height", `${t.height}px`), this.domService.setAttribute(r, "data-row-index", `${s}`), this.domService.setAttribute(r, "data-area", `${o}`), a) {
|
|
370
|
+
const c = this.domService.createText(a);
|
|
371
|
+
this.domService.appendChild(r, c);
|
|
372
372
|
}
|
|
373
|
-
return this.domService.appendChild(e.child,
|
|
373
|
+
return this.domService.appendChild(e.child, r), r;
|
|
374
374
|
}
|
|
375
375
|
addColumnDiv(e) {
|
|
376
|
-
const { parent: t, geo:
|
|
377
|
-
this.domService.addClass(
|
|
378
|
-
const
|
|
379
|
-
if (
|
|
380
|
-
const
|
|
381
|
-
this.addLabelDiv(
|
|
376
|
+
const { parent: t, geo: s, rowIndex: o = -1, columnIndex: i = -1, areaIdent: a, sideIdent: l, text: r = "", treeArrow: c, tableOptions: h, checkedType: d = void 0, sortState: p } = e, u = h == null ? void 0 : h.treeOptions, g = h == null ? void 0 : h.showCheckboxWihoutExtraColumn, b = this.domService.createElement("div");
|
|
377
|
+
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", `${a}`);
|
|
378
|
+
const f = ((s == null ? void 0 : s.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
379
|
+
if (a === "body" && l === "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, u, o, i, a)), g && i === 0 && d && this.addCheckboxToDiv(b, d, a, o), r) {
|
|
380
|
+
const m = c !== "none" && i === 0;
|
|
381
|
+
this.addLabelDiv(b, r, m, o, i, a);
|
|
382
382
|
}
|
|
383
|
-
return
|
|
383
|
+
return p && this.addSortedIcon(b, p, h == null ? void 0 : h.sortedOptions, i), this.domService.appendChild(t, b), b;
|
|
384
384
|
}
|
|
385
|
-
addCheckboxToDiv(e, t,
|
|
386
|
-
const i = this.domService.createElement("div"),
|
|
385
|
+
addCheckboxToDiv(e, t, s, o) {
|
|
386
|
+
const i = this.domService.createElement("div"), a = t === "full" ? "checked" : "";
|
|
387
387
|
return i.innerHTML = `
|
|
388
388
|
<input
|
|
389
389
|
type="checkbox"
|
|
390
|
-
data-area="${
|
|
391
|
-
data-row-index="${
|
|
390
|
+
data-area="${s}"
|
|
391
|
+
data-row-index="${o}"
|
|
392
392
|
data-input-type="checkbox"
|
|
393
|
-
${
|
|
394
|
-
class="ge-table-row-checkbox"> `, this.domService.setStyle(i, "display", "inline"), this.domService.setStyle(i, "width", "inherit"), this.domService.setAttribute(i, "data-row-index", `${
|
|
393
|
+
${a}
|
|
394
|
+
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;
|
|
395
395
|
}
|
|
396
|
-
addLabelDiv(e, t = "",
|
|
397
|
-
const
|
|
398
|
-
if (this.domService.addClass(
|
|
399
|
-
if (
|
|
400
|
-
const
|
|
401
|
-
this.domService.appendChild(
|
|
396
|
+
addLabelDiv(e, t = "", s = !1, o = -1, i = -1, a = "body") {
|
|
397
|
+
const l = this.domService.createElement("div");
|
|
398
|
+
if (this.domService.addClass(l, "ge-table-label-div"), this.domService.setStyle(l, "position", "relative"), this.domService.setStyle(l, "background", "transparent"), this.domService.setStyle(l, "width", "100%"), this.domService.setStyle(l, "height", "100%"), this.domService.setAttribute(l, "data-row-index", `${o}`), this.domService.setAttribute(l, "data-col-index", `${i}`), this.domService.setAttribute(l, "data-area", `${a}`), t)
|
|
399
|
+
if (s) {
|
|
400
|
+
const r = this.domService.createText(t);
|
|
401
|
+
this.domService.appendChild(l, r);
|
|
402
402
|
} else {
|
|
403
|
-
const
|
|
404
|
-
this.domService.appendChild(
|
|
405
|
-
const
|
|
406
|
-
this.domService.addClass(
|
|
403
|
+
const r = this.domService.createElement("div");
|
|
404
|
+
this.domService.appendChild(l, r);
|
|
405
|
+
const c = this.domService.createText(t);
|
|
406
|
+
this.domService.addClass(r, "ge-table-label"), this.domService.appendChild(r, c), this.domService.setAttribute(r, "data-row-index", `${o}`), this.domService.setAttribute(r, "data-col-index", `${i}`), this.domService.setAttribute(r, "data-area", `${a}`);
|
|
407
407
|
}
|
|
408
|
-
return this.domService.appendChild(e,
|
|
408
|
+
return this.domService.appendChild(e, l), l;
|
|
409
409
|
}
|
|
410
|
-
addSortedIcon(e, t = "",
|
|
410
|
+
addSortedIcon(e, t = "", s = new fe(), o = -1) {
|
|
411
411
|
const i = this.domService.createElement("div");
|
|
412
|
-
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", `${
|
|
412
|
+
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");
|
|
413
|
+
let a;
|
|
414
|
+
t === "asc" ? a = s.iconAsc : t === "desc" ? a = s.iconDesc : a = s.iconPlaceholder;
|
|
415
|
+
const l = a.content, r = this.domService.createText(l);
|
|
416
|
+
this.domService.appendChild(i, r), a.style && this.applyStyleString(i, a.style);
|
|
417
|
+
for (const c of a.classes)
|
|
418
|
+
this.domService.addClass(i, c);
|
|
419
|
+
return this.domService.appendChild(e, i), i;
|
|
420
|
+
}
|
|
421
|
+
addArrowDiv(e, t = "none", s = new ge(), o = -1, i = -1, a = "body") {
|
|
422
|
+
const l = this.domService.createElement("div");
|
|
423
|
+
this.domService.addClass(l, "ge-table-tree-arrow-div"), this.domService.setStyle(l, "display", "inline-block"), this.domService.setStyle(l, "position", ""), this.domService.setStyle(l, "width", "20px"), this.domService.setStyle(l, "background", "transparent"), this.domService.setStyle(l, "cursor", "pointer"), this.domService.setAttribute(l, "data-row-index", `${o}`), this.domService.setAttribute(l, "data-col-index", `${i}`), this.domService.setAttribute(l, "data-area", `${a}`);
|
|
413
424
|
let r;
|
|
414
|
-
t === "
|
|
415
|
-
const
|
|
416
|
-
this.domService.appendChild(
|
|
425
|
+
t === "expanded" ? r = s.arrowExpanded : t === "collapsed" ? r = s.arrowCollapsed : r = s.arrowPlaceholder;
|
|
426
|
+
const c = r.content, h = this.domService.createText(c);
|
|
427
|
+
this.domService.appendChild(l, h), r.style && this.applyStyleString(l, r.style);
|
|
417
428
|
for (const d of r.classes)
|
|
418
|
-
this.domService.addClass(
|
|
419
|
-
return this.domService.appendChild(e,
|
|
429
|
+
this.domService.addClass(l, d);
|
|
430
|
+
return this.domService.appendChild(e, l), l;
|
|
420
431
|
}
|
|
421
|
-
|
|
422
|
-
const n = this.domService.createElement("div");
|
|
423
|
-
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", `${s}`), this.domService.setAttribute(n, "data-col-index", `${i}`), this.domService.setAttribute(n, "data-area", `${r}`);
|
|
424
|
-
let l;
|
|
425
|
-
t === "expanded" ? l = o.arrowExpanded : t === "collapsed" ? l = o.arrowCollapsed : l = o.arrowPlaceholder;
|
|
426
|
-
const d = l.content, c = this.domService.createText(d);
|
|
427
|
-
this.domService.appendChild(n, c), l.style && this.applyStyleString(n, l.style);
|
|
428
|
-
for (const h of l.classes)
|
|
429
|
-
this.domService.addClass(n, h);
|
|
430
|
-
return this.domService.appendChild(e, n), n;
|
|
431
|
-
}
|
|
432
|
-
addColumnBorderDivs(e, t, o, s, i) {
|
|
432
|
+
addColumnBorderDivs(e, t, s, o, i) {
|
|
433
433
|
if (e.verticalBorderVisible) {
|
|
434
|
-
const
|
|
435
|
-
this.addVerticalBorder(
|
|
434
|
+
const a = `ge-table-${o}-${i}-vertical-border`;
|
|
435
|
+
this.addVerticalBorder(s, t, a);
|
|
436
436
|
}
|
|
437
437
|
if (e.horizontalBorderVisible) {
|
|
438
|
-
const
|
|
439
|
-
this.addHorizontalBorder(
|
|
438
|
+
const a = `ge-table-${o}-${i}-horizontal-border`;
|
|
439
|
+
this.addHorizontalBorder(s, t, a);
|
|
440
440
|
}
|
|
441
441
|
return t;
|
|
442
442
|
}
|
|
443
|
-
addHorizontalBorder(e, t,
|
|
444
|
-
const
|
|
445
|
-
return this.domService.addClass(
|
|
443
|
+
addHorizontalBorder(e, t, s = "ge-table-body-center-horizontal-border") {
|
|
444
|
+
const o = this.domService.createElement("div");
|
|
445
|
+
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;
|
|
446
446
|
}
|
|
447
|
-
addFocusBorderDivs(e, t,
|
|
447
|
+
addFocusBorderDivs(e, t, s) {
|
|
448
448
|
t = { ...t, width: t.width + 1, height: t.height + 1 };
|
|
449
|
-
let
|
|
450
|
-
return this.domService.addClass(
|
|
449
|
+
let o = this.domService.createElement("div");
|
|
450
|
+
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;
|
|
451
451
|
}
|
|
452
|
-
addVerticalBorder(e, t,
|
|
453
|
-
const
|
|
454
|
-
return this.domService.addClass(
|
|
452
|
+
addVerticalBorder(e, t, s = "ge-table-body-center-vertical-border") {
|
|
453
|
+
const o = this.domService.createElement("div");
|
|
454
|
+
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;
|
|
455
455
|
}
|
|
456
|
-
addDiv(e, t,
|
|
457
|
-
const
|
|
458
|
-
return
|
|
456
|
+
addDiv(e, t, s = "") {
|
|
457
|
+
const o = this.domService.createElement("div");
|
|
458
|
+
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;
|
|
459
459
|
}
|
|
460
460
|
applyStyleString(e, t) {
|
|
461
|
-
const
|
|
462
|
-
for (const
|
|
463
|
-
const [i,
|
|
464
|
-
this.domService.setStyle(e, i.trim(),
|
|
461
|
+
const s = t.split(";").map((o) => o.trim()).filter((o) => o);
|
|
462
|
+
for (const o of s) {
|
|
463
|
+
const [i, a] = o.split(":");
|
|
464
|
+
this.domService.setStyle(e, i.trim(), a.trim());
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
467
|
getDivOrCreateDiv(e, t) {
|
|
468
|
-
let
|
|
469
|
-
return
|
|
468
|
+
let s = t.cache[e];
|
|
469
|
+
return s ? (s.innerText = "", s) : (s = this.domService.createElement("div"), t.cache[e] = s, s);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
const
|
|
473
|
-
class
|
|
472
|
+
const Q = (n) => n === "header" ? "header" : n === "footer" ? "footer" : "body";
|
|
473
|
+
class Ge {
|
|
474
474
|
constructor(e, t) {
|
|
475
475
|
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)) {
|
|
476
476
|
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"));
|
|
477
|
-
const
|
|
478
|
-
if (
|
|
479
|
-
const
|
|
480
|
-
this.value =
|
|
477
|
+
const s = e.getAttribute("data-area");
|
|
478
|
+
if (s && (this.areaIdent = Q(s), this.areaModel = t.tableModel.getAreaModel(this.areaIdent), this.row = this.areaModel.getRowByIndex(this.rowIdx)), e instanceof HTMLInputElement) {
|
|
479
|
+
const o = e;
|
|
480
|
+
this.value = o.value;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
class
|
|
485
|
+
class Ne {
|
|
486
486
|
constructor(e) {
|
|
487
487
|
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(
|
|
488
488
|
(t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
|
|
@@ -512,24 +512,24 @@ class Ve {
|
|
|
512
512
|
if (t - this.lastClicked < this.doubleClickDelay)
|
|
513
513
|
return;
|
|
514
514
|
this.lastClicked = t;
|
|
515
|
-
const
|
|
516
|
-
if (
|
|
515
|
+
const s = new Ge(e.target, this.tableScope);
|
|
516
|
+
if (s.action === "toggleExpandCollapseAll")
|
|
517
517
|
this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
|
|
518
|
-
else if (
|
|
519
|
-
this.tableScope.toggleHeaderGroup(
|
|
520
|
-
else if (
|
|
521
|
-
this.tableScope.toggleRowCheckbox(
|
|
522
|
-
else if (
|
|
523
|
-
const
|
|
524
|
-
if (
|
|
518
|
+
else if (s.action === "toggleHeaderGroup")
|
|
519
|
+
this.tableScope.toggleHeaderGroup(s), e.preventDefault(), e.stopPropagation();
|
|
520
|
+
else if (s.inputType === "checkbox" && s.areaIdent)
|
|
521
|
+
this.tableScope.toggleRowCheckbox(s.rowIdx, s.colIdx, s.areaIdent), e.preventDefault(), e.stopPropagation();
|
|
522
|
+
else if (Y(s.row) && s.areaModel) {
|
|
523
|
+
const o = s.colIdx === this.getArrowColumnIndex() && e.altKey, i = s.className.includes("ge-table-tree-arrow-div");
|
|
524
|
+
if (o || i) {
|
|
525
525
|
e.preventDefault(), e.stopPropagation();
|
|
526
|
-
const
|
|
527
|
-
|
|
526
|
+
const a = s.row;
|
|
527
|
+
a.expanded = !a.expanded, "recalcVisibleTreeRows" in s.areaModel && s.areaModel.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(a);
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
|
-
if (
|
|
531
|
-
const
|
|
532
|
-
|
|
530
|
+
if (s.areaIdent === "body" && this.tableScope.tableOptions.getFocusModel) {
|
|
531
|
+
const o = this.tableScope.tableOptions.getFocusModel();
|
|
532
|
+
o == null || o.clear(), o == null || o.setFocus(s.rowIdx, s.colIdx);
|
|
533
533
|
}
|
|
534
534
|
this.publishGeMouseEvent(e, 1);
|
|
535
535
|
}
|
|
@@ -541,15 +541,15 @@ class Ve {
|
|
|
541
541
|
*/
|
|
542
542
|
onHostElementDblClicked(e) {
|
|
543
543
|
if (this.lastClicked = Date.now(), e.target instanceof HTMLElement) {
|
|
544
|
-
const t = e.target,
|
|
545
|
-
if (
|
|
546
|
-
this.tableScope.tableModel.isSortable(
|
|
544
|
+
const t = e.target, s = t.getAttribute("data-area"), o = Q(s), i = Number(t.getAttribute("data-row-index")), a = Number(t.getAttribute("data-col-index")), l = this.tableScope.tableModel.getAreaModel(o);
|
|
545
|
+
if (s && o === "header")
|
|
546
|
+
this.tableScope.tableModel.isSortable(a) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, i, a));
|
|
547
547
|
else if (t.getAttribute("data-row-index")) {
|
|
548
|
-
const
|
|
549
|
-
if (
|
|
548
|
+
const r = l.getRowByIndex(i);
|
|
549
|
+
if (s && o === "body" && l.isEditable(i, a) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(i, a)), Y(r) && a === this.getArrowColumnIndex()) {
|
|
550
550
|
e.preventDefault(), e.stopPropagation();
|
|
551
|
-
const
|
|
552
|
-
|
|
551
|
+
const c = r;
|
|
552
|
+
c.expanded = !c.expanded, "recalcVisibleTreeRows" in l && l.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(c);
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
555
|
}
|
|
@@ -564,8 +564,8 @@ class Ve {
|
|
|
564
564
|
* @return {void}
|
|
565
565
|
*/
|
|
566
566
|
publishGeMouseEvent(e, t) {
|
|
567
|
-
var
|
|
568
|
-
this.mouseEvent = e, this.geMouseEventOld = (
|
|
567
|
+
var s;
|
|
568
|
+
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();
|
|
569
569
|
}
|
|
570
570
|
/**
|
|
571
571
|
* Update the collapsed/expanded state of a tree row.
|
|
@@ -574,11 +574,11 @@ class Ve {
|
|
|
574
574
|
* @returns {void}
|
|
575
575
|
*/
|
|
576
576
|
updateCollapsedExpandedState(e) {
|
|
577
|
-
var
|
|
578
|
-
const t = (
|
|
577
|
+
var s, o, i, a, l;
|
|
578
|
+
const t = (o = (s = this.tableScope.tableOptions) == null ? void 0 : s.autoRestoreOptions) == null ? void 0 : o.getRowId;
|
|
579
579
|
if (t) {
|
|
580
|
-
const
|
|
581
|
-
|
|
580
|
+
const r = (i = this.tableScope.storeStateCollapsedExpandService) == null ? void 0 : i.collapsedExpandedStateGet().mode, c = r === "collapsed" && !e.expanded || r === "expanded" && e.expanded, h = r === "collapsed" && e.expanded || r === "expanded" && !e.expanded, d = t(e.data);
|
|
581
|
+
c ? (a = this.tableScope.storeStateCollapsedExpandService) == null || a.collapsedStateIdsPush(d) : h && ((l = this.tableScope.storeStateCollapsedExpandService) == null || l.collapsedStateIdsRemove(d));
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
getArrowColumnIndex() {
|
|
@@ -614,7 +614,7 @@ class Ve {
|
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
-
class
|
|
617
|
+
class ze {
|
|
618
618
|
constructor(e) {
|
|
619
619
|
this.tableScope = e;
|
|
620
620
|
}
|
|
@@ -731,6 +731,13 @@ class Ne {
|
|
|
731
731
|
repaintHard() {
|
|
732
732
|
this.tableScope.repaintHard();
|
|
733
733
|
}
|
|
734
|
+
/**
|
|
735
|
+
* Recalculates the column widths of the table.
|
|
736
|
+
*
|
|
737
|
+
* @param {number} clientWidth - The width of the client area.
|
|
738
|
+
*
|
|
739
|
+
* @return {void}
|
|
740
|
+
*/
|
|
734
741
|
recalcColumnWidths(e) {
|
|
735
742
|
this.tableScope.recalcColumnWidths(e);
|
|
736
743
|
}
|
|
@@ -784,6 +791,26 @@ class Ne {
|
|
|
784
791
|
this.tableScope.focusModel()
|
|
785
792
|
);
|
|
786
793
|
}
|
|
794
|
+
/**
|
|
795
|
+
* Generates and downloads an Excel file based on the table data.
|
|
796
|
+
*
|
|
797
|
+
* @param {string} fileName - The name of the Excel file to be downloaded. Defaults to 'table.xlsx'.
|
|
798
|
+
* @param {string} author - The author of the Excel file. If not provided, it will remain empty.
|
|
799
|
+
* @return {void} No return value. Initiates a file download of the Excel document.
|
|
800
|
+
*/
|
|
801
|
+
downloadExcel(e = "table.xlsx", t = "") {
|
|
802
|
+
const s = [], o = this.tableScope.tableModel.getColumnCount(), i = ["header", "body", "footer"];
|
|
803
|
+
for (const a of i) {
|
|
804
|
+
const l = this.tableScope.tableModel.getAreaModel(a), r = (l == null ? void 0 : l.getRowCount()) ?? 0;
|
|
805
|
+
for (let c = 0; c < r; c++) {
|
|
806
|
+
const h = [];
|
|
807
|
+
s.push(h);
|
|
808
|
+
for (let d = 0; d < o; d++)
|
|
809
|
+
h.push(l.getValueAt(c, d));
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
return this.tableScope.excelService.downloadExcel(s, e, t);
|
|
813
|
+
}
|
|
787
814
|
/**
|
|
788
815
|
* Retrieves the current scope of the table.
|
|
789
816
|
*
|
|
@@ -809,26 +836,26 @@ class ee {
|
|
|
809
836
|
autoConvertMapToObject(e) {
|
|
810
837
|
const t = {};
|
|
811
838
|
if (e instanceof Map) {
|
|
812
|
-
const
|
|
813
|
-
for (const
|
|
839
|
+
const s = e;
|
|
840
|
+
for (const o of [...s]) {
|
|
814
841
|
const [
|
|
815
842
|
i,
|
|
816
|
-
|
|
817
|
-
] =
|
|
818
|
-
t[i] =
|
|
843
|
+
a
|
|
844
|
+
] = o;
|
|
845
|
+
t[i] = a;
|
|
819
846
|
}
|
|
820
847
|
}
|
|
821
848
|
return t;
|
|
822
849
|
}
|
|
823
850
|
checkAndPersistItem(e, t) {
|
|
824
|
-
const
|
|
825
|
-
if (
|
|
826
|
-
const
|
|
827
|
-
if (
|
|
828
|
-
const i =
|
|
851
|
+
const s = this.getStorageKeyFn;
|
|
852
|
+
if (s) {
|
|
853
|
+
const o = s();
|
|
854
|
+
if (o) {
|
|
855
|
+
const i = o + e;
|
|
829
856
|
if ((t + "").includes("Map")) {
|
|
830
|
-
const
|
|
831
|
-
this.persistItem(i,
|
|
857
|
+
const a = this.autoConvertMapToObject(t);
|
|
858
|
+
this.persistItem(i, a);
|
|
832
859
|
} else
|
|
833
860
|
this.persistItem(i, t);
|
|
834
861
|
}
|
|
@@ -877,7 +904,7 @@ class ee {
|
|
|
877
904
|
// }
|
|
878
905
|
// }
|
|
879
906
|
}
|
|
880
|
-
class
|
|
907
|
+
class Ue extends ee {
|
|
881
908
|
constructor(e) {
|
|
882
909
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
883
910
|
}
|
|
@@ -892,21 +919,21 @@ class je extends ee {
|
|
|
892
919
|
if (e) {
|
|
893
920
|
const t = e();
|
|
894
921
|
if (t) {
|
|
895
|
-
const
|
|
896
|
-
let
|
|
897
|
-
this.scrollOffset =
|
|
922
|
+
const s = t + this.SCROLL_STATE;
|
|
923
|
+
let o = this.loadFromLocalStorage(s);
|
|
924
|
+
this.scrollOffset = o || [0, 0];
|
|
898
925
|
}
|
|
899
926
|
}
|
|
900
927
|
}
|
|
901
928
|
}
|
|
902
|
-
class
|
|
903
|
-
constructor(e = "collapsed", t = [],
|
|
904
|
-
this.mode = e, this.rowIds = t, this.allCollapsed =
|
|
929
|
+
class je {
|
|
930
|
+
constructor(e = "collapsed", t = [], s = !1, o = !1) {
|
|
931
|
+
this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = o;
|
|
905
932
|
}
|
|
906
933
|
}
|
|
907
|
-
class
|
|
934
|
+
class Xe extends ee {
|
|
908
935
|
constructor(e) {
|
|
909
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
936
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new je(), this.load();
|
|
910
937
|
}
|
|
911
938
|
collapsedExpandedStateGet() {
|
|
912
939
|
return this.collapsedExpandedState;
|
|
@@ -929,8 +956,8 @@ class Ke extends ee {
|
|
|
929
956
|
if (e) {
|
|
930
957
|
const t = e();
|
|
931
958
|
if (t) {
|
|
932
|
-
const
|
|
933
|
-
|
|
959
|
+
const s = t + this.COLLAPSED_EXPANDED_STATE, o = this.loadFromLocalStorage(s);
|
|
960
|
+
o && (this.collapsedExpandedState = o);
|
|
934
961
|
}
|
|
935
962
|
}
|
|
936
963
|
}
|
|
@@ -938,7 +965,7 @@ class Ke extends ee {
|
|
|
938
965
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
939
966
|
}
|
|
940
967
|
}
|
|
941
|
-
class
|
|
968
|
+
class Ke extends ee {
|
|
942
969
|
constructor(e) {
|
|
943
970
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
944
971
|
}
|
|
@@ -953,89 +980,89 @@ class Ye extends ee {
|
|
|
953
980
|
if (e) {
|
|
954
981
|
const t = e();
|
|
955
982
|
if (t) {
|
|
956
|
-
const
|
|
957
|
-
this.sortItems =
|
|
983
|
+
const s = t + this.SORTING_STATE, o = this.loadFromLocalStorage(s);
|
|
984
|
+
this.sortItems = o || [];
|
|
958
985
|
}
|
|
959
986
|
}
|
|
960
987
|
}
|
|
961
988
|
}
|
|
962
|
-
class
|
|
963
|
-
constructor(e = 0, t = 0,
|
|
964
|
-
this.left = e, this.width = t, this.height =
|
|
989
|
+
class R {
|
|
990
|
+
constructor(e = 0, t = 0, s = 0, o = 0, i) {
|
|
991
|
+
this.left = e, this.width = t, this.height = s, this.top = o, this.index = i;
|
|
965
992
|
}
|
|
966
993
|
}
|
|
967
|
-
class
|
|
968
|
-
constructor(e, t,
|
|
969
|
-
this.hostElement = e, this.tableModel = t, this.dom =
|
|
994
|
+
class Ye {
|
|
995
|
+
constructor(e, t, s, o) {
|
|
996
|
+
this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = o, this.scrollTop = 0, this.areaBodyWestGeo = new R(), this.areaBodyCenterGeo = new R(), this.areaBodyEastGeo = new R();
|
|
970
997
|
const i = this.hostElement;
|
|
971
998
|
i.innerText = "", this.dom.setAttribute(i, "tabindex", "0"), this.dom.setStyle(
|
|
972
999
|
this.dom.addClass("ge-table", i),
|
|
973
1000
|
"position",
|
|
974
1001
|
"relative"
|
|
975
|
-
), this.hoverRow =
|
|
976
|
-
|
|
977
|
-
), this.hoverColumn =
|
|
978
|
-
|
|
979
|
-
), this.draggingColumn =
|
|
980
|
-
|
|
981
|
-
), this.areaHeaderWest =
|
|
982
|
-
|
|
983
|
-
|
|
1002
|
+
), this.hoverRow = s.applyStylePosistionAbsolute(
|
|
1003
|
+
s.createDivWithClass("ge-table-hover-row", i)
|
|
1004
|
+
), this.hoverColumn = s.applyStylePosistionAbsolute(
|
|
1005
|
+
s.createDivWithClass("ge-table-hover-column", i)
|
|
1006
|
+
), this.draggingColumn = s.applyStylePosistionAbsolute(
|
|
1007
|
+
s.createDivWithClass("ge-table-dragging-column", i)
|
|
1008
|
+
), this.areaHeaderWest = s.appendRelativeChildDiv(
|
|
1009
|
+
s.applyStylePosistionAbsolute(
|
|
1010
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-west", i, "header", "west")
|
|
984
1011
|
)
|
|
985
|
-
), this.areaHeaderCenter =
|
|
986
|
-
|
|
987
|
-
|
|
1012
|
+
), this.areaHeaderCenter = s.appendRelativeChildDiv(
|
|
1013
|
+
s.applyStylePosistionAbsolute(
|
|
1014
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-center", i, "header", "center")
|
|
988
1015
|
)
|
|
989
|
-
), this.areaHeaderEast =
|
|
990
|
-
|
|
991
|
-
|
|
1016
|
+
), this.areaHeaderEast = s.appendRelativeChildDiv(
|
|
1017
|
+
s.applyStylePosistionAbsolute(
|
|
1018
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-east", i, "body", "east")
|
|
992
1019
|
)
|
|
993
|
-
), this.areaBodyWest =
|
|
994
|
-
|
|
995
|
-
|
|
1020
|
+
), this.areaBodyWest = s.appendRelativeChildDiv(
|
|
1021
|
+
s.applyStylePosistionAbsolute(
|
|
1022
|
+
s.createAreaDivWithClass("ge-table-body ge-table-body-west", i, "body", "west")
|
|
996
1023
|
)
|
|
997
|
-
), this.areaBodyEast =
|
|
998
|
-
|
|
999
|
-
|
|
1024
|
+
), this.areaBodyEast = s.appendRelativeChildDiv(
|
|
1025
|
+
s.applyStylePosistionAbsolute(
|
|
1026
|
+
s.createAreaDivWithClass("ge-table-body ge-table-body-east", i, "body", "east")
|
|
1000
1027
|
)
|
|
1001
|
-
), this.areaFooterWest =
|
|
1002
|
-
|
|
1003
|
-
|
|
1028
|
+
), this.areaFooterWest = s.appendRelativeChildDiv(
|
|
1029
|
+
s.applyStylePosistionAbsolute(
|
|
1030
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-west", i, "footer", "west")
|
|
1004
1031
|
)
|
|
1005
|
-
), this.areaFooterCenter =
|
|
1006
|
-
|
|
1007
|
-
|
|
1032
|
+
), this.areaFooterCenter = s.appendRelativeChildDiv(
|
|
1033
|
+
s.applyStylePosistionAbsolute(
|
|
1034
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-center", i, "footer", "center")
|
|
1008
1035
|
)
|
|
1009
|
-
), this.areaFooterEast =
|
|
1010
|
-
|
|
1011
|
-
|
|
1036
|
+
), this.areaFooterEast = s.appendRelativeChildDiv(
|
|
1037
|
+
s.applyStylePosistionAbsolute(
|
|
1038
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-east", i, "footer", "east")
|
|
1012
1039
|
)
|
|
1013
|
-
), this.scrollViewport =
|
|
1040
|
+
), this.scrollViewport = s.applyStyleOverflowAuto(
|
|
1014
1041
|
this.tableOptions.overflowX ?? "auto",
|
|
1015
1042
|
this.tableOptions.overflowY ?? "auto",
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1043
|
+
s.applyStyleNoPadding(
|
|
1044
|
+
s.applyStylePosistionAbsolute(
|
|
1045
|
+
s.createAreaDivWithClass("ge-table-scroll-viewport", i, "body", "center")
|
|
1019
1046
|
)
|
|
1020
1047
|
)
|
|
1021
|
-
), this.contentWrapperDiv =
|
|
1022
|
-
|
|
1023
|
-
|
|
1048
|
+
), this.contentWrapperDiv = s.applyStyleNoPadding(
|
|
1049
|
+
s.applyStylePosistionRelative(
|
|
1050
|
+
s.createDivWithClass("ge-table-scroll-content-wrapper", this.scrollViewport)
|
|
1024
1051
|
)
|
|
1025
|
-
), this.contentDiv =
|
|
1026
|
-
|
|
1027
|
-
|
|
1052
|
+
), this.contentDiv = s.applyStyleNoPadding(
|
|
1053
|
+
s.applyStylePosistionRelative(
|
|
1054
|
+
s.createDivWithClass("ge-table-scroll-content", this.contentWrapperDiv)
|
|
1028
1055
|
)
|
|
1029
|
-
), this.areaBodyCenter =
|
|
1030
|
-
|
|
1031
|
-
), this.borderHeaderBottom =
|
|
1032
|
-
|
|
1033
|
-
), this.borderFixedWest =
|
|
1034
|
-
|
|
1035
|
-
), this.borderFixedEast =
|
|
1036
|
-
|
|
1037
|
-
), this.borderFooterTop =
|
|
1038
|
-
|
|
1056
|
+
), this.areaBodyCenter = s.appendRelativeChildDiv(
|
|
1057
|
+
s.createDivWithClass("ge-table-body-center", this.contentDiv)
|
|
1058
|
+
), this.borderHeaderBottom = s.applyStylePosistionAbsolute(
|
|
1059
|
+
s.createDivWithClass("ge-table-header-border", i)
|
|
1060
|
+
), this.borderFixedWest = s.applyStylePosistionAbsolute(
|
|
1061
|
+
s.createDivWithClass("ge-table-west-fixed-column-border", i)
|
|
1062
|
+
), this.borderFixedEast = s.applyStylePosistionAbsolute(
|
|
1063
|
+
s.createDivWithClass("ge-table-east-fixed-column-border", i)
|
|
1064
|
+
), this.borderFooterTop = s.applyStylePosistionAbsolute(
|
|
1065
|
+
s.createDivWithClass("ge-table-footer-border", i)
|
|
1039
1066
|
);
|
|
1040
1067
|
}
|
|
1041
1068
|
/**
|
|
@@ -1044,10 +1071,10 @@ class qe {
|
|
|
1044
1071
|
* @return {void}
|
|
1045
1072
|
*/
|
|
1046
1073
|
adjustContainersAndRows() {
|
|
1047
|
-
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth,
|
|
1074
|
+
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth, s = this.hostElement.clientHeight;
|
|
1048
1075
|
this.dom.applyStyle(this.scrollViewport, {
|
|
1049
1076
|
width: `${t - e.left}px`,
|
|
1050
|
-
height: `${
|
|
1077
|
+
height: `${s - e.top}px`,
|
|
1051
1078
|
top: `${e.top}px`,
|
|
1052
1079
|
left: `${e.left}px`
|
|
1053
1080
|
}), this.scrollTop = this.scrollViewport.scrollTop, this.dom.applyStyle(this.contentDiv, {
|
|
@@ -1055,21 +1082,21 @@ class qe {
|
|
|
1055
1082
|
height: `${this.scrollViewport.clientHeight}px`,
|
|
1056
1083
|
top: `${this.scrollTop}px`,
|
|
1057
1084
|
left: `${this.scrollViewport.scrollLeft}px`
|
|
1058
|
-
}), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height =
|
|
1085
|
+
}), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height = s - e.top - e.bottom, this.areaBodyWestGeo.top = e.top, this.areaBodyWestGeo.left = 0, this.dom.applyStyleInPx(this.areaBodyWest.parent, this.areaBodyWestGeo), this.tableOptions.fixedWestSeparatorBorderVisible && this.tableModel.getFixedLeftColumnCount() ? this.dom.applyDisplayBlockStyle(
|
|
1059
1086
|
this.dom.applyStyle(this.borderFixedWest, {
|
|
1060
1087
|
width: "1px",
|
|
1061
1088
|
height: `${this.areaBodyWestGeo.height}px`,
|
|
1062
1089
|
top: `${this.areaBodyWestGeo.top}px`,
|
|
1063
1090
|
left: `${this.areaBodyWestGeo.width}px`
|
|
1064
1091
|
})
|
|
1065
|
-
) : this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height =
|
|
1092
|
+
) : this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height = s - e.top - e.bottom, this.areaBodyEastGeo.top = e.top, this.areaBodyEastGeo.left = t - e.right, this.dom.applyStyleInPx(this.areaBodyEast.parent, this.areaBodyEastGeo), this.tableOptions.fixedEastSeparatorBorderVisible && this.tableModel.getFixedLeftColumnCount() ? this.dom.applyDisplayBlockStyle(
|
|
1066
1093
|
this.dom.applyStyle(this.borderFixedEast, {
|
|
1067
1094
|
width: "1px",
|
|
1068
1095
|
height: `${this.areaBodyEastGeo.height}px`,
|
|
1069
1096
|
top: `${this.areaBodyEastGeo.top}px`,
|
|
1070
1097
|
left: `${this.areaBodyEastGeo.left}px`
|
|
1071
1098
|
})
|
|
1072
|
-
) : this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = t - e.left - e.right, this.areaBodyCenterGeo.height =
|
|
1099
|
+
) : this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = t - e.left - e.right, this.areaBodyCenterGeo.height = s - e.top - e.bottom, this.areaBodyCenterGeo.top = 0, this.areaBodyCenterGeo.left = 0, this.dom.applyStyleInPx(this.areaBodyCenter.parent, this.areaBodyCenterGeo), this.dom.applyStyle(this.areaHeaderCenter.parent, {
|
|
1073
1100
|
width: `${t - e.left - e.right}px`,
|
|
1074
1101
|
height: `${e.top}px`,
|
|
1075
1102
|
top: "0",
|
|
@@ -1094,23 +1121,23 @@ class qe {
|
|
|
1094
1121
|
) : this.dom.applyDisplayNoneStyle(this.borderHeaderBottom), this.dom.applyStyle(this.areaFooterWest.parent, {
|
|
1095
1122
|
width: `${e.left}px`,
|
|
1096
1123
|
height: `${e.bottom}px`,
|
|
1097
|
-
top: `${
|
|
1124
|
+
top: `${s - e.bottom}px`,
|
|
1098
1125
|
left: "0"
|
|
1099
1126
|
}), this.dom.applyStyle(this.areaFooterCenter.parent, {
|
|
1100
1127
|
width: `${t - e.left - e.right}px`,
|
|
1101
1128
|
height: `${e.bottom}px`,
|
|
1102
|
-
top: `${
|
|
1129
|
+
top: `${s - e.bottom}px`,
|
|
1103
1130
|
left: `${e.left}px`
|
|
1104
1131
|
}), this.dom.applyStyle(this.areaFooterEast.parent, {
|
|
1105
1132
|
width: `${e.right}px`,
|
|
1106
1133
|
height: `${e.bottom}px`,
|
|
1107
|
-
top: `${
|
|
1134
|
+
top: `${s - e.bottom}px`,
|
|
1108
1135
|
left: `${t - e.right}px`
|
|
1109
1136
|
}), this.tableOptions.footerSeparatorBorderVisible && this.tableModel.isFooterVisibe() ? this.dom.applyDisplayBlockStyle(
|
|
1110
1137
|
this.dom.applyStyle(this.borderFooterTop, {
|
|
1111
1138
|
width: `${t}px`,
|
|
1112
1139
|
height: "1px",
|
|
1113
|
-
top: `${
|
|
1140
|
+
top: `${s - e.bottom}px`,
|
|
1114
1141
|
left: "0px"
|
|
1115
1142
|
})
|
|
1116
1143
|
) : this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.adjustAfterScrolling();
|
|
@@ -1145,8 +1172,8 @@ class E {
|
|
|
1145
1172
|
* @param {number} c2 - The value for c2.
|
|
1146
1173
|
* @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
|
|
1147
1174
|
*/
|
|
1148
|
-
constructor(e, t,
|
|
1149
|
-
this.r1 = e, this.c1 = t, this.r2 =
|
|
1175
|
+
constructor(e, t, s, o, i = !1) {
|
|
1176
|
+
this.r1 = e, this.c1 = t, this.r2 = s, this.c2 = o, this.gammaRange = i;
|
|
1150
1177
|
}
|
|
1151
1178
|
static create(e) {
|
|
1152
1179
|
return e.gammaRange === void 0 && (e.gammaRange = !1), new E(
|
|
@@ -1170,7 +1197,7 @@ class E {
|
|
|
1170
1197
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
1171
1198
|
}
|
|
1172
1199
|
}
|
|
1173
|
-
class
|
|
1200
|
+
class Je {
|
|
1174
1201
|
constructor(e, t) {
|
|
1175
1202
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
1176
1203
|
}
|
|
@@ -1179,14 +1206,14 @@ class Ue {
|
|
|
1179
1206
|
return;
|
|
1180
1207
|
this.colAndRowspanRanges = [];
|
|
1181
1208
|
const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
|
|
1182
|
-
for (let
|
|
1183
|
-
for (let
|
|
1184
|
-
let i = this.areaModel.getColspanAt(
|
|
1185
|
-
if (i > 1 ||
|
|
1186
|
-
i === 0 && (i = 1),
|
|
1187
|
-
const
|
|
1209
|
+
for (let s = 0; s < e; s++)
|
|
1210
|
+
for (let o = 0; o < t; o++) {
|
|
1211
|
+
let i = this.areaModel.getColspanAt(s, o), a = this.areaModel.getRowspanAt(s, o);
|
|
1212
|
+
if (i > 1 || a > 1) {
|
|
1213
|
+
i === 0 && (i = 1), a === 0 && (a = 1);
|
|
1214
|
+
const l = "gammaCells" in this.areaModel;
|
|
1188
1215
|
this.colAndRowspanRanges.push(
|
|
1189
|
-
new E(o, s
|
|
1216
|
+
new E(s, o, s + a - 1, o + i - 1, l)
|
|
1190
1217
|
);
|
|
1191
1218
|
}
|
|
1192
1219
|
}
|
|
@@ -1196,29 +1223,29 @@ class Ue {
|
|
|
1196
1223
|
}
|
|
1197
1224
|
isInRange(e, t) {
|
|
1198
1225
|
if (this.colAndRowspanRanges) {
|
|
1199
|
-
for (const
|
|
1200
|
-
if (
|
|
1226
|
+
for (const s of this.colAndRowspanRanges)
|
|
1227
|
+
if (s.isInRange(e, t))
|
|
1201
1228
|
return !0;
|
|
1202
1229
|
}
|
|
1203
1230
|
return !1;
|
|
1204
1231
|
}
|
|
1205
1232
|
}
|
|
1206
|
-
class
|
|
1207
|
-
constructor(e, t,
|
|
1208
|
-
this.header = e, this.body = t, this.footer =
|
|
1233
|
+
class qe {
|
|
1234
|
+
constructor(e, t, s) {
|
|
1235
|
+
this.header = e, this.body = t, this.footer = s;
|
|
1209
1236
|
}
|
|
1210
1237
|
}
|
|
1211
|
-
class
|
|
1212
|
-
constructor(e, t,
|
|
1213
|
-
var
|
|
1214
|
-
super(e, t,
|
|
1238
|
+
class Ze extends Ye {
|
|
1239
|
+
constructor(e, t, s, o) {
|
|
1240
|
+
var a, l;
|
|
1241
|
+
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 = {
|
|
1215
1242
|
header: [],
|
|
1216
1243
|
body: [],
|
|
1217
1244
|
footer: []
|
|
1218
|
-
}, this.tree = !1, this.colAndRowspanModels = new
|
|
1219
|
-
(
|
|
1220
|
-
var
|
|
1221
|
-
this.colAndRowspanModels[
|
|
1245
|
+
}, this.tree = !1, this.colAndRowspanModels = new qe(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (a = this.tableOptions) != null && a.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (l = this.tableOptions) != null && l.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), J(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
1246
|
+
(r) => {
|
|
1247
|
+
var c;
|
|
1248
|
+
this.colAndRowspanModels[r] = new Je(t, t.getAreaModel(r)), (c = this.colAndRowspanModels[r]) == null || c.init();
|
|
1222
1249
|
}
|
|
1223
1250
|
);
|
|
1224
1251
|
}
|
|
@@ -1256,10 +1283,10 @@ class Qe extends qe {
|
|
|
1256
1283
|
* @param {number} colIdx - The index of the column.
|
|
1257
1284
|
*/
|
|
1258
1285
|
initRenderEditor(e, t) {
|
|
1259
|
-
var
|
|
1260
|
-
let
|
|
1261
|
-
if (
|
|
1262
|
-
if (this.editorRenderer =
|
|
1286
|
+
var o;
|
|
1287
|
+
let s = (o = this.tableModel.getColumnDef(t)) == null ? void 0 : o.getEditRenderer;
|
|
1288
|
+
if (s || (s = this.tableOptions.getEditRenderer), s)
|
|
1289
|
+
if (this.editorRenderer = s(e, t), this.editorRenderer) {
|
|
1263
1290
|
this.editorRendererRow = e, this.editorRendererColumn = t, this.editing = !0, this.repaint();
|
|
1264
1291
|
const i = document.querySelector("input.ge-table-cell-editor-input");
|
|
1265
1292
|
i && i.focus();
|
|
@@ -1304,19 +1331,19 @@ class Qe extends qe {
|
|
|
1304
1331
|
for (const t of this.removables)
|
|
1305
1332
|
t.remove();
|
|
1306
1333
|
this.hideHoverRow(), this.hideHoverColumn(), this.scrollTop = this.scrollViewport.scrollTop, this.scrollLeft = this.scrollViewport.scrollLeft, this.debounce(this.checkForScrollPosSaving.bind(this)), this.scrollFactorY = this.scrollTop / (this.scrollViewport.scrollHeight - this.scrollViewport.clientHeight), this.scrollFactorX = this.scrollLeft / (this.scrollViewport.scrollWidth - this.scrollViewport.clientWidth), isNaN(this.scrollFactorY) && (this.scrollFactorY = 0), isNaN(this.scrollFactorX) && (this.scrollFactorX = 0), this.adjustBody(), this.adjustArea("footer"), this.adjustArea("header"), this.tableOptions.tableTopBorderVisible && this.removables.push(this.dom.addHorizontalBorder(
|
|
1307
|
-
new
|
|
1334
|
+
new R(0, this.hostElement.clientWidth, 1, 0),
|
|
1308
1335
|
this.hostElement,
|
|
1309
1336
|
"ge-table-border"
|
|
1310
1337
|
)), this.tableOptions.tableBottomBorderVisible && this.removables.push(this.dom.addHorizontalBorder(
|
|
1311
|
-
new
|
|
1338
|
+
new R(0, this.hostElement.clientWidth, 1, this.hostElement.clientHeight - 1),
|
|
1312
1339
|
this.hostElement,
|
|
1313
1340
|
"ge-table-border"
|
|
1314
1341
|
)), this.tableModel.getFixedLeftColumnCount() > 0 && this.removables.push(this.dom.addVerticalBorder(
|
|
1315
|
-
new
|
|
1342
|
+
new R(this.areaBodyWest.child.clientWidth, 1, this.hostElement.clientHeight, 0),
|
|
1316
1343
|
this.hostElement,
|
|
1317
1344
|
"ge-table-body-west-vertical-border"
|
|
1318
1345
|
)), ((e = this.tableModel.getAreaModel("header")) == null ? void 0 : e.getRowCount()) > 0 && this.removables.push(this.dom.addHorizontalBorder(
|
|
1319
|
-
new
|
|
1346
|
+
new R(0, this.hostElement.clientWidth, 1, this.areaHeaderCenter.child.clientHeight),
|
|
1320
1347
|
this.hostElement,
|
|
1321
1348
|
"ge-table-body-west-vertical-border"
|
|
1322
1349
|
));
|
|
@@ -1340,8 +1367,8 @@ class Qe extends qe {
|
|
|
1340
1367
|
*/
|
|
1341
1368
|
updateCells(e, t = !1) {
|
|
1342
1369
|
e.forEach(
|
|
1343
|
-
(
|
|
1344
|
-
this.tableModel.getAreaModel(
|
|
1370
|
+
(s) => {
|
|
1371
|
+
this.tableModel.getAreaModel(s.area).setValue(s.rowIndex, s.columnIndex, s.value), t || this.rerenderCellContent(s);
|
|
1345
1372
|
}
|
|
1346
1373
|
), t && this.repaint();
|
|
1347
1374
|
}
|
|
@@ -1354,23 +1381,24 @@ class Qe extends qe {
|
|
|
1354
1381
|
* @param {any} value - The new value to be displayed in the cell.
|
|
1355
1382
|
* @param {string[]} cssClasses - An array of CSS classes to be applied to the cell.
|
|
1356
1383
|
*/
|
|
1357
|
-
rerenderCellContent({ area: e, rowIndex: t, columnIndex:
|
|
1358
|
-
const
|
|
1359
|
-
if (
|
|
1384
|
+
rerenderCellContent({ area: e, rowIndex: t, columnIndex: s, value: o, cssClasses: i }) {
|
|
1385
|
+
const a = this.tableModel.getAreaModel(e), l = 'div[data-col-index="' + s + '"][data-row-index="' + t + '"][data-area="' + e + '"]', r = document.querySelector(l);
|
|
1386
|
+
if (r) {
|
|
1387
|
+
let c;
|
|
1388
|
+
const h = this.editorRenderer && this.editorRendererRow === t && this.editorRendererColumn === s;
|
|
1360
1389
|
let d;
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
d = h.render(l, t, o, e, r, s, this.dom.domService), d && this.cleanupFunctions[e].push(d);
|
|
1390
|
+
if (h ? d = this.editorRenderer : d = a.getCellRenderer(t, s), r.innerText = "", this.applyCssClasses(r, i), d)
|
|
1391
|
+
c = d.render(r, t, s, e, a, o, this.dom.domService), c && this.cleanupFunctions[e].push(c);
|
|
1364
1392
|
else {
|
|
1365
|
-
const
|
|
1366
|
-
this.dom.addLabelDiv(
|
|
1393
|
+
const g = `${o}`;
|
|
1394
|
+
this.dom.addLabelDiv(r, g, !1, t, s, e);
|
|
1367
1395
|
}
|
|
1368
|
-
const
|
|
1369
|
-
|
|
1370
|
-
const
|
|
1371
|
-
if (
|
|
1372
|
-
for (const
|
|
1373
|
-
this.dom.setStyle(
|
|
1396
|
+
const p = a.getCustomClassesAt(t, s);
|
|
1397
|
+
p.length && this.dom.addClasses(p, r);
|
|
1398
|
+
const u = a.getCustomStyleAt(t, s);
|
|
1399
|
+
if (u)
|
|
1400
|
+
for (const g in u)
|
|
1401
|
+
this.dom.setStyle(r, g, u[g]);
|
|
1374
1402
|
}
|
|
1375
1403
|
}
|
|
1376
1404
|
/**
|
|
@@ -1382,13 +1410,13 @@ class Qe extends qe {
|
|
|
1382
1410
|
*/
|
|
1383
1411
|
storeColumnWidths() {
|
|
1384
1412
|
const e = this.tableModel.getColumnDefs();
|
|
1385
|
-
e != null && e.length && (this.storedColumnWidths = e.map((t,
|
|
1413
|
+
e != null && e.length && (this.storedColumnWidths = e.map((t, s) => this.tableModel.getColumnWidth(s)));
|
|
1386
1414
|
}
|
|
1387
1415
|
getAreaAndSideIdentByAttr(e) {
|
|
1388
1416
|
if (e) {
|
|
1389
|
-
const t = this.getStringByAttr(e, "data-area"),
|
|
1390
|
-
if (
|
|
1391
|
-
return [t,
|
|
1417
|
+
const t = this.getStringByAttr(e, "data-area"), s = this.getStringByAttr(e, "data-side");
|
|
1418
|
+
if (s && t)
|
|
1419
|
+
return [t, s];
|
|
1392
1420
|
}
|
|
1393
1421
|
return [void 0, void 0];
|
|
1394
1422
|
}
|
|
@@ -1445,11 +1473,11 @@ class Qe extends qe {
|
|
|
1445
1473
|
* @protected
|
|
1446
1474
|
*/
|
|
1447
1475
|
getNumberByAttr(e, t) {
|
|
1448
|
-
var
|
|
1476
|
+
var s;
|
|
1449
1477
|
if (e) {
|
|
1450
|
-
const
|
|
1451
|
-
if (
|
|
1452
|
-
return Number(
|
|
1478
|
+
const o = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
|
|
1479
|
+
if (o)
|
|
1480
|
+
return Number(o);
|
|
1453
1481
|
}
|
|
1454
1482
|
return -1;
|
|
1455
1483
|
}
|
|
@@ -1462,11 +1490,11 @@ class Qe extends qe {
|
|
|
1462
1490
|
* @protected
|
|
1463
1491
|
*/
|
|
1464
1492
|
getStringByAttr(e, t) {
|
|
1465
|
-
var
|
|
1493
|
+
var s;
|
|
1466
1494
|
if (e) {
|
|
1467
|
-
const
|
|
1468
|
-
if (
|
|
1469
|
-
return
|
|
1495
|
+
const o = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
|
|
1496
|
+
if (o)
|
|
1497
|
+
return o;
|
|
1470
1498
|
}
|
|
1471
1499
|
return "";
|
|
1472
1500
|
}
|
|
@@ -1479,87 +1507,87 @@ class Qe extends qe {
|
|
|
1479
1507
|
* @protected
|
|
1480
1508
|
*/
|
|
1481
1509
|
adjustArea(e, t = 0) {
|
|
1482
|
-
var
|
|
1483
|
-
const
|
|
1484
|
-
|
|
1485
|
-
const
|
|
1510
|
+
var f;
|
|
1511
|
+
const s = this.getArea(e, "west"), o = this.getArea(e, "center"), i = this.getArea(e, "east"), a = o.child.clientHeight;
|
|
1512
|
+
s.child.innerText = "", o.child.innerText = "", i.child.innerText = "";
|
|
1513
|
+
const l = 0, r = this.areaBodyCenterGeo.width, c = this.tableModel.getPadding(), h = this.tableModel.getAreaModel(e), d = h.getRowCount();
|
|
1486
1514
|
for (; this.cleanupFunctions[e].length; ) {
|
|
1487
|
-
const
|
|
1488
|
-
|
|
1515
|
+
const m = this.cleanupFunctions[e].shift();
|
|
1516
|
+
m && m();
|
|
1489
1517
|
}
|
|
1490
|
-
let
|
|
1491
|
-
const
|
|
1492
|
-
for (let
|
|
1493
|
-
const
|
|
1494
|
-
if (
|
|
1495
|
-
this.firstVisibleRowIndex =
|
|
1496
|
-
let y = { left:
|
|
1497
|
-
const
|
|
1518
|
+
let p = t;
|
|
1519
|
+
const u = this.tableModel.getColumnCount(), g = this.tableModel.getFixedRightColumnCount(), b = this.tableModel.getFixedLeftColumnCount();
|
|
1520
|
+
for (let m = 0; m < d; m++) {
|
|
1521
|
+
const x = p, v = m === d - 1, w = this.tableModel.getRowHeight(e, m);
|
|
1522
|
+
if (x + w > 0) {
|
|
1523
|
+
this.firstVisibleRowIndex = m;
|
|
1524
|
+
let y = { left: l, width: r, height: w, top: x, index: m }, S = this.dom.addRowDiv(o, y, m, e, "center");
|
|
1525
|
+
const T = b;
|
|
1498
1526
|
if (this.adjustColumnsToRowParent({
|
|
1499
1527
|
areaIdent: e,
|
|
1500
1528
|
sideIdent: "center",
|
|
1501
|
-
areaModel:
|
|
1529
|
+
areaModel: h,
|
|
1502
1530
|
geo: y,
|
|
1503
|
-
parent:
|
|
1504
|
-
rowIndex:
|
|
1505
|
-
columnIndexStart:
|
|
1506
|
-
columnIndexEnd:
|
|
1531
|
+
parent: S,
|
|
1532
|
+
rowIndex: m,
|
|
1533
|
+
columnIndexStart: T,
|
|
1534
|
+
columnIndexEnd: u - g - 1,
|
|
1507
1535
|
verticalFixed: !1,
|
|
1508
|
-
lastRowOfModel:
|
|
1509
|
-
}),
|
|
1536
|
+
lastRowOfModel: v
|
|
1537
|
+
}), c.left > 0 && (y = { left: l, width: this.areaBodyWestGeo.width, height: w, top: x, index: m }, S = this.dom.addRowDiv(s, y, m, e, "west"), this.adjustColumnsToRowParent({
|
|
1510
1538
|
areaIdent: e,
|
|
1511
1539
|
sideIdent: "west",
|
|
1512
|
-
areaModel:
|
|
1540
|
+
areaModel: h,
|
|
1513
1541
|
geo: y,
|
|
1514
|
-
parent:
|
|
1515
|
-
rowIndex:
|
|
1542
|
+
parent: S,
|
|
1543
|
+
rowIndex: m,
|
|
1516
1544
|
columnIndexStart: 0,
|
|
1517
|
-
columnIndexEnd:
|
|
1545
|
+
columnIndexEnd: T - 1,
|
|
1518
1546
|
verticalFixed: !0,
|
|
1519
|
-
lastRowOfModel:
|
|
1520
|
-
})),
|
|
1547
|
+
lastRowOfModel: v
|
|
1548
|
+
})), c.right > 0 && (y = { left: l, width: this.areaBodyEastGeo.width, height: w, top: x, index: m }, S = this.dom.addRowDiv(i, y, m, e, "east"), this.adjustColumnsToRowParent({
|
|
1521
1549
|
areaIdent: e,
|
|
1522
1550
|
sideIdent: "east",
|
|
1523
|
-
areaModel:
|
|
1551
|
+
areaModel: h,
|
|
1524
1552
|
geo: y,
|
|
1525
|
-
parent:
|
|
1526
|
-
rowIndex:
|
|
1527
|
-
columnIndexStart:
|
|
1528
|
-
columnIndexEnd:
|
|
1553
|
+
parent: S,
|
|
1554
|
+
rowIndex: m,
|
|
1555
|
+
columnIndexStart: u - g,
|
|
1556
|
+
columnIndexEnd: u - 1,
|
|
1529
1557
|
verticalFixed: !0,
|
|
1530
|
-
lastRowOfModel:
|
|
1531
|
-
})), e === "header" && this.tree &&
|
|
1558
|
+
lastRowOfModel: v
|
|
1559
|
+
})), e === "header" && this.tree && m === d - 1) {
|
|
1532
1560
|
const A = this.dom.applyStyle(
|
|
1533
1561
|
this.dom.setAttribute(
|
|
1534
|
-
this.dom.addDiv(
|
|
1562
|
+
this.dom.addDiv(S, new R(16, 20, 20, 8)),
|
|
1535
1563
|
"data-ge-action",
|
|
1536
1564
|
"toggleExpandCollapseAll"
|
|
1537
1565
|
),
|
|
1538
1566
|
{ cursor: "pointer" }
|
|
1539
1567
|
), M = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1540
1568
|
if (M) {
|
|
1541
|
-
const
|
|
1542
|
-
this.dom.domService.appendChild(A,
|
|
1569
|
+
const H = this.dom.domService.createText(M.content);
|
|
1570
|
+
this.dom.domService.appendChild(A, H), M.style && this.dom.applyStyleString(A, M.style);
|
|
1543
1571
|
}
|
|
1544
1572
|
}
|
|
1545
1573
|
}
|
|
1546
|
-
if (
|
|
1574
|
+
if (p = p + w, p > a)
|
|
1547
1575
|
break;
|
|
1548
1576
|
}
|
|
1549
1577
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1550
|
-
const
|
|
1551
|
-
if (
|
|
1552
|
-
for (const
|
|
1553
|
-
let
|
|
1554
|
-
if (
|
|
1555
|
-
|
|
1556
|
-
else if (
|
|
1557
|
-
|
|
1578
|
+
const m = ((f = this.colAndRowspanModels[e]) == null ? void 0 : f.getRanges()) ?? [];
|
|
1579
|
+
if (m.length)
|
|
1580
|
+
for (const x of m) {
|
|
1581
|
+
let v = 0, w = o.child, y = "center";
|
|
1582
|
+
if (x.c1 < b)
|
|
1583
|
+
w = s.child, y = "west";
|
|
1584
|
+
else if (g > 0 && x.c1 >= u - g)
|
|
1585
|
+
w = i.child, y = "east";
|
|
1558
1586
|
else {
|
|
1559
|
-
const
|
|
1560
|
-
|
|
1587
|
+
const S = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1588
|
+
v = this.scrollFactorX * S - this.areaBodyWestGeo.width, y = "center";
|
|
1561
1589
|
}
|
|
1562
|
-
this.drawBigCell(
|
|
1590
|
+
this.drawBigCell(x, v, t, h, w, y);
|
|
1563
1591
|
}
|
|
1564
1592
|
}
|
|
1565
1593
|
}
|
|
@@ -1573,48 +1601,48 @@ class Qe extends qe {
|
|
|
1573
1601
|
* @param sideIdent SideIdent (west,center,east)
|
|
1574
1602
|
* @protected
|
|
1575
1603
|
*/
|
|
1576
|
-
drawBigCell(e, t,
|
|
1577
|
-
const
|
|
1578
|
-
let
|
|
1579
|
-
|
|
1580
|
-
const
|
|
1581
|
-
let
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1584
|
-
areaModel:
|
|
1585
|
-
areaIdent:
|
|
1586
|
-
sideIdent:
|
|
1604
|
+
drawBigCell(e, t, s, o, i, a) {
|
|
1605
|
+
const l = s + this.getRowHeights(0, e.r1 - 1, o).reduce((f, m) => f + m, 0), r = this.tableModel.getColumnCount(), c = this.tableModel.getFixedRightColumnCount();
|
|
1606
|
+
let h = 0;
|
|
1607
|
+
c > 0 && e.c1 >= r - c && (h = r - c);
|
|
1608
|
+
const d = t + this.getColumnWidths(h, e.c1 - 1).reduce((f, m) => f + m, 0), p = this.getRowHeights(e.r1, e.r2, o).reduce((f, m) => f + m, 0), u = this.getColumnWidths(e.c1, e.c2).reduce((f, m) => f + m, 0);
|
|
1609
|
+
let g = !1;
|
|
1610
|
+
const b = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
1611
|
+
b && (g = b.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? this.renderCell({
|
|
1612
|
+
areaModel: o,
|
|
1613
|
+
areaIdent: o.areaIdent,
|
|
1614
|
+
sideIdent: a,
|
|
1587
1615
|
rowIndex: e.r1,
|
|
1588
1616
|
columnIndex: e.c1,
|
|
1589
|
-
left:
|
|
1590
|
-
top:
|
|
1591
|
-
width:
|
|
1592
|
-
height:
|
|
1617
|
+
left: d,
|
|
1618
|
+
top: l,
|
|
1619
|
+
width: u,
|
|
1620
|
+
height: p,
|
|
1593
1621
|
parent: i,
|
|
1594
|
-
cellSelected:
|
|
1622
|
+
cellSelected: g,
|
|
1595
1623
|
lastRowOfModel: !0,
|
|
1596
1624
|
gammaRange: e.gammaRange
|
|
1597
1625
|
}) : this.renderCell({
|
|
1598
|
-
areaModel:
|
|
1599
|
-
areaIdent:
|
|
1600
|
-
sideIdent:
|
|
1626
|
+
areaModel: o,
|
|
1627
|
+
areaIdent: o.areaIdent,
|
|
1628
|
+
sideIdent: a,
|
|
1601
1629
|
rowIndex: e.r1,
|
|
1602
1630
|
columnIndex: e.c1,
|
|
1603
|
-
left:
|
|
1604
|
-
top:
|
|
1605
|
-
width:
|
|
1606
|
-
height:
|
|
1631
|
+
left: d,
|
|
1632
|
+
top: l,
|
|
1633
|
+
width: u,
|
|
1634
|
+
height: p,
|
|
1607
1635
|
parent: i,
|
|
1608
|
-
cellSelected:
|
|
1636
|
+
cellSelected: g,
|
|
1609
1637
|
lastRowOfModel: !0,
|
|
1610
1638
|
gammaRange: e.gammaRange
|
|
1611
|
-
}),
|
|
1639
|
+
}), o.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1612
1640
|
rowIndex: e.r1,
|
|
1613
1641
|
columnIndex: e.c1,
|
|
1614
|
-
cellLeft:
|
|
1615
|
-
cellTop:
|
|
1616
|
-
cellWidth:
|
|
1617
|
-
cellHeight:
|
|
1642
|
+
cellLeft: d,
|
|
1643
|
+
cellTop: l,
|
|
1644
|
+
cellWidth: u,
|
|
1645
|
+
cellHeight: p,
|
|
1618
1646
|
parent: i
|
|
1619
1647
|
});
|
|
1620
1648
|
}
|
|
@@ -1627,13 +1655,13 @@ class Qe extends qe {
|
|
|
1627
1655
|
* @returns {number} - The row index of the important rowspan cell, or -1 if not found.
|
|
1628
1656
|
* @protected
|
|
1629
1657
|
*/
|
|
1630
|
-
findRowOfImportantRowspanCell(e, t,
|
|
1631
|
-
const
|
|
1658
|
+
findRowOfImportantRowspanCell(e, t, s) {
|
|
1659
|
+
const o = e.getMaxRowspan();
|
|
1632
1660
|
for (let i = t - 1; i > -1; i--) {
|
|
1633
|
-
const
|
|
1634
|
-
if (
|
|
1661
|
+
const a = e.getRowspanAt(i, s);
|
|
1662
|
+
if (a > 1 && i + a + 1 >= t)
|
|
1635
1663
|
return i;
|
|
1636
|
-
if (t - i >
|
|
1664
|
+
if (t - i > o)
|
|
1637
1665
|
return -1;
|
|
1638
1666
|
}
|
|
1639
1667
|
return -1;
|
|
@@ -1648,68 +1676,68 @@ class Qe extends qe {
|
|
|
1648
1676
|
adjustColumnsToRowParent({
|
|
1649
1677
|
areaIdent: e,
|
|
1650
1678
|
sideIdent: t,
|
|
1651
|
-
areaModel:
|
|
1652
|
-
geo:
|
|
1679
|
+
areaModel: s,
|
|
1680
|
+
geo: o,
|
|
1653
1681
|
parent: i,
|
|
1654
|
-
rowIndex:
|
|
1655
|
-
columnIndexStart:
|
|
1656
|
-
columnIndexEnd:
|
|
1657
|
-
verticalFixed:
|
|
1658
|
-
lastRowOfModel:
|
|
1682
|
+
rowIndex: a,
|
|
1683
|
+
columnIndexStart: l,
|
|
1684
|
+
columnIndexEnd: r,
|
|
1685
|
+
verticalFixed: c = !1,
|
|
1686
|
+
lastRowOfModel: h = !1
|
|
1659
1687
|
}) {
|
|
1660
|
-
var
|
|
1688
|
+
var b;
|
|
1661
1689
|
this.scrollViewportLeft = this.scrollViewport.scrollLeft;
|
|
1662
|
-
let
|
|
1663
|
-
if (!
|
|
1664
|
-
const
|
|
1665
|
-
|
|
1690
|
+
let d = 0;
|
|
1691
|
+
if (!c) {
|
|
1692
|
+
const f = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1693
|
+
d = this.scrollFactorX * f;
|
|
1666
1694
|
}
|
|
1667
|
-
const
|
|
1668
|
-
let
|
|
1669
|
-
for (let
|
|
1670
|
-
const
|
|
1671
|
-
if (
|
|
1672
|
-
let
|
|
1673
|
-
const
|
|
1674
|
-
|
|
1675
|
-
let
|
|
1676
|
-
y > 1 && (
|
|
1677
|
-
let
|
|
1678
|
-
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (
|
|
1679
|
-
this.renderDragTargetDiv(i,
|
|
1680
|
-
const A = { left:
|
|
1695
|
+
const p = 0, u = !!(e === "body" && t);
|
|
1696
|
+
let g = d;
|
|
1697
|
+
for (let f = l; f <= r; f++) {
|
|
1698
|
+
const m = g, x = this.tableModel.getColumnWidth(f);
|
|
1699
|
+
if (x > 0 && m + x > 0) {
|
|
1700
|
+
let v = o.height;
|
|
1701
|
+
const w = s.getRowspanAt(a, f), y = s.getColspanAt(a, f);
|
|
1702
|
+
w > 1 && (v = this.getRowHeights(a, a + w - 1, s).reduce((A, M) => A + M, 0));
|
|
1703
|
+
let S = x;
|
|
1704
|
+
y > 1 && (S = this.getColumnWidths(f, f + y - 1).reduce((A, M) => A + M, 0));
|
|
1705
|
+
let T = !1;
|
|
1706
|
+
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (b = this.colAndRowspanModels[e]) != null && b.isInRange(a, f) && (T = !0), this.draggingTargetColumnIndex === f && e !== "header") {
|
|
1707
|
+
this.renderDragTargetDiv(i, m, p, S, v);
|
|
1708
|
+
const A = { left: m, top: p, width: S, height: v };
|
|
1681
1709
|
this.dom.addColumnBorderDivs(this.tableOptions, i, A, e, t);
|
|
1682
1710
|
} else {
|
|
1683
|
-
const A = this.renderSelectedBackgroundDiv(
|
|
1684
|
-
"gammaCells" in
|
|
1685
|
-
areaModel:
|
|
1711
|
+
const A = this.renderSelectedBackgroundDiv(T, u, t, s, a, f, i, m, p, S, v);
|
|
1712
|
+
"gammaCells" in s && s.getValueAt(a, f) && (T = !1), T || this.renderCell({
|
|
1713
|
+
areaModel: s,
|
|
1686
1714
|
areaIdent: e,
|
|
1687
1715
|
sideIdent: t,
|
|
1688
|
-
rowIndex:
|
|
1689
|
-
columnIndex:
|
|
1690
|
-
left:
|
|
1691
|
-
top:
|
|
1692
|
-
width:
|
|
1693
|
-
height:
|
|
1716
|
+
rowIndex: a,
|
|
1717
|
+
columnIndex: f,
|
|
1718
|
+
left: m,
|
|
1719
|
+
top: p,
|
|
1720
|
+
width: S,
|
|
1721
|
+
height: v,
|
|
1694
1722
|
parent: i,
|
|
1695
1723
|
cellSelected: A,
|
|
1696
|
-
lastRowOfModel:
|
|
1724
|
+
lastRowOfModel: h,
|
|
1697
1725
|
gammaRange: !0
|
|
1698
1726
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1699
|
-
rowIndex:
|
|
1700
|
-
columnIndex:
|
|
1701
|
-
cellLeft:
|
|
1702
|
-
cellTop:
|
|
1703
|
-
cellWidth:
|
|
1704
|
-
cellHeight:
|
|
1727
|
+
rowIndex: a,
|
|
1728
|
+
columnIndex: f,
|
|
1729
|
+
cellLeft: m,
|
|
1730
|
+
cellTop: p,
|
|
1731
|
+
cellWidth: S,
|
|
1732
|
+
cellHeight: v,
|
|
1705
1733
|
parent: i
|
|
1706
1734
|
});
|
|
1707
1735
|
}
|
|
1708
1736
|
}
|
|
1709
|
-
if (
|
|
1737
|
+
if (g = g + x, g > this.areaBodyCenterGeo.width)
|
|
1710
1738
|
break;
|
|
1711
1739
|
}
|
|
1712
|
-
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new
|
|
1740
|
+
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new R(g - 1, 1, o.height, 0), i);
|
|
1713
1741
|
}
|
|
1714
1742
|
/**
|
|
1715
1743
|
* Retrieves the column index of the tree arrow column in the table.
|
|
@@ -1726,59 +1754,59 @@ class Qe extends qe {
|
|
|
1726
1754
|
addAndRenderCellDiv({
|
|
1727
1755
|
areaModel: e,
|
|
1728
1756
|
areaIdent: t,
|
|
1729
|
-
sideIdent:
|
|
1730
|
-
rowIndex:
|
|
1757
|
+
sideIdent: s,
|
|
1758
|
+
rowIndex: o,
|
|
1731
1759
|
index: i,
|
|
1732
|
-
left:
|
|
1733
|
-
width:
|
|
1734
|
-
height:
|
|
1735
|
-
top:
|
|
1736
|
-
parent:
|
|
1737
|
-
lastRowOfModel:
|
|
1760
|
+
left: a,
|
|
1761
|
+
width: l,
|
|
1762
|
+
height: r,
|
|
1763
|
+
top: c,
|
|
1764
|
+
parent: h,
|
|
1765
|
+
lastRowOfModel: d
|
|
1738
1766
|
}) {
|
|
1739
|
-
var
|
|
1740
|
-
const
|
|
1741
|
-
let
|
|
1742
|
-
if (i === this.getTreeArrowColumnIndex() &&
|
|
1743
|
-
const C =
|
|
1744
|
-
(
|
|
1767
|
+
var oe;
|
|
1768
|
+
const u = this.editorRenderer && this.editorRendererRow === o && this.editorRendererColumn === i ? this.editorRenderer : e.getCellRenderer(o, i), g = { left: a, width: l, height: r, top: c, index: i }, b = e.getRowByIndex(o);
|
|
1769
|
+
let f = "none";
|
|
1770
|
+
if (i === this.getTreeArrowColumnIndex() && Y(b)) {
|
|
1771
|
+
const C = b;
|
|
1772
|
+
(oe = C.children) != null && oe.length ? C.expanded ? f = "expanded" : f = "collapsed" : f = "hidden";
|
|
1745
1773
|
}
|
|
1746
|
-
let
|
|
1774
|
+
let x;
|
|
1747
1775
|
if (t === "header") {
|
|
1748
1776
|
const C = this.tableModel.getColumnDef(i);
|
|
1749
|
-
(!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (
|
|
1777
|
+
(!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (x = C == null ? void 0 : C.sortState);
|
|
1750
1778
|
}
|
|
1751
|
-
const
|
|
1779
|
+
const v = e.getValueAt(o, i), w = u ? "" : `${v}`, y = e.isRowChecked(o), S = this.dom.addColumnDiv(
|
|
1752
1780
|
{
|
|
1753
|
-
parent:
|
|
1754
|
-
geo:
|
|
1755
|
-
rowIndex:
|
|
1781
|
+
parent: h,
|
|
1782
|
+
geo: g,
|
|
1783
|
+
rowIndex: o,
|
|
1756
1784
|
columnIndex: i,
|
|
1757
1785
|
areaIdent: t,
|
|
1758
|
-
sideIdent:
|
|
1759
|
-
text:
|
|
1760
|
-
treeArrow:
|
|
1786
|
+
sideIdent: s,
|
|
1787
|
+
text: w,
|
|
1788
|
+
treeArrow: f,
|
|
1761
1789
|
tableOptions: this.tableOptions,
|
|
1762
1790
|
checkedType: y,
|
|
1763
|
-
sortState:
|
|
1791
|
+
sortState: x
|
|
1764
1792
|
}
|
|
1765
|
-
),
|
|
1766
|
-
|
|
1793
|
+
), T = e.getTooltipAt(o, i);
|
|
1794
|
+
T && this.dom.setAttribute(S, "title", T);
|
|
1767
1795
|
const A = this.tableModel.getColumnDef(i);
|
|
1768
|
-
A && A.classes[t] && this.dom.addClasses(A.classes[t],
|
|
1796
|
+
A && A.classes[t] && this.dom.addClasses(A.classes[t], S);
|
|
1769
1797
|
let M;
|
|
1770
|
-
|
|
1771
|
-
const
|
|
1772
|
-
if (
|
|
1798
|
+
u && (M = u.render(S, o, i, t, e, v, this.dom.domService));
|
|
1799
|
+
const H = e.getCustomClassesAt(o, i);
|
|
1800
|
+
if (H.length && this.dom.addClasses(H, S), this.dom.addColumnBorderDivs(this.tableOptions, h, g, t, s), d && this.dom.addHorizontalBorder({ left: a, width: l, height: r, top: c + r }, h), this.getFocusModel && t === "body") {
|
|
1773
1801
|
const C = this.getFocusModel();
|
|
1774
|
-
C != null && C.hasFocus(
|
|
1802
|
+
C != null && C.hasFocus(o, i) && this.dom.addFocusBorderDivs(h, g, {});
|
|
1775
1803
|
}
|
|
1776
|
-
t === "header" && this.dom.setAttribute(
|
|
1777
|
-
const
|
|
1778
|
-
if (
|
|
1779
|
-
for (const C in
|
|
1780
|
-
this.dom.setStyle(
|
|
1781
|
-
return [
|
|
1804
|
+
t === "header" && this.dom.setAttribute(S, "data-ge-action", "drag-column");
|
|
1805
|
+
const N = e.getCustomStyleAt(o, i);
|
|
1806
|
+
if (N)
|
|
1807
|
+
for (const C in N)
|
|
1808
|
+
this.dom.setStyle(S, C, N[C]);
|
|
1809
|
+
return [S, M];
|
|
1782
1810
|
}
|
|
1783
1811
|
/**
|
|
1784
1812
|
* Applies CSS classes to an HTML element.
|
|
@@ -1788,8 +1816,8 @@ class Qe extends qe {
|
|
|
1788
1816
|
* @protected
|
|
1789
1817
|
*/
|
|
1790
1818
|
applyCssClasses(e, t = {}) {
|
|
1791
|
-
e && Object.entries(t).forEach(([
|
|
1792
|
-
|
|
1819
|
+
e && Object.entries(t).forEach(([s, o]) => {
|
|
1820
|
+
o ? this.dom.addClass(s, e) : this.dom.removeClass(s, e);
|
|
1793
1821
|
});
|
|
1794
1822
|
}
|
|
1795
1823
|
/**
|
|
@@ -1801,10 +1829,10 @@ class Qe extends qe {
|
|
|
1801
1829
|
* @return {number[]} An array containing the widths of the columns within the specified range.
|
|
1802
1830
|
*/
|
|
1803
1831
|
getColumnWidths(e, t) {
|
|
1804
|
-
const
|
|
1805
|
-
for (let
|
|
1806
|
-
|
|
1807
|
-
return
|
|
1832
|
+
const s = [];
|
|
1833
|
+
for (let o = e; o <= t; o++)
|
|
1834
|
+
s.push(this.tableModel.getColumnWidth(o));
|
|
1835
|
+
return s;
|
|
1808
1836
|
}
|
|
1809
1837
|
/**
|
|
1810
1838
|
* Retrieves the heights of rows within a specified range.
|
|
@@ -1814,11 +1842,11 @@ class Qe extends qe {
|
|
|
1814
1842
|
* @param {AreaModelIf} areaModel - The area model.
|
|
1815
1843
|
* @return {number[]} - An array containing the heights of the rows within the specified range.
|
|
1816
1844
|
*/
|
|
1817
|
-
getRowHeights(e, t,
|
|
1818
|
-
const
|
|
1845
|
+
getRowHeights(e, t, s) {
|
|
1846
|
+
const o = [];
|
|
1819
1847
|
for (let i = e; i <= t; i++)
|
|
1820
|
-
|
|
1821
|
-
return
|
|
1848
|
+
o.push(s.getRowHeight(i));
|
|
1849
|
+
return o;
|
|
1822
1850
|
}
|
|
1823
1851
|
/**
|
|
1824
1852
|
* Adjusts the position and size of the hover row based on the mouse move event.
|
|
@@ -1829,12 +1857,12 @@ class Qe extends qe {
|
|
|
1829
1857
|
*/
|
|
1830
1858
|
adjustHoverRows(e) {
|
|
1831
1859
|
if (this.tableOptions.hoverRowVisible && e.rowIndex > -1) {
|
|
1832
|
-
const t = this.hostElement.clientWidth,
|
|
1860
|
+
const t = this.hostElement.clientWidth, s = this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex), o = e.rowTop + this.areaHeaderCenter.parent.clientHeight - this.scrollTop;
|
|
1833
1861
|
this.dom.applyStyle(this.hoverRow, {
|
|
1834
1862
|
left: "0",
|
|
1835
|
-
top:
|
|
1863
|
+
top: o + "px",
|
|
1836
1864
|
width: t + "px",
|
|
1837
|
-
height:
|
|
1865
|
+
height: s + "px",
|
|
1838
1866
|
display: "block"
|
|
1839
1867
|
});
|
|
1840
1868
|
} else
|
|
@@ -1862,11 +1890,11 @@ class Qe extends qe {
|
|
|
1862
1890
|
*/
|
|
1863
1891
|
adjustHoverColumns(e) {
|
|
1864
1892
|
if (this.tableOptions.hoverColumnVisible && e.rowIndex > -1) {
|
|
1865
|
-
const t = this.hostElement.clientHeight,
|
|
1893
|
+
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;
|
|
1866
1894
|
this.dom.applyStyle(this.hoverColumn, {
|
|
1867
1895
|
left: i + "px",
|
|
1868
1896
|
top: "0px",
|
|
1869
|
-
width:
|
|
1897
|
+
width: s + "px",
|
|
1870
1898
|
height: t + "px",
|
|
1871
1899
|
display: "block"
|
|
1872
1900
|
});
|
|
@@ -1905,17 +1933,17 @@ class Qe extends qe {
|
|
|
1905
1933
|
* @param {number} sourceColumnIndex - The index of the source column.
|
|
1906
1934
|
* @param {boolean} firstDraggingRendering - Indicates if it's the first rendering of the dragging column.
|
|
1907
1935
|
*/
|
|
1908
|
-
adjustDraggingColumn(e, t,
|
|
1909
|
-
var
|
|
1936
|
+
adjustDraggingColumn(e, t, s) {
|
|
1937
|
+
var o, i;
|
|
1910
1938
|
if (this.dragging) {
|
|
1911
|
-
const
|
|
1912
|
-
if ((
|
|
1913
|
-
const
|
|
1939
|
+
const a = this.hostElement.clientHeight, l = this.storedColumnWidths[t];
|
|
1940
|
+
if ((o = e.originalEvent) != null && o.clientX) {
|
|
1941
|
+
const h = { left: ((i = e.originalEvent) == null ? void 0 : i.clientX) - l / 2, width: l, height: a, top: 0, index: t };
|
|
1914
1942
|
this.dom.applyStyle(this.draggingColumn, {
|
|
1915
1943
|
background: "rgba(128,128,128,0.2)",
|
|
1916
1944
|
display: "block",
|
|
1917
1945
|
overfllow: "clip"
|
|
1918
|
-
}), this.dom.applyStyleInPx(this.draggingColumn,
|
|
1946
|
+
}), this.dom.applyStyleInPx(this.draggingColumn, h), s && this.renderContentOfDraggingColumn(h);
|
|
1919
1947
|
}
|
|
1920
1948
|
} else
|
|
1921
1949
|
this.hideDraggingColumn();
|
|
@@ -1939,34 +1967,34 @@ class Qe extends qe {
|
|
|
1939
1967
|
* @param {number} [y=0] - The starting y-position.
|
|
1940
1968
|
* @return {number} The final y-position after rendering all the content.
|
|
1941
1969
|
*/
|
|
1942
|
-
renderContentOfDraggingColumnForArea(e, t,
|
|
1943
|
-
const
|
|
1944
|
-
if (
|
|
1945
|
-
const
|
|
1946
|
-
for (let
|
|
1947
|
-
const
|
|
1948
|
-
parent:
|
|
1949
|
-
geo:
|
|
1950
|
-
rowIndex:
|
|
1951
|
-
columnIndex:
|
|
1970
|
+
renderContentOfDraggingColumnForArea(e, t, s = 0) {
|
|
1971
|
+
const o = "center", i = this.tableModel.getAreaModel(t), a = i == null ? void 0 : i.getRowCount();
|
|
1972
|
+
if (a) {
|
|
1973
|
+
const l = e.index ?? 0, r = this.draggingColumn;
|
|
1974
|
+
for (let c = 0; c < a; c++) {
|
|
1975
|
+
const h = s, d = i.getRowHeight(c), p = { left: 0, width: e.width, height: d, top: h, index: c }, u = i.getValueAt(c, l), g = i.getCellRenderer(c, l), b = g ? "" : `${u}`, f = {
|
|
1976
|
+
parent: r,
|
|
1977
|
+
geo: p,
|
|
1978
|
+
rowIndex: c,
|
|
1979
|
+
columnIndex: l,
|
|
1952
1980
|
areaIdent: t,
|
|
1953
|
-
sideIdent:
|
|
1954
|
-
text:
|
|
1955
|
-
},
|
|
1956
|
-
let
|
|
1957
|
-
|
|
1958
|
-
const
|
|
1959
|
-
|
|
1960
|
-
const
|
|
1961
|
-
|
|
1962
|
-
const y = i.getCustomStyleAt(
|
|
1981
|
+
sideIdent: o,
|
|
1982
|
+
text: b
|
|
1983
|
+
}, m = this.dom.addColumnDiv(f);
|
|
1984
|
+
let x;
|
|
1985
|
+
g && (x = g.render(m, c, l, t, i, u, this.dom.domService), x && this.cleanupFunctions[t].push(x));
|
|
1986
|
+
const v = i.getCustomClassesAt(c, l);
|
|
1987
|
+
v.length && this.dom.addClasses(v, m);
|
|
1988
|
+
const w = this.tableModel.getColumnDef(l);
|
|
1989
|
+
w && w.classes[t] && this.dom.addClasses(w.classes[t], m), this.dom.addColumnBorderDivs(this.tableOptions, r, p, t, o);
|
|
1990
|
+
const y = i.getCustomStyleAt(c, l);
|
|
1963
1991
|
if (y)
|
|
1964
|
-
for (const
|
|
1965
|
-
this.dom.setStyle(
|
|
1966
|
-
|
|
1992
|
+
for (const S in y)
|
|
1993
|
+
this.dom.setStyle(m, S, y[S]);
|
|
1994
|
+
s = s + d;
|
|
1967
1995
|
}
|
|
1968
1996
|
}
|
|
1969
|
-
return
|
|
1997
|
+
return s;
|
|
1970
1998
|
}
|
|
1971
1999
|
/**
|
|
1972
2000
|
* Hides the dragging column by applying a 'display: none' style to it.
|
|
@@ -1989,11 +2017,11 @@ class Qe extends qe {
|
|
|
1989
2017
|
* @param {number} height - The height of the target div in pixels.
|
|
1990
2018
|
* @return {HTMLDivElement} - The rendered draggable target div element.
|
|
1991
2019
|
*/
|
|
1992
|
-
renderDragTargetDiv(e, t,
|
|
1993
|
-
const
|
|
2020
|
+
renderDragTargetDiv(e, t, s, o, i) {
|
|
2021
|
+
const a = this.dom.applyStylePosistionAbsolute(
|
|
1994
2022
|
this.dom.createDivWithClass("ge-table-drop-zone", e)
|
|
1995
2023
|
);
|
|
1996
|
-
return this.dom.setStyle(
|
|
2024
|
+
return this.dom.setStyle(a, "left", `${t}px`), this.dom.setStyle(a, "top", `${s}px`), this.dom.setStyle(a, "width", `${o}px`), this.dom.setStyle(a, "height", `${i}px`), a;
|
|
1997
2025
|
}
|
|
1998
2026
|
/**
|
|
1999
2027
|
* Render selected background div.
|
|
@@ -2012,23 +2040,23 @@ class Qe extends qe {
|
|
|
2012
2040
|
* @param {number} height - The height of the div.
|
|
2013
2041
|
* @returns {boolean} - Whether the cell is selected.
|
|
2014
2042
|
*/
|
|
2015
|
-
renderSelectedBackgroundDiv(e, t,
|
|
2016
|
-
let
|
|
2017
|
-
if (!e && t &&
|
|
2018
|
-
const
|
|
2019
|
-
if (
|
|
2020
|
-
const
|
|
2021
|
-
|
|
2022
|
-
for (let
|
|
2023
|
-
const
|
|
2043
|
+
renderSelectedBackgroundDiv(e, t, s, o, i, a, l, r, c, h, d) {
|
|
2044
|
+
let p = !1;
|
|
2045
|
+
if (!e && t && o.isSelectable(i, a) && this.getSelectionModel) {
|
|
2046
|
+
const u = this.getSelectionModel();
|
|
2047
|
+
if (u) {
|
|
2048
|
+
const g = u.getSelectionCount(i, a);
|
|
2049
|
+
p = g > 0;
|
|
2050
|
+
for (let b = 0; b < g; b++) {
|
|
2051
|
+
const f = this.dom.applyStylePosistionAbsolute(
|
|
2024
2052
|
// ge-table-body-west-selected-range
|
|
2025
|
-
this.dom.createDivWithClass(`ge-table-${
|
|
2053
|
+
this.dom.createDivWithClass(`ge-table-${o.areaIdent}-${s}-selected-range`, l)
|
|
2026
2054
|
);
|
|
2027
|
-
this.dom.setStyle(
|
|
2055
|
+
this.dom.setStyle(f, "left", `${r}px`), this.dom.setStyle(f, "top", `${c}px`), this.dom.setStyle(f, "width", `${h}px`), this.dom.setStyle(f, "height", `${d}px`);
|
|
2028
2056
|
}
|
|
2029
2057
|
}
|
|
2030
2058
|
}
|
|
2031
|
-
return
|
|
2059
|
+
return p;
|
|
2032
2060
|
}
|
|
2033
2061
|
/**
|
|
2034
2062
|
* Renders a cell in the grid.
|
|
@@ -2052,31 +2080,31 @@ class Qe extends qe {
|
|
|
2052
2080
|
renderCell({
|
|
2053
2081
|
areaModel: e,
|
|
2054
2082
|
areaIdent: t,
|
|
2055
|
-
sideIdent:
|
|
2056
|
-
rowIndex:
|
|
2083
|
+
sideIdent: s,
|
|
2084
|
+
rowIndex: o,
|
|
2057
2085
|
columnIndex: i,
|
|
2058
|
-
left:
|
|
2059
|
-
top:
|
|
2060
|
-
width:
|
|
2061
|
-
height:
|
|
2062
|
-
parent:
|
|
2063
|
-
cellSelected:
|
|
2064
|
-
lastRowOfModel:
|
|
2086
|
+
left: a,
|
|
2087
|
+
top: l,
|
|
2088
|
+
width: r,
|
|
2089
|
+
height: c,
|
|
2090
|
+
parent: h,
|
|
2091
|
+
cellSelected: d,
|
|
2092
|
+
lastRowOfModel: p
|
|
2065
2093
|
}) {
|
|
2066
|
-
const [
|
|
2094
|
+
const [u, g] = this.addAndRenderCellDiv({
|
|
2067
2095
|
areaModel: e,
|
|
2068
2096
|
areaIdent: t,
|
|
2069
|
-
sideIdent:
|
|
2070
|
-
rowIndex:
|
|
2097
|
+
sideIdent: s,
|
|
2098
|
+
rowIndex: o,
|
|
2071
2099
|
index: i,
|
|
2072
|
-
left:
|
|
2073
|
-
width:
|
|
2074
|
-
height:
|
|
2075
|
-
top:
|
|
2076
|
-
parent:
|
|
2077
|
-
lastRowOfModel:
|
|
2100
|
+
left: a,
|
|
2101
|
+
width: r,
|
|
2102
|
+
height: c,
|
|
2103
|
+
top: l,
|
|
2104
|
+
parent: h,
|
|
2105
|
+
lastRowOfModel: p
|
|
2078
2106
|
});
|
|
2079
|
-
|
|
2107
|
+
d && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, u), g && this.cleanupFunctions[t].push(g);
|
|
2080
2108
|
}
|
|
2081
2109
|
/**
|
|
2082
2110
|
* Render the header cell resize handle.
|
|
@@ -2092,12 +2120,12 @@ class Qe extends qe {
|
|
|
2092
2120
|
*
|
|
2093
2121
|
* @return {void}
|
|
2094
2122
|
*/
|
|
2095
|
-
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft:
|
|
2096
|
-
const
|
|
2097
|
-
|
|
2123
|
+
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: o, cellWidth: i, cellHeight: a, parent: l }) {
|
|
2124
|
+
const r = this.dom.domService, c = this.tableOptions.columnResizeHandleWidthInPx ?? 2, h = r.createElement("div");
|
|
2125
|
+
r.setAttribute(h, "data-col-index", `${t}`), r.setAttribute(h, "data-row-index", `${e}`), r.setAttribute(h, "data-area", "header"), r.setAttribute(h, "data-ge-action", "resize-column"), r.addClass(h, "ge-table-column-resize-handle"), r.setStyle(h, "display", "clip"), r.setStyle(h, "position", "absolute"), r.setStyle(h, "cursor", "col-resize"), r.setStyle(h, "left", `${s + i - c}px`), r.setStyle(h, "top", `${o}px`), r.setStyle(h, "width", `${c}px`), r.setStyle(h, "height", `${a}px`), r.appendChild(l, h);
|
|
2098
2126
|
}
|
|
2099
2127
|
}
|
|
2100
|
-
class
|
|
2128
|
+
class Qe {
|
|
2101
2129
|
constructor(e, t) {
|
|
2102
2130
|
this.columnIndex = e, this.sortState = t;
|
|
2103
2131
|
}
|
|
@@ -2116,10 +2144,10 @@ class et {
|
|
|
2116
2144
|
*/
|
|
2117
2145
|
onHostElementChanged(e) {
|
|
2118
2146
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
2119
|
-
const t = e.target,
|
|
2120
|
-
if (
|
|
2121
|
-
const
|
|
2122
|
-
this.tableScope.updateModelValueAfterEdit(
|
|
2147
|
+
const t = e.target, s = t.getAttribute("data-area"), o = t.getAttribute("data-row-index"), i = t.getAttribute("data-col-index");
|
|
2148
|
+
if (s && o && i) {
|
|
2149
|
+
const a = Q(s), l = Number(o), r = Number(i);
|
|
2150
|
+
this.tableScope.updateModelValueAfterEdit(a, l, r, t.value);
|
|
2123
2151
|
}
|
|
2124
2152
|
}
|
|
2125
2153
|
}
|
|
@@ -2137,31 +2165,31 @@ class te {
|
|
|
2137
2165
|
return new te([new tt(e, t)]);
|
|
2138
2166
|
}
|
|
2139
2167
|
}
|
|
2140
|
-
class
|
|
2168
|
+
class st {
|
|
2141
2169
|
constructor(e) {
|
|
2142
|
-
var t,
|
|
2143
|
-
this.tableScope = e, (t = this.tableScope.tableOptions) != null && t.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), (
|
|
2170
|
+
var t, s;
|
|
2171
|
+
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);
|
|
2144
2172
|
}
|
|
2145
2173
|
onMouseClicked(e, t) {
|
|
2146
|
-
var i,
|
|
2147
|
-
let
|
|
2174
|
+
var i, a, l, r, c, h, d;
|
|
2175
|
+
let s = !1, o = !1;
|
|
2148
2176
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
2149
|
-
const
|
|
2150
|
-
|
|
2177
|
+
const p = this.getSelectionModel(), u = this.getFocusModel();
|
|
2178
|
+
p && u && (u.hasFocus(e.rowIndex, e.columnIndex) || (u.setFocus(e.rowIndex, e.columnIndex), this.tableScope.onFocusChanged(u), s = !0), (i = e.originalEvent) != null && i.shiftKey || p.hasSelection() && (p.clear(), s = !0), (a = e.originalEvent) != null && a.shiftKey && this.previousEvt ? (p.addSelection(this.createRangeByEvents(e, this.previousEvt)), o = !0, s = !0) : (l = e.originalEvent) != null && l.altKey && ((r = e.originalEvent) != null && r.ctrlKey || (c = e.originalEvent) != null && c.metaKey) ? (p.removeSelection(E.singleCell(e.rowIndex, e.columnIndex)), o = !0, s = !0) : (h = e.originalEvent) != null && h.ctrlKey || (d = e.originalEvent) != null && d.metaKey ? (p.addSelection(E.singleCell(e.rowIndex, e.columnIndex)), o = !0, s = !0) : (p.firstClick(e.rowIndex, e.columnIndex), s = !0), this.tableScope.onSelectionChanged(p));
|
|
2151
2179
|
}
|
|
2152
|
-
return
|
|
2180
|
+
return o ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
2153
2181
|
}
|
|
2154
2182
|
onActionTriggered(e) {
|
|
2155
2183
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
2156
|
-
const t = this.getSelectionModel(),
|
|
2157
|
-
if (t &&
|
|
2184
|
+
const t = this.getSelectionModel(), s = this.getFocusModel();
|
|
2185
|
+
if (t && s) {
|
|
2158
2186
|
if (e === "SELECT_ALL")
|
|
2159
2187
|
return t.selectAll(), this.tableScope.repaint(), !0;
|
|
2160
2188
|
if (e === "DESELECT_ALL")
|
|
2161
2189
|
return t.clear(), this.tableScope.repaint(), !0;
|
|
2162
2190
|
if (e === "TOGGLE_SELECTION") {
|
|
2163
|
-
const [
|
|
2164
|
-
return t.togglePoint(
|
|
2191
|
+
const [o, i] = s.getFocus();
|
|
2192
|
+
return t.togglePoint(o, i), this.tableScope.repaint(), !0;
|
|
2165
2193
|
}
|
|
2166
2194
|
}
|
|
2167
2195
|
}
|
|
@@ -2169,16 +2197,16 @@ class ot {
|
|
|
2169
2197
|
}
|
|
2170
2198
|
createRangeByEvents(e, t) {
|
|
2171
2199
|
t || (t = e);
|
|
2172
|
-
const
|
|
2200
|
+
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), a = Math.max(e.columnIndex, t == null ? void 0 : t.columnIndex);
|
|
2173
2201
|
return E.create({
|
|
2174
|
-
rowIndex1:
|
|
2202
|
+
rowIndex1: s,
|
|
2175
2203
|
columnIndex1: i,
|
|
2176
|
-
rowIndex2:
|
|
2177
|
-
columnIndex2:
|
|
2204
|
+
rowIndex2: o,
|
|
2205
|
+
columnIndex2: a
|
|
2178
2206
|
});
|
|
2179
2207
|
}
|
|
2180
2208
|
}
|
|
2181
|
-
class
|
|
2209
|
+
class ot {
|
|
2182
2210
|
get() {
|
|
2183
2211
|
return {
|
|
2184
2212
|
f2: "START_EDITING",
|
|
@@ -2220,7 +2248,7 @@ class it {
|
|
|
2220
2248
|
};
|
|
2221
2249
|
}
|
|
2222
2250
|
}
|
|
2223
|
-
class
|
|
2251
|
+
class at {
|
|
2224
2252
|
constructor(e) {
|
|
2225
2253
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
2226
2254
|
}
|
|
@@ -2241,7 +2269,7 @@ class rt {
|
|
|
2241
2269
|
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));
|
|
2242
2270
|
}
|
|
2243
2271
|
assignPredefinedSystemShortcutMappings() {
|
|
2244
|
-
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new it().get()) : Object.assign(this.shortcutActionIdMapping, new
|
|
2272
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new it().get()) : Object.assign(this.shortcutActionIdMapping, new ot().get());
|
|
2245
2273
|
}
|
|
2246
2274
|
isMacintosh() {
|
|
2247
2275
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -2259,24 +2287,24 @@ class rt {
|
|
|
2259
2287
|
emit(e) {
|
|
2260
2288
|
this.isDebug() && console.debug("ShortcutService emit :", e);
|
|
2261
2289
|
let t = !1;
|
|
2262
|
-
for (const
|
|
2263
|
-
|
|
2290
|
+
for (const s of this.listener)
|
|
2291
|
+
s.onActionTriggered(e) && (t = !0);
|
|
2264
2292
|
return t;
|
|
2265
2293
|
}
|
|
2266
2294
|
findEntity(e) {
|
|
2267
2295
|
const t = this.getTokenByEvent(e);
|
|
2268
2296
|
this.isDebug() && console.debug("ShortcutService tokens :", t);
|
|
2269
|
-
for (const
|
|
2270
|
-
const
|
|
2271
|
-
if (this.areTokensEquals(t,
|
|
2272
|
-
return this.shortcutActionIdMapping[
|
|
2297
|
+
for (const s in this.shortcutActionIdMapping) {
|
|
2298
|
+
const o = s.replace(/opt/g, "alt").replace(/cmd/g, "meta").split(/[+ ]/g).sort();
|
|
2299
|
+
if (this.areTokensEquals(t, o))
|
|
2300
|
+
return this.shortcutActionIdMapping[s];
|
|
2273
2301
|
}
|
|
2274
2302
|
}
|
|
2275
2303
|
areTokensEquals(e, t) {
|
|
2276
2304
|
if (e.length !== t.length || e.length === 0)
|
|
2277
2305
|
return !1;
|
|
2278
|
-
for (let
|
|
2279
|
-
if (e[
|
|
2306
|
+
for (let s = 0; s < e.length; s++)
|
|
2307
|
+
if (e[s] !== t[s])
|
|
2280
2308
|
return !1;
|
|
2281
2309
|
return !0;
|
|
2282
2310
|
}
|
|
@@ -2293,7 +2321,7 @@ class rt {
|
|
|
2293
2321
|
return this.shortcutActionIdMapping;
|
|
2294
2322
|
}
|
|
2295
2323
|
}
|
|
2296
|
-
class
|
|
2324
|
+
class re {
|
|
2297
2325
|
onCheckboxChanged(e) {
|
|
2298
2326
|
}
|
|
2299
2327
|
onContextmenu(e) {
|
|
@@ -2313,19 +2341,19 @@ class le {
|
|
|
2313
2341
|
onFocusChanged(e) {
|
|
2314
2342
|
}
|
|
2315
2343
|
}
|
|
2316
|
-
class
|
|
2317
|
-
setStyle(e, t,
|
|
2318
|
-
return e.style[t] =
|
|
2344
|
+
class ue {
|
|
2345
|
+
setStyle(e, t, s) {
|
|
2346
|
+
return e.style[t] = s, e;
|
|
2319
2347
|
}
|
|
2320
2348
|
appendText(e, t) {
|
|
2321
|
-
const
|
|
2322
|
-
return this.appendChild(e,
|
|
2349
|
+
const s = this.createText(t);
|
|
2350
|
+
return this.appendChild(e, s), s;
|
|
2323
2351
|
}
|
|
2324
2352
|
addClass(e, t) {
|
|
2325
|
-
return t.includes(" ") ? t.split(" ").forEach((
|
|
2353
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.add(s)) : e.classList.add(t), e;
|
|
2326
2354
|
}
|
|
2327
2355
|
removeClass(e, t) {
|
|
2328
|
-
return t.includes(" ") ? t.split(" ").forEach((
|
|
2356
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.remove(s)) : e.classList.remove(t), e;
|
|
2329
2357
|
}
|
|
2330
2358
|
appendChild(e, t) {
|
|
2331
2359
|
e.appendChild(t);
|
|
@@ -2336,32 +2364,32 @@ class be {
|
|
|
2336
2364
|
createText(e) {
|
|
2337
2365
|
return document.createTextNode(e);
|
|
2338
2366
|
}
|
|
2339
|
-
setAttribute(e, t,
|
|
2340
|
-
e.setAttribute(t,
|
|
2367
|
+
setAttribute(e, t, s) {
|
|
2368
|
+
e.setAttribute(t, s);
|
|
2341
2369
|
}
|
|
2342
2370
|
}
|
|
2343
|
-
class
|
|
2344
|
-
render(e, t,
|
|
2345
|
-
if (i.isEditable(t,
|
|
2346
|
-
|
|
2347
|
-
const
|
|
2371
|
+
class rt {
|
|
2372
|
+
render(e, t, s, o, i, a, l) {
|
|
2373
|
+
if (i.isEditable(t, s)) {
|
|
2374
|
+
l.addClass(e, "ge-table-row-input-div");
|
|
2375
|
+
const r = i.getValueAt(t, s);
|
|
2348
2376
|
e.innerHTML = `
|
|
2349
2377
|
<input
|
|
2350
2378
|
type="text"
|
|
2351
|
-
value="${
|
|
2379
|
+
value="${r}"
|
|
2352
2380
|
autofocus
|
|
2353
2381
|
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
2354
2382
|
data-listen="change"
|
|
2355
|
-
data-area="${
|
|
2383
|
+
data-area="${o}"
|
|
2356
2384
|
data-row-index="${t}"
|
|
2357
|
-
data-col-index="${
|
|
2385
|
+
data-col-index="${s}"
|
|
2358
2386
|
data-input-type="text"
|
|
2359
2387
|
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
2360
2388
|
class="ge-table-cell-editor-input">`;
|
|
2361
2389
|
}
|
|
2362
2390
|
}
|
|
2363
2391
|
}
|
|
2364
|
-
class
|
|
2392
|
+
class lt {
|
|
2365
2393
|
constructor(e = "none", t = "single") {
|
|
2366
2394
|
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1, this.silent = !1, this.listenerArr = [];
|
|
2367
2395
|
}
|
|
@@ -2383,14 +2411,14 @@ class at {
|
|
|
2383
2411
|
this.selectionType === "row" ? this.addRange(E.singleRow(e)) : this.selectionType === "column" && this.addRange(E.singleColumn(t));
|
|
2384
2412
|
}
|
|
2385
2413
|
getSelectionCount(e, t) {
|
|
2386
|
-
let
|
|
2387
|
-
for (const
|
|
2388
|
-
|
|
2389
|
-
return this.allSelected &&
|
|
2414
|
+
let s = 0;
|
|
2415
|
+
for (const o of this.ranges)
|
|
2416
|
+
o.isInRange(e, t) && s++;
|
|
2417
|
+
return this.allSelected && s++, this.isInNegativeRange(e, t) && (s = 0), s;
|
|
2390
2418
|
}
|
|
2391
2419
|
isInNegativeRange(e, t) {
|
|
2392
|
-
for (const
|
|
2393
|
-
if (
|
|
2420
|
+
for (const s of this.negativeRanges)
|
|
2421
|
+
if (s.isInRange(e, t))
|
|
2394
2422
|
return !0;
|
|
2395
2423
|
return !1;
|
|
2396
2424
|
}
|
|
@@ -2414,8 +2442,8 @@ class at {
|
|
|
2414
2442
|
getMergedRowIndices() {
|
|
2415
2443
|
const e = /* @__PURE__ */ new Set();
|
|
2416
2444
|
for (const t of this.ranges)
|
|
2417
|
-
for (let
|
|
2418
|
-
!e.has(
|
|
2445
|
+
for (let s = t.r1; s <= t.r2; s++)
|
|
2446
|
+
!e.has(s) && !this.isInNegativeRange(s, 0) && e.add(s);
|
|
2419
2447
|
return Array.from(e);
|
|
2420
2448
|
}
|
|
2421
2449
|
selectAll() {
|
|
@@ -2480,7 +2508,7 @@ class nt {
|
|
|
2480
2508
|
return [this.rowIndex, this.columnIndex];
|
|
2481
2509
|
}
|
|
2482
2510
|
}
|
|
2483
|
-
class
|
|
2511
|
+
class me {
|
|
2484
2512
|
constructor(e = new D(
|
|
2485
2513
|
"❯",
|
|
2486
2514
|
"",
|
|
@@ -2494,17 +2522,17 @@ class fe {
|
|
|
2494
2522
|
}
|
|
2495
2523
|
// `⊖ `, `⊕ `;
|
|
2496
2524
|
}
|
|
2497
|
-
const
|
|
2498
|
-
class
|
|
2525
|
+
const ct = new lt(), dt = new nt("cell");
|
|
2526
|
+
class be {
|
|
2499
2527
|
constructor() {
|
|
2500
2528
|
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 = {
|
|
2501
2529
|
header: 34,
|
|
2502
2530
|
body: 34,
|
|
2503
2531
|
footer: 34
|
|
2504
|
-
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new
|
|
2532
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new ge(), this.headerGroupOptions = new me(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new fe(), this.sortOrder = ["asc", "desc"], this.resizeEventDebounceDelay = 500, this.getEditRenderer = (e, t) => new rt(), this.getSelectionModel = () => ct, this.getFocusModel = () => dt;
|
|
2505
2533
|
}
|
|
2506
2534
|
}
|
|
2507
|
-
const
|
|
2535
|
+
const L = class L {
|
|
2508
2536
|
/**
|
|
2509
2537
|
* Returns the content to be copied based on the provided table model, selection model, and focus model.
|
|
2510
2538
|
*
|
|
@@ -2514,27 +2542,27 @@ const F = class F {
|
|
|
2514
2542
|
* @return {Promise<string>} A promise that resolves to the copied content as a string.
|
|
2515
2543
|
* @throws {string} Throws an error if neither selection nor focus is defined.
|
|
2516
2544
|
*/
|
|
2517
|
-
createContent(e, t,
|
|
2518
|
-
return new Promise((
|
|
2545
|
+
createContent(e, t, s) {
|
|
2546
|
+
return new Promise((o, i) => {
|
|
2519
2547
|
if (t != null && t.hasSelection()) {
|
|
2520
|
-
const
|
|
2521
|
-
if (
|
|
2522
|
-
|
|
2523
|
-
const
|
|
2524
|
-
for (let
|
|
2525
|
-
const
|
|
2526
|
-
for (let
|
|
2527
|
-
const
|
|
2528
|
-
|
|
2548
|
+
const a = this.mergeRanges(t.getRanges());
|
|
2549
|
+
if (a) {
|
|
2550
|
+
a.c2 = Math.min(a.c2, e.getColumnCount() - 1), a.r2 = Math.min(a.r2, e.getBodyModel().getRowCount() - 1);
|
|
2551
|
+
const l = [];
|
|
2552
|
+
for (let r = a.r1; r <= a.r2; r++) {
|
|
2553
|
+
const c = [];
|
|
2554
|
+
for (let h = a.c1; h <= a.c2; h++) {
|
|
2555
|
+
const d = t.isSelected(r, h) ? e.getBodyModel().getTextValueAt(r, h) : "";
|
|
2556
|
+
c.push(d);
|
|
2529
2557
|
}
|
|
2530
|
-
|
|
2558
|
+
l.push(c.join(L.columnSeparatorChar));
|
|
2531
2559
|
}
|
|
2532
|
-
return
|
|
2560
|
+
return o(l.join(L.rowSeparatorChar));
|
|
2533
2561
|
}
|
|
2534
2562
|
}
|
|
2535
|
-
if (
|
|
2536
|
-
const [
|
|
2537
|
-
return
|
|
2563
|
+
if (s) {
|
|
2564
|
+
const [a, l] = s.getFocus(), r = e.getBodyModel().getTextValueAt(a, l);
|
|
2565
|
+
return o(r);
|
|
2538
2566
|
}
|
|
2539
2567
|
i("Cannot copy, neither selection nor focus defined.");
|
|
2540
2568
|
});
|
|
@@ -2556,19 +2584,19 @@ const F = class F {
|
|
|
2556
2584
|
* @param {FocusModelIf} focusModel - The focus model of the table.
|
|
2557
2585
|
* @returns {Promise<string>} A promise that resolves with the copied text if successful, or rejects if an error occurs.
|
|
2558
2586
|
*/
|
|
2559
|
-
copyToClipboard(e, t,
|
|
2560
|
-
return new Promise((
|
|
2587
|
+
copyToClipboard(e, t, s) {
|
|
2588
|
+
return new Promise((o, i) => {
|
|
2561
2589
|
this.createContent(
|
|
2562
2590
|
e,
|
|
2563
2591
|
t,
|
|
2564
|
-
|
|
2565
|
-
).then((
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
}).catch((
|
|
2592
|
+
s
|
|
2593
|
+
).then((a) => {
|
|
2594
|
+
a && this.copyContent(a).then((l) => {
|
|
2595
|
+
o(a);
|
|
2596
|
+
}).catch((l) => {
|
|
2569
2597
|
i();
|
|
2570
2598
|
});
|
|
2571
|
-
}).catch((
|
|
2599
|
+
}).catch((a) => {
|
|
2572
2600
|
i();
|
|
2573
2601
|
});
|
|
2574
2602
|
});
|
|
@@ -2581,35 +2609,141 @@ const F = class F {
|
|
|
2581
2609
|
*/
|
|
2582
2610
|
mergeRanges(e) {
|
|
2583
2611
|
let t;
|
|
2584
|
-
for (const
|
|
2585
|
-
t ? (t.r1 = Math.min(t.r1,
|
|
2612
|
+
for (const s of e)
|
|
2613
|
+
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 E(s.r1, s.c1, s.r2, s.c2);
|
|
2586
2614
|
return t;
|
|
2587
2615
|
}
|
|
2588
2616
|
};
|
|
2589
|
-
|
|
2617
|
+
L.columnSeparatorChar = " ", L.rowSeparatorChar = `
|
|
2590
2618
|
`;
|
|
2591
|
-
let
|
|
2619
|
+
let _ = L;
|
|
2592
2620
|
class ht {
|
|
2593
|
-
constructor(e) {
|
|
2594
|
-
this.tableScope = e, new ResizeObserver(We(this.handleResize.bind(this),
|
|
2621
|
+
constructor(e, t = 500) {
|
|
2622
|
+
this.tableScope = e, this.debounceDelay = t, new ResizeObserver(We(this.handleResize.bind(this), t)).observe(this.tableScope.hostElement);
|
|
2595
2623
|
}
|
|
2596
2624
|
handleResize(e) {
|
|
2597
|
-
const t = e[0], { width:
|
|
2598
|
-
this.tableScope.recalcColumnWidths(
|
|
2625
|
+
const t = e[0], { width: s } = t.contentRect;
|
|
2626
|
+
this.tableScope.recalcColumnWidths(s);
|
|
2599
2627
|
}
|
|
2600
2628
|
}
|
|
2601
|
-
class
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2629
|
+
class pt {
|
|
2630
|
+
/**
|
|
2631
|
+
* Downloads a matrix data as an Excel file.
|
|
2632
|
+
*
|
|
2633
|
+
* @param {Array<Array<any>>} matrix - A 2D array representing the data to be included in the Excel file. Each inner array corresponds to a row in the sheet.
|
|
2634
|
+
* @param {string} [filename='file.xlsx'] - The name of the Excel file to be downloaded. Defaults to 'file.xlsx'.
|
|
2635
|
+
* @param {string} [author=''] - The author's name to include as metadata in the Excel file. Optional parameter.
|
|
2636
|
+
* @return {void} Does not return a value.
|
|
2637
|
+
* @throws {Error} Throws an error if the input matrix is not a valid 2D array or if the filename is an empty string.
|
|
2638
|
+
*/
|
|
2639
|
+
downloadExcel(e, t = "file.xlsx", s = "") {
|
|
2640
|
+
if (!Array.isArray(e) || e.some((o) => !Array.isArray(o)))
|
|
2641
|
+
throw new Error("Invalid matrix format. Expected a 2D array.");
|
|
2642
|
+
if ((t == null ? void 0 : t.trim()) === "")
|
|
2643
|
+
throw new Error("Invalid filename. Filename must be a non-empty string.");
|
|
2644
|
+
try {
|
|
2645
|
+
const o = this.generateBuffer(e, s), i = new Blob([o], {
|
|
2646
|
+
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
2647
|
+
}), a = document.createElement("a");
|
|
2648
|
+
a.href = URL.createObjectURL(i), a.download = t, document.body.appendChild(a), a.click(), document.body.removeChild(a);
|
|
2649
|
+
} catch (o) {
|
|
2650
|
+
throw console.error("Error generating Excel file:", o), new Error("Failed to download Excel file.");
|
|
2607
2651
|
}
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2652
|
+
}
|
|
2653
|
+
generateMap(e, t = "") {
|
|
2654
|
+
const s = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2655
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>`, o = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2656
|
+
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>Microsoft Macintosh Excel</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="2" baseType="variant"><vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant><vt:variant><vt:i4>1</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="1" baseType="lpstr"><vt:lpstr>Sheet1</vt:lpstr></vt:vector></TitlesOfParts><Company></Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>16.0300</AppVersion></Properties>`, i = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2657
|
+
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>${t}</dc:creator><cp:lastModifiedBy>${t}</cp:lastModifiedBy><dcterms:created xsi:type="dcterms:W3CDTF">2024-12-13T19:45:08Z</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">2024-12-13T19:45:35Z</dcterms:modified></cp:coreProperties>`, a = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2658
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/></Relationships>`, l = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2659
|
+
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="0E2841"/></a:dk2><a:lt2><a:srgbClr val="E8E8E8"/></a:lt2><a:accent1><a:srgbClr val="156082"/></a:accent1><a:accent2><a:srgbClr val="E97132"/></a:accent2><a:accent3><a:srgbClr val="196B24"/></a:accent3><a:accent4><a:srgbClr val="0F9ED5"/></a:accent4><a:accent5><a:srgbClr val="A02B93"/></a:accent5><a:accent6><a:srgbClr val="4EA72E"/></a:accent6><a:hlink><a:srgbClr val="467886"/></a:hlink><a:folHlink><a:srgbClr val="96607D"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Aptos Display" panose="02110004020202020204"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="游ゴシック Light"/><a:font script="Hang" typeface="맑은 고딕"/><a:font script="Hans" typeface="等线 Light"/><a:font script="Hant" typeface="新細明體"/><a:font script="Arab" typeface="Times New Roman"/><a:font script="Hebr" typeface="Times New Roman"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="MoolBoran"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Times New Roman"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/><a:font script="Armn" typeface="Arial"/><a:font script="Bugi" typeface="Leelawadee UI"/><a:font script="Bopo" typeface="Microsoft JhengHei"/><a:font script="Java" typeface="Javanese Text"/><a:font script="Lisu" typeface="Segoe UI"/><a:font script="Mymr" typeface="Myanmar Text"/><a:font script="Nkoo" typeface="Ebrima"/><a:font script="Olck" typeface="Nirmala UI"/><a:font script="Osma" typeface="Ebrima"/><a:font script="Phag" typeface="Phagspa"/><a:font script="Syrn" typeface="Estrangelo Edessa"/><a:font script="Syrj" typeface="Estrangelo Edessa"/><a:font script="Syre" typeface="Estrangelo Edessa"/><a:font script="Sora" typeface="Nirmala UI"/><a:font script="Tale" typeface="Microsoft Tai Le"/><a:font script="Talu" typeface="Microsoft New Tai Lue"/><a:font script="Tfng" typeface="Ebrima"/></a:majorFont><a:minorFont><a:latin typeface="Aptos Narrow" panose="02110004020202020204"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="游ゴシック"/><a:font script="Hang" typeface="맑은 고딕"/><a:font script="Hans" typeface="等线"/><a:font script="Hant" typeface="新細明體"/><a:font script="Arab" typeface="Arial"/><a:font script="Hebr" typeface="Arial"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="DaunPenh"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Arial"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/><a:font script="Armn" typeface="Arial"/><a:font script="Bugi" typeface="Leelawadee UI"/><a:font script="Bopo" typeface="Microsoft JhengHei"/><a:font script="Java" typeface="Javanese Text"/><a:font script="Lisu" typeface="Segoe UI"/><a:font script="Mymr" typeface="Myanmar Text"/><a:font script="Nkoo" typeface="Ebrima"/><a:font script="Olck" typeface="Nirmala UI"/><a:font script="Osma" typeface="Ebrima"/><a:font script="Phag" typeface="Phagspa"/><a:font script="Syrn" typeface="Estrangelo Edessa"/><a:font script="Syrj" typeface="Estrangelo Edessa"/><a:font script="Syre" typeface="Estrangelo Edessa"/><a:font script="Sora" typeface="Nirmala UI"/><a:font script="Tale" typeface="Microsoft Tai Le"/><a:font script="Talu" typeface="Microsoft New Tai Lue"/><a:font script="Tfng" typeface="Ebrima"/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="110000"/><a:satMod val="105000"/><a:tint val="67000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="103000"/><a:tint val="73000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="109000"/><a:tint val="81000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:satMod val="103000"/><a:lumMod val="102000"/><a:tint val="94000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:satMod val="110000"/><a:lumMod val="100000"/><a:shade val="100000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="99000"/><a:satMod val="120000"/><a:shade val="78000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="12700" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="19050" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="57150" dist="19050" dir="5400000" algn="ctr" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="63000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"><a:tint val="95000"/><a:satMod val="170000"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="93000"/><a:satMod val="150000"/><a:shade val="98000"/><a:lumMod val="102000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:tint val="98000"/><a:satMod val="130000"/><a:shade val="90000"/><a:lumMod val="103000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="63000"/><a:satMod val="120000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults><a:lnDef><a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style></a:lnDef></a:objectDefaults><a:extraClrSchemeLst/><a:extLst><a:ext uri="{05A4C25C-085E-4340-85A3-A5531E510DB2}"><thm15:themeFamily xmlns:thm15="http://schemas.microsoft.com/office/thememl/2012/main" name="Office Theme" id="{2E142A2C-CD16-42D6-873A-C26D2A0506FA}" vid="{1BDDFF52-6CD6-40A5-AB3C-68EB2F1E4D0A}"/></a:ext></a:extLst></a:theme>`, r = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2660
|
+
<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="3" uniqueCount="3"><si><t>a</t></si><si><t>b</t></si><si><t>c</t></si></sst>`, c = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2661
|
+
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac x16r2 xr" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:x16r2="http://schemas.microsoft.com/office/spreadsheetml/2015/02/main" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision"><fonts count="1" x14ac:knownFonts="1"><font><sz val="12"/><color theme="1"/><name val="Aptos Narrow"/><family val="2"/><scheme val="minor"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles><dxfs count="0"/><tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleLight16"/><extLst><ext uri="{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:slicerStyles defaultSlicerStyle="SlicerStyleLight1"/></ext><ext uri="{9260A510-F301-46a8-8635-F512D64BE5F5}" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"><x15:timelineStyles defaultTimelineStyle="TimeSlicerStyleLight1"/></ext></extLst></styleSheet>`, h = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2662
|
+
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x15 xr xr6 xr10 xr2" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" xmlns:xr6="http://schemas.microsoft.com/office/spreadsheetml/2016/revision6" xmlns:xr10="http://schemas.microsoft.com/office/spreadsheetml/2016/revision10" xmlns:xr2="http://schemas.microsoft.com/office/spreadsheetml/2015/revision2"><fileVersion appName="xl" lastEdited="7" lowestEdited="7" rupBuild="11207"/><workbookPr defaultThemeVersion="202300"/><mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice Requires="x15"><x15ac:absPath url="/" xmlns:x15ac="http://schemas.microsoft.com/office/spreadsheetml/2010/11/ac"/></mc:Choice></mc:AlternateContent><xr:revisionPtr revIDLastSave="0" documentId="8_{292BF245-1F37-B045-B1A5-26C42FB62779}" xr6:coauthVersionLast="47" xr6:coauthVersionMax="47" xr10:uidLastSave="{00000000-0000-0000-0000-000000000000}"/><bookViews><workbookView xWindow="11340" yWindow="5060" windowWidth="28040" windowHeight="17440" xr2:uid="{858B8D3F-6246-774D-8903-6D38687B7BC6}"/></bookViews><sheets><sheet name="Sheet1" sheetId="1" r:id="rId1"/></sheets><calcPr calcId="181029"/><extLst><ext uri="{140A7094-0E35-4892-8432-C4D2E57EDEB5}" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"><x15:workbookPr chartTrackingRefBase="1"/></ext><ext uri="{B58B0392-4F1F-4190-BB64-5DF3571DCE5F}" xmlns:xcalcf="http://schemas.microsoft.com/office/spreadsheetml/2018/calcfeatures"><xcalcf:calcFeatures><xcalcf:feature name="microsoft.com:RD"/><xcalcf:feature name="microsoft.com:Single"/><xcalcf:feature name="microsoft.com:FV"/><xcalcf:feature name="microsoft.com:CNMTM"/><xcalcf:feature name="microsoft.com:LET_WF"/><xcalcf:feature name="microsoft.com:LAMBDA_WF"/><xcalcf:feature name="microsoft.com:ARRAYTEXT_WF"/></xcalcf:calcFeatures></ext></extLst></workbook>`, d = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2663
|
+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/></Types>`, p = /* @__PURE__ */ new Map();
|
|
2664
|
+
return p.set("_rels/.rels", s), p.set("docProps/app.xml", o), p.set("docProps/core.xml", i), p.set("xl/_rels/workbook.xml.rels", a), p.set("xl/theme/theme1.xml", l), p.set("xl/worksheets/sheet1.xml", this.getX1WorksheetsSheet1Xml(e)), p.set("xl/sharedStrings.xml", r), p.set("xl/styles.xml", c), p.set("xl/workbook.xml", h), p.set("[Content_Types].xml", d), p;
|
|
2665
|
+
}
|
|
2666
|
+
getX1WorksheetsSheet1Xml(e) {
|
|
2667
|
+
const t = [];
|
|
2668
|
+
t.push(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2669
|
+
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac xr xr2 xr3" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" xmlns:xr2="http://schemas.microsoft.com/office/spreadsheetml/2015/revision2" xmlns:xr3="http://schemas.microsoft.com/office/spreadsheetml/2016/revision3" xr:uid="{E15F8FC4-4D40-434C-921A-3D9CFAAA2865}">
|
|
2670
|
+
<dimension ref="A1:B3"/>
|
|
2671
|
+
<sheetViews>
|
|
2672
|
+
<sheetView tabSelected="1" workbookViewId="0"/></sheetViews>
|
|
2673
|
+
<sheetFormatPr baseColWidth="10" defaultRowHeight="16" x14ac:dyDescent="0.2"/>
|
|
2674
|
+
<sheetData>`);
|
|
2675
|
+
for (let s = 0; s < e.length; s++) {
|
|
2676
|
+
const o = e[s];
|
|
2677
|
+
t.push('<row r="${r + 1}" spans="1:2" x14ac:dyDescent="0.2">');
|
|
2678
|
+
for (let i = 0; i < o.length; i++) {
|
|
2679
|
+
const a = o[i], l = this.getCellAddress(s, i);
|
|
2680
|
+
if (typeof a == "number")
|
|
2681
|
+
t.push(`<c r="${l}"><v>${a}</v></c>`);
|
|
2682
|
+
else if (a instanceof Date) {
|
|
2683
|
+
const r = a;
|
|
2684
|
+
t.push(`<c r="${l}" t="inlineStr"><is><t>${r.toISOString()}</t></is></c>`);
|
|
2685
|
+
} else {
|
|
2686
|
+
const r = a != null ? this.escapeXml(String(a)) : "";
|
|
2687
|
+
t.push(`<c r="${l}" t="inlineStr"><is><t>${r}</t></is></c>`);
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
t.push("</row>");
|
|
2691
|
+
}
|
|
2692
|
+
return t.push(""), t.push(""), t.push('</sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/>'), t.push("</worksheet>"), t.join(`
|
|
2693
|
+
`);
|
|
2694
|
+
}
|
|
2695
|
+
escapeXml(e) {
|
|
2696
|
+
return e == null ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2697
|
+
}
|
|
2698
|
+
getCellAddress(e, t) {
|
|
2699
|
+
const s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
2700
|
+
let o = "";
|
|
2701
|
+
for (; t >= 0; )
|
|
2702
|
+
o = s[t % 26] + o, t = Math.floor(t / 26) - 1;
|
|
2703
|
+
return `${o}${e + 1}`;
|
|
2704
|
+
}
|
|
2705
|
+
createZip(e) {
|
|
2706
|
+
const t = [];
|
|
2707
|
+
let s = 0;
|
|
2708
|
+
const o = [];
|
|
2709
|
+
e.forEach((d, p) => {
|
|
2710
|
+
const u = new TextEncoder().encode(p), g = new TextEncoder().encode(d), b = new Uint8Array(30 + u.length), f = new DataView(b.buffer);
|
|
2711
|
+
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, u.length, !0), f.setUint16(28, 0, !0), b.set(u, 30), t.push(b, g), o.push({
|
|
2712
|
+
path: p,
|
|
2713
|
+
offset: s,
|
|
2714
|
+
contentSize: g.length
|
|
2715
|
+
}), s += b.length + g.length;
|
|
2716
|
+
});
|
|
2717
|
+
const i = s;
|
|
2718
|
+
o.forEach((d) => {
|
|
2719
|
+
const p = new TextEncoder().encode(d.path), u = new Uint8Array(46 + p.length), g = new DataView(u.buffer);
|
|
2720
|
+
u.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), u.set(p, 46), t.push(u), s += u.length;
|
|
2721
|
+
});
|
|
2722
|
+
const a = new Uint8Array(22), l = new DataView(a.buffer);
|
|
2723
|
+
a.set([80, 75, 5, 6], 0), l.setUint16(4, 0, !0), l.setUint16(6, 0, !0), l.setUint16(8, o.length, !0), l.setUint16(10, o.length, !0), l.setUint32(12, s - i, !0), l.setUint32(16, i, !0), l.setUint16(20, 0, !0), t.push(a);
|
|
2724
|
+
const r = t.reduce((d, p) => d + p.length, 0), c = new Uint8Array(r);
|
|
2725
|
+
let h = 0;
|
|
2726
|
+
for (const d of t)
|
|
2727
|
+
c.set(d, h), h += d.length;
|
|
2728
|
+
return c;
|
|
2729
|
+
}
|
|
2730
|
+
generateBuffer(e, t = "") {
|
|
2731
|
+
const s = this.generateMap(e, t);
|
|
2732
|
+
return this.createZip(s);
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
class se extends Ze {
|
|
2736
|
+
constructor(e, t, s, o, i, a = new _(), l = new pt()) {
|
|
2737
|
+
var h;
|
|
2738
|
+
if (super(e, t, new Ve(s), o), this.eventListener = i, this.copyService = a, this.excelService = l, this.licenseManager = k.getInstance(), this.selectionService = new st(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 re()), (h = this.tableOptions) != null && h.autoRestoreOptions) {
|
|
2739
|
+
const d = this.tableOptions.autoRestoreOptions, p = d.getStorageKeyFn;
|
|
2740
|
+
p && (d.autoRestoreScrollPosition && (this.storeScrollPosStateService = new Ue(p)), d.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new Xe(p)), d.autoRestoreSortingState && (this.storeSortingService = new Ke(p)));
|
|
2741
|
+
}
|
|
2742
|
+
this.mouseHandler = new Ne(this), this.inputHandler = new et(this), this.resizeHandler = new ht(this, o.resizeEventDebounceDelay), this.shortcutService = new at(this), this.shortcutService.addListener(this.selectionService);
|
|
2743
|
+
const r = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
2744
|
+
r && r.addEventSelectionChangedListener(this);
|
|
2745
|
+
const c = this.getFocusModel ? this.getFocusModel() : void 0;
|
|
2746
|
+
c && c.addEventFocusChangedListener(this);
|
|
2613
2747
|
}
|
|
2614
2748
|
/**
|
|
2615
2749
|
* Creates a TableScope instance.
|
|
@@ -2623,8 +2757,8 @@ class oe extends Qe {
|
|
|
2623
2757
|
*
|
|
2624
2758
|
* @return {TableScope} - The newly created TableScope instance.
|
|
2625
2759
|
*/
|
|
2626
|
-
static create(e, t,
|
|
2627
|
-
return new
|
|
2760
|
+
static create(e, t, s = new be(), o = new re(), i = new ue(), a = new _()) {
|
|
2761
|
+
return new se(e, t, i, s, o, a);
|
|
2628
2762
|
}
|
|
2629
2763
|
/**
|
|
2630
2764
|
* Triggers an action based on the provided actionId.
|
|
@@ -2640,19 +2774,19 @@ class oe extends Qe {
|
|
|
2640
2774
|
if (e === "START_EDITING" && this.getFocusModel) {
|
|
2641
2775
|
const t = this.getFocusModel();
|
|
2642
2776
|
if (t) {
|
|
2643
|
-
const [
|
|
2644
|
-
this.tableModel.getBodyModel().isEditable(
|
|
2777
|
+
const [s, o] = t.getFocus();
|
|
2778
|
+
this.tableModel.getBodyModel().isEditable(s, o) && (this.clearSelection(), this.initRenderEditor(s, o));
|
|
2645
2779
|
}
|
|
2646
2780
|
return !0;
|
|
2647
2781
|
}
|
|
2648
2782
|
if (e === "COPY_2_CLIPBOARD") {
|
|
2649
|
-
const t = this.getSelectionModel ? this.getSelectionModel() : void 0,
|
|
2650
|
-
this.copyService.createContent(this.tableModel, t,
|
|
2783
|
+
const t = this.getSelectionModel ? this.getSelectionModel() : void 0, s = this.getFocusModel ? this.getFocusModel() : void 0;
|
|
2784
|
+
this.copyService.createContent(this.tableModel, t, s).then((o) => this.copyService.copyContent(o));
|
|
2651
2785
|
}
|
|
2652
2786
|
return !1;
|
|
2653
2787
|
}
|
|
2654
|
-
updateModelValueAfterEdit(e, t,
|
|
2655
|
-
e === "body" && this.tableModel.getAreaModel(e).setValue(t,
|
|
2788
|
+
updateModelValueAfterEdit(e, t, s, o) {
|
|
2789
|
+
e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, o) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(te.createSingle(t, s)), this.hostElement.focus());
|
|
2656
2790
|
}
|
|
2657
2791
|
/**
|
|
2658
2792
|
* Retrieves the TableApi object.
|
|
@@ -2681,16 +2815,16 @@ class oe extends Qe {
|
|
|
2681
2815
|
* @return {GeMouseEvent} - The created GeMouseEvent object.
|
|
2682
2816
|
*/
|
|
2683
2817
|
createGeMouseEvent(e) {
|
|
2684
|
-
const t = new
|
|
2818
|
+
const t = new Z();
|
|
2685
2819
|
if (t.originalEvent = e, e) {
|
|
2686
|
-
const
|
|
2687
|
-
if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(
|
|
2688
|
-
const
|
|
2689
|
-
t.rowTop =
|
|
2820
|
+
const s = e.target;
|
|
2821
|
+
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) {
|
|
2822
|
+
const o = this.tableModel.getAreaModel(t.areaIdent);
|
|
2823
|
+
t.rowTop = o.getYPosByRowIndex(t.rowIndex);
|
|
2690
2824
|
}
|
|
2691
2825
|
if (t.columnLeft = this.tableModel.getXPosByColumnIndex(t.columnIndex), e.ctrlKey && e.altKey) {
|
|
2692
|
-
const
|
|
2693
|
-
this.debugOnce(i,
|
|
2826
|
+
const o = e.clientY - this.hostElement.offsetTop - this.areaHeaderCenter.parent.clientHeight, i = e.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width;
|
|
2827
|
+
this.debugOnce(i, o);
|
|
2694
2828
|
}
|
|
2695
2829
|
}
|
|
2696
2830
|
return t;
|
|
@@ -2749,9 +2883,9 @@ class oe extends Qe {
|
|
|
2749
2883
|
* @return {void}
|
|
2750
2884
|
*/
|
|
2751
2885
|
toggleExpandCollapseAll(e = !0) {
|
|
2752
|
-
var
|
|
2886
|
+
var s;
|
|
2753
2887
|
const t = this.tableModel.getBodyModel();
|
|
2754
|
-
|
|
2888
|
+
J(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
2755
2889
|
}
|
|
2756
2890
|
/**
|
|
2757
2891
|
* Toggles the checkbox state of a specific row in a table.
|
|
@@ -2762,12 +2896,12 @@ class oe extends Qe {
|
|
|
2762
2896
|
*
|
|
2763
2897
|
* @return {void} - This method does not return anything.
|
|
2764
2898
|
*/
|
|
2765
|
-
toggleRowCheckbox(e, t,
|
|
2766
|
-
var
|
|
2767
|
-
const
|
|
2768
|
-
|
|
2769
|
-
const
|
|
2770
|
-
this.eventListener.onCheckboxChanged(
|
|
2899
|
+
toggleRowCheckbox(e, t, s) {
|
|
2900
|
+
var r;
|
|
2901
|
+
const o = this.tableModel.getAreaModel(s), i = o.isRowChecked(e), a = i === void 0 || i === "semi" || i === "none";
|
|
2902
|
+
o.setRowChecked(e, a), this.repaint();
|
|
2903
|
+
const l = (r = o.rowSelectionModel) == null ? void 0 : r.getCheckedRows();
|
|
2904
|
+
this.eventListener.onCheckboxChanged(l || []);
|
|
2771
2905
|
}
|
|
2772
2906
|
/**
|
|
2773
2907
|
* Handle mouse click events.
|
|
@@ -2777,13 +2911,13 @@ class oe extends Qe {
|
|
|
2777
2911
|
* @returns {void}
|
|
2778
2912
|
*/
|
|
2779
2913
|
onMouseClicked(e, t) {
|
|
2780
|
-
let
|
|
2781
|
-
if (!
|
|
2914
|
+
let s = this.selectionService.onMouseClicked(e, t);
|
|
2915
|
+
if (!s && this.getFocusModel) {
|
|
2782
2916
|
this.resetEditorRenderer();
|
|
2783
|
-
const
|
|
2784
|
-
|
|
2917
|
+
const o = this.getFocusModel();
|
|
2918
|
+
o && (s = o.hasChanged(), o.clearChanged());
|
|
2785
2919
|
}
|
|
2786
|
-
return
|
|
2920
|
+
return s;
|
|
2787
2921
|
}
|
|
2788
2922
|
debounceRepaint() {
|
|
2789
2923
|
this.debounce(this.repaint.bind(this), 1);
|
|
@@ -2816,13 +2950,13 @@ class oe extends Qe {
|
|
|
2816
2950
|
*
|
|
2817
2951
|
* @return {void}
|
|
2818
2952
|
*/
|
|
2819
|
-
onHeaderDblClicked(e, t,
|
|
2820
|
-
var i,
|
|
2821
|
-
const
|
|
2822
|
-
if (
|
|
2953
|
+
onHeaderDblClicked(e, t, s) {
|
|
2954
|
+
var i, a;
|
|
2955
|
+
const o = this.tableModel.getColumnDef(s);
|
|
2956
|
+
if (o != null && o.sortable && o.sortable()) {
|
|
2823
2957
|
e.preventDefault(), e.stopPropagation();
|
|
2824
|
-
const
|
|
2825
|
-
this.tableModel.doSort([
|
|
2958
|
+
const l = o.sortStatesOrder ? o.sortStatesOrder : this.tableOptions.sortOrder, r = o.sortState ?? "", c = l[(l.indexOf(r) + 1) % l.length], h = new Qe(s, c);
|
|
2959
|
+
this.tableModel.doSort([h]) && ((i = this.tableModel.getColumnDefs()) == null || i.forEach((p) => p.sortState = ""), o.sortState = c), this.repaint(), (a = this.storeSortingService) == null || a.setSortItems([h]);
|
|
2826
2960
|
}
|
|
2827
2961
|
}
|
|
2828
2962
|
/**
|
|
@@ -2844,8 +2978,8 @@ class oe extends Qe {
|
|
|
2844
2978
|
* @return {void}
|
|
2845
2979
|
*/
|
|
2846
2980
|
scrollToIndex(e, t) {
|
|
2847
|
-
const
|
|
2848
|
-
this.scrollToPixel(0,
|
|
2981
|
+
const o = this.tableModel.getAreaModel("body").getYPosByRowIndex(t);
|
|
2982
|
+
this.scrollToPixel(0, o);
|
|
2849
2983
|
}
|
|
2850
2984
|
/**
|
|
2851
2985
|
* Sets the selection model for the table.
|
|
@@ -2856,8 +2990,8 @@ class oe extends Qe {
|
|
|
2856
2990
|
* @return {void} - This method does not return any value.
|
|
2857
2991
|
*/
|
|
2858
2992
|
setSelectionModel(e, t = !1) {
|
|
2859
|
-
const
|
|
2860
|
-
this.tableOptions.getSelectionModel =
|
|
2993
|
+
const s = () => e;
|
|
2994
|
+
this.tableOptions.getSelectionModel = s, this.getSelectionModel = s, this.selectionService.getSelectionModel = s, t && this.repaint();
|
|
2861
2995
|
}
|
|
2862
2996
|
toggleHeaderGroup(e) {
|
|
2863
2997
|
const t = this.tableModel.getAreaModel("header");
|
|
@@ -2892,10 +3026,10 @@ class oe extends Qe {
|
|
|
2892
3026
|
*/
|
|
2893
3027
|
changeFocusCell(e, t) {
|
|
2894
3028
|
if (!this.isEditing() && this.getFocusModel) {
|
|
2895
|
-
const
|
|
2896
|
-
if (
|
|
2897
|
-
const [
|
|
2898
|
-
return
|
|
3029
|
+
const s = this.getFocusModel();
|
|
3030
|
+
if (s) {
|
|
3031
|
+
const [o, i] = s.getFocus();
|
|
3032
|
+
return s.setFocus(o + t, i + e), this.repaint(), !0;
|
|
2899
3033
|
}
|
|
2900
3034
|
}
|
|
2901
3035
|
return !1;
|
|
@@ -2918,8 +3052,8 @@ class oe extends Qe {
|
|
|
2918
3052
|
this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
|
|
2919
3053
|
}
|
|
2920
3054
|
debugOnce(e, t) {
|
|
2921
|
-
var
|
|
2922
|
-
console.clear(), console.info("this.hostElement.offsetTop", this.hostElement.offsetTop), console.info("this.hostElement.scrollHeight", this.hostElement.scrollHeight), console.info("this.scrollViewportTop", this.scrollTop), console.info("this.areaHeaderCenter.parent.clientHeight", this.areaHeaderCenter.parent.clientHeight), console.info("bodyY", t), console.info("bodyX", e), console.info("rows", this.firstVisibleRowIndex), console.info(""), console.info("this.tableModel", this.tableModel), console.info(""), console.info("this.mouseMoveEvent.clientX", (
|
|
3055
|
+
var s;
|
|
3056
|
+
console.clear(), console.info("this.hostElement.offsetTop", this.hostElement.offsetTop), console.info("this.hostElement.scrollHeight", this.hostElement.scrollHeight), console.info("this.scrollViewportTop", this.scrollTop), console.info("this.areaHeaderCenter.parent.clientHeight", this.areaHeaderCenter.parent.clientHeight), console.info("bodyY", t), console.info("bodyX", e), console.info("rows", this.firstVisibleRowIndex), console.info(""), console.info("this.tableModel", this.tableModel), console.info(""), console.info("this.mouseMoveEvent.clientX", (s = this.mouseHandler.mouseEvent) == null ? void 0 : s.clientX), console.info("this.hostElement.offsetLeft", this.hostElement.offsetLeft), console.info("this.areaBodyWestGeo.width", this.areaBodyWestGeo.width);
|
|
2923
3057
|
}
|
|
2924
3058
|
/**
|
|
2925
3059
|
* Restores the scroll position of the table if auto restore options are enabled.
|
|
@@ -2930,8 +3064,8 @@ class oe extends Qe {
|
|
|
2930
3064
|
autoRestoreScrollPosition() {
|
|
2931
3065
|
var e;
|
|
2932
3066
|
if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
|
|
2933
|
-
const
|
|
2934
|
-
|
|
3067
|
+
const s = this.storeScrollPosStateService.getScrollOffset();
|
|
3068
|
+
s && this.scrollViewport.scrollTo(...s);
|
|
2935
3069
|
}
|
|
2936
3070
|
}
|
|
2937
3071
|
/**
|
|
@@ -2951,8 +3085,8 @@ class oe extends Qe {
|
|
|
2951
3085
|
autoRestoreSortingState() {
|
|
2952
3086
|
var e, t;
|
|
2953
3087
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
|
|
2954
|
-
const
|
|
2955
|
-
|
|
3088
|
+
const s = this.storeSortingService.getSortItems();
|
|
3089
|
+
s != null && s.length && this.tableModel.getBodyModel().doSort(s);
|
|
2956
3090
|
}
|
|
2957
3091
|
}
|
|
2958
3092
|
/**
|
|
@@ -2964,24 +3098,24 @@ class oe extends Qe {
|
|
|
2964
3098
|
autoRestoreCollapsedExpandedState() {
|
|
2965
3099
|
var e, t;
|
|
2966
3100
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
|
|
2967
|
-
const
|
|
2968
|
-
if (
|
|
2969
|
-
const i = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(),
|
|
2970
|
-
if (
|
|
2971
|
-
const
|
|
2972
|
-
for (let
|
|
2973
|
-
const
|
|
2974
|
-
if (
|
|
3101
|
+
const s = this.tableOptions.autoRestoreOptions, o = s.getRowId;
|
|
3102
|
+
if (s.autoRestoreCollapsedExpandedState && o) {
|
|
3103
|
+
const i = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), a = this.tableModel.getAreaModel("body");
|
|
3104
|
+
if (J(a)) {
|
|
3105
|
+
const l = a, r = a.getRowCount();
|
|
3106
|
+
for (let c = 0; c < r; c++) {
|
|
3107
|
+
const h = a.getRowByIndex(c);
|
|
3108
|
+
if (h)
|
|
2975
3109
|
if (i.allExpanded)
|
|
2976
|
-
|
|
3110
|
+
h.expanded = !0;
|
|
2977
3111
|
else if (i.allCollapsed)
|
|
2978
|
-
|
|
3112
|
+
h.expanded = !1;
|
|
2979
3113
|
else {
|
|
2980
|
-
const
|
|
2981
|
-
i.mode === "expanded" ?
|
|
3114
|
+
const d = o(h.data);
|
|
3115
|
+
i.mode === "expanded" ? h.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(d) : i.mode === "collapsed" && (h.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(d));
|
|
2982
3116
|
}
|
|
2983
3117
|
}
|
|
2984
|
-
|
|
3118
|
+
l.recalcVisibleTreeRows();
|
|
2985
3119
|
}
|
|
2986
3120
|
}
|
|
2987
3121
|
}
|
|
@@ -3223,112 +3357,112 @@ W.themes = ["light", "combat", "paper", "blackboard"], W.vars = {
|
|
|
3223
3357
|
--ge-table-drop-zone-bg: #758129;
|
|
3224
3358
|
}`
|
|
3225
3359
|
};
|
|
3226
|
-
let
|
|
3227
|
-
const
|
|
3228
|
-
constructor(e = new
|
|
3360
|
+
let le = W;
|
|
3361
|
+
const V = class V {
|
|
3362
|
+
constructor(e = new me()) {
|
|
3229
3363
|
this.headerGroupOptions = e;
|
|
3230
3364
|
}
|
|
3231
|
-
render(e, t,
|
|
3232
|
-
const
|
|
3233
|
-
if (
|
|
3234
|
-
const { toggle:
|
|
3235
|
-
this.addText(e,
|
|
3365
|
+
render(e, t, s, o, i, a, l) {
|
|
3366
|
+
const r = a != null && a.data ? a.data : "";
|
|
3367
|
+
if (a) {
|
|
3368
|
+
const { toggle: c, visibility: h, closed: d } = a, p = c ? V.toggleHeaderGroup : "";
|
|
3369
|
+
this.addText(e, o, t, s, r, p), c && h !== "always" && this.addArrowDiv(l, e, !d, t, s, o, p);
|
|
3236
3370
|
} else
|
|
3237
|
-
this.addText(e,
|
|
3371
|
+
this.addText(e, o, t, s, r, "");
|
|
3238
3372
|
}
|
|
3239
|
-
addText(e, t,
|
|
3373
|
+
addText(e, t, s, o, i, a) {
|
|
3240
3374
|
e.innerHTML = `<span
|
|
3241
|
-
data-ge-action="${
|
|
3375
|
+
data-ge-action="${a}"
|
|
3242
3376
|
data-area="${t}"
|
|
3243
|
-
data-row-index="${
|
|
3244
|
-
data-col-index="${
|
|
3377
|
+
data-row-index="${s}"
|
|
3378
|
+
data-col-index="${o}"
|
|
3245
3379
|
>${i}</span>`;
|
|
3246
3380
|
}
|
|
3247
|
-
addArrowDiv(e, t,
|
|
3248
|
-
const
|
|
3249
|
-
e.addClass(
|
|
3250
|
-
let
|
|
3251
|
-
|
|
3252
|
-
const
|
|
3253
|
-
e.appendChild(
|
|
3254
|
-
for (const
|
|
3255
|
-
e.addClass(
|
|
3256
|
-
return e.appendChild(t,
|
|
3257
|
-
}
|
|
3258
|
-
applyStyleString(e, t,
|
|
3259
|
-
const
|
|
3260
|
-
for (const i of
|
|
3261
|
-
const [
|
|
3262
|
-
e.setStyle(t,
|
|
3381
|
+
addArrowDiv(e, t, s = !0, o = -1, i = -1, a = "header", l) {
|
|
3382
|
+
const r = e.createElement("div");
|
|
3383
|
+
e.addClass(r, "ge-table-toggle-icon-div"), e.setStyle(r, "display", "inline-block"), e.setStyle(r, "position", ""), e.setStyle(r, "width", "20px"), e.setStyle(r, "background", "transparent"), e.setStyle(r, "cursor", "pointer"), e.setAttribute(r, "data-row-index", `${o}`), e.setAttribute(r, "data-col-index", `${i}`), e.setAttribute(r, "data-area", `${a}`), e.setAttribute(r, "data-ge-action", `${l}`);
|
|
3384
|
+
let c;
|
|
3385
|
+
s ? c = this.headerGroupOptions.iconExpanded : c = this.headerGroupOptions.iconCollapsed;
|
|
3386
|
+
const h = c.content, d = e.createText(h);
|
|
3387
|
+
e.appendChild(r, d), c.style && this.applyStyleString(e, r, c.style);
|
|
3388
|
+
for (const p of c.classes)
|
|
3389
|
+
e.addClass(r, p);
|
|
3390
|
+
return e.appendChild(t, r), r;
|
|
3391
|
+
}
|
|
3392
|
+
applyStyleString(e, t, s) {
|
|
3393
|
+
const o = s.split(";").map((i) => i.trim()).filter((i) => i);
|
|
3394
|
+
for (const i of o) {
|
|
3395
|
+
const [a, l] = i.split(":");
|
|
3396
|
+
e.setStyle(t, a.trim(), l.trim());
|
|
3263
3397
|
}
|
|
3264
3398
|
}
|
|
3265
3399
|
};
|
|
3266
|
-
|
|
3267
|
-
let ne =
|
|
3268
|
-
function gt(
|
|
3400
|
+
V.toggleHeaderGroup = "toggleHeaderGroup";
|
|
3401
|
+
let ne = V;
|
|
3402
|
+
function gt(n) {
|
|
3269
3403
|
let e;
|
|
3270
3404
|
return {
|
|
3271
3405
|
c() {
|
|
3272
|
-
e = Ae("div"), Me(e, "class", "ge-table"),
|
|
3406
|
+
e = Ae("div"), Me(e, "class", "ge-table"), P(e, "width", "100%"), P(e, "height", "100%"), P(e, "background-color", "transparent"), P(e, "padding", "0"), P(e, "margin", "0");
|
|
3273
3407
|
},
|
|
3274
|
-
m(t,
|
|
3275
|
-
Ee(t, e,
|
|
3408
|
+
m(t, s) {
|
|
3409
|
+
Ee(t, e, s), n[4](e);
|
|
3276
3410
|
},
|
|
3277
|
-
p:
|
|
3278
|
-
i:
|
|
3279
|
-
o:
|
|
3411
|
+
p: O,
|
|
3412
|
+
i: O,
|
|
3413
|
+
o: O,
|
|
3280
3414
|
d(t) {
|
|
3281
|
-
t && he(e),
|
|
3415
|
+
t && he(e), n[4](null);
|
|
3282
3416
|
}
|
|
3283
3417
|
};
|
|
3284
3418
|
}
|
|
3285
|
-
function
|
|
3286
|
-
let { tableModel:
|
|
3287
|
-
const
|
|
3288
|
-
|
|
3289
|
-
const
|
|
3290
|
-
onSelectionChanged(
|
|
3291
|
-
|
|
3419
|
+
function ft(n, e, t) {
|
|
3420
|
+
let { tableModel: s } = e, { tableOptions: o = new be() } = e, { licenseKey: i } = e, a;
|
|
3421
|
+
const l = xe();
|
|
3422
|
+
ve(() => {
|
|
3423
|
+
const c = {
|
|
3424
|
+
onSelectionChanged(d) {
|
|
3425
|
+
l("selectionChanged", d);
|
|
3292
3426
|
},
|
|
3293
|
-
onFocusChanged(
|
|
3294
|
-
|
|
3427
|
+
onFocusChanged(d) {
|
|
3428
|
+
l("focusChanged", d);
|
|
3295
3429
|
},
|
|
3296
|
-
onCheckboxChanged: (
|
|
3297
|
-
|
|
3430
|
+
onCheckboxChanged: (d) => {
|
|
3431
|
+
l("checkboxChanged", d);
|
|
3298
3432
|
},
|
|
3299
|
-
onContextmenu: (
|
|
3300
|
-
|
|
3433
|
+
onContextmenu: (d) => {
|
|
3434
|
+
l("contextmenu", d);
|
|
3301
3435
|
},
|
|
3302
|
-
onModelChanged: (
|
|
3303
|
-
|
|
3436
|
+
onModelChanged: (d) => {
|
|
3437
|
+
l("modelChanged", d);
|
|
3304
3438
|
},
|
|
3305
|
-
onMouseClicked: (
|
|
3306
|
-
|
|
3439
|
+
onMouseClicked: (d) => {
|
|
3440
|
+
l("mouseClicked", d);
|
|
3307
3441
|
},
|
|
3308
|
-
onMouseDragging: (
|
|
3309
|
-
|
|
3442
|
+
onMouseDragging: (d) => {
|
|
3443
|
+
l("mouseDragging", d);
|
|
3310
3444
|
},
|
|
3311
|
-
onMouseDraggingEnd: (
|
|
3312
|
-
|
|
3445
|
+
onMouseDraggingEnd: (d) => {
|
|
3446
|
+
l("mouseDraggingEnd", d);
|
|
3313
3447
|
},
|
|
3314
|
-
onMouseMoved: (
|
|
3315
|
-
|
|
3448
|
+
onMouseMoved: (d) => {
|
|
3449
|
+
l("mouseMoved", d);
|
|
3316
3450
|
}
|
|
3317
|
-
},
|
|
3318
|
-
|
|
3451
|
+
}, h = new se(a, s, new ue(), o, c);
|
|
3452
|
+
h.firstInit(), l("tableReady", h.getApi()), i && k.getInstance().setLicenseKey(i);
|
|
3319
3453
|
});
|
|
3320
|
-
function
|
|
3321
|
-
|
|
3322
|
-
|
|
3454
|
+
function r(c) {
|
|
3455
|
+
j[c ? "unshift" : "push"](() => {
|
|
3456
|
+
a = c, t(0, a);
|
|
3323
3457
|
});
|
|
3324
3458
|
}
|
|
3325
|
-
return
|
|
3326
|
-
"tableModel" in
|
|
3327
|
-
}, [
|
|
3459
|
+
return n.$$set = (c) => {
|
|
3460
|
+
"tableModel" in c && t(1, s = c.tableModel), "tableOptions" in c && t(2, o = c.tableOptions), "licenseKey" in c && t(3, i = c.licenseKey);
|
|
3461
|
+
}, [a, s, o, i, r];
|
|
3328
3462
|
}
|
|
3329
|
-
class
|
|
3463
|
+
class bt extends He {
|
|
3330
3464
|
constructor(e) {
|
|
3331
|
-
super(),
|
|
3465
|
+
super(), $e(this, e, ft, gt, Ce, {
|
|
3332
3466
|
tableModel: 1,
|
|
3333
3467
|
tableOptions: 2,
|
|
3334
3468
|
licenseKey: 3
|
|
@@ -3339,24 +3473,24 @@ class St {
|
|
|
3339
3473
|
constructor(e) {
|
|
3340
3474
|
this.Component = e;
|
|
3341
3475
|
}
|
|
3342
|
-
render(e, t,
|
|
3343
|
-
const
|
|
3476
|
+
render(e, t, s, o, i, a, l) {
|
|
3477
|
+
const r = new this.Component({
|
|
3344
3478
|
target: e,
|
|
3345
3479
|
props: {
|
|
3346
3480
|
cellDiv: e,
|
|
3347
3481
|
rowIndex: t,
|
|
3348
|
-
columnIndex:
|
|
3349
|
-
areaIdent:
|
|
3482
|
+
columnIndex: s,
|
|
3483
|
+
areaIdent: o,
|
|
3350
3484
|
areaModel: i,
|
|
3351
|
-
cellValue:
|
|
3485
|
+
cellValue: a
|
|
3352
3486
|
}
|
|
3353
3487
|
});
|
|
3354
3488
|
return () => {
|
|
3355
|
-
|
|
3489
|
+
r.$destroy();
|
|
3356
3490
|
};
|
|
3357
3491
|
}
|
|
3358
3492
|
}
|
|
3359
3493
|
export {
|
|
3360
3494
|
St as ComponentRendererWrapper,
|
|
3361
|
-
|
|
3495
|
+
bt as GuiexpertTable
|
|
3362
3496
|
};
|