@guiexpert/svelte-table 4.0.10 → 4.0.11
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 +1037 -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,25 @@ class Ne {
|
|
|
784
791
|
this.tableScope.focusModel()
|
|
785
792
|
);
|
|
786
793
|
}
|
|
794
|
+
/**
|
|
795
|
+
* Downloads an Excel file containing data from the table's header, body, and footer areas.
|
|
796
|
+
* Extracts the table data into a 2D matrix and uses the Excel service to generate and download the file.
|
|
797
|
+
*
|
|
798
|
+
* @return {void} No return value, downloads the Excel file directly.
|
|
799
|
+
*/
|
|
800
|
+
downloadExcel() {
|
|
801
|
+
const e = [], t = this.tableScope.tableModel.getColumnCount(), s = ["header", "body", "footer"];
|
|
802
|
+
for (const o of s) {
|
|
803
|
+
const i = this.tableScope.tableModel.getAreaModel(o), a = (i == null ? void 0 : i.getRowCount()) ?? 0;
|
|
804
|
+
for (let l = 0; l < a; l++) {
|
|
805
|
+
const r = [];
|
|
806
|
+
e.push(r);
|
|
807
|
+
for (let c = 0; c < t; c++)
|
|
808
|
+
r.push(i.getValueAt(l, c));
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
return this.tableScope.excelService.downloadExcel(e, "table.xlsx");
|
|
812
|
+
}
|
|
787
813
|
/**
|
|
788
814
|
* Retrieves the current scope of the table.
|
|
789
815
|
*
|
|
@@ -809,26 +835,26 @@ class ee {
|
|
|
809
835
|
autoConvertMapToObject(e) {
|
|
810
836
|
const t = {};
|
|
811
837
|
if (e instanceof Map) {
|
|
812
|
-
const
|
|
813
|
-
for (const
|
|
838
|
+
const s = e;
|
|
839
|
+
for (const o of [...s]) {
|
|
814
840
|
const [
|
|
815
841
|
i,
|
|
816
|
-
|
|
817
|
-
] =
|
|
818
|
-
t[i] =
|
|
842
|
+
a
|
|
843
|
+
] = o;
|
|
844
|
+
t[i] = a;
|
|
819
845
|
}
|
|
820
846
|
}
|
|
821
847
|
return t;
|
|
822
848
|
}
|
|
823
849
|
checkAndPersistItem(e, t) {
|
|
824
|
-
const
|
|
825
|
-
if (
|
|
826
|
-
const
|
|
827
|
-
if (
|
|
828
|
-
const i =
|
|
850
|
+
const s = this.getStorageKeyFn;
|
|
851
|
+
if (s) {
|
|
852
|
+
const o = s();
|
|
853
|
+
if (o) {
|
|
854
|
+
const i = o + e;
|
|
829
855
|
if ((t + "").includes("Map")) {
|
|
830
|
-
const
|
|
831
|
-
this.persistItem(i,
|
|
856
|
+
const a = this.autoConvertMapToObject(t);
|
|
857
|
+
this.persistItem(i, a);
|
|
832
858
|
} else
|
|
833
859
|
this.persistItem(i, t);
|
|
834
860
|
}
|
|
@@ -877,7 +903,7 @@ class ee {
|
|
|
877
903
|
// }
|
|
878
904
|
// }
|
|
879
905
|
}
|
|
880
|
-
class
|
|
906
|
+
class Ue extends ee {
|
|
881
907
|
constructor(e) {
|
|
882
908
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
883
909
|
}
|
|
@@ -892,21 +918,21 @@ class je extends ee {
|
|
|
892
918
|
if (e) {
|
|
893
919
|
const t = e();
|
|
894
920
|
if (t) {
|
|
895
|
-
const
|
|
896
|
-
let
|
|
897
|
-
this.scrollOffset =
|
|
921
|
+
const s = t + this.SCROLL_STATE;
|
|
922
|
+
let o = this.loadFromLocalStorage(s);
|
|
923
|
+
this.scrollOffset = o || [0, 0];
|
|
898
924
|
}
|
|
899
925
|
}
|
|
900
926
|
}
|
|
901
927
|
}
|
|
902
|
-
class
|
|
903
|
-
constructor(e = "collapsed", t = [],
|
|
904
|
-
this.mode = e, this.rowIds = t, this.allCollapsed =
|
|
928
|
+
class je {
|
|
929
|
+
constructor(e = "collapsed", t = [], s = !1, o = !1) {
|
|
930
|
+
this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = o;
|
|
905
931
|
}
|
|
906
932
|
}
|
|
907
|
-
class
|
|
933
|
+
class Xe extends ee {
|
|
908
934
|
constructor(e) {
|
|
909
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
935
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new je(), this.load();
|
|
910
936
|
}
|
|
911
937
|
collapsedExpandedStateGet() {
|
|
912
938
|
return this.collapsedExpandedState;
|
|
@@ -929,8 +955,8 @@ class Ke extends ee {
|
|
|
929
955
|
if (e) {
|
|
930
956
|
const t = e();
|
|
931
957
|
if (t) {
|
|
932
|
-
const
|
|
933
|
-
|
|
958
|
+
const s = t + this.COLLAPSED_EXPANDED_STATE, o = this.loadFromLocalStorage(s);
|
|
959
|
+
o && (this.collapsedExpandedState = o);
|
|
934
960
|
}
|
|
935
961
|
}
|
|
936
962
|
}
|
|
@@ -938,7 +964,7 @@ class Ke extends ee {
|
|
|
938
964
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
939
965
|
}
|
|
940
966
|
}
|
|
941
|
-
class
|
|
967
|
+
class Ke extends ee {
|
|
942
968
|
constructor(e) {
|
|
943
969
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
944
970
|
}
|
|
@@ -953,89 +979,89 @@ class Ye extends ee {
|
|
|
953
979
|
if (e) {
|
|
954
980
|
const t = e();
|
|
955
981
|
if (t) {
|
|
956
|
-
const
|
|
957
|
-
this.sortItems =
|
|
982
|
+
const s = t + this.SORTING_STATE, o = this.loadFromLocalStorage(s);
|
|
983
|
+
this.sortItems = o || [];
|
|
958
984
|
}
|
|
959
985
|
}
|
|
960
986
|
}
|
|
961
987
|
}
|
|
962
|
-
class
|
|
963
|
-
constructor(e = 0, t = 0,
|
|
964
|
-
this.left = e, this.width = t, this.height =
|
|
988
|
+
class R {
|
|
989
|
+
constructor(e = 0, t = 0, s = 0, o = 0, i) {
|
|
990
|
+
this.left = e, this.width = t, this.height = s, this.top = o, this.index = i;
|
|
965
991
|
}
|
|
966
992
|
}
|
|
967
|
-
class
|
|
968
|
-
constructor(e, t,
|
|
969
|
-
this.hostElement = e, this.tableModel = t, this.dom =
|
|
993
|
+
class Ye {
|
|
994
|
+
constructor(e, t, s, o) {
|
|
995
|
+
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
996
|
const i = this.hostElement;
|
|
971
997
|
i.innerText = "", this.dom.setAttribute(i, "tabindex", "0"), this.dom.setStyle(
|
|
972
998
|
this.dom.addClass("ge-table", i),
|
|
973
999
|
"position",
|
|
974
1000
|
"relative"
|
|
975
|
-
), this.hoverRow =
|
|
976
|
-
|
|
977
|
-
), this.hoverColumn =
|
|
978
|
-
|
|
979
|
-
), this.draggingColumn =
|
|
980
|
-
|
|
981
|
-
), this.areaHeaderWest =
|
|
982
|
-
|
|
983
|
-
|
|
1001
|
+
), this.hoverRow = s.applyStylePosistionAbsolute(
|
|
1002
|
+
s.createDivWithClass("ge-table-hover-row", i)
|
|
1003
|
+
), this.hoverColumn = s.applyStylePosistionAbsolute(
|
|
1004
|
+
s.createDivWithClass("ge-table-hover-column", i)
|
|
1005
|
+
), this.draggingColumn = s.applyStylePosistionAbsolute(
|
|
1006
|
+
s.createDivWithClass("ge-table-dragging-column", i)
|
|
1007
|
+
), this.areaHeaderWest = s.appendRelativeChildDiv(
|
|
1008
|
+
s.applyStylePosistionAbsolute(
|
|
1009
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-west", i, "header", "west")
|
|
984
1010
|
)
|
|
985
|
-
), this.areaHeaderCenter =
|
|
986
|
-
|
|
987
|
-
|
|
1011
|
+
), this.areaHeaderCenter = s.appendRelativeChildDiv(
|
|
1012
|
+
s.applyStylePosistionAbsolute(
|
|
1013
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-center", i, "header", "center")
|
|
988
1014
|
)
|
|
989
|
-
), this.areaHeaderEast =
|
|
990
|
-
|
|
991
|
-
|
|
1015
|
+
), this.areaHeaderEast = s.appendRelativeChildDiv(
|
|
1016
|
+
s.applyStylePosistionAbsolute(
|
|
1017
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-east", i, "body", "east")
|
|
992
1018
|
)
|
|
993
|
-
), this.areaBodyWest =
|
|
994
|
-
|
|
995
|
-
|
|
1019
|
+
), this.areaBodyWest = s.appendRelativeChildDiv(
|
|
1020
|
+
s.applyStylePosistionAbsolute(
|
|
1021
|
+
s.createAreaDivWithClass("ge-table-body ge-table-body-west", i, "body", "west")
|
|
996
1022
|
)
|
|
997
|
-
), this.areaBodyEast =
|
|
998
|
-
|
|
999
|
-
|
|
1023
|
+
), this.areaBodyEast = s.appendRelativeChildDiv(
|
|
1024
|
+
s.applyStylePosistionAbsolute(
|
|
1025
|
+
s.createAreaDivWithClass("ge-table-body ge-table-body-east", i, "body", "east")
|
|
1000
1026
|
)
|
|
1001
|
-
), this.areaFooterWest =
|
|
1002
|
-
|
|
1003
|
-
|
|
1027
|
+
), this.areaFooterWest = s.appendRelativeChildDiv(
|
|
1028
|
+
s.applyStylePosistionAbsolute(
|
|
1029
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-west", i, "footer", "west")
|
|
1004
1030
|
)
|
|
1005
|
-
), this.areaFooterCenter =
|
|
1006
|
-
|
|
1007
|
-
|
|
1031
|
+
), this.areaFooterCenter = s.appendRelativeChildDiv(
|
|
1032
|
+
s.applyStylePosistionAbsolute(
|
|
1033
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-center", i, "footer", "center")
|
|
1008
1034
|
)
|
|
1009
|
-
), this.areaFooterEast =
|
|
1010
|
-
|
|
1011
|
-
|
|
1035
|
+
), this.areaFooterEast = s.appendRelativeChildDiv(
|
|
1036
|
+
s.applyStylePosistionAbsolute(
|
|
1037
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-east", i, "footer", "east")
|
|
1012
1038
|
)
|
|
1013
|
-
), this.scrollViewport =
|
|
1039
|
+
), this.scrollViewport = s.applyStyleOverflowAuto(
|
|
1014
1040
|
this.tableOptions.overflowX ?? "auto",
|
|
1015
1041
|
this.tableOptions.overflowY ?? "auto",
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1042
|
+
s.applyStyleNoPadding(
|
|
1043
|
+
s.applyStylePosistionAbsolute(
|
|
1044
|
+
s.createAreaDivWithClass("ge-table-scroll-viewport", i, "body", "center")
|
|
1019
1045
|
)
|
|
1020
1046
|
)
|
|
1021
|
-
), this.contentWrapperDiv =
|
|
1022
|
-
|
|
1023
|
-
|
|
1047
|
+
), this.contentWrapperDiv = s.applyStyleNoPadding(
|
|
1048
|
+
s.applyStylePosistionRelative(
|
|
1049
|
+
s.createDivWithClass("ge-table-scroll-content-wrapper", this.scrollViewport)
|
|
1024
1050
|
)
|
|
1025
|
-
), this.contentDiv =
|
|
1026
|
-
|
|
1027
|
-
|
|
1051
|
+
), this.contentDiv = s.applyStyleNoPadding(
|
|
1052
|
+
s.applyStylePosistionRelative(
|
|
1053
|
+
s.createDivWithClass("ge-table-scroll-content", this.contentWrapperDiv)
|
|
1028
1054
|
)
|
|
1029
|
-
), this.areaBodyCenter =
|
|
1030
|
-
|
|
1031
|
-
), this.borderHeaderBottom =
|
|
1032
|
-
|
|
1033
|
-
), this.borderFixedWest =
|
|
1034
|
-
|
|
1035
|
-
), this.borderFixedEast =
|
|
1036
|
-
|
|
1037
|
-
), this.borderFooterTop =
|
|
1038
|
-
|
|
1055
|
+
), this.areaBodyCenter = s.appendRelativeChildDiv(
|
|
1056
|
+
s.createDivWithClass("ge-table-body-center", this.contentDiv)
|
|
1057
|
+
), this.borderHeaderBottom = s.applyStylePosistionAbsolute(
|
|
1058
|
+
s.createDivWithClass("ge-table-header-border", i)
|
|
1059
|
+
), this.borderFixedWest = s.applyStylePosistionAbsolute(
|
|
1060
|
+
s.createDivWithClass("ge-table-west-fixed-column-border", i)
|
|
1061
|
+
), this.borderFixedEast = s.applyStylePosistionAbsolute(
|
|
1062
|
+
s.createDivWithClass("ge-table-east-fixed-column-border", i)
|
|
1063
|
+
), this.borderFooterTop = s.applyStylePosistionAbsolute(
|
|
1064
|
+
s.createDivWithClass("ge-table-footer-border", i)
|
|
1039
1065
|
);
|
|
1040
1066
|
}
|
|
1041
1067
|
/**
|
|
@@ -1044,10 +1070,10 @@ class qe {
|
|
|
1044
1070
|
* @return {void}
|
|
1045
1071
|
*/
|
|
1046
1072
|
adjustContainersAndRows() {
|
|
1047
|
-
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth,
|
|
1073
|
+
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth, s = this.hostElement.clientHeight;
|
|
1048
1074
|
this.dom.applyStyle(this.scrollViewport, {
|
|
1049
1075
|
width: `${t - e.left}px`,
|
|
1050
|
-
height: `${
|
|
1076
|
+
height: `${s - e.top}px`,
|
|
1051
1077
|
top: `${e.top}px`,
|
|
1052
1078
|
left: `${e.left}px`
|
|
1053
1079
|
}), this.scrollTop = this.scrollViewport.scrollTop, this.dom.applyStyle(this.contentDiv, {
|
|
@@ -1055,21 +1081,21 @@ class qe {
|
|
|
1055
1081
|
height: `${this.scrollViewport.clientHeight}px`,
|
|
1056
1082
|
top: `${this.scrollTop}px`,
|
|
1057
1083
|
left: `${this.scrollViewport.scrollLeft}px`
|
|
1058
|
-
}), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height =
|
|
1084
|
+
}), 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
1085
|
this.dom.applyStyle(this.borderFixedWest, {
|
|
1060
1086
|
width: "1px",
|
|
1061
1087
|
height: `${this.areaBodyWestGeo.height}px`,
|
|
1062
1088
|
top: `${this.areaBodyWestGeo.top}px`,
|
|
1063
1089
|
left: `${this.areaBodyWestGeo.width}px`
|
|
1064
1090
|
})
|
|
1065
|
-
) : this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height =
|
|
1091
|
+
) : 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
1092
|
this.dom.applyStyle(this.borderFixedEast, {
|
|
1067
1093
|
width: "1px",
|
|
1068
1094
|
height: `${this.areaBodyEastGeo.height}px`,
|
|
1069
1095
|
top: `${this.areaBodyEastGeo.top}px`,
|
|
1070
1096
|
left: `${this.areaBodyEastGeo.left}px`
|
|
1071
1097
|
})
|
|
1072
|
-
) : this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = t - e.left - e.right, this.areaBodyCenterGeo.height =
|
|
1098
|
+
) : 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
1099
|
width: `${t - e.left - e.right}px`,
|
|
1074
1100
|
height: `${e.top}px`,
|
|
1075
1101
|
top: "0",
|
|
@@ -1094,23 +1120,23 @@ class qe {
|
|
|
1094
1120
|
) : this.dom.applyDisplayNoneStyle(this.borderHeaderBottom), this.dom.applyStyle(this.areaFooterWest.parent, {
|
|
1095
1121
|
width: `${e.left}px`,
|
|
1096
1122
|
height: `${e.bottom}px`,
|
|
1097
|
-
top: `${
|
|
1123
|
+
top: `${s - e.bottom}px`,
|
|
1098
1124
|
left: "0"
|
|
1099
1125
|
}), this.dom.applyStyle(this.areaFooterCenter.parent, {
|
|
1100
1126
|
width: `${t - e.left - e.right}px`,
|
|
1101
1127
|
height: `${e.bottom}px`,
|
|
1102
|
-
top: `${
|
|
1128
|
+
top: `${s - e.bottom}px`,
|
|
1103
1129
|
left: `${e.left}px`
|
|
1104
1130
|
}), this.dom.applyStyle(this.areaFooterEast.parent, {
|
|
1105
1131
|
width: `${e.right}px`,
|
|
1106
1132
|
height: `${e.bottom}px`,
|
|
1107
|
-
top: `${
|
|
1133
|
+
top: `${s - e.bottom}px`,
|
|
1108
1134
|
left: `${t - e.right}px`
|
|
1109
1135
|
}), this.tableOptions.footerSeparatorBorderVisible && this.tableModel.isFooterVisibe() ? this.dom.applyDisplayBlockStyle(
|
|
1110
1136
|
this.dom.applyStyle(this.borderFooterTop, {
|
|
1111
1137
|
width: `${t}px`,
|
|
1112
1138
|
height: "1px",
|
|
1113
|
-
top: `${
|
|
1139
|
+
top: `${s - e.bottom}px`,
|
|
1114
1140
|
left: "0px"
|
|
1115
1141
|
})
|
|
1116
1142
|
) : this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.adjustAfterScrolling();
|
|
@@ -1145,8 +1171,8 @@ class E {
|
|
|
1145
1171
|
* @param {number} c2 - The value for c2.
|
|
1146
1172
|
* @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
|
|
1147
1173
|
*/
|
|
1148
|
-
constructor(e, t,
|
|
1149
|
-
this.r1 = e, this.c1 = t, this.r2 =
|
|
1174
|
+
constructor(e, t, s, o, i = !1) {
|
|
1175
|
+
this.r1 = e, this.c1 = t, this.r2 = s, this.c2 = o, this.gammaRange = i;
|
|
1150
1176
|
}
|
|
1151
1177
|
static create(e) {
|
|
1152
1178
|
return e.gammaRange === void 0 && (e.gammaRange = !1), new E(
|
|
@@ -1170,7 +1196,7 @@ class E {
|
|
|
1170
1196
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
1171
1197
|
}
|
|
1172
1198
|
}
|
|
1173
|
-
class
|
|
1199
|
+
class Je {
|
|
1174
1200
|
constructor(e, t) {
|
|
1175
1201
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
1176
1202
|
}
|
|
@@ -1179,14 +1205,14 @@ class Ue {
|
|
|
1179
1205
|
return;
|
|
1180
1206
|
this.colAndRowspanRanges = [];
|
|
1181
1207
|
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
|
|
1208
|
+
for (let s = 0; s < e; s++)
|
|
1209
|
+
for (let o = 0; o < t; o++) {
|
|
1210
|
+
let i = this.areaModel.getColspanAt(s, o), a = this.areaModel.getRowspanAt(s, o);
|
|
1211
|
+
if (i > 1 || a > 1) {
|
|
1212
|
+
i === 0 && (i = 1), a === 0 && (a = 1);
|
|
1213
|
+
const l = "gammaCells" in this.areaModel;
|
|
1188
1214
|
this.colAndRowspanRanges.push(
|
|
1189
|
-
new E(o, s
|
|
1215
|
+
new E(s, o, s + a - 1, o + i - 1, l)
|
|
1190
1216
|
);
|
|
1191
1217
|
}
|
|
1192
1218
|
}
|
|
@@ -1196,29 +1222,29 @@ class Ue {
|
|
|
1196
1222
|
}
|
|
1197
1223
|
isInRange(e, t) {
|
|
1198
1224
|
if (this.colAndRowspanRanges) {
|
|
1199
|
-
for (const
|
|
1200
|
-
if (
|
|
1225
|
+
for (const s of this.colAndRowspanRanges)
|
|
1226
|
+
if (s.isInRange(e, t))
|
|
1201
1227
|
return !0;
|
|
1202
1228
|
}
|
|
1203
1229
|
return !1;
|
|
1204
1230
|
}
|
|
1205
1231
|
}
|
|
1206
|
-
class
|
|
1207
|
-
constructor(e, t,
|
|
1208
|
-
this.header = e, this.body = t, this.footer =
|
|
1232
|
+
class qe {
|
|
1233
|
+
constructor(e, t, s) {
|
|
1234
|
+
this.header = e, this.body = t, this.footer = s;
|
|
1209
1235
|
}
|
|
1210
1236
|
}
|
|
1211
|
-
class
|
|
1212
|
-
constructor(e, t,
|
|
1213
|
-
var
|
|
1214
|
-
super(e, t,
|
|
1237
|
+
class Ze extends Ye {
|
|
1238
|
+
constructor(e, t, s, o) {
|
|
1239
|
+
var a, l;
|
|
1240
|
+
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
1241
|
header: [],
|
|
1216
1242
|
body: [],
|
|
1217
1243
|
footer: []
|
|
1218
|
-
}, this.tree = !1, this.colAndRowspanModels = new
|
|
1219
|
-
(
|
|
1220
|
-
var
|
|
1221
|
-
this.colAndRowspanModels[
|
|
1244
|
+
}, 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(
|
|
1245
|
+
(r) => {
|
|
1246
|
+
var c;
|
|
1247
|
+
this.colAndRowspanModels[r] = new Je(t, t.getAreaModel(r)), (c = this.colAndRowspanModels[r]) == null || c.init();
|
|
1222
1248
|
}
|
|
1223
1249
|
);
|
|
1224
1250
|
}
|
|
@@ -1256,10 +1282,10 @@ class Qe extends qe {
|
|
|
1256
1282
|
* @param {number} colIdx - The index of the column.
|
|
1257
1283
|
*/
|
|
1258
1284
|
initRenderEditor(e, t) {
|
|
1259
|
-
var
|
|
1260
|
-
let
|
|
1261
|
-
if (
|
|
1262
|
-
if (this.editorRenderer =
|
|
1285
|
+
var o;
|
|
1286
|
+
let s = (o = this.tableModel.getColumnDef(t)) == null ? void 0 : o.getEditRenderer;
|
|
1287
|
+
if (s || (s = this.tableOptions.getEditRenderer), s)
|
|
1288
|
+
if (this.editorRenderer = s(e, t), this.editorRenderer) {
|
|
1263
1289
|
this.editorRendererRow = e, this.editorRendererColumn = t, this.editing = !0, this.repaint();
|
|
1264
1290
|
const i = document.querySelector("input.ge-table-cell-editor-input");
|
|
1265
1291
|
i && i.focus();
|
|
@@ -1304,19 +1330,19 @@ class Qe extends qe {
|
|
|
1304
1330
|
for (const t of this.removables)
|
|
1305
1331
|
t.remove();
|
|
1306
1332
|
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
|
|
1333
|
+
new R(0, this.hostElement.clientWidth, 1, 0),
|
|
1308
1334
|
this.hostElement,
|
|
1309
1335
|
"ge-table-border"
|
|
1310
1336
|
)), this.tableOptions.tableBottomBorderVisible && this.removables.push(this.dom.addHorizontalBorder(
|
|
1311
|
-
new
|
|
1337
|
+
new R(0, this.hostElement.clientWidth, 1, this.hostElement.clientHeight - 1),
|
|
1312
1338
|
this.hostElement,
|
|
1313
1339
|
"ge-table-border"
|
|
1314
1340
|
)), this.tableModel.getFixedLeftColumnCount() > 0 && this.removables.push(this.dom.addVerticalBorder(
|
|
1315
|
-
new
|
|
1341
|
+
new R(this.areaBodyWest.child.clientWidth, 1, this.hostElement.clientHeight, 0),
|
|
1316
1342
|
this.hostElement,
|
|
1317
1343
|
"ge-table-body-west-vertical-border"
|
|
1318
1344
|
)), ((e = this.tableModel.getAreaModel("header")) == null ? void 0 : e.getRowCount()) > 0 && this.removables.push(this.dom.addHorizontalBorder(
|
|
1319
|
-
new
|
|
1345
|
+
new R(0, this.hostElement.clientWidth, 1, this.areaHeaderCenter.child.clientHeight),
|
|
1320
1346
|
this.hostElement,
|
|
1321
1347
|
"ge-table-body-west-vertical-border"
|
|
1322
1348
|
));
|
|
@@ -1340,8 +1366,8 @@ class Qe extends qe {
|
|
|
1340
1366
|
*/
|
|
1341
1367
|
updateCells(e, t = !1) {
|
|
1342
1368
|
e.forEach(
|
|
1343
|
-
(
|
|
1344
|
-
this.tableModel.getAreaModel(
|
|
1369
|
+
(s) => {
|
|
1370
|
+
this.tableModel.getAreaModel(s.area).setValue(s.rowIndex, s.columnIndex, s.value), t || this.rerenderCellContent(s);
|
|
1345
1371
|
}
|
|
1346
1372
|
), t && this.repaint();
|
|
1347
1373
|
}
|
|
@@ -1354,23 +1380,24 @@ class Qe extends qe {
|
|
|
1354
1380
|
* @param {any} value - The new value to be displayed in the cell.
|
|
1355
1381
|
* @param {string[]} cssClasses - An array of CSS classes to be applied to the cell.
|
|
1356
1382
|
*/
|
|
1357
|
-
rerenderCellContent({ area: e, rowIndex: t, columnIndex:
|
|
1358
|
-
const
|
|
1359
|
-
if (
|
|
1383
|
+
rerenderCellContent({ area: e, rowIndex: t, columnIndex: s, value: o, cssClasses: i }) {
|
|
1384
|
+
const a = this.tableModel.getAreaModel(e), l = 'div[data-col-index="' + s + '"][data-row-index="' + t + '"][data-area="' + e + '"]', r = document.querySelector(l);
|
|
1385
|
+
if (r) {
|
|
1386
|
+
let c;
|
|
1387
|
+
const h = this.editorRenderer && this.editorRendererRow === t && this.editorRendererColumn === s;
|
|
1360
1388
|
let d;
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
d = h.render(l, t, o, e, r, s, this.dom.domService), d && this.cleanupFunctions[e].push(d);
|
|
1389
|
+
if (h ? d = this.editorRenderer : d = a.getCellRenderer(t, s), r.innerText = "", this.applyCssClasses(r, i), d)
|
|
1390
|
+
c = d.render(r, t, s, e, a, o, this.dom.domService), c && this.cleanupFunctions[e].push(c);
|
|
1364
1391
|
else {
|
|
1365
|
-
const
|
|
1366
|
-
this.dom.addLabelDiv(
|
|
1392
|
+
const g = `${o}`;
|
|
1393
|
+
this.dom.addLabelDiv(r, g, !1, t, s, e);
|
|
1367
1394
|
}
|
|
1368
|
-
const
|
|
1369
|
-
|
|
1370
|
-
const
|
|
1371
|
-
if (
|
|
1372
|
-
for (const
|
|
1373
|
-
this.dom.setStyle(
|
|
1395
|
+
const p = a.getCustomClassesAt(t, s);
|
|
1396
|
+
p.length && this.dom.addClasses(p, r);
|
|
1397
|
+
const u = a.getCustomStyleAt(t, s);
|
|
1398
|
+
if (u)
|
|
1399
|
+
for (const g in u)
|
|
1400
|
+
this.dom.setStyle(r, g, u[g]);
|
|
1374
1401
|
}
|
|
1375
1402
|
}
|
|
1376
1403
|
/**
|
|
@@ -1382,13 +1409,13 @@ class Qe extends qe {
|
|
|
1382
1409
|
*/
|
|
1383
1410
|
storeColumnWidths() {
|
|
1384
1411
|
const e = this.tableModel.getColumnDefs();
|
|
1385
|
-
e != null && e.length && (this.storedColumnWidths = e.map((t,
|
|
1412
|
+
e != null && e.length && (this.storedColumnWidths = e.map((t, s) => this.tableModel.getColumnWidth(s)));
|
|
1386
1413
|
}
|
|
1387
1414
|
getAreaAndSideIdentByAttr(e) {
|
|
1388
1415
|
if (e) {
|
|
1389
|
-
const t = this.getStringByAttr(e, "data-area"),
|
|
1390
|
-
if (
|
|
1391
|
-
return [t,
|
|
1416
|
+
const t = this.getStringByAttr(e, "data-area"), s = this.getStringByAttr(e, "data-side");
|
|
1417
|
+
if (s && t)
|
|
1418
|
+
return [t, s];
|
|
1392
1419
|
}
|
|
1393
1420
|
return [void 0, void 0];
|
|
1394
1421
|
}
|
|
@@ -1445,11 +1472,11 @@ class Qe extends qe {
|
|
|
1445
1472
|
* @protected
|
|
1446
1473
|
*/
|
|
1447
1474
|
getNumberByAttr(e, t) {
|
|
1448
|
-
var
|
|
1475
|
+
var s;
|
|
1449
1476
|
if (e) {
|
|
1450
|
-
const
|
|
1451
|
-
if (
|
|
1452
|
-
return Number(
|
|
1477
|
+
const o = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
|
|
1478
|
+
if (o)
|
|
1479
|
+
return Number(o);
|
|
1453
1480
|
}
|
|
1454
1481
|
return -1;
|
|
1455
1482
|
}
|
|
@@ -1462,11 +1489,11 @@ class Qe extends qe {
|
|
|
1462
1489
|
* @protected
|
|
1463
1490
|
*/
|
|
1464
1491
|
getStringByAttr(e, t) {
|
|
1465
|
-
var
|
|
1492
|
+
var s;
|
|
1466
1493
|
if (e) {
|
|
1467
|
-
const
|
|
1468
|
-
if (
|
|
1469
|
-
return
|
|
1494
|
+
const o = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
|
|
1495
|
+
if (o)
|
|
1496
|
+
return o;
|
|
1470
1497
|
}
|
|
1471
1498
|
return "";
|
|
1472
1499
|
}
|
|
@@ -1479,87 +1506,87 @@ class Qe extends qe {
|
|
|
1479
1506
|
* @protected
|
|
1480
1507
|
*/
|
|
1481
1508
|
adjustArea(e, t = 0) {
|
|
1482
|
-
var
|
|
1483
|
-
const
|
|
1484
|
-
|
|
1485
|
-
const
|
|
1509
|
+
var f;
|
|
1510
|
+
const s = this.getArea(e, "west"), o = this.getArea(e, "center"), i = this.getArea(e, "east"), a = o.child.clientHeight;
|
|
1511
|
+
s.child.innerText = "", o.child.innerText = "", i.child.innerText = "";
|
|
1512
|
+
const l = 0, r = this.areaBodyCenterGeo.width, c = this.tableModel.getPadding(), h = this.tableModel.getAreaModel(e), d = h.getRowCount();
|
|
1486
1513
|
for (; this.cleanupFunctions[e].length; ) {
|
|
1487
|
-
const
|
|
1488
|
-
|
|
1514
|
+
const m = this.cleanupFunctions[e].shift();
|
|
1515
|
+
m && m();
|
|
1489
1516
|
}
|
|
1490
|
-
let
|
|
1491
|
-
const
|
|
1492
|
-
for (let
|
|
1493
|
-
const
|
|
1494
|
-
if (
|
|
1495
|
-
this.firstVisibleRowIndex =
|
|
1496
|
-
let y = { left:
|
|
1497
|
-
const
|
|
1517
|
+
let p = t;
|
|
1518
|
+
const u = this.tableModel.getColumnCount(), g = this.tableModel.getFixedRightColumnCount(), b = this.tableModel.getFixedLeftColumnCount();
|
|
1519
|
+
for (let m = 0; m < d; m++) {
|
|
1520
|
+
const x = p, v = m === d - 1, w = this.tableModel.getRowHeight(e, m);
|
|
1521
|
+
if (x + w > 0) {
|
|
1522
|
+
this.firstVisibleRowIndex = m;
|
|
1523
|
+
let y = { left: l, width: r, height: w, top: x, index: m }, S = this.dom.addRowDiv(o, y, m, e, "center");
|
|
1524
|
+
const T = b;
|
|
1498
1525
|
if (this.adjustColumnsToRowParent({
|
|
1499
1526
|
areaIdent: e,
|
|
1500
1527
|
sideIdent: "center",
|
|
1501
|
-
areaModel:
|
|
1528
|
+
areaModel: h,
|
|
1502
1529
|
geo: y,
|
|
1503
|
-
parent:
|
|
1504
|
-
rowIndex:
|
|
1505
|
-
columnIndexStart:
|
|
1506
|
-
columnIndexEnd:
|
|
1530
|
+
parent: S,
|
|
1531
|
+
rowIndex: m,
|
|
1532
|
+
columnIndexStart: T,
|
|
1533
|
+
columnIndexEnd: u - g - 1,
|
|
1507
1534
|
verticalFixed: !1,
|
|
1508
|
-
lastRowOfModel:
|
|
1509
|
-
}),
|
|
1535
|
+
lastRowOfModel: v
|
|
1536
|
+
}), 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
1537
|
areaIdent: e,
|
|
1511
1538
|
sideIdent: "west",
|
|
1512
|
-
areaModel:
|
|
1539
|
+
areaModel: h,
|
|
1513
1540
|
geo: y,
|
|
1514
|
-
parent:
|
|
1515
|
-
rowIndex:
|
|
1541
|
+
parent: S,
|
|
1542
|
+
rowIndex: m,
|
|
1516
1543
|
columnIndexStart: 0,
|
|
1517
|
-
columnIndexEnd:
|
|
1544
|
+
columnIndexEnd: T - 1,
|
|
1518
1545
|
verticalFixed: !0,
|
|
1519
|
-
lastRowOfModel:
|
|
1520
|
-
})),
|
|
1546
|
+
lastRowOfModel: v
|
|
1547
|
+
})), 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
1548
|
areaIdent: e,
|
|
1522
1549
|
sideIdent: "east",
|
|
1523
|
-
areaModel:
|
|
1550
|
+
areaModel: h,
|
|
1524
1551
|
geo: y,
|
|
1525
|
-
parent:
|
|
1526
|
-
rowIndex:
|
|
1527
|
-
columnIndexStart:
|
|
1528
|
-
columnIndexEnd:
|
|
1552
|
+
parent: S,
|
|
1553
|
+
rowIndex: m,
|
|
1554
|
+
columnIndexStart: u - g,
|
|
1555
|
+
columnIndexEnd: u - 1,
|
|
1529
1556
|
verticalFixed: !0,
|
|
1530
|
-
lastRowOfModel:
|
|
1531
|
-
})), e === "header" && this.tree &&
|
|
1557
|
+
lastRowOfModel: v
|
|
1558
|
+
})), e === "header" && this.tree && m === d - 1) {
|
|
1532
1559
|
const A = this.dom.applyStyle(
|
|
1533
1560
|
this.dom.setAttribute(
|
|
1534
|
-
this.dom.addDiv(
|
|
1561
|
+
this.dom.addDiv(S, new R(16, 20, 20, 8)),
|
|
1535
1562
|
"data-ge-action",
|
|
1536
1563
|
"toggleExpandCollapseAll"
|
|
1537
1564
|
),
|
|
1538
1565
|
{ cursor: "pointer" }
|
|
1539
1566
|
), M = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1540
1567
|
if (M) {
|
|
1541
|
-
const
|
|
1542
|
-
this.dom.domService.appendChild(A,
|
|
1568
|
+
const H = this.dom.domService.createText(M.content);
|
|
1569
|
+
this.dom.domService.appendChild(A, H), M.style && this.dom.applyStyleString(A, M.style);
|
|
1543
1570
|
}
|
|
1544
1571
|
}
|
|
1545
1572
|
}
|
|
1546
|
-
if (
|
|
1573
|
+
if (p = p + w, p > a)
|
|
1547
1574
|
break;
|
|
1548
1575
|
}
|
|
1549
1576
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1550
|
-
const
|
|
1551
|
-
if (
|
|
1552
|
-
for (const
|
|
1553
|
-
let
|
|
1554
|
-
if (
|
|
1555
|
-
|
|
1556
|
-
else if (
|
|
1557
|
-
|
|
1577
|
+
const m = ((f = this.colAndRowspanModels[e]) == null ? void 0 : f.getRanges()) ?? [];
|
|
1578
|
+
if (m.length)
|
|
1579
|
+
for (const x of m) {
|
|
1580
|
+
let v = 0, w = o.child, y = "center";
|
|
1581
|
+
if (x.c1 < b)
|
|
1582
|
+
w = s.child, y = "west";
|
|
1583
|
+
else if (g > 0 && x.c1 >= u - g)
|
|
1584
|
+
w = i.child, y = "east";
|
|
1558
1585
|
else {
|
|
1559
|
-
const
|
|
1560
|
-
|
|
1586
|
+
const S = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1587
|
+
v = this.scrollFactorX * S - this.areaBodyWestGeo.width, y = "center";
|
|
1561
1588
|
}
|
|
1562
|
-
this.drawBigCell(
|
|
1589
|
+
this.drawBigCell(x, v, t, h, w, y);
|
|
1563
1590
|
}
|
|
1564
1591
|
}
|
|
1565
1592
|
}
|
|
@@ -1573,48 +1600,48 @@ class Qe extends qe {
|
|
|
1573
1600
|
* @param sideIdent SideIdent (west,center,east)
|
|
1574
1601
|
* @protected
|
|
1575
1602
|
*/
|
|
1576
|
-
drawBigCell(e, t,
|
|
1577
|
-
const
|
|
1578
|
-
let
|
|
1579
|
-
|
|
1580
|
-
const
|
|
1581
|
-
let
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1584
|
-
areaModel:
|
|
1585
|
-
areaIdent:
|
|
1586
|
-
sideIdent:
|
|
1603
|
+
drawBigCell(e, t, s, o, i, a) {
|
|
1604
|
+
const l = s + this.getRowHeights(0, e.r1 - 1, o).reduce((f, m) => f + m, 0), r = this.tableModel.getColumnCount(), c = this.tableModel.getFixedRightColumnCount();
|
|
1605
|
+
let h = 0;
|
|
1606
|
+
c > 0 && e.c1 >= r - c && (h = r - c);
|
|
1607
|
+
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);
|
|
1608
|
+
let g = !1;
|
|
1609
|
+
const b = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
1610
|
+
b && (g = b.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? this.renderCell({
|
|
1611
|
+
areaModel: o,
|
|
1612
|
+
areaIdent: o.areaIdent,
|
|
1613
|
+
sideIdent: a,
|
|
1587
1614
|
rowIndex: e.r1,
|
|
1588
1615
|
columnIndex: e.c1,
|
|
1589
|
-
left:
|
|
1590
|
-
top:
|
|
1591
|
-
width:
|
|
1592
|
-
height:
|
|
1616
|
+
left: d,
|
|
1617
|
+
top: l,
|
|
1618
|
+
width: u,
|
|
1619
|
+
height: p,
|
|
1593
1620
|
parent: i,
|
|
1594
|
-
cellSelected:
|
|
1621
|
+
cellSelected: g,
|
|
1595
1622
|
lastRowOfModel: !0,
|
|
1596
1623
|
gammaRange: e.gammaRange
|
|
1597
1624
|
}) : this.renderCell({
|
|
1598
|
-
areaModel:
|
|
1599
|
-
areaIdent:
|
|
1600
|
-
sideIdent:
|
|
1625
|
+
areaModel: o,
|
|
1626
|
+
areaIdent: o.areaIdent,
|
|
1627
|
+
sideIdent: a,
|
|
1601
1628
|
rowIndex: e.r1,
|
|
1602
1629
|
columnIndex: e.c1,
|
|
1603
|
-
left:
|
|
1604
|
-
top:
|
|
1605
|
-
width:
|
|
1606
|
-
height:
|
|
1630
|
+
left: d,
|
|
1631
|
+
top: l,
|
|
1632
|
+
width: u,
|
|
1633
|
+
height: p,
|
|
1607
1634
|
parent: i,
|
|
1608
|
-
cellSelected:
|
|
1635
|
+
cellSelected: g,
|
|
1609
1636
|
lastRowOfModel: !0,
|
|
1610
1637
|
gammaRange: e.gammaRange
|
|
1611
|
-
}),
|
|
1638
|
+
}), o.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1612
1639
|
rowIndex: e.r1,
|
|
1613
1640
|
columnIndex: e.c1,
|
|
1614
|
-
cellLeft:
|
|
1615
|
-
cellTop:
|
|
1616
|
-
cellWidth:
|
|
1617
|
-
cellHeight:
|
|
1641
|
+
cellLeft: d,
|
|
1642
|
+
cellTop: l,
|
|
1643
|
+
cellWidth: u,
|
|
1644
|
+
cellHeight: p,
|
|
1618
1645
|
parent: i
|
|
1619
1646
|
});
|
|
1620
1647
|
}
|
|
@@ -1627,13 +1654,13 @@ class Qe extends qe {
|
|
|
1627
1654
|
* @returns {number} - The row index of the important rowspan cell, or -1 if not found.
|
|
1628
1655
|
* @protected
|
|
1629
1656
|
*/
|
|
1630
|
-
findRowOfImportantRowspanCell(e, t,
|
|
1631
|
-
const
|
|
1657
|
+
findRowOfImportantRowspanCell(e, t, s) {
|
|
1658
|
+
const o = e.getMaxRowspan();
|
|
1632
1659
|
for (let i = t - 1; i > -1; i--) {
|
|
1633
|
-
const
|
|
1634
|
-
if (
|
|
1660
|
+
const a = e.getRowspanAt(i, s);
|
|
1661
|
+
if (a > 1 && i + a + 1 >= t)
|
|
1635
1662
|
return i;
|
|
1636
|
-
if (t - i >
|
|
1663
|
+
if (t - i > o)
|
|
1637
1664
|
return -1;
|
|
1638
1665
|
}
|
|
1639
1666
|
return -1;
|
|
@@ -1648,68 +1675,68 @@ class Qe extends qe {
|
|
|
1648
1675
|
adjustColumnsToRowParent({
|
|
1649
1676
|
areaIdent: e,
|
|
1650
1677
|
sideIdent: t,
|
|
1651
|
-
areaModel:
|
|
1652
|
-
geo:
|
|
1678
|
+
areaModel: s,
|
|
1679
|
+
geo: o,
|
|
1653
1680
|
parent: i,
|
|
1654
|
-
rowIndex:
|
|
1655
|
-
columnIndexStart:
|
|
1656
|
-
columnIndexEnd:
|
|
1657
|
-
verticalFixed:
|
|
1658
|
-
lastRowOfModel:
|
|
1681
|
+
rowIndex: a,
|
|
1682
|
+
columnIndexStart: l,
|
|
1683
|
+
columnIndexEnd: r,
|
|
1684
|
+
verticalFixed: c = !1,
|
|
1685
|
+
lastRowOfModel: h = !1
|
|
1659
1686
|
}) {
|
|
1660
|
-
var
|
|
1687
|
+
var b;
|
|
1661
1688
|
this.scrollViewportLeft = this.scrollViewport.scrollLeft;
|
|
1662
|
-
let
|
|
1663
|
-
if (!
|
|
1664
|
-
const
|
|
1665
|
-
|
|
1689
|
+
let d = 0;
|
|
1690
|
+
if (!c) {
|
|
1691
|
+
const f = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1692
|
+
d = this.scrollFactorX * f;
|
|
1666
1693
|
}
|
|
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:
|
|
1694
|
+
const p = 0, u = !!(e === "body" && t);
|
|
1695
|
+
let g = d;
|
|
1696
|
+
for (let f = l; f <= r; f++) {
|
|
1697
|
+
const m = g, x = this.tableModel.getColumnWidth(f);
|
|
1698
|
+
if (x > 0 && m + x > 0) {
|
|
1699
|
+
let v = o.height;
|
|
1700
|
+
const w = s.getRowspanAt(a, f), y = s.getColspanAt(a, f);
|
|
1701
|
+
w > 1 && (v = this.getRowHeights(a, a + w - 1, s).reduce((A, M) => A + M, 0));
|
|
1702
|
+
let S = x;
|
|
1703
|
+
y > 1 && (S = this.getColumnWidths(f, f + y - 1).reduce((A, M) => A + M, 0));
|
|
1704
|
+
let T = !1;
|
|
1705
|
+
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (b = this.colAndRowspanModels[e]) != null && b.isInRange(a, f) && (T = !0), this.draggingTargetColumnIndex === f && e !== "header") {
|
|
1706
|
+
this.renderDragTargetDiv(i, m, p, S, v);
|
|
1707
|
+
const A = { left: m, top: p, width: S, height: v };
|
|
1681
1708
|
this.dom.addColumnBorderDivs(this.tableOptions, i, A, e, t);
|
|
1682
1709
|
} else {
|
|
1683
|
-
const A = this.renderSelectedBackgroundDiv(
|
|
1684
|
-
"gammaCells" in
|
|
1685
|
-
areaModel:
|
|
1710
|
+
const A = this.renderSelectedBackgroundDiv(T, u, t, s, a, f, i, m, p, S, v);
|
|
1711
|
+
"gammaCells" in s && s.getValueAt(a, f) && (T = !1), T || this.renderCell({
|
|
1712
|
+
areaModel: s,
|
|
1686
1713
|
areaIdent: e,
|
|
1687
1714
|
sideIdent: t,
|
|
1688
|
-
rowIndex:
|
|
1689
|
-
columnIndex:
|
|
1690
|
-
left:
|
|
1691
|
-
top:
|
|
1692
|
-
width:
|
|
1693
|
-
height:
|
|
1715
|
+
rowIndex: a,
|
|
1716
|
+
columnIndex: f,
|
|
1717
|
+
left: m,
|
|
1718
|
+
top: p,
|
|
1719
|
+
width: S,
|
|
1720
|
+
height: v,
|
|
1694
1721
|
parent: i,
|
|
1695
1722
|
cellSelected: A,
|
|
1696
|
-
lastRowOfModel:
|
|
1723
|
+
lastRowOfModel: h,
|
|
1697
1724
|
gammaRange: !0
|
|
1698
1725
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1699
|
-
rowIndex:
|
|
1700
|
-
columnIndex:
|
|
1701
|
-
cellLeft:
|
|
1702
|
-
cellTop:
|
|
1703
|
-
cellWidth:
|
|
1704
|
-
cellHeight:
|
|
1726
|
+
rowIndex: a,
|
|
1727
|
+
columnIndex: f,
|
|
1728
|
+
cellLeft: m,
|
|
1729
|
+
cellTop: p,
|
|
1730
|
+
cellWidth: S,
|
|
1731
|
+
cellHeight: v,
|
|
1705
1732
|
parent: i
|
|
1706
1733
|
});
|
|
1707
1734
|
}
|
|
1708
1735
|
}
|
|
1709
|
-
if (
|
|
1736
|
+
if (g = g + x, g > this.areaBodyCenterGeo.width)
|
|
1710
1737
|
break;
|
|
1711
1738
|
}
|
|
1712
|
-
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new
|
|
1739
|
+
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new R(g - 1, 1, o.height, 0), i);
|
|
1713
1740
|
}
|
|
1714
1741
|
/**
|
|
1715
1742
|
* Retrieves the column index of the tree arrow column in the table.
|
|
@@ -1726,59 +1753,59 @@ class Qe extends qe {
|
|
|
1726
1753
|
addAndRenderCellDiv({
|
|
1727
1754
|
areaModel: e,
|
|
1728
1755
|
areaIdent: t,
|
|
1729
|
-
sideIdent:
|
|
1730
|
-
rowIndex:
|
|
1756
|
+
sideIdent: s,
|
|
1757
|
+
rowIndex: o,
|
|
1731
1758
|
index: i,
|
|
1732
|
-
left:
|
|
1733
|
-
width:
|
|
1734
|
-
height:
|
|
1735
|
-
top:
|
|
1736
|
-
parent:
|
|
1737
|
-
lastRowOfModel:
|
|
1759
|
+
left: a,
|
|
1760
|
+
width: l,
|
|
1761
|
+
height: r,
|
|
1762
|
+
top: c,
|
|
1763
|
+
parent: h,
|
|
1764
|
+
lastRowOfModel: d
|
|
1738
1765
|
}) {
|
|
1739
|
-
var
|
|
1740
|
-
const
|
|
1741
|
-
let
|
|
1742
|
-
if (i === this.getTreeArrowColumnIndex() &&
|
|
1743
|
-
const C =
|
|
1744
|
-
(
|
|
1766
|
+
var oe;
|
|
1767
|
+
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);
|
|
1768
|
+
let f = "none";
|
|
1769
|
+
if (i === this.getTreeArrowColumnIndex() && Y(b)) {
|
|
1770
|
+
const C = b;
|
|
1771
|
+
(oe = C.children) != null && oe.length ? C.expanded ? f = "expanded" : f = "collapsed" : f = "hidden";
|
|
1745
1772
|
}
|
|
1746
|
-
let
|
|
1773
|
+
let x;
|
|
1747
1774
|
if (t === "header") {
|
|
1748
1775
|
const C = this.tableModel.getColumnDef(i);
|
|
1749
|
-
(!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (
|
|
1776
|
+
(!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (x = C == null ? void 0 : C.sortState);
|
|
1750
1777
|
}
|
|
1751
|
-
const
|
|
1778
|
+
const v = e.getValueAt(o, i), w = u ? "" : `${v}`, y = e.isRowChecked(o), S = this.dom.addColumnDiv(
|
|
1752
1779
|
{
|
|
1753
|
-
parent:
|
|
1754
|
-
geo:
|
|
1755
|
-
rowIndex:
|
|
1780
|
+
parent: h,
|
|
1781
|
+
geo: g,
|
|
1782
|
+
rowIndex: o,
|
|
1756
1783
|
columnIndex: i,
|
|
1757
1784
|
areaIdent: t,
|
|
1758
|
-
sideIdent:
|
|
1759
|
-
text:
|
|
1760
|
-
treeArrow:
|
|
1785
|
+
sideIdent: s,
|
|
1786
|
+
text: w,
|
|
1787
|
+
treeArrow: f,
|
|
1761
1788
|
tableOptions: this.tableOptions,
|
|
1762
1789
|
checkedType: y,
|
|
1763
|
-
sortState:
|
|
1790
|
+
sortState: x
|
|
1764
1791
|
}
|
|
1765
|
-
),
|
|
1766
|
-
|
|
1792
|
+
), T = e.getTooltipAt(o, i);
|
|
1793
|
+
T && this.dom.setAttribute(S, "title", T);
|
|
1767
1794
|
const A = this.tableModel.getColumnDef(i);
|
|
1768
|
-
A && A.classes[t] && this.dom.addClasses(A.classes[t],
|
|
1795
|
+
A && A.classes[t] && this.dom.addClasses(A.classes[t], S);
|
|
1769
1796
|
let M;
|
|
1770
|
-
|
|
1771
|
-
const
|
|
1772
|
-
if (
|
|
1797
|
+
u && (M = u.render(S, o, i, t, e, v, this.dom.domService));
|
|
1798
|
+
const H = e.getCustomClassesAt(o, i);
|
|
1799
|
+
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
1800
|
const C = this.getFocusModel();
|
|
1774
|
-
C != null && C.hasFocus(
|
|
1801
|
+
C != null && C.hasFocus(o, i) && this.dom.addFocusBorderDivs(h, g, {});
|
|
1775
1802
|
}
|
|
1776
|
-
t === "header" && this.dom.setAttribute(
|
|
1777
|
-
const
|
|
1778
|
-
if (
|
|
1779
|
-
for (const C in
|
|
1780
|
-
this.dom.setStyle(
|
|
1781
|
-
return [
|
|
1803
|
+
t === "header" && this.dom.setAttribute(S, "data-ge-action", "drag-column");
|
|
1804
|
+
const N = e.getCustomStyleAt(o, i);
|
|
1805
|
+
if (N)
|
|
1806
|
+
for (const C in N)
|
|
1807
|
+
this.dom.setStyle(S, C, N[C]);
|
|
1808
|
+
return [S, M];
|
|
1782
1809
|
}
|
|
1783
1810
|
/**
|
|
1784
1811
|
* Applies CSS classes to an HTML element.
|
|
@@ -1788,8 +1815,8 @@ class Qe extends qe {
|
|
|
1788
1815
|
* @protected
|
|
1789
1816
|
*/
|
|
1790
1817
|
applyCssClasses(e, t = {}) {
|
|
1791
|
-
e && Object.entries(t).forEach(([
|
|
1792
|
-
|
|
1818
|
+
e && Object.entries(t).forEach(([s, o]) => {
|
|
1819
|
+
o ? this.dom.addClass(s, e) : this.dom.removeClass(s, e);
|
|
1793
1820
|
});
|
|
1794
1821
|
}
|
|
1795
1822
|
/**
|
|
@@ -1801,10 +1828,10 @@ class Qe extends qe {
|
|
|
1801
1828
|
* @return {number[]} An array containing the widths of the columns within the specified range.
|
|
1802
1829
|
*/
|
|
1803
1830
|
getColumnWidths(e, t) {
|
|
1804
|
-
const
|
|
1805
|
-
for (let
|
|
1806
|
-
|
|
1807
|
-
return
|
|
1831
|
+
const s = [];
|
|
1832
|
+
for (let o = e; o <= t; o++)
|
|
1833
|
+
s.push(this.tableModel.getColumnWidth(o));
|
|
1834
|
+
return s;
|
|
1808
1835
|
}
|
|
1809
1836
|
/**
|
|
1810
1837
|
* Retrieves the heights of rows within a specified range.
|
|
@@ -1814,11 +1841,11 @@ class Qe extends qe {
|
|
|
1814
1841
|
* @param {AreaModelIf} areaModel - The area model.
|
|
1815
1842
|
* @return {number[]} - An array containing the heights of the rows within the specified range.
|
|
1816
1843
|
*/
|
|
1817
|
-
getRowHeights(e, t,
|
|
1818
|
-
const
|
|
1844
|
+
getRowHeights(e, t, s) {
|
|
1845
|
+
const o = [];
|
|
1819
1846
|
for (let i = e; i <= t; i++)
|
|
1820
|
-
|
|
1821
|
-
return
|
|
1847
|
+
o.push(s.getRowHeight(i));
|
|
1848
|
+
return o;
|
|
1822
1849
|
}
|
|
1823
1850
|
/**
|
|
1824
1851
|
* Adjusts the position and size of the hover row based on the mouse move event.
|
|
@@ -1829,12 +1856,12 @@ class Qe extends qe {
|
|
|
1829
1856
|
*/
|
|
1830
1857
|
adjustHoverRows(e) {
|
|
1831
1858
|
if (this.tableOptions.hoverRowVisible && e.rowIndex > -1) {
|
|
1832
|
-
const t = this.hostElement.clientWidth,
|
|
1859
|
+
const t = this.hostElement.clientWidth, s = this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex), o = e.rowTop + this.areaHeaderCenter.parent.clientHeight - this.scrollTop;
|
|
1833
1860
|
this.dom.applyStyle(this.hoverRow, {
|
|
1834
1861
|
left: "0",
|
|
1835
|
-
top:
|
|
1862
|
+
top: o + "px",
|
|
1836
1863
|
width: t + "px",
|
|
1837
|
-
height:
|
|
1864
|
+
height: s + "px",
|
|
1838
1865
|
display: "block"
|
|
1839
1866
|
});
|
|
1840
1867
|
} else
|
|
@@ -1862,11 +1889,11 @@ class Qe extends qe {
|
|
|
1862
1889
|
*/
|
|
1863
1890
|
adjustHoverColumns(e) {
|
|
1864
1891
|
if (this.tableOptions.hoverColumnVisible && e.rowIndex > -1) {
|
|
1865
|
-
const t = this.hostElement.clientHeight,
|
|
1892
|
+
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
1893
|
this.dom.applyStyle(this.hoverColumn, {
|
|
1867
1894
|
left: i + "px",
|
|
1868
1895
|
top: "0px",
|
|
1869
|
-
width:
|
|
1896
|
+
width: s + "px",
|
|
1870
1897
|
height: t + "px",
|
|
1871
1898
|
display: "block"
|
|
1872
1899
|
});
|
|
@@ -1905,17 +1932,17 @@ class Qe extends qe {
|
|
|
1905
1932
|
* @param {number} sourceColumnIndex - The index of the source column.
|
|
1906
1933
|
* @param {boolean} firstDraggingRendering - Indicates if it's the first rendering of the dragging column.
|
|
1907
1934
|
*/
|
|
1908
|
-
adjustDraggingColumn(e, t,
|
|
1909
|
-
var
|
|
1935
|
+
adjustDraggingColumn(e, t, s) {
|
|
1936
|
+
var o, i;
|
|
1910
1937
|
if (this.dragging) {
|
|
1911
|
-
const
|
|
1912
|
-
if ((
|
|
1913
|
-
const
|
|
1938
|
+
const a = this.hostElement.clientHeight, l = this.storedColumnWidths[t];
|
|
1939
|
+
if ((o = e.originalEvent) != null && o.clientX) {
|
|
1940
|
+
const h = { left: ((i = e.originalEvent) == null ? void 0 : i.clientX) - l / 2, width: l, height: a, top: 0, index: t };
|
|
1914
1941
|
this.dom.applyStyle(this.draggingColumn, {
|
|
1915
1942
|
background: "rgba(128,128,128,0.2)",
|
|
1916
1943
|
display: "block",
|
|
1917
1944
|
overfllow: "clip"
|
|
1918
|
-
}), this.dom.applyStyleInPx(this.draggingColumn,
|
|
1945
|
+
}), this.dom.applyStyleInPx(this.draggingColumn, h), s && this.renderContentOfDraggingColumn(h);
|
|
1919
1946
|
}
|
|
1920
1947
|
} else
|
|
1921
1948
|
this.hideDraggingColumn();
|
|
@@ -1939,34 +1966,34 @@ class Qe extends qe {
|
|
|
1939
1966
|
* @param {number} [y=0] - The starting y-position.
|
|
1940
1967
|
* @return {number} The final y-position after rendering all the content.
|
|
1941
1968
|
*/
|
|
1942
|
-
renderContentOfDraggingColumnForArea(e, t,
|
|
1943
|
-
const
|
|
1944
|
-
if (
|
|
1945
|
-
const
|
|
1946
|
-
for (let
|
|
1947
|
-
const
|
|
1948
|
-
parent:
|
|
1949
|
-
geo:
|
|
1950
|
-
rowIndex:
|
|
1951
|
-
columnIndex:
|
|
1969
|
+
renderContentOfDraggingColumnForArea(e, t, s = 0) {
|
|
1970
|
+
const o = "center", i = this.tableModel.getAreaModel(t), a = i == null ? void 0 : i.getRowCount();
|
|
1971
|
+
if (a) {
|
|
1972
|
+
const l = e.index ?? 0, r = this.draggingColumn;
|
|
1973
|
+
for (let c = 0; c < a; c++) {
|
|
1974
|
+
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 = {
|
|
1975
|
+
parent: r,
|
|
1976
|
+
geo: p,
|
|
1977
|
+
rowIndex: c,
|
|
1978
|
+
columnIndex: l,
|
|
1952
1979
|
areaIdent: t,
|
|
1953
|
-
sideIdent:
|
|
1954
|
-
text:
|
|
1955
|
-
},
|
|
1956
|
-
let
|
|
1957
|
-
|
|
1958
|
-
const
|
|
1959
|
-
|
|
1960
|
-
const
|
|
1961
|
-
|
|
1962
|
-
const y = i.getCustomStyleAt(
|
|
1980
|
+
sideIdent: o,
|
|
1981
|
+
text: b
|
|
1982
|
+
}, m = this.dom.addColumnDiv(f);
|
|
1983
|
+
let x;
|
|
1984
|
+
g && (x = g.render(m, c, l, t, i, u, this.dom.domService), x && this.cleanupFunctions[t].push(x));
|
|
1985
|
+
const v = i.getCustomClassesAt(c, l);
|
|
1986
|
+
v.length && this.dom.addClasses(v, m);
|
|
1987
|
+
const w = this.tableModel.getColumnDef(l);
|
|
1988
|
+
w && w.classes[t] && this.dom.addClasses(w.classes[t], m), this.dom.addColumnBorderDivs(this.tableOptions, r, p, t, o);
|
|
1989
|
+
const y = i.getCustomStyleAt(c, l);
|
|
1963
1990
|
if (y)
|
|
1964
|
-
for (const
|
|
1965
|
-
this.dom.setStyle(
|
|
1966
|
-
|
|
1991
|
+
for (const S in y)
|
|
1992
|
+
this.dom.setStyle(m, S, y[S]);
|
|
1993
|
+
s = s + d;
|
|
1967
1994
|
}
|
|
1968
1995
|
}
|
|
1969
|
-
return
|
|
1996
|
+
return s;
|
|
1970
1997
|
}
|
|
1971
1998
|
/**
|
|
1972
1999
|
* Hides the dragging column by applying a 'display: none' style to it.
|
|
@@ -1989,11 +2016,11 @@ class Qe extends qe {
|
|
|
1989
2016
|
* @param {number} height - The height of the target div in pixels.
|
|
1990
2017
|
* @return {HTMLDivElement} - The rendered draggable target div element.
|
|
1991
2018
|
*/
|
|
1992
|
-
renderDragTargetDiv(e, t,
|
|
1993
|
-
const
|
|
2019
|
+
renderDragTargetDiv(e, t, s, o, i) {
|
|
2020
|
+
const a = this.dom.applyStylePosistionAbsolute(
|
|
1994
2021
|
this.dom.createDivWithClass("ge-table-drop-zone", e)
|
|
1995
2022
|
);
|
|
1996
|
-
return this.dom.setStyle(
|
|
2023
|
+
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
2024
|
}
|
|
1998
2025
|
/**
|
|
1999
2026
|
* Render selected background div.
|
|
@@ -2012,23 +2039,23 @@ class Qe extends qe {
|
|
|
2012
2039
|
* @param {number} height - The height of the div.
|
|
2013
2040
|
* @returns {boolean} - Whether the cell is selected.
|
|
2014
2041
|
*/
|
|
2015
|
-
renderSelectedBackgroundDiv(e, t,
|
|
2016
|
-
let
|
|
2017
|
-
if (!e && t &&
|
|
2018
|
-
const
|
|
2019
|
-
if (
|
|
2020
|
-
const
|
|
2021
|
-
|
|
2022
|
-
for (let
|
|
2023
|
-
const
|
|
2042
|
+
renderSelectedBackgroundDiv(e, t, s, o, i, a, l, r, c, h, d) {
|
|
2043
|
+
let p = !1;
|
|
2044
|
+
if (!e && t && o.isSelectable(i, a) && this.getSelectionModel) {
|
|
2045
|
+
const u = this.getSelectionModel();
|
|
2046
|
+
if (u) {
|
|
2047
|
+
const g = u.getSelectionCount(i, a);
|
|
2048
|
+
p = g > 0;
|
|
2049
|
+
for (let b = 0; b < g; b++) {
|
|
2050
|
+
const f = this.dom.applyStylePosistionAbsolute(
|
|
2024
2051
|
// ge-table-body-west-selected-range
|
|
2025
|
-
this.dom.createDivWithClass(`ge-table-${
|
|
2052
|
+
this.dom.createDivWithClass(`ge-table-${o.areaIdent}-${s}-selected-range`, l)
|
|
2026
2053
|
);
|
|
2027
|
-
this.dom.setStyle(
|
|
2054
|
+
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
2055
|
}
|
|
2029
2056
|
}
|
|
2030
2057
|
}
|
|
2031
|
-
return
|
|
2058
|
+
return p;
|
|
2032
2059
|
}
|
|
2033
2060
|
/**
|
|
2034
2061
|
* Renders a cell in the grid.
|
|
@@ -2052,31 +2079,31 @@ class Qe extends qe {
|
|
|
2052
2079
|
renderCell({
|
|
2053
2080
|
areaModel: e,
|
|
2054
2081
|
areaIdent: t,
|
|
2055
|
-
sideIdent:
|
|
2056
|
-
rowIndex:
|
|
2082
|
+
sideIdent: s,
|
|
2083
|
+
rowIndex: o,
|
|
2057
2084
|
columnIndex: i,
|
|
2058
|
-
left:
|
|
2059
|
-
top:
|
|
2060
|
-
width:
|
|
2061
|
-
height:
|
|
2062
|
-
parent:
|
|
2063
|
-
cellSelected:
|
|
2064
|
-
lastRowOfModel:
|
|
2085
|
+
left: a,
|
|
2086
|
+
top: l,
|
|
2087
|
+
width: r,
|
|
2088
|
+
height: c,
|
|
2089
|
+
parent: h,
|
|
2090
|
+
cellSelected: d,
|
|
2091
|
+
lastRowOfModel: p
|
|
2065
2092
|
}) {
|
|
2066
|
-
const [
|
|
2093
|
+
const [u, g] = this.addAndRenderCellDiv({
|
|
2067
2094
|
areaModel: e,
|
|
2068
2095
|
areaIdent: t,
|
|
2069
|
-
sideIdent:
|
|
2070
|
-
rowIndex:
|
|
2096
|
+
sideIdent: s,
|
|
2097
|
+
rowIndex: o,
|
|
2071
2098
|
index: i,
|
|
2072
|
-
left:
|
|
2073
|
-
width:
|
|
2074
|
-
height:
|
|
2075
|
-
top:
|
|
2076
|
-
parent:
|
|
2077
|
-
lastRowOfModel:
|
|
2099
|
+
left: a,
|
|
2100
|
+
width: r,
|
|
2101
|
+
height: c,
|
|
2102
|
+
top: l,
|
|
2103
|
+
parent: h,
|
|
2104
|
+
lastRowOfModel: p
|
|
2078
2105
|
});
|
|
2079
|
-
|
|
2106
|
+
d && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, u), g && this.cleanupFunctions[t].push(g);
|
|
2080
2107
|
}
|
|
2081
2108
|
/**
|
|
2082
2109
|
* Render the header cell resize handle.
|
|
@@ -2092,12 +2119,12 @@ class Qe extends qe {
|
|
|
2092
2119
|
*
|
|
2093
2120
|
* @return {void}
|
|
2094
2121
|
*/
|
|
2095
|
-
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft:
|
|
2096
|
-
const
|
|
2097
|
-
|
|
2122
|
+
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: o, cellWidth: i, cellHeight: a, parent: l }) {
|
|
2123
|
+
const r = this.dom.domService, c = this.tableOptions.columnResizeHandleWidthInPx ?? 2, h = r.createElement("div");
|
|
2124
|
+
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
2125
|
}
|
|
2099
2126
|
}
|
|
2100
|
-
class
|
|
2127
|
+
class Qe {
|
|
2101
2128
|
constructor(e, t) {
|
|
2102
2129
|
this.columnIndex = e, this.sortState = t;
|
|
2103
2130
|
}
|
|
@@ -2116,10 +2143,10 @@ class et {
|
|
|
2116
2143
|
*/
|
|
2117
2144
|
onHostElementChanged(e) {
|
|
2118
2145
|
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(
|
|
2146
|
+
const t = e.target, s = t.getAttribute("data-area"), o = t.getAttribute("data-row-index"), i = t.getAttribute("data-col-index");
|
|
2147
|
+
if (s && o && i) {
|
|
2148
|
+
const a = Q(s), l = Number(o), r = Number(i);
|
|
2149
|
+
this.tableScope.updateModelValueAfterEdit(a, l, r, t.value);
|
|
2123
2150
|
}
|
|
2124
2151
|
}
|
|
2125
2152
|
}
|
|
@@ -2137,31 +2164,31 @@ class te {
|
|
|
2137
2164
|
return new te([new tt(e, t)]);
|
|
2138
2165
|
}
|
|
2139
2166
|
}
|
|
2140
|
-
class
|
|
2167
|
+
class st {
|
|
2141
2168
|
constructor(e) {
|
|
2142
|
-
var t,
|
|
2143
|
-
this.tableScope = e, (t = this.tableScope.tableOptions) != null && t.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), (
|
|
2169
|
+
var t, s;
|
|
2170
|
+
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
2171
|
}
|
|
2145
2172
|
onMouseClicked(e, t) {
|
|
2146
|
-
var i,
|
|
2147
|
-
let
|
|
2173
|
+
var i, a, l, r, c, h, d;
|
|
2174
|
+
let s = !1, o = !1;
|
|
2148
2175
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
2149
|
-
const
|
|
2150
|
-
|
|
2176
|
+
const p = this.getSelectionModel(), u = this.getFocusModel();
|
|
2177
|
+
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
2178
|
}
|
|
2152
|
-
return
|
|
2179
|
+
return o ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
2153
2180
|
}
|
|
2154
2181
|
onActionTriggered(e) {
|
|
2155
2182
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
2156
|
-
const t = this.getSelectionModel(),
|
|
2157
|
-
if (t &&
|
|
2183
|
+
const t = this.getSelectionModel(), s = this.getFocusModel();
|
|
2184
|
+
if (t && s) {
|
|
2158
2185
|
if (e === "SELECT_ALL")
|
|
2159
2186
|
return t.selectAll(), this.tableScope.repaint(), !0;
|
|
2160
2187
|
if (e === "DESELECT_ALL")
|
|
2161
2188
|
return t.clear(), this.tableScope.repaint(), !0;
|
|
2162
2189
|
if (e === "TOGGLE_SELECTION") {
|
|
2163
|
-
const [
|
|
2164
|
-
return t.togglePoint(
|
|
2190
|
+
const [o, i] = s.getFocus();
|
|
2191
|
+
return t.togglePoint(o, i), this.tableScope.repaint(), !0;
|
|
2165
2192
|
}
|
|
2166
2193
|
}
|
|
2167
2194
|
}
|
|
@@ -2169,16 +2196,16 @@ class ot {
|
|
|
2169
2196
|
}
|
|
2170
2197
|
createRangeByEvents(e, t) {
|
|
2171
2198
|
t || (t = e);
|
|
2172
|
-
const
|
|
2199
|
+
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
2200
|
return E.create({
|
|
2174
|
-
rowIndex1:
|
|
2201
|
+
rowIndex1: s,
|
|
2175
2202
|
columnIndex1: i,
|
|
2176
|
-
rowIndex2:
|
|
2177
|
-
columnIndex2:
|
|
2203
|
+
rowIndex2: o,
|
|
2204
|
+
columnIndex2: a
|
|
2178
2205
|
});
|
|
2179
2206
|
}
|
|
2180
2207
|
}
|
|
2181
|
-
class
|
|
2208
|
+
class ot {
|
|
2182
2209
|
get() {
|
|
2183
2210
|
return {
|
|
2184
2211
|
f2: "START_EDITING",
|
|
@@ -2220,7 +2247,7 @@ class it {
|
|
|
2220
2247
|
};
|
|
2221
2248
|
}
|
|
2222
2249
|
}
|
|
2223
|
-
class
|
|
2250
|
+
class at {
|
|
2224
2251
|
constructor(e) {
|
|
2225
2252
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
2226
2253
|
}
|
|
@@ -2241,7 +2268,7 @@ class rt {
|
|
|
2241
2268
|
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
2269
|
}
|
|
2243
2270
|
assignPredefinedSystemShortcutMappings() {
|
|
2244
|
-
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new it().get()) : Object.assign(this.shortcutActionIdMapping, new
|
|
2271
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new it().get()) : Object.assign(this.shortcutActionIdMapping, new ot().get());
|
|
2245
2272
|
}
|
|
2246
2273
|
isMacintosh() {
|
|
2247
2274
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -2259,24 +2286,24 @@ class rt {
|
|
|
2259
2286
|
emit(e) {
|
|
2260
2287
|
this.isDebug() && console.debug("ShortcutService emit :", e);
|
|
2261
2288
|
let t = !1;
|
|
2262
|
-
for (const
|
|
2263
|
-
|
|
2289
|
+
for (const s of this.listener)
|
|
2290
|
+
s.onActionTriggered(e) && (t = !0);
|
|
2264
2291
|
return t;
|
|
2265
2292
|
}
|
|
2266
2293
|
findEntity(e) {
|
|
2267
2294
|
const t = this.getTokenByEvent(e);
|
|
2268
2295
|
this.isDebug() && console.debug("ShortcutService tokens :", t);
|
|
2269
|
-
for (const
|
|
2270
|
-
const
|
|
2271
|
-
if (this.areTokensEquals(t,
|
|
2272
|
-
return this.shortcutActionIdMapping[
|
|
2296
|
+
for (const s in this.shortcutActionIdMapping) {
|
|
2297
|
+
const o = s.replace(/opt/g, "alt").replace(/cmd/g, "meta").split(/[+ ]/g).sort();
|
|
2298
|
+
if (this.areTokensEquals(t, o))
|
|
2299
|
+
return this.shortcutActionIdMapping[s];
|
|
2273
2300
|
}
|
|
2274
2301
|
}
|
|
2275
2302
|
areTokensEquals(e, t) {
|
|
2276
2303
|
if (e.length !== t.length || e.length === 0)
|
|
2277
2304
|
return !1;
|
|
2278
|
-
for (let
|
|
2279
|
-
if (e[
|
|
2305
|
+
for (let s = 0; s < e.length; s++)
|
|
2306
|
+
if (e[s] !== t[s])
|
|
2280
2307
|
return !1;
|
|
2281
2308
|
return !0;
|
|
2282
2309
|
}
|
|
@@ -2293,7 +2320,7 @@ class rt {
|
|
|
2293
2320
|
return this.shortcutActionIdMapping;
|
|
2294
2321
|
}
|
|
2295
2322
|
}
|
|
2296
|
-
class
|
|
2323
|
+
class re {
|
|
2297
2324
|
onCheckboxChanged(e) {
|
|
2298
2325
|
}
|
|
2299
2326
|
onContextmenu(e) {
|
|
@@ -2313,19 +2340,19 @@ class le {
|
|
|
2313
2340
|
onFocusChanged(e) {
|
|
2314
2341
|
}
|
|
2315
2342
|
}
|
|
2316
|
-
class
|
|
2317
|
-
setStyle(e, t,
|
|
2318
|
-
return e.style[t] =
|
|
2343
|
+
class ue {
|
|
2344
|
+
setStyle(e, t, s) {
|
|
2345
|
+
return e.style[t] = s, e;
|
|
2319
2346
|
}
|
|
2320
2347
|
appendText(e, t) {
|
|
2321
|
-
const
|
|
2322
|
-
return this.appendChild(e,
|
|
2348
|
+
const s = this.createText(t);
|
|
2349
|
+
return this.appendChild(e, s), s;
|
|
2323
2350
|
}
|
|
2324
2351
|
addClass(e, t) {
|
|
2325
|
-
return t.includes(" ") ? t.split(" ").forEach((
|
|
2352
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.add(s)) : e.classList.add(t), e;
|
|
2326
2353
|
}
|
|
2327
2354
|
removeClass(e, t) {
|
|
2328
|
-
return t.includes(" ") ? t.split(" ").forEach((
|
|
2355
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.remove(s)) : e.classList.remove(t), e;
|
|
2329
2356
|
}
|
|
2330
2357
|
appendChild(e, t) {
|
|
2331
2358
|
e.appendChild(t);
|
|
@@ -2336,32 +2363,32 @@ class be {
|
|
|
2336
2363
|
createText(e) {
|
|
2337
2364
|
return document.createTextNode(e);
|
|
2338
2365
|
}
|
|
2339
|
-
setAttribute(e, t,
|
|
2340
|
-
e.setAttribute(t,
|
|
2366
|
+
setAttribute(e, t, s) {
|
|
2367
|
+
e.setAttribute(t, s);
|
|
2341
2368
|
}
|
|
2342
2369
|
}
|
|
2343
|
-
class
|
|
2344
|
-
render(e, t,
|
|
2345
|
-
if (i.isEditable(t,
|
|
2346
|
-
|
|
2347
|
-
const
|
|
2370
|
+
class rt {
|
|
2371
|
+
render(e, t, s, o, i, a, l) {
|
|
2372
|
+
if (i.isEditable(t, s)) {
|
|
2373
|
+
l.addClass(e, "ge-table-row-input-div");
|
|
2374
|
+
const r = i.getValueAt(t, s);
|
|
2348
2375
|
e.innerHTML = `
|
|
2349
2376
|
<input
|
|
2350
2377
|
type="text"
|
|
2351
|
-
value="${
|
|
2378
|
+
value="${r}"
|
|
2352
2379
|
autofocus
|
|
2353
2380
|
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
2354
2381
|
data-listen="change"
|
|
2355
|
-
data-area="${
|
|
2382
|
+
data-area="${o}"
|
|
2356
2383
|
data-row-index="${t}"
|
|
2357
|
-
data-col-index="${
|
|
2384
|
+
data-col-index="${s}"
|
|
2358
2385
|
data-input-type="text"
|
|
2359
2386
|
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
2360
2387
|
class="ge-table-cell-editor-input">`;
|
|
2361
2388
|
}
|
|
2362
2389
|
}
|
|
2363
2390
|
}
|
|
2364
|
-
class
|
|
2391
|
+
class lt {
|
|
2365
2392
|
constructor(e = "none", t = "single") {
|
|
2366
2393
|
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1, this.silent = !1, this.listenerArr = [];
|
|
2367
2394
|
}
|
|
@@ -2383,14 +2410,14 @@ class at {
|
|
|
2383
2410
|
this.selectionType === "row" ? this.addRange(E.singleRow(e)) : this.selectionType === "column" && this.addRange(E.singleColumn(t));
|
|
2384
2411
|
}
|
|
2385
2412
|
getSelectionCount(e, t) {
|
|
2386
|
-
let
|
|
2387
|
-
for (const
|
|
2388
|
-
|
|
2389
|
-
return this.allSelected &&
|
|
2413
|
+
let s = 0;
|
|
2414
|
+
for (const o of this.ranges)
|
|
2415
|
+
o.isInRange(e, t) && s++;
|
|
2416
|
+
return this.allSelected && s++, this.isInNegativeRange(e, t) && (s = 0), s;
|
|
2390
2417
|
}
|
|
2391
2418
|
isInNegativeRange(e, t) {
|
|
2392
|
-
for (const
|
|
2393
|
-
if (
|
|
2419
|
+
for (const s of this.negativeRanges)
|
|
2420
|
+
if (s.isInRange(e, t))
|
|
2394
2421
|
return !0;
|
|
2395
2422
|
return !1;
|
|
2396
2423
|
}
|
|
@@ -2414,8 +2441,8 @@ class at {
|
|
|
2414
2441
|
getMergedRowIndices() {
|
|
2415
2442
|
const e = /* @__PURE__ */ new Set();
|
|
2416
2443
|
for (const t of this.ranges)
|
|
2417
|
-
for (let
|
|
2418
|
-
!e.has(
|
|
2444
|
+
for (let s = t.r1; s <= t.r2; s++)
|
|
2445
|
+
!e.has(s) && !this.isInNegativeRange(s, 0) && e.add(s);
|
|
2419
2446
|
return Array.from(e);
|
|
2420
2447
|
}
|
|
2421
2448
|
selectAll() {
|
|
@@ -2480,7 +2507,7 @@ class nt {
|
|
|
2480
2507
|
return [this.rowIndex, this.columnIndex];
|
|
2481
2508
|
}
|
|
2482
2509
|
}
|
|
2483
|
-
class
|
|
2510
|
+
class me {
|
|
2484
2511
|
constructor(e = new D(
|
|
2485
2512
|
"❯",
|
|
2486
2513
|
"",
|
|
@@ -2494,17 +2521,17 @@ class fe {
|
|
|
2494
2521
|
}
|
|
2495
2522
|
// `⊖ `, `⊕ `;
|
|
2496
2523
|
}
|
|
2497
|
-
const
|
|
2498
|
-
class
|
|
2524
|
+
const ct = new lt(), dt = new nt("cell");
|
|
2525
|
+
class be {
|
|
2499
2526
|
constructor() {
|
|
2500
2527
|
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
2528
|
header: 34,
|
|
2502
2529
|
body: 34,
|
|
2503
2530
|
footer: 34
|
|
2504
|
-
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new
|
|
2531
|
+
}, 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
2532
|
}
|
|
2506
2533
|
}
|
|
2507
|
-
const
|
|
2534
|
+
const L = class L {
|
|
2508
2535
|
/**
|
|
2509
2536
|
* Returns the content to be copied based on the provided table model, selection model, and focus model.
|
|
2510
2537
|
*
|
|
@@ -2514,27 +2541,27 @@ const F = class F {
|
|
|
2514
2541
|
* @return {Promise<string>} A promise that resolves to the copied content as a string.
|
|
2515
2542
|
* @throws {string} Throws an error if neither selection nor focus is defined.
|
|
2516
2543
|
*/
|
|
2517
|
-
createContent(e, t,
|
|
2518
|
-
return new Promise((
|
|
2544
|
+
createContent(e, t, s) {
|
|
2545
|
+
return new Promise((o, i) => {
|
|
2519
2546
|
if (t != null && t.hasSelection()) {
|
|
2520
|
-
const
|
|
2521
|
-
if (
|
|
2522
|
-
|
|
2523
|
-
const
|
|
2524
|
-
for (let
|
|
2525
|
-
const
|
|
2526
|
-
for (let
|
|
2527
|
-
const
|
|
2528
|
-
|
|
2547
|
+
const a = this.mergeRanges(t.getRanges());
|
|
2548
|
+
if (a) {
|
|
2549
|
+
a.c2 = Math.min(a.c2, e.getColumnCount() - 1), a.r2 = Math.min(a.r2, e.getBodyModel().getRowCount() - 1);
|
|
2550
|
+
const l = [];
|
|
2551
|
+
for (let r = a.r1; r <= a.r2; r++) {
|
|
2552
|
+
const c = [];
|
|
2553
|
+
for (let h = a.c1; h <= a.c2; h++) {
|
|
2554
|
+
const d = t.isSelected(r, h) ? e.getBodyModel().getTextValueAt(r, h) : "";
|
|
2555
|
+
c.push(d);
|
|
2529
2556
|
}
|
|
2530
|
-
|
|
2557
|
+
l.push(c.join(L.columnSeparatorChar));
|
|
2531
2558
|
}
|
|
2532
|
-
return
|
|
2559
|
+
return o(l.join(L.rowSeparatorChar));
|
|
2533
2560
|
}
|
|
2534
2561
|
}
|
|
2535
|
-
if (
|
|
2536
|
-
const [
|
|
2537
|
-
return
|
|
2562
|
+
if (s) {
|
|
2563
|
+
const [a, l] = s.getFocus(), r = e.getBodyModel().getTextValueAt(a, l);
|
|
2564
|
+
return o(r);
|
|
2538
2565
|
}
|
|
2539
2566
|
i("Cannot copy, neither selection nor focus defined.");
|
|
2540
2567
|
});
|
|
@@ -2556,19 +2583,19 @@ const F = class F {
|
|
|
2556
2583
|
* @param {FocusModelIf} focusModel - The focus model of the table.
|
|
2557
2584
|
* @returns {Promise<string>} A promise that resolves with the copied text if successful, or rejects if an error occurs.
|
|
2558
2585
|
*/
|
|
2559
|
-
copyToClipboard(e, t,
|
|
2560
|
-
return new Promise((
|
|
2586
|
+
copyToClipboard(e, t, s) {
|
|
2587
|
+
return new Promise((o, i) => {
|
|
2561
2588
|
this.createContent(
|
|
2562
2589
|
e,
|
|
2563
2590
|
t,
|
|
2564
|
-
|
|
2565
|
-
).then((
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
}).catch((
|
|
2591
|
+
s
|
|
2592
|
+
).then((a) => {
|
|
2593
|
+
a && this.copyContent(a).then((l) => {
|
|
2594
|
+
o(a);
|
|
2595
|
+
}).catch((l) => {
|
|
2569
2596
|
i();
|
|
2570
2597
|
});
|
|
2571
|
-
}).catch((
|
|
2598
|
+
}).catch((a) => {
|
|
2572
2599
|
i();
|
|
2573
2600
|
});
|
|
2574
2601
|
});
|
|
@@ -2581,35 +2608,141 @@ const F = class F {
|
|
|
2581
2608
|
*/
|
|
2582
2609
|
mergeRanges(e) {
|
|
2583
2610
|
let t;
|
|
2584
|
-
for (const
|
|
2585
|
-
t ? (t.r1 = Math.min(t.r1,
|
|
2611
|
+
for (const s of e)
|
|
2612
|
+
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
2613
|
return t;
|
|
2587
2614
|
}
|
|
2588
2615
|
};
|
|
2589
|
-
|
|
2616
|
+
L.columnSeparatorChar = " ", L.rowSeparatorChar = `
|
|
2590
2617
|
`;
|
|
2591
|
-
let
|
|
2618
|
+
let _ = L;
|
|
2592
2619
|
class ht {
|
|
2593
|
-
constructor(e) {
|
|
2594
|
-
this.tableScope = e, new ResizeObserver(We(this.handleResize.bind(this),
|
|
2620
|
+
constructor(e, t = 500) {
|
|
2621
|
+
this.tableScope = e, this.debounceDelay = t, new ResizeObserver(We(this.handleResize.bind(this), t)).observe(this.tableScope.hostElement);
|
|
2595
2622
|
}
|
|
2596
2623
|
handleResize(e) {
|
|
2597
|
-
const t = e[0], { width:
|
|
2598
|
-
this.tableScope.recalcColumnWidths(
|
|
2624
|
+
const t = e[0], { width: s } = t.contentRect;
|
|
2625
|
+
this.tableScope.recalcColumnWidths(s);
|
|
2599
2626
|
}
|
|
2600
2627
|
}
|
|
2601
|
-
class
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2628
|
+
class pt {
|
|
2629
|
+
/**
|
|
2630
|
+
* Downloads a matrix data as an Excel file.
|
|
2631
|
+
*
|
|
2632
|
+
* @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.
|
|
2633
|
+
* @param {string} [filename='file.xlsx'] - The name of the Excel file to be downloaded. Defaults to 'file.xlsx'.
|
|
2634
|
+
* @param {string} [author=''] - The author's name to include as metadata in the Excel file. Optional parameter.
|
|
2635
|
+
* @return {void} Does not return a value.
|
|
2636
|
+
* @throws {Error} Throws an error if the input matrix is not a valid 2D array or if the filename is an empty string.
|
|
2637
|
+
*/
|
|
2638
|
+
downloadExcel(e, t = "file.xlsx", s = "") {
|
|
2639
|
+
if (!Array.isArray(e) || e.some((o) => !Array.isArray(o)))
|
|
2640
|
+
throw new Error("Invalid matrix format. Expected a 2D array.");
|
|
2641
|
+
if ((t == null ? void 0 : t.trim()) === "")
|
|
2642
|
+
throw new Error("Invalid filename. Filename must be a non-empty string.");
|
|
2643
|
+
try {
|
|
2644
|
+
const o = this.generateBuffer(e, s), i = new Blob([o], {
|
|
2645
|
+
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
2646
|
+
}), a = document.createElement("a");
|
|
2647
|
+
a.href = URL.createObjectURL(i), a.download = t, document.body.appendChild(a), a.click(), document.body.removeChild(a);
|
|
2648
|
+
} catch (o) {
|
|
2649
|
+
throw console.error("Error generating Excel file:", o), new Error("Failed to download Excel file.");
|
|
2607
2650
|
}
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2651
|
+
}
|
|
2652
|
+
generateMap(e, t = "") {
|
|
2653
|
+
const s = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2654
|
+
<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"?>
|
|
2655
|
+
<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"?>
|
|
2656
|
+
<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"?>
|
|
2657
|
+
<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"?>
|
|
2658
|
+
<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"?>
|
|
2659
|
+
<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"?>
|
|
2660
|
+
<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"?>
|
|
2661
|
+
<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"?>
|
|
2662
|
+
<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();
|
|
2663
|
+
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;
|
|
2664
|
+
}
|
|
2665
|
+
getX1WorksheetsSheet1Xml(e) {
|
|
2666
|
+
const t = [];
|
|
2667
|
+
t.push(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2668
|
+
<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}">
|
|
2669
|
+
<dimension ref="A1:B3"/>
|
|
2670
|
+
<sheetViews>
|
|
2671
|
+
<sheetView tabSelected="1" workbookViewId="0"/></sheetViews>
|
|
2672
|
+
<sheetFormatPr baseColWidth="10" defaultRowHeight="16" x14ac:dyDescent="0.2"/>
|
|
2673
|
+
<sheetData>`);
|
|
2674
|
+
for (let s = 0; s < e.length; s++) {
|
|
2675
|
+
const o = e[s];
|
|
2676
|
+
t.push('<row r="${r + 1}" spans="1:2" x14ac:dyDescent="0.2">');
|
|
2677
|
+
for (let i = 0; i < o.length; i++) {
|
|
2678
|
+
const a = o[i], l = this.getCellAddress(s, i);
|
|
2679
|
+
if (typeof a == "number")
|
|
2680
|
+
t.push(`<c r="${l}"><v>${a}</v></c>`);
|
|
2681
|
+
else if (a instanceof Date) {
|
|
2682
|
+
const r = a;
|
|
2683
|
+
t.push(`<c r="${l}" t="inlineStr"><is><t>${r.toISOString()}</t></is></c>`);
|
|
2684
|
+
} else {
|
|
2685
|
+
const r = a != null ? this.escapeXml(String(a)) : "";
|
|
2686
|
+
t.push(`<c r="${l}" t="inlineStr"><is><t>${r}</t></is></c>`);
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
t.push("</row>");
|
|
2690
|
+
}
|
|
2691
|
+
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(`
|
|
2692
|
+
`);
|
|
2693
|
+
}
|
|
2694
|
+
escapeXml(e) {
|
|
2695
|
+
return e == null ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2696
|
+
}
|
|
2697
|
+
getCellAddress(e, t) {
|
|
2698
|
+
const s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
2699
|
+
let o = "";
|
|
2700
|
+
for (; t >= 0; )
|
|
2701
|
+
o = s[t % 26] + o, t = Math.floor(t / 26) - 1;
|
|
2702
|
+
return `${o}${e + 1}`;
|
|
2703
|
+
}
|
|
2704
|
+
createZip(e) {
|
|
2705
|
+
const t = [];
|
|
2706
|
+
let s = 0;
|
|
2707
|
+
const o = [];
|
|
2708
|
+
e.forEach((d, p) => {
|
|
2709
|
+
const u = new TextEncoder().encode(p), g = new TextEncoder().encode(d), b = new Uint8Array(30 + u.length), f = new DataView(b.buffer);
|
|
2710
|
+
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({
|
|
2711
|
+
path: p,
|
|
2712
|
+
offset: s,
|
|
2713
|
+
contentSize: g.length
|
|
2714
|
+
}), s += b.length + g.length;
|
|
2715
|
+
});
|
|
2716
|
+
const i = s;
|
|
2717
|
+
o.forEach((d) => {
|
|
2718
|
+
const p = new TextEncoder().encode(d.path), u = new Uint8Array(46 + p.length), g = new DataView(u.buffer);
|
|
2719
|
+
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;
|
|
2720
|
+
});
|
|
2721
|
+
const a = new Uint8Array(22), l = new DataView(a.buffer);
|
|
2722
|
+
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);
|
|
2723
|
+
const r = t.reduce((d, p) => d + p.length, 0), c = new Uint8Array(r);
|
|
2724
|
+
let h = 0;
|
|
2725
|
+
for (const d of t)
|
|
2726
|
+
c.set(d, h), h += d.length;
|
|
2727
|
+
return c;
|
|
2728
|
+
}
|
|
2729
|
+
generateBuffer(e, t = "") {
|
|
2730
|
+
const s = this.generateMap(e, t);
|
|
2731
|
+
return this.createZip(s);
|
|
2732
|
+
}
|
|
2733
|
+
}
|
|
2734
|
+
class se extends Ze {
|
|
2735
|
+
constructor(e, t, s, o, i, a = new _(), l = new pt()) {
|
|
2736
|
+
var h;
|
|
2737
|
+
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) {
|
|
2738
|
+
const d = this.tableOptions.autoRestoreOptions, p = d.getStorageKeyFn;
|
|
2739
|
+
p && (d.autoRestoreScrollPosition && (this.storeScrollPosStateService = new Ue(p)), d.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new Xe(p)), d.autoRestoreSortingState && (this.storeSortingService = new Ke(p)));
|
|
2740
|
+
}
|
|
2741
|
+
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);
|
|
2742
|
+
const r = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
2743
|
+
r && r.addEventSelectionChangedListener(this);
|
|
2744
|
+
const c = this.getFocusModel ? this.getFocusModel() : void 0;
|
|
2745
|
+
c && c.addEventFocusChangedListener(this);
|
|
2613
2746
|
}
|
|
2614
2747
|
/**
|
|
2615
2748
|
* Creates a TableScope instance.
|
|
@@ -2623,8 +2756,8 @@ class oe extends Qe {
|
|
|
2623
2756
|
*
|
|
2624
2757
|
* @return {TableScope} - The newly created TableScope instance.
|
|
2625
2758
|
*/
|
|
2626
|
-
static create(e, t,
|
|
2627
|
-
return new
|
|
2759
|
+
static create(e, t, s = new be(), o = new re(), i = new ue(), a = new _()) {
|
|
2760
|
+
return new se(e, t, i, s, o, a);
|
|
2628
2761
|
}
|
|
2629
2762
|
/**
|
|
2630
2763
|
* Triggers an action based on the provided actionId.
|
|
@@ -2640,19 +2773,19 @@ class oe extends Qe {
|
|
|
2640
2773
|
if (e === "START_EDITING" && this.getFocusModel) {
|
|
2641
2774
|
const t = this.getFocusModel();
|
|
2642
2775
|
if (t) {
|
|
2643
|
-
const [
|
|
2644
|
-
this.tableModel.getBodyModel().isEditable(
|
|
2776
|
+
const [s, o] = t.getFocus();
|
|
2777
|
+
this.tableModel.getBodyModel().isEditable(s, o) && (this.clearSelection(), this.initRenderEditor(s, o));
|
|
2645
2778
|
}
|
|
2646
2779
|
return !0;
|
|
2647
2780
|
}
|
|
2648
2781
|
if (e === "COPY_2_CLIPBOARD") {
|
|
2649
|
-
const t = this.getSelectionModel ? this.getSelectionModel() : void 0,
|
|
2650
|
-
this.copyService.createContent(this.tableModel, t,
|
|
2782
|
+
const t = this.getSelectionModel ? this.getSelectionModel() : void 0, s = this.getFocusModel ? this.getFocusModel() : void 0;
|
|
2783
|
+
this.copyService.createContent(this.tableModel, t, s).then((o) => this.copyService.copyContent(o));
|
|
2651
2784
|
}
|
|
2652
2785
|
return !1;
|
|
2653
2786
|
}
|
|
2654
|
-
updateModelValueAfterEdit(e, t,
|
|
2655
|
-
e === "body" && this.tableModel.getAreaModel(e).setValue(t,
|
|
2787
|
+
updateModelValueAfterEdit(e, t, s, o) {
|
|
2788
|
+
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
2789
|
}
|
|
2657
2790
|
/**
|
|
2658
2791
|
* Retrieves the TableApi object.
|
|
@@ -2681,16 +2814,16 @@ class oe extends Qe {
|
|
|
2681
2814
|
* @return {GeMouseEvent} - The created GeMouseEvent object.
|
|
2682
2815
|
*/
|
|
2683
2816
|
createGeMouseEvent(e) {
|
|
2684
|
-
const t = new
|
|
2817
|
+
const t = new Z();
|
|
2685
2818
|
if (t.originalEvent = e, e) {
|
|
2686
|
-
const
|
|
2687
|
-
if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(
|
|
2688
|
-
const
|
|
2689
|
-
t.rowTop =
|
|
2819
|
+
const s = e.target;
|
|
2820
|
+
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) {
|
|
2821
|
+
const o = this.tableModel.getAreaModel(t.areaIdent);
|
|
2822
|
+
t.rowTop = o.getYPosByRowIndex(t.rowIndex);
|
|
2690
2823
|
}
|
|
2691
2824
|
if (t.columnLeft = this.tableModel.getXPosByColumnIndex(t.columnIndex), e.ctrlKey && e.altKey) {
|
|
2692
|
-
const
|
|
2693
|
-
this.debugOnce(i,
|
|
2825
|
+
const o = e.clientY - this.hostElement.offsetTop - this.areaHeaderCenter.parent.clientHeight, i = e.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width;
|
|
2826
|
+
this.debugOnce(i, o);
|
|
2694
2827
|
}
|
|
2695
2828
|
}
|
|
2696
2829
|
return t;
|
|
@@ -2749,9 +2882,9 @@ class oe extends Qe {
|
|
|
2749
2882
|
* @return {void}
|
|
2750
2883
|
*/
|
|
2751
2884
|
toggleExpandCollapseAll(e = !0) {
|
|
2752
|
-
var
|
|
2885
|
+
var s;
|
|
2753
2886
|
const t = this.tableModel.getBodyModel();
|
|
2754
|
-
|
|
2887
|
+
J(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
2755
2888
|
}
|
|
2756
2889
|
/**
|
|
2757
2890
|
* Toggles the checkbox state of a specific row in a table.
|
|
@@ -2762,12 +2895,12 @@ class oe extends Qe {
|
|
|
2762
2895
|
*
|
|
2763
2896
|
* @return {void} - This method does not return anything.
|
|
2764
2897
|
*/
|
|
2765
|
-
toggleRowCheckbox(e, t,
|
|
2766
|
-
var
|
|
2767
|
-
const
|
|
2768
|
-
|
|
2769
|
-
const
|
|
2770
|
-
this.eventListener.onCheckboxChanged(
|
|
2898
|
+
toggleRowCheckbox(e, t, s) {
|
|
2899
|
+
var r;
|
|
2900
|
+
const o = this.tableModel.getAreaModel(s), i = o.isRowChecked(e), a = i === void 0 || i === "semi" || i === "none";
|
|
2901
|
+
o.setRowChecked(e, a), this.repaint();
|
|
2902
|
+
const l = (r = o.rowSelectionModel) == null ? void 0 : r.getCheckedRows();
|
|
2903
|
+
this.eventListener.onCheckboxChanged(l || []);
|
|
2771
2904
|
}
|
|
2772
2905
|
/**
|
|
2773
2906
|
* Handle mouse click events.
|
|
@@ -2777,13 +2910,13 @@ class oe extends Qe {
|
|
|
2777
2910
|
* @returns {void}
|
|
2778
2911
|
*/
|
|
2779
2912
|
onMouseClicked(e, t) {
|
|
2780
|
-
let
|
|
2781
|
-
if (!
|
|
2913
|
+
let s = this.selectionService.onMouseClicked(e, t);
|
|
2914
|
+
if (!s && this.getFocusModel) {
|
|
2782
2915
|
this.resetEditorRenderer();
|
|
2783
|
-
const
|
|
2784
|
-
|
|
2916
|
+
const o = this.getFocusModel();
|
|
2917
|
+
o && (s = o.hasChanged(), o.clearChanged());
|
|
2785
2918
|
}
|
|
2786
|
-
return
|
|
2919
|
+
return s;
|
|
2787
2920
|
}
|
|
2788
2921
|
debounceRepaint() {
|
|
2789
2922
|
this.debounce(this.repaint.bind(this), 1);
|
|
@@ -2816,13 +2949,13 @@ class oe extends Qe {
|
|
|
2816
2949
|
*
|
|
2817
2950
|
* @return {void}
|
|
2818
2951
|
*/
|
|
2819
|
-
onHeaderDblClicked(e, t,
|
|
2820
|
-
var i,
|
|
2821
|
-
const
|
|
2822
|
-
if (
|
|
2952
|
+
onHeaderDblClicked(e, t, s) {
|
|
2953
|
+
var i, a;
|
|
2954
|
+
const o = this.tableModel.getColumnDef(s);
|
|
2955
|
+
if (o != null && o.sortable && o.sortable()) {
|
|
2823
2956
|
e.preventDefault(), e.stopPropagation();
|
|
2824
|
-
const
|
|
2825
|
-
this.tableModel.doSort([
|
|
2957
|
+
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);
|
|
2958
|
+
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
2959
|
}
|
|
2827
2960
|
}
|
|
2828
2961
|
/**
|
|
@@ -2844,8 +2977,8 @@ class oe extends Qe {
|
|
|
2844
2977
|
* @return {void}
|
|
2845
2978
|
*/
|
|
2846
2979
|
scrollToIndex(e, t) {
|
|
2847
|
-
const
|
|
2848
|
-
this.scrollToPixel(0,
|
|
2980
|
+
const o = this.tableModel.getAreaModel("body").getYPosByRowIndex(t);
|
|
2981
|
+
this.scrollToPixel(0, o);
|
|
2849
2982
|
}
|
|
2850
2983
|
/**
|
|
2851
2984
|
* Sets the selection model for the table.
|
|
@@ -2856,8 +2989,8 @@ class oe extends Qe {
|
|
|
2856
2989
|
* @return {void} - This method does not return any value.
|
|
2857
2990
|
*/
|
|
2858
2991
|
setSelectionModel(e, t = !1) {
|
|
2859
|
-
const
|
|
2860
|
-
this.tableOptions.getSelectionModel =
|
|
2992
|
+
const s = () => e;
|
|
2993
|
+
this.tableOptions.getSelectionModel = s, this.getSelectionModel = s, this.selectionService.getSelectionModel = s, t && this.repaint();
|
|
2861
2994
|
}
|
|
2862
2995
|
toggleHeaderGroup(e) {
|
|
2863
2996
|
const t = this.tableModel.getAreaModel("header");
|
|
@@ -2892,10 +3025,10 @@ class oe extends Qe {
|
|
|
2892
3025
|
*/
|
|
2893
3026
|
changeFocusCell(e, t) {
|
|
2894
3027
|
if (!this.isEditing() && this.getFocusModel) {
|
|
2895
|
-
const
|
|
2896
|
-
if (
|
|
2897
|
-
const [
|
|
2898
|
-
return
|
|
3028
|
+
const s = this.getFocusModel();
|
|
3029
|
+
if (s) {
|
|
3030
|
+
const [o, i] = s.getFocus();
|
|
3031
|
+
return s.setFocus(o + t, i + e), this.repaint(), !0;
|
|
2899
3032
|
}
|
|
2900
3033
|
}
|
|
2901
3034
|
return !1;
|
|
@@ -2918,8 +3051,8 @@ class oe extends Qe {
|
|
|
2918
3051
|
this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
|
|
2919
3052
|
}
|
|
2920
3053
|
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", (
|
|
3054
|
+
var s;
|
|
3055
|
+
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
3056
|
}
|
|
2924
3057
|
/**
|
|
2925
3058
|
* Restores the scroll position of the table if auto restore options are enabled.
|
|
@@ -2930,8 +3063,8 @@ class oe extends Qe {
|
|
|
2930
3063
|
autoRestoreScrollPosition() {
|
|
2931
3064
|
var e;
|
|
2932
3065
|
if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
|
|
2933
|
-
const
|
|
2934
|
-
|
|
3066
|
+
const s = this.storeScrollPosStateService.getScrollOffset();
|
|
3067
|
+
s && this.scrollViewport.scrollTo(...s);
|
|
2935
3068
|
}
|
|
2936
3069
|
}
|
|
2937
3070
|
/**
|
|
@@ -2951,8 +3084,8 @@ class oe extends Qe {
|
|
|
2951
3084
|
autoRestoreSortingState() {
|
|
2952
3085
|
var e, t;
|
|
2953
3086
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
|
|
2954
|
-
const
|
|
2955
|
-
|
|
3087
|
+
const s = this.storeSortingService.getSortItems();
|
|
3088
|
+
s != null && s.length && this.tableModel.getBodyModel().doSort(s);
|
|
2956
3089
|
}
|
|
2957
3090
|
}
|
|
2958
3091
|
/**
|
|
@@ -2964,24 +3097,24 @@ class oe extends Qe {
|
|
|
2964
3097
|
autoRestoreCollapsedExpandedState() {
|
|
2965
3098
|
var e, t;
|
|
2966
3099
|
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 (
|
|
3100
|
+
const s = this.tableOptions.autoRestoreOptions, o = s.getRowId;
|
|
3101
|
+
if (s.autoRestoreCollapsedExpandedState && o) {
|
|
3102
|
+
const i = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), a = this.tableModel.getAreaModel("body");
|
|
3103
|
+
if (J(a)) {
|
|
3104
|
+
const l = a, r = a.getRowCount();
|
|
3105
|
+
for (let c = 0; c < r; c++) {
|
|
3106
|
+
const h = a.getRowByIndex(c);
|
|
3107
|
+
if (h)
|
|
2975
3108
|
if (i.allExpanded)
|
|
2976
|
-
|
|
3109
|
+
h.expanded = !0;
|
|
2977
3110
|
else if (i.allCollapsed)
|
|
2978
|
-
|
|
3111
|
+
h.expanded = !1;
|
|
2979
3112
|
else {
|
|
2980
|
-
const
|
|
2981
|
-
i.mode === "expanded" ?
|
|
3113
|
+
const d = o(h.data);
|
|
3114
|
+
i.mode === "expanded" ? h.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(d) : i.mode === "collapsed" && (h.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(d));
|
|
2982
3115
|
}
|
|
2983
3116
|
}
|
|
2984
|
-
|
|
3117
|
+
l.recalcVisibleTreeRows();
|
|
2985
3118
|
}
|
|
2986
3119
|
}
|
|
2987
3120
|
}
|
|
@@ -3223,112 +3356,112 @@ W.themes = ["light", "combat", "paper", "blackboard"], W.vars = {
|
|
|
3223
3356
|
--ge-table-drop-zone-bg: #758129;
|
|
3224
3357
|
}`
|
|
3225
3358
|
};
|
|
3226
|
-
let
|
|
3227
|
-
const
|
|
3228
|
-
constructor(e = new
|
|
3359
|
+
let le = W;
|
|
3360
|
+
const V = class V {
|
|
3361
|
+
constructor(e = new me()) {
|
|
3229
3362
|
this.headerGroupOptions = e;
|
|
3230
3363
|
}
|
|
3231
|
-
render(e, t,
|
|
3232
|
-
const
|
|
3233
|
-
if (
|
|
3234
|
-
const { toggle:
|
|
3235
|
-
this.addText(e,
|
|
3364
|
+
render(e, t, s, o, i, a, l) {
|
|
3365
|
+
const r = a != null && a.data ? a.data : "";
|
|
3366
|
+
if (a) {
|
|
3367
|
+
const { toggle: c, visibility: h, closed: d } = a, p = c ? V.toggleHeaderGroup : "";
|
|
3368
|
+
this.addText(e, o, t, s, r, p), c && h !== "always" && this.addArrowDiv(l, e, !d, t, s, o, p);
|
|
3236
3369
|
} else
|
|
3237
|
-
this.addText(e,
|
|
3370
|
+
this.addText(e, o, t, s, r, "");
|
|
3238
3371
|
}
|
|
3239
|
-
addText(e, t,
|
|
3372
|
+
addText(e, t, s, o, i, a) {
|
|
3240
3373
|
e.innerHTML = `<span
|
|
3241
|
-
data-ge-action="${
|
|
3374
|
+
data-ge-action="${a}"
|
|
3242
3375
|
data-area="${t}"
|
|
3243
|
-
data-row-index="${
|
|
3244
|
-
data-col-index="${
|
|
3376
|
+
data-row-index="${s}"
|
|
3377
|
+
data-col-index="${o}"
|
|
3245
3378
|
>${i}</span>`;
|
|
3246
3379
|
}
|
|
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,
|
|
3380
|
+
addArrowDiv(e, t, s = !0, o = -1, i = -1, a = "header", l) {
|
|
3381
|
+
const r = e.createElement("div");
|
|
3382
|
+
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}`);
|
|
3383
|
+
let c;
|
|
3384
|
+
s ? c = this.headerGroupOptions.iconExpanded : c = this.headerGroupOptions.iconCollapsed;
|
|
3385
|
+
const h = c.content, d = e.createText(h);
|
|
3386
|
+
e.appendChild(r, d), c.style && this.applyStyleString(e, r, c.style);
|
|
3387
|
+
for (const p of c.classes)
|
|
3388
|
+
e.addClass(r, p);
|
|
3389
|
+
return e.appendChild(t, r), r;
|
|
3390
|
+
}
|
|
3391
|
+
applyStyleString(e, t, s) {
|
|
3392
|
+
const o = s.split(";").map((i) => i.trim()).filter((i) => i);
|
|
3393
|
+
for (const i of o) {
|
|
3394
|
+
const [a, l] = i.split(":");
|
|
3395
|
+
e.setStyle(t, a.trim(), l.trim());
|
|
3263
3396
|
}
|
|
3264
3397
|
}
|
|
3265
3398
|
};
|
|
3266
|
-
|
|
3267
|
-
let ne =
|
|
3268
|
-
function gt(
|
|
3399
|
+
V.toggleHeaderGroup = "toggleHeaderGroup";
|
|
3400
|
+
let ne = V;
|
|
3401
|
+
function gt(n) {
|
|
3269
3402
|
let e;
|
|
3270
3403
|
return {
|
|
3271
3404
|
c() {
|
|
3272
|
-
e = Ae("div"), Me(e, "class", "ge-table"),
|
|
3405
|
+
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
3406
|
},
|
|
3274
|
-
m(t,
|
|
3275
|
-
Ee(t, e,
|
|
3407
|
+
m(t, s) {
|
|
3408
|
+
Ee(t, e, s), n[4](e);
|
|
3276
3409
|
},
|
|
3277
|
-
p:
|
|
3278
|
-
i:
|
|
3279
|
-
o:
|
|
3410
|
+
p: O,
|
|
3411
|
+
i: O,
|
|
3412
|
+
o: O,
|
|
3280
3413
|
d(t) {
|
|
3281
|
-
t && he(e),
|
|
3414
|
+
t && he(e), n[4](null);
|
|
3282
3415
|
}
|
|
3283
3416
|
};
|
|
3284
3417
|
}
|
|
3285
|
-
function
|
|
3286
|
-
let { tableModel:
|
|
3287
|
-
const
|
|
3288
|
-
|
|
3289
|
-
const
|
|
3290
|
-
onSelectionChanged(
|
|
3291
|
-
|
|
3418
|
+
function ft(n, e, t) {
|
|
3419
|
+
let { tableModel: s } = e, { tableOptions: o = new be() } = e, { licenseKey: i } = e, a;
|
|
3420
|
+
const l = xe();
|
|
3421
|
+
ve(() => {
|
|
3422
|
+
const c = {
|
|
3423
|
+
onSelectionChanged(d) {
|
|
3424
|
+
l("selectionChanged", d);
|
|
3292
3425
|
},
|
|
3293
|
-
onFocusChanged(
|
|
3294
|
-
|
|
3426
|
+
onFocusChanged(d) {
|
|
3427
|
+
l("focusChanged", d);
|
|
3295
3428
|
},
|
|
3296
|
-
onCheckboxChanged: (
|
|
3297
|
-
|
|
3429
|
+
onCheckboxChanged: (d) => {
|
|
3430
|
+
l("checkboxChanged", d);
|
|
3298
3431
|
},
|
|
3299
|
-
onContextmenu: (
|
|
3300
|
-
|
|
3432
|
+
onContextmenu: (d) => {
|
|
3433
|
+
l("contextmenu", d);
|
|
3301
3434
|
},
|
|
3302
|
-
onModelChanged: (
|
|
3303
|
-
|
|
3435
|
+
onModelChanged: (d) => {
|
|
3436
|
+
l("modelChanged", d);
|
|
3304
3437
|
},
|
|
3305
|
-
onMouseClicked: (
|
|
3306
|
-
|
|
3438
|
+
onMouseClicked: (d) => {
|
|
3439
|
+
l("mouseClicked", d);
|
|
3307
3440
|
},
|
|
3308
|
-
onMouseDragging: (
|
|
3309
|
-
|
|
3441
|
+
onMouseDragging: (d) => {
|
|
3442
|
+
l("mouseDragging", d);
|
|
3310
3443
|
},
|
|
3311
|
-
onMouseDraggingEnd: (
|
|
3312
|
-
|
|
3444
|
+
onMouseDraggingEnd: (d) => {
|
|
3445
|
+
l("mouseDraggingEnd", d);
|
|
3313
3446
|
},
|
|
3314
|
-
onMouseMoved: (
|
|
3315
|
-
|
|
3447
|
+
onMouseMoved: (d) => {
|
|
3448
|
+
l("mouseMoved", d);
|
|
3316
3449
|
}
|
|
3317
|
-
},
|
|
3318
|
-
|
|
3450
|
+
}, h = new se(a, s, new ue(), o, c);
|
|
3451
|
+
h.firstInit(), l("tableReady", h.getApi()), i && k.getInstance().setLicenseKey(i);
|
|
3319
3452
|
});
|
|
3320
|
-
function
|
|
3321
|
-
|
|
3322
|
-
|
|
3453
|
+
function r(c) {
|
|
3454
|
+
j[c ? "unshift" : "push"](() => {
|
|
3455
|
+
a = c, t(0, a);
|
|
3323
3456
|
});
|
|
3324
3457
|
}
|
|
3325
|
-
return
|
|
3326
|
-
"tableModel" in
|
|
3327
|
-
}, [
|
|
3458
|
+
return n.$$set = (c) => {
|
|
3459
|
+
"tableModel" in c && t(1, s = c.tableModel), "tableOptions" in c && t(2, o = c.tableOptions), "licenseKey" in c && t(3, i = c.licenseKey);
|
|
3460
|
+
}, [a, s, o, i, r];
|
|
3328
3461
|
}
|
|
3329
|
-
class
|
|
3462
|
+
class bt extends He {
|
|
3330
3463
|
constructor(e) {
|
|
3331
|
-
super(),
|
|
3464
|
+
super(), $e(this, e, ft, gt, Ce, {
|
|
3332
3465
|
tableModel: 1,
|
|
3333
3466
|
tableOptions: 2,
|
|
3334
3467
|
licenseKey: 3
|
|
@@ -3339,24 +3472,24 @@ class St {
|
|
|
3339
3472
|
constructor(e) {
|
|
3340
3473
|
this.Component = e;
|
|
3341
3474
|
}
|
|
3342
|
-
render(e, t,
|
|
3343
|
-
const
|
|
3475
|
+
render(e, t, s, o, i, a, l) {
|
|
3476
|
+
const r = new this.Component({
|
|
3344
3477
|
target: e,
|
|
3345
3478
|
props: {
|
|
3346
3479
|
cellDiv: e,
|
|
3347
3480
|
rowIndex: t,
|
|
3348
|
-
columnIndex:
|
|
3349
|
-
areaIdent:
|
|
3481
|
+
columnIndex: s,
|
|
3482
|
+
areaIdent: o,
|
|
3350
3483
|
areaModel: i,
|
|
3351
|
-
cellValue:
|
|
3484
|
+
cellValue: a
|
|
3352
3485
|
}
|
|
3353
3486
|
});
|
|
3354
3487
|
return () => {
|
|
3355
|
-
|
|
3488
|
+
r.$destroy();
|
|
3356
3489
|
};
|
|
3357
3490
|
}
|
|
3358
3491
|
}
|
|
3359
3492
|
export {
|
|
3360
3493
|
St as ComponentRendererWrapper,
|
|
3361
|
-
|
|
3494
|
+
bt as GuiexpertTable
|
|
3362
3495
|
};
|