e-virt-table 0.1.17 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +683 -677
- 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/BaseCell.d.ts +1 -1
- package/dist/lib/BaseCell.js +1 -1
- package/dist/lib/BaseCell.js.map +1 -1
- package/dist/lib/Body.js +5 -1
- package/dist/lib/Body.js.map +1 -1
- package/dist/lib/Cell.d.ts +3 -4
- package/dist/lib/Cell.js +4 -4
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/CellHeader.d.ts +3 -3
- package/dist/lib/CellHeader.js +8 -8
- package/dist/lib/CellHeader.js.map +1 -1
- package/dist/lib/ContextMenu.d.ts +2 -2
- package/dist/lib/ContextMenu.js +4 -4
- package/dist/lib/ContextMenu.js.map +1 -1
- package/dist/lib/EVirtTable.d.ts +2 -0
- package/dist/lib/EVirtTable.js +6 -0
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/Editor.js +1 -1
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/Header.js +2 -2
- package/dist/lib/Header.js.map +1 -1
- package/dist/lib/types.d.ts +38 -49
- package/dist/lib/util.d.ts +1 -1
- package/dist/lib/util.js +6 -6
- package/dist/lib/util.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--e-virt-table-color-white: #fff;--e-virt-table-color-black: #000000;--e-virt-table-color-primary: rgb(82, 146, 247);--e-virt-table-text-color-primary: #333;--e-virt-table-text-color-regular: #666;--e-virt-table-text-color-secondary: #999;--e-virt-table-box-shadow: 0 2px 12px 0 #0000001a;--e-virt-table-editor-bg-color: #fff;--e-virt-table-border-color: #e1e6eb}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;z-index:10;border-radius:8px;border:1px solid var(--e-virt-table-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(--e-virt-table-editor-bg-color);border:2px solid var(--e-virt-table-color-primary);box-sizing:border-box;box-shadow:var(--e-virt-table-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(--e-virt-table-color-white);overflow-y:auto;resize:none}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--e-virt-table-text-color-regular);background-color:var(--e-virt-table-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--e-virt-table-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(--e-virt-table-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--e-virt-table-color-primary);background-color:#f5f7fa}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
2
|
var me = Object.defineProperty;
|
|
3
3
|
var Ee = (n, t, e) => t in n ? me(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
4
|
-
var
|
|
4
|
+
var h = (n, t, e) => Ee(n, typeof t != "symbol" ? t + "" : t, e);
|
|
5
5
|
function $() {
|
|
6
6
|
return $ = Object.assign ? Object.assign.bind() : function(n) {
|
|
7
7
|
for (var t = 1; t < arguments.length; t++) {
|
|
@@ -39,7 +39,7 @@ function dt(n, t, e) {
|
|
|
39
39
|
return Ce() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
|
|
40
40
|
var a = [null];
|
|
41
41
|
a.push.apply(a, r);
|
|
42
|
-
var
|
|
42
|
+
var l = Function.bind.apply(s, a), c = new l();
|
|
43
43
|
return o && st(c, o.prototype), c;
|
|
44
44
|
}, dt.apply(null, arguments);
|
|
45
45
|
}
|
|
@@ -169,9 +169,9 @@ function Te(n, t, e, i, s) {
|
|
|
169
169
|
return x;
|
|
170
170
|
}), r;
|
|
171
171
|
}
|
|
172
|
-
var o = t.firstFields === !0 ? Object.keys(n) : t.firstFields || [], a = Object.keys(n),
|
|
172
|
+
var o = t.firstFields === !0 ? Object.keys(n) : t.firstFields || [], a = Object.keys(n), l = a.length, c = 0, f = [], d = new Promise(function(x, u) {
|
|
173
173
|
var g = function(p) {
|
|
174
|
-
if (f.push.apply(f, p), c++, c ===
|
|
174
|
+
if (f.push.apply(f, p), c++, c === l)
|
|
175
175
|
return i(f), f.length ? u(new Xt(f, Ct(f))) : x(s);
|
|
176
176
|
};
|
|
177
177
|
a.length || (i(f), x(s)), a.forEach(function(w) {
|
|
@@ -234,15 +234,15 @@ var jt = function(t, e, i, s, r, o) {
|
|
|
234
234
|
(?:` + i + ":){1}(?:(?::" + i + "){0,4}:" + e + "|(?::" + i + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
235
235
|
(?::(?:(?::` + i + "){0,5}:" + e + "|(?::" + i + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
236
236
|
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
237
|
-
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), a = new RegExp("^" + s + "$"),
|
|
237
|
+
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), a = new RegExp("^" + s + "$"), l = function(E) {
|
|
238
238
|
return E && E.exact ? r : new RegExp("(?:" + t(E) + e + t(E) + ")|(?:" + t(E) + s + t(E) + ")", "g");
|
|
239
239
|
};
|
|
240
|
-
|
|
240
|
+
l.v4 = function(m) {
|
|
241
241
|
return m && m.exact ? o : new RegExp("" + t(m) + e + t(m), "g");
|
|
242
|
-
},
|
|
242
|
+
}, l.v6 = function(m) {
|
|
243
243
|
return m && m.exact ? a : new RegExp("" + t(m) + s + t(m), "g");
|
|
244
244
|
};
|
|
245
|
-
var c = "(?:(?:[a-z]+:)?//)", f = "(?:\\S+(?::\\S*)?@)?", d =
|
|
245
|
+
var c = "(?:(?:[a-z]+:)?//)", f = "(?:\\S+(?::\\S*)?@)?", d = l.v4().source, x = l.v6().source, u = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", g = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", w = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", p = "(?::\\d{2,5})?", y = '(?:[/?#][^\\s"]*)?', b = "(?:" + c + "|www\\.)" + f + "(?:localhost|" + d + "|" + x + "|" + u + g + w + ")" + p + y;
|
|
246
246
|
return ct = new RegExp("(?:^" + b + "$)", "i"), ct;
|
|
247
247
|
}, Kt = {
|
|
248
248
|
// http://emailregex.com/
|
|
@@ -300,10 +300,10 @@ var jt = function(t, e, i, s, r, o) {
|
|
|
300
300
|
var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], a = t.type;
|
|
301
301
|
o.indexOf(a) > -1 ? et[a](e) || s.push(M(r.messages.types[a], t.fullField, t.type)) : a && typeof e !== t.type && s.push(M(r.messages.types[a], t.fullField, t.type));
|
|
302
302
|
}, De = function(t, e, i, s, r) {
|
|
303
|
-
var o = typeof t.len == "number", a = typeof t.min == "number",
|
|
303
|
+
var o = typeof t.len == "number", a = typeof t.min == "number", l = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, f = e, d = null, x = typeof e == "number", u = typeof e == "string", g = Array.isArray(e);
|
|
304
304
|
if (x ? d = "number" : u ? d = "string" : g && (d = "array"), !d)
|
|
305
305
|
return !1;
|
|
306
|
-
g && (f = e.length), u && (f = e.replace(c, "_").length), o ? f !== t.len && s.push(M(r.messages[d].len, t.fullField, t.len)) : a && !
|
|
306
|
+
g && (f = e.length), u && (f = e.replace(c, "_").length), o ? f !== t.len && s.push(M(r.messages[d].len, t.fullField, t.len)) : a && !l && f < t.min ? s.push(M(r.messages[d].min, t.fullField, t.min)) : l && !a && f > t.max ? s.push(M(r.messages[d].max, t.fullField, t.max)) : a && l && (f < t.min || f > t.max) && s.push(M(r.messages[d].range, t.fullField, t.min, t.max));
|
|
307
307
|
}, j = "enum", Fe = function(t, e, i, s, r) {
|
|
308
308
|
t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(M(r.messages[j], t.fullField, t[j].join(", ")));
|
|
309
309
|
}, Xe = function(t, e, i, s, r) {
|
|
@@ -416,8 +416,8 @@ var jt = function(t, e, i, s, r, o) {
|
|
|
416
416
|
if (_(e, "date") && !t.required)
|
|
417
417
|
return i();
|
|
418
418
|
if (v.required(t, e, s, o, r), !_(e, "date")) {
|
|
419
|
-
var
|
|
420
|
-
e instanceof Date ?
|
|
419
|
+
var l;
|
|
420
|
+
e instanceof Date ? l = e : l = new Date(e), v.type(t, l, s, o, r), l && v.range(t, l.getTime(), s, o, r);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
i(o);
|
|
@@ -425,8 +425,8 @@ var jt = function(t, e, i, s, r, o) {
|
|
|
425
425
|
var o = [], a = Array.isArray(e) ? "array" : typeof e;
|
|
426
426
|
v.required(t, e, s, o, r, a), i(o);
|
|
427
427
|
}, yt = function(t, e, i, s, r) {
|
|
428
|
-
var o = t.type, a = [],
|
|
429
|
-
if (
|
|
428
|
+
var o = t.type, a = [], l = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
429
|
+
if (l) {
|
|
430
430
|
if (_(e, o) && !t.required)
|
|
431
431
|
return i();
|
|
432
432
|
v.required(t, e, s, a, r, o), _(e, o) || v.type(t, e, s, a, r);
|
|
@@ -533,8 +533,8 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
533
533
|
var o = this;
|
|
534
534
|
s === void 0 && (s = {}), r === void 0 && (r = function() {
|
|
535
535
|
});
|
|
536
|
-
var a = i,
|
|
537
|
-
if (typeof
|
|
536
|
+
var a = i, l = s, c = r;
|
|
537
|
+
if (typeof l == "function" && (c = l, l = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
538
538
|
return c && c(null, a), Promise.resolve(a);
|
|
539
539
|
function f(w) {
|
|
540
540
|
var p = [], y = {};
|
|
@@ -549,12 +549,12 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
549
549
|
b(w[m]);
|
|
550
550
|
p.length ? (y = Ct(p), c(p, y)) : c(null, a);
|
|
551
551
|
}
|
|
552
|
-
if (
|
|
552
|
+
if (l.messages) {
|
|
553
553
|
var d = this.messages();
|
|
554
|
-
d === Rt && (d = vt()), Nt(d,
|
|
554
|
+
d === Rt && (d = vt()), Nt(d, l.messages), l.messages = d;
|
|
555
555
|
} else
|
|
556
|
-
|
|
557
|
-
var x = {}, u =
|
|
556
|
+
l.messages = this.messages();
|
|
557
|
+
var x = {}, u = l.keys || Object.keys(this.rules);
|
|
558
558
|
u.forEach(function(w) {
|
|
559
559
|
var p = o.rules[w], y = a[w];
|
|
560
560
|
p.forEach(function(b) {
|
|
@@ -570,7 +570,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
572
|
var g = {};
|
|
573
|
-
return Te(x,
|
|
573
|
+
return Te(x, l, function(w, p) {
|
|
574
574
|
var y = w.rule, b = (y.type === "object" || y.type === "array") && (typeof y.fields == "object" || typeof y.defaultField == "object");
|
|
575
575
|
b = b && (y.required || !y.required && w.value), y.field = w.field;
|
|
576
576
|
function m(R, T) {
|
|
@@ -582,15 +582,15 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
582
582
|
function E(R) {
|
|
583
583
|
R === void 0 && (R = []);
|
|
584
584
|
var T = Array.isArray(R) ? R : [R];
|
|
585
|
-
!
|
|
585
|
+
!l.suppressWarning && T.length && n.warning("async-validator:", T), T.length && y.message !== void 0 && (T = [].concat(y.message));
|
|
586
586
|
var A = T.map(kt(y, a));
|
|
587
|
-
if (
|
|
587
|
+
if (l.first && A.length)
|
|
588
588
|
return g[y.field] = 1, p(A);
|
|
589
589
|
if (!b)
|
|
590
590
|
p(A);
|
|
591
591
|
else {
|
|
592
592
|
if (y.required && !w.value)
|
|
593
|
-
return y.message !== void 0 ? A = [].concat(y.message).map(kt(y, a)) :
|
|
593
|
+
return y.message !== void 0 ? A = [].concat(y.message).map(kt(y, a)) : l.error && (A = [l.error(y, M(l.messages.required, y.field))]), p(A);
|
|
594
594
|
var L = {};
|
|
595
595
|
y.defaultField && Object.keys(w.value).map(function(I) {
|
|
596
596
|
L[I] = y.defaultField;
|
|
@@ -601,7 +601,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
601
601
|
D[I] = O.map(m.bind(null, I));
|
|
602
602
|
});
|
|
603
603
|
var B = new n(D);
|
|
604
|
-
B.messages(
|
|
604
|
+
B.messages(l.messages), w.rule.options && (w.rule.options.messages = l.messages, w.rule.options.error = l.error), B.validate(w.value, w.rule.options || l, function(I) {
|
|
605
605
|
var S = [];
|
|
606
606
|
A && A.length && S.push.apply(S, A), I && I.length && S.push.apply(S, I), p(S.length ? S : null);
|
|
607
607
|
});
|
|
@@ -609,12 +609,12 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
609
609
|
}
|
|
610
610
|
var C;
|
|
611
611
|
if (y.asyncValidator)
|
|
612
|
-
C = y.asyncValidator(y, w.value, E, w.source,
|
|
612
|
+
C = y.asyncValidator(y, w.value, E, w.source, l);
|
|
613
613
|
else if (y.validator) {
|
|
614
614
|
try {
|
|
615
|
-
C = y.validator(y, w.value, E, w.source,
|
|
615
|
+
C = y.validator(y, w.value, E, w.source, l);
|
|
616
616
|
} catch (R) {
|
|
617
|
-
console.error == null || console.error(R),
|
|
617
|
+
console.error == null || console.error(R), l.suppressValidatorError || setTimeout(function() {
|
|
618
618
|
throw R;
|
|
619
619
|
}, 0), E(R.message);
|
|
620
620
|
}
|
|
@@ -662,17 +662,17 @@ function Zt(n, t) {
|
|
|
662
662
|
}, t - o));
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
|
-
function Jt(n) {
|
|
666
|
-
return n ? n.map((t) => Jt(t.children) + 1).sort((t, e) => e - t)[0] : 0;
|
|
665
|
+
function Jt(n = []) {
|
|
666
|
+
return n.length ? n.map((t) => Jt(t.children) + 1).sort((t, e) => e - t)[0] : 0;
|
|
667
667
|
}
|
|
668
668
|
function Je(n = []) {
|
|
669
669
|
let t = [], e = [], i = [];
|
|
670
670
|
return n.forEach((s) => {
|
|
671
671
|
s.fixed === "left" ? t.push(s) : s.fixed === "right" ? i.push(s) : e.push(s);
|
|
672
672
|
}), [
|
|
673
|
-
...t.sort((s, r) => s.sort - r.sort),
|
|
674
|
-
...e.sort((s, r) => s.sort - r.sort),
|
|
675
|
-
...i.sort((s, r) => s.sort - r.sort)
|
|
673
|
+
...t.sort((s, r) => (s.sort ?? 0) - (r.sort ?? 0)),
|
|
674
|
+
...e.sort((s, r) => (s.sort ?? 0) - (r.sort ?? 0)),
|
|
675
|
+
...i.sort((s, r) => (s.sort ?? 0) - (r.sort ?? 0))
|
|
676
676
|
];
|
|
677
677
|
}
|
|
678
678
|
function Qt(n = [], t = 1, e = 0) {
|
|
@@ -684,7 +684,7 @@ function Qt(n = [], t = 1, e = 0) {
|
|
|
684
684
|
});
|
|
685
685
|
const o = Qt(i.children, t - 1, e + 1);
|
|
686
686
|
return o && o.forEach((a) => {
|
|
687
|
-
s += a.colspan;
|
|
687
|
+
s += a.colspan ?? 0;
|
|
688
688
|
}), {
|
|
689
689
|
...i,
|
|
690
690
|
width: i.width,
|
|
@@ -724,10 +724,10 @@ function ti(n) {
|
|
|
724
724
|
if (n.startsWith('"')) {
|
|
725
725
|
let o = 0, a = !0;
|
|
726
726
|
for (; a; ) {
|
|
727
|
-
const
|
|
728
|
-
|
|
727
|
+
const l = n.slice(0, 1);
|
|
728
|
+
l === '"' && (o += 1), r += l, n = n.slice(1), (n.length === 0 || n.match(/^[\t\r\n]/) && o % 2 === 0) && (a = !1);
|
|
729
729
|
}
|
|
730
|
-
r = r.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (
|
|
730
|
+
r = r.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (l) => new Array(Math.floor(l.length / 2)).fill('"').join(""));
|
|
731
731
|
} else {
|
|
732
732
|
const o = n.match(Qe);
|
|
733
733
|
r = o ? o[0] : "", n = n.slice(r.length);
|
|
@@ -750,24 +750,24 @@ function ei(n) {
|
|
|
750
750
|
class ii {
|
|
751
751
|
//虚拟滚动位置
|
|
752
752
|
constructor(t, e) {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
753
|
+
h(this, "loading", !1);
|
|
754
|
+
h(this, "ctx");
|
|
755
|
+
h(this, "data");
|
|
756
|
+
h(this, "columns");
|
|
757
|
+
h(this, "footerData", []);
|
|
758
|
+
h(this, "rowKeyMap", /* @__PURE__ */ new Map());
|
|
759
|
+
h(this, "colIndexKeyMap", /* @__PURE__ */ new Map());
|
|
760
|
+
h(this, "headerMap", /* @__PURE__ */ new Map());
|
|
761
|
+
h(this, "rowIndexRowKeyMap", /* @__PURE__ */ new Map());
|
|
762
|
+
h(this, "checkboxKeyMap", /* @__PURE__ */ new Map());
|
|
763
|
+
h(this, "originalDataMap", /* @__PURE__ */ new Map());
|
|
764
|
+
h(this, "changedDataMap", /* @__PURE__ */ new Map());
|
|
765
|
+
h(this, "validationErrorMap", /* @__PURE__ */ new Map());
|
|
766
|
+
h(this, "itemRowKeyMap", /* @__PURE__ */ new WeakMap());
|
|
767
|
+
h(this, "bufferData", []);
|
|
768
|
+
h(this, "sumHeight", 0);
|
|
769
|
+
h(this, "filterMethod");
|
|
770
|
+
h(this, "positions", []);
|
|
771
771
|
this.ctx = t;
|
|
772
772
|
const { data: i = [], columns: s = [], footerData: r = [] } = e;
|
|
773
773
|
this.data = i, this.footerData = r, this.columns = s, this.setLoading(!0), this.init();
|
|
@@ -790,9 +790,9 @@ class ii {
|
|
|
790
790
|
t.forEach((i, s) => {
|
|
791
791
|
let r = i._hasChildren || !1;
|
|
792
792
|
Array.isArray(i.children) && i.children.length && (r = !0, this.initData(i.children, e + 1));
|
|
793
|
-
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: a, CELL_HEIGHT:
|
|
793
|
+
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: a, CELL_HEIGHT: l, SELECTABLE_METHOD: c, CHECKBOX_KEY: f } = this.ctx.config, d = i[o], x = d != null ? `${d}` : Ut();
|
|
794
794
|
this.itemRowKeyMap.set(i, x);
|
|
795
|
-
const u = i._height ||
|
|
795
|
+
const u = i._height || l, g = i._readonly;
|
|
796
796
|
let w = !0;
|
|
797
797
|
if (typeof c == "function" && (w = c), f) {
|
|
798
798
|
const p = i[f];
|
|
@@ -874,12 +874,12 @@ class ii {
|
|
|
874
874
|
const i = (r) => {
|
|
875
875
|
r.forEach((o) => {
|
|
876
876
|
t.push(o);
|
|
877
|
-
const a = this.itemRowKeyMap.get(o), { expand:
|
|
877
|
+
const a = this.itemRowKeyMap.get(o), { expand: l, hasChildren: c, height: f } = this.rowKeyMap.get(a), d = this.sumHeight;
|
|
878
878
|
this.sumHeight += f, this.rowIndexRowKeyMap.set(e, a), this.positions.push({
|
|
879
879
|
top: d,
|
|
880
880
|
height: f,
|
|
881
881
|
bottom: this.sumHeight
|
|
882
|
-
}), e += 1,
|
|
882
|
+
}), e += 1, l && c && i(o.children);
|
|
883
883
|
});
|
|
884
884
|
};
|
|
885
885
|
this.rowIndexRowKeyMap.clear();
|
|
@@ -1035,7 +1035,7 @@ class ii {
|
|
|
1035
1035
|
});
|
|
1036
1036
|
});
|
|
1037
1037
|
let a = [];
|
|
1038
|
-
const
|
|
1038
|
+
const l = i.map((f) => {
|
|
1039
1039
|
const d = this.ctx.database.getRowDataItemForRowKey(f.rowKey);
|
|
1040
1040
|
return {
|
|
1041
1041
|
rowKey: f.rowKey,
|
|
@@ -1047,10 +1047,10 @@ class ii {
|
|
|
1047
1047
|
s.forEach((f) => {
|
|
1048
1048
|
a.push(this.ctx.database.getRowDataItemForRowKey(f));
|
|
1049
1049
|
});
|
|
1050
|
-
const c =
|
|
1050
|
+
const c = l.map(({ rowKey: f, key: d }) => this.getValidator(f, d));
|
|
1051
1051
|
Promise.all(c).then(() => {
|
|
1052
1052
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1053
|
-
}), this.ctx.emit("change",
|
|
1053
|
+
}), this.ctx.emit("change", l, a), e && this.ctx.history.pushState({
|
|
1054
1054
|
changeList: i,
|
|
1055
1055
|
scrollX: this.ctx.scrollX,
|
|
1056
1056
|
scrollY: this.ctx.scrollY,
|
|
@@ -1071,15 +1071,15 @@ class ii {
|
|
|
1071
1071
|
if (!this.rowKeyMap.has(t))
|
|
1072
1072
|
return {};
|
|
1073
1073
|
const { item: a } = this.rowKeyMap.get(t);
|
|
1074
|
-
let
|
|
1074
|
+
let l = a[e];
|
|
1075
1075
|
if (this.ctx.database.getReadonly(t, e))
|
|
1076
1076
|
return {
|
|
1077
|
-
oldValue:
|
|
1078
|
-
newValue:
|
|
1077
|
+
oldValue: l,
|
|
1078
|
+
newValue: l
|
|
1079
1079
|
};
|
|
1080
|
-
a[e] !== null && typeof a[e] == "object" && (
|
|
1080
|
+
a[e] !== null && typeof a[e] == "object" && (l = JSON.parse(JSON.stringify(a[e])));
|
|
1081
1081
|
const c = `${t}_${e}`;
|
|
1082
|
-
this.originalDataMap.has(c) || this.originalDataMap.set(c,
|
|
1082
|
+
this.originalDataMap.has(c) || this.originalDataMap.set(c, l);
|
|
1083
1083
|
const f = this.originalDataMap.get(c);
|
|
1084
1084
|
let d = i;
|
|
1085
1085
|
if (o) {
|
|
@@ -1108,7 +1108,7 @@ class ii {
|
|
|
1108
1108
|
}), this.ctx.emit("change", [g], [u]), this.ctx.emit("editChange", {
|
|
1109
1109
|
rowKey: t,
|
|
1110
1110
|
key: e,
|
|
1111
|
-
oldValue:
|
|
1111
|
+
oldValue: l,
|
|
1112
1112
|
value: d,
|
|
1113
1113
|
originalValue: f,
|
|
1114
1114
|
row: u
|
|
@@ -1118,7 +1118,7 @@ class ii {
|
|
|
1118
1118
|
return this.ctx.hasEvent("iterationChange") && this.ctx.emit("iterationChange", {
|
|
1119
1119
|
rowKey: t,
|
|
1120
1120
|
key: e,
|
|
1121
|
-
oldValue:
|
|
1121
|
+
oldValue: l,
|
|
1122
1122
|
value: d,
|
|
1123
1123
|
originalValue: this.originalDataMap.get(c),
|
|
1124
1124
|
row: this.ctx.database.getRowDataItemForRowKey(t)
|
|
@@ -1130,12 +1130,12 @@ class ii {
|
|
|
1130
1130
|
{
|
|
1131
1131
|
rowKey: t,
|
|
1132
1132
|
key: e,
|
|
1133
|
-
oldValue:
|
|
1133
|
+
oldValue: l,
|
|
1134
1134
|
newValue: d
|
|
1135
1135
|
}
|
|
1136
1136
|
]
|
|
1137
1137
|
}), r && this.ctx.emit("draw"), {
|
|
1138
|
-
oldValue:
|
|
1138
|
+
oldValue: l,
|
|
1139
1139
|
newValue: d
|
|
1140
1140
|
};
|
|
1141
1141
|
}
|
|
@@ -1162,8 +1162,8 @@ class ii {
|
|
|
1162
1162
|
return !1;
|
|
1163
1163
|
const { item: s } = this.rowKeyMap.get(t), r = s[i];
|
|
1164
1164
|
this.checkboxKeyMap.has(r) && this.checkboxKeyMap.get(r).forEach((a) => {
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1165
|
+
const l = this.rowKeyMap.get(a);
|
|
1166
|
+
l.check = e;
|
|
1167
1167
|
});
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
@@ -1346,7 +1346,7 @@ class ii {
|
|
|
1346
1346
|
getValidator(t, e) {
|
|
1347
1347
|
return new Promise((i) => {
|
|
1348
1348
|
const s = this.rowKeyMap.get(t), r = this.headerMap.get(e), { BODY_CELL_RULES_METHOD: o } = this.ctx.config, a = r.column;
|
|
1349
|
-
let
|
|
1349
|
+
let l = a.rules;
|
|
1350
1350
|
if (typeof o == "function") {
|
|
1351
1351
|
const f = o({
|
|
1352
1352
|
row: s.item,
|
|
@@ -1355,12 +1355,12 @@ class ii {
|
|
|
1355
1355
|
column: a,
|
|
1356
1356
|
value: this.getItemValue(t, e)
|
|
1357
1357
|
});
|
|
1358
|
-
f && (
|
|
1358
|
+
f && (l = f);
|
|
1359
1359
|
}
|
|
1360
|
-
if (
|
|
1360
|
+
if (l) {
|
|
1361
1361
|
let c = {}, f = {};
|
|
1362
|
-
if (f[e] = this.getItemValue(t, e), Array.isArray(
|
|
1363
|
-
const x =
|
|
1362
|
+
if (f[e] = this.getItemValue(t, e), Array.isArray(l) && l.length) {
|
|
1363
|
+
const x = l.map((u) => ({
|
|
1364
1364
|
...u,
|
|
1365
1365
|
row: s.item,
|
|
1366
1366
|
column: a,
|
|
@@ -1370,7 +1370,7 @@ class ii {
|
|
|
1370
1370
|
c[e] = x;
|
|
1371
1371
|
} else
|
|
1372
1372
|
c[e] = {
|
|
1373
|
-
...
|
|
1373
|
+
...l,
|
|
1374
1374
|
row: s.item,
|
|
1375
1375
|
column: a,
|
|
1376
1376
|
rowIndex: s.rowIndex,
|
|
@@ -1429,9 +1429,9 @@ class ii {
|
|
|
1429
1429
|
}
|
|
1430
1430
|
class si {
|
|
1431
1431
|
constructor(t) {
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1432
|
+
h(this, "ctx");
|
|
1433
|
+
h(this, "history", []);
|
|
1434
|
+
h(this, "historyIndex", -1);
|
|
1435
1435
|
this.ctx = t, this.init();
|
|
1436
1436
|
}
|
|
1437
1437
|
init() {
|
|
@@ -1486,8 +1486,8 @@ class si {
|
|
|
1486
1486
|
}
|
|
1487
1487
|
class ri {
|
|
1488
1488
|
constructor(t) {
|
|
1489
|
-
|
|
1490
|
-
|
|
1489
|
+
h(this, "eventTasks", /* @__PURE__ */ new Map());
|
|
1490
|
+
h(this, "ctx");
|
|
1491
1491
|
this.ctx = t, this.init();
|
|
1492
1492
|
}
|
|
1493
1493
|
init() {
|
|
@@ -1541,7 +1541,7 @@ class ri {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
class oi {
|
|
1543
1543
|
constructor() {
|
|
1544
|
-
|
|
1544
|
+
h(this, "events", /* @__PURE__ */ new Map());
|
|
1545
1545
|
}
|
|
1546
1546
|
has(t) {
|
|
1547
1547
|
return this.events.has(t);
|
|
@@ -1579,7 +1579,7 @@ class oi {
|
|
|
1579
1579
|
}
|
|
1580
1580
|
class ni {
|
|
1581
1581
|
constructor(t) {
|
|
1582
|
-
|
|
1582
|
+
h(this, "ctx");
|
|
1583
1583
|
const e = t.getContext("2d");
|
|
1584
1584
|
if (!e) throw new Error("canvas context not found");
|
|
1585
1585
|
this.ctx = e;
|
|
@@ -1613,21 +1613,21 @@ class ni {
|
|
|
1613
1613
|
* @param {string} color - 阴影的颜色
|
|
1614
1614
|
*/
|
|
1615
1615
|
drawShadow(t, e, i, s, r) {
|
|
1616
|
-
const { fillColor: o, side: a, shadowWidth:
|
|
1616
|
+
const { fillColor: o, side: a, shadowWidth: l, colorStart: c, colorEnd: f } = r;
|
|
1617
1617
|
this.ctx.save(), o && (this.ctx.fillStyle = o, this.ctx.fillRect(t, e, i, s));
|
|
1618
1618
|
let d;
|
|
1619
1619
|
switch (a) {
|
|
1620
1620
|
case "left":
|
|
1621
|
-
d = this.ctx.createLinearGradient(t -
|
|
1621
|
+
d = this.ctx.createLinearGradient(t - l, e, t, e), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t - l, e, l, s);
|
|
1622
1622
|
break;
|
|
1623
1623
|
case "right":
|
|
1624
|
-
d = this.ctx.createLinearGradient(t + i, e, t + i +
|
|
1624
|
+
d = this.ctx.createLinearGradient(t + i, e, t + i + l, e), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t + i, e, l, s);
|
|
1625
1625
|
break;
|
|
1626
1626
|
case "top":
|
|
1627
|
-
d = this.ctx.createLinearGradient(t, e -
|
|
1627
|
+
d = this.ctx.createLinearGradient(t, e - l, t, e), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t, e - l, i, l);
|
|
1628
1628
|
break;
|
|
1629
1629
|
case "bottom":
|
|
1630
|
-
d = this.ctx.createLinearGradient(t, e + s, t, e + s +
|
|
1630
|
+
d = this.ctx.createLinearGradient(t, e + s, t, e + s + l), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t, e + s, i, l);
|
|
1631
1631
|
break;
|
|
1632
1632
|
default:
|
|
1633
1633
|
console.error("Invalid side specified for shadow");
|
|
@@ -1648,11 +1648,11 @@ class ni {
|
|
|
1648
1648
|
drawImage(t, e, i, s, r) {
|
|
1649
1649
|
this.ctx.save(), this.ctx.drawImage(t, e, i, s, r), this.ctx.restore();
|
|
1650
1650
|
}
|
|
1651
|
-
drawRect(t, e, i, s, { borderWidth: r = 1, borderColor: o, fillColor: a, radius:
|
|
1652
|
-
if (this.ctx.save(), this.ctx.beginPath(), a !== void 0 && (this.ctx.fillStyle = a), o !== void 0 && (this.ctx.lineWidth = r, this.ctx.strokeStyle = o),
|
|
1651
|
+
drawRect(t, e, i, s, { borderWidth: r = 1, borderColor: o, fillColor: a, radius: l = 0 } = {}) {
|
|
1652
|
+
if (this.ctx.save(), this.ctx.beginPath(), a !== void 0 && (this.ctx.fillStyle = a), o !== void 0 && (this.ctx.lineWidth = r, this.ctx.strokeStyle = o), l === 0)
|
|
1653
1653
|
this.ctx.rect(t - 0.5, e - 0.5, i, s);
|
|
1654
1654
|
else {
|
|
1655
|
-
const [c, f, d, x] = typeof
|
|
1655
|
+
const [c, f, d, x] = typeof l == "number" ? [l, l, l, l] : l;
|
|
1656
1656
|
this.ctx.moveTo(t + c, e), this.ctx.arcTo(t + i, e, t + i, e + f, f), this.ctx.arcTo(t + i, e + s, t + i - d, e + s, d), this.ctx.arcTo(t, e + s, t, e + s - x, x), this.ctx.arcTo(t, e, t + c, e, c);
|
|
1657
1657
|
}
|
|
1658
1658
|
a !== void 0 && this.ctx.fill(), o !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
@@ -1671,16 +1671,16 @@ class ni {
|
|
|
1671
1671
|
this.ctx.save();
|
|
1672
1672
|
const {
|
|
1673
1673
|
font: a = "12px Arial",
|
|
1674
|
-
align:
|
|
1674
|
+
align: l = "center",
|
|
1675
1675
|
color: c = "#495060",
|
|
1676
1676
|
padding: f = 0,
|
|
1677
1677
|
verticalAlign: d = "middle"
|
|
1678
1678
|
} = o;
|
|
1679
|
-
this.ctx.font = a, this.ctx.fillStyle = c, this.ctx.textBaseline = d, this.ctx.textAlign =
|
|
1679
|
+
this.ctx.font = a, this.ctx.fillStyle = c, this.ctx.textBaseline = d, this.ctx.textAlign = l;
|
|
1680
1680
|
let x = 0;
|
|
1681
1681
|
d === "top" ? x = i + f : d === "bottom" ? x = i + r - f : x = i + (r + 1) / 2;
|
|
1682
1682
|
let u = 0;
|
|
1683
|
-
|
|
1683
|
+
l === "left" ? u = e + f : l === "right" ? u = e + s - f : u = e + s / 2;
|
|
1684
1684
|
const { _text: g, ellipsis: w } = this.handleEllipsis(t, s, f, a);
|
|
1685
1685
|
return this.ctx.fillText(g, u, x), this.ctx.restore(), w;
|
|
1686
1686
|
}
|
|
@@ -1691,8 +1691,8 @@ class ni {
|
|
|
1691
1691
|
_text: "",
|
|
1692
1692
|
ellipsis: r
|
|
1693
1693
|
};
|
|
1694
|
-
const a = this.ctx.measureText("...").width,
|
|
1695
|
-
if (
|
|
1694
|
+
const a = this.ctx.measureText("...").width, l = this.ctx.measureText(t).width;
|
|
1695
|
+
if (l && l + a >= e - i * 2) {
|
|
1696
1696
|
r = !0;
|
|
1697
1697
|
let c = 0;
|
|
1698
1698
|
for (let f = 0; f < t.length; f++)
|
|
@@ -1709,131 +1709,131 @@ class ni {
|
|
|
1709
1709
|
}
|
|
1710
1710
|
class Wt {
|
|
1711
1711
|
constructor(t) {
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1712
|
+
h(this, "PROCESSOR_NUM", 50);
|
|
1713
|
+
h(this, "CSS_PREFIX", "e-virt-table");
|
|
1714
|
+
h(this, "ICONS", []);
|
|
1715
|
+
h(this, "ROW_KEY", "");
|
|
1716
|
+
h(this, "HEADER_FONT", "12px normal Arial");
|
|
1717
|
+
h(this, "BODY_FONT", "12px normal Arial");
|
|
1718
|
+
h(this, "BORDER_COLOR", "#e1e6eb");
|
|
1719
|
+
h(this, "WIDTH", 0);
|
|
1720
|
+
h(this, "RESIZE_MIN_WIDTH", 40);
|
|
1721
|
+
h(this, "HEIGHT", 0);
|
|
1722
|
+
h(this, "EMPTY_BODY_HEIGHT", 120);
|
|
1723
|
+
h(this, "EMPTY_CUSTOM_STYLE", {});
|
|
1724
|
+
h(this, "EMPTY_TEXT", "暂无数据");
|
|
1725
|
+
h(this, "MAX_HEIGHT", 1e3);
|
|
1726
|
+
h(this, "BORDER_RADIUS", 8);
|
|
1727
|
+
h(this, "ENABLE_OFFSET_HEIGHT", !1);
|
|
1728
|
+
h(this, "OFFSET_HEIGHT", 0);
|
|
1729
|
+
h(this, "HEADER_HEIGHT", 36);
|
|
1730
|
+
h(this, "ENABLE_HEADER_STICKY", !1);
|
|
1731
1731
|
// 启用头部固定,需要外面实现覆盖层,或者所有表头都要是元素
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1732
|
+
h(this, "HEADER_BG_COLOR", "#F8FAFF");
|
|
1733
|
+
h(this, "BODY_BG_COLOR", "#FFF");
|
|
1734
|
+
h(this, "HEADER_TEXT_COLOR", "#1D2129");
|
|
1735
|
+
h(this, "LOADING_ICON_SVG", "");
|
|
1736
|
+
h(this, "LOADING_ICON_COLOR", "#4E5969");
|
|
1737
|
+
h(this, "EXPAND_ICON_SVG", "");
|
|
1738
|
+
h(this, "SHRINK_ICON_SVG", "");
|
|
1739
|
+
h(this, "EXPAND_ICON_COLOR", "#4E5969");
|
|
1740
|
+
h(this, "SHRINK_ICON_COLOR", "#4E5969");
|
|
1741
|
+
h(this, "ERROR_TIP_ICON_COLOR", "red");
|
|
1742
|
+
h(this, "ERROR_TIP_ICON_SIZE", 6);
|
|
1743
|
+
h(this, "EXPAND_LAZY", !0);
|
|
1744
|
+
h(this, "DEFAULT_EXPAND_ALL", !1);
|
|
1745
|
+
h(this, "CELL_WIDTH", 100);
|
|
1746
|
+
h(this, "CELL_HEIGHT", 36);
|
|
1747
|
+
h(this, "CELL_PADDING", 8);
|
|
1748
|
+
h(this, "CELL_HOVER_ICON_SIZE", 20);
|
|
1749
|
+
h(this, "SCROLLER_TRACK_SIZE", 14);
|
|
1750
|
+
h(this, "SCROLLER_SIZE", 8);
|
|
1751
|
+
h(this, "SCROLLER_COLOR", "#dee0e3");
|
|
1752
|
+
h(this, "SCROLLER_TRACK_COLOR", "#fff");
|
|
1753
|
+
h(this, "SCROLLER_FOCUS_COLOR", "#bbbec4");
|
|
1754
|
+
h(this, "SELECT_BORDER_COLOR", "rgb(82,146,247)");
|
|
1755
|
+
h(this, "SELECT_AREA_COLOR", "rgba(82,146,247,0.1)");
|
|
1756
|
+
h(this, "SELECT_BG_COLOR", "rgba(82,146,247,0.1)");
|
|
1757
|
+
h(this, "EDIT_BG_COLOR", "#fcf6ed");
|
|
1758
|
+
h(this, "CHECKBOX_KEY", "");
|
|
1759
|
+
h(this, "CHECKBOX_COLOR", "rgb(82,146,247)");
|
|
1760
|
+
h(this, "CHECKBOX_SIZE", 20);
|
|
1761
|
+
h(this, "CHECKBOX_DISABLED_SVG", "");
|
|
1762
|
+
h(this, "CHECKBOX_CHECK_SVG", "");
|
|
1763
|
+
h(this, "CHECKBOX_UNCHECK_SVG", "");
|
|
1764
|
+
h(this, "CHECKBOX_INDETERMINATE_SVG", "");
|
|
1765
|
+
h(this, "READONLY_COLOR", "#fff");
|
|
1766
|
+
h(this, "READONLY_TEXT_COLOR", "#4E5969");
|
|
1767
|
+
h(this, "ERROR_TIP_COLOR", "#ED3F14");
|
|
1768
|
+
h(this, "FOOTER_BG_COLOR", "#fafafa");
|
|
1769
|
+
h(this, "FOOTER_FIXED", !0);
|
|
1770
|
+
h(this, "CELL_FOOTER_HEIGHT", 36);
|
|
1771
|
+
h(this, "ENABLE_SELECTOR", !1);
|
|
1772
|
+
h(this, "ENABLE_EDIT_SINGLE_CLICK", !1);
|
|
1773
1773
|
// 启用单点击立马编辑
|
|
1774
|
-
|
|
1774
|
+
h(this, "ENABLE_EDIT_CLICK_SELECTOR", !0);
|
|
1775
1775
|
// 启用点击选择器编辑
|
|
1776
|
-
|
|
1776
|
+
h(this, "SELECTOR_AREA_MIN_X", 0);
|
|
1777
1777
|
// 选择器X最小范围
|
|
1778
|
-
|
|
1778
|
+
h(this, "SELECTOR_AREA_MAX_X_OFFSET", 0);
|
|
1779
1779
|
// 选择器X最大范围colMax - offset
|
|
1780
|
-
|
|
1780
|
+
h(this, "SELECTOR_AREA_MAX_X", 0);
|
|
1781
1781
|
// 选择器X最大范围,0默认最大colMax
|
|
1782
|
-
|
|
1782
|
+
h(this, "SELECTOR_AREA_MIN_Y", 0);
|
|
1783
1783
|
// 选择器Y最小范围
|
|
1784
|
-
|
|
1784
|
+
h(this, "SELECTOR_AREA_MAX_Y", 0);
|
|
1785
1785
|
// 选择器Y最大范围,0默认rowMax
|
|
1786
|
-
|
|
1786
|
+
h(this, "SELECTOR_AREA_MAX_Y_OFFSET", 0);
|
|
1787
1787
|
// 选择器Y最大范围,0默认rowMax
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1788
|
+
h(this, "ENABLE_SELECTOR_SINGLE", !1);
|
|
1789
|
+
h(this, "ENABLE_SELECTOR_SPAN_COL", !0);
|
|
1790
|
+
h(this, "ENABLE_SELECTOR_SPAN_ROW", !0);
|
|
1791
|
+
h(this, "ENABLE_SELECTOR_ALL_ROWS", !0);
|
|
1792
|
+
h(this, "ENABLE_SELECTOR_ALL_COLS", !0);
|
|
1793
|
+
h(this, "ENABLE_AUTOFILL", !1);
|
|
1794
|
+
h(this, "ENABLE_CONTEXT_MENU", !1);
|
|
1795
|
+
h(this, "ENABLE_COPY", !0);
|
|
1796
|
+
h(this, "ENABLE_PASTER", !0);
|
|
1797
|
+
h(this, "ENABLE_RESIZE_ROW", !0);
|
|
1798
|
+
h(this, "ENABLE_RESIZE_COLUMN", !0);
|
|
1799
|
+
h(this, "RESIZE_ROW_LINE_COLOR", "#e1e6eb");
|
|
1800
|
+
h(this, "RESIZE_COLUMN_LINE_COLOR", "#e1e6eb");
|
|
1801
|
+
h(this, "RESIZE_ROW_MIN_HEIGHT", 36);
|
|
1802
|
+
h(this, "RESIZE_COLUMN_MIN_WIDTH", 40);
|
|
1803
|
+
h(this, "ENABLE_KEYBOARD", !0);
|
|
1804
|
+
h(this, "ENABLE_HISTORY", !1);
|
|
1805
|
+
h(this, "ENABLE_VALIDATOR_IMMEDIATE", !0);
|
|
1806
|
+
h(this, "HISTORY_NUM", 50);
|
|
1807
|
+
h(this, "HIGHLIGHT_HOVER_ROW", !1);
|
|
1808
|
+
h(this, "HIGHLIGHT_HOVER_ROW_COLOR", "rgba(186,203,231,0.1)");
|
|
1809
|
+
h(this, "HIGHLIGHT_SELECTED_ROW", !1);
|
|
1810
|
+
h(this, "HIGHLIGHT_SELECTED_ROW_COLOR", "rgba(82,146,247,0.1)");
|
|
1811
|
+
h(this, "TOOLTIP_BG_COLOR", "#303133");
|
|
1812
|
+
h(this, "TOOLTIP_TEXT_COLOR", "#fff");
|
|
1813
|
+
h(this, "TOOLTIP_ZINDEX", 3e3);
|
|
1814
|
+
h(this, "TOOLTIP_CUSTOM_STYLE", {});
|
|
1815
|
+
h(this, "CONTEXT_MENU", [
|
|
1816
1816
|
{ label: "复制", value: "copy" },
|
|
1817
1817
|
{ label: "剪切", value: "cut" },
|
|
1818
1818
|
{ label: "粘贴", value: "paste" },
|
|
1819
1819
|
{ label: "清空选中内容", value: "clearSelected" }
|
|
1820
1820
|
]);
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1821
|
+
h(this, "HEADER_CELL_STYLE_METHOD");
|
|
1822
|
+
h(this, "BODY_CELL_STYLE_METHOD");
|
|
1823
|
+
h(this, "FOOTER_CELL_STYLE_METHOD");
|
|
1824
|
+
h(this, "BODY_CELL_READONLY_METHOD");
|
|
1825
|
+
h(this, "BODY_CELL_FORMATTER_METHOD");
|
|
1826
|
+
h(this, "BODY_CELL_RULES_METHOD");
|
|
1827
|
+
h(this, "BODY_CELL_TYPE_METHOD");
|
|
1828
|
+
h(this, "BODY_CELL_EDITOR_TYPE_METHOD");
|
|
1829
|
+
h(this, "BODY_CELL_RENDER_METHOD");
|
|
1830
|
+
h(this, "BODY_CELL_HOVER_ICON_METHOD");
|
|
1831
|
+
h(this, "SPAN_METHOD");
|
|
1832
|
+
h(this, "SELECTABLE_METHOD");
|
|
1833
|
+
h(this, "EXPAND_LAZY_METHOD");
|
|
1834
|
+
h(this, "BEFORE_VALUE_CHANGE_METHOD");
|
|
1835
|
+
h(this, "BEFORE_PASTE_CHANGE_METHOD");
|
|
1836
|
+
h(this, "BEFORE_AUTOFILL_CHANGE_METHOD");
|
|
1837
1837
|
Object.assign(this, t);
|
|
1838
1838
|
}
|
|
1839
1839
|
init(t) {
|
|
@@ -1842,8 +1842,8 @@ class Wt {
|
|
|
1842
1842
|
}
|
|
1843
1843
|
class ai {
|
|
1844
1844
|
constructor(t) {
|
|
1845
|
-
|
|
1846
|
-
|
|
1845
|
+
h(this, "ctx");
|
|
1846
|
+
h(this, "list", [
|
|
1847
1847
|
{
|
|
1848
1848
|
name: "loading",
|
|
1849
1849
|
configName: "LOADING_ICON_SVG",
|
|
@@ -1905,7 +1905,7 @@ class ai {
|
|
|
1905
1905
|
color: ""
|
|
1906
1906
|
}
|
|
1907
1907
|
]);
|
|
1908
|
-
|
|
1908
|
+
h(this, "icons", /* @__PURE__ */ new Map());
|
|
1909
1909
|
this.ctx = t, this.init();
|
|
1910
1910
|
}
|
|
1911
1911
|
async init() {
|
|
@@ -1939,8 +1939,8 @@ class ai {
|
|
|
1939
1939
|
});
|
|
1940
1940
|
const o = new Image(), a = new Blob([new XMLSerializer().serializeToString(r)], {
|
|
1941
1941
|
type: "image/svg+xml"
|
|
1942
|
-
}),
|
|
1943
|
-
return o.src =
|
|
1942
|
+
}), l = URL.createObjectURL(a);
|
|
1943
|
+
return o.src = l, new Promise((c, f) => {
|
|
1944
1944
|
o.onerror = () => f(new Error("Failed to load image")), o.onload = () => {
|
|
1945
1945
|
c(o);
|
|
1946
1946
|
};
|
|
@@ -1952,14 +1952,14 @@ class ai {
|
|
|
1952
1952
|
}
|
|
1953
1953
|
class te {
|
|
1954
1954
|
constructor(t, e, i, s, r, o, a) {
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
this.ctx = t, this.x = e, this.y = i, this.width = s, this.height = r, this.fixed =
|
|
1955
|
+
h(this, "ctx");
|
|
1956
|
+
h(this, "x", 0);
|
|
1957
|
+
h(this, "y", 0);
|
|
1958
|
+
h(this, "width", 0);
|
|
1959
|
+
h(this, "height", 0);
|
|
1960
|
+
h(this, "fixed");
|
|
1961
|
+
h(this, "cellType");
|
|
1962
|
+
this.ctx = t, this.x = e, this.y = i, this.width = s, this.height = r, this.fixed = a, this.cellType = o;
|
|
1963
1963
|
}
|
|
1964
1964
|
isHorizontalVisible() {
|
|
1965
1965
|
if (this.fixed)
|
|
@@ -1997,58 +1997,58 @@ class te {
|
|
|
1997
1997
|
}
|
|
1998
1998
|
}
|
|
1999
1999
|
class ee extends te {
|
|
2000
|
-
constructor(e, i, s, r, o, a,
|
|
2001
|
-
super(e, r, o, a,
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = c.key, this.type = c.type || "
|
|
2000
|
+
constructor(e, i, s, r, o, a, l, c, f, d = "body") {
|
|
2001
|
+
super(e, r, o, a, l, d, c.fixed);
|
|
2002
|
+
h(this, "formatter");
|
|
2003
|
+
h(this, "formatterFooter");
|
|
2004
|
+
h(this, "hoverIconName", "");
|
|
2005
|
+
h(this, "operation", !1);
|
|
2006
|
+
h(this, "align");
|
|
2007
|
+
h(this, "verticalAlign");
|
|
2008
|
+
h(this, "fixed");
|
|
2009
|
+
h(this, "type");
|
|
2010
|
+
h(this, "editorType");
|
|
2011
|
+
h(this, "cellType");
|
|
2012
|
+
h(this, "level");
|
|
2013
|
+
h(this, "colspan", 1);
|
|
2014
|
+
h(this, "rowspan", 1);
|
|
2015
|
+
h(this, "key");
|
|
2016
|
+
h(this, "column");
|
|
2017
|
+
h(this, "rowIndex");
|
|
2018
|
+
h(this, "colIndex");
|
|
2019
|
+
h(this, "rowKey");
|
|
2020
|
+
h(this, "row");
|
|
2021
|
+
h(this, "value");
|
|
2022
|
+
h(this, "render");
|
|
2023
|
+
h(this, "renderFooter");
|
|
2024
|
+
h(this, "style", {});
|
|
2025
|
+
h(this, "rules", {});
|
|
2026
|
+
h(this, "message", "");
|
|
2027
|
+
h(this, "text", "");
|
|
2028
|
+
h(this, "displayText", "");
|
|
2029
|
+
h(this, "visibleWidth", 0);
|
|
2030
|
+
h(this, "visibleHeight", 0);
|
|
2031
|
+
h(this, "isHasChanged", !1);
|
|
2032
|
+
h(this, "drawX", 0);
|
|
2033
|
+
h(this, "drawY", 0);
|
|
2034
|
+
h(this, "drawCellBgColor", "");
|
|
2035
|
+
h(this, "drawCellSkyBgColor", "");
|
|
2036
|
+
h(this, "drawTextColor", "");
|
|
2037
|
+
h(this, "drawTextX", 0);
|
|
2038
|
+
h(this, "drawTextY", 0);
|
|
2039
|
+
h(this, "drawImageX", 0);
|
|
2040
|
+
h(this, "drawImageY", 0);
|
|
2041
|
+
h(this, "drawImageWidth", 0);
|
|
2042
|
+
h(this, "drawImageHeight", 0);
|
|
2043
|
+
h(this, "drawImageName", "");
|
|
2044
|
+
h(this, "drawImageSource");
|
|
2045
|
+
h(this, "ellipsis", !1);
|
|
2046
|
+
h(this, "rowExpand", !1);
|
|
2047
|
+
h(this, "rowHasChildren", !1);
|
|
2048
|
+
h(this, "overflowTooltipShow", !0);
|
|
2049
|
+
h(this, "overflowTooltipMaxWidth", 500);
|
|
2050
|
+
h(this, "overflowTooltipPlacement", "top");
|
|
2051
|
+
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = c.key, this.type = c.type || "", this.editorType = c.editorType || "text", this.cellType = d, this.align = c.align || "center", this.verticalAlign = c.verticalAlign || "middle", this.fixed = c.fixed, this.level = c.level || 0, this.operation = c.operation || !1, this.column = c, this.rules = c.rules || {}, this.row = f, this.rowKey = this.cellType === "body" ? this.ctx.database.getRowKeyForRowIndex(i) : `${this.cellType}_${this.rowIndex}`, this.value = this.getValue(), this.render = c.render, this.overflowTooltipShow = c.overflowTooltipShow !== !1, this.overflowTooltipMaxWidth = c.overflowTooltipMaxWidth || 500, this.overflowTooltipPlacement = c.overflowTooltipPlacement || "top", this.renderFooter = c.renderFooter, this.hoverIconName = c.hoverIconName, this.formatter = c.formatter, this.formatterFooter = c.formatterFooter, this.update();
|
|
2052
2052
|
}
|
|
2053
2053
|
getValidationMessage() {
|
|
2054
2054
|
const e = this.ctx.database.getValidationError(this.rowKey, this.key);
|
|
@@ -2142,7 +2142,7 @@ class ee extends te {
|
|
|
2142
2142
|
const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
|
|
2143
2143
|
let r, o = 0, a = "";
|
|
2144
2144
|
if (this.type === "tree" && s === "body") {
|
|
2145
|
-
const
|
|
2145
|
+
const l = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: f = !1, expandLoading: d = !1, level: x = 0 } = l || {};
|
|
2146
2146
|
if (this.rowExpand = c, this.rowHasChildren = f, d) {
|
|
2147
2147
|
const u = this.ctx.icons.get("loading");
|
|
2148
2148
|
a = "loading", r = u, o = x * 8;
|
|
@@ -2165,7 +2165,7 @@ class ee extends te {
|
|
|
2165
2165
|
FOOTER_CELL_STYLE_METHOD: r,
|
|
2166
2166
|
READONLY_TEXT_COLOR: o,
|
|
2167
2167
|
FOOTER_BG_COLOR: a,
|
|
2168
|
-
HIGHLIGHT_SELECTED_ROW:
|
|
2168
|
+
HIGHLIGHT_SELECTED_ROW: l,
|
|
2169
2169
|
HIGHLIGHT_SELECTED_ROW_COLOR: c,
|
|
2170
2170
|
HIGHLIGHT_HOVER_ROW: f,
|
|
2171
2171
|
HIGHLIGHT_HOVER_ROW_COLOR: d
|
|
@@ -2187,7 +2187,7 @@ class ee extends te {
|
|
|
2187
2187
|
}
|
|
2188
2188
|
let x = "transparent";
|
|
2189
2189
|
const u = this.ctx.focusCell, g = this.ctx.hoverCell;
|
|
2190
|
-
f && (g == null ? void 0 : g.rowKey) === this.rowKey && (x = d),
|
|
2190
|
+
f && (g == null ? void 0 : g.rowKey) === this.rowKey && (x = d), l && (u == null ? void 0 : u.rowKey) === this.rowKey && (x = c), this.drawCellSkyBgColor = x;
|
|
2191
2191
|
let w = e, p = o;
|
|
2192
2192
|
if (["index", "index-selection", "selection"].includes(this.type)) {
|
|
2193
2193
|
this.drawCellBgColor = e, this.drawTextColor = o;
|
|
@@ -2207,24 +2207,24 @@ class ee extends te {
|
|
|
2207
2207
|
this.drawCellBgColor = w, this.drawTextColor = p;
|
|
2208
2208
|
}
|
|
2209
2209
|
updateSelection() {
|
|
2210
|
-
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: a, rowIndex:
|
|
2210
|
+
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: a, rowIndex: l, rowKey: c } = this;
|
|
2211
2211
|
if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(a)) {
|
|
2212
2212
|
const f = this.ctx.database.getRowSelection(c), d = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: x = 0 } = this.ctx.config, u = this.drawX + (e - x) / 2, g = this.drawY + (i - x) / 2;
|
|
2213
2213
|
let w = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck";
|
|
2214
|
-
f && d ? (w = this.ctx.icons.get("checkbox-check"), p = "checkbox-check") : f && d ? (w = this.ctx.icons.get("checkbox-check-disabled"), p = "checkbox-check-disabled") : !f && d ? (w = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), p = "checkbox-disabled"), w && a == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex ===
|
|
2214
|
+
f && d ? (w = this.ctx.icons.get("checkbox-check"), p = "checkbox-check") : f && d ? (w = this.ctx.icons.get("checkbox-check-disabled"), p = "checkbox-check-disabled") : !f && d ? (w = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), p = "checkbox-disabled"), w && a == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(p)) && (this.drawImageX = u, this.drawImageY = g, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = p, this.drawImageSource = w) : w && a === "selection" && (this.drawImageX = u, this.drawImageY = g, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = p, this.drawImageSource = w);
|
|
2215
2215
|
}
|
|
2216
2216
|
}
|
|
2217
2217
|
updateHoverIcon() {
|
|
2218
2218
|
const { BODY_CELL_HOVER_ICON_METHOD: e, CELL_HOVER_ICON_SIZE: i, CELL_PADDING: s } = this.ctx.config;
|
|
2219
2219
|
if (typeof e == "function") {
|
|
2220
|
-
const
|
|
2220
|
+
const l = e({
|
|
2221
2221
|
row: this.row,
|
|
2222
2222
|
rowIndex: this.rowIndex,
|
|
2223
2223
|
colIndex: this.colIndex,
|
|
2224
2224
|
column: this.column,
|
|
2225
2225
|
value: this.getValue()
|
|
2226
2226
|
});
|
|
2227
|
-
|
|
2227
|
+
l !== void 0 && (this.hoverIconName = l);
|
|
2228
2228
|
}
|
|
2229
2229
|
const r = this.drawX + this.width - i - s, o = this.drawY + (this.height - i) / 2;
|
|
2230
2230
|
if (this.hoverIconName && this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === this.rowIndex) {
|
|
@@ -2348,8 +2348,8 @@ class ee extends te {
|
|
|
2348
2348
|
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s } = this.ctx.config;
|
|
2349
2349
|
if (!s || !i)
|
|
2350
2350
|
return;
|
|
2351
|
-
const { xArr: r, yArr: o } = this.ctx.selector, a = r[1],
|
|
2352
|
-
c === a && f ===
|
|
2351
|
+
const { xArr: r, yArr: o } = this.ctx.selector, a = r[1], l = o[1], { colIndex: c, rowIndex: f, drawX: d, drawY: x } = this;
|
|
2352
|
+
c === a && f === l && this.ctx.paint.drawRect(d + this.width - 6, x + this.height - 6, 6, 6, {
|
|
2353
2353
|
borderColor: "#fff",
|
|
2354
2354
|
fillColor: e
|
|
2355
2355
|
});
|
|
@@ -2404,31 +2404,31 @@ class ee extends te {
|
|
|
2404
2404
|
}
|
|
2405
2405
|
drawBorder(e) {
|
|
2406
2406
|
const { drawX: i, drawY: s, width: r, rowIndex: o, colIndex: a } = this;
|
|
2407
|
-
let
|
|
2408
|
-
o === 0 && (c = this.y + 1, f = f - 1), a === this.ctx.maxColIndex && (
|
|
2407
|
+
let l = i + 0.5, c = s + 0.5, f = this.height;
|
|
2408
|
+
o === 0 && (c = this.y + 1, f = f - 1), a === this.ctx.maxColIndex && (l = l - 1);
|
|
2409
2409
|
const { xArr: d, yArr: x, lineDash: u = [], borderWidth: g = 1, borderColor: w, fillColor: p } = e, y = d[0], b = d[1], m = x[0], E = x[1];
|
|
2410
|
-
a >= y && a <= b && o === m && this.ctx.paint.drawLine([
|
|
2410
|
+
a >= y && a <= b && o === m && this.ctx.paint.drawLine([l, c, l + r - 2, c], {
|
|
2411
2411
|
borderColor: w,
|
|
2412
2412
|
fillColor: p,
|
|
2413
2413
|
borderWidth: g,
|
|
2414
2414
|
lineCap: "round",
|
|
2415
2415
|
lineJoin: "round",
|
|
2416
2416
|
lineDash: u
|
|
2417
|
-
}), a >= y && a <= b && o === E && this.ctx.paint.drawLine([
|
|
2417
|
+
}), a >= y && a <= b && o === E && this.ctx.paint.drawLine([l, c + f - 1.5, l + r, c + f - 1.5], {
|
|
2418
2418
|
borderColor: w,
|
|
2419
2419
|
fillColor: p,
|
|
2420
2420
|
borderWidth: g,
|
|
2421
2421
|
lineCap: "round",
|
|
2422
2422
|
lineJoin: "round",
|
|
2423
2423
|
lineDash: u
|
|
2424
|
-
}), a === y && o >= m && o <= E && this.ctx.paint.drawLine([
|
|
2424
|
+
}), a === y && o >= m && o <= E && this.ctx.paint.drawLine([l, c, l, c + f - 1], {
|
|
2425
2425
|
borderColor: w,
|
|
2426
2426
|
fillColor: p,
|
|
2427
2427
|
borderWidth: g,
|
|
2428
2428
|
lineCap: "round",
|
|
2429
2429
|
lineJoin: "round",
|
|
2430
2430
|
lineDash: u
|
|
2431
|
-
}), a === b && o >= m && o <= E && this.ctx.paint.drawLine([
|
|
2431
|
+
}), a === b && o >= m && o <= E && this.ctx.paint.drawLine([l + r - 1.5, c, l + r - 1.5, c + f - 1.5], {
|
|
2432
2432
|
borderColor: w,
|
|
2433
2433
|
fillColor: p,
|
|
2434
2434
|
borderWidth: g,
|
|
@@ -2439,42 +2439,42 @@ class ee extends te {
|
|
|
2439
2439
|
}
|
|
2440
2440
|
}
|
|
2441
2441
|
class ie extends te {
|
|
2442
|
-
constructor(e, i, s, r, o, a,
|
|
2443
|
-
super(e, s, r, o, a,
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = a, this.colIndex = i, this.key =
|
|
2442
|
+
constructor(e, i, s, r, o, a, l) {
|
|
2443
|
+
super(e, s, r, o, a, "header", l.fixed);
|
|
2444
|
+
h(this, "align");
|
|
2445
|
+
h(this, "verticalAlign", "middle");
|
|
2446
|
+
h(this, "fixed");
|
|
2447
|
+
h(this, "widthFillDisable");
|
|
2448
|
+
h(this, "type");
|
|
2449
|
+
h(this, "operation", !1);
|
|
2450
|
+
h(this, "editorType");
|
|
2451
|
+
h(this, "level");
|
|
2452
|
+
h(this, "text");
|
|
2453
|
+
h(this, "displayText", "");
|
|
2454
|
+
h(this, "colspan");
|
|
2455
|
+
h(this, "rowspan");
|
|
2456
|
+
h(this, "key");
|
|
2457
|
+
h(this, "required", !1);
|
|
2458
|
+
h(this, "readonly", !1);
|
|
2459
|
+
h(this, "children", []);
|
|
2460
|
+
h(this, "column");
|
|
2461
|
+
h(this, "colIndex");
|
|
2462
|
+
h(this, "rowKey");
|
|
2463
|
+
h(this, "rules");
|
|
2464
|
+
h(this, "hasChildren");
|
|
2465
|
+
h(this, "render");
|
|
2466
|
+
h(this, "style", {});
|
|
2467
|
+
h(this, "drawX", 0);
|
|
2468
|
+
h(this, "drawY", 0);
|
|
2469
|
+
h(this, "drawCellBgColor", "");
|
|
2470
|
+
h(this, "drawTextColor", "");
|
|
2471
|
+
h(this, "drawImageX", 0);
|
|
2472
|
+
h(this, "drawImageY", 0);
|
|
2473
|
+
h(this, "drawImageWidth", 0);
|
|
2474
|
+
h(this, "drawImageHeight", 0);
|
|
2475
|
+
h(this, "drawImageName", "");
|
|
2476
|
+
h(this, "drawImageSource");
|
|
2477
|
+
this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = a, this.colIndex = i, this.key = l.key, this.type = l.type || "", this.editorType = l.editorType || "text", this.align = l.align || "center", this.verticalAlign = l.verticalAlign || "middle", 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 = Ut(), this.hasChildren = l.children && l.children.length > 0 || !1, this.render = l.renderHeader;
|
|
2478
2478
|
}
|
|
2479
2479
|
/**
|
|
2480
2480
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -2494,11 +2494,11 @@ class ie extends te {
|
|
|
2494
2494
|
const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
|
|
2495
2495
|
let r = i, o = s;
|
|
2496
2496
|
if (typeof e == "function") {
|
|
2497
|
-
const a = e, { backgroundColor:
|
|
2497
|
+
const a = e, { backgroundColor: l, color: c } = a({
|
|
2498
2498
|
colIndex: this.colIndex,
|
|
2499
2499
|
column: this.column
|
|
2500
2500
|
}) || {};
|
|
2501
|
-
|
|
2501
|
+
l && (r = l), c && (o = c);
|
|
2502
2502
|
}
|
|
2503
2503
|
this.drawCellBgColor = r, this.drawTextColor = o;
|
|
2504
2504
|
}
|
|
@@ -2509,11 +2509,11 @@ class ie extends te {
|
|
|
2509
2509
|
const {
|
|
2510
2510
|
paint: e,
|
|
2511
2511
|
config: { BORDER_COLOR: i, CELL_PADDING: s, HEADER_FONT: r }
|
|
2512
|
-
} = this.ctx, { drawX: o, drawY: a, displayText:
|
|
2512
|
+
} = this.ctx, { drawX: o, drawY: a, displayText: l } = this;
|
|
2513
2513
|
e.drawRect(o, a, this.width, this.height, {
|
|
2514
2514
|
borderColor: i,
|
|
2515
2515
|
fillColor: this.drawCellBgColor
|
|
2516
|
-
}), e.drawText(
|
|
2516
|
+
}), e.drawText(l, o, a, this.width, this.height, {
|
|
2517
2517
|
font: r,
|
|
2518
2518
|
padding: s,
|
|
2519
2519
|
color: this.drawTextColor,
|
|
@@ -2524,9 +2524,9 @@ class ie extends te {
|
|
|
2524
2524
|
drawSelection() {
|
|
2525
2525
|
const { width: e, height: i, type: s } = this;
|
|
2526
2526
|
if (["index-selection", "selection"].includes(s)) {
|
|
2527
|
-
const { indeterminate: r, check: o, selectable: a } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE:
|
|
2527
|
+
const { indeterminate: r, check: o, selectable: a } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: l = 0 } = this.ctx.config, c = this.drawX + (e - l) / 2, f = this.drawY + (i - l) / 2;
|
|
2528
2528
|
let d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck";
|
|
2529
|
-
r ? (d = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : o && a ? (d = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : o && a ? (d = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !o && a ? (d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (d = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), d && (this.drawImageX = c, this.drawImageY = f, this.drawImageWidth =
|
|
2529
|
+
r ? (d = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : o && a ? (d = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : o && a ? (d = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !o && a ? (d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (d = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), d && (this.drawImageX = c, this.drawImageY = f, this.drawImageWidth = l, this.drawImageHeight = l, this.drawImageName = x, this.drawImageSource = d, this.ctx.paint.drawImage(
|
|
2530
2530
|
this.drawImageSource,
|
|
2531
2531
|
this.drawImageX,
|
|
2532
2532
|
this.drawImageY,
|
|
@@ -2555,11 +2555,11 @@ class ie extends te {
|
|
|
2555
2555
|
};
|
|
2556
2556
|
}
|
|
2557
2557
|
}
|
|
2558
|
-
class
|
|
2558
|
+
class hi {
|
|
2559
2559
|
constructor(t) {
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2560
|
+
h(this, "ctx");
|
|
2561
|
+
h(this, "visibleHoverCell");
|
|
2562
|
+
h(this, "resizeObserver");
|
|
2563
2563
|
this.ctx = t, this.init();
|
|
2564
2564
|
}
|
|
2565
2565
|
init() {
|
|
@@ -2649,10 +2649,10 @@ class li {
|
|
|
2649
2649
|
colIndex: t.colIndex,
|
|
2650
2650
|
column: t.column,
|
|
2651
2651
|
value: t.getValue()
|
|
2652
|
-
}).then((
|
|
2653
|
-
this.ctx.database.setExpandChildren(t.rowKey,
|
|
2654
|
-
}).catch((
|
|
2655
|
-
this.ctx.database.expandLoading(t.rowKey, !1), console.error(
|
|
2652
|
+
}).then((l) => {
|
|
2653
|
+
this.ctx.database.setExpandChildren(t.rowKey, l), this.ctx.database.expandLoading(t.rowKey, !1), this.ctx.emit("expandChange", this.ctx.database.getExpandRowKeys());
|
|
2654
|
+
}).catch((l) => {
|
|
2655
|
+
this.ctx.database.expandLoading(t.rowKey, !1), console.error(l);
|
|
2656
2656
|
}));
|
|
2657
2657
|
else {
|
|
2658
2658
|
const a = this.ctx.database.getIsExpand(t.rowKey);
|
|
@@ -2679,15 +2679,15 @@ class li {
|
|
|
2679
2679
|
handleBodyEvent(t, e, i, s, r = !1) {
|
|
2680
2680
|
for (const o of i) {
|
|
2681
2681
|
const a = o.fixedCells.concat(o.noFixedCells);
|
|
2682
|
-
for (const
|
|
2683
|
-
const c =
|
|
2682
|
+
for (const l of a) {
|
|
2683
|
+
const c = l.getDrawX(), f = l.getDrawY();
|
|
2684
2684
|
if (r) {
|
|
2685
|
-
if (t > c && t < c +
|
|
2686
|
-
s(
|
|
2685
|
+
if (t > c && t < c + l.visibleWidth && e > f && e < f + l.visibleHeight) {
|
|
2686
|
+
s(l);
|
|
2687
2687
|
return;
|
|
2688
2688
|
}
|
|
2689
|
-
} else if (t > c && t < c +
|
|
2690
|
-
s(
|
|
2689
|
+
} else if (t > c && t < c + l.width && e > f && e < f + l.height) {
|
|
2690
|
+
s(l);
|
|
2691
2691
|
return;
|
|
2692
2692
|
}
|
|
2693
2693
|
}
|
|
@@ -2706,55 +2706,55 @@ class li {
|
|
|
2706
2706
|
this.resizeObserver.unobserve(this.ctx.stageElement);
|
|
2707
2707
|
}
|
|
2708
2708
|
}
|
|
2709
|
-
class
|
|
2709
|
+
class li {
|
|
2710
2710
|
constructor(t, e) {
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2711
|
+
h(this, "eventBus");
|
|
2712
|
+
h(this, "eventBrowser");
|
|
2713
|
+
h(this, "eventTable");
|
|
2714
|
+
h(this, "containerElement");
|
|
2715
|
+
h(this, "stageElement");
|
|
2716
|
+
h(this, "canvasElement");
|
|
2717
|
+
h(this, "overlayerElement");
|
|
2718
|
+
h(this, "editorElement");
|
|
2719
|
+
h(this, "emptyElement");
|
|
2720
|
+
h(this, "contextMenuElement");
|
|
2721
|
+
h(this, "stageWidth", 0);
|
|
2722
|
+
h(this, "stageHeight", 0);
|
|
2723
|
+
h(this, "paint");
|
|
2724
|
+
h(this, "icons");
|
|
2725
|
+
h(this, "isInsideTargetContainer", !1);
|
|
2726
|
+
h(this, "mousedown", !1);
|
|
2727
|
+
h(this, "isPointer", !1);
|
|
2728
|
+
h(this, "rowResizing", !1);
|
|
2729
2729
|
// 行调整大小中
|
|
2730
|
-
|
|
2730
|
+
h(this, "columnResizing", !1);
|
|
2731
2731
|
// 列调整大小中
|
|
2732
|
-
|
|
2732
|
+
h(this, "scrollerMove", !1);
|
|
2733
2733
|
// 滚动条移动中
|
|
2734
|
-
|
|
2734
|
+
h(this, "scrollerFocus", !1);
|
|
2735
2735
|
// 滚动条focus中
|
|
2736
|
-
|
|
2736
|
+
h(this, "autofillMove", !1);
|
|
2737
2737
|
// 自动填充移动中
|
|
2738
|
-
|
|
2738
|
+
h(this, "selectorMove", !1);
|
|
2739
2739
|
// 选择器移动中
|
|
2740
|
-
|
|
2740
|
+
h(this, "adjustPositioning", !1);
|
|
2741
2741
|
// 调整位置中
|
|
2742
|
-
|
|
2742
|
+
h(this, "editing", !1);
|
|
2743
2743
|
// 编辑中
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2744
|
+
h(this, "scrollY", 0);
|
|
2745
|
+
h(this, "scrollX", 0);
|
|
2746
|
+
h(this, "fixedLeftWidth", 0);
|
|
2747
|
+
h(this, "fixedRightWidth", 0);
|
|
2748
|
+
h(this, "maxColIndex", 0);
|
|
2749
|
+
h(this, "maxRowIndex", 0);
|
|
2750
|
+
h(this, "hoverRow");
|
|
2751
|
+
h(this, "clickCell");
|
|
2752
|
+
h(this, "focusCell");
|
|
2753
|
+
h(this, "hoverCell");
|
|
2754
|
+
h(this, "clickCellHeader");
|
|
2755
|
+
h(this, "focusCellHeader");
|
|
2756
|
+
h(this, "hoverCellHeader");
|
|
2757
|
+
h(this, "body", {
|
|
2758
2758
|
x: 0,
|
|
2759
2759
|
y: 0,
|
|
2760
2760
|
width: 0,
|
|
@@ -2767,7 +2767,7 @@ class hi {
|
|
|
2767
2767
|
renderRows: [],
|
|
2768
2768
|
data: []
|
|
2769
2769
|
});
|
|
2770
|
-
|
|
2770
|
+
h(this, "footer", {
|
|
2771
2771
|
x: 0,
|
|
2772
2772
|
y: 0,
|
|
2773
2773
|
width: 0,
|
|
@@ -2776,7 +2776,7 @@ class hi {
|
|
|
2776
2776
|
visibleWidth: 0,
|
|
2777
2777
|
renderRows: []
|
|
2778
2778
|
});
|
|
2779
|
-
|
|
2779
|
+
h(this, "header", {
|
|
2780
2780
|
x: 0,
|
|
2781
2781
|
y: 0,
|
|
2782
2782
|
width: 0,
|
|
@@ -2791,31 +2791,31 @@ class hi {
|
|
|
2791
2791
|
fixedRightCellHeaders: [],
|
|
2792
2792
|
renderCenterCellHeaders: []
|
|
2793
2793
|
});
|
|
2794
|
-
|
|
2794
|
+
h(this, "selector", {
|
|
2795
2795
|
enable: !1,
|
|
2796
2796
|
xArr: [-1, -1],
|
|
2797
2797
|
yArr: [-1, -1],
|
|
2798
2798
|
xArrCopy: [-1, -1],
|
|
2799
2799
|
yArrCopy: [-1, -1]
|
|
2800
2800
|
});
|
|
2801
|
-
|
|
2801
|
+
h(this, "autofill", {
|
|
2802
2802
|
enable: !1,
|
|
2803
2803
|
xArr: [-1, -1],
|
|
2804
2804
|
yArr: [-1, -1]
|
|
2805
2805
|
});
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2806
|
+
h(this, "database");
|
|
2807
|
+
h(this, "history");
|
|
2808
|
+
h(this, "config");
|
|
2809
2809
|
const {
|
|
2810
2810
|
containerElement: i,
|
|
2811
2811
|
stageElement: s,
|
|
2812
2812
|
canvasElement: r,
|
|
2813
2813
|
overlayerElement: o,
|
|
2814
2814
|
editorElement: a,
|
|
2815
|
-
emptyElement:
|
|
2815
|
+
emptyElement: l,
|
|
2816
2816
|
contextMenuElement: c
|
|
2817
2817
|
} = t;
|
|
2818
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = a, this.emptyElement =
|
|
2818
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = a, this.emptyElement = l, this.contextMenuElement = c, this.config = new Wt(e.config || {}), this.eventBus = new oi(), this.eventBrowser = new ri(this), this.eventTable = new hi(this), this.paint = new ni(this.canvasElement), this.database = new ii(this, e), this.history = new si(this), this.icons = new ai(this);
|
|
2819
2819
|
}
|
|
2820
2820
|
setConfig(t) {
|
|
2821
2821
|
this.config = new Wt(t);
|
|
@@ -2850,7 +2850,7 @@ class hi {
|
|
|
2850
2850
|
for (let r = 0; r <= e[1] - e[0]; r++) {
|
|
2851
2851
|
const o = [];
|
|
2852
2852
|
for (let a = 0; a <= i[1] - i[0]; a++) {
|
|
2853
|
-
const
|
|
2853
|
+
const l = r + e[0], c = a + i[0], f = this.database.getItemValueForRowIndexAndColIndex(l, c);
|
|
2854
2854
|
f && o.push(f.value);
|
|
2855
2855
|
}
|
|
2856
2856
|
s += `${o.join(" ")}\r`, t.push(o);
|
|
@@ -2912,29 +2912,29 @@ class hi {
|
|
|
2912
2912
|
}
|
|
2913
2913
|
class Pt {
|
|
2914
2914
|
constructor(t, e) {
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2915
|
+
h(this, "ctx");
|
|
2916
|
+
h(this, "type");
|
|
2917
|
+
h(this, "isFocus", !1);
|
|
2918
|
+
h(this, "trackX", 0);
|
|
2919
|
+
h(this, "trackY", 0);
|
|
2920
|
+
h(this, "trackWidth", 0);
|
|
2921
|
+
h(this, "trackHeight", 0);
|
|
2922
|
+
h(this, "splitPoints", []);
|
|
2923
2923
|
//分割线
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2924
|
+
h(this, "barX", 0);
|
|
2925
|
+
h(this, "barY", 0);
|
|
2926
|
+
h(this, "barWidth", 0);
|
|
2927
|
+
h(this, "barHeight", 0);
|
|
2928
|
+
h(this, "distance", 0);
|
|
2929
2929
|
// 滚动条的长度
|
|
2930
|
-
|
|
2930
|
+
h(this, "visibleDistance", 0);
|
|
2931
2931
|
//可见区域的长度
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2932
|
+
h(this, "clientX", 0);
|
|
2933
|
+
h(this, "clientY", 0);
|
|
2934
|
+
h(this, "dragStart", 0);
|
|
2935
2935
|
// 拖拽开始的位置
|
|
2936
|
-
|
|
2937
|
-
|
|
2936
|
+
h(this, "isDragging", !1);
|
|
2937
|
+
h(this, "scroll", 0);
|
|
2938
2938
|
this.ctx = t, this.type = e, this.type === "vertical" ? this.scroll = this.ctx.scrollY : this.scroll = this.ctx.scrollX;
|
|
2939
2939
|
}
|
|
2940
2940
|
onWheel(t) {
|
|
@@ -2990,19 +2990,19 @@ class Pt {
|
|
|
2990
2990
|
stageHeight: i,
|
|
2991
2991
|
stageWidth: s,
|
|
2992
2992
|
config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0 }
|
|
2993
|
-
} = this.ctx, a = s,
|
|
2993
|
+
} = this.ctx, a = s, l = i, c = e.height, f = e.width, d = t.height, x = this.ctx.footer.height;
|
|
2994
2994
|
if (this.type === "vertical") {
|
|
2995
|
-
this.visibleDistance =
|
|
2995
|
+
this.visibleDistance = l - r - c, this.distance = d - this.visibleDistance + x, this.trackX = a - r, this.trackY = 0, this.splitPoints = [this.trackX, c, this.trackX + r, c], this.trackWidth = r, this.trackHeight = l, this.barX = this.trackX - 0.5 + (r - o) / 2, this.barWidth = o;
|
|
2996
2996
|
const u = this.distance ? this.visibleDistance / d : 0;
|
|
2997
2997
|
let g = Math.floor(u * this.visibleDistance);
|
|
2998
2998
|
g < 30 ? g = 30 : g > this.visibleDistance && (g = 0), this.barHeight = g, this.barY = c + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
2999
2999
|
} else {
|
|
3000
3000
|
this.visibleDistance = a - r, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
3001
3001
|
a - r,
|
|
3002
|
-
|
|
3002
|
+
l - r,
|
|
3003
3003
|
a - r,
|
|
3004
|
-
|
|
3005
|
-
], this.trackX = 0, this.trackY =
|
|
3004
|
+
l
|
|
3005
|
+
], this.trackX = 0, this.trackY = l - r, this.trackWidth = a, this.trackHeight = r;
|
|
3006
3006
|
const u = this.distance ? this.visibleDistance / f : 0;
|
|
3007
3007
|
let g = Math.floor(u * this.visibleDistance);
|
|
3008
3008
|
this.barY = this.trackY - 0.5 + (r - o) / 2, g < 30 ? g = 30 : g >= this.visibleDistance && (g = 0), this.barWidth = g, this.barHeight = o, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
@@ -3026,9 +3026,9 @@ class Pt {
|
|
|
3026
3026
|
}
|
|
3027
3027
|
class ci {
|
|
3028
3028
|
constructor(t) {
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3029
|
+
h(this, "ctx");
|
|
3030
|
+
h(this, "verticalScrollbar");
|
|
3031
|
+
h(this, "horizontalScrollbar");
|
|
3032
3032
|
this.ctx = t, this.verticalScrollbar = new Pt(t, "vertical"), this.horizontalScrollbar = new Pt(t, "horizontal"), this.ctx.on("wheel", (e) => this.onWheel(e)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("setScroll", (e, i) => {
|
|
3033
3033
|
this.setScroll(e, i);
|
|
3034
3034
|
}), this.ctx.on("setScrollX", (e) => {
|
|
@@ -3082,41 +3082,41 @@ class ci {
|
|
|
3082
3082
|
}
|
|
3083
3083
|
class di {
|
|
3084
3084
|
constructor(t) {
|
|
3085
|
-
|
|
3085
|
+
h(this, "ctx");
|
|
3086
3086
|
// 上下文
|
|
3087
|
-
|
|
3087
|
+
h(this, "x", 0);
|
|
3088
3088
|
// x坐标
|
|
3089
|
-
|
|
3089
|
+
h(this, "y", 0);
|
|
3090
3090
|
// y坐标
|
|
3091
|
-
|
|
3091
|
+
h(this, "width", 0);
|
|
3092
3092
|
// 宽度
|
|
3093
|
-
|
|
3093
|
+
h(this, "height", 0);
|
|
3094
3094
|
// 高度
|
|
3095
|
-
|
|
3095
|
+
h(this, "resizeTarget", null);
|
|
3096
3096
|
//调整表头
|
|
3097
|
-
|
|
3097
|
+
h(this, "resizeNum", 0);
|
|
3098
3098
|
// 调整列的数量
|
|
3099
|
-
|
|
3099
|
+
h(this, "isResizing", !1);
|
|
3100
3100
|
// 是否移动中
|
|
3101
|
-
|
|
3101
|
+
h(this, "clientX", 0);
|
|
3102
3102
|
// 鼠标按下时的x轴位置
|
|
3103
|
-
|
|
3103
|
+
h(this, "resizeDiff", 0);
|
|
3104
3104
|
// 是否移动中
|
|
3105
|
-
|
|
3106
|
-
|
|
3105
|
+
h(this, "columnIndex", 0);
|
|
3106
|
+
h(this, "isMouseDown", !1);
|
|
3107
3107
|
// 是否按下
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3108
|
+
h(this, "columns");
|
|
3109
|
+
h(this, "visibleLeafColumns", []);
|
|
3110
|
+
h(this, "visibleHeight", 0);
|
|
3111
|
+
h(this, "visibleWidth", 0);
|
|
3112
|
+
h(this, "allCellHeaders", []);
|
|
3113
|
+
h(this, "leafCellHeaders", []);
|
|
3114
|
+
h(this, "renderLeafCellHeaders", []);
|
|
3115
|
+
h(this, "fixedLeftCellHeaders", []);
|
|
3116
|
+
h(this, "centerCellHeaders", []);
|
|
3117
|
+
h(this, "fixedRightCellHeaders", []);
|
|
3118
|
+
h(this, "renderCenterCellHeaders", []);
|
|
3119
|
+
h(this, "renderFixedCellHeaders", []);
|
|
3120
3120
|
this.ctx = t, this.ctx.on(
|
|
3121
3121
|
"resetHeader",
|
|
3122
3122
|
Zt(() => {
|
|
@@ -3135,9 +3135,9 @@ class di {
|
|
|
3135
3135
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3136
3136
|
const a = this.ctx.containerElement.getBoundingClientRect();
|
|
3137
3137
|
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 - 0.5 + "px", this.visibleWidth = this.ctx.stageWidth - e;
|
|
3138
|
-
const
|
|
3139
|
-
if (this.resizeNum &&
|
|
3140
|
-
const d = Math.floor(
|
|
3138
|
+
const l = this.visibleWidth - this.width;
|
|
3139
|
+
if (this.resizeNum && l > 0) {
|
|
3140
|
+
const d = Math.floor(l / this.resizeNum * 100) / 100;
|
|
3141
3141
|
this.resizeAllColumn(d);
|
|
3142
3142
|
}
|
|
3143
3143
|
const c = this.fixedLeftCellHeaders.filter((d) => !d.hasChildren);
|
|
@@ -3170,9 +3170,9 @@ class di {
|
|
|
3170
3170
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3171
3171
|
const r = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
3172
3172
|
for (const o of r) {
|
|
3173
|
-
const { offsetX: a, offsetY:
|
|
3173
|
+
const { offsetX: a, offsetY: l } = this.ctx.getOffset(e), c = a, f = o.getDrawX();
|
|
3174
3174
|
c > f + o.width - 5 && c < f + o.width + 4 && c < i - 4 && // 视窗中最后一列不允许调整宽
|
|
3175
|
-
o.colspan <= 1 && this.ctx.isTarget() &&
|
|
3175
|
+
o.colspan <= 1 && this.ctx.isTarget() && l <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = o);
|
|
3176
3176
|
}
|
|
3177
3177
|
}
|
|
3178
3178
|
}));
|
|
@@ -3226,10 +3226,10 @@ class di {
|
|
|
3226
3226
|
let s = e;
|
|
3227
3227
|
const { HEADER_HEIGHT: r = 0 } = this.ctx.config;
|
|
3228
3228
|
for (let o = 0; o < i; o++) {
|
|
3229
|
-
const a = t[o],
|
|
3229
|
+
const a = t[o], l = r * (a.rowspan || 0), c = r * (a.level || 0);
|
|
3230
3230
|
let f = a.width || 100;
|
|
3231
3231
|
a.children && (f = _t(a.children).reduce((u, g) => u + ((g == null ? void 0 : g.width) || 100), 0));
|
|
3232
|
-
const d = new ie(this.ctx, this.columnIndex, s, c, f,
|
|
3232
|
+
const d = new ie(this.ctx, this.columnIndex, s, c, f, l, a);
|
|
3233
3233
|
this.ctx.database.setHeader(a.key, d), this.allCellHeaders.push(d), a.children || (this.leafCellHeaders.push(d), d.column.widthFillDisable || this.resizeNum++), a.fixed === "left" ? this.fixedLeftCellHeaders.push(d) : a.fixed === "right" ? this.fixedRightCellHeaders.push(d) : this.centerCellHeaders.push(d), !a.children && this.columnIndex++, a.children && this.render(a.children, s), s += f;
|
|
3234
3234
|
}
|
|
3235
3235
|
}
|
|
@@ -3261,8 +3261,8 @@ class di {
|
|
|
3261
3261
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3262
3262
|
colorEnd: "rgba(0,0,0,0)"
|
|
3263
3263
|
}), i < Math.floor(s.width - r - 1) && e !== a) {
|
|
3264
|
-
const
|
|
3265
|
-
this.ctx.paint.drawShadow(
|
|
3264
|
+
const l = s.width - (this.x + this.width) + r - e;
|
|
3265
|
+
this.ctx.paint.drawShadow(l + 1, this.y, e, this.height, {
|
|
3266
3266
|
fillColor: o,
|
|
3267
3267
|
side: "left",
|
|
3268
3268
|
shadowWidth: 4,
|
|
@@ -3290,20 +3290,20 @@ class di {
|
|
|
3290
3290
|
}
|
|
3291
3291
|
}
|
|
3292
3292
|
class se {
|
|
3293
|
-
constructor(t, e, i = 0, s = 0, r = 0, o = 0, a,
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
this.ctx = t, this.x = i, this.y = s, this.width = r, this.height = o, this.rowIndex = e, this.rowKey = t.database.getRowKeyForRowIndex(e), this.rowType =
|
|
3293
|
+
constructor(t, e, i = 0, s = 0, r = 0, o = 0, a, l = "body") {
|
|
3294
|
+
h(this, "ctx");
|
|
3295
|
+
h(this, "x", 0);
|
|
3296
|
+
h(this, "y", 0);
|
|
3297
|
+
h(this, "width", 0);
|
|
3298
|
+
h(this, "height");
|
|
3299
|
+
h(this, "cells", []);
|
|
3300
|
+
h(this, "fixedCells", []);
|
|
3301
|
+
h(this, "noFixedCells", []);
|
|
3302
|
+
h(this, "rowIndex", 0);
|
|
3303
|
+
h(this, "rowKey", "");
|
|
3304
|
+
h(this, "rowType", "body");
|
|
3305
|
+
h(this, "data");
|
|
3306
|
+
this.ctx = t, this.x = i, this.y = s, this.width = r, this.height = o, this.rowIndex = e, this.rowKey = t.database.getRowKeyForRowIndex(e), this.rowType = l, this.data = a, this.update();
|
|
3307
3307
|
}
|
|
3308
3308
|
update() {
|
|
3309
3309
|
const { header: t } = this.ctx, e = [], i = [], s = [];
|
|
@@ -3343,28 +3343,28 @@ class se {
|
|
|
3343
3343
|
}
|
|
3344
3344
|
class fi {
|
|
3345
3345
|
constructor(t) {
|
|
3346
|
-
|
|
3346
|
+
h(this, "resizeTarget", null);
|
|
3347
3347
|
//调整行大小的目标
|
|
3348
|
-
|
|
3348
|
+
h(this, "isMouseDown", !1);
|
|
3349
3349
|
// 是否按下
|
|
3350
|
-
|
|
3350
|
+
h(this, "resizeDiff", 0);
|
|
3351
3351
|
// 是否移动中
|
|
3352
|
-
|
|
3352
|
+
h(this, "clientY", 0);
|
|
3353
3353
|
// 鼠标按下时的y轴位置
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3354
|
+
h(this, "ctx");
|
|
3355
|
+
h(this, "x", 0);
|
|
3356
|
+
h(this, "y", 0);
|
|
3357
|
+
h(this, "width", 0);
|
|
3358
|
+
h(this, "height", 0);
|
|
3359
|
+
h(this, "headIndex", 0);
|
|
3360
|
+
h(this, "tailIndex", 0);
|
|
3361
|
+
h(this, "isResizing", !1);
|
|
3362
3362
|
//是否正在调整大小
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3363
|
+
h(this, "renderRows", []);
|
|
3364
|
+
h(this, "visibleRows", []);
|
|
3365
|
+
h(this, "visibleHeight", 0);
|
|
3366
|
+
h(this, "visibleWidth", 0);
|
|
3367
|
+
h(this, "data", []);
|
|
3368
3368
|
this.ctx = t, this.init(), this.initResizeRow();
|
|
3369
3369
|
}
|
|
3370
3370
|
init() {
|
|
@@ -3377,7 +3377,7 @@ class fi {
|
|
|
3377
3377
|
SCROLLER_TRACK_SIZE: r = 0,
|
|
3378
3378
|
HEIGHT: o,
|
|
3379
3379
|
EMPTY_BODY_HEIGHT: a = 0,
|
|
3380
|
-
MAX_HEIGHT:
|
|
3380
|
+
MAX_HEIGHT: l = 0,
|
|
3381
3381
|
ENABLE_OFFSET_HEIGHT: c = 0,
|
|
3382
3382
|
OFFSET_HEIGHT: f = 0
|
|
3383
3383
|
}
|
|
@@ -3390,7 +3390,7 @@ class fi {
|
|
|
3390
3390
|
const { top: u } = t.getBoundingClientRect();
|
|
3391
3391
|
this.width = e.width, this.visibleWidth = this.ctx.stageWidth - r;
|
|
3392
3392
|
const g = this.ctx.footer.height;
|
|
3393
|
-
this.data.length
|
|
3393
|
+
!this.data.length && !o ? this.height = a : !this.data.length && o && (this.height = o - e.height - g - r);
|
|
3394
3394
|
const w = this.data.length ? "not-empty" : "empty";
|
|
3395
3395
|
this.ctx.emit("emptyChange", {
|
|
3396
3396
|
isEmpty: w,
|
|
@@ -3406,7 +3406,7 @@ class fi {
|
|
|
3406
3406
|
let y = 0;
|
|
3407
3407
|
this.data.length && c ? (y = window.innerHeight - u - f, y < 0 && (y = 32, console.error(
|
|
3408
3408
|
"There is an error in the height calculation ENABLE_OFFSET_HEIGHT and OFFSET_HEIGHT are invalid"
|
|
3409
|
-
))) : this.data.length && o ? y = o : this.data.length &&
|
|
3409
|
+
))) : this.data.length && o ? y = o : this.data.length && l && p > l ? y = l : y = p, y > 0 && (this.ctx.stageHeight = Math.floor(y), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
|
|
3410
3410
|
let b = this.ctx.stageHeight - e.height - r;
|
|
3411
3411
|
s ? this.visibleHeight = b - g : this.visibleHeight = b, 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 = d;
|
|
3412
3412
|
const m = window.devicePixelRatio || 1, E = this.ctx.stageWidth * m, C = this.ctx.stageHeight * m;
|
|
@@ -3429,7 +3429,7 @@ class fi {
|
|
|
3429
3429
|
}), this.ctx.on("mousemove", (e) => {
|
|
3430
3430
|
if (this.ctx.editing) return;
|
|
3431
3431
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s, a = e.clientY, {
|
|
3432
|
-
stageHeight:
|
|
3432
|
+
stageHeight: l,
|
|
3433
3433
|
scrollY: c,
|
|
3434
3434
|
config: { RESIZE_ROW_MIN_HEIGHT: f = 0 }
|
|
3435
3435
|
} = this.ctx;
|
|
@@ -3443,7 +3443,7 @@ class fi {
|
|
|
3443
3443
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3444
3444
|
for (let d = 0; d < this.renderRows.length; d++) {
|
|
3445
3445
|
const x = this.renderRows[d];
|
|
3446
|
-
if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r <
|
|
3446
|
+
if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r < l - 4)
|
|
3447
3447
|
for (let g = 0; g < x.cells.length; g++) {
|
|
3448
3448
|
const w = x.cells[g];
|
|
3449
3449
|
o > w.drawX + 10 && o < w.drawX + w.width - 10 && w.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = x);
|
|
@@ -3492,8 +3492,8 @@ class fi {
|
|
|
3492
3492
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3493
3493
|
colorEnd: "rgba(0,0,0,0)"
|
|
3494
3494
|
}), i < Math.floor(s.width - r - 1) && e !== a) {
|
|
3495
|
-
const
|
|
3496
|
-
this.ctx.paint.drawShadow(
|
|
3495
|
+
const l = s.width - (this.x + this.width) + r - e;
|
|
3496
|
+
this.ctx.paint.drawShadow(l + 1, this.y, e, this.height, {
|
|
3497
3497
|
fillColor: o,
|
|
3498
3498
|
side: "left",
|
|
3499
3499
|
shadowWidth: 4,
|
|
@@ -3517,8 +3517,8 @@ class fi {
|
|
|
3517
3517
|
const { header: t, database: e, scrollY: i } = this.ctx, s = i, { data: r, positions: o } = e.getData();
|
|
3518
3518
|
this.ctx.maxRowIndex = r.length - 1;
|
|
3519
3519
|
const a = this.binarySearch(o, s);
|
|
3520
|
-
let
|
|
3521
|
-
|
|
3520
|
+
let l = this.binarySearch(o, s + this.visibleHeight);
|
|
3521
|
+
l === -1 && (l = r.length), this.headIndex = Math.max(0, a), this.tailIndex = Math.min(this.ctx.maxRowIndex, l + 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;
|
|
3522
3522
|
const c = [];
|
|
3523
3523
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
3524
3524
|
const d = this.headIndex + f, x = this.visibleRows[f], { height: u, top: g } = this.ctx.database.getPositionForRowIndex(d), w = new se(this.ctx, d, 0, g + this.y, t.width, u, x);
|
|
@@ -3536,15 +3536,15 @@ class fi {
|
|
|
3536
3536
|
}
|
|
3537
3537
|
class xi {
|
|
3538
3538
|
constructor(t) {
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3539
|
+
h(this, "ctx");
|
|
3540
|
+
h(this, "renderRows", []);
|
|
3541
|
+
h(this, "data", []);
|
|
3542
|
+
h(this, "x", 0);
|
|
3543
|
+
h(this, "y", 0);
|
|
3544
|
+
h(this, "width", 0);
|
|
3545
|
+
h(this, "height", 0);
|
|
3546
|
+
h(this, "visibleWidth", 0);
|
|
3547
|
+
h(this, "visibleHeight", 0);
|
|
3548
3548
|
this.ctx = t, this.init();
|
|
3549
3549
|
}
|
|
3550
3550
|
init() {
|
|
@@ -3565,8 +3565,8 @@ class xi {
|
|
|
3565
3565
|
stageWidth: r,
|
|
3566
3566
|
config: { HEADER_BG_COLOR: o, SCROLLER_TRACK_SIZE: a }
|
|
3567
3567
|
} = this.ctx;
|
|
3568
|
-
let
|
|
3569
|
-
if (this.ctx.config.FOOTER_FIXED || (
|
|
3568
|
+
let l = this.y;
|
|
3569
|
+
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, {
|
|
3570
3570
|
fillColor: o,
|
|
3571
3571
|
side: "right",
|
|
3572
3572
|
shadowWidth: 4,
|
|
@@ -3574,7 +3574,7 @@ class xi {
|
|
|
3574
3574
|
colorEnd: "rgba(0,0,0,0)"
|
|
3575
3575
|
}), i < Math.floor(s.width - r - 1) && e !== a) {
|
|
3576
3576
|
const c = s.width - (this.x + this.width) + r - e;
|
|
3577
|
-
this.ctx.paint.drawShadow(c + 1,
|
|
3577
|
+
this.ctx.paint.drawShadow(c + 1, l, e, this.height, {
|
|
3578
3578
|
fillColor: o,
|
|
3579
3579
|
side: "left",
|
|
3580
3580
|
shadowWidth: 4,
|
|
@@ -3613,15 +3613,15 @@ class xi {
|
|
|
3613
3613
|
class ui {
|
|
3614
3614
|
// 垂直滚动定时器
|
|
3615
3615
|
constructor(t) {
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3616
|
+
h(this, "isCut", !1);
|
|
3617
|
+
h(this, "isMultipleRow", !1);
|
|
3618
|
+
h(this, "mousedownHeader", !1);
|
|
3619
|
+
h(this, "ctx");
|
|
3620
|
+
h(this, "adjustPositionX", "");
|
|
3621
|
+
h(this, "adjustPositionY", "");
|
|
3622
|
+
h(this, "timerX", 0);
|
|
3623
3623
|
// 水平滚动定时器
|
|
3624
|
-
|
|
3624
|
+
h(this, "timerY", 0);
|
|
3625
3625
|
this.ctx = t, this.init();
|
|
3626
3626
|
}
|
|
3627
3627
|
init() {
|
|
@@ -3721,12 +3721,12 @@ class ui {
|
|
|
3721
3721
|
this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0;
|
|
3722
3722
|
const {
|
|
3723
3723
|
SELECTOR_AREA_MIN_X: a,
|
|
3724
|
-
SELECTOR_AREA_MAX_X:
|
|
3724
|
+
SELECTOR_AREA_MAX_X: l,
|
|
3725
3725
|
SELECTOR_AREA_MIN_Y: c,
|
|
3726
3726
|
SELECTOR_AREA_MAX_Y: f,
|
|
3727
3727
|
SELECTOR_AREA_MAX_X_OFFSET: d,
|
|
3728
3728
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
3729
|
-
} = this.ctx.config, u = a, g =
|
|
3729
|
+
} = this.ctx.config, u = a, g = l || this.ctx.maxColIndex - d, w = c, p = f || this.ctx.maxRowIndex - x;
|
|
3730
3730
|
let [y, b] = r, [m, E] = o;
|
|
3731
3731
|
if (y < u || b > g || m < w || E > p)
|
|
3732
3732
|
return;
|
|
@@ -3744,15 +3744,15 @@ class ui {
|
|
|
3744
3744
|
if (this.ctx.mousedown && this.ctx.focusCellHeader) {
|
|
3745
3745
|
const { colIndex: a } = this.ctx.focusCellHeader;
|
|
3746
3746
|
if (this.ctx.clearSelector(), t.colIndex >= a) {
|
|
3747
|
-
const
|
|
3748
|
-
this.setSelector(
|
|
3747
|
+
const l = [a, t.colIndex + t.colspan - 1], c = [r, o];
|
|
3748
|
+
this.setSelector(l, c);
|
|
3749
3749
|
} else {
|
|
3750
|
-
const
|
|
3751
|
-
this.setSelector(
|
|
3750
|
+
const l = [t.colIndex, a], c = [r, o];
|
|
3751
|
+
this.setSelector(l, c);
|
|
3752
3752
|
}
|
|
3753
3753
|
} else {
|
|
3754
|
-
const a = [t.colIndex, t.colIndex + t.colspan - 1],
|
|
3755
|
-
this.setSelector(a,
|
|
3754
|
+
const a = [t.colIndex, t.colIndex + t.colspan - 1], l = [r, o];
|
|
3755
|
+
this.setSelector(a, l);
|
|
3756
3756
|
}
|
|
3757
3757
|
}
|
|
3758
3758
|
selectAll() {
|
|
@@ -3766,8 +3766,8 @@ class ui {
|
|
|
3766
3766
|
SELECTOR_AREA_MIN_Y: r,
|
|
3767
3767
|
SELECTOR_AREA_MAX_Y: o,
|
|
3768
3768
|
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
3769
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
3770
|
-
} = this.ctx.config, c = i, f = s || this.ctx.maxColIndex - a, d = r, x = o || this.ctx.maxRowIndex -
|
|
3769
|
+
SELECTOR_AREA_MAX_Y_OFFSET: l
|
|
3770
|
+
} = this.ctx.config, c = i, f = s || this.ctx.maxColIndex - a, d = r, x = o || this.ctx.maxRowIndex - l, u = [c, f], g = [d, x];
|
|
3771
3771
|
this.setSelector(u, g);
|
|
3772
3772
|
}
|
|
3773
3773
|
}
|
|
@@ -3777,16 +3777,16 @@ class ui {
|
|
|
3777
3777
|
const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MAX_X_OFFSET: r } = this.ctx.config, o = s || this.ctx.maxColIndex - r, a = i;
|
|
3778
3778
|
if (e) {
|
|
3779
3779
|
this.ctx.setFocusCell(t);
|
|
3780
|
-
const
|
|
3781
|
-
this.setSelector(
|
|
3780
|
+
const l = [a, o], c = [t.rowIndex, t.rowIndex];
|
|
3781
|
+
this.setSelector(l, c);
|
|
3782
3782
|
}
|
|
3783
3783
|
if (this.ctx.focusCell && this.ctx.mousedown) {
|
|
3784
|
-
const { rowIndex:
|
|
3785
|
-
if (t.rowIndex >=
|
|
3786
|
-
const c = [a, o], f = [
|
|
3784
|
+
const { rowIndex: l } = this.ctx.focusCell;
|
|
3785
|
+
if (t.rowIndex >= l) {
|
|
3786
|
+
const c = [a, o], f = [l, t.rowIndex];
|
|
3787
3787
|
this.setSelector(c, f);
|
|
3788
3788
|
} else {
|
|
3789
|
-
const c = [a, o], f = [t.rowIndex,
|
|
3789
|
+
const c = [a, o], f = [t.rowIndex, l];
|
|
3790
3790
|
this.setSelector(c, f);
|
|
3791
3791
|
}
|
|
3792
3792
|
}
|
|
@@ -3796,7 +3796,7 @@ class ui {
|
|
|
3796
3796
|
return;
|
|
3797
3797
|
const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
|
|
3798
3798
|
if (t && e && i) {
|
|
3799
|
-
const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), a = Math.max(i.colIndex, r),
|
|
3799
|
+
const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), a = Math.max(i.colIndex, r), l = Math.min(i.rowIndex, s), c = Math.max(i.rowIndex, s), f = [o, a], d = [l, c];
|
|
3800
3800
|
this.setSelector(f, d);
|
|
3801
3801
|
}
|
|
3802
3802
|
}
|
|
@@ -3804,7 +3804,7 @@ class ui {
|
|
|
3804
3804
|
const { focusCell: e, clickCell: i } = this.ctx;
|
|
3805
3805
|
if (e && this.isInSettingRange(e.rowIndex, e.colIndex))
|
|
3806
3806
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
3807
|
-
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: a } = e,
|
|
3807
|
+
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: a } = e, l = Math.min(o, s), c = Math.max(o, s), f = Math.min(a, r), d = Math.max(a, r), x = [l, c], u = [f, d];
|
|
3808
3808
|
this.setSelector(x, u);
|
|
3809
3809
|
} else {
|
|
3810
3810
|
this.ctx.emit("cellSelectedClick", e);
|
|
@@ -3845,8 +3845,8 @@ class ui {
|
|
|
3845
3845
|
let s = [];
|
|
3846
3846
|
const r = /* @__PURE__ */ new Set();
|
|
3847
3847
|
for (let a = 0; a <= e[1] - e[0]; a++)
|
|
3848
|
-
for (let
|
|
3849
|
-
const c = a + e[0], f =
|
|
3848
|
+
for (let l = 0; l <= t[1] - t[0]; l++) {
|
|
3849
|
+
const c = a + e[0], f = l + t[0], d = this.ctx.database.getItemValueForRowIndexAndColIndex(c, f);
|
|
3850
3850
|
if (d) {
|
|
3851
3851
|
const { rowKey: x, key: u } = d;
|
|
3852
3852
|
this.ctx.database.getReadonly(x, u) || (r.add(x), s.push({
|
|
@@ -3910,9 +3910,9 @@ class ui {
|
|
|
3910
3910
|
}
|
|
3911
3911
|
if (!a.length)
|
|
3912
3912
|
return;
|
|
3913
|
-
const { BEFORE_PASTE_CHANGE_METHOD:
|
|
3914
|
-
if (typeof
|
|
3915
|
-
const f =
|
|
3913
|
+
const { BEFORE_PASTE_CHANGE_METHOD: l } = this.ctx.config;
|
|
3914
|
+
if (typeof l == "function") {
|
|
3915
|
+
const f = l, d = a.map((x) => ({
|
|
3916
3916
|
rowKey: x.rowKey,
|
|
3917
3917
|
key: x.key,
|
|
3918
3918
|
value: x.value,
|
|
@@ -3941,7 +3941,7 @@ class ui {
|
|
|
3941
3941
|
if (!e)
|
|
3942
3942
|
return;
|
|
3943
3943
|
let { colIndex: i = 0, rowIndex: s = 0 } = e;
|
|
3944
|
-
const r = 0, o = 0, a = this.ctx.maxColIndex,
|
|
3944
|
+
const r = 0, o = 0, a = this.ctx.maxColIndex, l = this.ctx.maxRowIndex;
|
|
3945
3945
|
switch (t) {
|
|
3946
3946
|
case "LEFT":
|
|
3947
3947
|
i > r && i--;
|
|
@@ -3953,7 +3953,7 @@ class ui {
|
|
|
3953
3953
|
i < a && i++;
|
|
3954
3954
|
break;
|
|
3955
3955
|
case "BOTTOM":
|
|
3956
|
-
s <
|
|
3956
|
+
s < l && s++;
|
|
3957
3957
|
break;
|
|
3958
3958
|
}
|
|
3959
3959
|
const c = [i, i], f = [s, s], d = this.getCell(s, i);
|
|
@@ -3970,8 +3970,8 @@ class ui {
|
|
|
3970
3970
|
SELECTOR_AREA_MIN_Y: r,
|
|
3971
3971
|
SELECTOR_AREA_MAX_Y: o,
|
|
3972
3972
|
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
3973
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
3974
|
-
} = this.ctx.config, c = i, f = s || this.ctx.maxColIndex - a, d = r, x = o || this.ctx.maxRowIndex -
|
|
3973
|
+
SELECTOR_AREA_MAX_Y_OFFSET: l
|
|
3974
|
+
} = this.ctx.config, c = i, f = s || this.ctx.maxColIndex - a, d = r, x = o || this.ctx.maxRowIndex - l;
|
|
3975
3975
|
return !(e < c || e > f || t < d || t > x);
|
|
3976
3976
|
}
|
|
3977
3977
|
/**
|
|
@@ -3985,7 +3985,7 @@ class ui {
|
|
|
3985
3985
|
let a = 10 * (s === "left" ? -1 : 1);
|
|
3986
3986
|
this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
|
|
3987
3987
|
a *= 1.5;
|
|
3988
|
-
const { scrollX:
|
|
3988
|
+
const { scrollX: l } = this.ctx, c = l + a;
|
|
3989
3989
|
(c < 0 || c > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(c);
|
|
3990
3990
|
}, 100);
|
|
3991
3991
|
}
|
|
@@ -3994,7 +3994,7 @@ class ui {
|
|
|
3994
3994
|
let a = 10 * (r === "top" ? -1 : 1);
|
|
3995
3995
|
this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
|
|
3996
3996
|
a *= 1.5;
|
|
3997
|
-
const { scrollY:
|
|
3997
|
+
const { scrollY: l } = this.ctx, c = l + a;
|
|
3998
3998
|
(c < 0 || c > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(c);
|
|
3999
3999
|
}, 100);
|
|
4000
4000
|
}
|
|
@@ -4011,7 +4011,7 @@ class ui {
|
|
|
4011
4011
|
fixedLeftWidth: r,
|
|
4012
4012
|
header: o,
|
|
4013
4013
|
footer: a,
|
|
4014
|
-
body:
|
|
4014
|
+
body: l,
|
|
4015
4015
|
scrollX: c,
|
|
4016
4016
|
scrollY: f,
|
|
4017
4017
|
config: { SCROLLER_TRACK_SIZE: d, FOOTER_FIXED: x }
|
|
@@ -4020,7 +4020,7 @@ class ui {
|
|
|
4020
4020
|
return;
|
|
4021
4021
|
const u = r - i.drawX + 1, g = i.drawX + i.width - (e - s) + 1, w = o.height - i.drawY;
|
|
4022
4022
|
let p = i.height;
|
|
4023
|
-
p >
|
|
4023
|
+
p > l.visibleHeight && (p = l.visibleHeight);
|
|
4024
4024
|
let y = 0;
|
|
4025
4025
|
x && (y = a.visibleHeight);
|
|
4026
4026
|
const b = i.drawY + p - (t - y - d);
|
|
@@ -4033,14 +4033,14 @@ class ui {
|
|
|
4033
4033
|
}
|
|
4034
4034
|
class gi {
|
|
4035
4035
|
constructor(t) {
|
|
4036
|
-
|
|
4036
|
+
h(this, "ctx");
|
|
4037
4037
|
this.ctx = t, this.init();
|
|
4038
4038
|
}
|
|
4039
4039
|
init() {
|
|
4040
4040
|
this.ctx.on("cellMouseenter", (t, e) => {
|
|
4041
4041
|
this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default");
|
|
4042
|
-
const { offsetX: i, offsetY: s } = this.ctx.getOffset(e), { xArr: r, yArr: o } = this.ctx.selector, a = r[1],
|
|
4043
|
-
if (this.ctx.config.ENABLE_AUTOFILL && c === a && f ===
|
|
4042
|
+
const { offsetX: i, offsetY: s } = this.ctx.getOffset(e), { xArr: r, yArr: o } = this.ctx.selector, a = r[1], l = o[1], { colIndex: c, rowIndex: f, drawX: d, drawY: x, width: u, height: g } = t;
|
|
4043
|
+
if (this.ctx.config.ENABLE_AUTOFILL && c === a && f === l) {
|
|
4044
4044
|
const p = d + u - 6, y = x + g - 6;
|
|
4045
4045
|
i > p && s > y && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4046
4046
|
}
|
|
@@ -4073,22 +4073,22 @@ class gi {
|
|
|
4073
4073
|
return;
|
|
4074
4074
|
let o = t, a = e;
|
|
4075
4075
|
if (!r) {
|
|
4076
|
-
const [
|
|
4077
|
-
a = [
|
|
4076
|
+
const [l] = a;
|
|
4077
|
+
a = [l, l];
|
|
4078
4078
|
}
|
|
4079
4079
|
if (!s) {
|
|
4080
|
-
const [
|
|
4081
|
-
o = [
|
|
4080
|
+
const [l] = o;
|
|
4081
|
+
o = [l, l];
|
|
4082
4082
|
}
|
|
4083
4083
|
if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(o) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(a)) {
|
|
4084
4084
|
const {
|
|
4085
|
-
SELECTOR_AREA_MIN_X:
|
|
4085
|
+
SELECTOR_AREA_MIN_X: l,
|
|
4086
4086
|
SELECTOR_AREA_MAX_X: c,
|
|
4087
4087
|
SELECTOR_AREA_MIN_Y: f,
|
|
4088
4088
|
SELECTOR_AREA_MAX_Y: d,
|
|
4089
4089
|
SELECTOR_AREA_MAX_X_OFFSET: x,
|
|
4090
4090
|
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
4091
|
-
} = this.ctx.config, g =
|
|
4091
|
+
} = this.ctx.config, g = l, w = c || this.ctx.maxColIndex - x, p = f, y = d || this.ctx.maxRowIndex - u;
|
|
4092
4092
|
let [b, m] = o, [E, C] = a;
|
|
4093
4093
|
if (b < g || E < p)
|
|
4094
4094
|
return;
|
|
@@ -4105,11 +4105,11 @@ class gi {
|
|
|
4105
4105
|
const g = x + e.yArr[0], w = u + e.xArr[0];
|
|
4106
4106
|
i.set(`${g}-${w}`, !0);
|
|
4107
4107
|
}
|
|
4108
|
-
const { value: s } = e, r = s[0].length, o = s.length, a = this.ctx.autofill.xArr,
|
|
4108
|
+
const { value: s } = e, r = s[0].length, o = s.length, a = this.ctx.autofill.xArr, l = this.ctx.autofill.yArr;
|
|
4109
4109
|
let c = [];
|
|
4110
|
-
for (let x = 0; x <=
|
|
4110
|
+
for (let x = 0; x <= l[1] - l[0]; x++)
|
|
4111
4111
|
for (let u = 0; u <= a[1] - a[0]; u++) {
|
|
4112
|
-
const g = u + a[0], w = x +
|
|
4112
|
+
const g = u + a[0], w = x + l[0], p = s[x % o][u % r], y = this.ctx.database.getItemValueForRowIndexAndColIndex(w, g), b = `${w}-${g}`;
|
|
4113
4113
|
if (y && !i.has(b)) {
|
|
4114
4114
|
const { rowKey: m, key: E } = y;
|
|
4115
4115
|
this.ctx.database.getReadonly(m, E) || (t.add(m), c.push({
|
|
@@ -4172,7 +4172,7 @@ function at(n, t) {
|
|
|
4172
4172
|
function q(n) {
|
|
4173
4173
|
return n.split("-")[0];
|
|
4174
4174
|
}
|
|
4175
|
-
function
|
|
4175
|
+
function ht(n) {
|
|
4176
4176
|
return n.split("-")[1];
|
|
4177
4177
|
}
|
|
4178
4178
|
function re(n) {
|
|
@@ -4189,7 +4189,7 @@ function Mt(n) {
|
|
|
4189
4189
|
}
|
|
4190
4190
|
function yi(n, t, e) {
|
|
4191
4191
|
e === void 0 && (e = !1);
|
|
4192
|
-
const i =
|
|
4192
|
+
const i = ht(n), s = Mt(n), r = Lt(s);
|
|
4193
4193
|
let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4194
4194
|
return t.reference[r] > t.floating[r] && (o = xt(o)), [o, xt(o)];
|
|
4195
4195
|
}
|
|
@@ -4214,7 +4214,7 @@ function Ei(n, t, e) {
|
|
|
4214
4214
|
}
|
|
4215
4215
|
}
|
|
4216
4216
|
function bi(n, t, e, i) {
|
|
4217
|
-
const s =
|
|
4217
|
+
const s = ht(n);
|
|
4218
4218
|
let r = Ei(q(n), e === "start", i);
|
|
4219
4219
|
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
|
|
4220
4220
|
}
|
|
@@ -4261,9 +4261,9 @@ function Vt(n, t, e) {
|
|
|
4261
4261
|
reference: i,
|
|
4262
4262
|
floating: s
|
|
4263
4263
|
} = n;
|
|
4264
|
-
const r = J(t), o = Mt(t), a = Lt(o),
|
|
4264
|
+
const r = J(t), o = Mt(t), a = Lt(o), l = q(t), c = r === "y", f = i.x + i.width / 2 - s.width / 2, d = i.y + i.height / 2 - s.height / 2, x = i[a] / 2 - s[a] / 2;
|
|
4265
4265
|
let u;
|
|
4266
|
-
switch (
|
|
4266
|
+
switch (l) {
|
|
4267
4267
|
case "top":
|
|
4268
4268
|
u = {
|
|
4269
4269
|
x: f,
|
|
@@ -4294,7 +4294,7 @@ function Vt(n, t, e) {
|
|
|
4294
4294
|
y: i.y
|
|
4295
4295
|
};
|
|
4296
4296
|
}
|
|
4297
|
-
switch (
|
|
4297
|
+
switch (ht(t)) {
|
|
4298
4298
|
case "start":
|
|
4299
4299
|
u[o] -= x * (e && c ? -1 : 1);
|
|
4300
4300
|
break;
|
|
@@ -4310,7 +4310,7 @@ const vi = async (n, t, e) => {
|
|
|
4310
4310
|
strategy: s = "absolute",
|
|
4311
4311
|
middleware: r = [],
|
|
4312
4312
|
platform: o
|
|
4313
|
-
} = e, a = r.filter(Boolean),
|
|
4313
|
+
} = e, a = r.filter(Boolean), l = await (o.isRTL == null ? void 0 : o.isRTL(t));
|
|
4314
4314
|
let c = await o.getElementRects({
|
|
4315
4315
|
reference: n,
|
|
4316
4316
|
floating: t,
|
|
@@ -4318,7 +4318,7 @@ const vi = async (n, t, e) => {
|
|
|
4318
4318
|
}), {
|
|
4319
4319
|
x: f,
|
|
4320
4320
|
y: d
|
|
4321
|
-
} = Vt(c, i,
|
|
4321
|
+
} = Vt(c, i, l), x = i, u = {}, g = 0;
|
|
4322
4322
|
for (let w = 0; w < a.length; w++) {
|
|
4323
4323
|
const {
|
|
4324
4324
|
name: p,
|
|
@@ -4355,7 +4355,7 @@ const vi = async (n, t, e) => {
|
|
|
4355
4355
|
}) : C.rects), {
|
|
4356
4356
|
x: f,
|
|
4357
4357
|
y: d
|
|
4358
|
-
} = Vt(c, x,
|
|
4358
|
+
} = Vt(c, x, l)), w = -1);
|
|
4359
4359
|
}
|
|
4360
4360
|
return {
|
|
4361
4361
|
x: f,
|
|
@@ -4374,7 +4374,7 @@ async function ne(n, t) {
|
|
|
4374
4374
|
platform: r,
|
|
4375
4375
|
rects: o,
|
|
4376
4376
|
elements: a,
|
|
4377
|
-
strategy:
|
|
4377
|
+
strategy: l
|
|
4378
4378
|
} = n, {
|
|
4379
4379
|
boundary: c = "clippingAncestors",
|
|
4380
4380
|
rootBoundary: f = "viewport",
|
|
@@ -4385,7 +4385,7 @@ async function ne(n, t) {
|
|
|
4385
4385
|
element: (e = await (r.isElement == null ? void 0 : r.isElement(p))) == null || e ? p : p.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(a.floating)),
|
|
4386
4386
|
boundary: c,
|
|
4387
4387
|
rootBoundary: f,
|
|
4388
|
-
strategy:
|
|
4388
|
+
strategy: l
|
|
4389
4389
|
})), b = d === "floating" ? {
|
|
4390
4390
|
x: i,
|
|
4391
4391
|
y: s,
|
|
@@ -4401,7 +4401,7 @@ async function ne(n, t) {
|
|
|
4401
4401
|
elements: a,
|
|
4402
4402
|
rect: b,
|
|
4403
4403
|
offsetParent: m,
|
|
4404
|
-
strategy:
|
|
4404
|
+
strategy: l
|
|
4405
4405
|
}) : b);
|
|
4406
4406
|
return {
|
|
4407
4407
|
top: (y.top - C.top + g.top) / E.y,
|
|
@@ -4421,7 +4421,7 @@ const Ri = (n) => ({
|
|
|
4421
4421
|
rects: r,
|
|
4422
4422
|
platform: o,
|
|
4423
4423
|
elements: a,
|
|
4424
|
-
middlewareData:
|
|
4424
|
+
middlewareData: l
|
|
4425
4425
|
} = t, {
|
|
4426
4426
|
element: c,
|
|
4427
4427
|
padding: f = 0
|
|
@@ -4434,7 +4434,7 @@ const Ri = (n) => ({
|
|
|
4434
4434
|
}, u = Mt(s), g = Lt(u), w = await o.getDimensions(c), p = u === "y", y = p ? "top" : "left", b = p ? "bottom" : "right", m = p ? "clientHeight" : "clientWidth", E = r.reference[g] + r.reference[u] - x[u] - r.floating[g], C = x[u] - r.reference[u], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
|
|
4435
4435
|
let T = R ? R[m] : 0;
|
|
4436
4436
|
(!T || !await (o.isElement == null ? void 0 : o.isElement(R))) && (T = a.floating[m] || r.floating[g]);
|
|
4437
|
-
const A = E / 2 - C / 2, L = T / 2 - w[g] / 2 - 1, D = rt(d[y], L), B = rt(d[b], L), I = D, S = T - w[g] - B, O = T / 2 - w[g] / 2 + A, G = It(I, O, S), K = !
|
|
4437
|
+
const A = E / 2 - C / 2, L = T / 2 - w[g] / 2 - 1, D = rt(d[y], L), B = rt(d[b], L), I = D, S = T - w[g] - B, O = T / 2 - w[g] / 2 + A, G = It(I, O, S), K = !l.arrow && ht(s) != null && O !== G && r.reference[g] / 2 - (O < I ? D : B) - w[g] / 2 < 0, k = K ? O < I ? O - I : O - S : 0;
|
|
4438
4438
|
return {
|
|
4439
4439
|
[u]: x[u] + k,
|
|
4440
4440
|
data: {
|
|
@@ -4458,7 +4458,7 @@ const Ri = (n) => ({
|
|
|
4458
4458
|
middlewareData: r,
|
|
4459
4459
|
rects: o,
|
|
4460
4460
|
initialPlacement: a,
|
|
4461
|
-
platform:
|
|
4461
|
+
platform: l,
|
|
4462
4462
|
elements: c
|
|
4463
4463
|
} = t, {
|
|
4464
4464
|
mainAxis: f = !0,
|
|
@@ -4471,7 +4471,7 @@ const Ri = (n) => ({
|
|
|
4471
4471
|
} = at(n, t);
|
|
4472
4472
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
4473
4473
|
return {};
|
|
4474
|
-
const y = q(s), b = J(a), m = q(a) === a, E = await (
|
|
4474
|
+
const y = q(s), b = J(a), m = q(a) === a, E = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), C = x || (m || !w ? [xt(a)] : mi(a)), R = g !== "none";
|
|
4475
4475
|
!x && R && C.push(...bi(a, w, g, E));
|
|
4476
4476
|
const T = [a, ...C], A = await ne(t, p), L = [];
|
|
4477
4477
|
let D = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
@@ -4532,7 +4532,7 @@ async function Ii(n, t) {
|
|
|
4532
4532
|
placement: e,
|
|
4533
4533
|
platform: i,
|
|
4534
4534
|
elements: s
|
|
4535
|
-
} = n, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), a =
|
|
4535
|
+
} = n, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), a = ht(e), l = J(e) === "y", c = ["left", "top"].includes(o) ? -1 : 1, f = r && l ? -1 : 1, d = at(t, n);
|
|
4536
4536
|
let {
|
|
4537
4537
|
mainAxis: x,
|
|
4538
4538
|
crossAxis: u,
|
|
@@ -4546,7 +4546,7 @@ async function Ii(n, t) {
|
|
|
4546
4546
|
crossAxis: d.crossAxis || 0,
|
|
4547
4547
|
alignmentAxis: d.alignmentAxis
|
|
4548
4548
|
};
|
|
4549
|
-
return a && typeof g == "number" && (u = a === "end" ? g * -1 : g),
|
|
4549
|
+
return a && typeof g == "number" && (u = a === "end" ? g * -1 : g), l ? {
|
|
4550
4550
|
x: u * f,
|
|
4551
4551
|
y: x * c
|
|
4552
4552
|
} : {
|
|
@@ -4565,12 +4565,12 @@ const Oi = function(n) {
|
|
|
4565
4565
|
y: r,
|
|
4566
4566
|
placement: o,
|
|
4567
4567
|
middlewareData: a
|
|
4568
|
-
} = t,
|
|
4568
|
+
} = t, l = await Ii(t, n);
|
|
4569
4569
|
return o === ((e = a.offset) == null ? void 0 : e.placement) && (i = a.arrow) != null && i.alignmentOffset ? {} : {
|
|
4570
|
-
x: s +
|
|
4571
|
-
y: r +
|
|
4570
|
+
x: s + l.x,
|
|
4571
|
+
y: r + l.y,
|
|
4572
4572
|
data: {
|
|
4573
|
-
...
|
|
4573
|
+
...l,
|
|
4574
4574
|
placement: o
|
|
4575
4575
|
}
|
|
4576
4576
|
};
|
|
@@ -4600,11 +4600,11 @@ const Oi = function(n) {
|
|
|
4600
4600
|
};
|
|
4601
4601
|
}
|
|
4602
4602
|
},
|
|
4603
|
-
...
|
|
4603
|
+
...l
|
|
4604
4604
|
} = at(n, t), c = {
|
|
4605
4605
|
x: e,
|
|
4606
4606
|
y: i
|
|
4607
|
-
}, f = await ne(t,
|
|
4607
|
+
}, f = await ne(t, l), d = J(q(s)), x = re(d);
|
|
4608
4608
|
let u = c[x], g = c[d];
|
|
4609
4609
|
if (r) {
|
|
4610
4610
|
const p = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", b = u + f[p], m = u - f[y];
|
|
@@ -4659,7 +4659,7 @@ function N(n) {
|
|
|
4659
4659
|
function zt(n) {
|
|
4660
4660
|
return !gt() || typeof ShadowRoot > "u" ? !1 : n instanceof ShadowRoot || n instanceof H(n).ShadowRoot;
|
|
4661
4661
|
}
|
|
4662
|
-
function
|
|
4662
|
+
function lt(n) {
|
|
4663
4663
|
const {
|
|
4664
4664
|
overflow: t,
|
|
4665
4665
|
overflowX: e,
|
|
@@ -4725,24 +4725,24 @@ function z(n) {
|
|
|
4725
4725
|
);
|
|
4726
4726
|
return zt(t) ? t.host : t;
|
|
4727
4727
|
}
|
|
4728
|
-
function
|
|
4728
|
+
function he(n) {
|
|
4729
4729
|
const t = z(n);
|
|
4730
|
-
return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) &&
|
|
4730
|
+
return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) && lt(t) ? t : he(t);
|
|
4731
4731
|
}
|
|
4732
4732
|
function Tt(n, t, e) {
|
|
4733
4733
|
var i;
|
|
4734
4734
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
4735
|
-
const s =
|
|
4735
|
+
const s = he(n), r = s === ((i = n.ownerDocument) == null ? void 0 : i.body), o = H(s);
|
|
4736
4736
|
if (r) {
|
|
4737
4737
|
const a = St(o);
|
|
4738
|
-
return t.concat(o, o.visualViewport || [],
|
|
4738
|
+
return t.concat(o, o.visualViewport || [], lt(s) ? s : [], a && e ? Tt(a) : []);
|
|
4739
4739
|
}
|
|
4740
4740
|
return t.concat(s, Tt(s, [], e));
|
|
4741
4741
|
}
|
|
4742
4742
|
function St(n) {
|
|
4743
4743
|
return n.parent && Object.getPrototypeOf(n.parent) ? n.frameElement : null;
|
|
4744
4744
|
}
|
|
4745
|
-
function
|
|
4745
|
+
function le(n) {
|
|
4746
4746
|
const t = X(n);
|
|
4747
4747
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
4748
4748
|
const s = N(n), r = s ? n.offsetWidth : e, o = s ? n.offsetHeight : i, a = ft(e) !== r || ft(i) !== o;
|
|
@@ -4763,7 +4763,7 @@ function Z(n) {
|
|
|
4763
4763
|
width: i,
|
|
4764
4764
|
height: s,
|
|
4765
4765
|
$: r
|
|
4766
|
-
} =
|
|
4766
|
+
} = le(t);
|
|
4767
4767
|
let o = (r ? ft(e.width) : e.width) / i, a = (r ? ft(e.height) : e.height) / s;
|
|
4768
4768
|
return (!o || !Number.isFinite(o)) && (o = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
4769
4769
|
x: o,
|
|
@@ -4787,19 +4787,19 @@ function ot(n, t, e, i) {
|
|
|
4787
4787
|
let o = V(1);
|
|
4788
4788
|
t && (i ? F(i) && (o = Z(i)) : o = Z(n));
|
|
4789
4789
|
const a = Mi(r, e, i) ? de(r) : V(0);
|
|
4790
|
-
let
|
|
4790
|
+
let l = (s.left + a.x) / o.x, c = (s.top + a.y) / o.y, f = s.width / o.x, d = s.height / o.y;
|
|
4791
4791
|
if (r) {
|
|
4792
4792
|
const x = H(r), u = i && F(i) ? H(i) : i;
|
|
4793
4793
|
let g = x, w = St(g);
|
|
4794
4794
|
for (; w && i && u !== g; ) {
|
|
4795
4795
|
const p = Z(w), y = w.getBoundingClientRect(), b = X(w), m = y.left + (w.clientLeft + parseFloat(b.paddingLeft)) * p.x, E = y.top + (w.clientTop + parseFloat(b.paddingTop)) * p.y;
|
|
4796
|
-
|
|
4796
|
+
l *= p.x, c *= p.y, f *= p.x, d *= p.y, l += m, c += E, g = H(w), w = St(g);
|
|
4797
4797
|
}
|
|
4798
4798
|
}
|
|
4799
4799
|
return ut({
|
|
4800
4800
|
width: f,
|
|
4801
4801
|
height: d,
|
|
4802
|
-
x:
|
|
4802
|
+
x: l,
|
|
4803
4803
|
y: c
|
|
4804
4804
|
});
|
|
4805
4805
|
}
|
|
@@ -4813,20 +4813,20 @@ function Hi(n) {
|
|
|
4813
4813
|
const r = s === "fixed", o = Y(i), a = t ? wt(t.floating) : !1;
|
|
4814
4814
|
if (i === o || a && r)
|
|
4815
4815
|
return e;
|
|
4816
|
-
let
|
|
4816
|
+
let l = {
|
|
4817
4817
|
scrollLeft: 0,
|
|
4818
4818
|
scrollTop: 0
|
|
4819
4819
|
}, c = V(1);
|
|
4820
4820
|
const f = V(0), d = N(i);
|
|
4821
|
-
if ((d || !d && !r) && ((tt(i) !== "body" ||
|
|
4821
|
+
if ((d || !d && !r) && ((tt(i) !== "body" || lt(o)) && (l = pt(i)), N(i))) {
|
|
4822
4822
|
const x = ot(i);
|
|
4823
4823
|
c = Z(i), f.x = x.x + i.clientLeft, f.y = x.y + i.clientTop;
|
|
4824
4824
|
}
|
|
4825
4825
|
return {
|
|
4826
4826
|
width: e.width * c.x,
|
|
4827
4827
|
height: e.height * c.y,
|
|
4828
|
-
x: e.x * c.x -
|
|
4829
|
-
y: e.y * c.y -
|
|
4828
|
+
x: e.x * c.x - l.scrollLeft * c.x + f.x,
|
|
4829
|
+
y: e.y * c.y - l.scrollTop * c.y + f.y
|
|
4830
4830
|
};
|
|
4831
4831
|
}
|
|
4832
4832
|
function Di(n) {
|
|
@@ -4849,25 +4849,25 @@ function Fi(n) {
|
|
|
4849
4849
|
}
|
|
4850
4850
|
function Xi(n, t) {
|
|
4851
4851
|
const e = H(n), i = Y(n), s = e.visualViewport;
|
|
4852
|
-
let r = i.clientWidth, o = i.clientHeight, a = 0,
|
|
4852
|
+
let r = i.clientWidth, o = i.clientHeight, a = 0, l = 0;
|
|
4853
4853
|
if (s) {
|
|
4854
4854
|
r = s.width, o = s.height;
|
|
4855
4855
|
const c = Dt();
|
|
4856
|
-
(!c || c && t === "fixed") && (a = s.offsetLeft,
|
|
4856
|
+
(!c || c && t === "fixed") && (a = s.offsetLeft, l = s.offsetTop);
|
|
4857
4857
|
}
|
|
4858
4858
|
return {
|
|
4859
4859
|
width: r,
|
|
4860
4860
|
height: o,
|
|
4861
4861
|
x: a,
|
|
4862
|
-
y:
|
|
4862
|
+
y: l
|
|
4863
4863
|
};
|
|
4864
4864
|
}
|
|
4865
4865
|
function ki(n, t) {
|
|
4866
|
-
const e = ot(n, !0, t === "fixed"), i = e.top + n.clientTop, s = e.left + n.clientLeft, r = N(n) ? Z(n) : V(1), o = n.clientWidth * r.x, a = n.clientHeight * r.y,
|
|
4866
|
+
const e = ot(n, !0, t === "fixed"), i = e.top + n.clientTop, s = e.left + n.clientLeft, r = N(n) ? Z(n) : V(1), o = n.clientWidth * r.x, a = n.clientHeight * r.y, l = s * r.x, c = i * r.y;
|
|
4867
4867
|
return {
|
|
4868
4868
|
width: o,
|
|
4869
4869
|
height: a,
|
|
4870
|
-
x:
|
|
4870
|
+
x: l,
|
|
4871
4871
|
y: c
|
|
4872
4872
|
};
|
|
4873
4873
|
}
|
|
@@ -4901,8 +4901,8 @@ function Ni(n, t) {
|
|
|
4901
4901
|
const r = X(n).position === "fixed";
|
|
4902
4902
|
let o = r ? z(n) : n;
|
|
4903
4903
|
for (; F(o) && !Q(o); ) {
|
|
4904
|
-
const a = X(o),
|
|
4905
|
-
!
|
|
4904
|
+
const a = X(o), l = Ht(o);
|
|
4905
|
+
!l && a.position === "fixed" && (s = null), (r ? !l && !s : !l && a.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || lt(o) && !l && fe(n, o)) ? i = i.filter((f) => f !== o) : s = a, o = z(o);
|
|
4906
4906
|
}
|
|
4907
4907
|
return t.set(n, i), i;
|
|
4908
4908
|
}
|
|
@@ -4913,22 +4913,22 @@ function Ki(n) {
|
|
|
4913
4913
|
rootBoundary: i,
|
|
4914
4914
|
strategy: s
|
|
4915
4915
|
} = n;
|
|
4916
|
-
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0],
|
|
4916
|
+
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0], l = o.reduce((c, f) => {
|
|
4917
4917
|
const d = $t(t, f, s);
|
|
4918
4918
|
return c.top = U(d.top, c.top), c.right = rt(d.right, c.right), c.bottom = rt(d.bottom, c.bottom), c.left = U(d.left, c.left), c;
|
|
4919
4919
|
}, $t(t, a, s));
|
|
4920
4920
|
return {
|
|
4921
|
-
width:
|
|
4922
|
-
height:
|
|
4923
|
-
x:
|
|
4924
|
-
y:
|
|
4921
|
+
width: l.right - l.left,
|
|
4922
|
+
height: l.bottom - l.top,
|
|
4923
|
+
x: l.left,
|
|
4924
|
+
y: l.top
|
|
4925
4925
|
};
|
|
4926
4926
|
}
|
|
4927
4927
|
function Yi(n) {
|
|
4928
4928
|
const {
|
|
4929
4929
|
width: t,
|
|
4930
4930
|
height: e
|
|
4931
|
-
} =
|
|
4931
|
+
} = le(n);
|
|
4932
4932
|
return {
|
|
4933
4933
|
width: t,
|
|
4934
4934
|
height: e
|
|
@@ -4940,19 +4940,19 @@ function Bi(n, t, e) {
|
|
|
4940
4940
|
scrollLeft: 0,
|
|
4941
4941
|
scrollTop: 0
|
|
4942
4942
|
};
|
|
4943
|
-
const
|
|
4943
|
+
const l = V(0);
|
|
4944
4944
|
if (i || !i && !r)
|
|
4945
|
-
if ((tt(t) !== "body" ||
|
|
4945
|
+
if ((tt(t) !== "body" || lt(s)) && (a = pt(t)), i) {
|
|
4946
4946
|
const u = ot(t, !0, r, t);
|
|
4947
|
-
|
|
4948
|
-
} else s && (
|
|
4947
|
+
l.x = u.x + t.clientLeft, l.y = u.y + t.clientTop;
|
|
4948
|
+
} else s && (l.x = At(s));
|
|
4949
4949
|
let c = 0, f = 0;
|
|
4950
4950
|
if (s && !i && !r) {
|
|
4951
4951
|
const u = s.getBoundingClientRect();
|
|
4952
4952
|
f = u.top + a.scrollTop, c = u.left + a.scrollLeft - // RTL <body> scrollbar.
|
|
4953
4953
|
At(s, u);
|
|
4954
4954
|
}
|
|
4955
|
-
const d = o.left + a.scrollLeft -
|
|
4955
|
+
const d = o.left + a.scrollLeft - l.x - c, x = o.top + a.scrollTop - l.y - f;
|
|
4956
4956
|
return {
|
|
4957
4957
|
x: d,
|
|
4958
4958
|
y: x,
|
|
@@ -5030,11 +5030,11 @@ const Vi = {
|
|
|
5030
5030
|
};
|
|
5031
5031
|
let $i = class {
|
|
5032
5032
|
constructor(t) {
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5033
|
+
h(this, "ctx");
|
|
5034
|
+
h(this, "enable", !1);
|
|
5035
|
+
h(this, "contentEl");
|
|
5036
|
+
h(this, "floatingEl");
|
|
5037
|
+
h(this, "arrowEl");
|
|
5038
5038
|
this.ctx = t;
|
|
5039
5039
|
const { TOOLTIP_BG_COLOR: e, TOOLTIP_TEXT_COLOR: i, TOOLTIP_ZINDEX: s, TOOLTIP_CUSTOM_STYLE: r, CSS_PREFIX: o } = this.ctx.config;
|
|
5040
5040
|
this.contentEl = document.createElement("div"), this.arrowEl = document.createElement("div"), this.floatingEl = document.createElement("div"), this.floatingEl.className = `${o}-tooltip`, this.contentEl.className = `${o}-tooltip-content`, this.arrowEl.className = `${o}-tooltip-arrow`;
|
|
@@ -5049,7 +5049,7 @@ let $i = class {
|
|
|
5049
5049
|
borderRadius: "4px",
|
|
5050
5050
|
fontSize: "12px",
|
|
5051
5051
|
...r
|
|
5052
|
-
},
|
|
5052
|
+
}, l = {
|
|
5053
5053
|
position: "absolute",
|
|
5054
5054
|
width: "10px",
|
|
5055
5055
|
height: "10px",
|
|
@@ -5058,7 +5058,7 @@ let $i = class {
|
|
|
5058
5058
|
transform: "rotate(45deg)",
|
|
5059
5059
|
zIndex: a.zIndex
|
|
5060
5060
|
};
|
|
5061
|
-
Object.assign(this.arrowEl.style,
|
|
5061
|
+
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();
|
|
5062
5062
|
}
|
|
5063
5063
|
init() {
|
|
5064
5064
|
this.ctx.on("mousemove", (t) => {
|
|
@@ -5102,10 +5102,10 @@ let $i = class {
|
|
|
5102
5102
|
placement: t.overflowTooltipPlacement,
|
|
5103
5103
|
middleware: [ge(), we(), ue(6), zi({ element: this.arrowEl })]
|
|
5104
5104
|
}).then((a) => {
|
|
5105
|
-
const { x:
|
|
5105
|
+
const { x: l, y: c, placement: f, middlewareData: d } = a;
|
|
5106
5106
|
if (Object.assign(this.floatingEl.style, {
|
|
5107
5107
|
top: `${c}px`,
|
|
5108
|
-
left: `${
|
|
5108
|
+
left: `${l}px`
|
|
5109
5109
|
}), d.arrow) {
|
|
5110
5110
|
const x = d.arrow;
|
|
5111
5111
|
["left", "left-start", "left-end"].includes(f) ? Object.assign(this.arrowEl.style, {
|
|
@@ -5141,13 +5141,13 @@ let $i = class {
|
|
|
5141
5141
|
};
|
|
5142
5142
|
class qi {
|
|
5143
5143
|
constructor(t) {
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5144
|
+
h(this, "editorEl");
|
|
5145
|
+
h(this, "inputEl");
|
|
5146
|
+
h(this, "enable", !1);
|
|
5147
|
+
h(this, "cellTarget", null);
|
|
5148
|
+
h(this, "ctx");
|
|
5149
|
+
h(this, "drawY", 0);
|
|
5150
|
+
h(this, "drawX", 0);
|
|
5151
5151
|
this.ctx = t, this.initTextEditor(), this.init();
|
|
5152
5152
|
}
|
|
5153
5153
|
init() {
|
|
@@ -5232,12 +5232,12 @@ class qi {
|
|
|
5232
5232
|
this.drawX = r, this.drawY = o;
|
|
5233
5233
|
let { height: a } = t;
|
|
5234
5234
|
const {
|
|
5235
|
-
config: { CELL_PADDING:
|
|
5235
|
+
config: { CELL_PADDING: l },
|
|
5236
5236
|
header: c
|
|
5237
5237
|
} = this.ctx;
|
|
5238
5238
|
let f = this.ctx.body.visibleHeight;
|
|
5239
5239
|
if (a > f && (a = f), this.editorEl.style.left = `${r - 1}px`, this.editorEl.style.top = `${o - 1}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text") {
|
|
5240
|
-
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${a - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${i - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${
|
|
5240
|
+
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${a - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${i - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${l}px`, e !== null && (this.inputEl.value = e), this.inputEl.focus();
|
|
5241
5241
|
const d = this.inputEl.value.length;
|
|
5242
5242
|
this.inputEl.setSelectionRange(d, d);
|
|
5243
5243
|
} else
|
|
@@ -5271,11 +5271,11 @@ class qi {
|
|
|
5271
5271
|
const r = this.ctx.focusCell;
|
|
5272
5272
|
if (!r || ["index", "index-selection", "selection"].includes(r.type) || this.enable)
|
|
5273
5273
|
return;
|
|
5274
|
-
const { rowKey: o, key: a } = r,
|
|
5275
|
-
r && !
|
|
5274
|
+
const { rowKey: o, key: a } = r, l = this.ctx.database.getReadonly(o, a);
|
|
5275
|
+
r && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = r, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
5276
5276
|
}
|
|
5277
5277
|
doneEdit() {
|
|
5278
|
-
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.stageElement.focus(), this.ctx.editing = !1
|
|
5278
|
+
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.stageElement.focus(), this.ctx.editing = !1);
|
|
5279
5279
|
}
|
|
5280
5280
|
destroy() {
|
|
5281
5281
|
var t;
|
|
@@ -5284,18 +5284,18 @@ class qi {
|
|
|
5284
5284
|
}
|
|
5285
5285
|
class Gi {
|
|
5286
5286
|
constructor(t) {
|
|
5287
|
-
|
|
5288
|
-
|
|
5287
|
+
h(this, "ctx");
|
|
5288
|
+
h(this, "emptyEl");
|
|
5289
5289
|
this.ctx = t;
|
|
5290
5290
|
const { EMPTY_TEXT: e, EMPTY_CUSTOM_STYLE: i } = this.ctx.config;
|
|
5291
5291
|
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: r, bodyHeight: o, footerHeight: a }) => {
|
|
5292
|
-
const
|
|
5292
|
+
const l = r + (o + a) / 2, c = {
|
|
5293
5293
|
display: s === "empty" ? "block" : "none",
|
|
5294
5294
|
position: "absolute",
|
|
5295
5295
|
fontSize: "14px",
|
|
5296
5296
|
color: "#666",
|
|
5297
5297
|
left: "50%",
|
|
5298
|
-
top: `${
|
|
5298
|
+
top: `${l}px`,
|
|
5299
5299
|
transform: "translate(-50%, -50%)",
|
|
5300
5300
|
...i
|
|
5301
5301
|
};
|
|
@@ -5308,7 +5308,7 @@ class Gi {
|
|
|
5308
5308
|
}
|
|
5309
5309
|
class ji {
|
|
5310
5310
|
constructor(t) {
|
|
5311
|
-
|
|
5311
|
+
h(this, "ctx");
|
|
5312
5312
|
this.ctx = t;
|
|
5313
5313
|
}
|
|
5314
5314
|
draw() {
|
|
@@ -5335,9 +5335,9 @@ class ji {
|
|
|
5335
5335
|
fixedRightWidth: e,
|
|
5336
5336
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
5337
5337
|
} = this.ctx, { visibleWidth: r, visibleHeight: o, renderCellHeaders: a } = this.ctx.header;
|
|
5338
|
-
let
|
|
5338
|
+
let l = [], c = [], f = [];
|
|
5339
5339
|
a.forEach((p) => {
|
|
5340
|
-
p.render && (p.fixed === "left" ? c.push(p) : p.fixed === "right" ? f.push(p) :
|
|
5340
|
+
p.render && (p.fixed === "left" ? c.push(p) : p.fixed === "right" ? f.push(p) : l.push(p));
|
|
5341
5341
|
});
|
|
5342
5342
|
const d = e - i, x = {
|
|
5343
5343
|
key: "left",
|
|
@@ -5360,7 +5360,7 @@ class ji {
|
|
|
5360
5360
|
width: `${r - t - d + 1}px`,
|
|
5361
5361
|
height: `${o}px`
|
|
5362
5362
|
},
|
|
5363
|
-
cells:
|
|
5363
|
+
cells: l
|
|
5364
5364
|
}, g = {
|
|
5365
5365
|
key: "right",
|
|
5366
5366
|
style: {
|
|
@@ -5396,7 +5396,7 @@ class ji {
|
|
|
5396
5396
|
const {
|
|
5397
5397
|
fixedLeftWidth: r,
|
|
5398
5398
|
fixedRightWidth: o,
|
|
5399
|
-
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX:
|
|
5399
|
+
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX: l }
|
|
5400
5400
|
} = this.ctx, { visibleWidth: c, visibleHeight: f } = this.ctx.body, d = o - a, x = {
|
|
5401
5401
|
key: "left",
|
|
5402
5402
|
style: {
|
|
@@ -5433,7 +5433,7 @@ class ji {
|
|
|
5433
5433
|
};
|
|
5434
5434
|
return {
|
|
5435
5435
|
type: "body",
|
|
5436
|
-
class: `${
|
|
5436
|
+
class: `${l}-overlayer-body`,
|
|
5437
5437
|
style: {
|
|
5438
5438
|
position: "relative",
|
|
5439
5439
|
overflow: "hidden",
|
|
@@ -5454,7 +5454,7 @@ class ji {
|
|
|
5454
5454
|
fixedLeftWidth: s,
|
|
5455
5455
|
fixedRightWidth: r,
|
|
5456
5456
|
config: { SCROLLER_TRACK_SIZE: o, CSS_PREFIX: a }
|
|
5457
|
-
} = this.ctx, { visibleWidth:
|
|
5457
|
+
} = this.ctx, { visibleWidth: l, visibleHeight: c } = this.ctx.footer, f = r - o, d = {
|
|
5458
5458
|
key: "left",
|
|
5459
5459
|
style: {
|
|
5460
5460
|
position: "absolute",
|
|
@@ -5472,7 +5472,7 @@ class ji {
|
|
|
5472
5472
|
top: `${0.5}px`,
|
|
5473
5473
|
left: `${s - 0.5}px`,
|
|
5474
5474
|
overflow: "hidden",
|
|
5475
|
-
width: `${
|
|
5475
|
+
width: `${l - s - f}px`,
|
|
5476
5476
|
height: `${c}px`
|
|
5477
5477
|
},
|
|
5478
5478
|
cells: t
|
|
@@ -5494,7 +5494,7 @@ class ji {
|
|
|
5494
5494
|
style: {
|
|
5495
5495
|
position: "relative",
|
|
5496
5496
|
overflow: "hidden",
|
|
5497
|
-
width: `${
|
|
5497
|
+
width: `${l}px`,
|
|
5498
5498
|
height: `${c}px`
|
|
5499
5499
|
},
|
|
5500
5500
|
views: [d, x, u]
|
|
@@ -5503,17 +5503,17 @@ class ji {
|
|
|
5503
5503
|
}
|
|
5504
5504
|
class Ui {
|
|
5505
5505
|
constructor(t) {
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
this.ctx = t, this.ctx.contextMenuElement ? (this.
|
|
5506
|
+
h(this, "ctx");
|
|
5507
|
+
h(this, "contextMenuEl");
|
|
5508
|
+
h(this, "custom", !1);
|
|
5509
|
+
this.ctx = t, this.ctx.contextMenuElement ? (this.custom = !0, this.contextMenuEl = this.ctx.contextMenuElement) : (this.custom = !1, this.contextMenuEl = document.createElement("div")), this.createContextMenu(), this.init();
|
|
5510
5510
|
}
|
|
5511
5511
|
init() {
|
|
5512
5512
|
this.ctx.on("cellContextMenuClick", (t, e) => {
|
|
5513
5513
|
if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
|
|
5514
5514
|
e.preventDefault();
|
|
5515
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a,
|
|
5516
|
-
c >= a && c <=
|
|
5515
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a, l] = s, { rowIndex: c, colIndex: f } = t;
|
|
5516
|
+
c >= a && c <= l && f >= r && f <= o || this.ctx.emit("setSelectorCell", t, e);
|
|
5517
5517
|
const x = {
|
|
5518
5518
|
getBoundingClientRect: () => ({
|
|
5519
5519
|
width: 0,
|
|
@@ -5537,7 +5537,7 @@ class Ui {
|
|
|
5537
5537
|
}
|
|
5538
5538
|
//创建右键菜单,绑定子项点击事件
|
|
5539
5539
|
createContextMenu() {
|
|
5540
|
-
if (this.contextMenuEl.className = "e-virt-table-context-menu", this.ctx.containerElement.appendChild(this.contextMenuEl), this.
|
|
5540
|
+
if (this.contextMenuEl.className = "e-virt-table-context-menu", this.ctx.containerElement.appendChild(this.contextMenuEl), this.custom) return;
|
|
5541
5541
|
const { CONTEXT_MENU: t } = this.ctx.config;
|
|
5542
5542
|
this.createContextMenuItems(t, (e) => {
|
|
5543
5543
|
switch (e.value) {
|
|
@@ -5587,19 +5587,19 @@ class Ui {
|
|
|
5587
5587
|
}
|
|
5588
5588
|
class Qi {
|
|
5589
5589
|
constructor(t, e) {
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5590
|
+
h(this, "options");
|
|
5591
|
+
h(this, "scroller");
|
|
5592
|
+
h(this, "header");
|
|
5593
|
+
h(this, "body");
|
|
5594
|
+
h(this, "footer");
|
|
5595
|
+
h(this, "selector");
|
|
5596
|
+
h(this, "autofill");
|
|
5597
|
+
h(this, "tooltip");
|
|
5598
|
+
h(this, "editor");
|
|
5599
|
+
h(this, "empty");
|
|
5600
|
+
h(this, "overlayer");
|
|
5601
|
+
h(this, "contextMenu");
|
|
5602
|
+
h(this, "ctx");
|
|
5603
5603
|
this.options = e;
|
|
5604
5604
|
const { overlayerElement: i, editorElement: s, emptyElement: r, contextMenuElement: o } = e, a = this.createContainer(
|
|
5605
5605
|
t,
|
|
@@ -5608,7 +5608,7 @@ class Qi {
|
|
|
5608
5608
|
r,
|
|
5609
5609
|
o
|
|
5610
5610
|
);
|
|
5611
|
-
this.ctx = new
|
|
5611
|
+
this.ctx = new li(a, this.options), this.header = new di(this.ctx), this.body = new fi(this.ctx), this.footer = new xi(this.ctx), this.scroller = new ci(this.ctx), this.selector = new ui(this.ctx), this.autofill = new gi(this.ctx), this.tooltip = new $i(this.ctx), this.empty = new Gi(this.ctx), this.editor = new qi(this.ctx), this.overlayer = new ji(this.ctx), this.contextMenu = new Ui(this.ctx), this.ctx.on("draw", () => {
|
|
5612
5612
|
this.draw();
|
|
5613
5613
|
}), this.ctx.on("drawView", () => {
|
|
5614
5614
|
this.draw(!0);
|
|
@@ -5616,16 +5616,16 @@ class Qi {
|
|
|
5616
5616
|
}
|
|
5617
5617
|
createContainer(t, e, i, s, r) {
|
|
5618
5618
|
t.className = "e-virt-table-container";
|
|
5619
|
-
const o = document.createElement("div"), a = document.createElement("canvas"),
|
|
5620
|
-
o.className = "e-virt-table-stage", a.className = "e-virt-table-canvas",
|
|
5619
|
+
const o = document.createElement("div"), a = document.createElement("canvas"), l = e || document.createElement("div");
|
|
5620
|
+
o.className = "e-virt-table-stage", a.className = "e-virt-table-canvas", l.className = "e-virt-table-overlayer";
|
|
5621
5621
|
const c = i || document.createElement("div");
|
|
5622
5622
|
c.className = "e-virt-table-editor";
|
|
5623
5623
|
const f = s, d = r;
|
|
5624
|
-
return o.appendChild(a), o.appendChild(
|
|
5624
|
+
return o.appendChild(a), o.appendChild(l), t.appendChild(o), {
|
|
5625
5625
|
containerElement: t,
|
|
5626
5626
|
stageElement: o,
|
|
5627
5627
|
canvasElement: a,
|
|
5628
|
-
overlayerElement:
|
|
5628
|
+
overlayerElement: l,
|
|
5629
5629
|
editorElement: c,
|
|
5630
5630
|
emptyElement: f,
|
|
5631
5631
|
contextMenuElement: d
|
|
@@ -5654,6 +5654,9 @@ class Qi {
|
|
|
5654
5654
|
on(t, e) {
|
|
5655
5655
|
this.ctx.on(t, e);
|
|
5656
5656
|
}
|
|
5657
|
+
emit(t, ...e) {
|
|
5658
|
+
this.ctx.emit(t, ...e);
|
|
5659
|
+
}
|
|
5657
5660
|
off(t, e) {
|
|
5658
5661
|
this.ctx.off(t, e);
|
|
5659
5662
|
}
|
|
@@ -5693,8 +5696,8 @@ class Qi {
|
|
|
5693
5696
|
if (t && Array.isArray(s) && s.length) {
|
|
5694
5697
|
const [r] = s;
|
|
5695
5698
|
if (Array.isArray(r) && r.length) {
|
|
5696
|
-
const [o] = r, { rowKey: a, key:
|
|
5697
|
-
this.scrollToRowkey(a), this.scrollToColkey(
|
|
5699
|
+
const [o] = r, { rowKey: a, key: l } = o;
|
|
5700
|
+
this.scrollToRowkey(a), this.scrollToColkey(l);
|
|
5698
5701
|
}
|
|
5699
5702
|
}
|
|
5700
5703
|
i(s);
|
|
@@ -5719,7 +5722,7 @@ class Qi {
|
|
|
5719
5722
|
let r = [];
|
|
5720
5723
|
for (let o = 0; o < i.length; o++)
|
|
5721
5724
|
for (let a = 0; a < s.length; a++) {
|
|
5722
|
-
const
|
|
5725
|
+
const l = this.ctx.database.getRowKeyByItem(i[o]), f = s[a].key, d = await this.ctx.database.getValidator(l, f);
|
|
5723
5726
|
Array.isArray(d) && d.length && r.push(d);
|
|
5724
5727
|
}
|
|
5725
5728
|
r.length ? (e(r), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
|
|
@@ -5791,6 +5794,9 @@ class Qi {
|
|
|
5791
5794
|
getCellValueByIndex(t, e) {
|
|
5792
5795
|
return this.ctx.database.getItemValueForRowIndexAndColIndex(t, e);
|
|
5793
5796
|
}
|
|
5797
|
+
contextMenuHide() {
|
|
5798
|
+
this.contextMenu.hide();
|
|
5799
|
+
}
|
|
5794
5800
|
/**
|
|
5795
5801
|
* 销毁
|
|
5796
5802
|
*/
|