@guiexpert/svelte-table 4.1.60 → 4.1.62
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 +7 -7
- package/index.js +220 -166
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var U = (n, e, t) =>
|
|
4
|
-
import { createEventDispatcher as
|
|
1
|
+
var ye = Object.defineProperty;
|
|
2
|
+
var xe = (n, e, t) => e in n ? ye(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var U = (n, e, t) => xe(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { createEventDispatcher as we, onMount as Ce } from "svelte";
|
|
5
5
|
function O() {
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function de(n) {
|
|
8
8
|
return n();
|
|
9
9
|
}
|
|
10
10
|
function ie() {
|
|
11
11
|
return /* @__PURE__ */ Object.create(null);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
n.forEach(
|
|
13
|
+
function z(n) {
|
|
14
|
+
n.forEach(de);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function he(n) {
|
|
17
17
|
return typeof n == "function";
|
|
18
18
|
}
|
|
19
19
|
function ve(n, e) {
|
|
20
20
|
return n != n ? e == e : n !== e || n && typeof n == "object" || typeof n == "function";
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Ee(n) {
|
|
23
23
|
return Object.keys(n).length === 0;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Ae(n, e, t) {
|
|
26
26
|
n.insertBefore(e, t || null);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function pe(n) {
|
|
29
29
|
n.parentNode && n.parentNode.removeChild(n);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Me(n) {
|
|
32
32
|
return document.createElement(n);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function Re(n, e, t) {
|
|
35
35
|
n.getAttribute(e) !== t && n.setAttribute(e, t);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function Te(n) {
|
|
38
38
|
return Array.from(n.childNodes);
|
|
39
39
|
}
|
|
40
40
|
function P(n, e, t, s) {
|
|
@@ -46,17 +46,17 @@ function $(n) {
|
|
|
46
46
|
}
|
|
47
47
|
const I = [], X = [];
|
|
48
48
|
let B = [];
|
|
49
|
-
const re = [],
|
|
49
|
+
const re = [], De = /* @__PURE__ */ Promise.resolve();
|
|
50
50
|
let K = !1;
|
|
51
|
-
function
|
|
52
|
-
K || (K = !0,
|
|
51
|
+
function ke() {
|
|
52
|
+
K || (K = !0, De.then(ge));
|
|
53
53
|
}
|
|
54
54
|
function Y(n) {
|
|
55
55
|
B.push(n);
|
|
56
56
|
}
|
|
57
57
|
const j = /* @__PURE__ */ new Set();
|
|
58
58
|
let F = 0;
|
|
59
|
-
function
|
|
59
|
+
function ge() {
|
|
60
60
|
if (F !== 0)
|
|
61
61
|
return;
|
|
62
62
|
const n = q;
|
|
@@ -64,7 +64,7 @@ function pe() {
|
|
|
64
64
|
try {
|
|
65
65
|
for (; F < I.length; ) {
|
|
66
66
|
const e = I[F];
|
|
67
|
-
F++, $(e),
|
|
67
|
+
F++, $(e), Fe(e.$$);
|
|
68
68
|
}
|
|
69
69
|
} catch (e) {
|
|
70
70
|
throw I.length = 0, F = 0, e;
|
|
@@ -80,36 +80,36 @@ function pe() {
|
|
|
80
80
|
re.pop()();
|
|
81
81
|
K = !1, j.clear(), $(n);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function Fe(n) {
|
|
84
84
|
if (n.fragment !== null) {
|
|
85
|
-
n.update(),
|
|
85
|
+
n.update(), z(n.before_update);
|
|
86
86
|
const e = n.dirty;
|
|
87
87
|
n.dirty = [-1], n.fragment && n.fragment.p(n.ctx, e), n.after_update.forEach(Y);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function Ie(n) {
|
|
91
91
|
const e = [], t = [];
|
|
92
92
|
B.forEach((s) => n.indexOf(s) === -1 ? e.push(s) : t.push(s)), t.forEach((s) => s()), B = e;
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
function
|
|
96
|
-
n && n.i && (
|
|
94
|
+
const Le = /* @__PURE__ */ new Set();
|
|
95
|
+
function Oe(n, e) {
|
|
96
|
+
n && n.i && (Le.delete(n), n.i(e));
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function Be(n, e, t) {
|
|
99
99
|
const { fragment: s, after_update: o } = n.$$;
|
|
100
100
|
s && s.m(e, t), Y(() => {
|
|
101
|
-
const i = n.$$.on_mount.map(
|
|
102
|
-
n.$$.on_destroy ? n.$$.on_destroy.push(...i) :
|
|
101
|
+
const i = n.$$.on_mount.map(de).filter(he);
|
|
102
|
+
n.$$.on_destroy ? n.$$.on_destroy.push(...i) : z(i), n.$$.on_mount = [];
|
|
103
103
|
}), o.forEach(Y);
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function Pe(n, e) {
|
|
106
106
|
const t = n.$$;
|
|
107
|
-
t.fragment !== null && (
|
|
107
|
+
t.fragment !== null && (Ie(t.after_update), z(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
n.$$.dirty[0] === -1 && (I.push(n),
|
|
109
|
+
function $e(n, e) {
|
|
110
|
+
n.$$.dirty[0] === -1 && (I.push(n), ke(), n.$$.dirty.fill(0)), n.$$.dirty[e / 31 | 0] |= 1 << e % 31;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function _e(n, e, t, s, o, i, r = null, l = [-1]) {
|
|
113
113
|
const a = q;
|
|
114
114
|
$(n);
|
|
115
115
|
const c = n.$$ = {
|
|
@@ -137,18 +137,18 @@ function $e(n, e, t, s, o, i, r = null, l = [-1]) {
|
|
|
137
137
|
let h = !1;
|
|
138
138
|
if (c.ctx = t ? t(n, e.props || {}, (d, p, ...u) => {
|
|
139
139
|
const g = u.length ? u[0] : p;
|
|
140
|
-
return c.ctx && o(c.ctx[d], c.ctx[d] = g) && (!c.skip_bound && c.bound[d] && c.bound[d](g), h &&
|
|
141
|
-
}) : [], c.update(), h = !0,
|
|
140
|
+
return c.ctx && o(c.ctx[d], c.ctx[d] = g) && (!c.skip_bound && c.bound[d] && c.bound[d](g), h && $e(n, d)), p;
|
|
141
|
+
}) : [], c.update(), h = !0, z(c.before_update), c.fragment = s ? s(c.ctx) : !1, e.target) {
|
|
142
142
|
if (e.hydrate) {
|
|
143
|
-
const d =
|
|
144
|
-
c.fragment && c.fragment.l(d), d.forEach(
|
|
143
|
+
const d = Te(e.target);
|
|
144
|
+
c.fragment && c.fragment.l(d), d.forEach(pe);
|
|
145
145
|
} else
|
|
146
146
|
c.fragment && c.fragment.c();
|
|
147
|
-
e.intro &&
|
|
147
|
+
e.intro && Oe(n.$$.fragment), Be(n, e.target, e.anchor), ge();
|
|
148
148
|
}
|
|
149
149
|
$(a);
|
|
150
150
|
}
|
|
151
|
-
class
|
|
151
|
+
class We {
|
|
152
152
|
constructor() {
|
|
153
153
|
/**
|
|
154
154
|
* ### PRIVATE API
|
|
@@ -169,7 +169,7 @@ class _e {
|
|
|
169
169
|
}
|
|
170
170
|
/** @returns {void} */
|
|
171
171
|
$destroy() {
|
|
172
|
-
|
|
172
|
+
Pe(this, 1), this.$destroy = O;
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
175
|
* @template {Extract<keyof Events, string>} K
|
|
@@ -178,7 +178,7 @@ class _e {
|
|
|
178
178
|
* @returns {() => void}
|
|
179
179
|
*/
|
|
180
180
|
$on(e, t) {
|
|
181
|
-
if (!
|
|
181
|
+
if (!he(t))
|
|
182
182
|
return O;
|
|
183
183
|
const s = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
|
|
184
184
|
return s.push(t), () => {
|
|
@@ -191,12 +191,12 @@ class _e {
|
|
|
191
191
|
* @returns {void}
|
|
192
192
|
*/
|
|
193
193
|
$set(e) {
|
|
194
|
-
this.$$set && !
|
|
194
|
+
this.$$set && !Ee(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
const
|
|
198
|
-
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(
|
|
199
|
-
function
|
|
197
|
+
const He = "4";
|
|
198
|
+
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(He);
|
|
199
|
+
function Ve(n, e = 500) {
|
|
200
200
|
let t = null;
|
|
201
201
|
return function(...s) {
|
|
202
202
|
t && window.clearTimeout(t), t = window.setTimeout(() => {
|
|
@@ -260,7 +260,7 @@ class D {
|
|
|
260
260
|
this.content = e, this.style = t, this.classes = s;
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
class
|
|
263
|
+
class fe {
|
|
264
264
|
constructor(e = new D(
|
|
265
265
|
">",
|
|
266
266
|
"transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
|
|
@@ -281,12 +281,12 @@ class ge {
|
|
|
281
281
|
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = o;
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
|
-
class
|
|
284
|
+
class ue {
|
|
285
285
|
constructor(e = new D("↑", "", ["ge-header-sorted-asc"]), t = new D("↓", "", ["ge-header-sorted-desc"]), s = new D("↑", "color:transparent;", [])) {
|
|
286
286
|
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
class
|
|
289
|
+
class Ne {
|
|
290
290
|
constructor(e) {
|
|
291
291
|
this.domService = e;
|
|
292
292
|
}
|
|
@@ -406,7 +406,7 @@ class Ve {
|
|
|
406
406
|
}
|
|
407
407
|
return this.domService.appendChild(e, l), l;
|
|
408
408
|
}
|
|
409
|
-
addSortedIcon(e, t = "", s = new
|
|
409
|
+
addSortedIcon(e, t = "", s = new ue(), o = -1) {
|
|
410
410
|
const i = this.domService.createElement("div");
|
|
411
411
|
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");
|
|
412
412
|
let r;
|
|
@@ -417,7 +417,7 @@ class Ve {
|
|
|
417
417
|
this.domService.addClass(i, c);
|
|
418
418
|
return this.domService.appendChild(e, i), i;
|
|
419
419
|
}
|
|
420
|
-
addArrowDiv(e, t = "none", s = new
|
|
420
|
+
addArrowDiv(e, t = "none", s = new fe(), o = -1, i = -1, r = "body") {
|
|
421
421
|
const l = this.domService.createElement("div");
|
|
422
422
|
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", `${r}`);
|
|
423
423
|
let a;
|
|
@@ -469,7 +469,7 @@ class Ve {
|
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
const Q = (n) => n === "header" ? "header" : n === "footer" ? "footer" : "body";
|
|
472
|
-
class
|
|
472
|
+
class ze {
|
|
473
473
|
constructor(e, t) {
|
|
474
474
|
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)) {
|
|
475
475
|
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"));
|
|
@@ -481,7 +481,7 @@ class Ge {
|
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
class
|
|
484
|
+
class Ge {
|
|
485
485
|
constructor(e) {
|
|
486
486
|
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(
|
|
487
487
|
(t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
|
|
@@ -511,7 +511,7 @@ class Ne {
|
|
|
511
511
|
if (t - this.lastClicked < this.doubleClickDelay)
|
|
512
512
|
return;
|
|
513
513
|
this.lastClicked = t;
|
|
514
|
-
const s = new
|
|
514
|
+
const s = new ze(e.target, this.tableScope);
|
|
515
515
|
if (s.action === "toggleExpandCollapseAll")
|
|
516
516
|
this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
|
|
517
517
|
else if (s.action === "toggleHeaderGroup")
|
|
@@ -613,7 +613,7 @@ class Ne {
|
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
class
|
|
616
|
+
class Ue {
|
|
617
617
|
constructor(e, t = [], s = -1) {
|
|
618
618
|
this.areaIdent = e, this.columnDefs = t, this.defaultRowHeight = s, this.rowSelectionModel = void 0, this.yPositions = [], this.cellRenderers = t.map((o) => o.rendererMap[e]);
|
|
619
619
|
}
|
|
@@ -709,7 +709,7 @@ class ze {
|
|
|
709
709
|
this.yPositions[t + 1] = this.getRowHeight(t) + this.yPositions[t];
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
|
-
class
|
|
712
|
+
class je {
|
|
713
713
|
genericSortComparator(e, t, s) {
|
|
714
714
|
if (typeof e == "number" && typeof t == "number")
|
|
715
715
|
return s * (e - t);
|
|
@@ -727,9 +727,9 @@ class Ue {
|
|
|
727
727
|
return s * ("" + e).localeCompare("" + t);
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
|
-
class
|
|
730
|
+
class Xe extends Ue {
|
|
731
731
|
constructor(e, t, s, o = []) {
|
|
732
|
-
super(e, o, s), this.areaIdent = e, this.rows = t, this.defaultRowHeight = s, this.columnDefs = o, this.sorterService = new
|
|
732
|
+
super(e, o, s), this.areaIdent = e, this.rows = t, this.defaultRowHeight = s, this.columnDefs = o, this.focusedRowIndex = 0, this.sorterService = new je(), this.filteredRows = [...t], this.properties = o.map((i) => i.property);
|
|
733
733
|
}
|
|
734
734
|
setRows(e) {
|
|
735
735
|
this.rows = e, this.filteredRows = [...e];
|
|
@@ -746,6 +746,12 @@ class je extends ze {
|
|
|
746
746
|
let o = this.filteredRows[e];
|
|
747
747
|
return W(o) && (o = o.data), o ? this.getValueByT(o, s) : "";
|
|
748
748
|
}
|
|
749
|
+
/**
|
|
750
|
+
* Retrieves the filtered and sorted rows from the dataset.
|
|
751
|
+
* These rows are used for rendering the table.
|
|
752
|
+
*
|
|
753
|
+
* @return {T[]} An array containing the filtered (and sorted) rows.
|
|
754
|
+
*/
|
|
749
755
|
getFilteredRows() {
|
|
750
756
|
return this.filteredRows;
|
|
751
757
|
}
|
|
@@ -774,6 +780,10 @@ class je extends ze {
|
|
|
774
780
|
changeColumnOrder(e, t) {
|
|
775
781
|
this.arrayMove(this.properties, e, t), super.changeColumnOrder(e, t);
|
|
776
782
|
}
|
|
783
|
+
getCustomClassesAt(e, t) {
|
|
784
|
+
const s = super.getCustomClassesAt(e, t);
|
|
785
|
+
return this.getRowByIndex(e).selected && s.push("ge-selected-row"), this.focusedRowIndex === e && s.push("ge-focused-row"), s;
|
|
786
|
+
}
|
|
777
787
|
genericFlatTableSortComparator(e, t) {
|
|
778
788
|
const s = this.columnDefs.find((o) => o.property === e);
|
|
779
789
|
return (o, i) => {
|
|
@@ -786,7 +796,7 @@ class je extends ze {
|
|
|
786
796
|
return o && t.length ? this.getPropertyValue(o, t) : o;
|
|
787
797
|
}
|
|
788
798
|
}
|
|
789
|
-
class
|
|
799
|
+
class Ke {
|
|
790
800
|
constructor(e) {
|
|
791
801
|
this.tableScope = e;
|
|
792
802
|
}
|
|
@@ -1017,7 +1027,7 @@ class Xe {
|
|
|
1017
1027
|
}
|
|
1018
1028
|
setRows(e) {
|
|
1019
1029
|
const t = this.getBodyModel();
|
|
1020
|
-
t instanceof
|
|
1030
|
+
t instanceof Xe ? t.setRows(e) : console.warn("setRows<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ", typeof t);
|
|
1021
1031
|
}
|
|
1022
1032
|
reSort() {
|
|
1023
1033
|
this.tableScope.reSort();
|
|
@@ -1090,7 +1100,7 @@ class ee {
|
|
|
1090
1100
|
// }
|
|
1091
1101
|
// }
|
|
1092
1102
|
}
|
|
1093
|
-
class
|
|
1103
|
+
class Ye extends ee {
|
|
1094
1104
|
constructor(e) {
|
|
1095
1105
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
1096
1106
|
}
|
|
@@ -1112,14 +1122,14 @@ class Ke extends ee {
|
|
|
1112
1122
|
}
|
|
1113
1123
|
}
|
|
1114
1124
|
}
|
|
1115
|
-
class
|
|
1125
|
+
class Je {
|
|
1116
1126
|
constructor(e = "collapsed", t = [], s = !1, o = !1) {
|
|
1117
1127
|
this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = o;
|
|
1118
1128
|
}
|
|
1119
1129
|
}
|
|
1120
|
-
class
|
|
1130
|
+
class qe extends ee {
|
|
1121
1131
|
constructor(e) {
|
|
1122
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
1132
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new Je(), this.load();
|
|
1123
1133
|
}
|
|
1124
1134
|
collapsedExpandedStateGet() {
|
|
1125
1135
|
return this.collapsedExpandedState;
|
|
@@ -1151,7 +1161,7 @@ class Je extends ee {
|
|
|
1151
1161
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
1152
1162
|
}
|
|
1153
1163
|
}
|
|
1154
|
-
class
|
|
1164
|
+
class Ze extends ee {
|
|
1155
1165
|
constructor(e) {
|
|
1156
1166
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
1157
1167
|
}
|
|
@@ -1177,7 +1187,7 @@ class T {
|
|
|
1177
1187
|
this.left = e, this.width = t, this.height = s, this.top = o, this.index = i;
|
|
1178
1188
|
}
|
|
1179
1189
|
}
|
|
1180
|
-
class
|
|
1190
|
+
class Qe {
|
|
1181
1191
|
constructor(e, t, s, o) {
|
|
1182
1192
|
this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = o, this.scrollTop = 0, this.areaBodyWestGeo = new T(), this.areaBodyCenterGeo = new T(), this.areaBodyEastGeo = new T();
|
|
1183
1193
|
const i = this.hostElement;
|
|
@@ -1383,7 +1393,7 @@ class E {
|
|
|
1383
1393
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
1384
1394
|
}
|
|
1385
1395
|
}
|
|
1386
|
-
class
|
|
1396
|
+
class et {
|
|
1387
1397
|
constructor(e, t) {
|
|
1388
1398
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
1389
1399
|
}
|
|
@@ -1416,22 +1426,22 @@ class Qe {
|
|
|
1416
1426
|
return !1;
|
|
1417
1427
|
}
|
|
1418
1428
|
}
|
|
1419
|
-
class
|
|
1429
|
+
class tt {
|
|
1420
1430
|
constructor(e, t, s) {
|
|
1421
1431
|
this.header = e, this.body = t, this.footer = s;
|
|
1422
1432
|
}
|
|
1423
1433
|
}
|
|
1424
|
-
class
|
|
1434
|
+
class st extends Qe {
|
|
1425
1435
|
constructor(e, t, s, o) {
|
|
1426
1436
|
var r, l;
|
|
1427
1437
|
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 = {
|
|
1428
1438
|
header: [],
|
|
1429
1439
|
body: [],
|
|
1430
1440
|
footer: []
|
|
1431
|
-
}, this.tree = !1, this.colAndRowspanModels = new
|
|
1441
|
+
}, this.tree = !1, this.colAndRowspanModels = new tt(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (r = this.tableOptions) != null && r.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(
|
|
1432
1442
|
(a) => {
|
|
1433
1443
|
var c;
|
|
1434
|
-
this.colAndRowspanModels[a] = new
|
|
1444
|
+
this.colAndRowspanModels[a] = new et(t, t.getAreaModel(a)), (c = this.colAndRowspanModels[a]) == null || c.init();
|
|
1435
1445
|
}
|
|
1436
1446
|
);
|
|
1437
1447
|
}
|
|
@@ -1693,10 +1703,10 @@ class tt extends Ze {
|
|
|
1693
1703
|
let p = t;
|
|
1694
1704
|
const u = this.tableModel.getColumnCount(), g = this.tableModel.getFixedRightColumnCount(), b = this.tableModel.getFixedLeftColumnCount();
|
|
1695
1705
|
for (let m = 0; m < d; m++) {
|
|
1696
|
-
const x = p, w = m === d - 1,
|
|
1697
|
-
if (x +
|
|
1706
|
+
const x = p, w = m === d - 1, v = this.tableModel.getRowHeight(e, m);
|
|
1707
|
+
if (x + v > 0) {
|
|
1698
1708
|
this.firstVisibleRowIndex = m;
|
|
1699
|
-
let y = { left: l, width: a, height:
|
|
1709
|
+
let y = { left: l, width: a, height: v, top: x, index: m }, S = this.dom.addRowDiv(o, y, m, e, "center");
|
|
1700
1710
|
const R = b;
|
|
1701
1711
|
if (this.adjustColumnsToRowParent({
|
|
1702
1712
|
areaIdent: e,
|
|
@@ -1709,7 +1719,7 @@ class tt extends Ze {
|
|
|
1709
1719
|
columnIndexEnd: u - g - 1,
|
|
1710
1720
|
verticalFixed: !1,
|
|
1711
1721
|
lastRowOfModel: w
|
|
1712
|
-
}), c.left > 0 && (y = { left: l, width: this.areaBodyWestGeo.width, height:
|
|
1722
|
+
}), c.left > 0 && (y = { left: l, width: this.areaBodyWestGeo.width, height: v, top: x, index: m }, S = this.dom.addRowDiv(s, y, m, e, "west"), this.adjustColumnsToRowParent({
|
|
1713
1723
|
areaIdent: e,
|
|
1714
1724
|
sideIdent: "west",
|
|
1715
1725
|
areaModel: h,
|
|
@@ -1720,7 +1730,7 @@ class tt extends Ze {
|
|
|
1720
1730
|
columnIndexEnd: R - 1,
|
|
1721
1731
|
verticalFixed: !0,
|
|
1722
1732
|
lastRowOfModel: w
|
|
1723
|
-
})), c.right > 0 && (y = { left: l, width: this.areaBodyEastGeo.width, height:
|
|
1733
|
+
})), c.right > 0 && (y = { left: l, width: this.areaBodyEastGeo.width, height: v, top: x, index: m }, S = this.dom.addRowDiv(i, y, m, e, "east"), this.adjustColumnsToRowParent({
|
|
1724
1734
|
areaIdent: e,
|
|
1725
1735
|
sideIdent: "east",
|
|
1726
1736
|
areaModel: h,
|
|
@@ -1746,23 +1756,23 @@ class tt extends Ze {
|
|
|
1746
1756
|
}
|
|
1747
1757
|
}
|
|
1748
1758
|
}
|
|
1749
|
-
if (p = p +
|
|
1759
|
+
if (p = p + v, p > r)
|
|
1750
1760
|
break;
|
|
1751
1761
|
}
|
|
1752
1762
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1753
1763
|
const m = ((f = this.colAndRowspanModels[e]) == null ? void 0 : f.getRanges()) ?? [];
|
|
1754
1764
|
if (m.length)
|
|
1755
1765
|
for (const x of m) {
|
|
1756
|
-
let w = 0,
|
|
1766
|
+
let w = 0, v = o.child, y = "center";
|
|
1757
1767
|
if (x.c1 < b)
|
|
1758
|
-
|
|
1768
|
+
v = s.child, y = "west";
|
|
1759
1769
|
else if (g > 0 && x.c1 >= u - g)
|
|
1760
|
-
|
|
1770
|
+
v = i.child, y = "east";
|
|
1761
1771
|
else {
|
|
1762
1772
|
const S = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1763
1773
|
w = this.scrollFactorX * S - this.areaBodyWestGeo.width, y = "center";
|
|
1764
1774
|
}
|
|
1765
|
-
this.drawBigCell(x, w, t, h,
|
|
1775
|
+
this.drawBigCell(x, w, t, h, v, y);
|
|
1766
1776
|
}
|
|
1767
1777
|
}
|
|
1768
1778
|
}
|
|
@@ -1873,8 +1883,8 @@ class tt extends Ze {
|
|
|
1873
1883
|
const m = g, x = this.tableModel.getColumnWidth(f);
|
|
1874
1884
|
if (x > 0 && m + x > 0) {
|
|
1875
1885
|
let w = o.height;
|
|
1876
|
-
const
|
|
1877
|
-
|
|
1886
|
+
const v = s.getRowspanAt(r, f), y = s.getColspanAt(r, f);
|
|
1887
|
+
v > 1 && (w = this.getRowHeights(r, r + v - 1, s).reduce((A, M) => A + M, 0));
|
|
1878
1888
|
let S = x;
|
|
1879
1889
|
y > 1 && (S = this.getColumnWidths(f, f + y - 1).reduce((A, M) => A + M, 0));
|
|
1880
1890
|
let R = !1;
|
|
@@ -1943,15 +1953,15 @@ class tt extends Ze {
|
|
|
1943
1953
|
const u = this.editorRenderer && this.editorRendererRow === o && this.editorRendererColumn === i ? this.editorRenderer : e.getCellRenderer(o, i), g = { left: r, width: l, height: a, top: c, index: i }, b = e.getRowByIndex(o);
|
|
1944
1954
|
let f = "none";
|
|
1945
1955
|
if (i === this.getTreeArrowColumnIndex() && W(b)) {
|
|
1946
|
-
const
|
|
1947
|
-
(oe =
|
|
1956
|
+
const C = b;
|
|
1957
|
+
(oe = C.children) != null && oe.length ? C.expanded ? f = "expanded" : f = "collapsed" : f = "hidden";
|
|
1948
1958
|
}
|
|
1949
1959
|
let x;
|
|
1950
1960
|
if (t === "header") {
|
|
1951
|
-
const
|
|
1952
|
-
(!(
|
|
1961
|
+
const C = this.tableModel.getColumnDef(i);
|
|
1962
|
+
(!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (x = C == null ? void 0 : C.sortState);
|
|
1953
1963
|
}
|
|
1954
|
-
const w = e.getValueAt(o, i),
|
|
1964
|
+
const w = e.getValueAt(o, i), v = u ? "" : `${w}`, y = e.isRowChecked(o), S = this.dom.addColumnDiv(
|
|
1955
1965
|
{
|
|
1956
1966
|
parent: h,
|
|
1957
1967
|
geo: g,
|
|
@@ -1959,7 +1969,7 @@ class tt extends Ze {
|
|
|
1959
1969
|
columnIndex: i,
|
|
1960
1970
|
areaIdent: t,
|
|
1961
1971
|
sideIdent: s,
|
|
1962
|
-
text:
|
|
1972
|
+
text: v,
|
|
1963
1973
|
treeArrow: f,
|
|
1964
1974
|
tableOptions: this.tableOptions,
|
|
1965
1975
|
checkedType: y,
|
|
@@ -1973,14 +1983,14 @@ class tt extends Ze {
|
|
|
1973
1983
|
u && (M = u.render(S, o, i, t, e, w, this.dom.domService));
|
|
1974
1984
|
const _ = e.getCustomClassesAt(o, i);
|
|
1975
1985
|
if (_.length && this.dom.addClasses(_, S), this.dom.addColumnBorderDivs(this.tableOptions, h, g, t, s), d && this.dom.addHorizontalBorder({ left: r, width: l, height: a, top: c + a }, h), this.getFocusModel && t === "body") {
|
|
1976
|
-
const
|
|
1977
|
-
|
|
1986
|
+
const C = this.getFocusModel();
|
|
1987
|
+
C != null && C.hasFocus(o, i) && this.dom.addFocusBorderDivs(h, g, {});
|
|
1978
1988
|
}
|
|
1979
1989
|
t === "header" && this.dom.setAttribute(S, "data-ge-action", "drag-column");
|
|
1980
|
-
const
|
|
1981
|
-
if (
|
|
1982
|
-
for (const
|
|
1983
|
-
this.dom.setStyle(S,
|
|
1990
|
+
const G = e.getCustomStyleAt(o, i);
|
|
1991
|
+
if (G)
|
|
1992
|
+
for (const C in G)
|
|
1993
|
+
this.dom.setStyle(S, C, G[C]);
|
|
1984
1994
|
return [S, M];
|
|
1985
1995
|
}
|
|
1986
1996
|
/**
|
|
@@ -2160,8 +2170,8 @@ class tt extends Ze {
|
|
|
2160
2170
|
g && (x = g.render(m, c, l, t, i, u, this.dom.domService), x && this.cleanupFunctions[t].push(x));
|
|
2161
2171
|
const w = i.getCustomClassesAt(c, l);
|
|
2162
2172
|
w.length && this.dom.addClasses(w, m);
|
|
2163
|
-
const
|
|
2164
|
-
|
|
2173
|
+
const v = this.tableModel.getColumnDef(l);
|
|
2174
|
+
v && v.classes[t] && this.dom.addClasses(v.classes[t], m), this.dom.addColumnBorderDivs(this.tableOptions, a, p, t, o);
|
|
2165
2175
|
const y = i.getCustomStyleAt(c, l);
|
|
2166
2176
|
if (y)
|
|
2167
2177
|
for (const S in y)
|
|
@@ -2300,12 +2310,12 @@ class tt extends Ze {
|
|
|
2300
2310
|
a.setAttribute(h, "data-col-index", `${t}`), a.setAttribute(h, "data-row-index", `${e}`), a.setAttribute(h, "data-area", "header"), a.setAttribute(h, "data-ge-action", "resize-column"), a.addClass(h, "ge-table-column-resize-handle"), a.setStyle(h, "display", "clip"), a.setStyle(h, "position", "absolute"), a.setStyle(h, "cursor", "col-resize"), a.setStyle(h, "left", `${s + i - c}px`), a.setStyle(h, "top", `${o}px`), a.setStyle(h, "width", `${c}px`), a.setStyle(h, "height", `${r}px`), a.appendChild(l, h);
|
|
2301
2311
|
}
|
|
2302
2312
|
}
|
|
2303
|
-
class
|
|
2313
|
+
class ot {
|
|
2304
2314
|
constructor(e, t) {
|
|
2305
2315
|
this.columnIndex = e, this.sortState = t;
|
|
2306
2316
|
}
|
|
2307
2317
|
}
|
|
2308
|
-
class
|
|
2318
|
+
class it {
|
|
2309
2319
|
constructor(e) {
|
|
2310
2320
|
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
2311
2321
|
}
|
|
@@ -2327,7 +2337,7 @@ class ot {
|
|
|
2327
2337
|
}
|
|
2328
2338
|
}
|
|
2329
2339
|
}
|
|
2330
|
-
class
|
|
2340
|
+
class rt {
|
|
2331
2341
|
constructor(e = -1, t = -1) {
|
|
2332
2342
|
this.rowIndex = e, this.columnIndex = t;
|
|
2333
2343
|
}
|
|
@@ -2337,10 +2347,10 @@ class te {
|
|
|
2337
2347
|
this.cells = e;
|
|
2338
2348
|
}
|
|
2339
2349
|
static createSingle(e, t) {
|
|
2340
|
-
return new te([new
|
|
2350
|
+
return new te([new rt(e, t)]);
|
|
2341
2351
|
}
|
|
2342
2352
|
}
|
|
2343
|
-
class
|
|
2353
|
+
class at {
|
|
2344
2354
|
constructor(e) {
|
|
2345
2355
|
var t, s;
|
|
2346
2356
|
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);
|
|
@@ -2381,7 +2391,7 @@ class rt {
|
|
|
2381
2391
|
});
|
|
2382
2392
|
}
|
|
2383
2393
|
}
|
|
2384
|
-
class
|
|
2394
|
+
class lt {
|
|
2385
2395
|
get() {
|
|
2386
2396
|
return {
|
|
2387
2397
|
f2: "START_EDITING",
|
|
@@ -2401,7 +2411,7 @@ class at {
|
|
|
2401
2411
|
};
|
|
2402
2412
|
}
|
|
2403
2413
|
}
|
|
2404
|
-
class
|
|
2414
|
+
class nt {
|
|
2405
2415
|
get() {
|
|
2406
2416
|
return {
|
|
2407
2417
|
f2: "START_EDITING",
|
|
@@ -2423,7 +2433,23 @@ class lt {
|
|
|
2423
2433
|
};
|
|
2424
2434
|
}
|
|
2425
2435
|
}
|
|
2426
|
-
|
|
2436
|
+
function ct(n) {
|
|
2437
|
+
return n.trim().replace(/\+/g, " ").replace(/ +/g, " ").replace(/⌫/g, "backspace").replace(/↩/g, "enter").replace(/⇧/g, "shift").replace(/⌥/g, "alt").replace(/option/g, "alt").replace(/opt/g, "alt").replace(/⌃/g, "ctrl").replace(/control/g, "ctrl").replace(/command/g, "cmd").replace(/meta/g, "cmd").replace(/escape/g, "esc").replace(/⌘/g, "cmd").replace(/\*/g, "multiply").split(" ").filter((e) => e).sort((e, t) => {
|
|
2438
|
+
const s = { cmd: 1, ctrl: 2, alt: 3, shift: 4 }, o = s[e] || 5, i = s[t] || 5;
|
|
2439
|
+
return o !== i ? o - i : e.localeCompare(t);
|
|
2440
|
+
}).join(" ");
|
|
2441
|
+
}
|
|
2442
|
+
function ae(n) {
|
|
2443
|
+
let e = n.key.toLowerCase();
|
|
2444
|
+
if (e === " " && (e = "space"), e === "arrowleft" && (e = "left"), e === "arrowright" && (e = "right"), e === "arrowup" && (e = "up"), e === "arrowdown" && (e = "down"), e === "delete" && n.code === "Delete" && (e = "delete"), e === "backspace" && (e = "backspace"), e === "escape" && (e = "esc"), e === "return" && (e = "enter"), n.code.startsWith("Numpad")) {
|
|
2445
|
+
const s = n.code.replace("Numpad", "").toLowerCase();
|
|
2446
|
+
s === "add" ? e = "num_add" : s === "subtract" ? e = "num_subtract" : s === "multiply" ? e = "num_multiply" : s === "divide" ? e = "num_divide" : s === "decimal" ? e = "num_decimal" : s === "enter" ? e = "num_enter" : e = "num_" + s;
|
|
2447
|
+
}
|
|
2448
|
+
n.code.match(/^F\d+$/) && (e = n.code.toLowerCase()), n.code.match(/^Digit\d+$/) && (e = n.code.replace(/Digit/g, ""));
|
|
2449
|
+
let t = "";
|
|
2450
|
+
return n.ctrlKey && (t += " ctrl"), n.altKey && (t += t + " alt"), n.shiftKey && (t += t + " shift"), n.metaKey && (t += t + " cmd"), ct(t + " " + e);
|
|
2451
|
+
}
|
|
2452
|
+
class dt {
|
|
2427
2453
|
constructor(e) {
|
|
2428
2454
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
2429
2455
|
}
|
|
@@ -2441,10 +2467,11 @@ class nt {
|
|
|
2441
2467
|
* Also adds key down event listener to the table host element.
|
|
2442
2468
|
*/
|
|
2443
2469
|
init() {
|
|
2444
|
-
|
|
2470
|
+
var e, t;
|
|
2471
|
+
(t = (e = this.tableScope) == null ? void 0 : e.tableOptions) != null && t.shortcutActionsDisabled ? this.isDebug() && console.debug("ShortcutService skipped.") : (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)));
|
|
2445
2472
|
}
|
|
2446
2473
|
assignPredefinedSystemShortcutMappings() {
|
|
2447
|
-
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new
|
|
2474
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new nt().get()) : Object.assign(this.shortcutActionIdMapping, new lt().get());
|
|
2448
2475
|
}
|
|
2449
2476
|
isMacintosh() {
|
|
2450
2477
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -2467,26 +2494,47 @@ class nt {
|
|
|
2467
2494
|
return t;
|
|
2468
2495
|
}
|
|
2469
2496
|
findEntity(e) {
|
|
2470
|
-
const t =
|
|
2471
|
-
this.isDebug() && console.debug("ShortcutService
|
|
2472
|
-
for (const s in this.shortcutActionIdMapping)
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2497
|
+
const t = ae(e);
|
|
2498
|
+
this.isDebug() && console.debug("ShortcutService shortcut :", t);
|
|
2499
|
+
for (const s in this.shortcutActionIdMapping)
|
|
2500
|
+
if (ae(e) === t)
|
|
2501
|
+
return this.isDebug() && console.debug("ShortcutService action :", this.shortcutActionIdMapping[s]), this.shortcutActionIdMapping[s];
|
|
2502
|
+
}
|
|
2503
|
+
// private areTokensEquals(tokens1: string[], tokens2: string[]): boolean {
|
|
2504
|
+
// if (tokens1.length !== tokens2.length) {
|
|
2505
|
+
// return false;
|
|
2506
|
+
// }
|
|
2507
|
+
// if (tokens1.length === 0) {
|
|
2508
|
+
// return false;
|
|
2509
|
+
// }
|
|
2510
|
+
// for (let i = 0; i < tokens1.length; i++) {
|
|
2511
|
+
// if (tokens1[i] !== tokens2[i]) {
|
|
2512
|
+
// return false;
|
|
2513
|
+
// }
|
|
2514
|
+
// }
|
|
2515
|
+
//
|
|
2516
|
+
// return true;
|
|
2517
|
+
// }
|
|
2518
|
+
//
|
|
2519
|
+
// private getTokenByEvent(evt: KeyboardEvent): string[] {
|
|
2520
|
+
// const tokens: string[] = [];
|
|
2521
|
+
// if (evt.altKey) {
|
|
2522
|
+
// tokens.push("alt");
|
|
2523
|
+
// }
|
|
2524
|
+
// if (evt.shiftKey) {
|
|
2525
|
+
// tokens.push("shift");
|
|
2526
|
+
// }
|
|
2527
|
+
// if (evt.ctrlKey) {
|
|
2528
|
+
// tokens.push("ctrl");
|
|
2529
|
+
// }
|
|
2530
|
+
// if (evt.metaKey) {
|
|
2531
|
+
// tokens.push("meta");
|
|
2532
|
+
// }
|
|
2533
|
+
// if (evt.code) {
|
|
2534
|
+
// tokens.push(evt.code.toLowerCase().replace(/key/g, ""));
|
|
2535
|
+
// }
|
|
2536
|
+
// return tokens.sort();
|
|
2537
|
+
// }
|
|
2490
2538
|
/**
|
|
2491
2539
|
* Retrieves the shortcut action mapping object.
|
|
2492
2540
|
*
|
|
@@ -2496,7 +2544,7 @@ class nt {
|
|
|
2496
2544
|
return this.shortcutActionIdMapping;
|
|
2497
2545
|
}
|
|
2498
2546
|
}
|
|
2499
|
-
class
|
|
2547
|
+
class le {
|
|
2500
2548
|
onCheckboxChanged(e) {
|
|
2501
2549
|
}
|
|
2502
2550
|
onContextmenu(e) {
|
|
@@ -2516,7 +2564,7 @@ class ae {
|
|
|
2516
2564
|
onFocusChanged(e) {
|
|
2517
2565
|
}
|
|
2518
2566
|
}
|
|
2519
|
-
class
|
|
2567
|
+
class me {
|
|
2520
2568
|
setStyle(e, t, s) {
|
|
2521
2569
|
return e.style[t] = s, e;
|
|
2522
2570
|
}
|
|
@@ -2543,7 +2591,7 @@ class ue {
|
|
|
2543
2591
|
e.setAttribute(t, s);
|
|
2544
2592
|
}
|
|
2545
2593
|
}
|
|
2546
|
-
class
|
|
2594
|
+
class ht {
|
|
2547
2595
|
render(e, t, s, o, i, r, l) {
|
|
2548
2596
|
if (i.isEditable(t, s)) {
|
|
2549
2597
|
l.addClass(e, "ge-table-row-input-div");
|
|
@@ -2564,7 +2612,7 @@ class ct {
|
|
|
2564
2612
|
}
|
|
2565
2613
|
}
|
|
2566
2614
|
}
|
|
2567
|
-
class
|
|
2615
|
+
class pt {
|
|
2568
2616
|
constructor(e = "none", t = "single") {
|
|
2569
2617
|
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1, this.silent = !1, this.listenerArr = [];
|
|
2570
2618
|
}
|
|
@@ -2646,7 +2694,7 @@ class dt {
|
|
|
2646
2694
|
this.selectionType !== "none" && (this.allSelected = !1, this.selectionMode === "single" && (this.ranges = []), this.selectionType === "row" ? (e.c1 = 0, e.c2 = Number.MAX_SAFE_INTEGER) : this.selectionType === "column" ? (e.r1 = 0, e.r2 = Number.MAX_SAFE_INTEGER) : this.selectionType === "cell" ? (e.r2 = e.r1, e.c2 = e.c1) : this.selectionType, this.ranges.push(e), this.fireChangeEvent());
|
|
2647
2695
|
}
|
|
2648
2696
|
}
|
|
2649
|
-
class
|
|
2697
|
+
class gt {
|
|
2650
2698
|
constructor(e = "none") {
|
|
2651
2699
|
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1, this.listenerArr = [];
|
|
2652
2700
|
}
|
|
@@ -2683,7 +2731,7 @@ class ht {
|
|
|
2683
2731
|
return [this.rowIndex, this.columnIndex];
|
|
2684
2732
|
}
|
|
2685
2733
|
}
|
|
2686
|
-
class
|
|
2734
|
+
class be {
|
|
2687
2735
|
constructor(e = new D(
|
|
2688
2736
|
"❯",
|
|
2689
2737
|
"",
|
|
@@ -2697,14 +2745,14 @@ class me {
|
|
|
2697
2745
|
}
|
|
2698
2746
|
// `⊖ `, `⊕ `;
|
|
2699
2747
|
}
|
|
2700
|
-
const
|
|
2701
|
-
class
|
|
2748
|
+
const ft = new pt(), ut = new gt("cell");
|
|
2749
|
+
class Se {
|
|
2702
2750
|
constructor() {
|
|
2703
2751
|
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 = {
|
|
2704
2752
|
header: 34,
|
|
2705
2753
|
body: 34,
|
|
2706
2754
|
footer: 34
|
|
2707
|
-
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new
|
|
2755
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new fe(), this.headerGroupOptions = new be(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new ue(), this.sortOrder = ["asc", "desc"], this.shortcutActionsDisabled = !1, this.resizeEventDebounceDelay = 500, this.getEditRenderer = (e, t) => new ht(), this.getSelectionModel = () => ft, this.getFocusModel = () => ut;
|
|
2708
2756
|
}
|
|
2709
2757
|
}
|
|
2710
2758
|
const L = class L {
|
|
@@ -2792,16 +2840,16 @@ const L = class L {
|
|
|
2792
2840
|
L.columnSeparatorChar = " ", L.rowSeparatorChar = `
|
|
2793
2841
|
`;
|
|
2794
2842
|
let H = L;
|
|
2795
|
-
class
|
|
2843
|
+
class mt {
|
|
2796
2844
|
constructor(e, t = 500) {
|
|
2797
|
-
this.tableScope = e, this.debounceDelay = t, new ResizeObserver(
|
|
2845
|
+
this.tableScope = e, this.debounceDelay = t, new ResizeObserver(Ve(this.handleResize.bind(this), t)).observe(this.tableScope.hostElement);
|
|
2798
2846
|
}
|
|
2799
2847
|
handleResize(e) {
|
|
2800
2848
|
const t = e[0], { width: s } = t.contentRect;
|
|
2801
2849
|
this.tableScope.recalcColumnWidths(s);
|
|
2802
2850
|
}
|
|
2803
2851
|
}
|
|
2804
|
-
class
|
|
2852
|
+
class bt {
|
|
2805
2853
|
/**
|
|
2806
2854
|
* Downloads a matrix data as an Excel file.
|
|
2807
2855
|
*
|
|
@@ -2907,14 +2955,14 @@ class ut {
|
|
|
2907
2955
|
return this.createZip(s);
|
|
2908
2956
|
}
|
|
2909
2957
|
}
|
|
2910
|
-
class se extends
|
|
2911
|
-
constructor(e, t, s, o, i, r = new H(), l = new
|
|
2958
|
+
class se extends st {
|
|
2959
|
+
constructor(e, t, s, o, i, r = new H(), l = new bt()) {
|
|
2912
2960
|
var h;
|
|
2913
|
-
if (super(e, t, new
|
|
2961
|
+
if (super(e, t, new Ne(s), o), this.eventListener = i, this.copyService = r, this.excelService = l, this.licenseManager = k.getInstance(), this.selectionService = new at(this), this.api = new Ke(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.lastDragFrom = -1, this.lastDragTo = -1, this.firstDraggingRendering = !0, this.lastContextmenu = Date.now(), t.setTableScope(this), i || (this.eventListener = new le()), (h = this.tableOptions) != null && h.autoRestoreOptions) {
|
|
2914
2962
|
const d = this.tableOptions.autoRestoreOptions, p = d.getStorageKeyFn;
|
|
2915
|
-
p && (d.autoRestoreScrollPosition && (this.storeScrollPosStateService = new
|
|
2963
|
+
p && (d.autoRestoreScrollPosition && (this.storeScrollPosStateService = new Ye(p)), d.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new qe(p)), d.autoRestoreSortingState && (this.storeSortingService = new Ze(p)));
|
|
2916
2964
|
}
|
|
2917
|
-
this.mouseHandler = new
|
|
2965
|
+
this.mouseHandler = new Ge(this), this.inputHandler = new it(this), this.resizeHandler = new mt(this, o.resizeEventDebounceDelay), this.shortcutService = new dt(this), this.shortcutService.addListener(this.selectionService);
|
|
2918
2966
|
const a = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
2919
2967
|
a && a.addEventSelectionChangedListener(this);
|
|
2920
2968
|
const c = this.getFocusModel ? this.getFocusModel() : void 0;
|
|
@@ -2932,7 +2980,7 @@ class se extends tt {
|
|
|
2932
2980
|
*
|
|
2933
2981
|
* @return {TableScope} - The newly created TableScope instance.
|
|
2934
2982
|
*/
|
|
2935
|
-
static create(e, t, s = new
|
|
2983
|
+
static create(e, t, s = new Se(), o = new le(), i = new me(), r = new H()) {
|
|
2936
2984
|
return new se(e, t, i, s, o, r);
|
|
2937
2985
|
}
|
|
2938
2986
|
/**
|
|
@@ -3048,7 +3096,13 @@ class se extends tt {
|
|
|
3048
3096
|
* @return {void}
|
|
3049
3097
|
*/
|
|
3050
3098
|
contextmenu(e) {
|
|
3051
|
-
|
|
3099
|
+
var s, o;
|
|
3100
|
+
const t = Date.now();
|
|
3101
|
+
if (t - this.lastContextmenu < 50) {
|
|
3102
|
+
this.lastContextmenu = t, (s = e.originalEvent) == null || s.preventDefault(), (o = e.originalEvent) == null || o.stopImmediatePropagation();
|
|
3103
|
+
return;
|
|
3104
|
+
}
|
|
3105
|
+
this.lastContextmenu = t, this.eventListener.onContextmenu(e);
|
|
3052
3106
|
}
|
|
3053
3107
|
/**
|
|
3054
3108
|
* Toggles the expand or collapse state of all items in the body area model.
|
|
@@ -3130,7 +3184,7 @@ class se extends tt {
|
|
|
3130
3184
|
const o = this.tableModel.getColumnDef(s);
|
|
3131
3185
|
if (o != null && o.sortable && o.sortable()) {
|
|
3132
3186
|
e.preventDefault(), e.stopPropagation();
|
|
3133
|
-
const l = o.sortStatesOrder ? o.sortStatesOrder : this.tableOptions.sortOrder, a = o.sortState ?? "", c = l[(l.indexOf(a) + 1) % l.length], h = new
|
|
3187
|
+
const l = o.sortStatesOrder ? o.sortStatesOrder : this.tableOptions.sortOrder, a = o.sortState ?? "", c = l[(l.indexOf(a) + 1) % l.length], h = new ot(s, c);
|
|
3134
3188
|
this.tableModel.doSort([h]) && ((i = this.tableModel.getColumnDefs()) == null || i.forEach((p) => p.sortState = ""), o.sortState = c), this.repaint(), (r = this.storeSortingService) == null || r.setSortItems([h]);
|
|
3135
3189
|
}
|
|
3136
3190
|
}
|
|
@@ -3563,15 +3617,15 @@ V.themes = ["light", "combat", "paper", "blackboard"], V.vars = {
|
|
|
3563
3617
|
--ge-table-drop-zone-bg: #758129;
|
|
3564
3618
|
}`
|
|
3565
3619
|
};
|
|
3566
|
-
let
|
|
3567
|
-
const
|
|
3568
|
-
constructor(e = new
|
|
3620
|
+
let ne = V;
|
|
3621
|
+
const N = class N {
|
|
3622
|
+
constructor(e = new be()) {
|
|
3569
3623
|
this.headerGroupOptions = e;
|
|
3570
3624
|
}
|
|
3571
3625
|
render(e, t, s, o, i, r, l) {
|
|
3572
3626
|
const a = r != null && r.data ? r.data : "";
|
|
3573
3627
|
if (r) {
|
|
3574
|
-
const { toggle: c, visibility: h, closed: d } = r, p = c ?
|
|
3628
|
+
const { toggle: c, visibility: h, closed: d } = r, p = c ? N.toggleHeaderGroup : "";
|
|
3575
3629
|
this.addText(e, o, t, s, a, p), c && h !== "always" && this.addArrowDiv(l, e, !d, t, s, o, p);
|
|
3576
3630
|
} else
|
|
3577
3631
|
this.addText(e, o, t, s, a, "");
|
|
@@ -3603,29 +3657,29 @@ const G = class G {
|
|
|
3603
3657
|
}
|
|
3604
3658
|
}
|
|
3605
3659
|
};
|
|
3606
|
-
|
|
3607
|
-
let
|
|
3608
|
-
function
|
|
3660
|
+
N.toggleHeaderGroup = "toggleHeaderGroup";
|
|
3661
|
+
let ce = N;
|
|
3662
|
+
function St(n) {
|
|
3609
3663
|
let e;
|
|
3610
3664
|
return {
|
|
3611
3665
|
c() {
|
|
3612
|
-
e =
|
|
3666
|
+
e = Me("div"), Re(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");
|
|
3613
3667
|
},
|
|
3614
3668
|
m(t, s) {
|
|
3615
|
-
|
|
3669
|
+
Ae(t, e, s), n[4](e);
|
|
3616
3670
|
},
|
|
3617
3671
|
p: O,
|
|
3618
3672
|
i: O,
|
|
3619
3673
|
o: O,
|
|
3620
3674
|
d(t) {
|
|
3621
|
-
t &&
|
|
3675
|
+
t && pe(e), n[4](null);
|
|
3622
3676
|
}
|
|
3623
3677
|
};
|
|
3624
3678
|
}
|
|
3625
|
-
function
|
|
3626
|
-
let { tableModel: s } = e, { tableOptions: o = new
|
|
3627
|
-
const l =
|
|
3628
|
-
|
|
3679
|
+
function yt(n, e, t) {
|
|
3680
|
+
let { tableModel: s } = e, { tableOptions: o = new Se() } = e, { licenseKey: i } = e, r;
|
|
3681
|
+
const l = we();
|
|
3682
|
+
Ce(() => {
|
|
3629
3683
|
const c = {
|
|
3630
3684
|
onSelectionChanged(d) {
|
|
3631
3685
|
l("selectionChanged", d);
|
|
@@ -3654,7 +3708,7 @@ function bt(n, e, t) {
|
|
|
3654
3708
|
onMouseMoved: (d) => {
|
|
3655
3709
|
l("mouseMoved", d);
|
|
3656
3710
|
}
|
|
3657
|
-
}, h = new se(r, s, new
|
|
3711
|
+
}, h = new se(r, s, new me(), o, c);
|
|
3658
3712
|
h.firstInit(), l("tableReady", h.getApi()), i && k.getInstance().setLicenseKey(i);
|
|
3659
3713
|
});
|
|
3660
3714
|
function a(c) {
|
|
@@ -3666,16 +3720,16 @@ function bt(n, e, t) {
|
|
|
3666
3720
|
"tableModel" in c && t(1, s = c.tableModel), "tableOptions" in c && t(2, o = c.tableOptions), "licenseKey" in c && t(3, i = c.licenseKey);
|
|
3667
3721
|
}, [r, s, o, i, a];
|
|
3668
3722
|
}
|
|
3669
|
-
class
|
|
3723
|
+
class Ct extends We {
|
|
3670
3724
|
constructor(e) {
|
|
3671
|
-
super(),
|
|
3725
|
+
super(), _e(this, e, yt, St, ve, {
|
|
3672
3726
|
tableModel: 1,
|
|
3673
3727
|
tableOptions: 2,
|
|
3674
3728
|
licenseKey: 3
|
|
3675
3729
|
});
|
|
3676
3730
|
}
|
|
3677
3731
|
}
|
|
3678
|
-
class
|
|
3732
|
+
class vt {
|
|
3679
3733
|
constructor(e) {
|
|
3680
3734
|
this.Component = e;
|
|
3681
3735
|
}
|
|
@@ -3697,6 +3751,6 @@ class wt {
|
|
|
3697
3751
|
}
|
|
3698
3752
|
}
|
|
3699
3753
|
export {
|
|
3700
|
-
|
|
3701
|
-
|
|
3754
|
+
vt as ComponentRendererWrapper,
|
|
3755
|
+
Ct as GuiexpertTable
|
|
3702
3756
|
};
|