@guiexpert/vue3-table 1.0.17 → 1.0.19
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 +4 -4
- package/index.js +583 -287
- package/package.json +1 -1
- package/style.css +1 -1
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as K, ref as Y, onMounted as q, openBlock as U, createElementBlock as J, createVNode as Q, render as V } from "vue";
|
|
2
2
|
function L(h) {
|
|
3
3
|
return h && h.type === "TreeRow";
|
|
4
4
|
}
|
|
@@ -6,8 +6,8 @@ function O(h) {
|
|
|
6
6
|
return h && h.type === "AreaModelTree";
|
|
7
7
|
}
|
|
8
8
|
class $ {
|
|
9
|
-
constructor(e = -1, t = -1, s = -1, i = -1, o, l,
|
|
10
|
-
this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = i, this.areaIdent = o, this.sideIdent = l, this.originalEvent =
|
|
9
|
+
constructor(e = -1, t = -1, s = -1, i = -1, o, l, n, r = 0, a = 0, d = 0, u = "") {
|
|
10
|
+
this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = i, this.areaIdent = o, this.sideIdent = l, this.originalEvent = n, this.clickCount = r, this.draggingX = a, this.draggingY = d, this.action = u;
|
|
11
11
|
}
|
|
12
12
|
clone() {
|
|
13
13
|
return new $(
|
|
@@ -30,7 +30,7 @@ class D {
|
|
|
30
30
|
this.content = e, this.style = t, this.classes = s;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
class
|
|
33
|
+
class N {
|
|
34
34
|
constructor(e = new D(
|
|
35
35
|
">",
|
|
36
36
|
"transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
|
|
@@ -51,12 +51,12 @@ class G {
|
|
|
51
51
|
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = i;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
class
|
|
54
|
+
class j {
|
|
55
55
|
constructor(e = new D("↑", "", ["ge-header-sorted-asc"]), t = new D("↓", "", ["ge-header-sorted-desc"]), s = new D("↑", "color:transparent;", [])) {
|
|
56
56
|
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
class
|
|
59
|
+
class Z {
|
|
60
60
|
constructor(e) {
|
|
61
61
|
this.domService = e;
|
|
62
62
|
}
|
|
@@ -109,6 +109,9 @@ class Q {
|
|
|
109
109
|
addClass(e, t) {
|
|
110
110
|
return e.includes(" ") ? e.split(" ").forEach((s) => this.domService.addClass(t, s)) : this.domService.addClass(t, e), t;
|
|
111
111
|
}
|
|
112
|
+
removeClass(e, t) {
|
|
113
|
+
return e.includes(" ") ? e.split(" ").forEach((s) => this.domService.removeClass(t, s)) : this.domService.removeClass(t, e), t;
|
|
114
|
+
}
|
|
112
115
|
addClasses(e, t) {
|
|
113
116
|
if (e)
|
|
114
117
|
for (const s of e)
|
|
@@ -127,26 +130,26 @@ class Q {
|
|
|
127
130
|
return this.addClass(e, s), this.domService.appendChild(t, s), s;
|
|
128
131
|
}
|
|
129
132
|
addRowDiv(e, t, s = -1, i, o, l = "") {
|
|
130
|
-
const
|
|
131
|
-
if (this.domService.addClass(
|
|
133
|
+
const n = t.index ?? -1, r = this.getDivOrCreateDiv(n, e);
|
|
134
|
+
if (this.domService.addClass(r, "ge-table-row-div"), this.domService.addClass(r, `ge-table-row-div-${t.index}`), i === "body" && o === "center") {
|
|
132
135
|
const a = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
133
|
-
this.domService.addClass(
|
|
136
|
+
this.domService.addClass(r, `ge-table-row-${a}`);
|
|
134
137
|
}
|
|
135
|
-
if (this.domService.setStyle(
|
|
138
|
+
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", `${i}`), l) {
|
|
136
139
|
const a = this.domService.createText(l);
|
|
137
|
-
this.domService.appendChild(
|
|
140
|
+
this.domService.appendChild(r, a);
|
|
138
141
|
}
|
|
139
|
-
return this.domService.appendChild(e.child,
|
|
142
|
+
return this.domService.appendChild(e.child, r), r;
|
|
140
143
|
}
|
|
141
|
-
addColumnDiv(e, t, s = -1, i = -1, o, l,
|
|
144
|
+
addColumnDiv(e, t, s = -1, i = -1, o, l, n = "", r, a, d = void 0, u) {
|
|
142
145
|
const g = a == null ? void 0 : a.treeOptions, m = a == null ? void 0 : a.showCheckboxWihoutExtraColumn, c = this.domService.createElement("div");
|
|
143
146
|
this.domService.addClass(c, "ge-table-col-div"), this.domService.addClass(c, `ge-table-col-div-${t.index}`), this.domService.setAttribute(c, "data-col-index", `${t.index}`), this.domService.setAttribute(c, "data-row-index", `${s}`), this.domService.setAttribute(c, "data-area", `${o}`);
|
|
144
|
-
const
|
|
145
|
-
if (o === "body" && l === "center" && this.domService.addClass(c, `ge-table-column-${
|
|
146
|
-
const
|
|
147
|
-
this.addLabelDiv(c,
|
|
147
|
+
const f = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
148
|
+
if (o === "body" && l === "center" && this.domService.addClass(c, `ge-table-column-${f}`), this.domService.setStyle(c, "display", "clip"), this.domService.setStyle(c, "position", "absolute"), this.domService.setStyle(c, "left", `${t.left}px`), this.domService.setStyle(c, "top", `${t.top}px`), this.domService.setStyle(c, "width", `${t.width}px`), this.domService.setStyle(c, "height", `${t.height}px`), r && r !== "none" && (this.domService.addClass(c, "ge-table-col-tree"), this.addArrowDiv(c, r, g, s, i, o)), m && i === 0 && d && this.addCheckboxToDiv(c, d, o, s), n) {
|
|
149
|
+
const S = r !== "none" && i === 0;
|
|
150
|
+
this.addLabelDiv(c, n, S, s, i, o);
|
|
148
151
|
}
|
|
149
|
-
return
|
|
152
|
+
return u && this.addSortedIcon(c, u, a == null ? void 0 : a.sortedOptions, i), this.domService.appendChild(e, c), c;
|
|
150
153
|
}
|
|
151
154
|
addCheckboxToDiv(e, t, s, i) {
|
|
152
155
|
const o = this.domService.createElement("div"), l = t === "full" ? "checked" : "";
|
|
@@ -160,40 +163,40 @@ class Q {
|
|
|
160
163
|
class="ge-table-row-checkbox"> `, this.domService.setStyle(o, "display", "inline"), this.domService.setStyle(o, "width", "inherit"), this.domService.setAttribute(o, "data-row-index", `${i}`), this.domService.appendChild(e, o), o;
|
|
161
164
|
}
|
|
162
165
|
addLabelDiv(e, t = "", s = !1, i = -1, o = -1, l = "body") {
|
|
163
|
-
const
|
|
164
|
-
if (this.domService.addClass(
|
|
166
|
+
const n = this.domService.createElement("div");
|
|
167
|
+
if (this.domService.addClass(n, "ge-table-label-div"), this.domService.setStyle(n, "position", "relative"), this.domService.setStyle(n, "background", "transparent"), this.domService.setStyle(n, "width", "100%"), this.domService.setStyle(n, "height", "100%"), this.domService.setAttribute(n, "data-row-index", `${i}`), this.domService.setAttribute(n, "data-col-index", `${o}`), this.domService.setAttribute(n, "data-area", `${l}`), t)
|
|
165
168
|
if (s) {
|
|
166
|
-
const
|
|
167
|
-
this.domService.appendChild(
|
|
169
|
+
const r = this.domService.createText(t);
|
|
170
|
+
this.domService.appendChild(n, r);
|
|
168
171
|
} else {
|
|
169
|
-
const
|
|
170
|
-
this.domService.appendChild(
|
|
172
|
+
const r = this.domService.createElement("div");
|
|
173
|
+
this.domService.appendChild(n, r);
|
|
171
174
|
const a = this.domService.createText(t);
|
|
172
|
-
this.domService.addClass(
|
|
175
|
+
this.domService.addClass(r, "ge-table-label"), this.domService.appendChild(r, a), this.domService.setAttribute(r, "data-row-index", `${i}`), this.domService.setAttribute(r, "data-col-index", `${o}`), this.domService.setAttribute(r, "data-area", `${l}`);
|
|
173
176
|
}
|
|
174
|
-
return this.domService.appendChild(e,
|
|
177
|
+
return this.domService.appendChild(e, n), n;
|
|
175
178
|
}
|
|
176
|
-
addSortedIcon(e, t = "", s = new
|
|
179
|
+
addSortedIcon(e, t = "", s = new j(), i = -1) {
|
|
177
180
|
const o = this.domService.createElement("div");
|
|
178
181
|
this.domService.addClass(o, "ge-table-sorted-icon-div"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "top", "0"), this.domService.setStyle(o, "right", "0"), this.domService.setStyle(o, "width", "20px"), this.domService.setStyle(o, "background", "transparent"), this.domService.setStyle(o, "cursor", "pointer"), this.domService.setAttribute(o, "data-col-index", `${i}`), this.domService.setAttribute(o, "data-area", "header");
|
|
179
182
|
let l;
|
|
180
183
|
t === "asc" ? l = s.iconAsc : t === "desc" ? l = s.iconDesc : l = s.iconPlaceholder;
|
|
181
|
-
const
|
|
182
|
-
this.domService.appendChild(o,
|
|
184
|
+
const n = l.content, r = this.domService.createText(n);
|
|
185
|
+
this.domService.appendChild(o, r), l.style && this.applyStyleString(o, l.style);
|
|
183
186
|
for (const a of l.classes)
|
|
184
187
|
this.domService.addClass(o, a);
|
|
185
188
|
return this.domService.appendChild(e, o), o;
|
|
186
189
|
}
|
|
187
|
-
addArrowDiv(e, t = "none", s = new
|
|
188
|
-
const
|
|
189
|
-
this.domService.addClass(
|
|
190
|
-
let
|
|
191
|
-
t === "expanded" ?
|
|
192
|
-
const a =
|
|
193
|
-
this.domService.appendChild(
|
|
194
|
-
for (const
|
|
195
|
-
this.domService.addClass(
|
|
196
|
-
return this.domService.appendChild(e,
|
|
190
|
+
addArrowDiv(e, t = "none", s = new N(), i = -1, o = -1, l = "body") {
|
|
191
|
+
const n = this.domService.createElement("div");
|
|
192
|
+
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", `${i}`), this.domService.setAttribute(n, "data-col-index", `${o}`), this.domService.setAttribute(n, "data-area", `${l}`);
|
|
193
|
+
let r;
|
|
194
|
+
t === "expanded" ? r = s.arrowExpanded : t === "collapsed" ? r = s.arrowCollapsed : r = s.arrowPlaceholder;
|
|
195
|
+
const a = r.content, d = this.domService.createText(a);
|
|
196
|
+
this.domService.appendChild(n, d), r.style && this.applyStyleString(n, r.style);
|
|
197
|
+
for (const u of r.classes)
|
|
198
|
+
this.domService.addClass(n, u);
|
|
199
|
+
return this.domService.appendChild(e, n), n;
|
|
197
200
|
}
|
|
198
201
|
addColumnBorderDivs(e, t, s, i, o) {
|
|
199
202
|
if (e.verticalBorderVisible) {
|
|
@@ -235,7 +238,7 @@ class Q {
|
|
|
235
238
|
}
|
|
236
239
|
}
|
|
237
240
|
const B = (h) => h === "header" ? "header" : h === "footer" ? "footer" : "body";
|
|
238
|
-
class
|
|
241
|
+
class ee {
|
|
239
242
|
constructor(e, t) {
|
|
240
243
|
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)) {
|
|
241
244
|
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"));
|
|
@@ -247,19 +250,33 @@ class Z {
|
|
|
247
250
|
}
|
|
248
251
|
}
|
|
249
252
|
}
|
|
250
|
-
class
|
|
253
|
+
class te {
|
|
251
254
|
constructor(e) {
|
|
252
255
|
this.tableScope = e, this.expandedAll = !0, this.mouseDown = !1, this.dragging = !1, 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(
|
|
253
256
|
(t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
|
|
254
257
|
);
|
|
255
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Handles the "contextmenu" event.
|
|
261
|
+
*
|
|
262
|
+
* @private
|
|
263
|
+
* @param {MouseEvent} evt - The mouse event object.
|
|
264
|
+
* @return {void}
|
|
265
|
+
*/
|
|
256
266
|
onContextmenu(e) {
|
|
257
267
|
this.mouseEvent = e;
|
|
258
268
|
const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
|
|
259
269
|
this.tableScope.contextmenu(t);
|
|
260
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* Handles the click event on the host element.
|
|
273
|
+
*
|
|
274
|
+
* @param {MouseEvent} event - The click event.
|
|
275
|
+
*
|
|
276
|
+
* @return {void}
|
|
277
|
+
*/
|
|
261
278
|
onHostElementClicked(e) {
|
|
262
|
-
const t = new
|
|
279
|
+
const t = new ee(e.target, this.tableScope);
|
|
263
280
|
if (t.action === "toggleExpandCollapseAll")
|
|
264
281
|
this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
|
|
265
282
|
else if (t.inputType === "checkbox" && t.areaIdent)
|
|
@@ -278,32 +295,52 @@ class ee {
|
|
|
278
295
|
}
|
|
279
296
|
this.publishGeMouseEvent(e, 1);
|
|
280
297
|
}
|
|
298
|
+
/**
|
|
299
|
+
* Handles the double click event on the host element.
|
|
300
|
+
* This method is private.
|
|
301
|
+
*
|
|
302
|
+
* @param {MouseEvent} event - The double click event.
|
|
303
|
+
*/
|
|
281
304
|
onHostElementDblClicked(e) {
|
|
282
305
|
if (e.target instanceof HTMLElement) {
|
|
283
|
-
const t = e.target, s = t.getAttribute("data-area"), i = B(s), o = Number(t.getAttribute("data-row-index")), l = Number(t.getAttribute("data-col-index")),
|
|
306
|
+
const t = e.target, s = t.getAttribute("data-area"), i = B(s), o = Number(t.getAttribute("data-row-index")), l = Number(t.getAttribute("data-col-index")), n = this.tableScope.tableModel.getAreaModel(i);
|
|
284
307
|
if (s && i === "header")
|
|
285
308
|
this.tableScope.tableModel.isSortable(l) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, o, l));
|
|
286
309
|
else if (t.getAttribute("data-row-index")) {
|
|
287
|
-
const
|
|
288
|
-
if (s && i === "body" &&
|
|
310
|
+
const r = n.getRowByIndex(o);
|
|
311
|
+
if (s && i === "body" && n.isEditable(o, l) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, l)), L(r) && l === this.getArrowColumnIndex()) {
|
|
289
312
|
e.preventDefault(), e.stopPropagation();
|
|
290
|
-
const a =
|
|
291
|
-
a.expanded = !a.expanded, "recalcVisibleTreeRows" in
|
|
313
|
+
const a = r;
|
|
314
|
+
a.expanded = !a.expanded, "recalcVisibleTreeRows" in n && n.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(a);
|
|
292
315
|
}
|
|
293
316
|
}
|
|
294
317
|
}
|
|
295
318
|
this.publishGeMouseEvent(e, 2);
|
|
296
319
|
}
|
|
320
|
+
/**
|
|
321
|
+
* Publishes a GeMouseEvent.
|
|
322
|
+
*
|
|
323
|
+
* @param {MouseEvent} event - The MouseEvent to publish.
|
|
324
|
+
* @param {number} clickCount - The number of clicks for the GeMouseEvent.
|
|
325
|
+
*
|
|
326
|
+
* @return {void}
|
|
327
|
+
*/
|
|
297
328
|
publishGeMouseEvent(e, t) {
|
|
298
329
|
var s;
|
|
299
330
|
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);
|
|
300
331
|
}
|
|
332
|
+
/**
|
|
333
|
+
* Update the collapsed/expanded state of a tree row.
|
|
334
|
+
*
|
|
335
|
+
* @param {TreeRowIf<any>} tr - The tree row object.
|
|
336
|
+
* @returns {void}
|
|
337
|
+
*/
|
|
301
338
|
updateCollapsedExpandedState(e) {
|
|
302
|
-
var s, i, o, l,
|
|
339
|
+
var s, i, o, l, n;
|
|
303
340
|
const t = (i = (s = this.tableScope.tableOptions) == null ? void 0 : s.autoRestoreOptions) == null ? void 0 : i.getRowId;
|
|
304
341
|
if (t) {
|
|
305
|
-
const
|
|
306
|
-
a ? (l = this.tableScope.storeStateCollapsedExpandService) == null || l.collapsedStateIdsPush(
|
|
342
|
+
const r = (o = this.tableScope.storeStateCollapsedExpandService) == null ? void 0 : o.collapsedExpandedStateGet().mode, a = r === "collapsed" && !e.expanded || r === "expanded" && e.expanded, d = r === "collapsed" && e.expanded || r === "expanded" && !e.expanded, u = t(e.data);
|
|
343
|
+
a ? (l = this.tableScope.storeStateCollapsedExpandService) == null || l.collapsedStateIdsPush(u) : d && ((n = this.tableScope.storeStateCollapsedExpandService) == null || n.collapsedStateIdsRemove(u));
|
|
307
344
|
}
|
|
308
345
|
}
|
|
309
346
|
getArrowColumnIndex() {
|
|
@@ -339,35 +376,107 @@ class ee {
|
|
|
339
376
|
}
|
|
340
377
|
}
|
|
341
378
|
}
|
|
342
|
-
class
|
|
379
|
+
class se {
|
|
343
380
|
constructor(e) {
|
|
344
381
|
this.tableScope = e;
|
|
345
382
|
}
|
|
346
|
-
|
|
347
|
-
|
|
383
|
+
/**
|
|
384
|
+
* Updates the cells in the table based on the provided events.
|
|
385
|
+
*
|
|
386
|
+
* @param {TableCellUpdateEventIf[]} events - The array of events representing the updates to perform on the cells.
|
|
387
|
+
* @param {boolean} [repaintAll=false] - Optional parameter indicating whether to repaint all cells or not. Default value is false. If true, the full table will be rendered. If false, the table cell will be rendered immediately.
|
|
388
|
+
*
|
|
389
|
+
* @return {void} - This method doesn't return anything.
|
|
390
|
+
*/
|
|
391
|
+
updateCells(e, t = !1) {
|
|
392
|
+
this.tableScope.updateCells(e, t);
|
|
348
393
|
}
|
|
394
|
+
/**
|
|
395
|
+
* Notifies that the external filter has changed.
|
|
396
|
+
*
|
|
397
|
+
* @return {void}
|
|
398
|
+
*/
|
|
349
399
|
externalFilterChanged() {
|
|
350
400
|
this.tableScope.externalFilterChanged();
|
|
351
401
|
}
|
|
402
|
+
/**
|
|
403
|
+
* Scrolls the table body to the specified pixel coordinates.
|
|
404
|
+
*
|
|
405
|
+
* @param {number} _px - The horizontal pixel coordinate to scroll to. Defaults to 0.
|
|
406
|
+
* @param {number} _py - The vertical pixel coordinate to scroll to. Defaults to 0.
|
|
407
|
+
* @return {void}
|
|
408
|
+
*/
|
|
352
409
|
scrollToPixel(e = 0, t = 0) {
|
|
353
410
|
}
|
|
411
|
+
/**
|
|
412
|
+
* Scrolls to the specified index in both horizontal and vertical directions.
|
|
413
|
+
*
|
|
414
|
+
* @param {number} _indexX - The index of the column to scroll to in the horizontal direction. Default is 0.
|
|
415
|
+
* @param {number} _indexY - The index of the row to scroll to in the vertical direction. Default is 0.
|
|
416
|
+
*
|
|
417
|
+
* @return undefined
|
|
418
|
+
*/
|
|
354
419
|
scrollToIndex(e = 0, t = 0) {
|
|
355
420
|
}
|
|
421
|
+
/**
|
|
422
|
+
* Sets whether the header is visible or not.
|
|
423
|
+
*
|
|
424
|
+
* @param _visible - A boolean value indicating whether the header should be visible. Default value is true.
|
|
425
|
+
*
|
|
426
|
+
* @return undefined
|
|
427
|
+
*/
|
|
356
428
|
setHeaderVisible(e = !0) {
|
|
357
429
|
}
|
|
430
|
+
/**
|
|
431
|
+
* Sets the visibility of a column in the table.
|
|
432
|
+
*
|
|
433
|
+
* @param {_column} - The column index or column definition to set visibility for.
|
|
434
|
+
* @param {_visible=true} - The flag to set visibility to. true for visible, false for hidden.
|
|
435
|
+
*
|
|
436
|
+
* @return {void} - There is no return value.
|
|
437
|
+
*/
|
|
358
438
|
setColumnVisible(e, t = !0) {
|
|
359
439
|
}
|
|
440
|
+
/**
|
|
441
|
+
* Returns whether a column is visible or not.
|
|
442
|
+
*
|
|
443
|
+
* @param {number | ColumnDefIf} _column - The column index or the column definition.
|
|
444
|
+
* @return {boolean} - True if the column is visible, false otherwise.
|
|
445
|
+
*/
|
|
360
446
|
isColumnVisible(e) {
|
|
361
447
|
return !0;
|
|
362
448
|
}
|
|
449
|
+
/**
|
|
450
|
+
* Checks if the header is visible.
|
|
451
|
+
*
|
|
452
|
+
* @return {boolean} - Returns true if the header is visible, otherwise returns false.
|
|
453
|
+
*/
|
|
363
454
|
isHeaderVisible() {
|
|
364
455
|
return !0;
|
|
365
456
|
}
|
|
457
|
+
/**
|
|
458
|
+
* Sets the visibility of the footer.
|
|
459
|
+
*
|
|
460
|
+
* @param {boolean} _visible - Indicates whether the footer should be visible or not. Default value is true.
|
|
461
|
+
*
|
|
462
|
+
* @return {void} - This method does not return any value.
|
|
463
|
+
*/
|
|
366
464
|
setFooterVisible(e = !0) {
|
|
367
465
|
}
|
|
466
|
+
/**
|
|
467
|
+
* Determines if the footer is visible.
|
|
468
|
+
*
|
|
469
|
+
* @returns {boolean} True if the footer is visible, false otherwise.
|
|
470
|
+
*/
|
|
368
471
|
isFooterVisible() {
|
|
369
472
|
return !0;
|
|
370
473
|
}
|
|
474
|
+
/**
|
|
475
|
+
* Repaints the table.
|
|
476
|
+
*
|
|
477
|
+
* This method calls the repaint method of the tableScope object
|
|
478
|
+
* to update and redraw the table based on the latest data.
|
|
479
|
+
*/
|
|
371
480
|
repaint() {
|
|
372
481
|
this.tableScope.repaint();
|
|
373
482
|
}
|
|
@@ -447,7 +556,7 @@ class W {
|
|
|
447
556
|
// }
|
|
448
557
|
// }
|
|
449
558
|
}
|
|
450
|
-
class
|
|
559
|
+
class ie extends W {
|
|
451
560
|
constructor(e) {
|
|
452
561
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
453
562
|
}
|
|
@@ -469,14 +578,14 @@ class se extends W {
|
|
|
469
578
|
}
|
|
470
579
|
}
|
|
471
580
|
}
|
|
472
|
-
class
|
|
581
|
+
class oe {
|
|
473
582
|
constructor(e = "collapsed", t = [], s = !1, i = !1) {
|
|
474
583
|
this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = i;
|
|
475
584
|
}
|
|
476
585
|
}
|
|
477
|
-
class
|
|
586
|
+
class le extends W {
|
|
478
587
|
constructor(e) {
|
|
479
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
588
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new oe(), this.load();
|
|
480
589
|
}
|
|
481
590
|
collapsedExpandedStateGet() {
|
|
482
591
|
return this.collapsedExpandedState;
|
|
@@ -508,7 +617,7 @@ class oe extends W {
|
|
|
508
617
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
509
618
|
}
|
|
510
619
|
}
|
|
511
|
-
class
|
|
620
|
+
class re extends W {
|
|
512
621
|
constructor(e) {
|
|
513
622
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
514
623
|
}
|
|
@@ -535,7 +644,7 @@ class T {
|
|
|
535
644
|
this.left = e, this.width = t, this.height = s, this.top = i, this.index = o;
|
|
536
645
|
}
|
|
537
646
|
}
|
|
538
|
-
class
|
|
647
|
+
class ne {
|
|
539
648
|
constructor(e, t, s, i) {
|
|
540
649
|
this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = i, this.scrollTop = 0, this.areaBodyWestGeo = new T(), this.areaBodyCenterGeo = new T(), this.areaBodyEastGeo = new T();
|
|
541
650
|
const o = this.hostElement;
|
|
@@ -686,12 +795,21 @@ class re {
|
|
|
686
795
|
this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", t);
|
|
687
796
|
}
|
|
688
797
|
}
|
|
689
|
-
class
|
|
798
|
+
class M {
|
|
799
|
+
/**
|
|
800
|
+
* Represents a constructor for a class.
|
|
801
|
+
* @constructor
|
|
802
|
+
* @param {number} r1 - The value for r1.
|
|
803
|
+
* @param {number} c1 - The value for c1.
|
|
804
|
+
* @param {number} r2 - The value for r2.
|
|
805
|
+
* @param {number} c2 - The value for c2.
|
|
806
|
+
* @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
|
|
807
|
+
*/
|
|
690
808
|
constructor(e, t, s, i, o = !1) {
|
|
691
809
|
this.r1 = e, this.c1 = t, this.r2 = s, this.c2 = i, this.gammaRange = o;
|
|
692
810
|
}
|
|
693
811
|
static create(e) {
|
|
694
|
-
return e.gammaRange === void 0 && (e.gammaRange = !1), new
|
|
812
|
+
return e.gammaRange === void 0 && (e.gammaRange = !1), new M(
|
|
695
813
|
e.rowIndex1,
|
|
696
814
|
e.columnIndex1,
|
|
697
815
|
e.rowIndex2,
|
|
@@ -700,19 +818,19 @@ class A {
|
|
|
700
818
|
);
|
|
701
819
|
}
|
|
702
820
|
static singleCell(e, t) {
|
|
703
|
-
return new
|
|
821
|
+
return new M(e, t, e, t);
|
|
704
822
|
}
|
|
705
823
|
static singleRow(e) {
|
|
706
|
-
return new
|
|
824
|
+
return new M(e, 0, e, Number.MAX_SAFE_INTEGER);
|
|
707
825
|
}
|
|
708
826
|
static singleColumn(e) {
|
|
709
|
-
return new
|
|
827
|
+
return new M(0, e, Number.MAX_SAFE_INTEGER, e);
|
|
710
828
|
}
|
|
711
829
|
isInRange(e, t) {
|
|
712
830
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
713
831
|
}
|
|
714
832
|
}
|
|
715
|
-
class
|
|
833
|
+
class ae {
|
|
716
834
|
constructor(e, t) {
|
|
717
835
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
718
836
|
}
|
|
@@ -726,9 +844,9 @@ class ne {
|
|
|
726
844
|
let o = this.areaModel.getColspanAt(s, i), l = this.areaModel.getRowspanAt(s, i);
|
|
727
845
|
if (o > 1 || l > 1) {
|
|
728
846
|
o === 0 && (o = 1), l === 0 && (l = 1);
|
|
729
|
-
const
|
|
847
|
+
const n = this.areaModel.hasOwnProperty("gammaCells");
|
|
730
848
|
this.colAndRowspanRanges.push(
|
|
731
|
-
new
|
|
849
|
+
new M(s, i, s + l - 1, i + o - 1, n)
|
|
732
850
|
);
|
|
733
851
|
}
|
|
734
852
|
}
|
|
@@ -745,22 +863,22 @@ class ne {
|
|
|
745
863
|
return !1;
|
|
746
864
|
}
|
|
747
865
|
}
|
|
748
|
-
class
|
|
866
|
+
class de {
|
|
749
867
|
constructor(e, t, s) {
|
|
750
868
|
this.header = e, this.body = t, this.footer = s;
|
|
751
869
|
}
|
|
752
870
|
}
|
|
753
|
-
class
|
|
871
|
+
class he extends ne {
|
|
754
872
|
constructor(e, t, s, i) {
|
|
755
|
-
var l,
|
|
873
|
+
var l, n;
|
|
756
874
|
super(e, t, s, i), this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
757
875
|
header: [],
|
|
758
876
|
body: [],
|
|
759
877
|
footer: []
|
|
760
|
-
}, this.tree = !1, this.colAndRowspanModels = new
|
|
761
|
-
(
|
|
878
|
+
}, this.tree = !1, this.colAndRowspanModels = new de(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.editing = !1, this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (l = this.tableOptions) != null && l.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (n = this.tableOptions) != null && n.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), O(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
879
|
+
(r) => {
|
|
762
880
|
var a;
|
|
763
|
-
this.colAndRowspanModels[
|
|
881
|
+
this.colAndRowspanModels[r] = new ae(t, t.getAreaModel(r)), (a = this.colAndRowspanModels[r]) == null || a.init();
|
|
764
882
|
}
|
|
765
883
|
);
|
|
766
884
|
}
|
|
@@ -816,10 +934,12 @@ class de extends re {
|
|
|
816
934
|
var e, t;
|
|
817
935
|
this.storeScrollPosStateService && ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreScrollPosition) && this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
|
|
818
936
|
}
|
|
819
|
-
updateCells(e) {
|
|
937
|
+
updateCells(e, t = !1) {
|
|
820
938
|
e.forEach(
|
|
821
|
-
(
|
|
822
|
-
|
|
939
|
+
(s) => {
|
|
940
|
+
this.tableModel.getAreaModel(s.area).setValue(s.rowIndex, s.columnIndex, s.value), t || this.rerenderCellContent(s);
|
|
941
|
+
}
|
|
942
|
+
), t && this.repaint();
|
|
823
943
|
}
|
|
824
944
|
getAreaAndSideIdentByAttr(e) {
|
|
825
945
|
if (e) {
|
|
@@ -877,87 +997,87 @@ class de extends re {
|
|
|
877
997
|
return "";
|
|
878
998
|
}
|
|
879
999
|
adjustArea(e, t = 0) {
|
|
880
|
-
var
|
|
1000
|
+
var S;
|
|
881
1001
|
const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"), l = i.child.clientHeight;
|
|
882
1002
|
s.child.innerText = "", i.child.innerText = "", o.child.innerText = "";
|
|
883
|
-
const
|
|
1003
|
+
const n = 0, r = this.areaBodyCenterGeo.width, a = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), u = d.getRowCount();
|
|
884
1004
|
for (; this.cleanupFunctions[e].length; ) {
|
|
885
|
-
const
|
|
886
|
-
|
|
1005
|
+
const p = this.cleanupFunctions[e].shift();
|
|
1006
|
+
p && p();
|
|
887
1007
|
}
|
|
888
1008
|
let g = t;
|
|
889
|
-
const m = this.tableModel.getColumnCount(), c = this.tableModel.getFixedRightColumnCount(),
|
|
890
|
-
for (let
|
|
891
|
-
const
|
|
892
|
-
if (
|
|
893
|
-
this.firstVisibleRowIndex =
|
|
894
|
-
let
|
|
895
|
-
const
|
|
1009
|
+
const m = this.tableModel.getColumnCount(), c = this.tableModel.getFixedRightColumnCount(), f = this.tableModel.getFixedLeftColumnCount();
|
|
1010
|
+
for (let p = 0; p < u; p++) {
|
|
1011
|
+
const w = g, C = p === u - 1, x = this.tableModel.getRowHeight(e, p);
|
|
1012
|
+
if (w + x > 0) {
|
|
1013
|
+
this.firstVisibleRowIndex = p;
|
|
1014
|
+
let y = { left: n, width: r, height: x, top: w, index: p }, v = this.dom.addRowDiv(i, y, p, e, "center");
|
|
1015
|
+
const E = f;
|
|
896
1016
|
if (this.adjustColumnsToRowParent({
|
|
897
1017
|
areaIdent: e,
|
|
898
1018
|
sideIdent: "center",
|
|
899
1019
|
areaModel: d,
|
|
900
|
-
geo:
|
|
901
|
-
parent:
|
|
902
|
-
rowIndex:
|
|
903
|
-
columnIndexStart:
|
|
1020
|
+
geo: y,
|
|
1021
|
+
parent: v,
|
|
1022
|
+
rowIndex: p,
|
|
1023
|
+
columnIndexStart: E,
|
|
904
1024
|
columnIndexEnd: m - c - 1,
|
|
905
1025
|
verticalFixed: !1,
|
|
906
1026
|
lastRowOfModel: C
|
|
907
|
-
}), a.left > 0 && (
|
|
1027
|
+
}), a.left > 0 && (y = { left: n, width: this.areaBodyWestGeo.width, height: x, top: w, index: p }, v = this.dom.addRowDiv(s, y, p, e, "west"), this.adjustColumnsToRowParent({
|
|
908
1028
|
areaIdent: e,
|
|
909
1029
|
sideIdent: "west",
|
|
910
1030
|
areaModel: d,
|
|
911
|
-
geo:
|
|
912
|
-
parent:
|
|
913
|
-
rowIndex:
|
|
1031
|
+
geo: y,
|
|
1032
|
+
parent: v,
|
|
1033
|
+
rowIndex: p,
|
|
914
1034
|
columnIndexStart: 0,
|
|
915
|
-
columnIndexEnd:
|
|
1035
|
+
columnIndexEnd: E - 1,
|
|
916
1036
|
verticalFixed: !0,
|
|
917
1037
|
lastRowOfModel: C
|
|
918
|
-
})), a.right > 0 && (
|
|
1038
|
+
})), a.right > 0 && (y = { left: n, width: this.areaBodyEastGeo.width, height: x, top: w, index: p }, v = this.dom.addRowDiv(o, y, p, e, "east"), this.adjustColumnsToRowParent({
|
|
919
1039
|
areaIdent: e,
|
|
920
1040
|
sideIdent: "east",
|
|
921
1041
|
areaModel: d,
|
|
922
|
-
geo:
|
|
923
|
-
parent:
|
|
924
|
-
rowIndex:
|
|
1042
|
+
geo: y,
|
|
1043
|
+
parent: v,
|
|
1044
|
+
rowIndex: p,
|
|
925
1045
|
columnIndexStart: m - c,
|
|
926
1046
|
columnIndexEnd: m - 1,
|
|
927
1047
|
verticalFixed: !0,
|
|
928
1048
|
lastRowOfModel: C
|
|
929
|
-
})), e === "header" && this.tree &&
|
|
930
|
-
const
|
|
1049
|
+
})), e === "header" && this.tree && p === u - 1) {
|
|
1050
|
+
const A = this.dom.applyStyle(
|
|
931
1051
|
this.dom.setAttribute(
|
|
932
|
-
this.dom.addDiv(
|
|
1052
|
+
this.dom.addDiv(v, new T(16, 20, 20, 8)),
|
|
933
1053
|
"data-ge-action",
|
|
934
1054
|
"toggleExpandCollapseAll"
|
|
935
1055
|
),
|
|
936
1056
|
{ cursor: "pointer" }
|
|
937
|
-
),
|
|
938
|
-
if (
|
|
939
|
-
const
|
|
940
|
-
this.dom.domService.appendChild(
|
|
1057
|
+
), R = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1058
|
+
if (R) {
|
|
1059
|
+
const F = this.dom.domService.createText(R.content);
|
|
1060
|
+
this.dom.domService.appendChild(A, F), R.style && this.dom.applyStyleString(A, R.style);
|
|
941
1061
|
}
|
|
942
1062
|
}
|
|
943
1063
|
}
|
|
944
|
-
if (g = g +
|
|
1064
|
+
if (g = g + x, g > l)
|
|
945
1065
|
break;
|
|
946
1066
|
}
|
|
947
1067
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
948
|
-
const
|
|
949
|
-
if (
|
|
950
|
-
for (const
|
|
951
|
-
let C = 0,
|
|
952
|
-
if (
|
|
953
|
-
|
|
954
|
-
else if (c > 0 &&
|
|
955
|
-
|
|
1068
|
+
const p = ((S = this.colAndRowspanModels[e]) == null ? void 0 : S.getRanges()) ?? [];
|
|
1069
|
+
if (p.length)
|
|
1070
|
+
for (const w of p) {
|
|
1071
|
+
let C = 0, x = i.child, y = "center";
|
|
1072
|
+
if (w.c1 < f)
|
|
1073
|
+
x = s.child, y = "west";
|
|
1074
|
+
else if (c > 0 && w.c1 >= m - c)
|
|
1075
|
+
x = o.child, y = "east";
|
|
956
1076
|
else {
|
|
957
|
-
const
|
|
958
|
-
C = this.scrollFactorX *
|
|
1077
|
+
const v = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1078
|
+
C = this.scrollFactorX * v - this.areaBodyWestGeo.width, y = "center";
|
|
959
1079
|
}
|
|
960
|
-
this.drawBigCell(
|
|
1080
|
+
this.drawBigCell(w, C, t, d, x, y);
|
|
961
1081
|
}
|
|
962
1082
|
}
|
|
963
1083
|
}
|
|
@@ -972,20 +1092,20 @@ class de extends re {
|
|
|
972
1092
|
* @protected
|
|
973
1093
|
*/
|
|
974
1094
|
drawBigCell(e, t, s, i, o, l) {
|
|
975
|
-
const
|
|
1095
|
+
const n = s + this.getRowHeights(0, e.r1 - 1, i).reduce((S, p) => S + p, 0), r = this.tableModel.getColumnCount(), a = this.tableModel.getFixedRightColumnCount();
|
|
976
1096
|
let d = 0;
|
|
977
|
-
a > 0 && e.c1 >=
|
|
978
|
-
const
|
|
1097
|
+
a > 0 && e.c1 >= r - a && (d = r - a);
|
|
1098
|
+
const u = t + this.getColumnWidths(d, e.c1 - 1).reduce((S, p) => S + p, 0), g = this.getRowHeights(e.r1, e.r2, i).reduce((S, p) => S + p, 0), m = this.getColumnWidths(e.c1, e.c2).reduce((S, p) => S + p, 0);
|
|
979
1099
|
let c = !1;
|
|
980
|
-
const
|
|
981
|
-
|
|
1100
|
+
const f = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
1101
|
+
f && (c = f.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? (console.info("TODO here", e), this.renderCell({
|
|
982
1102
|
areaModel: i,
|
|
983
1103
|
areaIdent: i.areaIdent,
|
|
984
1104
|
sideIdent: l,
|
|
985
1105
|
rowIndex: e.r1,
|
|
986
1106
|
columnIndex: e.c1,
|
|
987
|
-
left:
|
|
988
|
-
top:
|
|
1107
|
+
left: u,
|
|
1108
|
+
top: n,
|
|
989
1109
|
width: m,
|
|
990
1110
|
height: g,
|
|
991
1111
|
parent: o,
|
|
@@ -998,8 +1118,8 @@ class de extends re {
|
|
|
998
1118
|
sideIdent: l,
|
|
999
1119
|
rowIndex: e.r1,
|
|
1000
1120
|
columnIndex: e.c1,
|
|
1001
|
-
left:
|
|
1002
|
-
top:
|
|
1121
|
+
left: u,
|
|
1122
|
+
top: n,
|
|
1003
1123
|
width: m,
|
|
1004
1124
|
height: g,
|
|
1005
1125
|
parent: o,
|
|
@@ -1009,8 +1129,8 @@ class de extends re {
|
|
|
1009
1129
|
}), i.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1010
1130
|
rowIndex: e.r1,
|
|
1011
1131
|
columnIndex: e.c1,
|
|
1012
|
-
cellLeft:
|
|
1013
|
-
cellTop:
|
|
1132
|
+
cellLeft: u,
|
|
1133
|
+
cellTop: n,
|
|
1014
1134
|
cellWidth: m,
|
|
1015
1135
|
cellHeight: g,
|
|
1016
1136
|
parent: o
|
|
@@ -1034,61 +1154,61 @@ class de extends re {
|
|
|
1034
1154
|
geo: i,
|
|
1035
1155
|
parent: o,
|
|
1036
1156
|
rowIndex: l,
|
|
1037
|
-
columnIndexStart:
|
|
1038
|
-
columnIndexEnd:
|
|
1157
|
+
columnIndexStart: n,
|
|
1158
|
+
columnIndexEnd: r,
|
|
1039
1159
|
verticalFixed: a = !1,
|
|
1040
1160
|
lastRowOfModel: d = !1
|
|
1041
1161
|
}) {
|
|
1042
|
-
var
|
|
1162
|
+
var f;
|
|
1043
1163
|
this.scrollViewportLeft = this.scrollViewport.scrollLeft;
|
|
1044
|
-
let
|
|
1164
|
+
let u = 0;
|
|
1045
1165
|
if (!a) {
|
|
1046
|
-
const
|
|
1047
|
-
|
|
1166
|
+
const S = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1167
|
+
u = this.scrollFactorX * S;
|
|
1048
1168
|
}
|
|
1049
1169
|
const g = 0, m = !!(e === "body" && t);
|
|
1050
|
-
let c =
|
|
1051
|
-
for (let
|
|
1052
|
-
const
|
|
1053
|
-
if (
|
|
1170
|
+
let c = u;
|
|
1171
|
+
for (let S = n; S <= r; S++) {
|
|
1172
|
+
const p = c, w = this.tableModel.getColumnWidth(S);
|
|
1173
|
+
if (w > 0 && p + w > 0) {
|
|
1054
1174
|
let C = i.height;
|
|
1055
|
-
const
|
|
1056
|
-
|
|
1057
|
-
let
|
|
1058
|
-
|
|
1059
|
-
let
|
|
1060
|
-
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (
|
|
1061
|
-
this.renderDragTargetDiv(o,
|
|
1062
|
-
const
|
|
1063
|
-
this.dom.addColumnBorderDivs(this.tableOptions, o,
|
|
1175
|
+
const x = s.getRowspanAt(l, S), y = s.getColspanAt(l, S);
|
|
1176
|
+
x > 1 && (C = this.getRowHeights(l, l + x - 1, s).reduce((A, R) => A + R, 0));
|
|
1177
|
+
let v = w;
|
|
1178
|
+
y > 1 && (v = this.getColumnWidths(S, S + y - 1).reduce((A, R) => A + R, 0));
|
|
1179
|
+
let E = !1;
|
|
1180
|
+
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (f = this.colAndRowspanModels[e]) != null && f.isInRange(l, S) && (E = !0), this.draggingTargetColumnIndex === S && e !== "header") {
|
|
1181
|
+
this.renderDragTargetDiv(o, p, g, v, C);
|
|
1182
|
+
const A = { left: p, top: g, width: v, height: C };
|
|
1183
|
+
this.dom.addColumnBorderDivs(this.tableOptions, o, A, e, t);
|
|
1064
1184
|
} else {
|
|
1065
|
-
const
|
|
1066
|
-
|
|
1185
|
+
const A = this.renderSelectedBackgroundDiv(E, m, t, s, l, S, o, p, g, v, C);
|
|
1186
|
+
E || this.renderCell({
|
|
1067
1187
|
areaModel: s,
|
|
1068
1188
|
areaIdent: e,
|
|
1069
1189
|
sideIdent: t,
|
|
1070
1190
|
rowIndex: l,
|
|
1071
|
-
columnIndex:
|
|
1072
|
-
left:
|
|
1191
|
+
columnIndex: S,
|
|
1192
|
+
left: p,
|
|
1073
1193
|
top: g,
|
|
1074
|
-
width:
|
|
1194
|
+
width: v,
|
|
1075
1195
|
height: C,
|
|
1076
1196
|
parent: o,
|
|
1077
|
-
cellSelected:
|
|
1197
|
+
cellSelected: A,
|
|
1078
1198
|
lastRowOfModel: d,
|
|
1079
1199
|
gammaRange: !0
|
|
1080
1200
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1081
1201
|
rowIndex: l,
|
|
1082
|
-
columnIndex:
|
|
1083
|
-
cellLeft:
|
|
1202
|
+
columnIndex: S,
|
|
1203
|
+
cellLeft: p,
|
|
1084
1204
|
cellTop: g,
|
|
1085
|
-
cellWidth:
|
|
1205
|
+
cellWidth: v,
|
|
1086
1206
|
cellHeight: C,
|
|
1087
1207
|
parent: o
|
|
1088
1208
|
});
|
|
1089
1209
|
}
|
|
1090
1210
|
}
|
|
1091
|
-
if (c = c +
|
|
1211
|
+
if (c = c + w, c > this.areaBodyCenterGeo.width)
|
|
1092
1212
|
break;
|
|
1093
1213
|
}
|
|
1094
1214
|
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(c - 1, 1, i.height, 0), o);
|
|
@@ -1103,53 +1223,78 @@ class de extends re {
|
|
|
1103
1223
|
rowIndex: i,
|
|
1104
1224
|
index: o,
|
|
1105
1225
|
left: l,
|
|
1106
|
-
width:
|
|
1107
|
-
height:
|
|
1226
|
+
width: n,
|
|
1227
|
+
height: r,
|
|
1108
1228
|
top: a,
|
|
1109
1229
|
parent: d,
|
|
1110
|
-
lastRowOfModel:
|
|
1230
|
+
lastRowOfModel: u,
|
|
1231
|
+
gammaRange: g
|
|
1111
1232
|
}) {
|
|
1112
|
-
var
|
|
1113
|
-
const
|
|
1233
|
+
var k;
|
|
1234
|
+
const c = this.editorRenderer && this.editorRendererRow === i && this.editorRendererColumn === o ? this.editorRenderer : e.getCellRenderer(i, o), f = { left: l, width: n, height: r, top: a, index: o }, S = e.getRowByIndex(i);
|
|
1114
1235
|
let p = "none";
|
|
1115
|
-
if (o === this.getTreeArrowColumnIndex() && L(
|
|
1116
|
-
const
|
|
1117
|
-
(
|
|
1236
|
+
if (o === this.getTreeArrowColumnIndex() && L(S)) {
|
|
1237
|
+
const b = S;
|
|
1238
|
+
(k = b.children) != null && k.length ? b.expanded ? p = "expanded" : p = "collapsed" : p = "hidden";
|
|
1118
1239
|
}
|
|
1119
|
-
let
|
|
1240
|
+
let C;
|
|
1120
1241
|
if (t === "header") {
|
|
1121
|
-
const
|
|
1122
|
-
(!(
|
|
1242
|
+
const b = this.tableModel.getColumnDef(o);
|
|
1243
|
+
(!(b != null && b.sortIconVisible) || b != null && b.sortIconVisible()) && (C = b == null ? void 0 : b.sortState);
|
|
1123
1244
|
}
|
|
1124
|
-
const
|
|
1245
|
+
const x = e.getValueAt(i, o), y = c ? "" : `${x}`, v = e.isRowChecked(i), E = this.dom.addColumnDiv(
|
|
1125
1246
|
d,
|
|
1126
|
-
|
|
1247
|
+
f,
|
|
1127
1248
|
i,
|
|
1128
1249
|
o,
|
|
1129
1250
|
t,
|
|
1130
1251
|
s,
|
|
1131
|
-
|
|
1252
|
+
y,
|
|
1132
1253
|
p,
|
|
1133
1254
|
this.tableOptions,
|
|
1134
1255
|
v,
|
|
1135
|
-
|
|
1136
|
-
),
|
|
1137
|
-
|
|
1138
|
-
const
|
|
1139
|
-
|
|
1140
|
-
let
|
|
1141
|
-
|
|
1142
|
-
const
|
|
1143
|
-
if (
|
|
1144
|
-
const
|
|
1145
|
-
|
|
1256
|
+
C
|
|
1257
|
+
), A = e.getTooltipAt(i, o);
|
|
1258
|
+
A && this.dom.setAttribute(E, "title", A);
|
|
1259
|
+
const R = this.tableModel.getColumnDef(o);
|
|
1260
|
+
R && R.classes[t] && this.dom.addClasses(R.classes[t], E);
|
|
1261
|
+
let F;
|
|
1262
|
+
c && (F = c.render(E, i, o, t, e, x, this.dom.domService));
|
|
1263
|
+
const P = e.getCustomClassesAt(i, o);
|
|
1264
|
+
if (P.length && this.dom.addClasses(P, E), this.dom.addColumnBorderDivs(this.tableOptions, d, f, t, s), u && this.dom.addHorizontalBorder({ left: l, width: n, height: r, top: a + r }, d), this.getFocusModel && t === "body") {
|
|
1265
|
+
const b = this.getFocusModel();
|
|
1266
|
+
b != null && b.hasFocus(i, o) && this.dom.addFocusBorderDivs(d, f, {});
|
|
1267
|
+
}
|
|
1268
|
+
t === "header" && this.dom.setAttribute(E, "data-ge-action", "drag-column");
|
|
1269
|
+
const I = e.getCustomStyleAt(i, o);
|
|
1270
|
+
if (I)
|
|
1271
|
+
for (const b in I)
|
|
1272
|
+
this.dom.setStyle(E, b, I[b]);
|
|
1273
|
+
return [E, F];
|
|
1274
|
+
}
|
|
1275
|
+
applyCssClasses(e, t = {}) {
|
|
1276
|
+
e && Object.entries(t).forEach(([s, i]) => {
|
|
1277
|
+
i ? this.dom.addClass(s, e) : this.dom.removeClass(s, e);
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
rerenderCellContent({ area: e, rowIndex: t, columnIndex: s, value: i, cssClasses: o }) {
|
|
1281
|
+
const l = this.tableModel.getAreaModel(e), n = 'div[data-col-index="' + s + '"][data-row-index="' + t + '"][data-area="' + e + '"]', r = document.querySelector(n);
|
|
1282
|
+
if (r) {
|
|
1283
|
+
let a;
|
|
1284
|
+
const u = this.editorRenderer && this.editorRendererRow === t && this.editorRendererColumn === s ? this.editorRenderer : l.getCellRenderer(t, s);
|
|
1285
|
+
if (r.innerText = "", this.applyCssClasses(r, o), u)
|
|
1286
|
+
a = u.render(r, t, s, e, l, i, this.dom.domService), a && this.cleanupFunctions[e].push(a);
|
|
1287
|
+
else {
|
|
1288
|
+
const c = `${i}`;
|
|
1289
|
+
this.dom.addLabelDiv(r, c, !1, t, s, e);
|
|
1290
|
+
}
|
|
1291
|
+
const g = l.getCustomClassesAt(t, s);
|
|
1292
|
+
g.length && this.dom.addClasses(g, r);
|
|
1293
|
+
const m = l.getCustomStyleAt(t, s);
|
|
1294
|
+
if (m)
|
|
1295
|
+
for (const c in m)
|
|
1296
|
+
this.dom.setStyle(r, c, m[c]);
|
|
1146
1297
|
}
|
|
1147
|
-
t === "header" && this.dom.setAttribute(f, "data-ge-action", "drag-column");
|
|
1148
|
-
const F = e.getCustomStyleAt(i, o);
|
|
1149
|
-
if (F)
|
|
1150
|
-
for (const y in F)
|
|
1151
|
-
this.dom.setStyle(f, y, F[y]);
|
|
1152
|
-
return [f, M];
|
|
1153
1298
|
}
|
|
1154
1299
|
getColumnWidths(e, t) {
|
|
1155
1300
|
const s = [];
|
|
@@ -1208,19 +1353,19 @@ class de extends re {
|
|
|
1208
1353
|
);
|
|
1209
1354
|
return this.dom.setStyle(l, "left", `${t}px`), this.dom.setStyle(l, "top", `${s}px`), this.dom.setStyle(l, "width", `${i}px`), this.dom.setStyle(l, "height", `${o}px`), l;
|
|
1210
1355
|
}
|
|
1211
|
-
renderSelectedBackgroundDiv(e, t, s, i, o, l,
|
|
1356
|
+
renderSelectedBackgroundDiv(e, t, s, i, o, l, n, r, a, d, u) {
|
|
1212
1357
|
let g = !1;
|
|
1213
1358
|
if (!e && t && i.isSelectable(o, l) && this.getSelectionModel) {
|
|
1214
1359
|
const m = this.getSelectionModel();
|
|
1215
1360
|
if (m) {
|
|
1216
1361
|
const c = m.getSelectionCount(o, l);
|
|
1217
1362
|
g = c > 0;
|
|
1218
|
-
for (let
|
|
1219
|
-
const
|
|
1363
|
+
for (let f = 0; f < c; f++) {
|
|
1364
|
+
const S = this.dom.applyStylePosistionAbsolute(
|
|
1220
1365
|
// ge-table-body-west-selected-range
|
|
1221
|
-
this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`,
|
|
1366
|
+
this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`, n)
|
|
1222
1367
|
);
|
|
1223
|
-
this.dom.setStyle(
|
|
1368
|
+
this.dom.setStyle(S, "left", `${r}px`), this.dom.setStyle(S, "top", `${a}px`), this.dom.setStyle(S, "width", `${d}px`), this.dom.setStyle(S, "height", `${u}px`);
|
|
1224
1369
|
}
|
|
1225
1370
|
}
|
|
1226
1371
|
}
|
|
@@ -1233,55 +1378,63 @@ class de extends re {
|
|
|
1233
1378
|
rowIndex: i,
|
|
1234
1379
|
columnIndex: o,
|
|
1235
1380
|
left: l,
|
|
1236
|
-
top:
|
|
1237
|
-
width:
|
|
1381
|
+
top: n,
|
|
1382
|
+
width: r,
|
|
1238
1383
|
height: a,
|
|
1239
1384
|
parent: d,
|
|
1240
|
-
cellSelected:
|
|
1385
|
+
cellSelected: u,
|
|
1241
1386
|
lastRowOfModel: g,
|
|
1242
1387
|
gammaRange: m
|
|
1243
1388
|
}) {
|
|
1244
|
-
const [c,
|
|
1389
|
+
const [c, f] = this.addAndRenderCellDiv({
|
|
1245
1390
|
areaModel: e,
|
|
1246
1391
|
areaIdent: t,
|
|
1247
1392
|
sideIdent: s,
|
|
1248
1393
|
rowIndex: i,
|
|
1249
1394
|
index: o,
|
|
1250
1395
|
left: l,
|
|
1251
|
-
width:
|
|
1396
|
+
width: r,
|
|
1252
1397
|
height: a,
|
|
1253
|
-
top:
|
|
1398
|
+
top: n,
|
|
1254
1399
|
parent: d,
|
|
1255
1400
|
lastRowOfModel: g,
|
|
1256
1401
|
gammaRange: m
|
|
1257
1402
|
});
|
|
1258
|
-
|
|
1403
|
+
u && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, c), f && this.cleanupFunctions[t].push(f);
|
|
1259
1404
|
}
|
|
1260
|
-
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight: l, parent:
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1405
|
+
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight: l, parent: n }) {
|
|
1406
|
+
const r = this.dom.domService, a = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = r.createElement("div");
|
|
1407
|
+
r.setAttribute(d, "data-col-index", `${t}`), r.setAttribute(d, "data-row-index", `${e}`), r.setAttribute(d, "data-area", "header"), r.setAttribute(d, "data-ge-action", "resize-column"), r.addClass(d, "ge-table-column-resize-handle"), r.setStyle(d, "display", "clip"), r.setStyle(d, "position", "absolute"), r.setStyle(d, "cursor", "col-resize"), r.setStyle(d, "left", `${s + o - a}px`), r.setStyle(d, "top", `${i}px`), r.setStyle(d, "width", `${a}px`), r.setStyle(d, "height", `${l}px`), r.appendChild(n, d);
|
|
1263
1408
|
}
|
|
1264
1409
|
}
|
|
1265
|
-
class
|
|
1410
|
+
class ce {
|
|
1266
1411
|
constructor(e, t) {
|
|
1267
1412
|
this.columnIndex = e, this.sortState = t;
|
|
1268
1413
|
}
|
|
1269
1414
|
}
|
|
1270
|
-
class
|
|
1415
|
+
class pe {
|
|
1271
1416
|
constructor(e) {
|
|
1272
1417
|
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
1273
1418
|
}
|
|
1419
|
+
/**
|
|
1420
|
+
* Handles the onHostElementChanged event.
|
|
1421
|
+
* In case that the element is an input field, the tableScope.updateModelValueAfterEdit() method is triggered.
|
|
1422
|
+
*
|
|
1423
|
+
* @param {Event} event - The event object.
|
|
1424
|
+
*
|
|
1425
|
+
* @return {void}
|
|
1426
|
+
*/
|
|
1274
1427
|
onHostElementChanged(e) {
|
|
1275
1428
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1276
1429
|
const t = e.target, s = t.getAttribute("data-area"), i = t.getAttribute("data-row-index"), o = t.getAttribute("data-col-index");
|
|
1277
1430
|
if (s && i && o) {
|
|
1278
|
-
const l = B(s),
|
|
1279
|
-
this.tableScope.updateModelValueAfterEdit(l,
|
|
1431
|
+
const l = B(s), n = Number(i), r = Number(o);
|
|
1432
|
+
this.tableScope.updateModelValueAfterEdit(l, n, r, t.value);
|
|
1280
1433
|
}
|
|
1281
1434
|
}
|
|
1282
1435
|
}
|
|
1283
1436
|
}
|
|
1284
|
-
class
|
|
1437
|
+
class ue {
|
|
1285
1438
|
constructor(e = -1, t = -1) {
|
|
1286
1439
|
this.rowIndex = e, this.columnIndex = t;
|
|
1287
1440
|
}
|
|
@@ -1291,20 +1444,20 @@ class H {
|
|
|
1291
1444
|
this.cells = e;
|
|
1292
1445
|
}
|
|
1293
1446
|
static createSingle(e, t) {
|
|
1294
|
-
return new H([new
|
|
1447
|
+
return new H([new ue(e, t)]);
|
|
1295
1448
|
}
|
|
1296
1449
|
}
|
|
1297
|
-
class
|
|
1450
|
+
class Se {
|
|
1298
1451
|
constructor(e) {
|
|
1299
1452
|
var t, s;
|
|
1300
1453
|
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);
|
|
1301
1454
|
}
|
|
1302
1455
|
onMouseClicked(e, t) {
|
|
1303
|
-
var o, l,
|
|
1456
|
+
var o, l, n, r, a, d, u;
|
|
1304
1457
|
let s = !1, i = !1;
|
|
1305
1458
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1306
1459
|
const g = this.getSelectionModel(), m = this.getFocusModel();
|
|
1307
|
-
g && m && (m.hasFocus(e.rowIndex, e.columnIndex) || (m.setFocus(e.rowIndex, e.columnIndex), s = !0), (o = e.originalEvent) != null && o.shiftKey || g.hasSelection() && (g.clear(), s = !0), (l = e.originalEvent) != null && l.shiftKey && this.previousEvt ? (g.addSelection(this.createRangeByEvents(e, this.previousEvt)), i = !0, s = !0) : (
|
|
1460
|
+
g && m && (m.hasFocus(e.rowIndex, e.columnIndex) || (m.setFocus(e.rowIndex, e.columnIndex), s = !0), (o = e.originalEvent) != null && o.shiftKey || g.hasSelection() && (g.clear(), s = !0), (l = e.originalEvent) != null && l.shiftKey && this.previousEvt ? (g.addSelection(this.createRangeByEvents(e, this.previousEvt)), i = !0, s = !0) : (n = e.originalEvent) != null && n.ctrlKey || (r = e.originalEvent) != null && r.metaKey ? (g.addSelection(M.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0) : (a = e.originalEvent) != null && a.altKey && ((d = e.originalEvent) != null && d.ctrlKey || (u = e.originalEvent) != null && u.metaKey) && (g.removeSelection(M.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0));
|
|
1308
1461
|
}
|
|
1309
1462
|
return i ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
1310
1463
|
}
|
|
@@ -1327,7 +1480,7 @@ class ue {
|
|
|
1327
1480
|
createRangeByEvents(e, t) {
|
|
1328
1481
|
t || (t = e);
|
|
1329
1482
|
const s = Math.min(e.rowIndex, t == null ? void 0 : t.rowIndex), i = Math.max(e.rowIndex, t == null ? void 0 : t.rowIndex), o = Math.min(e.columnIndex, t == null ? void 0 : t.columnIndex), l = Math.max(e.columnIndex, t == null ? void 0 : t.columnIndex);
|
|
1330
|
-
return
|
|
1483
|
+
return M.create({
|
|
1331
1484
|
rowIndex1: s,
|
|
1332
1485
|
columnIndex1: o,
|
|
1333
1486
|
rowIndex2: i,
|
|
@@ -1335,7 +1488,7 @@ class ue {
|
|
|
1335
1488
|
});
|
|
1336
1489
|
}
|
|
1337
1490
|
}
|
|
1338
|
-
class
|
|
1491
|
+
class ge {
|
|
1339
1492
|
get() {
|
|
1340
1493
|
return {
|
|
1341
1494
|
f2: "START_EDITING",
|
|
@@ -1353,7 +1506,7 @@ class Se {
|
|
|
1353
1506
|
};
|
|
1354
1507
|
}
|
|
1355
1508
|
}
|
|
1356
|
-
class
|
|
1509
|
+
class me {
|
|
1357
1510
|
get() {
|
|
1358
1511
|
return {
|
|
1359
1512
|
f2: "START_EDITING",
|
|
@@ -1373,7 +1526,7 @@ class ge {
|
|
|
1373
1526
|
};
|
|
1374
1527
|
}
|
|
1375
1528
|
}
|
|
1376
|
-
class
|
|
1529
|
+
class fe {
|
|
1377
1530
|
constructor(e) {
|
|
1378
1531
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
1379
1532
|
}
|
|
@@ -1381,7 +1534,7 @@ class me {
|
|
|
1381
1534
|
this.listener.includes(e) || this.listener.push(e);
|
|
1382
1535
|
}
|
|
1383
1536
|
init() {
|
|
1384
|
-
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new
|
|
1537
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new me().get()) : Object.assign(this.shortcutActionIdMapping, new ge().get()), Object.assign(this.shortcutActionIdMapping, this.tableScope.tableOptions.shortcutActionIdMapping), this.isDebug() && console.debug("ShortcutService", this.shortcutActionIdMapping), this.tableScope.hostElement.addEventListener("keydown", this.onKeyDown.bind(this));
|
|
1385
1538
|
}
|
|
1386
1539
|
isMacintosh() {
|
|
1387
1540
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -1425,7 +1578,7 @@ class me {
|
|
|
1425
1578
|
return e.altKey && t.push("alt"), e.shiftKey && t.push("shift"), e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), e.code && t.push(e.code.toLowerCase().replace(/key/g, "")), t.sort();
|
|
1426
1579
|
}
|
|
1427
1580
|
}
|
|
1428
|
-
class
|
|
1581
|
+
class G {
|
|
1429
1582
|
onCheckboxChanged(e) {
|
|
1430
1583
|
}
|
|
1431
1584
|
onContextmenu(e) {
|
|
@@ -1441,7 +1594,7 @@ class V {
|
|
|
1441
1594
|
onMouseMoved(e) {
|
|
1442
1595
|
}
|
|
1443
1596
|
}
|
|
1444
|
-
class
|
|
1597
|
+
class X {
|
|
1445
1598
|
setStyle(e, t, s) {
|
|
1446
1599
|
return e.style[t] = s, e;
|
|
1447
1600
|
}
|
|
@@ -1452,6 +1605,9 @@ class z {
|
|
|
1452
1605
|
addClass(e, t) {
|
|
1453
1606
|
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.add(s)) : e.classList.add(t), e;
|
|
1454
1607
|
}
|
|
1608
|
+
removeClass(e, t) {
|
|
1609
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.remove(s)) : e.classList.remove(t), e;
|
|
1610
|
+
}
|
|
1455
1611
|
appendChild(e, t) {
|
|
1456
1612
|
e.appendChild(t);
|
|
1457
1613
|
}
|
|
@@ -1465,15 +1621,15 @@ class z {
|
|
|
1465
1621
|
e.setAttribute(t, s);
|
|
1466
1622
|
}
|
|
1467
1623
|
}
|
|
1468
|
-
class
|
|
1469
|
-
render(e, t, s, i, o, l,
|
|
1624
|
+
class be {
|
|
1625
|
+
render(e, t, s, i, o, l, n) {
|
|
1470
1626
|
if (o.isEditable(t, s)) {
|
|
1471
|
-
|
|
1472
|
-
const
|
|
1627
|
+
n.addClass(e, "ge-table-row-input-div");
|
|
1628
|
+
const r = o.getValueAt(t, s);
|
|
1473
1629
|
e.innerHTML = `
|
|
1474
1630
|
<input
|
|
1475
1631
|
type="text"
|
|
1476
|
-
value="${
|
|
1632
|
+
value="${r}"
|
|
1477
1633
|
autofocus
|
|
1478
1634
|
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
1479
1635
|
data-listen="change"
|
|
@@ -1486,7 +1642,7 @@ class fe {
|
|
|
1486
1642
|
}
|
|
1487
1643
|
}
|
|
1488
1644
|
}
|
|
1489
|
-
class
|
|
1645
|
+
class ye {
|
|
1490
1646
|
constructor(e = "none", t = "single") {
|
|
1491
1647
|
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1492
1648
|
}
|
|
@@ -1521,16 +1677,16 @@ class be {
|
|
|
1521
1677
|
if (this.selectionType === "none")
|
|
1522
1678
|
return;
|
|
1523
1679
|
let t = e;
|
|
1524
|
-
this.selectionType === "row" ? t =
|
|
1680
|
+
this.selectionType === "row" ? t = M.singleRow(e.r1) : this.selectionType === "column" && (t = M.singleColumn(e.c1)), this.negativeRanges.push(t);
|
|
1525
1681
|
}
|
|
1526
1682
|
togglePoint(e, t) {
|
|
1527
|
-
this.getSelectionCount(e, t) > 0 ? this.removeSelection(
|
|
1683
|
+
this.getSelectionCount(e, t) > 0 ? this.removeSelection(M.singleCell(e, t)) : this.addSelection(M.singleCell(e, t));
|
|
1528
1684
|
}
|
|
1529
1685
|
addRange(e) {
|
|
1530
1686
|
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));
|
|
1531
1687
|
}
|
|
1532
1688
|
}
|
|
1533
|
-
class
|
|
1689
|
+
class ve {
|
|
1534
1690
|
constructor(e = "none") {
|
|
1535
1691
|
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
|
|
1536
1692
|
}
|
|
@@ -1553,32 +1709,43 @@ class ye {
|
|
|
1553
1709
|
return [this.rowIndex, this.columnIndex];
|
|
1554
1710
|
}
|
|
1555
1711
|
}
|
|
1556
|
-
const
|
|
1557
|
-
class
|
|
1712
|
+
const Ce = new ye(), xe = new ve("cell");
|
|
1713
|
+
class z {
|
|
1558
1714
|
constructor() {
|
|
1559
1715
|
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 = {
|
|
1560
1716
|
header: 34,
|
|
1561
1717
|
body: 34,
|
|
1562
1718
|
footer: 34
|
|
1563
|
-
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new
|
|
1719
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new N(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new j(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new be(), this.getSelectionModel = () => Ce, this.getFocusModel = () => xe;
|
|
1564
1720
|
}
|
|
1565
1721
|
}
|
|
1566
|
-
class
|
|
1722
|
+
class _ extends he {
|
|
1567
1723
|
constructor(e, t, s, i, o) {
|
|
1568
1724
|
var l;
|
|
1569
1725
|
if (super(
|
|
1570
1726
|
e,
|
|
1571
1727
|
t,
|
|
1572
|
-
new
|
|
1728
|
+
new Z(s),
|
|
1573
1729
|
i
|
|
1574
|
-
), this.eventListener = o, this.selectionService = new
|
|
1575
|
-
const
|
|
1576
|
-
|
|
1730
|
+
), this.eventListener = o, this.selectionService = new Se(this), this.api = new se(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new G()), (l = this.tableOptions) != null && l.autoRestoreOptions) {
|
|
1731
|
+
const n = this.tableOptions.autoRestoreOptions, r = n.getStorageKeyFn;
|
|
1732
|
+
r && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new ie(r)), n.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new le(r)), n.autoRestoreSortingState && (this.storeSortingService = new re(r)));
|
|
1577
1733
|
}
|
|
1578
|
-
this.mouseHandler = new
|
|
1734
|
+
this.mouseHandler = new te(this), this.inputHandler = new pe(this), this.shortcutService = new fe(this), this.shortcutService.addListener(this.selectionService);
|
|
1579
1735
|
}
|
|
1580
|
-
|
|
1581
|
-
|
|
1736
|
+
/**
|
|
1737
|
+
* Creates a TableScope instance.
|
|
1738
|
+
*
|
|
1739
|
+
* @param {HTMLDivElement} hostElement - The HTML div element that will contain the table.
|
|
1740
|
+
* @param {TableModelIf} tableModel - The table model object.
|
|
1741
|
+
* @param {TableOptionsIf} [tableOptions=new TableOptions()] - The optional table options object.
|
|
1742
|
+
* @param {EventListenerIf} [eventListener=new EventAdapter()] - The optional event listener object.
|
|
1743
|
+
* @param {DomServiceIf} [domService=new SimpleDomService()] - The optional DOM service object.
|
|
1744
|
+
*
|
|
1745
|
+
* @return {TableScope} - The newly created TableScope instance.
|
|
1746
|
+
*/
|
|
1747
|
+
static create(e, t, s = new z(), i = new G(), o = new X()) {
|
|
1748
|
+
return new _(
|
|
1582
1749
|
e,
|
|
1583
1750
|
t,
|
|
1584
1751
|
o,
|
|
@@ -1602,16 +1769,32 @@ class P extends de {
|
|
|
1602
1769
|
updateModelValueAfterEdit(e, t, s, i) {
|
|
1603
1770
|
e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, i) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(H.createSingle(t, s)), this.hostElement.focus());
|
|
1604
1771
|
}
|
|
1772
|
+
/**
|
|
1773
|
+
* Retrieves the TableApi object.
|
|
1774
|
+
*
|
|
1775
|
+
* @return {TableApi} The TableApi object.
|
|
1776
|
+
*/
|
|
1605
1777
|
getApi() {
|
|
1606
1778
|
return this.api;
|
|
1607
1779
|
}
|
|
1608
|
-
|
|
1609
|
-
* Called by the table component
|
|
1780
|
+
/**
|
|
1781
|
+
* Initializes the table. Called by the table component.
|
|
1782
|
+
*
|
|
1783
|
+
* @function firstInit
|
|
1784
|
+
* @memberof TableScope
|
|
1785
|
+
*
|
|
1786
|
+
* @returns {TableScope} This instance of the table scope.
|
|
1610
1787
|
*/
|
|
1611
1788
|
firstInit() {
|
|
1612
1789
|
var e;
|
|
1613
1790
|
return this.tableModel.init(), (e = this.tableOptions) != null && e.externalFilterFunction && this.externalFilterChanged(!1), this.autoRestoreCollapsedExpandedState(), this.autoRestoreSortingState(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.autoRestoreScrollPosition(), this;
|
|
1614
1791
|
}
|
|
1792
|
+
/**
|
|
1793
|
+
* Creates a GeMouseEvent object based on a MouseEvent.
|
|
1794
|
+
*
|
|
1795
|
+
* @param {MouseEvent} mouseEvent - The MouseEvent object to create the GeMouseEvent from.
|
|
1796
|
+
* @return {GeMouseEvent} - The created GeMouseEvent object.
|
|
1797
|
+
*/
|
|
1615
1798
|
createGeMouseEvent(e) {
|
|
1616
1799
|
const t = new $();
|
|
1617
1800
|
if (t.originalEvent = e, e) {
|
|
@@ -1627,33 +1810,86 @@ class P extends de {
|
|
|
1627
1810
|
}
|
|
1628
1811
|
return t;
|
|
1629
1812
|
}
|
|
1813
|
+
/**
|
|
1814
|
+
* Handles the mouse down event.
|
|
1815
|
+
*
|
|
1816
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event object.
|
|
1817
|
+
* @return {void}
|
|
1818
|
+
*/
|
|
1630
1819
|
onMouseDown(e) {
|
|
1631
1820
|
e.columnIndex > -1 && e.action && ["resize-column", "drag-column"].includes(e.action) && (this.mouseStartWidth = this.tableModel.getColumnWidth(e.columnIndex), this.mouseStartAction = e.action, this.mouseStartColumnIndex = e.columnIndex, this.mouseStartAction === "drag-column" && (this.dragFrom = this.mouseStartColumnIndex));
|
|
1632
1821
|
}
|
|
1822
|
+
/**
|
|
1823
|
+
* Handles mouse dragging on the frame.
|
|
1824
|
+
*
|
|
1825
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event object.
|
|
1826
|
+
*/
|
|
1633
1827
|
mouseDraggingOnFrame(e) {
|
|
1634
1828
|
this.eventListener.onMouseDragging(e), this.mouseEvent = e, this.mouseStartColumnIndex > -1 && this.mouseStartAction === "resize-column" && this.tableOptions.columnsResizable ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && e.columnIndex > -1 && this.tableOptions.columnsDraggable && (this.draggingTargetColumnIndex = e.columnIndex, this.dragTo = this.draggingTargetColumnIndex, this.dragFrom > -1 && this.dragTo > -1 && this.dragFrom !== this.dragTo && (this.tableModel.changeColumnOrder(this.dragFrom, this.dragTo), this.dragFrom = this.dragTo, this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows()), this.repaint());
|
|
1635
1829
|
}
|
|
1830
|
+
/**
|
|
1831
|
+
* Handles the end of mouse dragging event on a frame.
|
|
1832
|
+
*
|
|
1833
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event object.
|
|
1834
|
+
*
|
|
1835
|
+
* @returns {void}
|
|
1836
|
+
*/
|
|
1636
1837
|
mouseDraggingEndOnFrame(e) {
|
|
1637
1838
|
this.eventListener.onMouseDraggingEnd(e), this.draggingTargetColumnIndex = -1, this.mouseStartAction === "resize-column" ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && this.repaint(), this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.mouseStartAction = "";
|
|
1638
1839
|
}
|
|
1840
|
+
/**
|
|
1841
|
+
* Handles the mouse move event.
|
|
1842
|
+
*
|
|
1843
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event object.
|
|
1844
|
+
* @return {void}
|
|
1845
|
+
*/
|
|
1639
1846
|
mouseMove(e) {
|
|
1640
1847
|
this.eventListener.onMouseMoved(e), this.adjustHoverRows(e), this.adjustHoverColumns(e);
|
|
1641
1848
|
}
|
|
1849
|
+
/**
|
|
1850
|
+
* Triggers the context menu event based on the mouse move event.
|
|
1851
|
+
*
|
|
1852
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event object.
|
|
1853
|
+
* @return {void}
|
|
1854
|
+
*/
|
|
1642
1855
|
contextmenu(e) {
|
|
1643
1856
|
this.eventListener.onContextmenu(e);
|
|
1644
1857
|
}
|
|
1858
|
+
/**
|
|
1859
|
+
* Toggles the expand or collapse state of all items in the body area model.
|
|
1860
|
+
*
|
|
1861
|
+
* @param {boolean} [expand=true] - Whether to expand or collapse all items. Default is true.
|
|
1862
|
+
*
|
|
1863
|
+
* @return {void}
|
|
1864
|
+
*/
|
|
1645
1865
|
toggleExpandCollapseAll(e = !0) {
|
|
1646
1866
|
var s;
|
|
1647
1867
|
const t = this.tableModel.getBodyModel();
|
|
1648
1868
|
O(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
1649
1869
|
}
|
|
1870
|
+
/**
|
|
1871
|
+
* Toggles the checkbox state of a specific row in a table.
|
|
1872
|
+
*
|
|
1873
|
+
* @param {number} rowIdx - The index of the row to toggle the checkbox state.
|
|
1874
|
+
* @param {number} _colIdx - The index of the column. This parameter is unused.
|
|
1875
|
+
* @param {AreaIdent} areaIdent - The identifier of the table area.
|
|
1876
|
+
*
|
|
1877
|
+
* @return {void} - This method does not return anything.
|
|
1878
|
+
*/
|
|
1650
1879
|
toggleRowCheckbox(e, t, s) {
|
|
1651
|
-
var
|
|
1880
|
+
var r;
|
|
1652
1881
|
const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e), l = o === void 0 || o === "semi" || o === "none";
|
|
1653
1882
|
i.setRowChecked(e, l), this.repaint();
|
|
1654
|
-
const
|
|
1655
|
-
this.eventListener.onCheckboxChanged(
|
|
1883
|
+
const n = (r = i.rowSelectionModel) == null ? void 0 : r.getCheckedRows();
|
|
1884
|
+
this.eventListener.onCheckboxChanged(n || []);
|
|
1656
1885
|
}
|
|
1886
|
+
/**
|
|
1887
|
+
* Handle mouse click events.
|
|
1888
|
+
*
|
|
1889
|
+
* @param {GeMouseEvent} evt - The mouse click event.
|
|
1890
|
+
* @param {GeMouseEvent | undefined} previousEvt - The previous mouse click event, if any.
|
|
1891
|
+
* @returns {void}
|
|
1892
|
+
*/
|
|
1657
1893
|
onMouseClicked(e, t) {
|
|
1658
1894
|
let s = this.selectionService.onMouseClicked(e, t);
|
|
1659
1895
|
if (!s && this.getFocusModel) {
|
|
@@ -1662,19 +1898,41 @@ class P extends de {
|
|
|
1662
1898
|
}
|
|
1663
1899
|
this.eventListener.onMouseClicked(e), s && this.debounce(this.repaint.bind(this), 10);
|
|
1664
1900
|
}
|
|
1901
|
+
/**
|
|
1902
|
+
* Updates the table (repaint) when an external filter is changed.
|
|
1903
|
+
*
|
|
1904
|
+
* @param {boolean} clearSelection - Indicates whether to clear the selection model or not. Default value is true.
|
|
1905
|
+
* @return {void}
|
|
1906
|
+
*/
|
|
1665
1907
|
externalFilterChanged(e = !0) {
|
|
1666
1908
|
const t = this.tableOptions.externalFilterFunction;
|
|
1667
1909
|
t && (e && this.clearSelectionModel(), this.tableModel.externalFilterChanged(t), this.scrollViewport.scrollTo(0, 0), this.tableModel.recalcHeightAndPadding(), this.resetSizeOfWrapperDiv(), this.repaint());
|
|
1668
1910
|
}
|
|
1911
|
+
/**
|
|
1912
|
+
* Handle the double click event on the table header.
|
|
1913
|
+
*
|
|
1914
|
+
* @param {MouseEvent} event - The mouse event that triggered the double click.
|
|
1915
|
+
* @param {number} _rowIdx - The row index of the header.
|
|
1916
|
+
* @param {number} colIdx - The column index of the header.
|
|
1917
|
+
*
|
|
1918
|
+
* @return {void}
|
|
1919
|
+
*/
|
|
1669
1920
|
onHeaderDblClicked(e, t, s) {
|
|
1670
1921
|
var o, l;
|
|
1671
1922
|
const i = this.tableModel.getColumnDef(s);
|
|
1672
1923
|
if (i != null && i.sortable && i.sortable()) {
|
|
1673
1924
|
e.preventDefault(), e.stopPropagation();
|
|
1674
|
-
const
|
|
1925
|
+
const n = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, r = i.sortState ?? "", a = n[(n.indexOf(r) + 1) % n.length], d = new ce(s, a);
|
|
1675
1926
|
this.tableModel.doSort([d]) && ((o = this.tableModel.getColumnDefs()) == null || o.forEach((g) => g.sortState = ""), i.sortState = a), this.repaint(), (l = this.storeSortingService) == null || l.setSortItems([d]);
|
|
1676
1927
|
}
|
|
1677
1928
|
}
|
|
1929
|
+
/**
|
|
1930
|
+
* Changes the focus cell using the specified deltas.
|
|
1931
|
+
*
|
|
1932
|
+
* @param {number} dx - The delta for the column index.
|
|
1933
|
+
* @param {number} dy - The delta for the row index.
|
|
1934
|
+
* @return {boolean} - True if the focus cell was changed, false otherwise.
|
|
1935
|
+
*/
|
|
1678
1936
|
changeFocusCell(e, t) {
|
|
1679
1937
|
if (!this.isEditing() && this.getFocusModel) {
|
|
1680
1938
|
const s = this.getFocusModel();
|
|
@@ -1685,9 +1943,19 @@ class P extends de {
|
|
|
1685
1943
|
}
|
|
1686
1944
|
return !1;
|
|
1687
1945
|
}
|
|
1946
|
+
/**
|
|
1947
|
+
* Resizes the column based on the mouse event.
|
|
1948
|
+
*
|
|
1949
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event that triggered the resize.
|
|
1950
|
+
*/
|
|
1688
1951
|
resizeColumn(e) {
|
|
1689
1952
|
this.tableModel.setColumnWidth(this.mouseStartColumnIndex, this.mouseStartWidth + e.draggingX), this.tableModel.recalcPadding(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows();
|
|
1690
1953
|
}
|
|
1954
|
+
/**
|
|
1955
|
+
* Clears the selection model, if available.
|
|
1956
|
+
*
|
|
1957
|
+
* @return {void}
|
|
1958
|
+
*/
|
|
1691
1959
|
clearSelectionModel() {
|
|
1692
1960
|
var e;
|
|
1693
1961
|
this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
|
|
@@ -1696,6 +1964,14 @@ class P extends de {
|
|
|
1696
1964
|
var s;
|
|
1697
1965
|
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);
|
|
1698
1966
|
}
|
|
1967
|
+
/**
|
|
1968
|
+
* Restores the scroll position of the table if auto restore options are enabled.
|
|
1969
|
+
*
|
|
1970
|
+
* @private
|
|
1971
|
+
* @memberof ClassName
|
|
1972
|
+
*
|
|
1973
|
+
* @returns {void}
|
|
1974
|
+
*/
|
|
1699
1975
|
autoRestoreScrollPosition() {
|
|
1700
1976
|
var e;
|
|
1701
1977
|
if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
|
|
@@ -1703,6 +1979,20 @@ class P extends de {
|
|
|
1703
1979
|
s && this.scrollViewport.scrollTo(...s);
|
|
1704
1980
|
}
|
|
1705
1981
|
}
|
|
1982
|
+
/**
|
|
1983
|
+
* Automatically restores the sorting state of the table.
|
|
1984
|
+
*
|
|
1985
|
+
* @private
|
|
1986
|
+
* @function autoRestoreSortingState
|
|
1987
|
+
* @memberof ClassName
|
|
1988
|
+
*
|
|
1989
|
+
* @description
|
|
1990
|
+
* This method checks if the autoRestoreSortingState option is enabled in the tableOptions.
|
|
1991
|
+
* If enabled, it uses the storeSortingService to retrieve the sort items array.
|
|
1992
|
+
* If there are sort items present, it applies them to the table's body model using the doSort method.
|
|
1993
|
+
*
|
|
1994
|
+
* @returns {void}
|
|
1995
|
+
*/
|
|
1706
1996
|
autoRestoreSortingState() {
|
|
1707
1997
|
var e, t;
|
|
1708
1998
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
|
|
@@ -1710,6 +2000,12 @@ class P extends de {
|
|
|
1710
2000
|
s != null && s.length && this.tableModel.getBodyModel().doSort(s);
|
|
1711
2001
|
}
|
|
1712
2002
|
}
|
|
2003
|
+
/**
|
|
2004
|
+
* Restores the collapsed/expanded state of the rows in the table based on the autoRestoreOptions
|
|
2005
|
+
* specified in the tableOptions. This method is private and should not be called directly.
|
|
2006
|
+
*
|
|
2007
|
+
* @private
|
|
2008
|
+
*/
|
|
1713
2009
|
autoRestoreCollapsedExpandedState() {
|
|
1714
2010
|
var e, t;
|
|
1715
2011
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
|
|
@@ -1717,8 +2013,8 @@ class P extends de {
|
|
|
1717
2013
|
if (s.autoRestoreCollapsedExpandedState && i) {
|
|
1718
2014
|
const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), l = this.tableModel.getAreaModel("body");
|
|
1719
2015
|
if (O(l)) {
|
|
1720
|
-
const
|
|
1721
|
-
for (let a = 0; a <
|
|
2016
|
+
const n = l, r = l.getRowCount();
|
|
2017
|
+
for (let a = 0; a < r; a++) {
|
|
1722
2018
|
const d = l.getRowByIndex(a);
|
|
1723
2019
|
if (d)
|
|
1724
2020
|
if (o.allExpanded)
|
|
@@ -1726,17 +2022,17 @@ class P extends de {
|
|
|
1726
2022
|
else if (o.allCollapsed)
|
|
1727
2023
|
d.expanded = !1;
|
|
1728
2024
|
else {
|
|
1729
|
-
const
|
|
1730
|
-
o.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(
|
|
2025
|
+
const u = i(d.data);
|
|
2026
|
+
o.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(u) : o.mode === "collapsed" && (d.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(u));
|
|
1731
2027
|
}
|
|
1732
2028
|
}
|
|
1733
|
-
|
|
2029
|
+
n.recalcVisibleTreeRows();
|
|
1734
2030
|
}
|
|
1735
2031
|
}
|
|
1736
2032
|
}
|
|
1737
2033
|
}
|
|
1738
2034
|
}
|
|
1739
|
-
const
|
|
2035
|
+
const we = K({
|
|
1740
2036
|
inheritAttrs: !1,
|
|
1741
2037
|
props: {
|
|
1742
2038
|
tableModel: {
|
|
@@ -1744,7 +2040,7 @@ const Ce = X({
|
|
|
1744
2040
|
},
|
|
1745
2041
|
tableOptions: {
|
|
1746
2042
|
required: !1,
|
|
1747
|
-
default: new
|
|
2043
|
+
default: new z()
|
|
1748
2044
|
},
|
|
1749
2045
|
debounceMouseClickDelay: {
|
|
1750
2046
|
required: !1,
|
|
@@ -1762,64 +2058,64 @@ const Ce = X({
|
|
|
1762
2058
|
"mouseMoved"
|
|
1763
2059
|
],
|
|
1764
2060
|
setup(h, { emit: e }) {
|
|
1765
|
-
const t =
|
|
2061
|
+
const t = Y(null), s = (i) => {
|
|
1766
2062
|
const o = {
|
|
1767
|
-
onCheckboxChanged: (
|
|
1768
|
-
e("checkboxChanged",
|
|
2063
|
+
onCheckboxChanged: (n) => {
|
|
2064
|
+
e("checkboxChanged", n);
|
|
1769
2065
|
},
|
|
1770
|
-
onContextmenu: (
|
|
1771
|
-
e("contextmenu",
|
|
2066
|
+
onContextmenu: (n) => {
|
|
2067
|
+
e("contextmenu", n);
|
|
1772
2068
|
},
|
|
1773
|
-
onModelChanged: (
|
|
1774
|
-
e("modelChanged",
|
|
2069
|
+
onModelChanged: (n) => {
|
|
2070
|
+
e("modelChanged", n);
|
|
1775
2071
|
},
|
|
1776
|
-
onMouseClicked: (
|
|
1777
|
-
e("mouseClicked",
|
|
2072
|
+
onMouseClicked: (n) => {
|
|
2073
|
+
e("mouseClicked", n);
|
|
1778
2074
|
},
|
|
1779
|
-
onMouseDragging: (
|
|
1780
|
-
e("mouseDragging",
|
|
2075
|
+
onMouseDragging: (n) => {
|
|
2076
|
+
e("mouseDragging", n);
|
|
1781
2077
|
},
|
|
1782
|
-
onMouseDraggingEnd: (
|
|
1783
|
-
e("mouseDraggingEnd",
|
|
2078
|
+
onMouseDraggingEnd: (n) => {
|
|
2079
|
+
e("mouseDraggingEnd", n);
|
|
1784
2080
|
},
|
|
1785
|
-
onMouseMoved: (
|
|
1786
|
-
e("mouseMoved",
|
|
2081
|
+
onMouseMoved: (n) => {
|
|
2082
|
+
e("mouseMoved", n);
|
|
1787
2083
|
}
|
|
1788
|
-
}, l = new
|
|
2084
|
+
}, l = new _(
|
|
1789
2085
|
i,
|
|
1790
2086
|
h.tableModel,
|
|
1791
|
-
new
|
|
2087
|
+
new X(),
|
|
1792
2088
|
h.tableOptions,
|
|
1793
2089
|
o
|
|
1794
2090
|
);
|
|
1795
2091
|
l.firstInit(), e("tableReady", l.getApi());
|
|
1796
2092
|
};
|
|
1797
|
-
return
|
|
2093
|
+
return q(() => {
|
|
1798
2094
|
t.value && s(t.value);
|
|
1799
2095
|
}), {
|
|
1800
2096
|
root: t
|
|
1801
2097
|
};
|
|
1802
2098
|
}
|
|
1803
2099
|
});
|
|
1804
|
-
const
|
|
2100
|
+
const Ee = (h, e) => {
|
|
1805
2101
|
const t = h.__vccOpts || h;
|
|
1806
2102
|
for (const [s, i] of e)
|
|
1807
2103
|
t[s] = i;
|
|
1808
2104
|
return t;
|
|
1809
|
-
},
|
|
2105
|
+
}, Ae = {
|
|
1810
2106
|
ref: "root",
|
|
1811
2107
|
class: "container-div",
|
|
1812
2108
|
style: { width: "100%", height: "100%", "background-color": "transparent", padding: "0", margin: "0" }
|
|
1813
2109
|
};
|
|
1814
|
-
function
|
|
1815
|
-
return
|
|
2110
|
+
function Me(h, e, t, s, i, o) {
|
|
2111
|
+
return U(), J("div", Ae, null, 512);
|
|
1816
2112
|
}
|
|
1817
|
-
const
|
|
1818
|
-
class
|
|
2113
|
+
const Re = /* @__PURE__ */ Ee(we, [["render", Me]]);
|
|
2114
|
+
class De {
|
|
1819
2115
|
constructor(e, t) {
|
|
1820
2116
|
this.component = e, this.appContext = t;
|
|
1821
2117
|
}
|
|
1822
|
-
render(e, t, s, i, o, l,
|
|
2118
|
+
render(e, t, s, i, o, l, n) {
|
|
1823
2119
|
return this.mount(
|
|
1824
2120
|
this.component,
|
|
1825
2121
|
{
|
|
@@ -1835,19 +2131,19 @@ class Te {
|
|
|
1835
2131
|
);
|
|
1836
2132
|
}
|
|
1837
2133
|
mount(e, t, s, i) {
|
|
1838
|
-
let o =
|
|
1839
|
-
return o.appContext = s,
|
|
1840
|
-
i &&
|
|
2134
|
+
let o = Q(e, t);
|
|
2135
|
+
return o.appContext = s, V(o, i), () => {
|
|
2136
|
+
i && V(null, i);
|
|
1841
2137
|
};
|
|
1842
2138
|
}
|
|
1843
2139
|
}
|
|
1844
|
-
const
|
|
2140
|
+
const Fe = {
|
|
1845
2141
|
install: (h, e = { img: "" }) => {
|
|
1846
|
-
h.component("GuiexpertTable",
|
|
2142
|
+
h.component("GuiexpertTable", Re);
|
|
1847
2143
|
}
|
|
1848
2144
|
};
|
|
1849
2145
|
export {
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
2146
|
+
De as ComponentRendererWrapper,
|
|
2147
|
+
Re as GuiexpertTable,
|
|
2148
|
+
Fe as default
|
|
1853
2149
|
};
|