e-virt-table 1.2.22 → 1.2.23
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/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +855 -802
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Cell.d.ts +1 -0
- package/dist/lib/Cell.js +83 -5
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/Config.d.ts +7 -0
- package/dist/lib/Config.js +20 -1
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Database.js +3 -0
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/Paint.d.ts +1 -0
- package/dist/lib/Paint.js +1 -1
- package/dist/lib/Paint.js.map +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--evt-header-font: 12px normal Arial;--evt-body-font: 12px normal Arial;--evt-color-white: #fff;--evt-color-black: #000000;--evt-color-primary: rgb(82, 146, 247);--evt-text-color-primary: #333;--evt-text-color-regular: #666;--evt-text-color-secondary: #999;--evt-box-shadow: 0 2px 12px 0 #0000001a;--evt-editor-bg-color: #fff;--evt-editor-text-color: #333;--evt-border-color: #e1e6eb;--evt-stripe-color: #fafafa;--evt-placeholder-color: #cdd0dc;--evt-header-bg-color: #f8faff;--evt-body-bg-color: #fff;--evt-header-text-color: #1d2129;--evt-body-text-color: #4e5969;--evt-footer-text-color: #4e5969;--evt-loading-icon-color: #4e5969;--evt-expand-icon-color: #4e5969;--evt-shrink-icon-color: #4e5969;--evt-error-tip-icon-color: red;--evt-cell-hover-icon-bg-color: #fff;--evt-cell-hover-icon-border-color: #dde0ea;--evt-scroller-color: #dee0e3;--evt-scroller-track-color: #fff;--evt-scroller-focus-color: #bbbec4;--evt-select-border-color: var(--evt-color-primary);--evt-select-area-color: rgba(82, 146, 247, .1);--evt-select-row-col-bg-color: transparent;--evt-autofill-point-border-color: #fff;--evt-edit-bg-color: #fcf6ed;--evt-checkbox-color: var(--evt-color-primary);--evt-readonly-color: #fff;--evt-readonly-text-color: var(--evt-body-text-color);--evt-error-tip-color: #ed3f14;--evt-footer-bg-color: #fafafa;--evt-highlight-hover-row-color: rgba(186, 203, 231, .1);--evt-highlight-selected-row-color: rgba(82, 146, 247, .1);--evt-tooltip-bg-color: #303133;--evt-tooltip-text-color: #fff;--evt-resize-row-line-color: #e1e6eb;--evt-resize-column-line-color: #e1e6eb;--evt-tree-line-color: #e1e6eb}.dark{--evt-border-color: #363637;--evt-header-bg-color: #141414;--evt-body-bg-color: #141414;--evt-header-text-color: #a3a6ad;--evt-scroller-color: #414243;--evt-scroller-track-color: #141414;--evt-scroller-focus-color: #a3a6ad;--evt-edit-bg-color: #141414;--evt-readonly-text-color: #cfd3dc;--evt-footer-bg-color: #262727;--evt-autofill-point-border-color: #fff;--evt-editor-bg-color: #434343;--evt-editor-text-color: #cfd3dc}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;box-sizing:border-box;z-index:10;border-radius:8px;border:1px solid var(--evt-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;border:none;outline:none;z-index:10}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;height:auto;line-height:0;z-index:100;overflow:hidden;background-color:var(--evt-editor-bg-color);border:2px solid var(--evt-color-primary);box-sizing:border-box;box-shadow:var(--evt-box-shadow);display:flex;align-items:center}.e-virt-table-overlayer{position:absolute;left:0;top:0;overflow:hidden;z-index:100;pointer-events:none}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;outline:none;font-weight:400;padding:8px;font-size:12px;color:inherit;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;line-height:1.5;margin:0;border:none;vertical-align:middle;background:var(--evt-editor-bg-color);color:var(--evt-editor-text-color);overflow-y:auto;resize:none}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--evt-text-color-regular);background-color:var(--evt-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--evt-box-shadow);width:fit-content;padding:6px 0;z-index:9999;left:-99999px;top:-99999px}.e-virt-table-context-menu-item{cursor:pointer;padding:8px 24px;color:var(--evt-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--evt-color-primary);background-color:#f5f7fa}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
2
|
var ee = Object.defineProperty;
|
|
3
3
|
var ie = (c, t, e) => t in c ? ee(c, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[t] = e;
|
|
4
4
|
var n = (c, t, e) => ie(c, typeof t != "symbol" ? t + "" : t, e);
|
|
@@ -8,53 +8,53 @@ class se {
|
|
|
8
8
|
this.rules = t;
|
|
9
9
|
}
|
|
10
10
|
validate(t) {
|
|
11
|
-
const e = [], { column: i, row: s, key: o, rowKey: r, colIndex:
|
|
11
|
+
const e = [], { column: i, row: s, key: o, rowKey: r, colIndex: a, rowIndex: l, value: h, field: d, fieldValue: f } = t;
|
|
12
12
|
Array.isArray(this.rules) || (this.rules = [this.rules]);
|
|
13
|
-
for (const
|
|
14
|
-
if (
|
|
15
|
-
const
|
|
13
|
+
for (const u of this.rules) {
|
|
14
|
+
if (u.validator) {
|
|
15
|
+
const x = {
|
|
16
16
|
field: d,
|
|
17
17
|
fieldValue: f,
|
|
18
18
|
value: h,
|
|
19
19
|
column: i,
|
|
20
|
-
colIndex:
|
|
21
|
-
rowIndex:
|
|
20
|
+
colIndex: a,
|
|
21
|
+
rowIndex: l,
|
|
22
22
|
row: s,
|
|
23
23
|
key: o,
|
|
24
24
|
rowKey: r,
|
|
25
|
-
...
|
|
25
|
+
...u
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
u.validator(x, h, (w) => {
|
|
28
28
|
w && e.push({
|
|
29
|
-
...
|
|
29
|
+
...x,
|
|
30
30
|
message: w
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
if (!
|
|
34
|
+
if (!u.required && (h == null || h === ""))
|
|
35
35
|
return e;
|
|
36
|
-
|
|
36
|
+
u.pattern && !u.pattern.test(h) && e.push({
|
|
37
37
|
value: h,
|
|
38
38
|
column: i,
|
|
39
39
|
row: s,
|
|
40
40
|
key: o,
|
|
41
41
|
rowKey: r,
|
|
42
|
-
colIndex:
|
|
43
|
-
rowIndex:
|
|
42
|
+
colIndex: a,
|
|
43
|
+
rowIndex: l,
|
|
44
44
|
field: d,
|
|
45
45
|
fieldValue: f,
|
|
46
|
-
message:
|
|
47
|
-
}),
|
|
46
|
+
message: u.message || `${o} is pattern validation error`
|
|
47
|
+
}), u.required && (h == null || h === "") && e.push({
|
|
48
48
|
value: h,
|
|
49
49
|
column: i,
|
|
50
50
|
row: s,
|
|
51
51
|
key: o,
|
|
52
52
|
rowKey: r,
|
|
53
|
-
colIndex:
|
|
54
|
-
rowIndex:
|
|
53
|
+
colIndex: a,
|
|
54
|
+
rowIndex: l,
|
|
55
55
|
field: d,
|
|
56
56
|
fieldValue: f,
|
|
57
|
-
message:
|
|
57
|
+
message: u.message || `${o} is required`
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
return e;
|
|
@@ -92,12 +92,12 @@ function Ht(c = [], t = 1, e = 0) {
|
|
|
92
92
|
return c.map((i) => {
|
|
93
93
|
if (i.children) {
|
|
94
94
|
let s = 0, o = i.fixed;
|
|
95
|
-
i.children.forEach((
|
|
96
|
-
|
|
95
|
+
i.children.forEach((a) => {
|
|
96
|
+
a.fixed = o;
|
|
97
97
|
});
|
|
98
98
|
const r = Ht(i.children, t - 1, e + 1);
|
|
99
|
-
return r && r.forEach((
|
|
100
|
-
s +=
|
|
99
|
+
return r && r.forEach((a) => {
|
|
100
|
+
s += a.colspan ?? 0;
|
|
101
101
|
}), {
|
|
102
102
|
...i,
|
|
103
103
|
width: i.width,
|
|
@@ -135,12 +135,12 @@ function ne(c) {
|
|
|
135
135
|
else {
|
|
136
136
|
let o = "";
|
|
137
137
|
if (c.startsWith('"')) {
|
|
138
|
-
let r = 0,
|
|
139
|
-
for (;
|
|
140
|
-
const
|
|
141
|
-
|
|
138
|
+
let r = 0, a = !0;
|
|
139
|
+
for (; a; ) {
|
|
140
|
+
const l = c.slice(0, 1);
|
|
141
|
+
l === '"' && (r += 1), o += l, c = c.slice(1), (c.length === 0 || c.match(/^[\t\r\n]/) && r % 2 === 0) && (a = !1);
|
|
142
142
|
}
|
|
143
|
-
o = o.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (
|
|
143
|
+
o = o.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (l) => new Array(Math.floor(l.length / 2)).fill('"').join(""));
|
|
144
144
|
} else {
|
|
145
145
|
const r = c.match(re);
|
|
146
146
|
o = r ? r[0] : "", c = c.slice(o.length);
|
|
@@ -149,7 +149,7 @@ function ne(c) {
|
|
|
149
149
|
}
|
|
150
150
|
return Array.isArray(t) && t.length > 1 && t[t.length - 1].length === 1 && t[t.length - 1][0] === "" && (t = t.slice(0, t.length - 1)), t;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function ae(c) {
|
|
153
153
|
let t, e, i, s, o = "", r;
|
|
154
154
|
for (t = 0, e = c.length; t < e; t += 1) {
|
|
155
155
|
for (s = c[t].length, i = 0; i < s; i += 1)
|
|
@@ -167,8 +167,8 @@ function Dt(c, t, e = []) {
|
|
|
167
167
|
if (r === 0)
|
|
168
168
|
s.push(1);
|
|
169
169
|
else {
|
|
170
|
-
const
|
|
171
|
-
|
|
170
|
+
const a = e.reduce((h, d) => `${h}${o[d] ?? ""}`, "") || o[t], l = e.reduce((h, d) => `${h}${c[r - 1][d] ?? ""}`, "") || c[r - 1][t];
|
|
171
|
+
a === l ? (s[i] += 1, s.push(0)) : (s.push(1), i = r);
|
|
172
172
|
}
|
|
173
173
|
}), s;
|
|
174
174
|
}
|
|
@@ -179,7 +179,7 @@ function kt(c, t) {
|
|
|
179
179
|
r === 0 ? (e = o.key, i = o.key, s[o.key] = 1) : c[o.key] === c[e] ? (s[o.key] = 0, s[i] += 1) : (s[o.key] = 1, e = o.key, i = o.key);
|
|
180
180
|
}), s;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function le(c, t, e = []) {
|
|
183
183
|
const { visibleRows: i, rowIndex: s, headIndex: o } = c, r = Dt(i, t, e);
|
|
184
184
|
return r[s - o] === 0 ? {
|
|
185
185
|
rowspan: 0,
|
|
@@ -215,7 +215,7 @@ function ce(c, t = document.documentElement) {
|
|
|
215
215
|
return getComputedStyle(t).getPropertyValue(e).trim();
|
|
216
216
|
}
|
|
217
217
|
class Xt {
|
|
218
|
-
constructor(t, e, i, s, o, r,
|
|
218
|
+
constructor(t, e, i, s, o, r, a) {
|
|
219
219
|
n(this, "ctx");
|
|
220
220
|
n(this, "x", 0);
|
|
221
221
|
n(this, "y", 0);
|
|
@@ -223,7 +223,7 @@ class Xt {
|
|
|
223
223
|
n(this, "height", 0);
|
|
224
224
|
n(this, "fixed");
|
|
225
225
|
n(this, "cellType");
|
|
226
|
-
this.ctx = t, this.x = e, this.y = i, this.width = s, this.height = o, this.fixed =
|
|
226
|
+
this.ctx = t, this.x = e, this.y = i, this.width = s, this.height = o, this.fixed = a, this.cellType = r;
|
|
227
227
|
}
|
|
228
228
|
isHorizontalVisible() {
|
|
229
229
|
if (this.fixed)
|
|
@@ -261,8 +261,8 @@ class Xt {
|
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
class $ extends Xt {
|
|
264
|
-
constructor(e, i, s, o, r,
|
|
265
|
-
super(e, o, r,
|
|
264
|
+
constructor(e, i, s, o, r, a, l, h, d, f = "body") {
|
|
265
|
+
super(e, o, r, a, l, f, h.fixed);
|
|
266
266
|
n(this, "formatter");
|
|
267
267
|
n(this, "formatterFooter");
|
|
268
268
|
n(this, "hoverIconName", "");
|
|
@@ -362,8 +362,8 @@ class $ extends Xt {
|
|
|
362
362
|
colspan: s = 1,
|
|
363
363
|
rowspan: o = 1,
|
|
364
364
|
relationRowKeys: r,
|
|
365
|
-
relationColKeys:
|
|
366
|
-
mergeRow:
|
|
365
|
+
relationColKeys: a,
|
|
366
|
+
mergeRow: l = !1,
|
|
367
367
|
mergeCol: h = !1
|
|
368
368
|
} = i({
|
|
369
369
|
row: this.row,
|
|
@@ -377,7 +377,7 @@ class $ extends Xt {
|
|
|
377
377
|
visibleLeafColumns: this.ctx.header.visibleLeafColumns,
|
|
378
378
|
rows: this.ctx.body.data
|
|
379
379
|
}) || {};
|
|
380
|
-
Array.isArray(r) && r.length > 0 ? this.relationRowKeys = r : this.relationRowKeys = [this.key], Array.isArray(
|
|
380
|
+
Array.isArray(r) && r.length > 0 ? this.relationRowKeys = r : this.relationRowKeys = [this.key], Array.isArray(a) && a.length > 0 ? this.relationColKeys = a : this.relationColKeys = [this.key], this.mergeCol = h, this.mergeRow = l, this.colspan = s, this.rowspan = o, this.visibleWidth = this.getWidthByColIndexColSpan(this.colIndex, this.colspan), this.visibleHeight = this.ctx.database.getHeightByRowIndexRowSpan(this.rowIndex, this.rowspan);
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
updateSpanInfo() {
|
|
@@ -448,23 +448,66 @@ class $ extends Xt {
|
|
|
448
448
|
}
|
|
449
449
|
updateTree() {
|
|
450
450
|
const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
|
|
451
|
-
let o, r = 0,
|
|
451
|
+
let o, r = 0, a = "";
|
|
452
452
|
if (!(["tree", "selection-tree", "tree-selection"].includes(this.type) && s === "body"))
|
|
453
453
|
return;
|
|
454
|
-
const
|
|
454
|
+
const l = this.ctx.database.getRowForRowKey(i), { expand: h = !1, hasChildren: d = !1, expandLoading: f = !1, level: u = 0 } = l || {};
|
|
455
455
|
this.rowExpand = h, this.rowHasChildren = d;
|
|
456
|
-
const { TREE_INDENT:
|
|
457
|
-
if (r =
|
|
456
|
+
const { TREE_INDENT: x = 16, CHECKBOX_SIZE: w, TREE_ICON_SIZE: E } = this.ctx.config;
|
|
457
|
+
if (r = u * x, f) {
|
|
458
458
|
const I = this.ctx.icons.get("loading");
|
|
459
|
-
|
|
459
|
+
a = "loading", o = I;
|
|
460
460
|
} else if (d) {
|
|
461
461
|
const I = this.ctx.icons.get("expand"), _ = this.ctx.icons.get("shrink");
|
|
462
|
-
o = h ? _ : I,
|
|
462
|
+
o = h ? _ : I, a = h ? "shrink" : "expand";
|
|
463
|
+
}
|
|
464
|
+
let g = E, p = E, y = this.drawX;
|
|
465
|
+
(this.align === "center" || this.align === "right") && (y = this.drawX + (this.visibleWidth - g - 2 * e) / 2, this.align = "left");
|
|
466
|
+
let m = y + r + e, b = this.drawY + (this.visibleHeight - p) / 2, C = r + this.drawX + g - 0.5;
|
|
467
|
+
this.type === "selection-tree" ? (m = r + this.drawSelectionImageX + this.drawSelectionImageWidth, C = m + g - e / 2) : this.type === "tree-selection" ? C = m + w + g - e / 2 : C = m + g - e / 2, this.drawTextX = C, this.drawTextWidth = this.drawX + this.visibleWidth - C, !(m + g + e > this.drawX + this.visibleWidth) && (b + p + e > this.drawY + this.visibleHeight || (this.drawTreeImageX = m, this.drawTreeImageY = b, this.drawTreeImageWidth = g, this.drawTreeImageHeight = p, o ? (this.drawTreeImageName = a, this.drawTreeImageSource = o) : (this.drawTreeImageName = "", this.drawTreeImageSource = void 0)));
|
|
468
|
+
}
|
|
469
|
+
drawTreeLine() {
|
|
470
|
+
const { TREE_LINE: e, TREE_INDENT: i = 16, TREE_ICON_SIZE: s = 16, TREE_LINE_COLOR: o = "#e1e6eb" } = this.ctx.config;
|
|
471
|
+
if (!e || this.cellType !== "body" || !["tree", "selection-tree", "tree-selection"].includes(this.type) || this.rowspan === 0 || this.colspan === 0) return;
|
|
472
|
+
const r = this.ctx.database.getRowForRowKey(this.rowKey) || {}, a = r.level ?? 0, l = this.drawTreeImageX + this.drawTreeImageWidth / 2, h = this.drawTreeImageY + this.drawTreeImageHeight / 2;
|
|
473
|
+
let d = this.drawTreeImageX - a * i;
|
|
474
|
+
const f = Array.isArray(r.parentRowKeys) ? r.parentRowKeys : [];
|
|
475
|
+
if (a > 0) {
|
|
476
|
+
for (let g = 0; g < a - 1; g += 1) {
|
|
477
|
+
const p = f[g + 1];
|
|
478
|
+
if (!!(p ? this.ctx.database.getRowForRowKey(p) || {} : {}).isLastChild) continue;
|
|
479
|
+
const b = Math.round(this.drawTreeImageX - (a - g) * i + s / 2);
|
|
480
|
+
this.ctx.paint.drawLine([b, this.drawY, b, this.drawY + this.visibleHeight], {
|
|
481
|
+
borderColor: o,
|
|
482
|
+
borderWidth: 1,
|
|
483
|
+
lineDash: [4, 4],
|
|
484
|
+
lineDashOffset: 0
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
const u = Math.round(this.drawTreeImageX - i + s / 2), w = !!r.isLastChild ? h : this.drawY + this.visibleHeight;
|
|
488
|
+
this.ctx.paint.drawLine([u, this.drawY, u, w], {
|
|
489
|
+
borderColor: o,
|
|
490
|
+
borderWidth: 1,
|
|
491
|
+
lineDash: [4, 4],
|
|
492
|
+
lineDashOffset: 0
|
|
493
|
+
});
|
|
494
|
+
const E = Math.round(d + (a - 1) * i + s / 2);
|
|
495
|
+
this.ctx.paint.drawLine([E, h, l, h], {
|
|
496
|
+
borderColor: o,
|
|
497
|
+
borderWidth: 1,
|
|
498
|
+
lineDash: [4, 4],
|
|
499
|
+
lineDashOffset: 0
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
if (r.hasChildren && r.expand) {
|
|
503
|
+
const u = this.drawTreeImageY + this.drawTreeImageHeight, x = u + Math.min(this.visibleHeight / 2, Math.max(8, s / 2));
|
|
504
|
+
this.ctx.paint.drawLine([l, u, l, x], {
|
|
505
|
+
borderColor: o,
|
|
506
|
+
borderWidth: 1,
|
|
507
|
+
lineDash: [4, 4],
|
|
508
|
+
lineDashOffset: 0
|
|
509
|
+
});
|
|
463
510
|
}
|
|
464
|
-
let g = E, p = E, m = this.drawX;
|
|
465
|
-
(this.align === "center" || this.align === "right") && (m = this.drawX + (this.visibleWidth - g - 2 * e) / 2, this.align = "left");
|
|
466
|
-
let y = m + r + e, b = this.drawY + (this.visibleHeight - p) / 2, C = r + this.drawX + g - 0.5;
|
|
467
|
-
this.type === "selection-tree" ? (y = r + this.drawSelectionImageX + this.drawSelectionImageWidth, C = y + g - e / 2) : this.type === "tree-selection" ? C = y + w + g - e / 2 : C = y + g - e / 2, this.drawTextX = C, this.drawTextWidth = this.drawX + this.visibleWidth - C, !(y + g + e > this.drawX + this.visibleWidth) && (b + p + e > this.drawY + this.visibleHeight || o && (this.drawTreeImageX = y, this.drawTreeImageY = b, this.drawTreeImageWidth = g, this.drawTreeImageHeight = p, this.drawTreeImageName = l, this.drawTreeImageSource = o));
|
|
468
511
|
}
|
|
469
512
|
updateContainer() {
|
|
470
513
|
const {
|
|
@@ -473,18 +516,18 @@ class $ extends Xt {
|
|
|
473
516
|
BODY_CELL_STYLE_METHOD: s,
|
|
474
517
|
FOOTER_CELL_STYLE_METHOD: o,
|
|
475
518
|
READONLY_TEXT_COLOR: r,
|
|
476
|
-
BODY_TEXT_COLOR:
|
|
477
|
-
FOOTER_TEXT_COLOR:
|
|
519
|
+
BODY_TEXT_COLOR: a,
|
|
520
|
+
FOOTER_TEXT_COLOR: l,
|
|
478
521
|
FOOTER_BG_COLOR: h,
|
|
479
522
|
HIGHLIGHT_SELECTED_ROW: d,
|
|
480
523
|
HIGHLIGHT_SELECTED_ROW_COLOR: f,
|
|
481
|
-
HIGHLIGHT_HOVER_ROW:
|
|
482
|
-
HIGHLIGHT_HOVER_ROW_COLOR:
|
|
524
|
+
HIGHLIGHT_HOVER_ROW: u,
|
|
525
|
+
HIGHLIGHT_HOVER_ROW_COLOR: x,
|
|
483
526
|
STRIPE: w,
|
|
484
527
|
STRIPE_COLOR: E
|
|
485
528
|
} = this.ctx.config;
|
|
486
529
|
if (this.cellType === "footer") {
|
|
487
|
-
let _ = h, T =
|
|
530
|
+
let _ = h, T = l;
|
|
488
531
|
if (typeof o == "function") {
|
|
489
532
|
const v = o, { backgroundColor: R, color: S } = v({
|
|
490
533
|
row: this.row,
|
|
@@ -499,14 +542,14 @@ class $ extends Xt {
|
|
|
499
542
|
return;
|
|
500
543
|
}
|
|
501
544
|
let g = "transparent";
|
|
502
|
-
const p = this.ctx.hoverCell,
|
|
503
|
-
let
|
|
504
|
-
if (this.rowspan !== 1 && (
|
|
545
|
+
const p = this.ctx.hoverCell, y = this.ctx.currentCell;
|
|
546
|
+
let m = this.rowIndex, b = this.rowIndex;
|
|
547
|
+
if (this.rowspan !== 1 && (u || d)) {
|
|
505
548
|
const _ = this.getSpanInfo(), { yArr: T } = _;
|
|
506
|
-
|
|
549
|
+
m = T[0], b = T[1];
|
|
507
550
|
}
|
|
508
|
-
|
|
509
|
-
let C = e, I =
|
|
551
|
+
u && p && (p.rowKey === this.rowKey && (g = x), p.rowIndex >= m && p.rowIndex <= b && (g = x)), d && y && (y.rowKey === this.rowKey && (g = f), y.rowIndex >= m && y.rowIndex <= b && (g = f)), this.drawCellSkyBgColor = g;
|
|
552
|
+
let C = e, I = a;
|
|
510
553
|
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (C = i, I = r), w && (this.rowIndex % 2 ? C = E : C = e), typeof s == "function") {
|
|
511
554
|
const _ = s, { backgroundColor: T, color: v } = _({
|
|
512
555
|
row: this.row,
|
|
@@ -521,28 +564,28 @@ class $ extends Xt {
|
|
|
521
564
|
this.drawCellBgColor = C, this.drawTextColor = I;
|
|
522
565
|
}
|
|
523
566
|
updateSelection() {
|
|
524
|
-
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: o, cellType: r, type:
|
|
525
|
-
if (s === 0 || o === 0 || r === "footer" || !["index-selection", "selection", "selection-tree", "tree-selection"].includes(
|
|
567
|
+
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: o, cellType: r, type: a, rowIndex: l, rowKey: h } = this;
|
|
568
|
+
if (s === 0 || o === 0 || r === "footer" || !["index-selection", "selection", "selection-tree", "tree-selection"].includes(a))
|
|
526
569
|
return;
|
|
527
|
-
const d = this.ctx.database.getRowSelectable(h), { CHECKBOX_SIZE: f = 0, CELL_PADDING:
|
|
528
|
-
let
|
|
529
|
-
(this.align === "center" || this.align === "right") && (
|
|
530
|
-
let w =
|
|
531
|
-
if (
|
|
532
|
-
if (
|
|
533
|
-
const { TREE_INDENT:
|
|
534
|
-
w =
|
|
570
|
+
const d = this.ctx.database.getRowSelectable(h), { CHECKBOX_SIZE: f = 0, CELL_PADDING: u } = this.ctx.config;
|
|
571
|
+
let x = this.drawX + u;
|
|
572
|
+
(this.align === "center" || this.align === "right") && (x = this.drawX + (e - f) / 2);
|
|
573
|
+
let w = x, E = this.drawY + (i - f) / 2;
|
|
574
|
+
if (a !== "selection-tree") {
|
|
575
|
+
if (a === "tree-selection") {
|
|
576
|
+
const { TREE_INDENT: y = 16, TREE_ICON_SIZE: m } = this.ctx.config, b = this.ctx.database.getRowForRowKey(h), { level: C = 0 } = b || {}, I = C * y;
|
|
577
|
+
w = x + m + I;
|
|
535
578
|
}
|
|
536
579
|
}
|
|
537
580
|
let g = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck";
|
|
538
|
-
if (
|
|
539
|
-
const
|
|
540
|
-
|
|
581
|
+
if (a === "selection-tree" || a === "tree-selection") {
|
|
582
|
+
const y = this.ctx.database.getTreeSelectionState(h);
|
|
583
|
+
y.indeterminate && d ? (g = this.ctx.icons.get("checkbox-indeterminate"), p = "checkbox-indeterminate") : y.checked && d ? (g = this.ctx.icons.get("checkbox-check"), p = "checkbox-check") : !y.checked && d ? (g = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), p = "checkbox-disabled");
|
|
541
584
|
} else {
|
|
542
|
-
const
|
|
543
|
-
|
|
585
|
+
const y = this.ctx.database.getRowSelection(h);
|
|
586
|
+
y && d ? (g = this.ctx.icons.get("checkbox-check"), p = "checkbox-check") : y && !d ? (g = this.ctx.icons.get("checkbox-check-disabled"), p = "checkbox-check-disabled") : !y && d ? (g = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), p = "checkbox-disabled");
|
|
544
587
|
}
|
|
545
|
-
w + f +
|
|
588
|
+
w + f + u > this.drawX + this.visibleWidth || E + f + u > this.drawY + this.visibleHeight || (a === "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(p)) && (this.drawSelectionImageX = w, this.drawSelectionImageY = E, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = p, this.drawSelectionImageSource = g) : (this.drawSelectionImageX = w, this.drawSelectionImageY = E, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = p, this.drawSelectionImageSource = g));
|
|
546
589
|
}
|
|
547
590
|
updateHoverIcon() {
|
|
548
591
|
if (this.ctx.database.getReadonly(this.rowKey, this.key))
|
|
@@ -558,18 +601,18 @@ class $ extends Xt {
|
|
|
558
601
|
});
|
|
559
602
|
h !== void 0 && (this.hoverIconName = h);
|
|
560
603
|
}
|
|
561
|
-
const { hoverCell:
|
|
562
|
-
if (this.hoverIconName && !this.ctx.editing &&
|
|
563
|
-
let
|
|
564
|
-
if (
|
|
565
|
-
const f = this.getSpanInfo(), { yArr:
|
|
566
|
-
if (
|
|
567
|
-
const { width: E, height: g, offsetTop: p, offsetLeft:
|
|
568
|
-
|
|
604
|
+
const { hoverCell: a } = this.ctx;
|
|
605
|
+
if (this.hoverIconName && !this.ctx.editing && a) {
|
|
606
|
+
let l = 0, h = 0;
|
|
607
|
+
if (a.rowKey === this.rowKey && (l = this.drawX + this.width - s - o, h = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && r) {
|
|
608
|
+
const f = this.getSpanInfo(), { yArr: u } = f, x = u[0], w = u[1];
|
|
609
|
+
if (a.rowIndex >= x && a.rowIndex <= w) {
|
|
610
|
+
const { width: E, height: g, offsetTop: p, offsetLeft: y } = f;
|
|
611
|
+
l = this.drawX - y + E - s - o, h = this.drawY - p + (g - s) / 2;
|
|
569
612
|
}
|
|
570
613
|
}
|
|
571
614
|
const d = this.ctx.icons.get(this.hoverIconName);
|
|
572
|
-
this.drawHoverImageX =
|
|
615
|
+
this.drawHoverImageX = l, this.drawHoverImageY = h, this.drawHoverImageWidth = s, this.drawHoverImageHeight = s, this.drawHoverImageName = this.hoverIconName, this.drawHoverImageSource = d;
|
|
573
616
|
}
|
|
574
617
|
}
|
|
575
618
|
// 过去跨度配置
|
|
@@ -664,17 +707,17 @@ class $ extends Xt {
|
|
|
664
707
|
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: o } = this.ctx.config;
|
|
665
708
|
if (!s || !i || this.ctx.editing)
|
|
666
709
|
return;
|
|
667
|
-
const { xArr: r, yArr:
|
|
668
|
-
if (d ===
|
|
710
|
+
const { xArr: r, yArr: a } = this.ctx.selector, l = r[1], h = a[1], { colIndex: d, rowIndex: f, drawX: u, drawY: x } = this;
|
|
711
|
+
if (d === l && f === h) {
|
|
669
712
|
const E = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
|
|
670
|
-
this.ctx.paint.drawRect(
|
|
713
|
+
this.ctx.paint.drawRect(u + this.width - E, x + this.height - E, 6, 6, {
|
|
671
714
|
borderColor: o,
|
|
672
715
|
fillColor: e
|
|
673
716
|
});
|
|
674
717
|
}
|
|
675
718
|
}
|
|
676
719
|
draw() {
|
|
677
|
-
this.drawText(), this.drawImage(), this.drawSelector(), this.drawAutofillPiont(), this.drawErrorTip();
|
|
720
|
+
this.drawTreeLine(), this.drawText(), this.drawImage(), this.drawSelector(), this.drawAutofillPiont(), this.drawErrorTip();
|
|
678
721
|
}
|
|
679
722
|
/**
|
|
680
723
|
* 根据列的索引获取列的宽度
|
|
@@ -699,13 +742,13 @@ class $ extends Xt {
|
|
|
699
742
|
);
|
|
700
743
|
this.ellipsis = o;
|
|
701
744
|
const { placeholder: r } = this.column;
|
|
702
|
-
let
|
|
703
|
-
return !this.ctx.database.getReadonly(this.rowKey, this.key) && r && ["", null, void 0].includes(this.text) && this.cellType === "body" && !(this.rowspan === 0 || this.colspan === 0) && (
|
|
745
|
+
let a = this.displayText, l = this.drawTextColor;
|
|
746
|
+
return !this.ctx.database.getReadonly(this.rowKey, this.key) && r && ["", null, void 0].includes(this.text) && this.cellType === "body" && !(this.rowspan === 0 || this.colspan === 0) && (a = r, l = s), this.ctx.paint.drawText(a, this.drawTextX, this.drawTextY, this.drawTextWidth, this.drawTextHeight, {
|
|
704
747
|
font: i,
|
|
705
748
|
padding: e,
|
|
706
749
|
align: this.align,
|
|
707
750
|
verticalAlign: this.verticalAlign,
|
|
708
|
-
color:
|
|
751
|
+
color: l
|
|
709
752
|
});
|
|
710
753
|
}
|
|
711
754
|
drawImage() {
|
|
@@ -771,8 +814,8 @@ class $ extends Xt {
|
|
|
771
814
|
fillColor: "transparent",
|
|
772
815
|
borderWidth: 1
|
|
773
816
|
});
|
|
774
|
-
const [
|
|
775
|
-
!(
|
|
817
|
+
const [a, l] = i, [h, d] = s;
|
|
818
|
+
!(a === l && h === d) && this.colIndex >= a && this.colIndex <= l && this.rowIndex >= h && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.width, this.height, {
|
|
776
819
|
borderColor: "transparent",
|
|
777
820
|
fillColor: this.ctx.config.SELECT_AREA_COLOR || "rgba(82,146,247,0.1)"
|
|
778
821
|
}), this.operation && this.rowIndex >= h && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.visibleWidth, this.visibleHeight, {
|
|
@@ -783,7 +826,7 @@ class $ extends Xt {
|
|
|
783
826
|
drawErrorTip() {
|
|
784
827
|
if (this.cellType === "footer" || !this.message || this.rowspan === 0 || this.colspan === 0)
|
|
785
828
|
return;
|
|
786
|
-
const { ERROR_TIP_ICON_SIZE: e, ERROR_TIP_COLOR: i } = this.ctx.config, { width: s } = this, o = this.drawX, r = this.drawY,
|
|
829
|
+
const { ERROR_TIP_ICON_SIZE: e, ERROR_TIP_COLOR: i } = this.ctx.config, { width: s } = this, o = this.drawX, r = this.drawY, a = [
|
|
787
830
|
o + s - e - 0.5,
|
|
788
831
|
r,
|
|
789
832
|
o + s - 0.5,
|
|
@@ -791,7 +834,7 @@ class $ extends Xt {
|
|
|
791
834
|
o + s - 0.5,
|
|
792
835
|
r + e
|
|
793
836
|
];
|
|
794
|
-
this.ctx.paint.drawLine(
|
|
837
|
+
this.ctx.paint.drawLine(a, {
|
|
795
838
|
borderColor: i,
|
|
796
839
|
fillColor: i,
|
|
797
840
|
borderWidth: 1,
|
|
@@ -800,51 +843,51 @@ class $ extends Xt {
|
|
|
800
843
|
});
|
|
801
844
|
}
|
|
802
845
|
drawBorder(e) {
|
|
803
|
-
const { drawX: i, drawY: s, rowIndex: o, colIndex: r, height:
|
|
846
|
+
const { drawX: i, drawY: s, rowIndex: o, colIndex: r, height: a, width: l } = this;
|
|
804
847
|
let h = i, d = s;
|
|
805
|
-
const { xArr: f, yArr:
|
|
806
|
-
if (r >= p && r <=
|
|
807
|
-
const C = r ===
|
|
808
|
-
this.ctx.paint.drawLine([h + I, d + 1, h +
|
|
848
|
+
const { xArr: f, yArr: u, lineDash: x = [], borderWidth: w = 1, borderColor: E, fillColor: g } = e, p = f[0], y = f[1], m = u[0], b = u[1];
|
|
849
|
+
if (r >= p && r <= y && o === m) {
|
|
850
|
+
const C = r === y ? 1 : 0, I = r === p ? 1 : 0;
|
|
851
|
+
this.ctx.paint.drawLine([h + I, d + 1, h + l - C, d + 1], {
|
|
809
852
|
borderColor: E,
|
|
810
853
|
fillColor: g,
|
|
811
854
|
borderWidth: w,
|
|
812
855
|
lineCap: "round",
|
|
813
856
|
lineJoin: "round",
|
|
814
|
-
lineDash:
|
|
857
|
+
lineDash: x
|
|
815
858
|
});
|
|
816
859
|
}
|
|
817
|
-
if (r ===
|
|
818
|
-
const C = o ===
|
|
819
|
-
this.ctx.paint.drawLine([h +
|
|
860
|
+
if (r === y && o >= m && o <= b) {
|
|
861
|
+
const C = o === m ? 1 : 0, I = o === b ? 1 : 0;
|
|
862
|
+
this.ctx.paint.drawLine([h + l - 1, d + C, h + l - 1, d + a - I], {
|
|
820
863
|
borderColor: E,
|
|
821
864
|
fillColor: g,
|
|
822
865
|
borderWidth: w,
|
|
823
866
|
lineCap: "round",
|
|
824
867
|
lineJoin: "round",
|
|
825
|
-
lineDash:
|
|
868
|
+
lineDash: x
|
|
826
869
|
});
|
|
827
870
|
}
|
|
828
|
-
if (r >= p && r <=
|
|
829
|
-
const C = r ===
|
|
830
|
-
this.ctx.paint.drawLine([h + I, d +
|
|
871
|
+
if (r >= p && r <= y && o === b) {
|
|
872
|
+
const C = r === y ? 1 : 0, I = r === p ? 1 : 0;
|
|
873
|
+
this.ctx.paint.drawLine([h + I, d + a - 1, h + l - C, d + a - 1], {
|
|
831
874
|
borderColor: E,
|
|
832
875
|
fillColor: g,
|
|
833
876
|
borderWidth: w,
|
|
834
877
|
lineCap: "round",
|
|
835
878
|
lineJoin: "round",
|
|
836
|
-
lineDash:
|
|
879
|
+
lineDash: x
|
|
837
880
|
});
|
|
838
881
|
}
|
|
839
|
-
if (r === p && o >=
|
|
840
|
-
const C = o === b ? 1 : 0, I = o ===
|
|
841
|
-
this.ctx.paint.drawLine([h + 1, d + I, h + 1, d +
|
|
882
|
+
if (r === p && o >= m && o <= b) {
|
|
883
|
+
const C = o === b ? 1 : 0, I = o === m ? 1 : 0;
|
|
884
|
+
this.ctx.paint.drawLine([h + 1, d + I, h + 1, d + a - C], {
|
|
842
885
|
borderColor: E,
|
|
843
886
|
fillColor: g,
|
|
844
887
|
borderWidth: w,
|
|
845
888
|
lineCap: "round",
|
|
846
889
|
lineJoin: "round",
|
|
847
|
-
lineDash:
|
|
890
|
+
lineDash: x
|
|
848
891
|
});
|
|
849
892
|
}
|
|
850
893
|
}
|
|
@@ -906,41 +949,44 @@ class de {
|
|
|
906
949
|
* @param level
|
|
907
950
|
*/
|
|
908
951
|
initData(t, e = 0, i = []) {
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
this.
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
952
|
+
const s = t.length;
|
|
953
|
+
t.forEach((o, r) => {
|
|
954
|
+
var y;
|
|
955
|
+
const { ROW_KEY: a = "", DEFAULT_EXPAND_ALL: l, CELL_HEIGHT: h, SELECTABLE_METHOD: d, CHECKBOX_KEY: f } = this.ctx.config, u = o[a], x = u != null ? `${u}` : Lt();
|
|
956
|
+
this.itemRowKeyMap.set(o, x);
|
|
957
|
+
const w = o._height || h, E = o._readonly;
|
|
958
|
+
let g = !0;
|
|
959
|
+
if (typeof d == "function" && (g = d), f) {
|
|
960
|
+
const m = o[f];
|
|
917
961
|
if (this.checkboxKeyMap.has(m)) {
|
|
918
|
-
const
|
|
919
|
-
|
|
962
|
+
const b = this.checkboxKeyMap.get(m) || [];
|
|
963
|
+
b.push(x), this.checkboxKeyMap.set(m, b);
|
|
920
964
|
} else
|
|
921
965
|
this.checkboxKeyMap.set(m, [x]);
|
|
922
966
|
}
|
|
923
967
|
this.selectionMap.set(x, {
|
|
924
|
-
key:
|
|
925
|
-
row:
|
|
926
|
-
check: ((
|
|
968
|
+
key: f ? o[f] : x,
|
|
969
|
+
row: o,
|
|
970
|
+
check: ((y = this.selectionMap.get(x)) == null ? void 0 : y.check) || !1
|
|
927
971
|
});
|
|
928
|
-
const
|
|
929
|
-
this.expandMap.set(x,
|
|
930
|
-
readonly:
|
|
931
|
-
index:
|
|
932
|
-
rowIndex:
|
|
972
|
+
const p = l || this.expandMap.get(x) || o._expand || !1;
|
|
973
|
+
this.expandMap.set(x, p), this.rowKeyMap.set(x, {
|
|
974
|
+
readonly: E,
|
|
975
|
+
index: r,
|
|
976
|
+
rowIndex: r,
|
|
933
977
|
level: e,
|
|
934
|
-
height:
|
|
978
|
+
height: w,
|
|
935
979
|
check: !1,
|
|
936
|
-
selectable:
|
|
937
|
-
expand:
|
|
980
|
+
selectable: g,
|
|
981
|
+
expand: p,
|
|
938
982
|
expandLazy: !1,
|
|
939
|
-
hasChildren:
|
|
983
|
+
hasChildren: o._hasChildren || (Array.isArray(o.children) ? o.children.length > 0 : !1),
|
|
940
984
|
expandLoading: !1,
|
|
941
|
-
item:
|
|
942
|
-
parentRowKeys: i
|
|
943
|
-
|
|
985
|
+
item: o,
|
|
986
|
+
parentRowKeys: i,
|
|
987
|
+
parentRowKey: i[i.length - 1] || "",
|
|
988
|
+
isLastChild: r === s - 1
|
|
989
|
+
}), Array.isArray(o.children) && o.children.length && this.initData(o.children, e + 1, [...i, x]);
|
|
944
990
|
});
|
|
945
991
|
}
|
|
946
992
|
/**
|
|
@@ -1002,12 +1048,12 @@ class de {
|
|
|
1002
1048
|
const i = (o) => {
|
|
1003
1049
|
o.forEach((r) => {
|
|
1004
1050
|
t.push(r);
|
|
1005
|
-
const
|
|
1006
|
-
this.sumHeight += d, this.rowIndexRowKeyMap.set(e,
|
|
1051
|
+
const a = this.itemRowKeyMap.get(r), { expand: l, hasChildren: h, height: d } = this.rowKeyMap.get(a), f = this.sumHeight;
|
|
1052
|
+
this.sumHeight += d, this.rowIndexRowKeyMap.set(e, a), this.rowKeyRowIndexMap.set(a, e), this.positions.push({
|
|
1007
1053
|
top: f,
|
|
1008
1054
|
height: d,
|
|
1009
1055
|
bottom: this.sumHeight
|
|
1010
|
-
}), e += 1,
|
|
1056
|
+
}), e += 1, l && h && i(r.children);
|
|
1011
1057
|
});
|
|
1012
1058
|
};
|
|
1013
1059
|
this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear();
|
|
@@ -1144,37 +1190,37 @@ class de {
|
|
|
1144
1190
|
*/
|
|
1145
1191
|
async batchSetItemValue(t, e = !1, i = !0, s = "none") {
|
|
1146
1192
|
let o = [], r = i;
|
|
1147
|
-
const
|
|
1148
|
-
let
|
|
1149
|
-
const { rowKey: w, key: E } =
|
|
1150
|
-
let g =
|
|
1151
|
-
const
|
|
1152
|
-
return (b == null ? void 0 : b.type) === "number" && (["", void 0, null].includes(g) ? p = null : /^-?\d+(\.\d+)?$/.test(`${g}`) ? p = Number(g) : (p =
|
|
1153
|
-
...
|
|
1193
|
+
const a = /* @__PURE__ */ new Set();
|
|
1194
|
+
let l = [], h = t.map((x) => {
|
|
1195
|
+
const { rowKey: w, key: E } = x;
|
|
1196
|
+
let g = x.value, p = g;
|
|
1197
|
+
const y = this.getRowDataItemForRowKey(w), m = this.getItemValue(w, E), b = this.getVirtualBodyCellByKey(w, E);
|
|
1198
|
+
return (b == null ? void 0 : b.type) === "number" && (["", void 0, null].includes(g) ? p = null : /^-?\d+(\.\d+)?$/.test(`${g}`) ? p = Number(g) : (p = m, l.push({
|
|
1199
|
+
...x,
|
|
1154
1200
|
value: p,
|
|
1155
|
-
oldValue:
|
|
1156
|
-
row:
|
|
1201
|
+
oldValue: m,
|
|
1202
|
+
row: y
|
|
1157
1203
|
}))), {
|
|
1158
|
-
...
|
|
1204
|
+
...x,
|
|
1159
1205
|
value: p,
|
|
1160
|
-
oldValue:
|
|
1161
|
-
row:
|
|
1206
|
+
oldValue: m,
|
|
1207
|
+
row: y
|
|
1162
1208
|
};
|
|
1163
1209
|
});
|
|
1164
|
-
if (h = h.filter((
|
|
1165
|
-
const
|
|
1210
|
+
if (h = h.filter((x) => !l.some((w) => x.rowKey === w.rowKey && x.key === w.key)), l.length) {
|
|
1211
|
+
const x = {
|
|
1166
1212
|
code: "ERR_BATCH_SET_NUMBER_VALUE",
|
|
1167
1213
|
message: "Assignment failed, not a numeric type",
|
|
1168
|
-
data:
|
|
1214
|
+
data: l
|
|
1169
1215
|
};
|
|
1170
|
-
this.ctx.emit("error",
|
|
1216
|
+
this.ctx.emit("error", x);
|
|
1171
1217
|
}
|
|
1172
1218
|
if (!h.length)
|
|
1173
1219
|
return;
|
|
1174
1220
|
const { BEFORE_VALUE_CHANGE_METHOD: d } = this.ctx.config;
|
|
1175
|
-
s === "none" && typeof d == "function" && (h = await d(h), r = !1), h.forEach((
|
|
1176
|
-
const { value: w, rowKey: E, key: g } =
|
|
1177
|
-
|
|
1221
|
+
s === "none" && typeof d == "function" && (h = await d(h), r = !1), h.forEach((x) => {
|
|
1222
|
+
const { value: w, rowKey: E, key: g } = x, p = this.getItemValue(E, g);
|
|
1223
|
+
a.add(E), this.setItemValue(E, g, w, !1, !1, !1, r), o.push({
|
|
1178
1224
|
rowKey: E,
|
|
1179
1225
|
key: g,
|
|
1180
1226
|
oldValue: p,
|
|
@@ -1182,11 +1228,11 @@ class de {
|
|
|
1182
1228
|
});
|
|
1183
1229
|
});
|
|
1184
1230
|
let f = [];
|
|
1185
|
-
|
|
1186
|
-
f.push(this.ctx.database.getRowDataItemForRowKey(
|
|
1231
|
+
a.forEach((x) => {
|
|
1232
|
+
f.push(this.ctx.database.getRowDataItemForRowKey(x));
|
|
1187
1233
|
});
|
|
1188
|
-
const
|
|
1189
|
-
Promise.all(
|
|
1234
|
+
const u = h.map(({ rowKey: x, key: w }) => this.getValidator(x, w));
|
|
1235
|
+
Promise.all(u).then(() => {
|
|
1190
1236
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1191
1237
|
}), this.ctx.emit("change", h, f), e && this.ctx.history.pushState({
|
|
1192
1238
|
changeList: o,
|
|
@@ -1206,20 +1252,20 @@ class de {
|
|
|
1206
1252
|
* @param checkReadonly 是否检查只读
|
|
1207
1253
|
* @returns
|
|
1208
1254
|
*/
|
|
1209
|
-
async setItemValue(t, e, i, s = !1, o = !1, r = !1,
|
|
1255
|
+
async setItemValue(t, e, i, s = !1, o = !1, r = !1, a = !0) {
|
|
1210
1256
|
if (!this.rowKeyMap.has(t))
|
|
1211
1257
|
return {};
|
|
1212
|
-
const { item:
|
|
1213
|
-
let h =
|
|
1214
|
-
if (
|
|
1258
|
+
const { item: l } = this.rowKeyMap.get(t);
|
|
1259
|
+
let h = l[e], d = i;
|
|
1260
|
+
if (a && this.ctx.database.getReadonly(t, e))
|
|
1215
1261
|
return {
|
|
1216
1262
|
oldValue: h,
|
|
1217
1263
|
newValue: h
|
|
1218
1264
|
};
|
|
1219
|
-
|
|
1265
|
+
l[e] !== null && typeof l[e] == "object" && (h = JSON.parse(JSON.stringify(l[e])));
|
|
1220
1266
|
const f = `${t}_${e}`;
|
|
1221
1267
|
this.originalDataMap.has(f) || this.originalDataMap.set(f, h);
|
|
1222
|
-
const
|
|
1268
|
+
const u = this.originalDataMap.get(f), x = this.getRowDataItemForRowKey(t);
|
|
1223
1269
|
if (r) {
|
|
1224
1270
|
const w = this.getVirtualBodyCellByKey(t, e);
|
|
1225
1271
|
if ((w == null ? void 0 : w.type) === "number")
|
|
@@ -1238,7 +1284,7 @@ class de {
|
|
|
1238
1284
|
key: e,
|
|
1239
1285
|
value: d,
|
|
1240
1286
|
oldValue: h,
|
|
1241
|
-
row:
|
|
1287
|
+
row: x
|
|
1242
1288
|
}
|
|
1243
1289
|
]
|
|
1244
1290
|
};
|
|
@@ -1255,7 +1301,7 @@ class de {
|
|
|
1255
1301
|
key: e,
|
|
1256
1302
|
value: d,
|
|
1257
1303
|
oldValue: h,
|
|
1258
|
-
row:
|
|
1304
|
+
row: x
|
|
1259
1305
|
}
|
|
1260
1306
|
];
|
|
1261
1307
|
this.batchSetItemValue(E, s, !1), this.ctx.emit("editChange", {
|
|
@@ -1263,18 +1309,18 @@ class de {
|
|
|
1263
1309
|
key: e,
|
|
1264
1310
|
oldValue: h,
|
|
1265
1311
|
value: d,
|
|
1266
|
-
originalValue:
|
|
1267
|
-
row:
|
|
1312
|
+
originalValue: u,
|
|
1313
|
+
row: x
|
|
1268
1314
|
});
|
|
1269
1315
|
} else
|
|
1270
|
-
this.changedDataMap.set(f, d),
|
|
1316
|
+
this.changedDataMap.set(f, d), l[e] = d;
|
|
1271
1317
|
return this.ctx.hasEvent("iterationChange") && this.ctx.emit("iterationChange", {
|
|
1272
1318
|
rowKey: t,
|
|
1273
1319
|
key: e,
|
|
1274
1320
|
oldValue: h,
|
|
1275
1321
|
value: d,
|
|
1276
1322
|
originalValue: this.originalDataMap.get(f),
|
|
1277
|
-
row:
|
|
1323
|
+
row: x
|
|
1278
1324
|
}), o && this.ctx.emit("draw"), {
|
|
1279
1325
|
oldValue: h,
|
|
1280
1326
|
newValue: d
|
|
@@ -1302,9 +1348,9 @@ class de {
|
|
|
1302
1348
|
if (!this.rowKeyMap.has(t))
|
|
1303
1349
|
return !1;
|
|
1304
1350
|
const { item: s } = this.rowKeyMap.get(t), o = s[i];
|
|
1305
|
-
this.checkboxKeyMap.has(o) && (this.checkboxKeyMap.get(o) || []).forEach((
|
|
1306
|
-
const
|
|
1307
|
-
|
|
1351
|
+
this.checkboxKeyMap.has(o) && (this.checkboxKeyMap.get(o) || []).forEach((a) => {
|
|
1352
|
+
const l = this.selectionMap.get(a);
|
|
1353
|
+
l && (l.check = e);
|
|
1308
1354
|
});
|
|
1309
1355
|
}
|
|
1310
1356
|
}
|
|
@@ -1351,10 +1397,10 @@ class de {
|
|
|
1351
1397
|
if (!e)
|
|
1352
1398
|
return;
|
|
1353
1399
|
const s = this.getTreeChildren(e).map((h) => this.selectionMap.get(h)), o = s.filter((h) => h == null ? void 0 : h.check).length, r = s.length;
|
|
1354
|
-
let
|
|
1355
|
-
r > 0 && (o === 0 ?
|
|
1356
|
-
const
|
|
1357
|
-
|
|
1400
|
+
let a = !1;
|
|
1401
|
+
r > 0 && (o === 0 ? a = !1 : o === r || this.ctx.config.TREE_SELECT_MODE === "auto" ? a = !0 : this.ctx.config.TREE_SELECT_MODE === "cautious" && (a = !1));
|
|
1402
|
+
const l = this.selectionMap.get(e);
|
|
1403
|
+
l && l.check !== a && (l.check = a, this.setRowSelectionByCheckboxKey(e, a), this.updateParentTreeSelection(e));
|
|
1358
1404
|
}
|
|
1359
1405
|
/**
|
|
1360
1406
|
* 根据rowKey 设置选中状态
|
|
@@ -1385,27 +1431,27 @@ class de {
|
|
|
1385
1431
|
const i = this.selectionMap.get(t), s = (i == null ? void 0 : i.check) || !1;
|
|
1386
1432
|
if (this.getTreeChildren(t).length === 0)
|
|
1387
1433
|
return { checked: s, indeterminate: !1 };
|
|
1388
|
-
let r = !1,
|
|
1434
|
+
let r = !1, a = s;
|
|
1389
1435
|
if (this.ctx.config.TREE_SELECT_MODE === "auto") {
|
|
1390
1436
|
const h = (g) => {
|
|
1391
1437
|
const p = this.getTreeChildren(g);
|
|
1392
|
-
let
|
|
1393
|
-
for (const
|
|
1394
|
-
|
|
1395
|
-
return
|
|
1396
|
-
}, f = h(t).map((g) => this.selectionMap.get(g)),
|
|
1397
|
-
r = w && !(
|
|
1438
|
+
let y = [];
|
|
1439
|
+
for (const m of p)
|
|
1440
|
+
y.push(m), y.push(...h(m));
|
|
1441
|
+
return y;
|
|
1442
|
+
}, f = h(t).map((g) => this.selectionMap.get(g)), u = f.filter((g) => g == null ? void 0 : g.check).length, x = f.length, w = u > 0;
|
|
1443
|
+
r = w && !(u === x), a = s || w, s && x > 0 && u === 0 && (a = !1, r = !1);
|
|
1398
1444
|
} else if (this.ctx.config.TREE_SELECT_MODE === "cautious") {
|
|
1399
1445
|
const h = (g) => {
|
|
1400
1446
|
const p = this.getTreeChildren(g);
|
|
1401
|
-
let
|
|
1402
|
-
for (const
|
|
1403
|
-
|
|
1404
|
-
return
|
|
1405
|
-
}, f = h(t).map((g) => this.selectionMap.get(g)),
|
|
1406
|
-
r = w && !E,
|
|
1407
|
-
} else this.ctx.config.TREE_SELECT_MODE === "strictly" && (r = !1,
|
|
1408
|
-
return { checked:
|
|
1447
|
+
let y = [];
|
|
1448
|
+
for (const m of p)
|
|
1449
|
+
y.push(m), y.push(...h(m));
|
|
1450
|
+
return y;
|
|
1451
|
+
}, f = h(t).map((g) => this.selectionMap.get(g)), u = f.filter((g) => g == null ? void 0 : g.check).length, x = f.length, w = u > 0, E = u === x;
|
|
1452
|
+
r = w && !E, a = s || E, s && x > 0 && u === 0 && (a = !1, r = !1);
|
|
1453
|
+
} else this.ctx.config.TREE_SELECT_MODE === "strictly" && (r = !1, a = s);
|
|
1454
|
+
return { checked: a, indeterminate: r };
|
|
1409
1455
|
}
|
|
1410
1456
|
// 获取树形子节点
|
|
1411
1457
|
getTreeChildren(t) {
|
|
@@ -1414,8 +1460,8 @@ class de {
|
|
|
1414
1460
|
return [];
|
|
1415
1461
|
const i = [], s = (o) => {
|
|
1416
1462
|
for (const r of o) {
|
|
1417
|
-
const
|
|
1418
|
-
|
|
1463
|
+
const a = this.getRowKeyByItem(r);
|
|
1464
|
+
a && i.push(a), r.children && r.children.length > 0 && s(r.children);
|
|
1419
1465
|
}
|
|
1420
1466
|
};
|
|
1421
1467
|
return s(e.item.children), i;
|
|
@@ -1426,8 +1472,8 @@ class de {
|
|
|
1426
1472
|
for (const o of i) {
|
|
1427
1473
|
const r = this.getRowKeyByItem(o);
|
|
1428
1474
|
if (o.children)
|
|
1429
|
-
for (const
|
|
1430
|
-
if (this.getRowKeyByItem(
|
|
1475
|
+
for (const a of o.children) {
|
|
1476
|
+
if (this.getRowKeyByItem(a) === s)
|
|
1431
1477
|
return r;
|
|
1432
1478
|
const h = e(o.children, s);
|
|
1433
1479
|
if (h)
|
|
@@ -1504,17 +1550,17 @@ class de {
|
|
|
1504
1550
|
return e;
|
|
1505
1551
|
const i = this.rowKeyMap.size;
|
|
1506
1552
|
let s = 0, o = 0;
|
|
1507
|
-
const r = this.selectionMap.size,
|
|
1508
|
-
this.rowKeyMap.forEach((
|
|
1553
|
+
const r = this.selectionMap.size, a = Array.from(this.selectionMap.values()).some((u) => u.check);
|
|
1554
|
+
this.rowKeyMap.forEach((u, x) => {
|
|
1509
1555
|
var E;
|
|
1510
|
-
(E = this.selectionMap.get(
|
|
1511
|
-
let w =
|
|
1556
|
+
(E = this.selectionMap.get(x)) != null && E.check && (s += 1);
|
|
1557
|
+
let w = u.selectable;
|
|
1512
1558
|
typeof w == "function" && (w = w({
|
|
1513
|
-
row:
|
|
1514
|
-
rowIndex:
|
|
1559
|
+
row: u.item,
|
|
1560
|
+
rowIndex: u.rowIndex
|
|
1515
1561
|
})), w && (o += 1);
|
|
1516
1562
|
});
|
|
1517
|
-
const
|
|
1563
|
+
const l = r > i && s === 0 && a, h = o && o > s && s > 0 || l, d = o !== 0, f = !!o && o === s;
|
|
1518
1564
|
return this.bufferCheckState = {
|
|
1519
1565
|
buffer: !0,
|
|
1520
1566
|
check: f,
|
|
@@ -1613,9 +1659,9 @@ class de {
|
|
|
1613
1659
|
const s = this.rowKeyMap.get(t), o = this.headerMap.get(e);
|
|
1614
1660
|
if (!s || !o)
|
|
1615
1661
|
return !0;
|
|
1616
|
-
const r = s.readonly,
|
|
1617
|
-
if (typeof
|
|
1618
|
-
const d =
|
|
1662
|
+
const r = s.readonly, a = o.readonly, { BODY_CELL_READONLY_METHOD: l } = this.ctx.config;
|
|
1663
|
+
if (typeof l == "function" && o) {
|
|
1664
|
+
const d = l({
|
|
1619
1665
|
row: s.item,
|
|
1620
1666
|
rowIndex: s.rowIndex,
|
|
1621
1667
|
colIndex: o.colIndex,
|
|
@@ -1625,7 +1671,7 @@ class de {
|
|
|
1625
1671
|
if (d !== void 0)
|
|
1626
1672
|
return d;
|
|
1627
1673
|
}
|
|
1628
|
-
return
|
|
1674
|
+
return a || r;
|
|
1629
1675
|
}
|
|
1630
1676
|
clearValidate() {
|
|
1631
1677
|
this.validationErrorMap.clear();
|
|
@@ -1638,30 +1684,30 @@ class de {
|
|
|
1638
1684
|
const s = this.rowKeyMap.get(t), o = this.headerMap.get(e), { BODY_CELL_RULES_METHOD: r } = this.ctx.config;
|
|
1639
1685
|
if (o === void 0)
|
|
1640
1686
|
return i([]);
|
|
1641
|
-
const
|
|
1642
|
-
let
|
|
1687
|
+
const a = o.column;
|
|
1688
|
+
let l = a.rules;
|
|
1643
1689
|
if (typeof r == "function") {
|
|
1644
1690
|
const d = r({
|
|
1645
1691
|
row: s.item,
|
|
1646
1692
|
rowIndex: s.rowIndex,
|
|
1647
1693
|
colIndex: o.colIndex,
|
|
1648
|
-
column:
|
|
1694
|
+
column: a,
|
|
1649
1695
|
value: this.getItemValue(t, e)
|
|
1650
1696
|
});
|
|
1651
|
-
d && (
|
|
1697
|
+
d && (l = d);
|
|
1652
1698
|
}
|
|
1653
|
-
if (
|
|
1699
|
+
if (l) {
|
|
1654
1700
|
const h = {
|
|
1655
1701
|
row: s.item,
|
|
1656
1702
|
rowIndex: s.rowIndex,
|
|
1657
1703
|
colIndex: o.colIndex,
|
|
1658
|
-
column:
|
|
1704
|
+
column: a,
|
|
1659
1705
|
key: e,
|
|
1660
1706
|
rowKey: t,
|
|
1661
1707
|
value: this.getItemValue(t, e),
|
|
1662
1708
|
field: e,
|
|
1663
1709
|
fieldValue: this.getItemValue(t, e)
|
|
1664
|
-
}, f = new se(
|
|
1710
|
+
}, f = new se(l).validate(h);
|
|
1665
1711
|
this.setValidationError(t, e, f), i(f);
|
|
1666
1712
|
} else
|
|
1667
1713
|
this.clearValidationError(t, e), i([]);
|
|
@@ -1682,24 +1728,24 @@ class de {
|
|
|
1682
1728
|
rowKey: s,
|
|
1683
1729
|
row: o,
|
|
1684
1730
|
value: r,
|
|
1685
|
-
colIndex:
|
|
1686
|
-
relationRowKeys:
|
|
1731
|
+
colIndex: a,
|
|
1732
|
+
relationRowKeys: l,
|
|
1687
1733
|
relationColKeys: h,
|
|
1688
1734
|
rowspan: d,
|
|
1689
1735
|
height: f,
|
|
1690
|
-
width:
|
|
1691
|
-
colspan:
|
|
1736
|
+
width: u,
|
|
1737
|
+
colspan: x,
|
|
1692
1738
|
mergeRow: w,
|
|
1693
1739
|
mergeCol: E
|
|
1694
1740
|
} = t;
|
|
1695
|
-
if (d === 1 &&
|
|
1741
|
+
if (d === 1 && x === 1)
|
|
1696
1742
|
return {
|
|
1697
|
-
xArr: [
|
|
1743
|
+
xArr: [a, a],
|
|
1698
1744
|
yArr: [e, e],
|
|
1699
1745
|
rowspan: d,
|
|
1700
|
-
colspan:
|
|
1746
|
+
colspan: x,
|
|
1701
1747
|
height: f,
|
|
1702
|
-
width:
|
|
1748
|
+
width: u,
|
|
1703
1749
|
offsetTop: 0,
|
|
1704
1750
|
offsetLeft: 0,
|
|
1705
1751
|
dataList: [
|
|
@@ -1711,15 +1757,15 @@ class de {
|
|
|
1711
1757
|
}
|
|
1712
1758
|
]
|
|
1713
1759
|
};
|
|
1714
|
-
let g = e, p = e,
|
|
1760
|
+
let g = e, p = e, y = a, m = a, b = [], C = 0, I = 0, _ = 0, T = 0;
|
|
1715
1761
|
if (d !== 1 && w) {
|
|
1716
|
-
T =
|
|
1717
|
-
const v =
|
|
1762
|
+
T = u;
|
|
1763
|
+
const v = l.reduce((R, S) => {
|
|
1718
1764
|
const O = this.getItemValue(s, S) ?? "";
|
|
1719
1765
|
return `${R}${O}`;
|
|
1720
1766
|
}, "");
|
|
1721
1767
|
for (let R = e - 1; R >= 0; R--) {
|
|
1722
|
-
const S = this.rowIndexRowKeyMap.get(R) || "", O =
|
|
1768
|
+
const S = this.rowIndexRowKeyMap.get(R) || "", O = l.reduce((M, L) => {
|
|
1723
1769
|
const H = this.getItemValue(S, L) ?? "";
|
|
1724
1770
|
return `${M}${H}`;
|
|
1725
1771
|
}, "");
|
|
@@ -1729,7 +1775,7 @@ class de {
|
|
|
1729
1775
|
break;
|
|
1730
1776
|
}
|
|
1731
1777
|
for (let R = e; R <= this.ctx.maxRowIndex; R++) {
|
|
1732
|
-
const S = this.rowIndexRowKeyMap.get(R) || "", O =
|
|
1778
|
+
const S = this.rowIndexRowKeyMap.get(R) || "", O = l.reduce((M, L) => {
|
|
1733
1779
|
const H = this.getItemValue(S, L) ?? "";
|
|
1734
1780
|
return `${M}${H}`;
|
|
1735
1781
|
}, "");
|
|
@@ -1754,35 +1800,35 @@ class de {
|
|
|
1754
1800
|
});
|
|
1755
1801
|
}
|
|
1756
1802
|
}
|
|
1757
|
-
if (
|
|
1803
|
+
if (x !== 1 && E) {
|
|
1758
1804
|
_ = f;
|
|
1759
|
-
for (let v =
|
|
1805
|
+
for (let v = a - 1; v >= 0; v--) {
|
|
1760
1806
|
const R = this.getColumnByColIndex(v);
|
|
1761
1807
|
if (!R)
|
|
1762
1808
|
break;
|
|
1763
1809
|
const S = this.getItemValue(s, i), O = this.getItemValue(s, R.key);
|
|
1764
1810
|
if (S === O && h.includes(R.key))
|
|
1765
|
-
|
|
1811
|
+
y = v;
|
|
1766
1812
|
else
|
|
1767
1813
|
break;
|
|
1768
1814
|
}
|
|
1769
|
-
for (let v =
|
|
1815
|
+
for (let v = a; v <= this.ctx.maxColIndex; v++) {
|
|
1770
1816
|
const R = this.getColumnByColIndex(v);
|
|
1771
1817
|
if (!R)
|
|
1772
1818
|
break;
|
|
1773
1819
|
const S = this.getItemValue(s, i), O = this.getItemValue(s, R.key);
|
|
1774
1820
|
if (S === O && h.includes(R.key))
|
|
1775
|
-
|
|
1821
|
+
m = v;
|
|
1776
1822
|
else
|
|
1777
1823
|
break;
|
|
1778
1824
|
}
|
|
1779
|
-
for (let v =
|
|
1825
|
+
for (let v = y; v < a; v++) {
|
|
1780
1826
|
const R = this.getColumnByColIndex(v);
|
|
1781
1827
|
if (!R)
|
|
1782
1828
|
break;
|
|
1783
1829
|
I += R.width || 100;
|
|
1784
1830
|
}
|
|
1785
|
-
for (let v =
|
|
1831
|
+
for (let v = y; v <= m; v++) {
|
|
1786
1832
|
const R = this.getColumnByColIndex(v);
|
|
1787
1833
|
if (!R)
|
|
1788
1834
|
break;
|
|
@@ -1795,10 +1841,10 @@ class de {
|
|
|
1795
1841
|
}
|
|
1796
1842
|
}
|
|
1797
1843
|
return {
|
|
1798
|
-
xArr: [
|
|
1844
|
+
xArr: [y, m],
|
|
1799
1845
|
yArr: [g, p],
|
|
1800
1846
|
rowspan: d,
|
|
1801
|
-
colspan:
|
|
1847
|
+
colspan: x,
|
|
1802
1848
|
height: _,
|
|
1803
1849
|
width: T,
|
|
1804
1850
|
offsetTop: C,
|
|
@@ -1813,21 +1859,21 @@ class de {
|
|
|
1813
1859
|
return this.loading;
|
|
1814
1860
|
}
|
|
1815
1861
|
setValidationErrorByRowIndex(t, e, i) {
|
|
1816
|
-
const s = this.rowIndexRowKeyMap.get(t), o = `${s}_${e}`, r = this.getRowForRowIndex(t),
|
|
1817
|
-
if (!s || !
|
|
1862
|
+
const s = this.rowIndexRowKeyMap.get(t), o = `${s}_${e}`, r = this.getRowForRowIndex(t), a = this.getColumnByKey(e);
|
|
1863
|
+
if (!s || !a || !r)
|
|
1818
1864
|
return;
|
|
1819
|
-
const
|
|
1865
|
+
const l = this.getItemValue(s, e), h = [
|
|
1820
1866
|
{
|
|
1821
1867
|
key: e,
|
|
1822
1868
|
rowKey: s,
|
|
1823
1869
|
rowIndex: t,
|
|
1824
|
-
colIndex:
|
|
1825
|
-
column:
|
|
1870
|
+
colIndex: a.colIndex,
|
|
1871
|
+
column: a.column,
|
|
1826
1872
|
row: r,
|
|
1827
|
-
value:
|
|
1873
|
+
value: l,
|
|
1828
1874
|
message: i,
|
|
1829
1875
|
field: e,
|
|
1830
|
-
fieldValue:
|
|
1876
|
+
fieldValue: l
|
|
1831
1877
|
}
|
|
1832
1878
|
];
|
|
1833
1879
|
this.validationErrorMap.set(o, h);
|
|
@@ -2087,21 +2133,21 @@ class ge {
|
|
|
2087
2133
|
* @param {string} color - 阴影的颜色
|
|
2088
2134
|
*/
|
|
2089
2135
|
drawShadow(t, e, i, s, o) {
|
|
2090
|
-
const { fillColor: r, side:
|
|
2136
|
+
const { fillColor: r, side: a, shadowWidth: l, colorStart: h, colorEnd: d } = o;
|
|
2091
2137
|
this.ctx.save(), r && (this.ctx.fillStyle = r, this.ctx.fillRect(t, e, i, s));
|
|
2092
2138
|
let f;
|
|
2093
|
-
switch (
|
|
2139
|
+
switch (a) {
|
|
2094
2140
|
case "left":
|
|
2095
|
-
f = this.ctx.createLinearGradient(t -
|
|
2141
|
+
f = this.ctx.createLinearGradient(t - l, e, t, e), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t - l, e, l, s);
|
|
2096
2142
|
break;
|
|
2097
2143
|
case "right":
|
|
2098
|
-
f = this.ctx.createLinearGradient(t + i, e, t + i +
|
|
2144
|
+
f = this.ctx.createLinearGradient(t + i, e, t + i + l, e), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t + i, e, l, s);
|
|
2099
2145
|
break;
|
|
2100
2146
|
case "top":
|
|
2101
|
-
f = this.ctx.createLinearGradient(t, e -
|
|
2147
|
+
f = this.ctx.createLinearGradient(t, e - l, t, e), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e - l, i, l);
|
|
2102
2148
|
break;
|
|
2103
2149
|
case "bottom":
|
|
2104
|
-
f = this.ctx.createLinearGradient(t, e + s, t, e + s +
|
|
2150
|
+
f = this.ctx.createLinearGradient(t, e + s, t, e + s + l), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e + s, i, l);
|
|
2105
2151
|
break;
|
|
2106
2152
|
default:
|
|
2107
2153
|
console.error("Invalid side specified for shadow");
|
|
@@ -2117,19 +2163,19 @@ class ge {
|
|
|
2117
2163
|
this.ctx.beginPath(), this.ctx.moveTo(t[0] - 0.5, t[1] - 0.5);
|
|
2118
2164
|
for (let o = 2; o < t.length; o += 2)
|
|
2119
2165
|
this.ctx.lineTo(t[o] - 0.5, t[o + 1] - 0.5);
|
|
2120
|
-
this.ctx.strokeStyle = i, this.ctx.lineWidth = s, e.lineDash && (this.ctx.lineDashOffset =
|
|
2166
|
+
this.ctx.strokeStyle = i, this.ctx.lineWidth = s, e.lineDash && (this.ctx.lineDashOffset = e.lineDashOffset ?? 0, this.ctx.setLineDash(e.lineDash)), e.fillColor && (this.ctx.fillStyle = e.fillColor, this.ctx.fill()), e.borderColor && (this.ctx.strokeStyle = e.borderColor), this.ctx.stroke(), this.ctx.closePath(), this.ctx.restore();
|
|
2121
2167
|
}
|
|
2122
2168
|
drawImage(t, e, i, s, o) {
|
|
2123
2169
|
this.ctx.save(), this.ctx.drawImage(t, e, i, s, o), this.ctx.restore();
|
|
2124
2170
|
}
|
|
2125
|
-
drawRect(t, e, i, s, { borderWidth: o = 1, borderColor: r, fillColor:
|
|
2126
|
-
if (this.ctx.save(), this.ctx.beginPath(),
|
|
2171
|
+
drawRect(t, e, i, s, { borderWidth: o = 1, borderColor: r, fillColor: a, radius: l = 0 } = {}) {
|
|
2172
|
+
if (this.ctx.save(), this.ctx.beginPath(), a !== void 0 && (this.ctx.fillStyle = a), r !== void 0 && (this.ctx.lineWidth = o, this.ctx.strokeStyle = r), l === 0)
|
|
2127
2173
|
this.ctx.rect(t - 0.5, e - 0.5, i, s);
|
|
2128
2174
|
else {
|
|
2129
|
-
const [h, d, f,
|
|
2130
|
-
this.ctx.moveTo(t + h, e), this.ctx.arcTo(t + i, e, t + i, e + d, d), this.ctx.arcTo(t + i, e + s, t + i - f, e + s, f), this.ctx.arcTo(t, e + s, t, e + s -
|
|
2175
|
+
const [h, d, f, u] = typeof l == "number" ? [l, l, l, l] : l;
|
|
2176
|
+
this.ctx.moveTo(t + h, e), this.ctx.arcTo(t + i, e, t + i, e + d, d), this.ctx.arcTo(t + i, e + s, t + i - f, e + s, f), this.ctx.arcTo(t, e + s, t, e + s - u, u), this.ctx.arcTo(t, e, t + h, e, h);
|
|
2131
2177
|
}
|
|
2132
|
-
|
|
2178
|
+
a !== void 0 && this.ctx.fill(), r !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
2133
2179
|
}
|
|
2134
2180
|
/**
|
|
2135
2181
|
* 画文本
|
|
@@ -2144,19 +2190,19 @@ class ge {
|
|
|
2144
2190
|
drawText(t = "", e, i, s, o, r = {}) {
|
|
2145
2191
|
this.ctx.save();
|
|
2146
2192
|
const {
|
|
2147
|
-
font:
|
|
2148
|
-
align:
|
|
2193
|
+
font: a = "12px Arial",
|
|
2194
|
+
align: l = "center",
|
|
2149
2195
|
color: h = "#495060",
|
|
2150
2196
|
padding: d = 0,
|
|
2151
2197
|
verticalAlign: f = "middle"
|
|
2152
2198
|
} = r;
|
|
2153
|
-
this.ctx.font =
|
|
2154
|
-
let x = 0;
|
|
2155
|
-
f === "top" ? x = i + d : f === "bottom" ? x = i + o - d : x = i + (o + 1) / 2;
|
|
2199
|
+
this.ctx.font = a, this.ctx.fillStyle = h, this.ctx.textBaseline = f, this.ctx.textAlign = l;
|
|
2156
2200
|
let u = 0;
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2201
|
+
f === "top" ? u = i + d : f === "bottom" ? u = i + o - d : u = i + (o + 1) / 2;
|
|
2202
|
+
let x = 0;
|
|
2203
|
+
l === "left" ? x = e + d : l === "right" ? x = e + s - d : x = e + s / 2;
|
|
2204
|
+
const { _text: w, ellipsis: E } = this.handleEllipsis(t, s, d, a);
|
|
2205
|
+
return this.ctx.fillText(w, x, u), this.ctx.restore(), E;
|
|
2160
2206
|
}
|
|
2161
2207
|
handleEllipsis(t, e, i = 0, s = "12px Arial") {
|
|
2162
2208
|
let o = !1, r = t;
|
|
@@ -2165,18 +2211,18 @@ class ge {
|
|
|
2165
2211
|
_text: "",
|
|
2166
2212
|
ellipsis: o
|
|
2167
2213
|
};
|
|
2168
|
-
const
|
|
2169
|
-
if (e <=
|
|
2214
|
+
const a = this.ctx.measureText("...").width;
|
|
2215
|
+
if (e <= a + i * 2)
|
|
2170
2216
|
return {
|
|
2171
2217
|
_text: "",
|
|
2172
2218
|
ellipsis: !0
|
|
2173
2219
|
};
|
|
2174
|
-
const
|
|
2175
|
-
if (
|
|
2220
|
+
const l = this.ctx.measureText(t).width;
|
|
2221
|
+
if (l && l + a >= e - i * 2) {
|
|
2176
2222
|
o = !0;
|
|
2177
2223
|
let h = 0;
|
|
2178
2224
|
for (let d = 0; d < t.length; d++)
|
|
2179
|
-
if (h += this.ctx.measureText(t[d]).width, h >= e - i * 2 -
|
|
2225
|
+
if (h += this.ctx.measureText(t[d]).width, h >= e - i * 2 - a) {
|
|
2180
2226
|
r = t.slice(0, d) + "...";
|
|
2181
2227
|
break;
|
|
2182
2228
|
}
|
|
@@ -2228,8 +2274,11 @@ class Ct {
|
|
|
2228
2274
|
n(this, "MAX_HEIGHT", 1e3);
|
|
2229
2275
|
/** 区域边框圆角 */
|
|
2230
2276
|
n(this, "BORDER_RADIUS", 8);
|
|
2277
|
+
/** 启用偏移高度内部计算表格高度 */
|
|
2231
2278
|
n(this, "ENABLE_OFFSET_HEIGHT", !1);
|
|
2279
|
+
/** 偏移高度 */
|
|
2232
2280
|
n(this, "OFFSET_HEIGHT", 0);
|
|
2281
|
+
/** 表头高度 */
|
|
2233
2282
|
n(this, "HEADER_HEIGHT", 36);
|
|
2234
2283
|
/** 启用头部固定,需要外面实现覆盖层,或者所有表头都要是元素 */
|
|
2235
2284
|
n(this, "ENABLE_HEADER_STICKY", !1);
|
|
@@ -2334,6 +2383,10 @@ class Ct {
|
|
|
2334
2383
|
n(this, "TREE_INDENT", 20);
|
|
2335
2384
|
/** 树形图标大小 */
|
|
2336
2385
|
n(this, "TREE_ICON_SIZE", 20);
|
|
2386
|
+
/**树形划线 */
|
|
2387
|
+
n(this, "TREE_LINE", !1);
|
|
2388
|
+
/** 树形划线颜色 */
|
|
2389
|
+
n(this, "TREE_LINE_COLOR", "#e1e6eb");
|
|
2337
2390
|
/** 启用单点击立马编辑 */
|
|
2338
2391
|
n(this, "ENABLE_EDIT_SINGLE_CLICK", !1);
|
|
2339
2392
|
/** 启用点击选择器编辑 */
|
|
@@ -2467,7 +2520,7 @@ class Ct {
|
|
|
2467
2520
|
Object.keys(this).forEach((e) => {
|
|
2468
2521
|
if (e.endsWith("_COLOR") || e.endsWith("_FONT")) {
|
|
2469
2522
|
const i = `--evt-${e.toLocaleLowerCase().replace(/_/g, "-")}`, s = ce(i);
|
|
2470
|
-
t[e] = s;
|
|
2523
|
+
s && (t[e] = s);
|
|
2471
2524
|
}
|
|
2472
2525
|
}), Object.assign(this, t, this._config);
|
|
2473
2526
|
}
|
|
@@ -2560,15 +2613,15 @@ class we {
|
|
|
2560
2613
|
const i = this.list[e];
|
|
2561
2614
|
let s = i.color, o = i.svg;
|
|
2562
2615
|
if (i.configColorName) {
|
|
2563
|
-
const
|
|
2564
|
-
|
|
2616
|
+
const a = this.ctx.config[i.configColorName];
|
|
2617
|
+
a && (s = a);
|
|
2565
2618
|
}
|
|
2566
2619
|
if (i.configName) {
|
|
2567
|
-
const
|
|
2568
|
-
|
|
2620
|
+
const a = this.ctx.config[i.configName];
|
|
2621
|
+
a && (o = a);
|
|
2569
2622
|
}
|
|
2570
|
-
const r = this.createImageFromSVG(o, s).then((
|
|
2571
|
-
this.icons.set(i.name,
|
|
2623
|
+
const r = this.createImageFromSVG(o, s).then((a) => {
|
|
2624
|
+
this.icons.set(i.name, a);
|
|
2572
2625
|
});
|
|
2573
2626
|
t.push(r);
|
|
2574
2627
|
}
|
|
@@ -2587,18 +2640,18 @@ class we {
|
|
|
2587
2640
|
e && r.querySelectorAll("*").forEach((h) => {
|
|
2588
2641
|
h.setAttribute("fill", e);
|
|
2589
2642
|
});
|
|
2590
|
-
const
|
|
2591
|
-
let
|
|
2643
|
+
const a = new Image();
|
|
2644
|
+
let l = "";
|
|
2592
2645
|
if (i) {
|
|
2593
2646
|
const h = new Blob([new XMLSerializer().serializeToString(r)], {
|
|
2594
2647
|
type: "image/svg+xml"
|
|
2595
2648
|
});
|
|
2596
|
-
|
|
2649
|
+
l = URL.createObjectURL(h);
|
|
2597
2650
|
} else
|
|
2598
|
-
|
|
2599
|
-
return
|
|
2600
|
-
|
|
2601
|
-
h(
|
|
2651
|
+
l = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(r));
|
|
2652
|
+
return a.src = l, new Promise((h, d) => {
|
|
2653
|
+
a.onerror = () => d(new Error("Failed to load image")), a.onload = () => {
|
|
2654
|
+
h(a);
|
|
2602
2655
|
};
|
|
2603
2656
|
});
|
|
2604
2657
|
}
|
|
@@ -2607,8 +2660,8 @@ class we {
|
|
|
2607
2660
|
}
|
|
2608
2661
|
}
|
|
2609
2662
|
class ct extends Xt {
|
|
2610
|
-
constructor(e, i, s, o, r,
|
|
2611
|
-
super(e, s, o, r,
|
|
2663
|
+
constructor(e, i, s, o, r, a, l) {
|
|
2664
|
+
super(e, s, o, r, a, "header", l.fixed);
|
|
2612
2665
|
n(this, "align");
|
|
2613
2666
|
n(this, "hideHeaderSelection", !1);
|
|
2614
2667
|
n(this, "verticalAlign", "middle");
|
|
@@ -2654,7 +2707,7 @@ class ct extends Xt {
|
|
|
2654
2707
|
n(this, "drawSelectionImageHeight", 0);
|
|
2655
2708
|
n(this, "drawSelectionImageName", "");
|
|
2656
2709
|
n(this, "drawSelectionImageSource");
|
|
2657
|
-
this.ctx = e, this.x = s, this.y = o, this.width = r, this.height =
|
|
2710
|
+
this.ctx = e, this.x = s, this.y = o, this.width = r, this.height = a, this.visibleWidth = r, this.visibleHeight = a, this.colIndex = i, this.key = l.key, this.minWidth = l.minWidth, this.maxWidth = l.maxWidth, this.type = l.type || "", this.editorType = l.editorType || "text", this.hideHeaderSelection = l.hideHeaderSelection || !1, this.align = l.headerAlign || l.align || this.ctx.config.COLUMNS_ALIGN, this.verticalAlign = l.headerVerticalAlign || l.verticalAlign || this.ctx.config.COLUMNS_VERTICAL_ALIGN, this.fixed = l.fixed, this.level = l.level || 0, this.operation = l.operation || !1, this.text = l.title, this.column = l, this.colspan = l.colspan || 1, this.widthFillDisable = l.widthFillDisable || !1, this.rowspan = l.rowspan || 1, this.rules = l.rules, this.readonly = l.readonly || !1, this.required = l.required || !1, this.rowKey = Lt(), this.overflowTooltipShow = l.overflowTooltipHeaderShow !== !1, this.hasChildren = l.children && l.children.length > 0 || !1, this.render = l.renderHeader;
|
|
2658
2711
|
}
|
|
2659
2712
|
/**
|
|
2660
2713
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -2674,11 +2727,11 @@ class ct extends Xt {
|
|
|
2674
2727
|
const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
|
|
2675
2728
|
let o = i, r = s;
|
|
2676
2729
|
if (typeof e == "function") {
|
|
2677
|
-
const
|
|
2730
|
+
const a = e, { backgroundColor: l, color: h } = a({
|
|
2678
2731
|
colIndex: this.colIndex,
|
|
2679
2732
|
column: this.column
|
|
2680
2733
|
}) || {};
|
|
2681
|
-
|
|
2734
|
+
l && (o = l), h && (r = h);
|
|
2682
2735
|
}
|
|
2683
2736
|
this.drawCellBgColor = o, this.drawTextColor = r;
|
|
2684
2737
|
}
|
|
@@ -2730,11 +2783,11 @@ class ct extends Xt {
|
|
|
2730
2783
|
return;
|
|
2731
2784
|
const { width: e, height: i, type: s } = this;
|
|
2732
2785
|
if (["index-selection", "selection", "selection-tree", "tree-selection"].includes(s)) {
|
|
2733
|
-
const { indeterminate: o, check: r, selectable:
|
|
2734
|
-
let d = this.drawX + (e -
|
|
2735
|
-
this.drawTextX = d +
|
|
2736
|
-
let
|
|
2737
|
-
o ? (
|
|
2786
|
+
const { indeterminate: o, check: r, selectable: a } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: l = 0, CELL_PADDING: h } = this.ctx.config;
|
|
2787
|
+
let d = this.drawX + (e - l) / 2, f = this.drawY + (i - l) / 2;
|
|
2788
|
+
this.drawTextX = d + l - h / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX, (this.align === "left" || this.align === "right") && (d = this.drawX + h, this.drawTextX = d + l - h / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX), this.verticalAlign === "top" ? f = this.drawY + h / 2 : this.verticalAlign === "bottom" && (f = this.drawY + i - l - h / 2);
|
|
2789
|
+
let u = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck";
|
|
2790
|
+
o ? (u = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : r && a ? (u = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : r && a ? (u = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !r && a ? (u = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (u = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), u && (this.drawSelectionImageX = d, this.drawSelectionImageY = f, this.drawSelectionImageWidth = l, this.drawSelectionImageHeight = l, this.drawSelectionImageName = x, this.drawSelectionImageSource = u, this.ctx.paint.drawImage(
|
|
2738
2791
|
this.drawSelectionImageSource,
|
|
2739
2792
|
this.drawSelectionImageX,
|
|
2740
2793
|
this.drawSelectionImageY,
|
|
@@ -2850,8 +2903,8 @@ class Ee {
|
|
|
2850
2903
|
selectionClick(t, e) {
|
|
2851
2904
|
if (!(["selection", "index-selection", "selection-tree", "tree-selection"].includes(t.type) && this.ctx.isPointer))
|
|
2852
2905
|
return;
|
|
2853
|
-
const { offsetY: s, offsetX: o } = this.ctx.getOffset(e), r = s,
|
|
2854
|
-
if (
|
|
2906
|
+
const { offsetY: s, offsetX: o } = this.ctx.getOffset(e), r = s, a = o;
|
|
2907
|
+
if (a > t.drawSelectionImageX && a < t.drawSelectionImageX + t.drawSelectionImageWidth && r > t.drawSelectionImageY && r < t.drawSelectionImageY + t.drawSelectionImageHeight)
|
|
2855
2908
|
if (t instanceof ct)
|
|
2856
2909
|
t.drawSelectionImageName === "checkbox-uncheck" || t.drawSelectionImageName === "checkbox-indeterminate" ? this.ctx.database.toggleAllSelection() : t.drawSelectionImageName === "checkbox-check" && this.ctx.database.clearSelection(!0);
|
|
2857
2910
|
else {
|
|
@@ -2867,12 +2920,12 @@ class Ee {
|
|
|
2867
2920
|
treeClick(t, e) {
|
|
2868
2921
|
if (!(["tree", "selection-tree", "tree-selection"].includes(t.type) && this.ctx.isPointer))
|
|
2869
2922
|
return;
|
|
2870
|
-
const { offsetY: s, offsetX: o } = this.ctx.getOffset(e), r = s,
|
|
2871
|
-
if (!(
|
|
2923
|
+
const { offsetY: s, offsetX: o } = this.ctx.getOffset(e), r = s, a = o;
|
|
2924
|
+
if (!(a > t.drawTreeImageX && a < t.drawTreeImageX + t.drawTreeImageWidth && r > t.drawTreeImageY && r < t.drawTreeImageY + t.drawTreeImageHeight))
|
|
2872
2925
|
return;
|
|
2873
|
-
const
|
|
2874
|
-
if (f &&
|
|
2875
|
-
typeof
|
|
2926
|
+
const l = this.ctx.database.getRowForRowKey(t.rowKey), { expand: h = !1, expandLazy: d = !1 } = l || {}, { EXPAND_LAZY: f, EXPAND_LAZY_METHOD: u } = this.ctx.config;
|
|
2927
|
+
if (f && u && !h && !d)
|
|
2928
|
+
typeof u == "function" && (this.ctx.database.expandLoading(t.rowKey, !0), u({
|
|
2876
2929
|
row: t.row,
|
|
2877
2930
|
rowIndex: t.rowIndex,
|
|
2878
2931
|
colIndex: t.colIndex,
|
|
@@ -2884,8 +2937,8 @@ class Ee {
|
|
|
2884
2937
|
this.ctx.database.expandLoading(t.rowKey, !1), console.error(w);
|
|
2885
2938
|
}));
|
|
2886
2939
|
else {
|
|
2887
|
-
const
|
|
2888
|
-
this.ctx.database.expandItem(t.rowKey, !
|
|
2940
|
+
const x = this.ctx.database.getIsExpand(t.rowKey);
|
|
2941
|
+
this.ctx.database.expandItem(t.rowKey, !x), this.ctx.emit("expandChange", this.ctx.database.getExpandRowKeys());
|
|
2889
2942
|
}
|
|
2890
2943
|
}
|
|
2891
2944
|
/**
|
|
@@ -2918,16 +2971,16 @@ class Ee {
|
|
|
2918
2971
|
handleBodyEvent(t, e, i, s, o = !1) {
|
|
2919
2972
|
if (this.isInsideBody(e))
|
|
2920
2973
|
for (const r of i) {
|
|
2921
|
-
const
|
|
2922
|
-
for (const
|
|
2923
|
-
const h =
|
|
2974
|
+
const a = r.fixedCells.concat(r.noFixedCells);
|
|
2975
|
+
for (const l of a) {
|
|
2976
|
+
const h = l.getDrawX(), d = l.getDrawY();
|
|
2924
2977
|
if (o) {
|
|
2925
|
-
if (t > h && t < h +
|
|
2926
|
-
s(
|
|
2978
|
+
if (t > h && t < h + l.visibleWidth && e > d && e < d + l.visibleHeight) {
|
|
2979
|
+
s(l);
|
|
2927
2980
|
return;
|
|
2928
2981
|
}
|
|
2929
|
-
} else if (t > h && t < h +
|
|
2930
|
-
s(
|
|
2982
|
+
} else if (t > h && t < h + l.width && e > d && e < d + l.height) {
|
|
2983
|
+
s(l);
|
|
2931
2984
|
return;
|
|
2932
2985
|
}
|
|
2933
2986
|
}
|
|
@@ -2935,8 +2988,8 @@ class Ee {
|
|
|
2935
2988
|
}
|
|
2936
2989
|
handleHeaderEvent(t, e, i, s) {
|
|
2937
2990
|
for (const o of i) {
|
|
2938
|
-
const r = o.getDrawX(),
|
|
2939
|
-
if (t > r && t < r + o.width && e >
|
|
2991
|
+
const r = o.getDrawX(), a = o.getDrawY();
|
|
2992
|
+
if (t > r && t < r + o.width && e > a && e < a + o.height) {
|
|
2940
2993
|
s(o);
|
|
2941
2994
|
return;
|
|
2942
2995
|
}
|
|
@@ -3065,20 +3118,20 @@ class pe {
|
|
|
3065
3118
|
stageElement: s,
|
|
3066
3119
|
canvasElement: o,
|
|
3067
3120
|
overlayerElement: r,
|
|
3068
|
-
editorElement:
|
|
3069
|
-
emptyElement:
|
|
3121
|
+
editorElement: a,
|
|
3122
|
+
emptyElement: l,
|
|
3070
3123
|
contextMenuElement: h
|
|
3071
3124
|
} = t;
|
|
3072
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement =
|
|
3125
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = l, this.contextMenuElement = h, this.config = new Ct(e.config || {}), this.eventBus = new ue(), this.eventBrowser = new xe(this), this.eventTable = new Ee(this), this.paint = new ge(this.canvasElement), this.database = new de(this, e), this.history = new fe(this), this.icons = new we(this);
|
|
3073
3126
|
}
|
|
3074
3127
|
setConfig(t) {
|
|
3075
3128
|
this.config = new Ct(t);
|
|
3076
3129
|
}
|
|
3077
3130
|
setItemValueByEditor(t, e, i, s = !0, o = !0, r = !0) {
|
|
3078
3131
|
if (this.config.ENABLE_MERGE_CELL_LINK) {
|
|
3079
|
-
const
|
|
3080
|
-
if (
|
|
3081
|
-
const { dataList:
|
|
3132
|
+
const a = this.database.getVirtualBodyCellByKey(t, e);
|
|
3133
|
+
if (a && (a.mergeRow || a.mergeCol)) {
|
|
3134
|
+
const { dataList: l } = a.getSpanInfo(), h = l.map((d) => ({ ...d, value: i }));
|
|
3082
3135
|
this.database.batchSetItemValue(h, s, r);
|
|
3083
3136
|
return;
|
|
3084
3137
|
}
|
|
@@ -3089,11 +3142,11 @@ class pe {
|
|
|
3089
3142
|
if (this.config.ENABLE_MERGE_CELL_LINK) {
|
|
3090
3143
|
const s = [];
|
|
3091
3144
|
t.forEach((o) => {
|
|
3092
|
-
const r = this.database.getRowIndexForRowKey(o.rowKey),
|
|
3093
|
-
if (r === void 0 ||
|
|
3094
|
-
const
|
|
3095
|
-
if (
|
|
3096
|
-
const { dataList: h } =
|
|
3145
|
+
const r = this.database.getRowIndexForRowKey(o.rowKey), a = this.database.getColIndexForKey(o.key);
|
|
3146
|
+
if (r === void 0 || a === void 0) return;
|
|
3147
|
+
const l = this.database.getVirtualBodyCell(r, a);
|
|
3148
|
+
if (l) {
|
|
3149
|
+
const { dataList: h } = l.getSpanInfo(), d = h.map((f) => ({ ...f, value: o.value }));
|
|
3097
3150
|
s.push(...d);
|
|
3098
3151
|
}
|
|
3099
3152
|
}), this.database.batchSetItemValue(s, e, i);
|
|
@@ -3137,8 +3190,8 @@ class pe {
|
|
|
3137
3190
|
let s = "";
|
|
3138
3191
|
for (let o = 0; o <= e[1] - e[0]; o++) {
|
|
3139
3192
|
const r = [];
|
|
3140
|
-
for (let
|
|
3141
|
-
const
|
|
3193
|
+
for (let a = 0; a <= i[1] - i[0]; a++) {
|
|
3194
|
+
const l = o + e[0], h = a + i[0], d = this.database.getVirtualBodyCell(l, h);
|
|
3142
3195
|
d && (d.selectorCellValueType === "displayText" ? r.push(d.displayText) : r.push(d.getValue()));
|
|
3143
3196
|
}
|
|
3144
3197
|
s += `${r.join(" ")}\r`, t.push(r);
|
|
@@ -3257,10 +3310,10 @@ class Rt {
|
|
|
3257
3310
|
onMouseMove(t) {
|
|
3258
3311
|
const { offsetX: e, offsetY: i, clientX: s, clientY: o, buttons: r } = t;
|
|
3259
3312
|
if (this.isOnScrollbar(e, i) && t.target === this.ctx.canvasElement ? this.isFocus = !0 : this.isFocus = !1, r === 0 || s == this.clientX && o == this.clientY) return;
|
|
3260
|
-
let
|
|
3261
|
-
if (this.type === "horizontal" ?
|
|
3262
|
-
let
|
|
3263
|
-
this.type === "vertical" ?
|
|
3313
|
+
let a = 0;
|
|
3314
|
+
if (this.type === "horizontal" ? a = s - this.clientX : a = o - this.clientY, this.isDragging && a !== 0) {
|
|
3315
|
+
let l = 0;
|
|
3316
|
+
this.type === "vertical" ? l = this.dragStart + a / (this.visibleDistance - this.barHeight) * this.distance : l = this.dragStart + a / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(l, this.distance));
|
|
3264
3317
|
}
|
|
3265
3318
|
}
|
|
3266
3319
|
isPointInElement(t, e, i, s, o, r) {
|
|
@@ -3285,22 +3338,22 @@ class Rt {
|
|
|
3285
3338
|
header: e,
|
|
3286
3339
|
stageHeight: i,
|
|
3287
3340
|
stageWidth: s,
|
|
3288
|
-
config: { SCROLLER_TRACK_SIZE: o = 0, SCROLLER_SIZE: r = 0, BORDER:
|
|
3289
|
-
} = this.ctx,
|
|
3341
|
+
config: { SCROLLER_TRACK_SIZE: o = 0, SCROLLER_SIZE: r = 0, BORDER: a }
|
|
3342
|
+
} = this.ctx, l = s, h = i, d = e.height, f = e.width, u = t.height, x = this.ctx.footer.height;
|
|
3290
3343
|
if (this.type === "vertical") {
|
|
3291
|
-
this.visibleDistance = h - o - d, this.distance =
|
|
3292
|
-
const w = this.distance ? this.visibleDistance / (
|
|
3344
|
+
this.visibleDistance = h - o - d, this.distance = u - this.visibleDistance + x, this.trackX = l - o, this.trackY = 0, this.splitPoints = [this.trackX, d, this.trackX + o, d], this.trackWidth = o, this.trackHeight = h, this.barX = this.trackX - 1 + (o - r) / 2, this.barWidth = r;
|
|
3345
|
+
const w = this.distance ? this.visibleDistance / (u + x) : 0;
|
|
3293
3346
|
let E = Math.floor(w * this.visibleDistance);
|
|
3294
3347
|
E < 30 ? E = 30 : E > this.visibleDistance && (E = 0), this.barHeight = E, this.barY = d + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3295
3348
|
} else {
|
|
3296
|
-
this.visibleDistance =
|
|
3297
|
-
|
|
3349
|
+
this.visibleDistance = l - o, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
3350
|
+
l - o,
|
|
3298
3351
|
h - o,
|
|
3299
|
-
|
|
3352
|
+
l - o,
|
|
3300
3353
|
h
|
|
3301
3354
|
];
|
|
3302
|
-
const w =
|
|
3303
|
-
this.trackX = 0, this.trackY = h - o + w, this.trackWidth =
|
|
3355
|
+
const w = a ? 0 : 0.5;
|
|
3356
|
+
this.trackX = 0, this.trackY = h - o + w, this.trackWidth = l, this.trackHeight = o;
|
|
3304
3357
|
const E = this.distance ? this.visibleDistance / f : 0;
|
|
3305
3358
|
let g = Math.floor(E * this.visibleDistance);
|
|
3306
3359
|
this.barY = this.trackY - 1 + (o - r) / 2, g < 30 ? g = 30 : g >= this.visibleDistance && (g = 0), this.barWidth = g, this.barHeight = r, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
@@ -3441,23 +3494,23 @@ class ye {
|
|
|
3441
3494
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3442
3495
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3443
3496
|
const s = Mt(i), o = it(i);
|
|
3444
|
-
this.height = t * s, this.width = o.reduce((f,
|
|
3445
|
-
const
|
|
3446
|
-
return w &&
|
|
3497
|
+
this.height = t * s, this.width = o.reduce((f, u) => {
|
|
3498
|
+
const x = u.width || 100, { maxWidth: w, minWidth: E } = u;
|
|
3499
|
+
return w && x > w ? f + w : E && x < E ? f + E : f + x;
|
|
3447
3500
|
}, 0), this.visibleHeight = this.height;
|
|
3448
3501
|
const r = oe(Ht(i, s));
|
|
3449
3502
|
this.columnIndex = 0, this.resizeNum = 0, this.render(r, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3450
|
-
const
|
|
3451
|
-
this.resizeNum > 0 ? this.ctx.stageWidth = Math.floor(
|
|
3452
|
-
const
|
|
3453
|
-
if (this.resizeNum &&
|
|
3454
|
-
const f = Math.floor(
|
|
3503
|
+
const a = this.ctx.containerElement.getBoundingClientRect();
|
|
3504
|
+
this.resizeNum > 0 ? this.ctx.stageWidth = Math.floor(a.width) : this.ctx.stageWidth = Math.floor(this.width + e), this.ctx.stageElement.style.width = this.ctx.stageWidth + "px", this.visibleWidth = this.ctx.stageWidth - e;
|
|
3505
|
+
const l = this.visibleWidth - this.width;
|
|
3506
|
+
if (this.resizeNum && l > 0) {
|
|
3507
|
+
const f = Math.floor(l / this.resizeNum * 100) / 100;
|
|
3455
3508
|
this.resizeAllColumn(f);
|
|
3456
3509
|
}
|
|
3457
3510
|
const h = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
3458
|
-
this.ctx.fixedLeftWidth = h.reduce((f,
|
|
3511
|
+
this.ctx.fixedLeftWidth = h.reduce((f, u) => f + u.width, 0);
|
|
3459
3512
|
const d = this.fixedRightCellHeaders.filter((f) => !f.hasChildren);
|
|
3460
|
-
this.ctx.fixedRightWidth = d.reduce((f,
|
|
3513
|
+
this.ctx.fixedRightWidth = d.reduce((f, u) => f + u.width, e), this.ctx.maxColIndex = this.leafCellHeaders.length - 1, this.ctx.header.x = this.x, this.ctx.header.y = this.y, this.ctx.header.width = this.width, this.ctx.header.height = this.height, this.ctx.header.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
|
|
3461
3514
|
}
|
|
3462
3515
|
// 调整表头的宽度
|
|
3463
3516
|
initResizeColumn() {
|
|
@@ -3475,9 +3528,9 @@ class ye {
|
|
|
3475
3528
|
config: { RESIZE_COLUMN_MIN_WIDTH: s }
|
|
3476
3529
|
} = this.ctx;
|
|
3477
3530
|
if (this.isResizing && this.resizeTarget) {
|
|
3478
|
-
const o = this.resizeTarget.width, r = this.resizeTarget.minWidth,
|
|
3479
|
-
let
|
|
3480
|
-
|
|
3531
|
+
const o = this.resizeTarget.width, r = this.resizeTarget.minWidth, a = this.resizeTarget.maxWidth;
|
|
3532
|
+
let l = e.clientX - this.clientX;
|
|
3533
|
+
l + o < s && (l = -(o - s)), r && l + o < r && (l = -(o - r)), a && l + o > a && (l = a - o), this.resizeDiff = l, this.ctx.emit("draw");
|
|
3481
3534
|
} else {
|
|
3482
3535
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
3483
3536
|
return;
|
|
@@ -3488,9 +3541,9 @@ class ye {
|
|
|
3488
3541
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3489
3542
|
const o = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
3490
3543
|
for (const r of o) {
|
|
3491
|
-
const { offsetX:
|
|
3544
|
+
const { offsetX: a, offsetY: l } = this.ctx.getOffset(e), h = a, d = r.getDrawX();
|
|
3492
3545
|
h > d + r.width - 5 && h < d + r.width + 4 && h < i - 4 && // 视窗中最后一列不允许调整宽
|
|
3493
|
-
r.colspan <= 1 && this.ctx.isTarget(e) &&
|
|
3546
|
+
r.colspan <= 1 && this.ctx.isTarget(e) && l <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = r);
|
|
3494
3547
|
}
|
|
3495
3548
|
}
|
|
3496
3549
|
}));
|
|
@@ -3499,8 +3552,8 @@ class ye {
|
|
|
3499
3552
|
const i = (o) => {
|
|
3500
3553
|
o.forEach((r) => {
|
|
3501
3554
|
if (r.children && r.children.length > 0 && i(r.children), r.key === t.key) {
|
|
3502
|
-
const
|
|
3503
|
-
r.width =
|
|
3555
|
+
const a = r.width || 100;
|
|
3556
|
+
r.width = a + e;
|
|
3504
3557
|
}
|
|
3505
3558
|
});
|
|
3506
3559
|
};
|
|
@@ -3544,11 +3597,11 @@ class ye {
|
|
|
3544
3597
|
let s = e;
|
|
3545
3598
|
const { HEADER_HEIGHT: o = 0 } = this.ctx.config;
|
|
3546
3599
|
for (let r = 0; r < i; r++) {
|
|
3547
|
-
const
|
|
3548
|
-
let { minWidth: d, maxWidth: f } =
|
|
3549
|
-
d &&
|
|
3550
|
-
const
|
|
3551
|
-
this.ctx.database.setHeader(
|
|
3600
|
+
const a = t[r], l = o * (a.rowspan || 0), h = o * (a.level || 0);
|
|
3601
|
+
let { minWidth: d, maxWidth: f } = a, u = a.width || 100;
|
|
3602
|
+
d && u < d && (u = d), f && u > f && (u = f), a.children && (u = it(a.children).reduce((E, g) => E + ((g == null ? void 0 : g.width) || 100), 0));
|
|
3603
|
+
const x = new ct(this.ctx, this.columnIndex, s, h, u, l, a);
|
|
3604
|
+
this.ctx.database.setHeader(a.key, x), this.allCellHeaders.push(x), a.children || (this.leafCellHeaders.push(x), x.column.widthFillDisable || this.resizeNum++), a.fixed === "left" ? this.fixedLeftCellHeaders.push(x) : a.fixed === "right" ? this.fixedRightCellHeaders.push(x) : this.centerCellHeaders.push(x), !a.children && this.columnIndex++, a.children && this.render(a.children, s), s += u;
|
|
3552
3605
|
}
|
|
3553
3606
|
}
|
|
3554
3607
|
drawTipLine() {
|
|
@@ -3570,7 +3623,7 @@ class ye {
|
|
|
3570
3623
|
scrollX: i,
|
|
3571
3624
|
header: s,
|
|
3572
3625
|
stageWidth: o,
|
|
3573
|
-
config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE:
|
|
3626
|
+
config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE: a }
|
|
3574
3627
|
} = this.ctx;
|
|
3575
3628
|
if (i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, this.y, t, this.height, {
|
|
3576
3629
|
fillColor: r,
|
|
@@ -3578,9 +3631,9 @@ class ye {
|
|
|
3578
3631
|
shadowWidth: 4,
|
|
3579
3632
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3580
3633
|
colorEnd: "rgba(0,0,0,0)"
|
|
3581
|
-
}), i < Math.floor(s.width - o - 1) && e !==
|
|
3582
|
-
const
|
|
3583
|
-
this.ctx.paint.drawShadow(
|
|
3634
|
+
}), i < Math.floor(s.width - o - 1) && e !== a) {
|
|
3635
|
+
const l = s.width - (this.x + this.width) + o - e;
|
|
3636
|
+
this.ctx.paint.drawShadow(l, this.y, e, this.height, {
|
|
3584
3637
|
fillColor: r,
|
|
3585
3638
|
side: "left",
|
|
3586
3639
|
shadowWidth: 4,
|
|
@@ -3621,8 +3674,8 @@ class ye {
|
|
|
3621
3674
|
}), this.drawTipLine(), this.drawBottomLine();
|
|
3622
3675
|
}
|
|
3623
3676
|
}
|
|
3624
|
-
class
|
|
3625
|
-
constructor(t, e, i = 0, s = 0, o = 0, r = 0,
|
|
3677
|
+
class Nt {
|
|
3678
|
+
constructor(t, e, i = 0, s = 0, o = 0, r = 0, a, l = "body") {
|
|
3626
3679
|
n(this, "ctx");
|
|
3627
3680
|
n(this, "x", 0);
|
|
3628
3681
|
n(this, "y", 0);
|
|
@@ -3635,7 +3688,7 @@ class Bt {
|
|
|
3635
3688
|
n(this, "rowKey", "");
|
|
3636
3689
|
n(this, "rowType", "body");
|
|
3637
3690
|
n(this, "data");
|
|
3638
|
-
this.ctx = t, this.x = i, this.y = s, this.width = o, this.height = r, this.rowIndex = e, this.rowKey = t.database.getRowKeyForRowIndex(e) || "", this.rowType =
|
|
3691
|
+
this.ctx = t, this.x = i, this.y = s, this.width = o, this.height = r, this.rowIndex = e, this.rowKey = t.database.getRowKeyForRowIndex(e) || "", this.rowType = l, this.data = a, this.update();
|
|
3639
3692
|
}
|
|
3640
3693
|
update() {
|
|
3641
3694
|
const { header: t } = this.ctx, e = [], i = [], s = [];
|
|
@@ -3712,32 +3765,32 @@ class Ce {
|
|
|
3712
3765
|
config: {
|
|
3713
3766
|
FOOTER_FIXED: o,
|
|
3714
3767
|
SCROLLER_TRACK_SIZE: r = 0,
|
|
3715
|
-
HEIGHT:
|
|
3716
|
-
EMPTY_BODY_HEIGHT:
|
|
3768
|
+
HEIGHT: a,
|
|
3769
|
+
EMPTY_BODY_HEIGHT: l = 0,
|
|
3717
3770
|
MAX_HEIGHT: h = 0,
|
|
3718
3771
|
ENABLE_OFFSET_HEIGHT: d = 0,
|
|
3719
3772
|
OFFSET_HEIGHT: f = 0,
|
|
3720
|
-
FOOTER_POSITION:
|
|
3773
|
+
FOOTER_POSITION: u
|
|
3721
3774
|
}
|
|
3722
3775
|
} = this.ctx;
|
|
3723
3776
|
if (!e.width)
|
|
3724
3777
|
return;
|
|
3725
|
-
this.x = 0,
|
|
3726
|
-
const { data:
|
|
3727
|
-
this.height = w, this.data =
|
|
3778
|
+
this.x = 0, u === "top" && o ? this.y = e.height + i.height : this.y = e.height;
|
|
3779
|
+
const { data: x, sumHeight: w } = s.getData();
|
|
3780
|
+
this.height = w, this.data = x, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - r;
|
|
3728
3781
|
const E = this.ctx.footer.height;
|
|
3729
|
-
!this.data.length && !
|
|
3782
|
+
!this.data.length && !a ? this.height = l : !this.data.length && a && (this.height = a - e.height - E - r);
|
|
3730
3783
|
let g = this.height + e.height + r;
|
|
3731
3784
|
g += E;
|
|
3732
3785
|
let p = g;
|
|
3733
|
-
const
|
|
3734
|
-
if (
|
|
3735
|
-
const O =
|
|
3786
|
+
const y = window.innerHeight, { top: m } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
3787
|
+
if (y > m && d && !a) {
|
|
3788
|
+
const O = y - m - f;
|
|
3736
3789
|
O > e.height + r ? p = O : g > h && (p = h);
|
|
3737
|
-
} else this.data.length &&
|
|
3790
|
+
} else this.data.length && a ? p = a : this.data.length && h && g > h && (p = h);
|
|
3738
3791
|
p > 0 && (this.ctx.stageHeight = Math.floor(p), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
|
|
3739
3792
|
let b = this.ctx.stageHeight - e.height - r;
|
|
3740
|
-
o ? this.visibleHeight = b - E : this.visibleHeight = b, this.data.length || (this.height = this.visibleHeight), this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data =
|
|
3793
|
+
o ? this.visibleHeight = b - E : this.visibleHeight = b, this.data.length || (this.height = this.visibleHeight), this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = x;
|
|
3741
3794
|
const C = window.devicePixelRatio || 1, I = this.ctx.stageWidth * C, _ = this.ctx.stageHeight * C;
|
|
3742
3795
|
t.width = Math.round(I), t.height = Math.round(_);
|
|
3743
3796
|
const T = this.data.length ? "not-empty" : "empty";
|
|
@@ -3748,7 +3801,7 @@ class Ce {
|
|
|
3748
3801
|
bodyHeight: this.height,
|
|
3749
3802
|
footerHeight: E,
|
|
3750
3803
|
width: this.width,
|
|
3751
|
-
height: this.data.length ? 0 :
|
|
3804
|
+
height: this.data.length ? 0 : l + E
|
|
3752
3805
|
});
|
|
3753
3806
|
const v = Math.round(t.width / C * 1e4) / 1e4, R = Math.round(t.height / C * 1e4) / 1e4;
|
|
3754
3807
|
this.ctx.canvasElement.setAttribute("style", `height:${R}px;width:${v}px;`), this.ctx.paint.scale(C);
|
|
@@ -3770,15 +3823,15 @@ class Ce {
|
|
|
3770
3823
|
this.ctx.isTarget(e) && (this.clientY = e.clientY, this.resizeTarget ? (this.isResizing = !0, this.ctx.rowResizing = !0) : (this.isResizing = !1, this.ctx.rowResizing = !1), this.isMouseDown = !0);
|
|
3771
3824
|
}), this.ctx.on("mousemove", (e) => {
|
|
3772
3825
|
if (this.ctx.editing) return;
|
|
3773
|
-
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), o = i, r = s,
|
|
3774
|
-
stageHeight:
|
|
3826
|
+
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), o = i, r = s, a = e.clientY, {
|
|
3827
|
+
stageHeight: l,
|
|
3775
3828
|
scrollY: h,
|
|
3776
3829
|
config: { RESIZE_ROW_MIN_HEIGHT: d = 0 }
|
|
3777
3830
|
} = this.ctx;
|
|
3778
3831
|
if (this.isResizing && this.resizeTarget) {
|
|
3779
3832
|
const f = this.resizeTarget.height;
|
|
3780
|
-
let
|
|
3781
|
-
|
|
3833
|
+
let u = a - this.clientY;
|
|
3834
|
+
u + f < d && (u = -(f - d)), this.resizeDiff = u, this.ctx.emit("draw");
|
|
3782
3835
|
} else {
|
|
3783
3836
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
3784
3837
|
return;
|
|
@@ -3790,11 +3843,11 @@ class Ce {
|
|
|
3790
3843
|
return;
|
|
3791
3844
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3792
3845
|
for (let f = 0; f < this.renderRows.length; f++) {
|
|
3793
|
-
const
|
|
3794
|
-
if (o >
|
|
3795
|
-
for (let w = 0; w <
|
|
3796
|
-
const E =
|
|
3797
|
-
r > E.drawX + 10 && r < E.drawX + E.width - 10 && E.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget =
|
|
3846
|
+
const u = this.renderRows[f];
|
|
3847
|
+
if (o > u.y - h + u.height - 1.5 && o < u.y - h + u.height + 1.5 && o < l - 4)
|
|
3848
|
+
for (let w = 0; w < u.cells.length; w++) {
|
|
3849
|
+
const E = u.cells[w];
|
|
3850
|
+
r > E.drawX + 10 && r < E.drawX + E.width - 10 && E.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = u);
|
|
3798
3851
|
}
|
|
3799
3852
|
}
|
|
3800
3853
|
}
|
|
@@ -3817,8 +3870,8 @@ class Ce {
|
|
|
3817
3870
|
stageWidth: t,
|
|
3818
3871
|
scrollY: e,
|
|
3819
3872
|
config: { RESIZE_ROW_LINE_COLOR: i }
|
|
3820
|
-
} = this.ctx, s = this.resizeTarget.y - e, o = this.resizeTarget.height, r = s + o + this.resizeDiff - 0.5,
|
|
3821
|
-
this.ctx.paint.drawLine(
|
|
3873
|
+
} = this.ctx, s = this.resizeTarget.y - e, o = this.resizeTarget.height, r = s + o + this.resizeDiff - 0.5, a = [0, r - 0.5, t, r - 0.5];
|
|
3874
|
+
this.ctx.paint.drawLine(a, {
|
|
3822
3875
|
borderColor: i,
|
|
3823
3876
|
borderWidth: 1
|
|
3824
3877
|
});
|
|
@@ -3831,7 +3884,7 @@ class Ce {
|
|
|
3831
3884
|
scrollX: i,
|
|
3832
3885
|
header: s,
|
|
3833
3886
|
stageWidth: o,
|
|
3834
|
-
config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE:
|
|
3887
|
+
config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE: a }
|
|
3835
3888
|
} = this.ctx;
|
|
3836
3889
|
if (i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, this.y, t, this.height, {
|
|
3837
3890
|
fillColor: r,
|
|
@@ -3839,9 +3892,9 @@ class Ce {
|
|
|
3839
3892
|
shadowWidth: 4,
|
|
3840
3893
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3841
3894
|
colorEnd: "rgba(0,0,0,0)"
|
|
3842
|
-
}), i < Math.floor(s.width - o - 1) && e !==
|
|
3843
|
-
const
|
|
3844
|
-
this.ctx.paint.drawShadow(
|
|
3895
|
+
}), i < Math.floor(s.width - o - 1) && e !== a) {
|
|
3896
|
+
const l = s.width - (this.x + this.width) + o - e;
|
|
3897
|
+
this.ctx.paint.drawShadow(l, this.y, e, this.height, {
|
|
3845
3898
|
fillColor: r,
|
|
3846
3899
|
side: "left",
|
|
3847
3900
|
shadowWidth: 4,
|
|
@@ -3853,10 +3906,10 @@ class Ce {
|
|
|
3853
3906
|
binarySearch(t, e) {
|
|
3854
3907
|
let i = 0, s = t.length - 1, o = -1;
|
|
3855
3908
|
for (; i <= s; ) {
|
|
3856
|
-
let r = Math.floor((i + s) / 2),
|
|
3857
|
-
if (
|
|
3909
|
+
let r = Math.floor((i + s) / 2), a = t[r].bottom;
|
|
3910
|
+
if (a === e)
|
|
3858
3911
|
return r;
|
|
3859
|
-
|
|
3912
|
+
a < e ? i = r + 1 : (o = r, s = r - 1);
|
|
3860
3913
|
}
|
|
3861
3914
|
return o;
|
|
3862
3915
|
}
|
|
@@ -3867,17 +3920,17 @@ class Ce {
|
|
|
3867
3920
|
database: e,
|
|
3868
3921
|
scrollY: i,
|
|
3869
3922
|
config: { CELL_HEIGHT: s }
|
|
3870
|
-
} = this.ctx, o = i, { data: r, positions:
|
|
3923
|
+
} = this.ctx, o = i, { data: r, positions: a } = e.getData();
|
|
3871
3924
|
this.ctx.maxRowIndex = r.length - 1;
|
|
3872
|
-
let
|
|
3873
|
-
if (h === -1 && (h = this.ctx.maxRowIndex),
|
|
3925
|
+
let l = this.binarySearch(a, o), h = this.binarySearch(a, o + this.visibleHeight);
|
|
3926
|
+
if (h === -1 && (h = this.ctx.maxRowIndex), l === -1 && h === this.ctx.maxRowIndex) {
|
|
3874
3927
|
const f = Math.floor(this.visibleHeight / s);
|
|
3875
|
-
|
|
3928
|
+
l = this.ctx.maxRowIndex - f;
|
|
3876
3929
|
}
|
|
3877
|
-
this.headIndex = Math.max(0,
|
|
3930
|
+
this.headIndex = Math.max(0, l), this.tailIndex = Math.min(this.ctx.maxRowIndex, h + 1), this.visibleRows = r.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
|
|
3878
3931
|
const d = [];
|
|
3879
3932
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
3880
|
-
const
|
|
3933
|
+
const u = this.headIndex + f, x = this.visibleRows[f], { height: w, top: E } = this.ctx.database.getPositionForRowIndex(u), g = new Nt(this.ctx, u, 0, E + this.y, t.width, w, x);
|
|
3881
3934
|
d.push(g);
|
|
3882
3935
|
}
|
|
3883
3936
|
this.renderRows = d, this.ctx.body.renderRows = d;
|
|
@@ -3914,7 +3967,7 @@ class be {
|
|
|
3914
3967
|
body: e,
|
|
3915
3968
|
config: { CELL_FOOTER_HEIGHT: i, FOOTER_FIXED: s, SCROLLER_TRACK_SIZE: o, FOOTER_POSITION: r }
|
|
3916
3969
|
} = this.ctx;
|
|
3917
|
-
this.width = t.width, this.visibleWidth = t.visibleWidth, this.height = this.data.reduce((
|
|
3970
|
+
this.width = t.width, this.visibleWidth = t.visibleWidth, this.height = this.data.reduce((a) => a + i, 0), this.visibleHeight = this.height, s ? r === "top" ? this.y = this.ctx.header.height : this.y = this.ctx.stageHeight - this.height - o : this.y = e.y + e.height, this.ctx.footer.x = this.x, this.ctx.footer.y = this.y, this.ctx.footer.height = this.height, this.ctx.footer.width = this.width, this.ctx.footer.visibleWidth = this.visibleWidth, this.ctx.footer.visibleHeight = this.visibleHeight;
|
|
3918
3971
|
}
|
|
3919
3972
|
drawFixedShadow() {
|
|
3920
3973
|
const {
|
|
@@ -3923,18 +3976,18 @@ class be {
|
|
|
3923
3976
|
scrollX: i,
|
|
3924
3977
|
header: s,
|
|
3925
3978
|
stageWidth: o,
|
|
3926
|
-
config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE:
|
|
3979
|
+
config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE: a }
|
|
3927
3980
|
} = this.ctx;
|
|
3928
|
-
let
|
|
3929
|
-
if (this.ctx.config.FOOTER_FIXED || (
|
|
3981
|
+
let l = this.y;
|
|
3982
|
+
if (this.ctx.config.FOOTER_FIXED || (l = this.y - this.ctx.scrollY), i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, l, t, this.height, {
|
|
3930
3983
|
fillColor: r,
|
|
3931
3984
|
side: "right",
|
|
3932
3985
|
shadowWidth: 4,
|
|
3933
3986
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3934
3987
|
colorEnd: "rgba(0,0,0,0)"
|
|
3935
|
-
}), i < Math.floor(s.width - o - 1) && e !==
|
|
3988
|
+
}), i < Math.floor(s.width - o - 1) && e !== a) {
|
|
3936
3989
|
const h = s.width - (this.x + this.width) + o - e;
|
|
3937
|
-
this.ctx.paint.drawShadow(h,
|
|
3990
|
+
this.ctx.paint.drawShadow(h, l, e, this.height, {
|
|
3938
3991
|
fillColor: r,
|
|
3939
3992
|
side: "left",
|
|
3940
3993
|
shadowWidth: 4,
|
|
@@ -3949,7 +4002,7 @@ class be {
|
|
|
3949
4002
|
let e = this.y;
|
|
3950
4003
|
const i = [];
|
|
3951
4004
|
this.data.forEach((s, o) => {
|
|
3952
|
-
const r = new
|
|
4005
|
+
const r = new Nt(this.ctx, o, 0, e, this.width, t, s, "footer");
|
|
3953
4006
|
e += t, i.push(r);
|
|
3954
4007
|
}), this.renderRows = i, this.ctx.footer.renderRows = this.renderRows;
|
|
3955
4008
|
}
|
|
@@ -4081,31 +4134,31 @@ class Re {
|
|
|
4081
4134
|
const { ENABLE_SELECTOR_SPAN_COL: i, ENABLE_SELECTOR_SPAN_ROW: s } = this.ctx.config;
|
|
4082
4135
|
let o = t, r = e;
|
|
4083
4136
|
if (!s) {
|
|
4084
|
-
const [
|
|
4085
|
-
r = [
|
|
4137
|
+
const [a] = r;
|
|
4138
|
+
r = [a, a];
|
|
4086
4139
|
}
|
|
4087
4140
|
if (!i) {
|
|
4088
|
-
const [
|
|
4089
|
-
o = [
|
|
4141
|
+
const [a] = o;
|
|
4142
|
+
o = [a, a];
|
|
4090
4143
|
}
|
|
4091
4144
|
if (JSON.stringify(this.ctx.selector.xArr) !== JSON.stringify(o) || JSON.stringify(this.ctx.selector.yArr) !== JSON.stringify(r)) {
|
|
4092
4145
|
this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0;
|
|
4093
4146
|
const {
|
|
4094
|
-
SELECTOR_AREA_MIN_X:
|
|
4095
|
-
SELECTOR_AREA_MAX_X:
|
|
4147
|
+
SELECTOR_AREA_MIN_X: a,
|
|
4148
|
+
SELECTOR_AREA_MAX_X: l,
|
|
4096
4149
|
SELECTOR_AREA_MIN_Y: h,
|
|
4097
4150
|
SELECTOR_AREA_MAX_Y: d,
|
|
4098
4151
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
4099
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4100
|
-
} = this.ctx.config,
|
|
4101
|
-
let [p,
|
|
4102
|
-
if (p <
|
|
4152
|
+
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
4153
|
+
} = this.ctx.config, x = a, w = l || this.ctx.maxColIndex - f, E = h, g = d || this.ctx.maxRowIndex - u;
|
|
4154
|
+
let [p, y] = o, [m, b] = r;
|
|
4155
|
+
if (p < x || y > w || m < E || b > g)
|
|
4103
4156
|
return;
|
|
4104
4157
|
if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
4105
4158
|
const I = this.adjustMergeCells(o, r);
|
|
4106
|
-
|
|
4159
|
+
m = I.yArr[0], b = I.yArr[1], p = I.xArr[0], y = I.xArr[1], this.ctx.onlyMergeCell = I.onlyMergeCell;
|
|
4107
4160
|
}
|
|
4108
|
-
p ===
|
|
4161
|
+
p === y && m === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, o = [Math.max(x, p), Math.min(w, y)], r = [Math.max(E, m), Math.min(g, b)];
|
|
4109
4162
|
const { BEFORE_SET_SELECTOR_METHOD: C } = this.ctx.config;
|
|
4110
4163
|
if (typeof C == "function") {
|
|
4111
4164
|
const _ = C({
|
|
@@ -4123,40 +4176,40 @@ class Re {
|
|
|
4123
4176
|
adjustMergeCells(t, e) {
|
|
4124
4177
|
var w;
|
|
4125
4178
|
const [i, s] = e, [o, r] = t;
|
|
4126
|
-
let
|
|
4179
|
+
let a = [], l = [];
|
|
4127
4180
|
for (let E = 0; E <= e[1] - e[0]; E++)
|
|
4128
4181
|
for (let g = 0; g <= t[1] - t[0]; g++) {
|
|
4129
|
-
const p = E + e[0],
|
|
4130
|
-
|
|
4182
|
+
const p = E + e[0], y = g + t[0], m = this.ctx.database.getVirtualBodyCell(p, y);
|
|
4183
|
+
m && ((p === i || p === s) && a.push(m), (y === o || y === r) && l.push(m));
|
|
4131
4184
|
}
|
|
4132
|
-
const h =
|
|
4185
|
+
const h = a.reduce(
|
|
4133
4186
|
(E, g) => {
|
|
4134
|
-
const { yArr: p } = g.getSpanInfo(), [
|
|
4135
|
-
return E.minY = Math.min(E.minY,
|
|
4187
|
+
const { yArr: p } = g.getSpanInfo(), [y, m] = p;
|
|
4188
|
+
return E.minY = Math.min(E.minY, y), E.maxY = Math.max(E.maxY, m), E;
|
|
4136
4189
|
},
|
|
4137
4190
|
{
|
|
4138
4191
|
minY: i,
|
|
4139
4192
|
maxY: s
|
|
4140
4193
|
}
|
|
4141
|
-
), d =
|
|
4194
|
+
), d = l.reduce(
|
|
4142
4195
|
(E, g) => {
|
|
4143
|
-
const { xArr: p } = g.getSpanInfo(), [
|
|
4144
|
-
return E.minX = Math.min(E.minX,
|
|
4196
|
+
const { xArr: p } = g.getSpanInfo(), [y, m] = p;
|
|
4197
|
+
return E.minX = Math.min(E.minX, y), E.maxX = Math.max(E.maxX, m), E;
|
|
4145
4198
|
},
|
|
4146
4199
|
{
|
|
4147
4200
|
minX: o,
|
|
4148
4201
|
maxX: r
|
|
4149
4202
|
}
|
|
4150
|
-
), f = [d.minX, d.maxX],
|
|
4151
|
-
let
|
|
4203
|
+
), f = [d.minX, d.maxX], u = [h.minY, h.maxY];
|
|
4204
|
+
let x = !1;
|
|
4152
4205
|
if (d.minX !== d.maxX || h.minY !== h.maxY) {
|
|
4153
|
-
const E = JSON.stringify(f) + JSON.stringify(
|
|
4154
|
-
|
|
4206
|
+
const E = JSON.stringify(f) + JSON.stringify(u), g = (w = this.ctx.focusCell) == null ? void 0 : w.getSpanInfo();
|
|
4207
|
+
x = (g && JSON.stringify(g.xArr) + JSON.stringify(g.yArr)) === E;
|
|
4155
4208
|
}
|
|
4156
4209
|
return {
|
|
4157
4210
|
xArr: f,
|
|
4158
|
-
yArr:
|
|
4159
|
-
onlyMergeCell:
|
|
4211
|
+
yArr: u,
|
|
4212
|
+
onlyMergeCell: x
|
|
4160
4213
|
};
|
|
4161
4214
|
}
|
|
4162
4215
|
selectCols(t) {
|
|
@@ -4168,17 +4221,17 @@ class Re {
|
|
|
4168
4221
|
}
|
|
4169
4222
|
const { SELECTOR_AREA_MIN_Y: e, SELECTOR_AREA_MAX_Y: i, SELECTOR_AREA_MAX_Y_OFFSET: s } = this.ctx.config, o = e, r = i || this.ctx.maxRowIndex - s;
|
|
4170
4223
|
if (this.ctx.mousedown && this.ctx.focusCellHeader) {
|
|
4171
|
-
const { colIndex:
|
|
4172
|
-
if (this.ctx.clearSelector(), t.colIndex >=
|
|
4173
|
-
const
|
|
4174
|
-
this.setSelector(
|
|
4224
|
+
const { colIndex: a } = this.ctx.focusCellHeader;
|
|
4225
|
+
if (this.ctx.clearSelector(), t.colIndex >= a) {
|
|
4226
|
+
const l = [a, t.colIndex + t.colspan - 1], h = [o, r];
|
|
4227
|
+
this.setSelector(l, h);
|
|
4175
4228
|
} else {
|
|
4176
|
-
const
|
|
4177
|
-
this.setSelector(
|
|
4229
|
+
const l = [t.colIndex, a], h = [o, r];
|
|
4230
|
+
this.setSelector(l, h);
|
|
4178
4231
|
}
|
|
4179
4232
|
} else {
|
|
4180
|
-
const
|
|
4181
|
-
this.setSelector(
|
|
4233
|
+
const a = [t.colIndex, t.colIndex + t.colspan - 1], l = [o, r];
|
|
4234
|
+
this.setSelector(a, l);
|
|
4182
4235
|
}
|
|
4183
4236
|
}
|
|
4184
4237
|
selectAll() {
|
|
@@ -4191,28 +4244,28 @@ class Re {
|
|
|
4191
4244
|
SELECTOR_AREA_MAX_X: s,
|
|
4192
4245
|
SELECTOR_AREA_MIN_Y: o,
|
|
4193
4246
|
SELECTOR_AREA_MAX_Y: r,
|
|
4194
|
-
SELECTOR_AREA_MAX_X_OFFSET:
|
|
4195
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4196
|
-
} = this.ctx.config, h = i, d = s || this.ctx.maxColIndex -
|
|
4197
|
-
this.setSelector(
|
|
4247
|
+
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
4248
|
+
SELECTOR_AREA_MAX_Y_OFFSET: l
|
|
4249
|
+
} = this.ctx.config, h = i, d = s || this.ctx.maxColIndex - a, f = o, u = r || this.ctx.maxRowIndex - l, x = [h, d], w = [f, u];
|
|
4250
|
+
this.setSelector(x, w);
|
|
4198
4251
|
}
|
|
4199
4252
|
}
|
|
4200
4253
|
selectRows(t, e = !0) {
|
|
4201
4254
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE || !this.ctx.config.ENABLE_SELECTOR_ALL_COLS || this.ctx.autofillMove || this.ctx.editing)
|
|
4202
4255
|
return;
|
|
4203
|
-
const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MAX_X_OFFSET: o } = this.ctx.config, r = s || this.ctx.maxColIndex - o,
|
|
4256
|
+
const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MAX_X_OFFSET: o } = this.ctx.config, r = s || this.ctx.maxColIndex - o, a = i;
|
|
4204
4257
|
if (e) {
|
|
4205
4258
|
this.ctx.setFocusCell(t);
|
|
4206
|
-
const
|
|
4207
|
-
this.setSelector(
|
|
4259
|
+
const l = [a, r], h = [t.rowIndex, t.rowIndex];
|
|
4260
|
+
this.setSelector(l, h);
|
|
4208
4261
|
}
|
|
4209
4262
|
if (this.ctx.focusCell && this.ctx.mousedown) {
|
|
4210
|
-
const { rowIndex:
|
|
4211
|
-
if (t.rowIndex >=
|
|
4212
|
-
const h = [
|
|
4263
|
+
const { rowIndex: l } = this.ctx.focusCell;
|
|
4264
|
+
if (t.rowIndex >= l) {
|
|
4265
|
+
const h = [a, r], d = [l, t.rowIndex];
|
|
4213
4266
|
this.setSelector(h, d);
|
|
4214
4267
|
} else {
|
|
4215
|
-
const h = [
|
|
4268
|
+
const h = [a, r], d = [t.rowIndex, l];
|
|
4216
4269
|
this.setSelector(h, d);
|
|
4217
4270
|
}
|
|
4218
4271
|
}
|
|
@@ -4222,7 +4275,7 @@ class Re {
|
|
|
4222
4275
|
return;
|
|
4223
4276
|
const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
|
|
4224
4277
|
if (t && e && i) {
|
|
4225
|
-
const { rowIndex: s, colIndex: o } = e, r = Math.min(i.colIndex, o),
|
|
4278
|
+
const { rowIndex: s, colIndex: o } = e, r = Math.min(i.colIndex, o), a = Math.max(i.colIndex, o), l = Math.min(i.rowIndex, s), h = Math.max(i.rowIndex, s), d = [r, a], f = [l, h];
|
|
4226
4279
|
this.setSelector(d, f);
|
|
4227
4280
|
}
|
|
4228
4281
|
}
|
|
@@ -4232,8 +4285,8 @@ class Re {
|
|
|
4232
4285
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
4233
4286
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
|
|
4234
4287
|
return;
|
|
4235
|
-
const { colIndex: s, rowIndex: o } = i, { colIndex: r, rowIndex:
|
|
4236
|
-
this.setSelector(
|
|
4288
|
+
const { colIndex: s, rowIndex: o } = i, { colIndex: r, rowIndex: a } = e, l = Math.min(r, s), h = Math.max(r, s), d = Math.min(a, o), f = Math.max(a, o), u = [l, h], x = [d, f];
|
|
4289
|
+
this.setSelector(u, x);
|
|
4237
4290
|
} else {
|
|
4238
4291
|
this.ctx.emit("cellSelectedClick", e);
|
|
4239
4292
|
const s = [e.colIndex, e.colIndex], o = [e.rowIndex, e.rowIndex];
|
|
@@ -4275,17 +4328,17 @@ class Re {
|
|
|
4275
4328
|
}
|
|
4276
4329
|
const { BEFORE_COPY_METHOD: s } = this.ctx.config;
|
|
4277
4330
|
if (typeof s == "function") {
|
|
4278
|
-
const
|
|
4331
|
+
const a = s({
|
|
4279
4332
|
focusCell: this.ctx.focusCell,
|
|
4280
4333
|
data: t,
|
|
4281
4334
|
xArr: e,
|
|
4282
4335
|
yArr: i
|
|
4283
4336
|
});
|
|
4284
|
-
if (!
|
|
4337
|
+
if (!a)
|
|
4285
4338
|
return;
|
|
4286
|
-
t =
|
|
4339
|
+
t = a.data;
|
|
4287
4340
|
}
|
|
4288
|
-
const o =
|
|
4341
|
+
const o = ae(t);
|
|
4289
4342
|
navigator.clipboard ? navigator.clipboard.writeText(o).then(() => {
|
|
4290
4343
|
this.ctx.selector.xArrCopy = this.ctx.selector.xArr.slice(), this.ctx.selector.yArrCopy = this.ctx.selector.yArr.slice(), this.ctx.emit("copyChange", {
|
|
4291
4344
|
xArr: this.ctx.selector.xArrCopy,
|
|
@@ -4297,13 +4350,13 @@ class Re {
|
|
|
4297
4350
|
clearSelectedData(t, e, i = !1, s = null) {
|
|
4298
4351
|
let o = [];
|
|
4299
4352
|
const r = /* @__PURE__ */ new Set();
|
|
4300
|
-
for (let
|
|
4353
|
+
for (let l = 0; l <= e[1] - e[0]; l++)
|
|
4301
4354
|
for (let h = 0; h <= t[1] - t[0]; h++) {
|
|
4302
|
-
const d =
|
|
4303
|
-
if (
|
|
4304
|
-
const { rowKey:
|
|
4305
|
-
this.ctx.database.getReadonly(
|
|
4306
|
-
rowKey:
|
|
4355
|
+
const d = l + e[0], f = h + t[0], u = this.ctx.database.getItemValueForRowIndexAndColIndex(d, f);
|
|
4356
|
+
if (u) {
|
|
4357
|
+
const { rowKey: x, key: w } = u;
|
|
4358
|
+
this.ctx.database.getReadonly(x, w) || (r.add(x), o.push({
|
|
4359
|
+
rowKey: x,
|
|
4307
4360
|
key: w,
|
|
4308
4361
|
value: s,
|
|
4309
4362
|
row: {}
|
|
@@ -4316,10 +4369,10 @@ class Re {
|
|
|
4316
4369
|
if (i)
|
|
4317
4370
|
return o;
|
|
4318
4371
|
this.ctx.database.batchSetItemValue(o, !0);
|
|
4319
|
-
let
|
|
4320
|
-
return r.forEach((
|
|
4321
|
-
|
|
4322
|
-
}), this.ctx.emit("clearSelectedDataChange", o,
|
|
4372
|
+
let a = [];
|
|
4373
|
+
return r.forEach((l) => {
|
|
4374
|
+
a.push(this.ctx.database.getRowDataItemForRowKey(l));
|
|
4375
|
+
}), this.ctx.emit("clearSelectedDataChange", o, a), o;
|
|
4323
4376
|
}
|
|
4324
4377
|
paste() {
|
|
4325
4378
|
if (!navigator.clipboard) {
|
|
@@ -4331,30 +4384,30 @@ class Re {
|
|
|
4331
4384
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
4332
4385
|
navigator.clipboard.readText().then(async (o) => {
|
|
4333
4386
|
let r = ne(o);
|
|
4334
|
-
const
|
|
4335
|
-
(
|
|
4387
|
+
const a = [i, i + r[0].length - 1], l = [e, e + r.length - 1], [h, d] = l, [f, u] = a, x = d - this.ctx.maxRowIndex, w = u - this.ctx.maxColIndex;
|
|
4388
|
+
(x > 0 || w > 0) && this.ctx.emit("onPastedDataOverflow", {
|
|
4336
4389
|
maxY: d,
|
|
4337
|
-
maxX:
|
|
4390
|
+
maxX: u,
|
|
4338
4391
|
minY: h,
|
|
4339
4392
|
minX: f,
|
|
4340
|
-
overflowRowCount:
|
|
4393
|
+
overflowRowCount: x,
|
|
4341
4394
|
overflowColCount: w,
|
|
4342
4395
|
textArr: r
|
|
4343
4396
|
});
|
|
4344
4397
|
const E = r.length === 1 && r[0].length === 1;
|
|
4345
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(
|
|
4346
|
-
const
|
|
4398
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !E) {
|
|
4399
|
+
const m = {
|
|
4347
4400
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
4348
4401
|
message: "Merged cells cannot span paste data"
|
|
4349
4402
|
};
|
|
4350
|
-
this.ctx.hasEvent("error") ? this.ctx.emit("error",
|
|
4403
|
+
this.ctx.hasEvent("error") ? this.ctx.emit("error", m) : alert(m.message);
|
|
4351
4404
|
return;
|
|
4352
4405
|
}
|
|
4353
4406
|
let g = [];
|
|
4354
|
-
for (let
|
|
4355
|
-
const b = r[
|
|
4407
|
+
for (let m = 0; m <= r.length - 1; m++) {
|
|
4408
|
+
const b = r[m].length;
|
|
4356
4409
|
for (let C = 0; C <= b - 1; C++) {
|
|
4357
|
-
const I =
|
|
4410
|
+
const I = m + e, _ = C + i, T = r[m][C], v = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
4358
4411
|
I,
|
|
4359
4412
|
_
|
|
4360
4413
|
);
|
|
@@ -4371,13 +4424,13 @@ class Re {
|
|
|
4371
4424
|
}
|
|
4372
4425
|
}
|
|
4373
4426
|
if (this.isCut) {
|
|
4374
|
-
const
|
|
4427
|
+
const m = this.clearSelectedData(
|
|
4375
4428
|
this.ctx.selector.xArrCopy,
|
|
4376
4429
|
this.ctx.selector.yArrCopy,
|
|
4377
4430
|
!0
|
|
4378
4431
|
// 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
|
|
4379
4432
|
), b = g.map((C) => `${C.rowKey}-${C.key}`);
|
|
4380
|
-
|
|
4433
|
+
m.forEach((C) => {
|
|
4381
4434
|
b.includes(`${C.rowKey}-${C.key}`) || g.unshift(C);
|
|
4382
4435
|
}), this.isCut = !1;
|
|
4383
4436
|
}
|
|
@@ -4385,21 +4438,21 @@ class Re {
|
|
|
4385
4438
|
return;
|
|
4386
4439
|
const { BEFORE_PASTE_DATA_METHOD: p } = this.ctx.config;
|
|
4387
4440
|
if (typeof p == "function") {
|
|
4388
|
-
const
|
|
4441
|
+
const m = p, b = g.map((C) => ({
|
|
4389
4442
|
rowKey: C.rowKey,
|
|
4390
4443
|
key: C.key,
|
|
4391
4444
|
value: C.value,
|
|
4392
4445
|
oldValue: this.ctx.database.getItemValue(C.rowKey, C.key),
|
|
4393
4446
|
row: this.ctx.database.getRowDataItemForRowKey(C.rowKey)
|
|
4394
4447
|
}));
|
|
4395
|
-
if (g = await
|
|
4448
|
+
if (g = await m(b, a, l, r), g && !g.length)
|
|
4396
4449
|
return;
|
|
4397
4450
|
}
|
|
4398
4451
|
this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(g, !0);
|
|
4399
|
-
let
|
|
4400
|
-
s.forEach((
|
|
4401
|
-
|
|
4402
|
-
}), this.ctx.emit("pasteChange", g,
|
|
4452
|
+
let y = [];
|
|
4453
|
+
s.forEach((m) => {
|
|
4454
|
+
y.push(this.ctx.database.getRowDataItemForRowKey(m));
|
|
4455
|
+
}), this.ctx.emit("pasteChange", g, y);
|
|
4403
4456
|
}).catch((o) => {
|
|
4404
4457
|
console.error("Failed to get the clipboard content:", o);
|
|
4405
4458
|
});
|
|
@@ -4415,7 +4468,7 @@ class Re {
|
|
|
4415
4468
|
if (!e)
|
|
4416
4469
|
return;
|
|
4417
4470
|
let { colIndex: i = 0, rowIndex: s = 0 } = e;
|
|
4418
|
-
const o = 0, r = 0,
|
|
4471
|
+
const o = 0, r = 0, a = this.ctx.maxColIndex, l = this.ctx.maxRowIndex;
|
|
4419
4472
|
switch (t) {
|
|
4420
4473
|
case "LEFT":
|
|
4421
4474
|
i > o && i--;
|
|
@@ -4424,10 +4477,10 @@ class Re {
|
|
|
4424
4477
|
s > r && s--;
|
|
4425
4478
|
break;
|
|
4426
4479
|
case "RIGHT":
|
|
4427
|
-
i <
|
|
4480
|
+
i < a && i++;
|
|
4428
4481
|
break;
|
|
4429
4482
|
case "BOTTOM":
|
|
4430
|
-
s <
|
|
4483
|
+
s < l && s++;
|
|
4431
4484
|
break;
|
|
4432
4485
|
}
|
|
4433
4486
|
const h = [i, i], d = [s, s], f = this.getCell(s, i);
|
|
@@ -4443,10 +4496,10 @@ class Re {
|
|
|
4443
4496
|
SELECTOR_AREA_MAX_X: s,
|
|
4444
4497
|
SELECTOR_AREA_MIN_Y: o,
|
|
4445
4498
|
SELECTOR_AREA_MAX_Y: r,
|
|
4446
|
-
SELECTOR_AREA_MAX_X_OFFSET:
|
|
4447
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4448
|
-
} = this.ctx.config, h = i, d = s || this.ctx.maxColIndex -
|
|
4449
|
-
return !(e < h || e > d || t < f || t >
|
|
4499
|
+
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
4500
|
+
SELECTOR_AREA_MAX_Y_OFFSET: l
|
|
4501
|
+
} = this.ctx.config, h = i, d = s || this.ctx.maxColIndex - a, f = o, u = r || this.ctx.maxRowIndex - l;
|
|
4502
|
+
return !(e < h || e > d || t < f || t > u);
|
|
4450
4503
|
}
|
|
4451
4504
|
/**
|
|
4452
4505
|
* 调整滚动条位置,让到达边界时自动滚动
|
|
@@ -4456,19 +4509,19 @@ class Re {
|
|
|
4456
4509
|
let s = "", o = "";
|
|
4457
4510
|
if (e < 0 ? s = "left" : e > this.ctx.body.visibleWidth && (s = "right"), i < this.ctx.header.visibleHeight ? o = "top" : i > this.ctx.header.visibleHeight + this.ctx.body.visibleHeight && (o = "bottom"), s && this.adjustPositionX !== s) {
|
|
4458
4511
|
this.adjustPositionX = s;
|
|
4459
|
-
let
|
|
4512
|
+
let a = 10 * (s === "left" ? -1 : 1);
|
|
4460
4513
|
this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
|
|
4461
|
-
|
|
4462
|
-
const { scrollX:
|
|
4514
|
+
a *= 1.5;
|
|
4515
|
+
const { scrollX: l } = this.ctx, h = l + a;
|
|
4463
4516
|
(h < 0 || h > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(h);
|
|
4464
4517
|
}, 100);
|
|
4465
4518
|
}
|
|
4466
4519
|
if (o && this.adjustPositionY !== o) {
|
|
4467
4520
|
this.adjustPositionY = o;
|
|
4468
|
-
let
|
|
4521
|
+
let a = 10 * (o === "top" ? -1 : 1);
|
|
4469
4522
|
this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
|
|
4470
|
-
|
|
4471
|
-
const { scrollY:
|
|
4523
|
+
a *= 1.5;
|
|
4524
|
+
const { scrollY: l } = this.ctx, h = l + a;
|
|
4472
4525
|
(h < 0 || h > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(h);
|
|
4473
4526
|
}, 100);
|
|
4474
4527
|
}
|
|
@@ -4484,23 +4537,23 @@ class Re {
|
|
|
4484
4537
|
fixedRightWidth: s,
|
|
4485
4538
|
fixedLeftWidth: o,
|
|
4486
4539
|
header: r,
|
|
4487
|
-
footer:
|
|
4488
|
-
body:
|
|
4540
|
+
footer: a,
|
|
4541
|
+
body: l,
|
|
4489
4542
|
scrollX: h,
|
|
4490
4543
|
scrollY: d,
|
|
4491
|
-
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED:
|
|
4544
|
+
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: u, FOOTER_POSITION: x, ENABLE_MERGE_CELL_LINK: w }
|
|
4492
4545
|
} = this.ctx;
|
|
4493
4546
|
if (!i)
|
|
4494
4547
|
return;
|
|
4495
4548
|
w && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
4496
|
-
const { drawX: E, drawY: g, width: p, height:
|
|
4497
|
-
let I = r.height - g, _ =
|
|
4498
|
-
_ >
|
|
4549
|
+
const { drawX: E, drawY: g, width: p, height: y, fixed: m } = i, b = o - E + 1, C = i.drawX + p - (e - s) + 1;
|
|
4550
|
+
let I = r.height - g, _ = y;
|
|
4551
|
+
_ > l.visibleHeight && (_ = l.visibleHeight);
|
|
4499
4552
|
let T = 0;
|
|
4500
|
-
|
|
4553
|
+
u && (x === "top" ? I = r.height + a.height - g : T = a.visibleHeight);
|
|
4501
4554
|
const v = g + _ - (t - T - f);
|
|
4502
4555
|
let R = h, S = d;
|
|
4503
|
-
C > 0 && !
|
|
4556
|
+
C > 0 && !m ? R = Math.floor(h + C) : b > 0 && !m && (R = Math.floor(h - b)), I > 0 ? S = Math.floor(d - I) : v > 0 && (S = Math.floor(d + v)), (Math.abs(h - R) > 2 || Math.abs(d - S) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(R, S), this.ctx.emit("adjustBoundaryPosition", i));
|
|
4504
4557
|
}
|
|
4505
4558
|
destroy() {
|
|
4506
4559
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
@@ -4516,11 +4569,11 @@ class Ie {
|
|
|
4516
4569
|
this.ctx.on("mousemove", (t) => {
|
|
4517
4570
|
if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
|
|
4518
4571
|
return;
|
|
4519
|
-
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: o, drawX: r, drawY:
|
|
4520
|
-
e >
|
|
4572
|
+
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: o, drawX: r, drawY: a, width: l, height: h } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || o === this.ctx.maxRowIndex ? 0 : 2, u = r + l - d + f, x = a + h - d + f;
|
|
4573
|
+
e > u && i > x && e < u + d && i < x + d && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4521
4574
|
}), this.ctx.on("cellMouseenter", (t) => {
|
|
4522
|
-
const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], o = i[1], { colIndex: r, rowIndex:
|
|
4523
|
-
this.ctx.config.ENABLE_AUTOFILL && r === s &&
|
|
4575
|
+
const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], o = i[1], { colIndex: r, rowIndex: a } = t;
|
|
4576
|
+
this.ctx.config.ENABLE_AUTOFILL && r === s && a === o && (this.maxColRowCell = t), this.mouseenter(t);
|
|
4524
4577
|
}), this.ctx.on("mousedown", () => {
|
|
4525
4578
|
this.ctx.stageElement.style.cursor === "crosshair" && this.setMousedown();
|
|
4526
4579
|
}), this.ctx.on("mouseup", () => {
|
|
@@ -4547,40 +4600,40 @@ class Ie {
|
|
|
4547
4600
|
const { ENABLE_AUTOFILL: i, ENABLE_SELECTOR_SPAN_COL: s, ENABLE_SELECTOR_SPAN_ROW: o } = this.ctx.config;
|
|
4548
4601
|
if (!i)
|
|
4549
4602
|
return;
|
|
4550
|
-
let r = t,
|
|
4603
|
+
let r = t, a = e;
|
|
4551
4604
|
if (!o) {
|
|
4552
|
-
const [
|
|
4553
|
-
|
|
4605
|
+
const [l] = a;
|
|
4606
|
+
a = [l, l];
|
|
4554
4607
|
}
|
|
4555
4608
|
if (!s) {
|
|
4556
|
-
const [
|
|
4557
|
-
r = [
|
|
4609
|
+
const [l] = r;
|
|
4610
|
+
r = [l, l];
|
|
4558
4611
|
}
|
|
4559
|
-
if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(r) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(
|
|
4612
|
+
if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(r) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(a)) {
|
|
4560
4613
|
const {
|
|
4561
|
-
SELECTOR_AREA_MIN_X:
|
|
4614
|
+
SELECTOR_AREA_MIN_X: l,
|
|
4562
4615
|
SELECTOR_AREA_MAX_X: h,
|
|
4563
4616
|
SELECTOR_AREA_MIN_Y: d,
|
|
4564
4617
|
SELECTOR_AREA_MAX_Y: f,
|
|
4565
|
-
SELECTOR_AREA_MAX_X_OFFSET:
|
|
4566
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4567
|
-
} = this.ctx.config, w =
|
|
4568
|
-
let [
|
|
4569
|
-
if (
|
|
4618
|
+
SELECTOR_AREA_MAX_X_OFFSET: u,
|
|
4619
|
+
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
4620
|
+
} = this.ctx.config, w = l, E = h || this.ctx.maxColIndex - u, g = d, p = f || this.ctx.maxRowIndex - x;
|
|
4621
|
+
let [y, m] = r, [b, C] = a;
|
|
4622
|
+
if (y < w || b < g)
|
|
4570
4623
|
return;
|
|
4571
|
-
r = [Math.max(w,
|
|
4624
|
+
r = [Math.max(w, y), Math.min(E, m)], a = [Math.max(g, b), Math.min(p, C)];
|
|
4572
4625
|
const { BEFORE_SET_AUTOFILL_METHOD: I } = this.ctx.config;
|
|
4573
4626
|
if (typeof I == "function") {
|
|
4574
4627
|
const T = I({
|
|
4575
4628
|
focusCell: this.ctx.focusCell,
|
|
4576
4629
|
xArr: r,
|
|
4577
|
-
yArr:
|
|
4630
|
+
yArr: a
|
|
4578
4631
|
});
|
|
4579
4632
|
if (!T)
|
|
4580
4633
|
return;
|
|
4581
|
-
r = T.xArr,
|
|
4634
|
+
r = T.xArr, a = T.yArr;
|
|
4582
4635
|
}
|
|
4583
|
-
this.ctx.autofill.xArr = r, this.ctx.autofill.yArr =
|
|
4636
|
+
this.ctx.autofill.xArr = r, this.ctx.autofill.yArr = a, this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
|
|
4584
4637
|
}
|
|
4585
4638
|
}
|
|
4586
4639
|
/**
|
|
@@ -4588,26 +4641,26 @@ class Ie {
|
|
|
4588
4641
|
*/
|
|
4589
4642
|
async autofillData() {
|
|
4590
4643
|
const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
|
|
4591
|
-
for (let
|
|
4644
|
+
for (let x = 0; x <= e.yArr[1] - e.yArr[0]; x++)
|
|
4592
4645
|
for (let w = 0; w <= e.xArr[1] - e.xArr[0]; w++) {
|
|
4593
|
-
const E =
|
|
4646
|
+
const E = x + e.yArr[0], g = w + e.xArr[0];
|
|
4594
4647
|
i.set(`${E}-${g}`, !0);
|
|
4595
4648
|
}
|
|
4596
|
-
const { value: s } = e, o = s[0].length, r = s.length,
|
|
4597
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(
|
|
4598
|
-
const
|
|
4649
|
+
const { value: s } = e, o = s[0].length, r = s.length, a = this.ctx.autofill.xArr, l = this.ctx.autofill.yArr, h = o === 1 && r === 1;
|
|
4650
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !h) {
|
|
4651
|
+
const x = {
|
|
4599
4652
|
code: "ERR_MERGED_CELLS_AUTOFILL",
|
|
4600
4653
|
message: "Merged cells cannot span autofill data"
|
|
4601
4654
|
};
|
|
4602
|
-
this.ctx.hasEvent("error") ? this.ctx.emit("error",
|
|
4655
|
+
this.ctx.hasEvent("error") ? this.ctx.emit("error", x) : alert(x.message);
|
|
4603
4656
|
return;
|
|
4604
4657
|
}
|
|
4605
4658
|
let d = [];
|
|
4606
|
-
for (let
|
|
4607
|
-
for (let w = 0; w <=
|
|
4608
|
-
const E = w +
|
|
4609
|
-
if (
|
|
4610
|
-
const { rowKey: b, key: C } =
|
|
4659
|
+
for (let x = 0; x <= l[1] - l[0]; x++)
|
|
4660
|
+
for (let w = 0; w <= a[1] - a[0]; w++) {
|
|
4661
|
+
const E = w + a[0], g = x + l[0], p = s[x % r][w % o], y = this.ctx.database.getItemValueForRowIndexAndColIndex(g, E), m = `${g}-${E}`;
|
|
4662
|
+
if (y && !i.has(m)) {
|
|
4663
|
+
const { rowKey: b, key: C } = y;
|
|
4611
4664
|
this.ctx.database.getReadonly(b, C) || (t.add(b), d.push({
|
|
4612
4665
|
rowKey: b,
|
|
4613
4666
|
key: C,
|
|
@@ -4621,35 +4674,35 @@ class Ie {
|
|
|
4621
4674
|
this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr;
|
|
4622
4675
|
const { BEFORE_AUTOFILL_DATA_METHOD: f } = this.ctx.config;
|
|
4623
4676
|
if (typeof f == "function") {
|
|
4624
|
-
const
|
|
4677
|
+
const x = f, w = d.map((E) => ({
|
|
4625
4678
|
rowKey: E.rowKey,
|
|
4626
4679
|
key: E.key,
|
|
4627
4680
|
value: E.value,
|
|
4628
4681
|
oldValue: this.ctx.database.getItemValue(E.rowKey, E.key),
|
|
4629
4682
|
row: this.ctx.database.getRowDataItemForRowKey(E.rowKey)
|
|
4630
4683
|
}));
|
|
4631
|
-
if (d = await
|
|
4684
|
+
if (d = await x(w, a, l), d && !d.length)
|
|
4632
4685
|
return;
|
|
4633
4686
|
}
|
|
4634
4687
|
this.ctx.batchSetItemValueByEditor(d, !0);
|
|
4635
|
-
let
|
|
4636
|
-
t.forEach((
|
|
4637
|
-
|
|
4638
|
-
}), this.ctx.emit("autofillChange", d,
|
|
4688
|
+
let u = [];
|
|
4689
|
+
t.forEach((x) => {
|
|
4690
|
+
u.push(this.ctx.database.getRowDataItemForRowKey(x));
|
|
4691
|
+
}), this.ctx.emit("autofillChange", d, u);
|
|
4639
4692
|
}
|
|
4640
4693
|
mouseenter(t) {
|
|
4641
4694
|
if (["index", "selection", "index-selection"].includes(t.type))
|
|
4642
4695
|
return;
|
|
4643
4696
|
const { selector: e, autofill: i } = this.ctx;
|
|
4644
4697
|
if (this.ctx.mousedown && e.enable && i.enable) {
|
|
4645
|
-
const { rowIndex: s, colIndex: o } = t, r = e.xArr.slice(),
|
|
4646
|
-
s >= e.yArr[0] && s <= e.yArr[1] ? o > e.xArr[1] ? r.splice(1, 1, o) : o < e.xArr[0] && r.splice(0, 1, o) : s > e.yArr[1] ?
|
|
4698
|
+
const { rowIndex: s, colIndex: o } = t, r = e.xArr.slice(), a = e.yArr.slice();
|
|
4699
|
+
s >= e.yArr[0] && s <= e.yArr[1] ? o > e.xArr[1] ? r.splice(1, 1, o) : o < e.xArr[0] && r.splice(0, 1, o) : s > e.yArr[1] ? a.splice(1, 1, s) : s < e.yArr[0] && a.splice(0, 1, s), this.setAutofill(r, a);
|
|
4647
4700
|
}
|
|
4648
4701
|
}
|
|
4649
4702
|
destroy() {
|
|
4650
4703
|
}
|
|
4651
4704
|
}
|
|
4652
|
-
const q = Math.min, G = Math.max, st = Math.round,
|
|
4705
|
+
const q = Math.min, G = Math.max, st = Math.round, B = (c) => ({
|
|
4653
4706
|
x: c,
|
|
4654
4707
|
y: c
|
|
4655
4708
|
}), ve = {
|
|
@@ -4673,7 +4726,7 @@ function z(c) {
|
|
|
4673
4726
|
function tt(c) {
|
|
4674
4727
|
return c.split("-")[1];
|
|
4675
4728
|
}
|
|
4676
|
-
function
|
|
4729
|
+
function Bt(c) {
|
|
4677
4730
|
return c === "x" ? "y" : "x";
|
|
4678
4731
|
}
|
|
4679
4732
|
function ut(c) {
|
|
@@ -4684,7 +4737,7 @@ function V(c) {
|
|
|
4684
4737
|
return Se.has(z(c)) ? "y" : "x";
|
|
4685
4738
|
}
|
|
4686
4739
|
function gt(c) {
|
|
4687
|
-
return
|
|
4740
|
+
return Bt(V(c));
|
|
4688
4741
|
}
|
|
4689
4742
|
function Te(c, t, e) {
|
|
4690
4743
|
e === void 0 && (e = !1);
|
|
@@ -4760,48 +4813,48 @@ function _t(c, t, e) {
|
|
|
4760
4813
|
reference: i,
|
|
4761
4814
|
floating: s
|
|
4762
4815
|
} = c;
|
|
4763
|
-
const o = V(t), r = gt(t),
|
|
4764
|
-
let
|
|
4765
|
-
switch (
|
|
4816
|
+
const o = V(t), r = gt(t), a = ut(r), l = z(t), h = o === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, u = i[a] / 2 - s[a] / 2;
|
|
4817
|
+
let x;
|
|
4818
|
+
switch (l) {
|
|
4766
4819
|
case "top":
|
|
4767
|
-
|
|
4820
|
+
x = {
|
|
4768
4821
|
x: d,
|
|
4769
4822
|
y: i.y - s.height
|
|
4770
4823
|
};
|
|
4771
4824
|
break;
|
|
4772
4825
|
case "bottom":
|
|
4773
|
-
|
|
4826
|
+
x = {
|
|
4774
4827
|
x: d,
|
|
4775
4828
|
y: i.y + i.height
|
|
4776
4829
|
};
|
|
4777
4830
|
break;
|
|
4778
4831
|
case "right":
|
|
4779
|
-
|
|
4832
|
+
x = {
|
|
4780
4833
|
x: i.x + i.width,
|
|
4781
4834
|
y: f
|
|
4782
4835
|
};
|
|
4783
4836
|
break;
|
|
4784
4837
|
case "left":
|
|
4785
|
-
|
|
4838
|
+
x = {
|
|
4786
4839
|
x: i.x - s.width,
|
|
4787
4840
|
y: f
|
|
4788
4841
|
};
|
|
4789
4842
|
break;
|
|
4790
4843
|
default:
|
|
4791
|
-
|
|
4844
|
+
x = {
|
|
4792
4845
|
x: i.x,
|
|
4793
4846
|
y: i.y
|
|
4794
4847
|
};
|
|
4795
4848
|
}
|
|
4796
4849
|
switch (tt(t)) {
|
|
4797
4850
|
case "start":
|
|
4798
|
-
|
|
4851
|
+
x[r] -= u * (e && h ? -1 : 1);
|
|
4799
4852
|
break;
|
|
4800
4853
|
case "end":
|
|
4801
|
-
|
|
4854
|
+
x[r] += u * (e && h ? -1 : 1);
|
|
4802
4855
|
break;
|
|
4803
4856
|
}
|
|
4804
|
-
return
|
|
4857
|
+
return x;
|
|
4805
4858
|
}
|
|
4806
4859
|
const ke = async (c, t, e) => {
|
|
4807
4860
|
const {
|
|
@@ -4809,7 +4862,7 @@ const ke = async (c, t, e) => {
|
|
|
4809
4862
|
strategy: s = "absolute",
|
|
4810
4863
|
middleware: o = [],
|
|
4811
4864
|
platform: r
|
|
4812
|
-
} = e,
|
|
4865
|
+
} = e, a = o.filter(Boolean), l = await (r.isRTL == null ? void 0 : r.isRTL(t));
|
|
4813
4866
|
let h = await r.getElementRects({
|
|
4814
4867
|
reference: c,
|
|
4815
4868
|
floating: t,
|
|
@@ -4817,23 +4870,23 @@ const ke = async (c, t, e) => {
|
|
|
4817
4870
|
}), {
|
|
4818
4871
|
x: d,
|
|
4819
4872
|
y: f
|
|
4820
|
-
} = _t(h, i,
|
|
4821
|
-
for (let E = 0; E <
|
|
4873
|
+
} = _t(h, i, l), u = i, x = {}, w = 0;
|
|
4874
|
+
for (let E = 0; E < a.length; E++) {
|
|
4822
4875
|
const {
|
|
4823
4876
|
name: g,
|
|
4824
4877
|
fn: p
|
|
4825
|
-
} =
|
|
4826
|
-
x:
|
|
4827
|
-
y,
|
|
4878
|
+
} = a[E], {
|
|
4879
|
+
x: y,
|
|
4880
|
+
y: m,
|
|
4828
4881
|
data: b,
|
|
4829
4882
|
reset: C
|
|
4830
4883
|
} = await p({
|
|
4831
4884
|
x: d,
|
|
4832
4885
|
y: f,
|
|
4833
4886
|
initialPlacement: i,
|
|
4834
|
-
placement:
|
|
4887
|
+
placement: u,
|
|
4835
4888
|
strategy: s,
|
|
4836
|
-
middlewareData:
|
|
4889
|
+
middlewareData: x,
|
|
4837
4890
|
rects: h,
|
|
4838
4891
|
platform: r,
|
|
4839
4892
|
elements: {
|
|
@@ -4841,27 +4894,27 @@ const ke = async (c, t, e) => {
|
|
|
4841
4894
|
floating: t
|
|
4842
4895
|
}
|
|
4843
4896
|
});
|
|
4844
|
-
d =
|
|
4845
|
-
...
|
|
4897
|
+
d = y ?? d, f = m ?? f, x = {
|
|
4898
|
+
...x,
|
|
4846
4899
|
[g]: {
|
|
4847
|
-
...
|
|
4900
|
+
...x[g],
|
|
4848
4901
|
...b
|
|
4849
4902
|
}
|
|
4850
|
-
}, C && w <= 50 && (w++, typeof C == "object" && (C.placement && (
|
|
4903
|
+
}, C && w <= 50 && (w++, typeof C == "object" && (C.placement && (u = C.placement), C.rects && (h = C.rects === !0 ? await r.getElementRects({
|
|
4851
4904
|
reference: c,
|
|
4852
4905
|
floating: t,
|
|
4853
4906
|
strategy: s
|
|
4854
4907
|
}) : C.rects), {
|
|
4855
4908
|
x: d,
|
|
4856
4909
|
y: f
|
|
4857
|
-
} = _t(h,
|
|
4910
|
+
} = _t(h, u, l)), E = -1);
|
|
4858
4911
|
}
|
|
4859
4912
|
return {
|
|
4860
4913
|
x: d,
|
|
4861
4914
|
y: f,
|
|
4862
|
-
placement:
|
|
4915
|
+
placement: u,
|
|
4863
4916
|
strategy: s,
|
|
4864
|
-
middlewareData:
|
|
4917
|
+
middlewareData: x
|
|
4865
4918
|
};
|
|
4866
4919
|
};
|
|
4867
4920
|
async function Yt(c, t) {
|
|
@@ -4872,36 +4925,36 @@ async function Yt(c, t) {
|
|
|
4872
4925
|
y: s,
|
|
4873
4926
|
platform: o,
|
|
4874
4927
|
rects: r,
|
|
4875
|
-
elements:
|
|
4876
|
-
strategy:
|
|
4928
|
+
elements: a,
|
|
4929
|
+
strategy: l
|
|
4877
4930
|
} = c, {
|
|
4878
4931
|
boundary: h = "clippingAncestors",
|
|
4879
4932
|
rootBoundary: d = "viewport",
|
|
4880
4933
|
elementContext: f = "floating",
|
|
4881
|
-
altBoundary:
|
|
4882
|
-
padding:
|
|
4883
|
-
} = Q(t, c), w = Kt(
|
|
4884
|
-
element: (e = await (o.isElement == null ? void 0 : o.isElement(g))) == null || e ? g : g.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(
|
|
4934
|
+
altBoundary: u = !1,
|
|
4935
|
+
padding: x = 0
|
|
4936
|
+
} = Q(t, c), w = Kt(x), g = a[u ? f === "floating" ? "reference" : "floating" : f], p = rt(await o.getClippingRect({
|
|
4937
|
+
element: (e = await (o.isElement == null ? void 0 : o.isElement(g))) == null || e ? g : g.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(a.floating)),
|
|
4885
4938
|
boundary: h,
|
|
4886
4939
|
rootBoundary: d,
|
|
4887
|
-
strategy:
|
|
4888
|
-
})),
|
|
4940
|
+
strategy: l
|
|
4941
|
+
})), y = f === "floating" ? {
|
|
4889
4942
|
x: i,
|
|
4890
4943
|
y: s,
|
|
4891
4944
|
width: r.floating.width,
|
|
4892
4945
|
height: r.floating.height
|
|
4893
|
-
} : r.reference,
|
|
4946
|
+
} : r.reference, m = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(a.floating)), b = await (o.isElement == null ? void 0 : o.isElement(m)) ? await (o.getScale == null ? void 0 : o.getScale(m)) || {
|
|
4894
4947
|
x: 1,
|
|
4895
4948
|
y: 1
|
|
4896
4949
|
} : {
|
|
4897
4950
|
x: 1,
|
|
4898
4951
|
y: 1
|
|
4899
4952
|
}, C = rt(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
4900
|
-
elements:
|
|
4901
|
-
rect:
|
|
4902
|
-
offsetParent:
|
|
4903
|
-
strategy:
|
|
4904
|
-
}) :
|
|
4953
|
+
elements: a,
|
|
4954
|
+
rect: y,
|
|
4955
|
+
offsetParent: m,
|
|
4956
|
+
strategy: l
|
|
4957
|
+
}) : y);
|
|
4905
4958
|
return {
|
|
4906
4959
|
top: (p.top - C.top + w.top) / b.y,
|
|
4907
4960
|
bottom: (C.bottom - p.bottom + w.bottom) / b.y,
|
|
@@ -4919,25 +4972,25 @@ const Xe = (c) => ({
|
|
|
4919
4972
|
placement: s,
|
|
4920
4973
|
rects: o,
|
|
4921
4974
|
platform: r,
|
|
4922
|
-
elements:
|
|
4923
|
-
middlewareData:
|
|
4975
|
+
elements: a,
|
|
4976
|
+
middlewareData: l
|
|
4924
4977
|
} = t, {
|
|
4925
4978
|
element: h,
|
|
4926
4979
|
padding: d = 0
|
|
4927
4980
|
} = Q(c, t) || {};
|
|
4928
4981
|
if (h == null)
|
|
4929
4982
|
return {};
|
|
4930
|
-
const f = Kt(d),
|
|
4983
|
+
const f = Kt(d), u = {
|
|
4931
4984
|
x: e,
|
|
4932
4985
|
y: i
|
|
4933
|
-
},
|
|
4934
|
-
let _ = I ? I[
|
|
4935
|
-
(!_ || !await (r.isElement == null ? void 0 : r.isElement(I))) && (_ =
|
|
4936
|
-
const T = b / 2 - C / 2, v = _ / 2 - E[w] / 2 - 1, R = q(f[p], v), S = q(f[
|
|
4986
|
+
}, x = gt(s), w = ut(x), E = await r.getDimensions(h), g = x === "y", p = g ? "top" : "left", y = g ? "bottom" : "right", m = g ? "clientHeight" : "clientWidth", b = o.reference[w] + o.reference[x] - u[x] - o.floating[w], C = u[x] - o.reference[x], I = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(h));
|
|
4987
|
+
let _ = I ? I[m] : 0;
|
|
4988
|
+
(!_ || !await (r.isElement == null ? void 0 : r.isElement(I))) && (_ = a.floating[m] || o.floating[w]);
|
|
4989
|
+
const T = b / 2 - C / 2, v = _ / 2 - E[w] / 2 - 1, R = q(f[p], v), S = q(f[y], v), O = R, M = _ - E[w] - S, L = _ / 2 - E[w] / 2 + T, H = dt(O, L, M), Y = !l.arrow && tt(s) != null && L !== H && o.reference[w] / 2 - (L < O ? R : S) - E[w] / 2 < 0, D = Y ? L < O ? L - O : L - M : 0;
|
|
4937
4990
|
return {
|
|
4938
|
-
[
|
|
4991
|
+
[x]: u[x] + D,
|
|
4939
4992
|
data: {
|
|
4940
|
-
[
|
|
4993
|
+
[x]: H,
|
|
4941
4994
|
centerOffset: L - H - D,
|
|
4942
4995
|
...Y && {
|
|
4943
4996
|
alignmentOffset: D
|
|
@@ -4946,7 +4999,7 @@ const Xe = (c) => ({
|
|
|
4946
4999
|
reset: Y
|
|
4947
5000
|
};
|
|
4948
5001
|
}
|
|
4949
|
-
}),
|
|
5002
|
+
}), Ne = function(c) {
|
|
4950
5003
|
return c === void 0 && (c = {}), {
|
|
4951
5004
|
name: "flip",
|
|
4952
5005
|
options: c,
|
|
@@ -4956,23 +5009,23 @@ const Xe = (c) => ({
|
|
|
4956
5009
|
placement: s,
|
|
4957
5010
|
middlewareData: o,
|
|
4958
5011
|
rects: r,
|
|
4959
|
-
initialPlacement:
|
|
4960
|
-
platform:
|
|
5012
|
+
initialPlacement: a,
|
|
5013
|
+
platform: l,
|
|
4961
5014
|
elements: h
|
|
4962
5015
|
} = t, {
|
|
4963
5016
|
mainAxis: d = !0,
|
|
4964
5017
|
crossAxis: f = !0,
|
|
4965
|
-
fallbackPlacements:
|
|
4966
|
-
fallbackStrategy:
|
|
5018
|
+
fallbackPlacements: u,
|
|
5019
|
+
fallbackStrategy: x = "bestFit",
|
|
4967
5020
|
fallbackAxisSideDirection: w = "none",
|
|
4968
5021
|
flipAlignment: E = !0,
|
|
4969
5022
|
...g
|
|
4970
5023
|
} = Q(c, t);
|
|
4971
5024
|
if ((e = o.arrow) != null && e.alignmentOffset)
|
|
4972
5025
|
return {};
|
|
4973
|
-
const p = z(s),
|
|
4974
|
-
!
|
|
4975
|
-
const _ = [
|
|
5026
|
+
const p = z(s), y = V(a), m = z(a) === a, b = await (l.isRTL == null ? void 0 : l.isRTL(h.floating)), C = u || (m || !E ? [ot(a)] : Oe(a)), I = w !== "none";
|
|
5027
|
+
!u && I && C.push(...He(a, E, w, b));
|
|
5028
|
+
const _ = [a, ...C], T = await Yt(t, g), v = [];
|
|
4976
5029
|
let R = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
4977
5030
|
if (d && v.push(T[p]), f) {
|
|
4978
5031
|
const L = Te(s, r, b);
|
|
@@ -4984,9 +5037,9 @@ const Xe = (c) => ({
|
|
|
4984
5037
|
}], !v.every((L) => L <= 0)) {
|
|
4985
5038
|
var S, O;
|
|
4986
5039
|
const L = (((S = o.flip) == null ? void 0 : S.index) || 0) + 1, H = _[L];
|
|
4987
|
-
if (H && (!(f === "alignment" ?
|
|
5040
|
+
if (H && (!(f === "alignment" ? y !== V(H) : !1) || // We leave the current main axis only if every placement on that axis
|
|
4988
5041
|
// overflows the main axis.
|
|
4989
|
-
R.every((k) => V(k.placement) ===
|
|
5042
|
+
R.every((k) => V(k.placement) === y ? k.overflows[0] > 0 : !0)))
|
|
4990
5043
|
return {
|
|
4991
5044
|
data: {
|
|
4992
5045
|
index: L,
|
|
@@ -4998,13 +5051,13 @@ const Xe = (c) => ({
|
|
|
4998
5051
|
};
|
|
4999
5052
|
let Y = (O = R.filter((D) => D.overflows[0] <= 0).sort((D, k) => D.overflows[1] - k.overflows[1])[0]) == null ? void 0 : O.placement;
|
|
5000
5053
|
if (!Y)
|
|
5001
|
-
switch (
|
|
5054
|
+
switch (x) {
|
|
5002
5055
|
case "bestFit": {
|
|
5003
5056
|
var M;
|
|
5004
5057
|
const D = (M = R.filter((k) => {
|
|
5005
5058
|
if (I) {
|
|
5006
5059
|
const W = V(k.placement);
|
|
5007
|
-
return W ===
|
|
5060
|
+
return W === y || // Create a bias to the `y` side axis due to horizontal
|
|
5008
5061
|
// reading directions favoring greater width.
|
|
5009
5062
|
W === "y";
|
|
5010
5063
|
}
|
|
@@ -5014,7 +5067,7 @@ const Xe = (c) => ({
|
|
|
5014
5067
|
break;
|
|
5015
5068
|
}
|
|
5016
5069
|
case "initialPlacement":
|
|
5017
|
-
Y =
|
|
5070
|
+
Y = a;
|
|
5018
5071
|
break;
|
|
5019
5072
|
}
|
|
5020
5073
|
if (s !== Y)
|
|
@@ -5027,16 +5080,16 @@ const Xe = (c) => ({
|
|
|
5027
5080
|
return {};
|
|
5028
5081
|
}
|
|
5029
5082
|
};
|
|
5030
|
-
},
|
|
5083
|
+
}, Be = /* @__PURE__ */ new Set(["left", "top"]);
|
|
5031
5084
|
async function Ke(c, t) {
|
|
5032
5085
|
const {
|
|
5033
5086
|
placement: e,
|
|
5034
5087
|
platform: i,
|
|
5035
5088
|
elements: s
|
|
5036
|
-
} = c, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r = z(e),
|
|
5089
|
+
} = c, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r = z(e), a = tt(e), l = V(e) === "y", h = Be.has(r) ? -1 : 1, d = o && l ? -1 : 1, f = Q(t, c);
|
|
5037
5090
|
let {
|
|
5038
|
-
mainAxis:
|
|
5039
|
-
crossAxis:
|
|
5091
|
+
mainAxis: u,
|
|
5092
|
+
crossAxis: x,
|
|
5040
5093
|
alignmentAxis: w
|
|
5041
5094
|
} = typeof f == "number" ? {
|
|
5042
5095
|
mainAxis: f,
|
|
@@ -5047,12 +5100,12 @@ async function Ke(c, t) {
|
|
|
5047
5100
|
crossAxis: f.crossAxis || 0,
|
|
5048
5101
|
alignmentAxis: f.alignmentAxis
|
|
5049
5102
|
};
|
|
5050
|
-
return
|
|
5051
|
-
x:
|
|
5052
|
-
y:
|
|
5103
|
+
return a && typeof w == "number" && (x = a === "end" ? w * -1 : w), l ? {
|
|
5104
|
+
x: x * d,
|
|
5105
|
+
y: u * h
|
|
5053
5106
|
} : {
|
|
5054
|
-
x:
|
|
5055
|
-
y:
|
|
5107
|
+
x: u * h,
|
|
5108
|
+
y: x * d
|
|
5056
5109
|
};
|
|
5057
5110
|
}
|
|
5058
5111
|
const Ye = function(c) {
|
|
@@ -5065,13 +5118,13 @@ const Ye = function(c) {
|
|
|
5065
5118
|
x: s,
|
|
5066
5119
|
y: o,
|
|
5067
5120
|
placement: r,
|
|
5068
|
-
middlewareData:
|
|
5069
|
-
} = t,
|
|
5070
|
-
return r === ((e =
|
|
5071
|
-
x: s +
|
|
5072
|
-
y: o +
|
|
5121
|
+
middlewareData: a
|
|
5122
|
+
} = t, l = await Ke(t, c);
|
|
5123
|
+
return r === ((e = a.offset) == null ? void 0 : e.placement) && (i = a.arrow) != null && i.alignmentOffset ? {} : {
|
|
5124
|
+
x: s + l.x,
|
|
5125
|
+
y: o + l.y,
|
|
5073
5126
|
data: {
|
|
5074
|
-
...
|
|
5127
|
+
...l,
|
|
5075
5128
|
placement: r
|
|
5076
5129
|
}
|
|
5077
5130
|
};
|
|
@@ -5089,35 +5142,35 @@ const Ye = function(c) {
|
|
|
5089
5142
|
} = t, {
|
|
5090
5143
|
mainAxis: o = !0,
|
|
5091
5144
|
crossAxis: r = !1,
|
|
5092
|
-
limiter:
|
|
5145
|
+
limiter: a = {
|
|
5093
5146
|
fn: (g) => {
|
|
5094
5147
|
let {
|
|
5095
5148
|
x: p,
|
|
5096
|
-
y
|
|
5149
|
+
y
|
|
5097
5150
|
} = g;
|
|
5098
5151
|
return {
|
|
5099
5152
|
x: p,
|
|
5100
|
-
y
|
|
5153
|
+
y
|
|
5101
5154
|
};
|
|
5102
5155
|
}
|
|
5103
5156
|
},
|
|
5104
|
-
...
|
|
5157
|
+
...l
|
|
5105
5158
|
} = Q(c, t), h = {
|
|
5106
5159
|
x: e,
|
|
5107
5160
|
y: i
|
|
5108
|
-
}, d = await Yt(t,
|
|
5109
|
-
let
|
|
5161
|
+
}, d = await Yt(t, l), f = V(z(s)), u = Bt(f);
|
|
5162
|
+
let x = h[u], w = h[f];
|
|
5110
5163
|
if (o) {
|
|
5111
|
-
const g =
|
|
5112
|
-
|
|
5164
|
+
const g = u === "y" ? "top" : "left", p = u === "y" ? "bottom" : "right", y = x + d[g], m = x - d[p];
|
|
5165
|
+
x = dt(y, x, m);
|
|
5113
5166
|
}
|
|
5114
5167
|
if (r) {
|
|
5115
|
-
const g = f === "y" ? "top" : "left", p = f === "y" ? "bottom" : "right",
|
|
5116
|
-
w = dt(
|
|
5168
|
+
const g = f === "y" ? "top" : "left", p = f === "y" ? "bottom" : "right", y = w + d[g], m = w - d[p];
|
|
5169
|
+
w = dt(y, w, m);
|
|
5117
5170
|
}
|
|
5118
|
-
const E =
|
|
5171
|
+
const E = a.fn({
|
|
5119
5172
|
...t,
|
|
5120
|
-
[
|
|
5173
|
+
[u]: x,
|
|
5121
5174
|
[f]: w
|
|
5122
5175
|
});
|
|
5123
5176
|
return {
|
|
@@ -5126,7 +5179,7 @@ const Ye = function(c) {
|
|
|
5126
5179
|
x: E.x - e,
|
|
5127
5180
|
y: E.y - i,
|
|
5128
5181
|
enabled: {
|
|
5129
|
-
[
|
|
5182
|
+
[u]: o,
|
|
5130
5183
|
[f]: r
|
|
5131
5184
|
}
|
|
5132
5185
|
}
|
|
@@ -5167,7 +5220,7 @@ function et(c) {
|
|
|
5167
5220
|
overflowX: e,
|
|
5168
5221
|
overflowY: i,
|
|
5169
5222
|
display: s
|
|
5170
|
-
} =
|
|
5223
|
+
} = N(c);
|
|
5171
5224
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !We.has(s);
|
|
5172
5225
|
}
|
|
5173
5226
|
const Ve = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
@@ -5175,7 +5228,7 @@ function Pe(c) {
|
|
|
5175
5228
|
return Ve.has(Z(c));
|
|
5176
5229
|
}
|
|
5177
5230
|
const ze = [":popover-open", ":modal"];
|
|
5178
|
-
function
|
|
5231
|
+
function at(c) {
|
|
5179
5232
|
return ze.some((t) => {
|
|
5180
5233
|
try {
|
|
5181
5234
|
return c.matches(t);
|
|
@@ -5186,7 +5239,7 @@ function lt(c) {
|
|
|
5186
5239
|
}
|
|
5187
5240
|
const $e = ["transform", "translate", "scale", "rotate", "perspective"], Ge = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Ue = ["paint", "layout", "strict", "content"];
|
|
5188
5241
|
function wt(c) {
|
|
5189
|
-
const t = Et(), e = X(c) ?
|
|
5242
|
+
const t = Et(), e = X(c) ? N(c) : c;
|
|
5190
5243
|
return $e.some((i) => e[i] ? e[i] !== "none" : !1) || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || Ge.some((i) => (e.willChange || "").includes(i)) || Ue.some((i) => (e.contain || "").includes(i));
|
|
5191
5244
|
}
|
|
5192
5245
|
function je(c) {
|
|
@@ -5194,7 +5247,7 @@ function je(c) {
|
|
|
5194
5247
|
for (; K(t) && !j(t); ) {
|
|
5195
5248
|
if (wt(t))
|
|
5196
5249
|
return t;
|
|
5197
|
-
if (
|
|
5250
|
+
if (at(t))
|
|
5198
5251
|
return null;
|
|
5199
5252
|
t = P(t);
|
|
5200
5253
|
}
|
|
@@ -5207,10 +5260,10 @@ const Ze = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
|
5207
5260
|
function j(c) {
|
|
5208
5261
|
return Ze.has(Z(c));
|
|
5209
5262
|
}
|
|
5210
|
-
function
|
|
5263
|
+
function N(c) {
|
|
5211
5264
|
return A(c).getComputedStyle(c);
|
|
5212
5265
|
}
|
|
5213
|
-
function
|
|
5266
|
+
function lt(c) {
|
|
5214
5267
|
return X(c) ? {
|
|
5215
5268
|
scrollLeft: c.scrollLeft,
|
|
5216
5269
|
scrollTop: c.scrollTop
|
|
@@ -5245,13 +5298,13 @@ function xt(c) {
|
|
|
5245
5298
|
return c.parent && Object.getPrototypeOf(c.parent) ? c.frameElement : null;
|
|
5246
5299
|
}
|
|
5247
5300
|
function Pt(c) {
|
|
5248
|
-
const t =
|
|
5301
|
+
const t = N(c);
|
|
5249
5302
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
5250
|
-
const s = K(c), o = s ? c.offsetWidth : e, r = s ? c.offsetHeight : i,
|
|
5251
|
-
return
|
|
5303
|
+
const s = K(c), o = s ? c.offsetWidth : e, r = s ? c.offsetHeight : i, a = st(e) !== o || st(i) !== r;
|
|
5304
|
+
return a && (e = o, i = r), {
|
|
5252
5305
|
width: e,
|
|
5253
5306
|
height: i,
|
|
5254
|
-
$:
|
|
5307
|
+
$: a
|
|
5255
5308
|
};
|
|
5256
5309
|
}
|
|
5257
5310
|
function zt(c) {
|
|
@@ -5260,19 +5313,19 @@ function zt(c) {
|
|
|
5260
5313
|
function U(c) {
|
|
5261
5314
|
const t = zt(c);
|
|
5262
5315
|
if (!K(t))
|
|
5263
|
-
return
|
|
5316
|
+
return B(1);
|
|
5264
5317
|
const e = t.getBoundingClientRect(), {
|
|
5265
5318
|
width: i,
|
|
5266
5319
|
height: s,
|
|
5267
5320
|
$: o
|
|
5268
5321
|
} = Pt(t);
|
|
5269
|
-
let r = (o ? st(e.width) : e.width) / i,
|
|
5270
|
-
return (!r || !Number.isFinite(r)) && (r = 1), (!
|
|
5322
|
+
let r = (o ? st(e.width) : e.width) / i, a = (o ? st(e.height) : e.height) / s;
|
|
5323
|
+
return (!r || !Number.isFinite(r)) && (r = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
5271
5324
|
x: r,
|
|
5272
|
-
y:
|
|
5325
|
+
y: a
|
|
5273
5326
|
};
|
|
5274
5327
|
}
|
|
5275
|
-
const qe = /* @__PURE__ */
|
|
5328
|
+
const qe = /* @__PURE__ */ B(0);
|
|
5276
5329
|
function $t(c) {
|
|
5277
5330
|
const t = A(c);
|
|
5278
5331
|
return !Et() || !t.visualViewport ? qe : {
|
|
@@ -5286,27 +5339,27 @@ function Je(c, t, e) {
|
|
|
5286
5339
|
function J(c, t, e, i) {
|
|
5287
5340
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
5288
5341
|
const s = c.getBoundingClientRect(), o = zt(c);
|
|
5289
|
-
let r =
|
|
5342
|
+
let r = B(1);
|
|
5290
5343
|
t && (i ? X(i) && (r = U(i)) : r = U(c));
|
|
5291
|
-
const
|
|
5292
|
-
let
|
|
5344
|
+
const a = Je(o, e, i) ? $t(o) : B(0);
|
|
5345
|
+
let l = (s.left + a.x) / r.x, h = (s.top + a.y) / r.y, d = s.width / r.x, f = s.height / r.y;
|
|
5293
5346
|
if (o) {
|
|
5294
|
-
const
|
|
5295
|
-
let w =
|
|
5296
|
-
for (; E && i &&
|
|
5297
|
-
const g = U(E), p = E.getBoundingClientRect(),
|
|
5298
|
-
|
|
5347
|
+
const u = A(o), x = i && X(i) ? A(i) : i;
|
|
5348
|
+
let w = u, E = xt(w);
|
|
5349
|
+
for (; E && i && x !== w; ) {
|
|
5350
|
+
const g = U(E), p = E.getBoundingClientRect(), y = N(E), m = p.left + (E.clientLeft + parseFloat(y.paddingLeft)) * g.x, b = p.top + (E.clientTop + parseFloat(y.paddingTop)) * g.y;
|
|
5351
|
+
l *= g.x, h *= g.y, d *= g.x, f *= g.y, l += m, h += b, w = A(E), E = xt(w);
|
|
5299
5352
|
}
|
|
5300
5353
|
}
|
|
5301
5354
|
return rt({
|
|
5302
5355
|
width: d,
|
|
5303
5356
|
height: f,
|
|
5304
|
-
x:
|
|
5357
|
+
x: l,
|
|
5305
5358
|
y: h
|
|
5306
5359
|
});
|
|
5307
5360
|
}
|
|
5308
5361
|
function pt(c, t) {
|
|
5309
|
-
const e =
|
|
5362
|
+
const e = lt(c).scrollLeft;
|
|
5310
5363
|
return t ? t.left + e : J(F(c)).left + e;
|
|
5311
5364
|
}
|
|
5312
5365
|
function Gt(c, t, e) {
|
|
@@ -5327,62 +5380,62 @@ function Qe(c) {
|
|
|
5327
5380
|
offsetParent: i,
|
|
5328
5381
|
strategy: s
|
|
5329
5382
|
} = c;
|
|
5330
|
-
const o = s === "fixed", r = F(i),
|
|
5331
|
-
if (i === r ||
|
|
5383
|
+
const o = s === "fixed", r = F(i), a = t ? at(t.floating) : !1;
|
|
5384
|
+
if (i === r || a && o)
|
|
5332
5385
|
return e;
|
|
5333
|
-
let
|
|
5386
|
+
let l = {
|
|
5334
5387
|
scrollLeft: 0,
|
|
5335
5388
|
scrollTop: 0
|
|
5336
|
-
}, h =
|
|
5337
|
-
const d =
|
|
5338
|
-
if ((f || !f && !o) && ((Z(i) !== "body" || et(r)) && (
|
|
5339
|
-
const
|
|
5340
|
-
h = U(i), d.x =
|
|
5389
|
+
}, h = B(1);
|
|
5390
|
+
const d = B(0), f = K(i);
|
|
5391
|
+
if ((f || !f && !o) && ((Z(i) !== "body" || et(r)) && (l = lt(i)), K(i))) {
|
|
5392
|
+
const x = J(i);
|
|
5393
|
+
h = U(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
|
|
5341
5394
|
}
|
|
5342
|
-
const
|
|
5395
|
+
const u = r && !f && !o ? Gt(r, l, !0) : B(0);
|
|
5343
5396
|
return {
|
|
5344
5397
|
width: e.width * h.x,
|
|
5345
5398
|
height: e.height * h.y,
|
|
5346
|
-
x: e.x * h.x -
|
|
5347
|
-
y: e.y * h.y -
|
|
5399
|
+
x: e.x * h.x - l.scrollLeft * h.x + d.x + u.x,
|
|
5400
|
+
y: e.y * h.y - l.scrollTop * h.y + d.y + u.y
|
|
5348
5401
|
};
|
|
5349
5402
|
}
|
|
5350
5403
|
function ti(c) {
|
|
5351
5404
|
return Array.from(c.getClientRects());
|
|
5352
5405
|
}
|
|
5353
5406
|
function ei(c) {
|
|
5354
|
-
const t = F(c), e =
|
|
5407
|
+
const t = F(c), e = lt(c), i = c.ownerDocument.body, s = G(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), o = G(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
|
|
5355
5408
|
let r = -e.scrollLeft + pt(c);
|
|
5356
|
-
const
|
|
5357
|
-
return
|
|
5409
|
+
const a = -e.scrollTop;
|
|
5410
|
+
return N(i).direction === "rtl" && (r += G(t.clientWidth, i.clientWidth) - s), {
|
|
5358
5411
|
width: s,
|
|
5359
5412
|
height: o,
|
|
5360
5413
|
x: r,
|
|
5361
|
-
y:
|
|
5414
|
+
y: a
|
|
5362
5415
|
};
|
|
5363
5416
|
}
|
|
5364
5417
|
function ii(c, t) {
|
|
5365
5418
|
const e = A(c), i = F(c), s = e.visualViewport;
|
|
5366
|
-
let o = i.clientWidth, r = i.clientHeight,
|
|
5419
|
+
let o = i.clientWidth, r = i.clientHeight, a = 0, l = 0;
|
|
5367
5420
|
if (s) {
|
|
5368
5421
|
o = s.width, r = s.height;
|
|
5369
5422
|
const h = Et();
|
|
5370
|
-
(!h || h && t === "fixed") && (
|
|
5423
|
+
(!h || h && t === "fixed") && (a = s.offsetLeft, l = s.offsetTop);
|
|
5371
5424
|
}
|
|
5372
5425
|
return {
|
|
5373
5426
|
width: o,
|
|
5374
5427
|
height: r,
|
|
5375
|
-
x:
|
|
5376
|
-
y:
|
|
5428
|
+
x: a,
|
|
5429
|
+
y: l
|
|
5377
5430
|
};
|
|
5378
5431
|
}
|
|
5379
5432
|
const si = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
5380
5433
|
function oi(c, t) {
|
|
5381
|
-
const e = J(c, !0, t === "fixed"), i = e.top + c.clientTop, s = e.left + c.clientLeft, o = K(c) ? U(c) :
|
|
5434
|
+
const e = J(c, !0, t === "fixed"), i = e.top + c.clientTop, s = e.left + c.clientLeft, o = K(c) ? U(c) : B(1), r = c.clientWidth * o.x, a = c.clientHeight * o.y, l = s * o.x, h = i * o.y;
|
|
5382
5435
|
return {
|
|
5383
5436
|
width: r,
|
|
5384
|
-
height:
|
|
5385
|
-
x:
|
|
5437
|
+
height: a,
|
|
5438
|
+
x: l,
|
|
5386
5439
|
y: h
|
|
5387
5440
|
};
|
|
5388
5441
|
}
|
|
@@ -5407,18 +5460,18 @@ function Tt(c, t, e) {
|
|
|
5407
5460
|
}
|
|
5408
5461
|
function Ut(c, t) {
|
|
5409
5462
|
const e = P(c);
|
|
5410
|
-
return e === t || !X(e) || j(e) ? !1 :
|
|
5463
|
+
return e === t || !X(e) || j(e) ? !1 : N(e).position === "fixed" || Ut(e, t);
|
|
5411
5464
|
}
|
|
5412
5465
|
function ri(c, t) {
|
|
5413
5466
|
const e = t.get(c);
|
|
5414
5467
|
if (e)
|
|
5415
5468
|
return e;
|
|
5416
|
-
let i = Vt(c, []).filter((
|
|
5417
|
-
const o =
|
|
5469
|
+
let i = Vt(c, []).filter((a) => X(a) && Z(a) !== "body"), s = null;
|
|
5470
|
+
const o = N(c).position === "fixed";
|
|
5418
5471
|
let r = o ? P(c) : c;
|
|
5419
5472
|
for (; X(r) && !j(r); ) {
|
|
5420
|
-
const
|
|
5421
|
-
!
|
|
5473
|
+
const a = N(r), l = wt(r);
|
|
5474
|
+
!l && a.position === "fixed" && (s = null), (o ? !l && !s : !l && a.position === "static" && !!s && si.has(s.position) || et(r) && !l && Ut(c, r)) ? i = i.filter((d) => d !== r) : s = a, r = P(r);
|
|
5422
5475
|
}
|
|
5423
5476
|
return t.set(c, i), i;
|
|
5424
5477
|
}
|
|
@@ -5429,18 +5482,18 @@ function ni(c) {
|
|
|
5429
5482
|
rootBoundary: i,
|
|
5430
5483
|
strategy: s
|
|
5431
5484
|
} = c;
|
|
5432
|
-
const r = [...e === "clippingAncestors" ?
|
|
5485
|
+
const r = [...e === "clippingAncestors" ? at(t) ? [] : ri(t, this._c) : [].concat(e), i], a = r[0], l = r.reduce((h, d) => {
|
|
5433
5486
|
const f = Tt(t, d, s);
|
|
5434
5487
|
return h.top = G(f.top, h.top), h.right = q(f.right, h.right), h.bottom = q(f.bottom, h.bottom), h.left = G(f.left, h.left), h;
|
|
5435
|
-
}, Tt(t,
|
|
5488
|
+
}, Tt(t, a, s));
|
|
5436
5489
|
return {
|
|
5437
|
-
width:
|
|
5438
|
-
height:
|
|
5439
|
-
x:
|
|
5440
|
-
y:
|
|
5490
|
+
width: l.right - l.left,
|
|
5491
|
+
height: l.bottom - l.top,
|
|
5492
|
+
x: l.left,
|
|
5493
|
+
y: l.top
|
|
5441
5494
|
};
|
|
5442
5495
|
}
|
|
5443
|
-
function
|
|
5496
|
+
function ai(c) {
|
|
5444
5497
|
const {
|
|
5445
5498
|
width: t,
|
|
5446
5499
|
height: e
|
|
@@ -5450,35 +5503,35 @@ function li(c) {
|
|
|
5450
5503
|
height: e
|
|
5451
5504
|
};
|
|
5452
5505
|
}
|
|
5453
|
-
function
|
|
5506
|
+
function li(c, t, e) {
|
|
5454
5507
|
const i = K(t), s = F(t), o = e === "fixed", r = J(c, !0, o, t);
|
|
5455
|
-
let
|
|
5508
|
+
let a = {
|
|
5456
5509
|
scrollLeft: 0,
|
|
5457
5510
|
scrollTop: 0
|
|
5458
5511
|
};
|
|
5459
|
-
const
|
|
5512
|
+
const l = B(0);
|
|
5460
5513
|
function h() {
|
|
5461
|
-
|
|
5514
|
+
l.x = pt(s);
|
|
5462
5515
|
}
|
|
5463
5516
|
if (i || !i && !o)
|
|
5464
|
-
if ((Z(t) !== "body" || et(s)) && (
|
|
5465
|
-
const
|
|
5466
|
-
|
|
5517
|
+
if ((Z(t) !== "body" || et(s)) && (a = lt(t)), i) {
|
|
5518
|
+
const x = J(t, !0, o, t);
|
|
5519
|
+
l.x = x.x + t.clientLeft, l.y = x.y + t.clientTop;
|
|
5467
5520
|
} else s && h();
|
|
5468
5521
|
o && !i && s && h();
|
|
5469
|
-
const d = s && !i && !o ? Gt(s,
|
|
5522
|
+
const d = s && !i && !o ? Gt(s, a) : B(0), f = r.left + a.scrollLeft - l.x - d.x, u = r.top + a.scrollTop - l.y - d.y;
|
|
5470
5523
|
return {
|
|
5471
5524
|
x: f,
|
|
5472
|
-
y:
|
|
5525
|
+
y: u,
|
|
5473
5526
|
width: r.width,
|
|
5474
5527
|
height: r.height
|
|
5475
5528
|
};
|
|
5476
5529
|
}
|
|
5477
5530
|
function ht(c) {
|
|
5478
|
-
return
|
|
5531
|
+
return N(c).position === "static";
|
|
5479
5532
|
}
|
|
5480
5533
|
function Ot(c, t) {
|
|
5481
|
-
if (!K(c) ||
|
|
5534
|
+
if (!K(c) || N(c).position === "fixed")
|
|
5482
5535
|
return null;
|
|
5483
5536
|
if (t)
|
|
5484
5537
|
return t(c);
|
|
@@ -5487,7 +5540,7 @@ function Ot(c, t) {
|
|
|
5487
5540
|
}
|
|
5488
5541
|
function jt(c, t) {
|
|
5489
5542
|
const e = A(c);
|
|
5490
|
-
if (
|
|
5543
|
+
if (at(c))
|
|
5491
5544
|
return e;
|
|
5492
5545
|
if (!K(c)) {
|
|
5493
5546
|
let s = P(c);
|
|
@@ -5506,7 +5559,7 @@ function jt(c, t) {
|
|
|
5506
5559
|
const hi = async function(c) {
|
|
5507
5560
|
const t = this.getOffsetParent || jt, e = this.getDimensions, i = await e(c.floating);
|
|
5508
5561
|
return {
|
|
5509
|
-
reference:
|
|
5562
|
+
reference: li(c.reference, await t(c.floating), c.strategy),
|
|
5510
5563
|
floating: {
|
|
5511
5564
|
x: 0,
|
|
5512
5565
|
y: 0,
|
|
@@ -5516,7 +5569,7 @@ const hi = async function(c) {
|
|
|
5516
5569
|
};
|
|
5517
5570
|
};
|
|
5518
5571
|
function ci(c) {
|
|
5519
|
-
return
|
|
5572
|
+
return N(c).direction === "rtl";
|
|
5520
5573
|
}
|
|
5521
5574
|
const di = {
|
|
5522
5575
|
convertOffsetParentRelativeRectToViewportRelativeRect: Qe,
|
|
@@ -5525,11 +5578,11 @@ const di = {
|
|
|
5525
5578
|
getOffsetParent: jt,
|
|
5526
5579
|
getElementRects: hi,
|
|
5527
5580
|
getClientRects: ti,
|
|
5528
|
-
getDimensions:
|
|
5581
|
+
getDimensions: ai,
|
|
5529
5582
|
getScale: U,
|
|
5530
5583
|
isElement: X,
|
|
5531
5584
|
isRTL: ci
|
|
5532
|
-
}, Zt = Ye, qt = Fe, Jt =
|
|
5585
|
+
}, Zt = Ye, qt = Fe, Jt = Ne, fi = Xe, Qt = (c, t, e) => {
|
|
5533
5586
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
5534
5587
|
platform: di,
|
|
5535
5588
|
...e
|
|
@@ -5552,7 +5605,7 @@ let xi = class {
|
|
|
5552
5605
|
this.ctx = t;
|
|
5553
5606
|
const { TOOLTIP_BG_COLOR: e, TOOLTIP_TEXT_COLOR: i, TOOLTIP_ZINDEX: s, TOOLTIP_CUSTOM_STYLE: o, CSS_PREFIX: r } = this.ctx.config;
|
|
5554
5607
|
this.contentEl = document.createElement("div"), this.arrowEl = document.createElement("div"), this.floatingEl = document.createElement("div"), this.floatingEl.className = `${r}-tooltip`, this.contentEl.className = `${r}-tooltip-content`, this.arrowEl.className = `${r}-tooltip-arrow`;
|
|
5555
|
-
const
|
|
5608
|
+
const a = {
|
|
5556
5609
|
display: "none",
|
|
5557
5610
|
position: "absolute",
|
|
5558
5611
|
background: e,
|
|
@@ -5563,16 +5616,16 @@ let xi = class {
|
|
|
5563
5616
|
borderRadius: "4px",
|
|
5564
5617
|
fontSize: "12px",
|
|
5565
5618
|
...o
|
|
5566
|
-
},
|
|
5619
|
+
}, l = {
|
|
5567
5620
|
position: "absolute",
|
|
5568
5621
|
width: "10px",
|
|
5569
5622
|
height: "10px",
|
|
5570
|
-
background:
|
|
5571
|
-
backgroundColor:
|
|
5623
|
+
background: a.background,
|
|
5624
|
+
backgroundColor: a.backgroundColor,
|
|
5572
5625
|
transform: "rotate(45deg)",
|
|
5573
|
-
zIndex:
|
|
5626
|
+
zIndex: a.zIndex
|
|
5574
5627
|
};
|
|
5575
|
-
Object.assign(this.arrowEl.style,
|
|
5628
|
+
Object.assign(this.arrowEl.style, l), Object.assign(this.floatingEl.style, a), this.floatingEl.appendChild(this.contentEl), this.floatingEl.appendChild(this.arrowEl), this.ctx.containerElement.appendChild(this.floatingEl), this.init();
|
|
5576
5629
|
}
|
|
5577
5630
|
init() {
|
|
5578
5631
|
this.floatingEl.addEventListener("mouseleave", () => {
|
|
@@ -5620,32 +5673,32 @@ let xi = class {
|
|
|
5620
5673
|
}, this.floatingEl, {
|
|
5621
5674
|
placement: t.overflowTooltipPlacement,
|
|
5622
5675
|
middleware: [qt(), Jt(), Zt(6), fi({ element: this.arrowEl })]
|
|
5623
|
-
}).then((
|
|
5624
|
-
const { x:
|
|
5676
|
+
}).then((a) => {
|
|
5677
|
+
const { x: l, y: h, placement: d, middlewareData: f } = a;
|
|
5625
5678
|
if (Object.assign(this.floatingEl.style, {
|
|
5626
5679
|
top: `${h}px`,
|
|
5627
|
-
left: `${
|
|
5680
|
+
left: `${l}px`
|
|
5628
5681
|
}), f.arrow) {
|
|
5629
|
-
const
|
|
5682
|
+
const u = f.arrow;
|
|
5630
5683
|
["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5631
|
-
top: `${
|
|
5684
|
+
top: `${u.y}px`,
|
|
5632
5685
|
bottom: "",
|
|
5633
5686
|
left: "",
|
|
5634
5687
|
right: "-5px"
|
|
5635
5688
|
}) : ["right", "right-start", "right-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5636
|
-
top: `${
|
|
5689
|
+
top: `${u.y}px`,
|
|
5637
5690
|
bottom: "",
|
|
5638
5691
|
left: "-5px",
|
|
5639
5692
|
right: ""
|
|
5640
5693
|
}) : ["bottom", "bottom-start", "bottom-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5641
5694
|
top: "-5px",
|
|
5642
5695
|
bottom: "",
|
|
5643
|
-
left: `${
|
|
5696
|
+
left: `${u.x}px`,
|
|
5644
5697
|
right: ""
|
|
5645
5698
|
}) : ["top", "top-start", "top-end"].includes(d) && Object.assign(this.arrowEl.style, {
|
|
5646
5699
|
top: "",
|
|
5647
5700
|
bottom: "-5px",
|
|
5648
|
-
left: `${
|
|
5701
|
+
left: `${u.x}px`,
|
|
5649
5702
|
right: ""
|
|
5650
5703
|
});
|
|
5651
5704
|
}
|
|
@@ -5689,15 +5742,15 @@ class ui {
|
|
|
5689
5742
|
return;
|
|
5690
5743
|
if (t.code === "Escape" && this.ctx.editing) {
|
|
5691
5744
|
this.cancel = !0;
|
|
5692
|
-
const { focusCell:
|
|
5693
|
-
|
|
5745
|
+
const { focusCell: l } = this.ctx;
|
|
5746
|
+
l && (this.ctx.emit("setSelectorCell", l), this.cellTarget = l), this.doneEdit();
|
|
5694
5747
|
return;
|
|
5695
5748
|
}
|
|
5696
5749
|
if ((t.altKey || t.metaKey) && t.code === "Enter" && this.ctx.editing && this.inputEl) {
|
|
5697
5750
|
t.preventDefault();
|
|
5698
|
-
const
|
|
5751
|
+
const l = this.inputEl.selectionStart, h = this.inputEl.value.substring(0, l), d = this.inputEl.value.substring(l);
|
|
5699
5752
|
this.inputEl.value = h + `
|
|
5700
|
-
` + d, this.inputEl.selectionStart = this.inputEl.selectionEnd =
|
|
5753
|
+
` + d, this.inputEl.selectionStart = this.inputEl.selectionEnd = l + 1, this.autoSize();
|
|
5701
5754
|
return;
|
|
5702
5755
|
}
|
|
5703
5756
|
if (t.code === "Tab" && this.ctx.editing) {
|
|
@@ -5777,8 +5830,8 @@ class ui {
|
|
|
5777
5830
|
});
|
|
5778
5831
|
}
|
|
5779
5832
|
isInSelectorRange(t, e) {
|
|
5780
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [
|
|
5781
|
-
return !(e < o || e > r || t <
|
|
5833
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [a, l] = s;
|
|
5834
|
+
return !(e < o || e > r || t < a || t > l);
|
|
5782
5835
|
}
|
|
5783
5836
|
initTextEditor() {
|
|
5784
5837
|
this.inputEl = document.createElement("textarea"), this.inputEl.setAttribute("rows", "1"), this.inputEl.addEventListener("input", this.autoSize.bind(this)), this.inputEl.addEventListener("blur", () => {
|
|
@@ -5794,14 +5847,14 @@ class ui {
|
|
|
5794
5847
|
footer: s,
|
|
5795
5848
|
header: o,
|
|
5796
5849
|
config: { SCROLLER_TRACK_SIZE: r }
|
|
5797
|
-
} = this.ctx,
|
|
5798
|
-
this.editorEl.style.bottom = "auto", this.drawY < o.height && (this.editorEl.style.top = `${o.height - 1}px`), this.drawY + t >
|
|
5850
|
+
} = this.ctx, a = i - s.height - r;
|
|
5851
|
+
this.editorEl.style.bottom = "auto", this.drawY < o.height && (this.editorEl.style.top = `${o.height - 1}px`), this.drawY + t > a && (this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = "auto", this.editorEl.style.bottom = `${i - a}px`), this.inputEl.style.height = `${t}px`;
|
|
5799
5852
|
}
|
|
5800
5853
|
startEditByInput(t, e = !1) {
|
|
5801
5854
|
const i = e ? null : t.getValue(), { editorType: s } = t;
|
|
5802
5855
|
t.update(), this.ctx.config.ENABLE_MERGE_CELL_LINK && t.updateSpanInfo();
|
|
5803
|
-
let { height: o, width: r, drawY:
|
|
5804
|
-
this.drawX =
|
|
5856
|
+
let { height: o, width: r, drawY: a, drawX: l } = t;
|
|
5857
|
+
this.drawX = l, this.drawY = a;
|
|
5805
5858
|
const {
|
|
5806
5859
|
config: { CELL_PADDING: h },
|
|
5807
5860
|
header: d
|
|
@@ -5809,8 +5862,8 @@ class ui {
|
|
|
5809
5862
|
let f = this.ctx.body.visibleHeight;
|
|
5810
5863
|
if (o > f && (o = f), this.editorEl.style.display = "inline-block", this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = `${this.drawY - 1}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text") {
|
|
5811
5864
|
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${r - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${r - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${h}px`, i !== null && (this.inputEl.value = i), this.inputEl.focus({ preventScroll: !0 });
|
|
5812
|
-
const
|
|
5813
|
-
this.inputEl.setSelectionRange(
|
|
5865
|
+
const u = this.inputEl.value.length;
|
|
5866
|
+
this.inputEl.setSelectionRange(u, u);
|
|
5814
5867
|
} else
|
|
5815
5868
|
this.inputEl.style.display = "none";
|
|
5816
5869
|
(this.inputEl.scrollHeight > o || this.drawY < d.height) && this.autoSize();
|
|
@@ -5829,11 +5882,11 @@ class ui {
|
|
|
5829
5882
|
const i = this.ctx.focusCell;
|
|
5830
5883
|
if (!i || ["index", "index-selection", "selection"].includes(i.type) || this.enable || (this.ctx.emit("drawView"), !(i.isVerticalVisible() && i.isHorizontalVisible())))
|
|
5831
5884
|
return;
|
|
5832
|
-
const { rowKey: o, key: r, editorType:
|
|
5833
|
-
if (
|
|
5885
|
+
const { rowKey: o, key: r, editorType: a } = i;
|
|
5886
|
+
if (a === "none")
|
|
5834
5887
|
return;
|
|
5835
|
-
const
|
|
5836
|
-
i && !
|
|
5888
|
+
const l = this.ctx.database.getReadonly(o, r);
|
|
5889
|
+
i && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = i, this.startEditByInput(this.cellTarget, t), this.ctx.emit("startEdit", this.cellTarget));
|
|
5837
5890
|
}
|
|
5838
5891
|
editCell(t, e) {
|
|
5839
5892
|
const i = this.ctx.body.renderRows.find((h) => h.rowIndex === t);
|
|
@@ -5846,8 +5899,8 @@ class ui {
|
|
|
5846
5899
|
const o = this.ctx.focusCell;
|
|
5847
5900
|
if (!o || ["index", "index-selection", "selection"].includes(o.type) || this.enable)
|
|
5848
5901
|
return;
|
|
5849
|
-
const { rowKey: r, key:
|
|
5850
|
-
o && !
|
|
5902
|
+
const { rowKey: r, key: a } = o, l = this.ctx.database.getReadonly(r, a);
|
|
5903
|
+
o && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = o, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
5851
5904
|
}
|
|
5852
5905
|
doneEdit() {
|
|
5853
5906
|
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.ctx.containerElement.focus({ preventScroll: !0 }), this.editorEl.style.display = "none", this.ctx.emit("drawView"));
|
|
@@ -5866,14 +5919,14 @@ class gi {
|
|
|
5866
5919
|
n(this, "emptyEl");
|
|
5867
5920
|
this.ctx = t;
|
|
5868
5921
|
const { EMPTY_TEXT: e, EMPTY_CUSTOM_STYLE: i } = this.ctx.config;
|
|
5869
|
-
this.ctx.emptyElement ? this.emptyEl = this.ctx.emptyElement : (this.emptyEl = document.createElement("div"), this.emptyEl.innerText = e), this.emptyEl.className = "e-virt-table-empty", this.emptyEl.style.display = "none", this.ctx.containerElement.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: s, headerHeight: o, bodyHeight: r, footerHeight:
|
|
5870
|
-
const
|
|
5922
|
+
this.ctx.emptyElement ? this.emptyEl = this.ctx.emptyElement : (this.emptyEl = document.createElement("div"), this.emptyEl.innerText = e), this.emptyEl.className = "e-virt-table-empty", this.emptyEl.style.display = "none", this.ctx.containerElement.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: s, headerHeight: o, bodyHeight: r, footerHeight: a }) => {
|
|
5923
|
+
const l = o + (r + a) / 2, h = {
|
|
5871
5924
|
display: s === "empty" ? "block" : "none",
|
|
5872
5925
|
position: "absolute",
|
|
5873
5926
|
fontSize: "14px",
|
|
5874
5927
|
color: "#666",
|
|
5875
5928
|
left: "50%",
|
|
5876
|
-
top: `${
|
|
5929
|
+
top: `${l}px`,
|
|
5877
5930
|
transform: "translate(-50%, -50%)",
|
|
5878
5931
|
...i
|
|
5879
5932
|
};
|
|
@@ -5912,12 +5965,12 @@ class wi {
|
|
|
5912
5965
|
fixedLeftWidth: t,
|
|
5913
5966
|
fixedRightWidth: e,
|
|
5914
5967
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
5915
|
-
} = this.ctx, { visibleWidth: o, visibleHeight: r, renderCellHeaders:
|
|
5916
|
-
let
|
|
5917
|
-
|
|
5918
|
-
g.render && (g.fixed === "left" ? h.push(g) : g.fixed === "right" ? d.push(g) :
|
|
5968
|
+
} = this.ctx, { visibleWidth: o, visibleHeight: r, renderCellHeaders: a } = this.ctx.header;
|
|
5969
|
+
let l = [], h = [], d = [];
|
|
5970
|
+
a.forEach((g) => {
|
|
5971
|
+
g.render && (g.fixed === "left" ? h.push(g) : g.fixed === "right" ? d.push(g) : l.push(g));
|
|
5919
5972
|
});
|
|
5920
|
-
const f = e - i,
|
|
5973
|
+
const f = e - i, u = {
|
|
5921
5974
|
key: "left",
|
|
5922
5975
|
style: {
|
|
5923
5976
|
position: "absolute",
|
|
@@ -5928,7 +5981,7 @@ class wi {
|
|
|
5928
5981
|
height: `${r}px`
|
|
5929
5982
|
},
|
|
5930
5983
|
cells: h
|
|
5931
|
-
},
|
|
5984
|
+
}, x = {
|
|
5932
5985
|
key: "center",
|
|
5933
5986
|
style: {
|
|
5934
5987
|
position: "absolute",
|
|
@@ -5938,7 +5991,7 @@ class wi {
|
|
|
5938
5991
|
width: `${o - t - f + 1}px`,
|
|
5939
5992
|
height: `${r}px`
|
|
5940
5993
|
},
|
|
5941
|
-
cells:
|
|
5994
|
+
cells: l
|
|
5942
5995
|
}, w = {
|
|
5943
5996
|
key: "right",
|
|
5944
5997
|
style: {
|
|
@@ -5960,7 +6013,7 @@ class wi {
|
|
|
5960
6013
|
width: `${o}px`,
|
|
5961
6014
|
height: `${r}px`
|
|
5962
6015
|
},
|
|
5963
|
-
views: [
|
|
6016
|
+
views: [u, x, w]
|
|
5964
6017
|
};
|
|
5965
6018
|
}
|
|
5966
6019
|
getBody() {
|
|
@@ -5974,8 +6027,8 @@ class wi {
|
|
|
5974
6027
|
const {
|
|
5975
6028
|
fixedLeftWidth: o,
|
|
5976
6029
|
fixedRightWidth: r,
|
|
5977
|
-
config: { SCROLLER_TRACK_SIZE:
|
|
5978
|
-
} = this.ctx, { visibleWidth: h, visibleHeight: d } = this.ctx.body, f = r -
|
|
6030
|
+
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX: l }
|
|
6031
|
+
} = this.ctx, { visibleWidth: h, visibleHeight: d } = this.ctx.body, f = r - a, u = {
|
|
5979
6032
|
key: "left",
|
|
5980
6033
|
style: {
|
|
5981
6034
|
position: "absolute",
|
|
@@ -5986,7 +6039,7 @@ class wi {
|
|
|
5986
6039
|
height: `${d}px`
|
|
5987
6040
|
},
|
|
5988
6041
|
cells: e
|
|
5989
|
-
},
|
|
6042
|
+
}, x = {
|
|
5990
6043
|
key: "center",
|
|
5991
6044
|
style: {
|
|
5992
6045
|
position: "absolute",
|
|
@@ -6011,14 +6064,14 @@ class wi {
|
|
|
6011
6064
|
};
|
|
6012
6065
|
return {
|
|
6013
6066
|
type: "body",
|
|
6014
|
-
class: `${
|
|
6067
|
+
class: `${l}-overlayer-body`,
|
|
6015
6068
|
style: {
|
|
6016
6069
|
position: "relative",
|
|
6017
6070
|
overflow: "hidden",
|
|
6018
6071
|
width: `${h}px`,
|
|
6019
6072
|
height: `${d}px`
|
|
6020
6073
|
},
|
|
6021
|
-
views: [
|
|
6074
|
+
views: [u, x, w]
|
|
6022
6075
|
};
|
|
6023
6076
|
}
|
|
6024
6077
|
getFooter() {
|
|
@@ -6031,8 +6084,8 @@ class wi {
|
|
|
6031
6084
|
const {
|
|
6032
6085
|
fixedLeftWidth: s,
|
|
6033
6086
|
fixedRightWidth: o,
|
|
6034
|
-
config: { SCROLLER_TRACK_SIZE: r, CSS_PREFIX:
|
|
6035
|
-
} = this.ctx, { visibleWidth:
|
|
6087
|
+
config: { SCROLLER_TRACK_SIZE: r, CSS_PREFIX: a }
|
|
6088
|
+
} = this.ctx, { visibleWidth: l, visibleHeight: h } = this.ctx.footer, d = o - r, f = {
|
|
6036
6089
|
key: "left",
|
|
6037
6090
|
style: {
|
|
6038
6091
|
position: "absolute",
|
|
@@ -6043,18 +6096,18 @@ class wi {
|
|
|
6043
6096
|
height: `${h}px`
|
|
6044
6097
|
},
|
|
6045
6098
|
cells: e
|
|
6046
|
-
},
|
|
6099
|
+
}, u = {
|
|
6047
6100
|
key: "center",
|
|
6048
6101
|
style: {
|
|
6049
6102
|
position: "absolute",
|
|
6050
6103
|
top: `${0.5}px`,
|
|
6051
6104
|
left: `${s - 0.5}px`,
|
|
6052
6105
|
overflow: "hidden",
|
|
6053
|
-
width: `${
|
|
6106
|
+
width: `${l - s - d}px`,
|
|
6054
6107
|
height: `${h}px`
|
|
6055
6108
|
},
|
|
6056
6109
|
cells: t
|
|
6057
|
-
},
|
|
6110
|
+
}, x = {
|
|
6058
6111
|
key: "right",
|
|
6059
6112
|
style: {
|
|
6060
6113
|
position: "absolute",
|
|
@@ -6068,14 +6121,14 @@ class wi {
|
|
|
6068
6121
|
};
|
|
6069
6122
|
return {
|
|
6070
6123
|
type: "footer",
|
|
6071
|
-
class: `${
|
|
6124
|
+
class: `${a}-overlayer-footer`,
|
|
6072
6125
|
style: {
|
|
6073
6126
|
position: "relative",
|
|
6074
6127
|
overflow: "hidden",
|
|
6075
|
-
width: `${
|
|
6128
|
+
width: `${l}px`,
|
|
6076
6129
|
height: `${h}px`
|
|
6077
6130
|
},
|
|
6078
|
-
views: [f,
|
|
6131
|
+
views: [f, u, x]
|
|
6079
6132
|
};
|
|
6080
6133
|
}
|
|
6081
6134
|
}
|
|
@@ -6090,9 +6143,9 @@ class Ei {
|
|
|
6090
6143
|
this.ctx.on("cellContextMenuClick", (t, e) => {
|
|
6091
6144
|
if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
|
|
6092
6145
|
e.preventDefault();
|
|
6093
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [
|
|
6094
|
-
h >=
|
|
6095
|
-
const
|
|
6146
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [a, l] = s, { rowIndex: h, colIndex: d } = t;
|
|
6147
|
+
h >= a && h <= l && d >= o && d <= r || this.ctx.emit("setSelectorCell", t, e);
|
|
6148
|
+
const u = {
|
|
6096
6149
|
getBoundingClientRect: () => ({
|
|
6097
6150
|
width: 0,
|
|
6098
6151
|
height: 0,
|
|
@@ -6105,11 +6158,11 @@ class Ei {
|
|
|
6105
6158
|
}),
|
|
6106
6159
|
contextElement: document.body
|
|
6107
6160
|
};
|
|
6108
|
-
Qt(
|
|
6161
|
+
Qt(u, this.contextMenuEl, {
|
|
6109
6162
|
placement: "right-start",
|
|
6110
6163
|
middleware: [Zt(), qt(), Jt()]
|
|
6111
|
-
}).then(({ x
|
|
6112
|
-
this.show(
|
|
6164
|
+
}).then(({ x, y: w }) => {
|
|
6165
|
+
this.show(x, w);
|
|
6113
6166
|
});
|
|
6114
6167
|
}), this.ctx.on("click", this.hide.bind(this)), this.ctx.on("onScroll", this.hide.bind(this)), this.ctx.on("resize", this.hide.bind(this));
|
|
6115
6168
|
}
|
|
@@ -6181,14 +6234,14 @@ class yi {
|
|
|
6181
6234
|
n(this, "contextMenu");
|
|
6182
6235
|
n(this, "ctx");
|
|
6183
6236
|
this.options = e;
|
|
6184
|
-
const { overlayerElement: i, editorElement: s, emptyElement: o, contextMenuElement: r } = this.options,
|
|
6237
|
+
const { overlayerElement: i, editorElement: s, emptyElement: o, contextMenuElement: r } = this.options, a = this.createContainer(
|
|
6185
6238
|
t,
|
|
6186
6239
|
i,
|
|
6187
6240
|
s,
|
|
6188
6241
|
o,
|
|
6189
6242
|
r
|
|
6190
6243
|
);
|
|
6191
|
-
this.ctx = new pe(
|
|
6244
|
+
this.ctx = new pe(a, this.options), this.header = new ye(this.ctx), this.footer = new be(this.ctx), this.body = new Ce(this.ctx), this.scroller = new me(this.ctx), this.selector = new Re(this.ctx), this.autofill = new Ie(this.ctx), this.tooltip = new xi(this.ctx), this.empty = new gi(this.ctx), this.editor = new ui(this.ctx), this.overlayer = new wi(this.ctx), this.contextMenu = new Ei(this.ctx), this.ctx.on("draw", () => {
|
|
6192
6245
|
this.draw();
|
|
6193
6246
|
}), this.ctx.on("drawView", () => {
|
|
6194
6247
|
this.draw(!0);
|
|
@@ -6196,16 +6249,16 @@ class yi {
|
|
|
6196
6249
|
}
|
|
6197
6250
|
createContainer(t, e, i, s, o) {
|
|
6198
6251
|
t.className = "e-virt-table-container";
|
|
6199
|
-
const r = document.createElement("div"),
|
|
6200
|
-
r.className = "e-virt-table-stage", t.tabIndex = 0,
|
|
6252
|
+
const r = document.createElement("div"), a = document.createElement("canvas"), l = e || document.createElement("div");
|
|
6253
|
+
r.className = "e-virt-table-stage", t.tabIndex = 0, a.className = "e-virt-table-canvas", l.className = "e-virt-table-overlayer";
|
|
6201
6254
|
const h = i || document.createElement("div");
|
|
6202
6255
|
h.className = "e-virt-table-editor";
|
|
6203
6256
|
const d = s, f = o;
|
|
6204
|
-
return r.appendChild(
|
|
6257
|
+
return r.appendChild(a), r.appendChild(l), t.appendChild(r), {
|
|
6205
6258
|
containerElement: t,
|
|
6206
6259
|
stageElement: r,
|
|
6207
|
-
canvasElement:
|
|
6208
|
-
overlayerElement:
|
|
6260
|
+
canvasElement: a,
|
|
6261
|
+
overlayerElement: l,
|
|
6209
6262
|
editorElement: h,
|
|
6210
6263
|
emptyElement: d,
|
|
6211
6264
|
contextMenuElement: f
|
|
@@ -6293,15 +6346,15 @@ class yi {
|
|
|
6293
6346
|
return new Promise(async (i, s) => {
|
|
6294
6347
|
let o = [];
|
|
6295
6348
|
for (let r = 0; r < t.length; r++) {
|
|
6296
|
-
const { rowKey:
|
|
6349
|
+
const { rowKey: a, key: l } = t[r], h = await this.ctx.database.getValidator(a, l);
|
|
6297
6350
|
Array.isArray(h) && h.length && o.push(h);
|
|
6298
6351
|
}
|
|
6299
6352
|
if (o.length) {
|
|
6300
6353
|
if (s(o), e) {
|
|
6301
6354
|
const [r] = o;
|
|
6302
6355
|
if (Array.isArray(r) && r.length) {
|
|
6303
|
-
const [
|
|
6304
|
-
this.scrollToRowkey(
|
|
6356
|
+
const [a] = r, { rowKey: l, key: h } = a;
|
|
6357
|
+
this.scrollToRowkey(l), this.scrollToColkey(h);
|
|
6305
6358
|
}
|
|
6306
6359
|
}
|
|
6307
6360
|
this.ctx.emit("draw");
|
|
@@ -6318,12 +6371,12 @@ class yi {
|
|
|
6318
6371
|
if (t && Array.isArray(s) && s.length) {
|
|
6319
6372
|
const [o] = s;
|
|
6320
6373
|
if (Array.isArray(o) && o.length) {
|
|
6321
|
-
const [r] = o, { rowKey:
|
|
6374
|
+
const [r] = o, { rowKey: a, key: l } = r, h = this.ctx.database.getRowForRowKey(a);
|
|
6322
6375
|
if (h) {
|
|
6323
6376
|
const { parentRowKeys: d = [] } = h;
|
|
6324
6377
|
d && d.length && this.setExpandRowKeys(d, !0);
|
|
6325
6378
|
}
|
|
6326
|
-
this.scrollToRowkey(
|
|
6379
|
+
this.scrollToRowkey(a), this.scrollToColkey(l);
|
|
6327
6380
|
}
|
|
6328
6381
|
}
|
|
6329
6382
|
i(s);
|
|
@@ -6347,8 +6400,8 @@ class yi {
|
|
|
6347
6400
|
const i = this.ctx.database.getAllRowsData(), s = this.ctx.header.leafCellHeaders;
|
|
6348
6401
|
let o = [];
|
|
6349
6402
|
for (let r = 0; r < i.length; r++)
|
|
6350
|
-
for (let
|
|
6351
|
-
const
|
|
6403
|
+
for (let a = 0; a < s.length; a++) {
|
|
6404
|
+
const l = this.ctx.database.getRowKeyByItem(i[r]), d = s[a].key, f = await this.ctx.database.getValidator(l, d);
|
|
6352
6405
|
Array.isArray(f) && f.length && o.push(f);
|
|
6353
6406
|
}
|
|
6354
6407
|
o.length ? (e(o), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
|
|
@@ -6429,7 +6482,7 @@ class yi {
|
|
|
6429
6482
|
getUtils() {
|
|
6430
6483
|
return {
|
|
6431
6484
|
mergeColCell: he,
|
|
6432
|
-
mergeRowCell:
|
|
6485
|
+
mergeRowCell: le,
|
|
6433
6486
|
getSpanArrByRow: Dt,
|
|
6434
6487
|
getSpanObjByColumn: kt
|
|
6435
6488
|
};
|