e-virt-table 0.1.19 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +673 -672
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Cell.d.ts +1 -1
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/CellHeader.d.ts +1 -0
- package/dist/lib/CellHeader.js +6 -0
- package/dist/lib/CellHeader.js.map +1 -1
- package/dist/lib/Editor.js +4 -3
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/Scroller.js +1 -0
- package/dist/lib/Scroller.js.map +1 -1
- package/dist/lib/Selector.js +3 -1
- package/dist/lib/Selector.js.map +1 -1
- package/dist/lib/Tooltip.js +1 -0
- package/dist/lib/Tooltip.js.map +1 -1
- package/dist/lib/types.d.ts +4 -3
- 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 l = (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 h = Function.bind.apply(s, a), c = new h();
|
|
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), h = 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 === h)
|
|
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 + "$"), h = 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
|
+
h.v4 = function(m) {
|
|
241
241
|
return m && m.exact ? o : new RegExp("" + t(m) + e + t(m), "g");
|
|
242
|
-
},
|
|
242
|
+
}, h.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 = h.v4().source, x = h.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", h = 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 && !h && f < t.min ? s.push(M(r.messages[d].min, t.fullField, t.min)) : h && !a && f > t.max ? s.push(M(r.messages[d].max, t.fullField, t.max)) : a && h && (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 h;
|
|
420
|
+
e instanceof Date ? h = e : h = new Date(e), v.type(t, h, s, o, r), h && v.range(t, h.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 = [], h = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
429
|
+
if (h) {
|
|
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, h = s, c = r;
|
|
537
|
+
if (typeof h == "function" && (c = h, h = {}), !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 (h.messages) {
|
|
553
553
|
var d = this.messages();
|
|
554
|
-
d === Rt && (d = vt()), Nt(d,
|
|
554
|
+
d === Rt && (d = vt()), Nt(d, h.messages), h.messages = d;
|
|
555
555
|
} else
|
|
556
|
-
|
|
557
|
-
var x = {}, u =
|
|
556
|
+
h.messages = this.messages();
|
|
557
|
+
var x = {}, u = h.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, h, 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
|
+
!h.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 (h.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)) : h.error && (A = [h.error(y, M(h.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(h.messages), w.rule.options && (w.rule.options.messages = h.messages, w.rule.options.error = h.error), B.validate(w.value, w.rule.options || h, 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, h);
|
|
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, h);
|
|
616
616
|
} catch (R) {
|
|
617
|
-
console.error == null || console.error(R),
|
|
617
|
+
console.error == null || console.error(R), h.suppressValidatorError || setTimeout(function() {
|
|
618
618
|
throw R;
|
|
619
619
|
}, 0), E(R.message);
|
|
620
620
|
}
|
|
@@ -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 h = n.slice(0, 1);
|
|
728
|
+
h === '"' && (o += 1), r += h, 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, (h) => new Array(Math.floor(h.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
|
+
l(this, "loading", !1);
|
|
754
|
+
l(this, "ctx");
|
|
755
|
+
l(this, "data");
|
|
756
|
+
l(this, "columns");
|
|
757
|
+
l(this, "footerData", []);
|
|
758
|
+
l(this, "rowKeyMap", /* @__PURE__ */ new Map());
|
|
759
|
+
l(this, "colIndexKeyMap", /* @__PURE__ */ new Map());
|
|
760
|
+
l(this, "headerMap", /* @__PURE__ */ new Map());
|
|
761
|
+
l(this, "rowIndexRowKeyMap", /* @__PURE__ */ new Map());
|
|
762
|
+
l(this, "checkboxKeyMap", /* @__PURE__ */ new Map());
|
|
763
|
+
l(this, "originalDataMap", /* @__PURE__ */ new Map());
|
|
764
|
+
l(this, "changedDataMap", /* @__PURE__ */ new Map());
|
|
765
|
+
l(this, "validationErrorMap", /* @__PURE__ */ new Map());
|
|
766
|
+
l(this, "itemRowKeyMap", /* @__PURE__ */ new WeakMap());
|
|
767
|
+
l(this, "bufferData", []);
|
|
768
|
+
l(this, "sumHeight", 0);
|
|
769
|
+
l(this, "filterMethod");
|
|
770
|
+
l(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: h, 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 || h, 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: h, 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, h && 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 h = 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 = h.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", h, 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 h = a[e];
|
|
1075
1075
|
if (this.ctx.database.getReadonly(t, e))
|
|
1076
1076
|
return {
|
|
1077
|
-
oldValue:
|
|
1078
|
-
newValue:
|
|
1077
|
+
oldValue: h,
|
|
1078
|
+
newValue: h
|
|
1079
1079
|
};
|
|
1080
|
-
a[e] !== null && typeof a[e] == "object" && (
|
|
1080
|
+
a[e] !== null && typeof a[e] == "object" && (h = 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, h);
|
|
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: h,
|
|
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: h,
|
|
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: h,
|
|
1134
1134
|
newValue: d
|
|
1135
1135
|
}
|
|
1136
1136
|
]
|
|
1137
1137
|
}), r && this.ctx.emit("draw"), {
|
|
1138
|
-
oldValue:
|
|
1138
|
+
oldValue: h,
|
|
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 h = this.rowKeyMap.get(a);
|
|
1166
|
+
h.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 h = 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 && (h = f);
|
|
1359
1359
|
}
|
|
1360
|
-
if (
|
|
1360
|
+
if (h) {
|
|
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(h) && h.length) {
|
|
1363
|
+
const x = h.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
|
+
...h,
|
|
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
|
+
l(this, "ctx");
|
|
1433
|
+
l(this, "history", []);
|
|
1434
|
+
l(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
|
+
l(this, "eventTasks", /* @__PURE__ */ new Map());
|
|
1490
|
+
l(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
|
+
l(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
|
+
l(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: h, 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 - h, e, t, e), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t - h, e, h, 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 + h, e), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t + i, e, h, s);
|
|
1625
1625
|
break;
|
|
1626
1626
|
case "top":
|
|
1627
|
-
d = this.ctx.createLinearGradient(t, e -
|
|
1627
|
+
d = this.ctx.createLinearGradient(t, e - h, t, e), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t, e - h, i, h);
|
|
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 + h), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t, e + s, i, h);
|
|
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: h = 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), h === 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 h == "number" ? [h, h, h, h] : h;
|
|
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: h = "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 = h;
|
|
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
|
+
h === "left" ? u = e + f : h === "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, h = this.ctx.measureText(t).width;
|
|
1695
|
+
if (h && h + 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
|
+
l(this, "PROCESSOR_NUM", 50);
|
|
1713
|
+
l(this, "CSS_PREFIX", "e-virt-table");
|
|
1714
|
+
l(this, "ICONS", []);
|
|
1715
|
+
l(this, "ROW_KEY", "");
|
|
1716
|
+
l(this, "HEADER_FONT", "12px normal Arial");
|
|
1717
|
+
l(this, "BODY_FONT", "12px normal Arial");
|
|
1718
|
+
l(this, "BORDER_COLOR", "#e1e6eb");
|
|
1719
|
+
l(this, "WIDTH", 0);
|
|
1720
|
+
l(this, "RESIZE_MIN_WIDTH", 40);
|
|
1721
|
+
l(this, "HEIGHT", 0);
|
|
1722
|
+
l(this, "EMPTY_BODY_HEIGHT", 120);
|
|
1723
|
+
l(this, "EMPTY_CUSTOM_STYLE", {});
|
|
1724
|
+
l(this, "EMPTY_TEXT", "暂无数据");
|
|
1725
|
+
l(this, "MAX_HEIGHT", 1e3);
|
|
1726
|
+
l(this, "BORDER_RADIUS", 8);
|
|
1727
|
+
l(this, "ENABLE_OFFSET_HEIGHT", !1);
|
|
1728
|
+
l(this, "OFFSET_HEIGHT", 0);
|
|
1729
|
+
l(this, "HEADER_HEIGHT", 36);
|
|
1730
|
+
l(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
|
+
l(this, "HEADER_BG_COLOR", "#F8FAFF");
|
|
1733
|
+
l(this, "BODY_BG_COLOR", "#FFF");
|
|
1734
|
+
l(this, "HEADER_TEXT_COLOR", "#1D2129");
|
|
1735
|
+
l(this, "LOADING_ICON_SVG", "");
|
|
1736
|
+
l(this, "LOADING_ICON_COLOR", "#4E5969");
|
|
1737
|
+
l(this, "EXPAND_ICON_SVG", "");
|
|
1738
|
+
l(this, "SHRINK_ICON_SVG", "");
|
|
1739
|
+
l(this, "EXPAND_ICON_COLOR", "#4E5969");
|
|
1740
|
+
l(this, "SHRINK_ICON_COLOR", "#4E5969");
|
|
1741
|
+
l(this, "ERROR_TIP_ICON_COLOR", "red");
|
|
1742
|
+
l(this, "ERROR_TIP_ICON_SIZE", 6);
|
|
1743
|
+
l(this, "EXPAND_LAZY", !0);
|
|
1744
|
+
l(this, "DEFAULT_EXPAND_ALL", !1);
|
|
1745
|
+
l(this, "CELL_WIDTH", 100);
|
|
1746
|
+
l(this, "CELL_HEIGHT", 36);
|
|
1747
|
+
l(this, "CELL_PADDING", 8);
|
|
1748
|
+
l(this, "CELL_HOVER_ICON_SIZE", 20);
|
|
1749
|
+
l(this, "SCROLLER_TRACK_SIZE", 14);
|
|
1750
|
+
l(this, "SCROLLER_SIZE", 8);
|
|
1751
|
+
l(this, "SCROLLER_COLOR", "#dee0e3");
|
|
1752
|
+
l(this, "SCROLLER_TRACK_COLOR", "#fff");
|
|
1753
|
+
l(this, "SCROLLER_FOCUS_COLOR", "#bbbec4");
|
|
1754
|
+
l(this, "SELECT_BORDER_COLOR", "rgb(82,146,247)");
|
|
1755
|
+
l(this, "SELECT_AREA_COLOR", "rgba(82,146,247,0.1)");
|
|
1756
|
+
l(this, "SELECT_BG_COLOR", "rgba(82,146,247,0.1)");
|
|
1757
|
+
l(this, "EDIT_BG_COLOR", "#fcf6ed");
|
|
1758
|
+
l(this, "CHECKBOX_KEY", "");
|
|
1759
|
+
l(this, "CHECKBOX_COLOR", "rgb(82,146,247)");
|
|
1760
|
+
l(this, "CHECKBOX_SIZE", 20);
|
|
1761
|
+
l(this, "CHECKBOX_DISABLED_SVG", "");
|
|
1762
|
+
l(this, "CHECKBOX_CHECK_SVG", "");
|
|
1763
|
+
l(this, "CHECKBOX_UNCHECK_SVG", "");
|
|
1764
|
+
l(this, "CHECKBOX_INDETERMINATE_SVG", "");
|
|
1765
|
+
l(this, "READONLY_COLOR", "#fff");
|
|
1766
|
+
l(this, "READONLY_TEXT_COLOR", "#4E5969");
|
|
1767
|
+
l(this, "ERROR_TIP_COLOR", "#ED3F14");
|
|
1768
|
+
l(this, "FOOTER_BG_COLOR", "#fafafa");
|
|
1769
|
+
l(this, "FOOTER_FIXED", !0);
|
|
1770
|
+
l(this, "CELL_FOOTER_HEIGHT", 36);
|
|
1771
|
+
l(this, "ENABLE_SELECTOR", !1);
|
|
1772
|
+
l(this, "ENABLE_EDIT_SINGLE_CLICK", !1);
|
|
1773
1773
|
// 启用单点击立马编辑
|
|
1774
|
-
|
|
1774
|
+
l(this, "ENABLE_EDIT_CLICK_SELECTOR", !0);
|
|
1775
1775
|
// 启用点击选择器编辑
|
|
1776
|
-
|
|
1776
|
+
l(this, "SELECTOR_AREA_MIN_X", 0);
|
|
1777
1777
|
// 选择器X最小范围
|
|
1778
|
-
|
|
1778
|
+
l(this, "SELECTOR_AREA_MAX_X_OFFSET", 0);
|
|
1779
1779
|
// 选择器X最大范围colMax - offset
|
|
1780
|
-
|
|
1780
|
+
l(this, "SELECTOR_AREA_MAX_X", 0);
|
|
1781
1781
|
// 选择器X最大范围,0默认最大colMax
|
|
1782
|
-
|
|
1782
|
+
l(this, "SELECTOR_AREA_MIN_Y", 0);
|
|
1783
1783
|
// 选择器Y最小范围
|
|
1784
|
-
|
|
1784
|
+
l(this, "SELECTOR_AREA_MAX_Y", 0);
|
|
1785
1785
|
// 选择器Y最大范围,0默认rowMax
|
|
1786
|
-
|
|
1786
|
+
l(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
|
+
l(this, "ENABLE_SELECTOR_SINGLE", !1);
|
|
1789
|
+
l(this, "ENABLE_SELECTOR_SPAN_COL", !0);
|
|
1790
|
+
l(this, "ENABLE_SELECTOR_SPAN_ROW", !0);
|
|
1791
|
+
l(this, "ENABLE_SELECTOR_ALL_ROWS", !0);
|
|
1792
|
+
l(this, "ENABLE_SELECTOR_ALL_COLS", !0);
|
|
1793
|
+
l(this, "ENABLE_AUTOFILL", !1);
|
|
1794
|
+
l(this, "ENABLE_CONTEXT_MENU", !1);
|
|
1795
|
+
l(this, "ENABLE_COPY", !0);
|
|
1796
|
+
l(this, "ENABLE_PASTER", !0);
|
|
1797
|
+
l(this, "ENABLE_RESIZE_ROW", !0);
|
|
1798
|
+
l(this, "ENABLE_RESIZE_COLUMN", !0);
|
|
1799
|
+
l(this, "RESIZE_ROW_LINE_COLOR", "#e1e6eb");
|
|
1800
|
+
l(this, "RESIZE_COLUMN_LINE_COLOR", "#e1e6eb");
|
|
1801
|
+
l(this, "RESIZE_ROW_MIN_HEIGHT", 36);
|
|
1802
|
+
l(this, "RESIZE_COLUMN_MIN_WIDTH", 40);
|
|
1803
|
+
l(this, "ENABLE_KEYBOARD", !0);
|
|
1804
|
+
l(this, "ENABLE_HISTORY", !1);
|
|
1805
|
+
l(this, "ENABLE_VALIDATOR_IMMEDIATE", !0);
|
|
1806
|
+
l(this, "HISTORY_NUM", 50);
|
|
1807
|
+
l(this, "HIGHLIGHT_HOVER_ROW", !1);
|
|
1808
|
+
l(this, "HIGHLIGHT_HOVER_ROW_COLOR", "rgba(186,203,231,0.1)");
|
|
1809
|
+
l(this, "HIGHLIGHT_SELECTED_ROW", !1);
|
|
1810
|
+
l(this, "HIGHLIGHT_SELECTED_ROW_COLOR", "rgba(82,146,247,0.1)");
|
|
1811
|
+
l(this, "TOOLTIP_BG_COLOR", "#303133");
|
|
1812
|
+
l(this, "TOOLTIP_TEXT_COLOR", "#fff");
|
|
1813
|
+
l(this, "TOOLTIP_ZINDEX", 3e3);
|
|
1814
|
+
l(this, "TOOLTIP_CUSTOM_STYLE", {});
|
|
1815
|
+
l(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
|
+
l(this, "HEADER_CELL_STYLE_METHOD");
|
|
1822
|
+
l(this, "BODY_CELL_STYLE_METHOD");
|
|
1823
|
+
l(this, "FOOTER_CELL_STYLE_METHOD");
|
|
1824
|
+
l(this, "BODY_CELL_READONLY_METHOD");
|
|
1825
|
+
l(this, "BODY_CELL_FORMATTER_METHOD");
|
|
1826
|
+
l(this, "BODY_CELL_RULES_METHOD");
|
|
1827
|
+
l(this, "BODY_CELL_TYPE_METHOD");
|
|
1828
|
+
l(this, "BODY_CELL_EDITOR_TYPE_METHOD");
|
|
1829
|
+
l(this, "BODY_CELL_RENDER_METHOD");
|
|
1830
|
+
l(this, "BODY_CELL_HOVER_ICON_METHOD");
|
|
1831
|
+
l(this, "SPAN_METHOD");
|
|
1832
|
+
l(this, "SELECTABLE_METHOD");
|
|
1833
|
+
l(this, "EXPAND_LAZY_METHOD");
|
|
1834
|
+
l(this, "BEFORE_VALUE_CHANGE_METHOD");
|
|
1835
|
+
l(this, "BEFORE_PASTE_CHANGE_METHOD");
|
|
1836
|
+
l(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
|
+
l(this, "ctx");
|
|
1846
|
+
l(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
|
+
l(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
|
+
}), h = URL.createObjectURL(a);
|
|
1943
|
+
return o.src = h, new Promise((c, f) => {
|
|
1944
1944
|
o.onerror = () => f(new Error("Failed to load image")), o.onload = () => {
|
|
1945
1945
|
c(o);
|
|
1946
1946
|
};
|
|
@@ -1952,13 +1952,13 @@ 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
|
-
|
|
1955
|
+
l(this, "ctx");
|
|
1956
|
+
l(this, "x", 0);
|
|
1957
|
+
l(this, "y", 0);
|
|
1958
|
+
l(this, "width", 0);
|
|
1959
|
+
l(this, "height", 0);
|
|
1960
|
+
l(this, "fixed");
|
|
1961
|
+
l(this, "cellType");
|
|
1962
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() {
|
|
@@ -1997,57 +1997,57 @@ 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
|
-
|
|
2000
|
+
constructor(e, i, s, r, o, a, h, c, f, d = "body") {
|
|
2001
|
+
super(e, r, o, a, h, d, c.fixed);
|
|
2002
|
+
l(this, "formatter");
|
|
2003
|
+
l(this, "formatterFooter");
|
|
2004
|
+
l(this, "hoverIconName", "");
|
|
2005
|
+
l(this, "operation", !1);
|
|
2006
|
+
l(this, "align");
|
|
2007
|
+
l(this, "verticalAlign");
|
|
2008
|
+
l(this, "fixed");
|
|
2009
|
+
l(this, "type");
|
|
2010
|
+
l(this, "editorType");
|
|
2011
|
+
l(this, "cellType");
|
|
2012
|
+
l(this, "level");
|
|
2013
|
+
l(this, "colspan", 1);
|
|
2014
|
+
l(this, "rowspan", 1);
|
|
2015
|
+
l(this, "key");
|
|
2016
|
+
l(this, "column");
|
|
2017
|
+
l(this, "rowIndex");
|
|
2018
|
+
l(this, "colIndex");
|
|
2019
|
+
l(this, "rowKey");
|
|
2020
|
+
l(this, "row");
|
|
2021
|
+
l(this, "value");
|
|
2022
|
+
l(this, "render");
|
|
2023
|
+
l(this, "renderFooter");
|
|
2024
|
+
l(this, "style", {});
|
|
2025
|
+
l(this, "rules", {});
|
|
2026
|
+
l(this, "message", "");
|
|
2027
|
+
l(this, "text", "");
|
|
2028
|
+
l(this, "displayText", "");
|
|
2029
|
+
l(this, "visibleWidth", 0);
|
|
2030
|
+
l(this, "visibleHeight", 0);
|
|
2031
|
+
l(this, "isHasChanged", !1);
|
|
2032
|
+
l(this, "drawX", 0);
|
|
2033
|
+
l(this, "drawY", 0);
|
|
2034
|
+
l(this, "drawCellBgColor", "");
|
|
2035
|
+
l(this, "drawCellSkyBgColor", "");
|
|
2036
|
+
l(this, "drawTextColor", "");
|
|
2037
|
+
l(this, "drawTextX", 0);
|
|
2038
|
+
l(this, "drawTextY", 0);
|
|
2039
|
+
l(this, "drawImageX", 0);
|
|
2040
|
+
l(this, "drawImageY", 0);
|
|
2041
|
+
l(this, "drawImageWidth", 0);
|
|
2042
|
+
l(this, "drawImageHeight", 0);
|
|
2043
|
+
l(this, "drawImageName", "");
|
|
2044
|
+
l(this, "drawImageSource");
|
|
2045
|
+
l(this, "ellipsis", !1);
|
|
2046
|
+
l(this, "rowExpand", !1);
|
|
2047
|
+
l(this, "rowHasChildren", !1);
|
|
2048
|
+
l(this, "overflowTooltipShow", !0);
|
|
2049
|
+
l(this, "overflowTooltipMaxWidth", 500);
|
|
2050
|
+
l(this, "overflowTooltipPlacement", "top");
|
|
2051
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() {
|
|
@@ -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 h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: f = !1, expandLoading: d = !1, level: x = 0 } = h || {};
|
|
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: h,
|
|
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), h && (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: h, 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 === h || ["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 h = 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
|
+
h !== void 0 && (this.hoverIconName = h);
|
|
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], h = o[1], { colIndex: c, rowIndex: f, drawX: d, drawY: x } = this;
|
|
2352
|
+
c === a && f === h && 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 h = i + 0.5, c = s + 0.5, f = this.height;
|
|
2408
|
+
o === 0 && (c = this.y + 1, f = f - 1), a === this.ctx.maxColIndex && (h = h - 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([h, c, h + 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([h, c + f - 1.5, h + 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([h, c, h, 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([h + r - 1.5, c, h + r - 1.5, c + f - 1.5], {
|
|
2432
2432
|
borderColor: w,
|
|
2433
2433
|
fillColor: p,
|
|
2434
2434
|
borderWidth: g,
|
|
@@ -2439,42 +2439,43 @@ 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, "header",
|
|
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
|
-
|
|
2442
|
+
constructor(e, i, s, r, o, a, h) {
|
|
2443
|
+
super(e, s, r, o, a, "header", h.fixed);
|
|
2444
|
+
l(this, "align");
|
|
2445
|
+
l(this, "verticalAlign", "middle");
|
|
2446
|
+
l(this, "fixed");
|
|
2447
|
+
l(this, "widthFillDisable");
|
|
2448
|
+
l(this, "type");
|
|
2449
|
+
l(this, "operation", !1);
|
|
2450
|
+
l(this, "editorType");
|
|
2451
|
+
l(this, "level");
|
|
2452
|
+
l(this, "text");
|
|
2453
|
+
l(this, "displayText", "");
|
|
2454
|
+
l(this, "colspan");
|
|
2455
|
+
l(this, "rowspan");
|
|
2456
|
+
l(this, "row");
|
|
2457
|
+
l(this, "key");
|
|
2458
|
+
l(this, "required", !1);
|
|
2459
|
+
l(this, "readonly", !1);
|
|
2460
|
+
l(this, "children", []);
|
|
2461
|
+
l(this, "column");
|
|
2462
|
+
l(this, "colIndex");
|
|
2463
|
+
l(this, "rowKey");
|
|
2464
|
+
l(this, "rules");
|
|
2465
|
+
l(this, "hasChildren");
|
|
2466
|
+
l(this, "render");
|
|
2467
|
+
l(this, "style", {});
|
|
2468
|
+
l(this, "drawX", 0);
|
|
2469
|
+
l(this, "drawY", 0);
|
|
2470
|
+
l(this, "drawCellBgColor", "");
|
|
2471
|
+
l(this, "drawTextColor", "");
|
|
2472
|
+
l(this, "drawImageX", 0);
|
|
2473
|
+
l(this, "drawImageY", 0);
|
|
2474
|
+
l(this, "drawImageWidth", 0);
|
|
2475
|
+
l(this, "drawImageHeight", 0);
|
|
2476
|
+
l(this, "drawImageName", "");
|
|
2477
|
+
l(this, "drawImageSource");
|
|
2478
|
+
this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = a, this.colIndex = i, this.key = h.key, this.type = h.type || "", this.editorType = h.editorType || "text", this.align = h.align || "center", this.verticalAlign = h.verticalAlign || "middle", this.fixed = h.fixed, this.level = h.level || 0, this.operation = h.operation || !1, this.text = h.title, this.column = h, this.colspan = h.colspan || 1, this.widthFillDisable = h.widthFillDisable || !1, this.rowspan = h.rowspan || 1, this.rules = h.rules, this.readonly = h.readonly || !1, this.required = h.required || !1, this.rowKey = Ut(), this.hasChildren = h.children && h.children.length > 0 || !1, this.render = h.renderHeader;
|
|
2478
2479
|
}
|
|
2479
2480
|
/**
|
|
2480
2481
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -2494,11 +2495,11 @@ class ie extends te {
|
|
|
2494
2495
|
const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
|
|
2495
2496
|
let r = i, o = s;
|
|
2496
2497
|
if (typeof e == "function") {
|
|
2497
|
-
const a = e, { backgroundColor:
|
|
2498
|
+
const a = e, { backgroundColor: h, color: c } = a({
|
|
2498
2499
|
colIndex: this.colIndex,
|
|
2499
2500
|
column: this.column
|
|
2500
2501
|
}) || {};
|
|
2501
|
-
|
|
2502
|
+
h && (r = h), c && (o = c);
|
|
2502
2503
|
}
|
|
2503
2504
|
this.drawCellBgColor = r, this.drawTextColor = o;
|
|
2504
2505
|
}
|
|
@@ -2509,11 +2510,11 @@ class ie extends te {
|
|
|
2509
2510
|
const {
|
|
2510
2511
|
paint: e,
|
|
2511
2512
|
config: { BORDER_COLOR: i, CELL_PADDING: s, HEADER_FONT: r }
|
|
2512
|
-
} = this.ctx, { drawX: o, drawY: a, displayText:
|
|
2513
|
+
} = this.ctx, { drawX: o, drawY: a, displayText: h } = this;
|
|
2513
2514
|
e.drawRect(o, a, this.width, this.height, {
|
|
2514
2515
|
borderColor: i,
|
|
2515
2516
|
fillColor: this.drawCellBgColor
|
|
2516
|
-
}), e.drawText(
|
|
2517
|
+
}), e.drawText(h, o, a, this.width, this.height, {
|
|
2517
2518
|
font: r,
|
|
2518
2519
|
padding: s,
|
|
2519
2520
|
color: this.drawTextColor,
|
|
@@ -2524,9 +2525,9 @@ class ie extends te {
|
|
|
2524
2525
|
drawSelection() {
|
|
2525
2526
|
const { width: e, height: i, type: s } = this;
|
|
2526
2527
|
if (["index-selection", "selection"].includes(s)) {
|
|
2527
|
-
const { indeterminate: r, check: o, selectable: a } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE:
|
|
2528
|
+
const { indeterminate: r, check: o, selectable: a } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: h = 0 } = this.ctx.config, c = this.drawX + (e - h) / 2, f = this.drawY + (i - h) / 2;
|
|
2528
2529
|
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 =
|
|
2530
|
+
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 = h, this.drawImageHeight = h, this.drawImageName = x, this.drawImageSource = d, this.ctx.paint.drawImage(
|
|
2530
2531
|
this.drawImageSource,
|
|
2531
2532
|
this.drawImageX,
|
|
2532
2533
|
this.drawImageY,
|
|
@@ -2555,11 +2556,11 @@ class ie extends te {
|
|
|
2555
2556
|
};
|
|
2556
2557
|
}
|
|
2557
2558
|
}
|
|
2558
|
-
class
|
|
2559
|
+
class li {
|
|
2559
2560
|
constructor(t) {
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2561
|
+
l(this, "ctx");
|
|
2562
|
+
l(this, "visibleHoverCell");
|
|
2563
|
+
l(this, "resizeObserver");
|
|
2563
2564
|
this.ctx = t, this.init();
|
|
2564
2565
|
}
|
|
2565
2566
|
init() {
|
|
@@ -2649,10 +2650,10 @@ class hi {
|
|
|
2649
2650
|
colIndex: t.colIndex,
|
|
2650
2651
|
column: t.column,
|
|
2651
2652
|
value: t.getValue()
|
|
2652
|
-
}).then((
|
|
2653
|
-
this.ctx.database.setExpandChildren(t.rowKey,
|
|
2654
|
-
}).catch((
|
|
2655
|
-
this.ctx.database.expandLoading(t.rowKey, !1), console.error(
|
|
2653
|
+
}).then((h) => {
|
|
2654
|
+
this.ctx.database.setExpandChildren(t.rowKey, h), this.ctx.database.expandLoading(t.rowKey, !1), this.ctx.emit("expandChange", this.ctx.database.getExpandRowKeys());
|
|
2655
|
+
}).catch((h) => {
|
|
2656
|
+
this.ctx.database.expandLoading(t.rowKey, !1), console.error(h);
|
|
2656
2657
|
}));
|
|
2657
2658
|
else {
|
|
2658
2659
|
const a = this.ctx.database.getIsExpand(t.rowKey);
|
|
@@ -2679,15 +2680,15 @@ class hi {
|
|
|
2679
2680
|
handleBodyEvent(t, e, i, s, r = !1) {
|
|
2680
2681
|
for (const o of i) {
|
|
2681
2682
|
const a = o.fixedCells.concat(o.noFixedCells);
|
|
2682
|
-
for (const
|
|
2683
|
-
const c =
|
|
2683
|
+
for (const h of a) {
|
|
2684
|
+
const c = h.getDrawX(), f = h.getDrawY();
|
|
2684
2685
|
if (r) {
|
|
2685
|
-
if (t > c && t < c +
|
|
2686
|
-
s(
|
|
2686
|
+
if (t > c && t < c + h.visibleWidth && e > f && e < f + h.visibleHeight) {
|
|
2687
|
+
s(h);
|
|
2687
2688
|
return;
|
|
2688
2689
|
}
|
|
2689
|
-
} else if (t > c && t < c +
|
|
2690
|
-
s(
|
|
2690
|
+
} else if (t > c && t < c + h.width && e > f && e < f + h.height) {
|
|
2691
|
+
s(h);
|
|
2691
2692
|
return;
|
|
2692
2693
|
}
|
|
2693
2694
|
}
|
|
@@ -2706,55 +2707,55 @@ class hi {
|
|
|
2706
2707
|
this.resizeObserver.unobserve(this.ctx.stageElement);
|
|
2707
2708
|
}
|
|
2708
2709
|
}
|
|
2709
|
-
class
|
|
2710
|
+
class hi {
|
|
2710
2711
|
constructor(t, e) {
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2712
|
+
l(this, "eventBus");
|
|
2713
|
+
l(this, "eventBrowser");
|
|
2714
|
+
l(this, "eventTable");
|
|
2715
|
+
l(this, "containerElement");
|
|
2716
|
+
l(this, "stageElement");
|
|
2717
|
+
l(this, "canvasElement");
|
|
2718
|
+
l(this, "overlayerElement");
|
|
2719
|
+
l(this, "editorElement");
|
|
2720
|
+
l(this, "emptyElement");
|
|
2721
|
+
l(this, "contextMenuElement");
|
|
2722
|
+
l(this, "stageWidth", 0);
|
|
2723
|
+
l(this, "stageHeight", 0);
|
|
2724
|
+
l(this, "paint");
|
|
2725
|
+
l(this, "icons");
|
|
2726
|
+
l(this, "isInsideTargetContainer", !1);
|
|
2727
|
+
l(this, "mousedown", !1);
|
|
2728
|
+
l(this, "isPointer", !1);
|
|
2729
|
+
l(this, "rowResizing", !1);
|
|
2729
2730
|
// 行调整大小中
|
|
2730
|
-
|
|
2731
|
+
l(this, "columnResizing", !1);
|
|
2731
2732
|
// 列调整大小中
|
|
2732
|
-
|
|
2733
|
+
l(this, "scrollerMove", !1);
|
|
2733
2734
|
// 滚动条移动中
|
|
2734
|
-
|
|
2735
|
+
l(this, "scrollerFocus", !1);
|
|
2735
2736
|
// 滚动条focus中
|
|
2736
|
-
|
|
2737
|
+
l(this, "autofillMove", !1);
|
|
2737
2738
|
// 自动填充移动中
|
|
2738
|
-
|
|
2739
|
+
l(this, "selectorMove", !1);
|
|
2739
2740
|
// 选择器移动中
|
|
2740
|
-
|
|
2741
|
+
l(this, "adjustPositioning", !1);
|
|
2741
2742
|
// 调整位置中
|
|
2742
|
-
|
|
2743
|
+
l(this, "editing", !1);
|
|
2743
2744
|
// 编辑中
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2745
|
+
l(this, "scrollY", 0);
|
|
2746
|
+
l(this, "scrollX", 0);
|
|
2747
|
+
l(this, "fixedLeftWidth", 0);
|
|
2748
|
+
l(this, "fixedRightWidth", 0);
|
|
2749
|
+
l(this, "maxColIndex", 0);
|
|
2750
|
+
l(this, "maxRowIndex", 0);
|
|
2751
|
+
l(this, "hoverRow");
|
|
2752
|
+
l(this, "clickCell");
|
|
2753
|
+
l(this, "focusCell");
|
|
2754
|
+
l(this, "hoverCell");
|
|
2755
|
+
l(this, "clickCellHeader");
|
|
2756
|
+
l(this, "focusCellHeader");
|
|
2757
|
+
l(this, "hoverCellHeader");
|
|
2758
|
+
l(this, "body", {
|
|
2758
2759
|
x: 0,
|
|
2759
2760
|
y: 0,
|
|
2760
2761
|
width: 0,
|
|
@@ -2767,7 +2768,7 @@ class li {
|
|
|
2767
2768
|
renderRows: [],
|
|
2768
2769
|
data: []
|
|
2769
2770
|
});
|
|
2770
|
-
|
|
2771
|
+
l(this, "footer", {
|
|
2771
2772
|
x: 0,
|
|
2772
2773
|
y: 0,
|
|
2773
2774
|
width: 0,
|
|
@@ -2776,7 +2777,7 @@ class li {
|
|
|
2776
2777
|
visibleWidth: 0,
|
|
2777
2778
|
renderRows: []
|
|
2778
2779
|
});
|
|
2779
|
-
|
|
2780
|
+
l(this, "header", {
|
|
2780
2781
|
x: 0,
|
|
2781
2782
|
y: 0,
|
|
2782
2783
|
width: 0,
|
|
@@ -2791,31 +2792,31 @@ class li {
|
|
|
2791
2792
|
fixedRightCellHeaders: [],
|
|
2792
2793
|
renderCenterCellHeaders: []
|
|
2793
2794
|
});
|
|
2794
|
-
|
|
2795
|
+
l(this, "selector", {
|
|
2795
2796
|
enable: !1,
|
|
2796
2797
|
xArr: [-1, -1],
|
|
2797
2798
|
yArr: [-1, -1],
|
|
2798
2799
|
xArrCopy: [-1, -1],
|
|
2799
2800
|
yArrCopy: [-1, -1]
|
|
2800
2801
|
});
|
|
2801
|
-
|
|
2802
|
+
l(this, "autofill", {
|
|
2802
2803
|
enable: !1,
|
|
2803
2804
|
xArr: [-1, -1],
|
|
2804
2805
|
yArr: [-1, -1]
|
|
2805
2806
|
});
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2807
|
+
l(this, "database");
|
|
2808
|
+
l(this, "history");
|
|
2809
|
+
l(this, "config");
|
|
2809
2810
|
const {
|
|
2810
2811
|
containerElement: i,
|
|
2811
2812
|
stageElement: s,
|
|
2812
2813
|
canvasElement: r,
|
|
2813
2814
|
overlayerElement: o,
|
|
2814
2815
|
editorElement: a,
|
|
2815
|
-
emptyElement:
|
|
2816
|
+
emptyElement: h,
|
|
2816
2817
|
contextMenuElement: c
|
|
2817
2818
|
} = t;
|
|
2818
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = a, this.emptyElement =
|
|
2819
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = a, this.emptyElement = h, this.contextMenuElement = c, this.config = new Wt(e.config || {}), this.eventBus = new oi(), this.eventBrowser = new ri(this), this.eventTable = new li(this), this.paint = new ni(this.canvasElement), this.database = new ii(this, e), this.history = new si(this), this.icons = new ai(this);
|
|
2819
2820
|
}
|
|
2820
2821
|
setConfig(t) {
|
|
2821
2822
|
this.config = new Wt(t);
|
|
@@ -2850,7 +2851,7 @@ class li {
|
|
|
2850
2851
|
for (let r = 0; r <= e[1] - e[0]; r++) {
|
|
2851
2852
|
const o = [];
|
|
2852
2853
|
for (let a = 0; a <= i[1] - i[0]; a++) {
|
|
2853
|
-
const
|
|
2854
|
+
const h = r + e[0], c = a + i[0], f = this.database.getItemValueForRowIndexAndColIndex(h, c);
|
|
2854
2855
|
f && o.push(f.value);
|
|
2855
2856
|
}
|
|
2856
2857
|
s += `${o.join(" ")}\r`, t.push(o);
|
|
@@ -2912,29 +2913,29 @@ class li {
|
|
|
2912
2913
|
}
|
|
2913
2914
|
class Pt {
|
|
2914
2915
|
constructor(t, e) {
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2916
|
+
l(this, "ctx");
|
|
2917
|
+
l(this, "type");
|
|
2918
|
+
l(this, "isFocus", !1);
|
|
2919
|
+
l(this, "trackX", 0);
|
|
2920
|
+
l(this, "trackY", 0);
|
|
2921
|
+
l(this, "trackWidth", 0);
|
|
2922
|
+
l(this, "trackHeight", 0);
|
|
2923
|
+
l(this, "splitPoints", []);
|
|
2923
2924
|
//分割线
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2925
|
+
l(this, "barX", 0);
|
|
2926
|
+
l(this, "barY", 0);
|
|
2927
|
+
l(this, "barWidth", 0);
|
|
2928
|
+
l(this, "barHeight", 0);
|
|
2929
|
+
l(this, "distance", 0);
|
|
2929
2930
|
// 滚动条的长度
|
|
2930
|
-
|
|
2931
|
+
l(this, "visibleDistance", 0);
|
|
2931
2932
|
//可见区域的长度
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2933
|
+
l(this, "clientX", 0);
|
|
2934
|
+
l(this, "clientY", 0);
|
|
2935
|
+
l(this, "dragStart", 0);
|
|
2935
2936
|
// 拖拽开始的位置
|
|
2936
|
-
|
|
2937
|
-
|
|
2937
|
+
l(this, "isDragging", !1);
|
|
2938
|
+
l(this, "scroll", 0);
|
|
2938
2939
|
this.ctx = t, this.type = e, this.type === "vertical" ? this.scroll = this.ctx.scrollY : this.scroll = this.ctx.scrollX;
|
|
2939
2940
|
}
|
|
2940
2941
|
onWheel(t) {
|
|
@@ -2948,7 +2949,7 @@ class Pt {
|
|
|
2948
2949
|
const { offsetX: e, offsetY: i, clientX: s, clientY: r } = t;
|
|
2949
2950
|
if (!(s == this.clientX && r == this.clientY)) {
|
|
2950
2951
|
if (this.isOnScrollbar(e, i))
|
|
2951
|
-
this.clientX = s, this.clientY = r, this.isDragging = !0, this.ctx.scrollerMove = !0, this.isFocus = !0, this.dragStart = this.scroll;
|
|
2952
|
+
this.clientX = s, this.clientY = r, this.isDragging = !0, this.ctx.scrollerMove = !0, this.isFocus = !0, this.dragStart = this.scroll, t.preventDefault();
|
|
2952
2953
|
else if (this.isOnTrack(e, i)) {
|
|
2953
2954
|
let o = 0;
|
|
2954
2955
|
this.type === "vertical" ? o = (i - this.ctx.header.height - this.barHeight / 2) / (this.visibleDistance - this.barHeight) * this.distance : o = (e - this.barWidth / 2) / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(o, this.distance));
|
|
@@ -2990,19 +2991,19 @@ class Pt {
|
|
|
2990
2991
|
stageHeight: i,
|
|
2991
2992
|
stageWidth: s,
|
|
2992
2993
|
config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0 }
|
|
2993
|
-
} = this.ctx, a = s,
|
|
2994
|
+
} = this.ctx, a = s, h = i, c = e.height, f = e.width, d = t.height, x = this.ctx.footer.height;
|
|
2994
2995
|
if (this.type === "vertical") {
|
|
2995
|
-
this.visibleDistance =
|
|
2996
|
+
this.visibleDistance = h - 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 = h, this.barX = this.trackX - 0.5 + (r - o) / 2, this.barWidth = o;
|
|
2996
2997
|
const u = this.distance ? this.visibleDistance / d : 0;
|
|
2997
2998
|
let g = Math.floor(u * this.visibleDistance);
|
|
2998
2999
|
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
3000
|
} else {
|
|
3000
3001
|
this.visibleDistance = a - r, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
3001
3002
|
a - r,
|
|
3002
|
-
|
|
3003
|
+
h - r,
|
|
3003
3004
|
a - r,
|
|
3004
|
-
|
|
3005
|
-
], this.trackX = 0, this.trackY =
|
|
3005
|
+
h
|
|
3006
|
+
], this.trackX = 0, this.trackY = h - r, this.trackWidth = a, this.trackHeight = r;
|
|
3006
3007
|
const u = this.distance ? this.visibleDistance / f : 0;
|
|
3007
3008
|
let g = Math.floor(u * this.visibleDistance);
|
|
3008
3009
|
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 +3027,9 @@ class Pt {
|
|
|
3026
3027
|
}
|
|
3027
3028
|
class ci {
|
|
3028
3029
|
constructor(t) {
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3030
|
+
l(this, "ctx");
|
|
3031
|
+
l(this, "verticalScrollbar");
|
|
3032
|
+
l(this, "horizontalScrollbar");
|
|
3032
3033
|
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
3034
|
this.setScroll(e, i);
|
|
3034
3035
|
}), this.ctx.on("setScrollX", (e) => {
|
|
@@ -3082,41 +3083,41 @@ class ci {
|
|
|
3082
3083
|
}
|
|
3083
3084
|
class di {
|
|
3084
3085
|
constructor(t) {
|
|
3085
|
-
|
|
3086
|
+
l(this, "ctx");
|
|
3086
3087
|
// 上下文
|
|
3087
|
-
|
|
3088
|
+
l(this, "x", 0);
|
|
3088
3089
|
// x坐标
|
|
3089
|
-
|
|
3090
|
+
l(this, "y", 0);
|
|
3090
3091
|
// y坐标
|
|
3091
|
-
|
|
3092
|
+
l(this, "width", 0);
|
|
3092
3093
|
// 宽度
|
|
3093
|
-
|
|
3094
|
+
l(this, "height", 0);
|
|
3094
3095
|
// 高度
|
|
3095
|
-
|
|
3096
|
+
l(this, "resizeTarget", null);
|
|
3096
3097
|
//调整表头
|
|
3097
|
-
|
|
3098
|
+
l(this, "resizeNum", 0);
|
|
3098
3099
|
// 调整列的数量
|
|
3099
|
-
|
|
3100
|
+
l(this, "isResizing", !1);
|
|
3100
3101
|
// 是否移动中
|
|
3101
|
-
|
|
3102
|
+
l(this, "clientX", 0);
|
|
3102
3103
|
// 鼠标按下时的x轴位置
|
|
3103
|
-
|
|
3104
|
+
l(this, "resizeDiff", 0);
|
|
3104
3105
|
// 是否移动中
|
|
3105
|
-
|
|
3106
|
-
|
|
3106
|
+
l(this, "columnIndex", 0);
|
|
3107
|
+
l(this, "isMouseDown", !1);
|
|
3107
3108
|
// 是否按下
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3109
|
+
l(this, "columns");
|
|
3110
|
+
l(this, "visibleLeafColumns", []);
|
|
3111
|
+
l(this, "visibleHeight", 0);
|
|
3112
|
+
l(this, "visibleWidth", 0);
|
|
3113
|
+
l(this, "allCellHeaders", []);
|
|
3114
|
+
l(this, "leafCellHeaders", []);
|
|
3115
|
+
l(this, "renderLeafCellHeaders", []);
|
|
3116
|
+
l(this, "fixedLeftCellHeaders", []);
|
|
3117
|
+
l(this, "centerCellHeaders", []);
|
|
3118
|
+
l(this, "fixedRightCellHeaders", []);
|
|
3119
|
+
l(this, "renderCenterCellHeaders", []);
|
|
3120
|
+
l(this, "renderFixedCellHeaders", []);
|
|
3120
3121
|
this.ctx = t, this.ctx.on(
|
|
3121
3122
|
"resetHeader",
|
|
3122
3123
|
Zt(() => {
|
|
@@ -3135,9 +3136,9 @@ class di {
|
|
|
3135
3136
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3136
3137
|
const a = this.ctx.containerElement.getBoundingClientRect();
|
|
3137
3138
|
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(
|
|
3139
|
+
const h = this.visibleWidth - this.width;
|
|
3140
|
+
if (this.resizeNum && h > 0) {
|
|
3141
|
+
const d = Math.floor(h / this.resizeNum * 100) / 100;
|
|
3141
3142
|
this.resizeAllColumn(d);
|
|
3142
3143
|
}
|
|
3143
3144
|
const c = this.fixedLeftCellHeaders.filter((d) => !d.hasChildren);
|
|
@@ -3170,9 +3171,9 @@ class di {
|
|
|
3170
3171
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3171
3172
|
const r = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
3172
3173
|
for (const o of r) {
|
|
3173
|
-
const { offsetX: a, offsetY:
|
|
3174
|
+
const { offsetX: a, offsetY: h } = this.ctx.getOffset(e), c = a, f = o.getDrawX();
|
|
3174
3175
|
c > f + o.width - 5 && c < f + o.width + 4 && c < i - 4 && // 视窗中最后一列不允许调整宽
|
|
3175
|
-
o.colspan <= 1 && this.ctx.isTarget() &&
|
|
3176
|
+
o.colspan <= 1 && this.ctx.isTarget() && h <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = o);
|
|
3176
3177
|
}
|
|
3177
3178
|
}
|
|
3178
3179
|
}));
|
|
@@ -3226,10 +3227,10 @@ class di {
|
|
|
3226
3227
|
let s = e;
|
|
3227
3228
|
const { HEADER_HEIGHT: r = 0 } = this.ctx.config;
|
|
3228
3229
|
for (let o = 0; o < i; o++) {
|
|
3229
|
-
const a = t[o],
|
|
3230
|
+
const a = t[o], h = r * (a.rowspan || 0), c = r * (a.level || 0);
|
|
3230
3231
|
let f = a.width || 100;
|
|
3231
3232
|
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,
|
|
3233
|
+
const d = new ie(this.ctx, this.columnIndex, s, c, f, h, a);
|
|
3233
3234
|
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
3235
|
}
|
|
3235
3236
|
}
|
|
@@ -3261,8 +3262,8 @@ class di {
|
|
|
3261
3262
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3262
3263
|
colorEnd: "rgba(0,0,0,0)"
|
|
3263
3264
|
}), i < Math.floor(s.width - r - 1) && e !== a) {
|
|
3264
|
-
const
|
|
3265
|
-
this.ctx.paint.drawShadow(
|
|
3265
|
+
const h = s.width - (this.x + this.width) + r - e;
|
|
3266
|
+
this.ctx.paint.drawShadow(h + 1, this.y, e, this.height, {
|
|
3266
3267
|
fillColor: o,
|
|
3267
3268
|
side: "left",
|
|
3268
3269
|
shadowWidth: 4,
|
|
@@ -3290,20 +3291,20 @@ class di {
|
|
|
3290
3291
|
}
|
|
3291
3292
|
}
|
|
3292
3293
|
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 =
|
|
3294
|
+
constructor(t, e, i = 0, s = 0, r = 0, o = 0, a, h = "body") {
|
|
3295
|
+
l(this, "ctx");
|
|
3296
|
+
l(this, "x", 0);
|
|
3297
|
+
l(this, "y", 0);
|
|
3298
|
+
l(this, "width", 0);
|
|
3299
|
+
l(this, "height");
|
|
3300
|
+
l(this, "cells", []);
|
|
3301
|
+
l(this, "fixedCells", []);
|
|
3302
|
+
l(this, "noFixedCells", []);
|
|
3303
|
+
l(this, "rowIndex", 0);
|
|
3304
|
+
l(this, "rowKey", "");
|
|
3305
|
+
l(this, "rowType", "body");
|
|
3306
|
+
l(this, "data");
|
|
3307
|
+
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 = h, this.data = a, this.update();
|
|
3307
3308
|
}
|
|
3308
3309
|
update() {
|
|
3309
3310
|
const { header: t } = this.ctx, e = [], i = [], s = [];
|
|
@@ -3343,28 +3344,28 @@ class se {
|
|
|
3343
3344
|
}
|
|
3344
3345
|
class fi {
|
|
3345
3346
|
constructor(t) {
|
|
3346
|
-
|
|
3347
|
+
l(this, "resizeTarget", null);
|
|
3347
3348
|
//调整行大小的目标
|
|
3348
|
-
|
|
3349
|
+
l(this, "isMouseDown", !1);
|
|
3349
3350
|
// 是否按下
|
|
3350
|
-
|
|
3351
|
+
l(this, "resizeDiff", 0);
|
|
3351
3352
|
// 是否移动中
|
|
3352
|
-
|
|
3353
|
+
l(this, "clientY", 0);
|
|
3353
3354
|
// 鼠标按下时的y轴位置
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3355
|
+
l(this, "ctx");
|
|
3356
|
+
l(this, "x", 0);
|
|
3357
|
+
l(this, "y", 0);
|
|
3358
|
+
l(this, "width", 0);
|
|
3359
|
+
l(this, "height", 0);
|
|
3360
|
+
l(this, "headIndex", 0);
|
|
3361
|
+
l(this, "tailIndex", 0);
|
|
3362
|
+
l(this, "isResizing", !1);
|
|
3362
3363
|
//是否正在调整大小
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3364
|
+
l(this, "renderRows", []);
|
|
3365
|
+
l(this, "visibleRows", []);
|
|
3366
|
+
l(this, "visibleHeight", 0);
|
|
3367
|
+
l(this, "visibleWidth", 0);
|
|
3368
|
+
l(this, "data", []);
|
|
3368
3369
|
this.ctx = t, this.init(), this.initResizeRow();
|
|
3369
3370
|
}
|
|
3370
3371
|
init() {
|
|
@@ -3377,7 +3378,7 @@ class fi {
|
|
|
3377
3378
|
SCROLLER_TRACK_SIZE: r = 0,
|
|
3378
3379
|
HEIGHT: o,
|
|
3379
3380
|
EMPTY_BODY_HEIGHT: a = 0,
|
|
3380
|
-
MAX_HEIGHT:
|
|
3381
|
+
MAX_HEIGHT: h = 0,
|
|
3381
3382
|
ENABLE_OFFSET_HEIGHT: c = 0,
|
|
3382
3383
|
OFFSET_HEIGHT: f = 0
|
|
3383
3384
|
}
|
|
@@ -3406,7 +3407,7 @@ class fi {
|
|
|
3406
3407
|
let y = 0;
|
|
3407
3408
|
this.data.length && c ? (y = window.innerHeight - u - f, y < 0 && (y = 32, console.error(
|
|
3408
3409
|
"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 &&
|
|
3410
|
+
))) : this.data.length && o ? y = o : this.data.length && h && p > h ? y = h : y = p, y > 0 && (this.ctx.stageHeight = Math.floor(y), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
|
|
3410
3411
|
let b = this.ctx.stageHeight - e.height - r;
|
|
3411
3412
|
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
3413
|
const m = window.devicePixelRatio || 1, E = this.ctx.stageWidth * m, C = this.ctx.stageHeight * m;
|
|
@@ -3429,7 +3430,7 @@ class fi {
|
|
|
3429
3430
|
}), this.ctx.on("mousemove", (e) => {
|
|
3430
3431
|
if (this.ctx.editing) return;
|
|
3431
3432
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s, a = e.clientY, {
|
|
3432
|
-
stageHeight:
|
|
3433
|
+
stageHeight: h,
|
|
3433
3434
|
scrollY: c,
|
|
3434
3435
|
config: { RESIZE_ROW_MIN_HEIGHT: f = 0 }
|
|
3435
3436
|
} = this.ctx;
|
|
@@ -3443,7 +3444,7 @@ class fi {
|
|
|
3443
3444
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3444
3445
|
for (let d = 0; d < this.renderRows.length; d++) {
|
|
3445
3446
|
const x = this.renderRows[d];
|
|
3446
|
-
if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r <
|
|
3447
|
+
if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r < h - 4)
|
|
3447
3448
|
for (let g = 0; g < x.cells.length; g++) {
|
|
3448
3449
|
const w = x.cells[g];
|
|
3449
3450
|
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 +3493,8 @@ class fi {
|
|
|
3492
3493
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3493
3494
|
colorEnd: "rgba(0,0,0,0)"
|
|
3494
3495
|
}), i < Math.floor(s.width - r - 1) && e !== a) {
|
|
3495
|
-
const
|
|
3496
|
-
this.ctx.paint.drawShadow(
|
|
3496
|
+
const h = s.width - (this.x + this.width) + r - e;
|
|
3497
|
+
this.ctx.paint.drawShadow(h + 1, this.y, e, this.height, {
|
|
3497
3498
|
fillColor: o,
|
|
3498
3499
|
side: "left",
|
|
3499
3500
|
shadowWidth: 4,
|
|
@@ -3517,8 +3518,8 @@ class fi {
|
|
|
3517
3518
|
const { header: t, database: e, scrollY: i } = this.ctx, s = i, { data: r, positions: o } = e.getData();
|
|
3518
3519
|
this.ctx.maxRowIndex = r.length - 1;
|
|
3519
3520
|
const a = this.binarySearch(o, s);
|
|
3520
|
-
let
|
|
3521
|
-
|
|
3521
|
+
let h = this.binarySearch(o, s + this.visibleHeight);
|
|
3522
|
+
h === -1 && (h = r.length), this.headIndex = Math.max(0, a), this.tailIndex = Math.min(this.ctx.maxRowIndex, h + 1), this.visibleRows = r.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
|
|
3522
3523
|
const c = [];
|
|
3523
3524
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
3524
3525
|
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 +3537,15 @@ class fi {
|
|
|
3536
3537
|
}
|
|
3537
3538
|
class xi {
|
|
3538
3539
|
constructor(t) {
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3540
|
+
l(this, "ctx");
|
|
3541
|
+
l(this, "renderRows", []);
|
|
3542
|
+
l(this, "data", []);
|
|
3543
|
+
l(this, "x", 0);
|
|
3544
|
+
l(this, "y", 0);
|
|
3545
|
+
l(this, "width", 0);
|
|
3546
|
+
l(this, "height", 0);
|
|
3547
|
+
l(this, "visibleWidth", 0);
|
|
3548
|
+
l(this, "visibleHeight", 0);
|
|
3548
3549
|
this.ctx = t, this.init();
|
|
3549
3550
|
}
|
|
3550
3551
|
init() {
|
|
@@ -3565,8 +3566,8 @@ class xi {
|
|
|
3565
3566
|
stageWidth: r,
|
|
3566
3567
|
config: { HEADER_BG_COLOR: o, SCROLLER_TRACK_SIZE: a }
|
|
3567
3568
|
} = this.ctx;
|
|
3568
|
-
let
|
|
3569
|
-
if (this.ctx.config.FOOTER_FIXED || (
|
|
3569
|
+
let h = this.y;
|
|
3570
|
+
if (this.ctx.config.FOOTER_FIXED || (h = this.y - this.ctx.scrollY), i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, h, t, this.height, {
|
|
3570
3571
|
fillColor: o,
|
|
3571
3572
|
side: "right",
|
|
3572
3573
|
shadowWidth: 4,
|
|
@@ -3574,7 +3575,7 @@ class xi {
|
|
|
3574
3575
|
colorEnd: "rgba(0,0,0,0)"
|
|
3575
3576
|
}), i < Math.floor(s.width - r - 1) && e !== a) {
|
|
3576
3577
|
const c = s.width - (this.x + this.width) + r - e;
|
|
3577
|
-
this.ctx.paint.drawShadow(c + 1,
|
|
3578
|
+
this.ctx.paint.drawShadow(c + 1, h, e, this.height, {
|
|
3578
3579
|
fillColor: o,
|
|
3579
3580
|
side: "left",
|
|
3580
3581
|
shadowWidth: 4,
|
|
@@ -3613,15 +3614,15 @@ class xi {
|
|
|
3613
3614
|
class ui {
|
|
3614
3615
|
// 垂直滚动定时器
|
|
3615
3616
|
constructor(t) {
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3617
|
+
l(this, "isCut", !1);
|
|
3618
|
+
l(this, "isMultipleRow", !1);
|
|
3619
|
+
l(this, "mousedownHeader", !1);
|
|
3620
|
+
l(this, "ctx");
|
|
3621
|
+
l(this, "adjustPositionX", "");
|
|
3622
|
+
l(this, "adjustPositionY", "");
|
|
3623
|
+
l(this, "timerX", 0);
|
|
3623
3624
|
// 水平滚动定时器
|
|
3624
|
-
|
|
3625
|
+
l(this, "timerY", 0);
|
|
3625
3626
|
this.ctx = t, this.init();
|
|
3626
3627
|
}
|
|
3627
3628
|
init() {
|
|
@@ -3645,7 +3646,7 @@ class ui {
|
|
|
3645
3646
|
this.isMultipleRow = !0, this.selectRows(t);
|
|
3646
3647
|
return;
|
|
3647
3648
|
}
|
|
3648
|
-
this.isMultipleRow = !1, this.click(e.shiftKey);
|
|
3649
|
+
e.preventDefault(), this.isMultipleRow = !1, this.click(e.shiftKey);
|
|
3649
3650
|
}
|
|
3650
3651
|
}), this.ctx.on("mouseup", () => {
|
|
3651
3652
|
this.mousedownHeader = !1;
|
|
@@ -3654,8 +3655,8 @@ class ui {
|
|
|
3654
3655
|
}, 0);
|
|
3655
3656
|
}), this.ctx.on("cellHeaderHoverChange", (t) => {
|
|
3656
3657
|
this.ctx.mousedown && this.selectCols(t);
|
|
3657
|
-
}), this.ctx.on("cellHeaderMousedown", (t) => {
|
|
3658
|
-
this.ctx.stageElement.style.cursor !== "pointer" && (this.ctx.isPointer || (this.mousedownHeader = !0, this.selectCols(t)));
|
|
3658
|
+
}), this.ctx.on("cellHeaderMousedown", (t, e) => {
|
|
3659
|
+
this.ctx.stageElement.style.cursor !== "pointer" && (this.ctx.isPointer || (e.preventDefault(), this.mousedownHeader = !0, this.selectCols(t)));
|
|
3659
3660
|
}), this.ctx.on("keydown", (t) => {
|
|
3660
3661
|
if (t.ctrlKey && t.code === "KeyV" || t.metaKey && t.code === "KeyV") {
|
|
3661
3662
|
t.preventDefault(), this.paste();
|
|
@@ -3721,12 +3722,12 @@ class ui {
|
|
|
3721
3722
|
this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0;
|
|
3722
3723
|
const {
|
|
3723
3724
|
SELECTOR_AREA_MIN_X: a,
|
|
3724
|
-
SELECTOR_AREA_MAX_X:
|
|
3725
|
+
SELECTOR_AREA_MAX_X: h,
|
|
3725
3726
|
SELECTOR_AREA_MIN_Y: c,
|
|
3726
3727
|
SELECTOR_AREA_MAX_Y: f,
|
|
3727
3728
|
SELECTOR_AREA_MAX_X_OFFSET: d,
|
|
3728
3729
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
3729
|
-
} = this.ctx.config, u = a, g =
|
|
3730
|
+
} = this.ctx.config, u = a, g = h || this.ctx.maxColIndex - d, w = c, p = f || this.ctx.maxRowIndex - x;
|
|
3730
3731
|
let [y, b] = r, [m, E] = o;
|
|
3731
3732
|
if (y < u || b > g || m < w || E > p)
|
|
3732
3733
|
return;
|
|
@@ -3744,15 +3745,15 @@ class ui {
|
|
|
3744
3745
|
if (this.ctx.mousedown && this.ctx.focusCellHeader) {
|
|
3745
3746
|
const { colIndex: a } = this.ctx.focusCellHeader;
|
|
3746
3747
|
if (this.ctx.clearSelector(), t.colIndex >= a) {
|
|
3747
|
-
const
|
|
3748
|
-
this.setSelector(
|
|
3748
|
+
const h = [a, t.colIndex + t.colspan - 1], c = [r, o];
|
|
3749
|
+
this.setSelector(h, c);
|
|
3749
3750
|
} else {
|
|
3750
|
-
const
|
|
3751
|
-
this.setSelector(
|
|
3751
|
+
const h = [t.colIndex, a], c = [r, o];
|
|
3752
|
+
this.setSelector(h, c);
|
|
3752
3753
|
}
|
|
3753
3754
|
} else {
|
|
3754
|
-
const a = [t.colIndex, t.colIndex + t.colspan - 1],
|
|
3755
|
-
this.setSelector(a,
|
|
3755
|
+
const a = [t.colIndex, t.colIndex + t.colspan - 1], h = [r, o];
|
|
3756
|
+
this.setSelector(a, h);
|
|
3756
3757
|
}
|
|
3757
3758
|
}
|
|
3758
3759
|
selectAll() {
|
|
@@ -3766,8 +3767,8 @@ class ui {
|
|
|
3766
3767
|
SELECTOR_AREA_MIN_Y: r,
|
|
3767
3768
|
SELECTOR_AREA_MAX_Y: o,
|
|
3768
3769
|
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 -
|
|
3770
|
+
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
3771
|
+
} = this.ctx.config, c = i, f = s || this.ctx.maxColIndex - a, d = r, x = o || this.ctx.maxRowIndex - h, u = [c, f], g = [d, x];
|
|
3771
3772
|
this.setSelector(u, g);
|
|
3772
3773
|
}
|
|
3773
3774
|
}
|
|
@@ -3777,16 +3778,16 @@ class ui {
|
|
|
3777
3778
|
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
3779
|
if (e) {
|
|
3779
3780
|
this.ctx.setFocusCell(t);
|
|
3780
|
-
const
|
|
3781
|
-
this.setSelector(
|
|
3781
|
+
const h = [a, o], c = [t.rowIndex, t.rowIndex];
|
|
3782
|
+
this.setSelector(h, c);
|
|
3782
3783
|
}
|
|
3783
3784
|
if (this.ctx.focusCell && this.ctx.mousedown) {
|
|
3784
|
-
const { rowIndex:
|
|
3785
|
-
if (t.rowIndex >=
|
|
3786
|
-
const c = [a, o], f = [
|
|
3785
|
+
const { rowIndex: h } = this.ctx.focusCell;
|
|
3786
|
+
if (t.rowIndex >= h) {
|
|
3787
|
+
const c = [a, o], f = [h, t.rowIndex];
|
|
3787
3788
|
this.setSelector(c, f);
|
|
3788
3789
|
} else {
|
|
3789
|
-
const c = [a, o], f = [t.rowIndex,
|
|
3790
|
+
const c = [a, o], f = [t.rowIndex, h];
|
|
3790
3791
|
this.setSelector(c, f);
|
|
3791
3792
|
}
|
|
3792
3793
|
}
|
|
@@ -3796,7 +3797,7 @@ class ui {
|
|
|
3796
3797
|
return;
|
|
3797
3798
|
const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
|
|
3798
3799
|
if (t && e && i) {
|
|
3799
|
-
const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), a = Math.max(i.colIndex, r),
|
|
3800
|
+
const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), a = Math.max(i.colIndex, r), h = Math.min(i.rowIndex, s), c = Math.max(i.rowIndex, s), f = [o, a], d = [h, c];
|
|
3800
3801
|
this.setSelector(f, d);
|
|
3801
3802
|
}
|
|
3802
3803
|
}
|
|
@@ -3804,7 +3805,7 @@ class ui {
|
|
|
3804
3805
|
const { focusCell: e, clickCell: i } = this.ctx;
|
|
3805
3806
|
if (e && this.isInSettingRange(e.rowIndex, e.colIndex))
|
|
3806
3807
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
3807
|
-
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: a } = e,
|
|
3808
|
+
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: a } = e, h = Math.min(o, s), c = Math.max(o, s), f = Math.min(a, r), d = Math.max(a, r), x = [h, c], u = [f, d];
|
|
3808
3809
|
this.setSelector(x, u);
|
|
3809
3810
|
} else {
|
|
3810
3811
|
this.ctx.emit("cellSelectedClick", e);
|
|
@@ -3845,8 +3846,8 @@ class ui {
|
|
|
3845
3846
|
let s = [];
|
|
3846
3847
|
const r = /* @__PURE__ */ new Set();
|
|
3847
3848
|
for (let a = 0; a <= e[1] - e[0]; a++)
|
|
3848
|
-
for (let
|
|
3849
|
-
const c = a + e[0], f =
|
|
3849
|
+
for (let h = 0; h <= t[1] - t[0]; h++) {
|
|
3850
|
+
const c = a + e[0], f = h + t[0], d = this.ctx.database.getItemValueForRowIndexAndColIndex(c, f);
|
|
3850
3851
|
if (d) {
|
|
3851
3852
|
const { rowKey: x, key: u } = d;
|
|
3852
3853
|
this.ctx.database.getReadonly(x, u) || (r.add(x), s.push({
|
|
@@ -3910,9 +3911,9 @@ class ui {
|
|
|
3910
3911
|
}
|
|
3911
3912
|
if (!a.length)
|
|
3912
3913
|
return;
|
|
3913
|
-
const { BEFORE_PASTE_CHANGE_METHOD:
|
|
3914
|
-
if (typeof
|
|
3915
|
-
const f =
|
|
3914
|
+
const { BEFORE_PASTE_CHANGE_METHOD: h } = this.ctx.config;
|
|
3915
|
+
if (typeof h == "function") {
|
|
3916
|
+
const f = h, d = a.map((x) => ({
|
|
3916
3917
|
rowKey: x.rowKey,
|
|
3917
3918
|
key: x.key,
|
|
3918
3919
|
value: x.value,
|
|
@@ -3941,7 +3942,7 @@ class ui {
|
|
|
3941
3942
|
if (!e)
|
|
3942
3943
|
return;
|
|
3943
3944
|
let { colIndex: i = 0, rowIndex: s = 0 } = e;
|
|
3944
|
-
const r = 0, o = 0, a = this.ctx.maxColIndex,
|
|
3945
|
+
const r = 0, o = 0, a = this.ctx.maxColIndex, h = this.ctx.maxRowIndex;
|
|
3945
3946
|
switch (t) {
|
|
3946
3947
|
case "LEFT":
|
|
3947
3948
|
i > r && i--;
|
|
@@ -3953,7 +3954,7 @@ class ui {
|
|
|
3953
3954
|
i < a && i++;
|
|
3954
3955
|
break;
|
|
3955
3956
|
case "BOTTOM":
|
|
3956
|
-
s <
|
|
3957
|
+
s < h && s++;
|
|
3957
3958
|
break;
|
|
3958
3959
|
}
|
|
3959
3960
|
const c = [i, i], f = [s, s], d = this.getCell(s, i);
|
|
@@ -3970,8 +3971,8 @@ class ui {
|
|
|
3970
3971
|
SELECTOR_AREA_MIN_Y: r,
|
|
3971
3972
|
SELECTOR_AREA_MAX_Y: o,
|
|
3972
3973
|
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 -
|
|
3974
|
+
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
3975
|
+
} = this.ctx.config, c = i, f = s || this.ctx.maxColIndex - a, d = r, x = o || this.ctx.maxRowIndex - h;
|
|
3975
3976
|
return !(e < c || e > f || t < d || t > x);
|
|
3976
3977
|
}
|
|
3977
3978
|
/**
|
|
@@ -3985,7 +3986,7 @@ class ui {
|
|
|
3985
3986
|
let a = 10 * (s === "left" ? -1 : 1);
|
|
3986
3987
|
this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
|
|
3987
3988
|
a *= 1.5;
|
|
3988
|
-
const { scrollX:
|
|
3989
|
+
const { scrollX: h } = this.ctx, c = h + a;
|
|
3989
3990
|
(c < 0 || c > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(c);
|
|
3990
3991
|
}, 100);
|
|
3991
3992
|
}
|
|
@@ -3994,7 +3995,7 @@ class ui {
|
|
|
3994
3995
|
let a = 10 * (r === "top" ? -1 : 1);
|
|
3995
3996
|
this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
|
|
3996
3997
|
a *= 1.5;
|
|
3997
|
-
const { scrollY:
|
|
3998
|
+
const { scrollY: h } = this.ctx, c = h + a;
|
|
3998
3999
|
(c < 0 || c > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(c);
|
|
3999
4000
|
}, 100);
|
|
4000
4001
|
}
|
|
@@ -4011,7 +4012,7 @@ class ui {
|
|
|
4011
4012
|
fixedLeftWidth: r,
|
|
4012
4013
|
header: o,
|
|
4013
4014
|
footer: a,
|
|
4014
|
-
body:
|
|
4015
|
+
body: h,
|
|
4015
4016
|
scrollX: c,
|
|
4016
4017
|
scrollY: f,
|
|
4017
4018
|
config: { SCROLLER_TRACK_SIZE: d, FOOTER_FIXED: x }
|
|
@@ -4020,7 +4021,7 @@ class ui {
|
|
|
4020
4021
|
return;
|
|
4021
4022
|
const u = r - i.drawX + 1, g = i.drawX + i.width - (e - s) + 1, w = o.height - i.drawY;
|
|
4022
4023
|
let p = i.height;
|
|
4023
|
-
p >
|
|
4024
|
+
p > h.visibleHeight && (p = h.visibleHeight);
|
|
4024
4025
|
let y = 0;
|
|
4025
4026
|
x && (y = a.visibleHeight);
|
|
4026
4027
|
const b = i.drawY + p - (t - y - d);
|
|
@@ -4033,14 +4034,14 @@ class ui {
|
|
|
4033
4034
|
}
|
|
4034
4035
|
class gi {
|
|
4035
4036
|
constructor(t) {
|
|
4036
|
-
|
|
4037
|
+
l(this, "ctx");
|
|
4037
4038
|
this.ctx = t, this.init();
|
|
4038
4039
|
}
|
|
4039
4040
|
init() {
|
|
4040
4041
|
this.ctx.on("cellMouseenter", (t, e) => {
|
|
4041
4042
|
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 ===
|
|
4043
|
+
const { offsetX: i, offsetY: s } = this.ctx.getOffset(e), { xArr: r, yArr: o } = this.ctx.selector, a = r[1], h = o[1], { colIndex: c, rowIndex: f, drawX: d, drawY: x, width: u, height: g } = t;
|
|
4044
|
+
if (this.ctx.config.ENABLE_AUTOFILL && c === a && f === h) {
|
|
4044
4045
|
const p = d + u - 6, y = x + g - 6;
|
|
4045
4046
|
i > p && s > y && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4046
4047
|
}
|
|
@@ -4073,22 +4074,22 @@ class gi {
|
|
|
4073
4074
|
return;
|
|
4074
4075
|
let o = t, a = e;
|
|
4075
4076
|
if (!r) {
|
|
4076
|
-
const [
|
|
4077
|
-
a = [
|
|
4077
|
+
const [h] = a;
|
|
4078
|
+
a = [h, h];
|
|
4078
4079
|
}
|
|
4079
4080
|
if (!s) {
|
|
4080
|
-
const [
|
|
4081
|
-
o = [
|
|
4081
|
+
const [h] = o;
|
|
4082
|
+
o = [h, h];
|
|
4082
4083
|
}
|
|
4083
4084
|
if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(o) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(a)) {
|
|
4084
4085
|
const {
|
|
4085
|
-
SELECTOR_AREA_MIN_X:
|
|
4086
|
+
SELECTOR_AREA_MIN_X: h,
|
|
4086
4087
|
SELECTOR_AREA_MAX_X: c,
|
|
4087
4088
|
SELECTOR_AREA_MIN_Y: f,
|
|
4088
4089
|
SELECTOR_AREA_MAX_Y: d,
|
|
4089
4090
|
SELECTOR_AREA_MAX_X_OFFSET: x,
|
|
4090
4091
|
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
4091
|
-
} = this.ctx.config, g =
|
|
4092
|
+
} = this.ctx.config, g = h, w = c || this.ctx.maxColIndex - x, p = f, y = d || this.ctx.maxRowIndex - u;
|
|
4092
4093
|
let [b, m] = o, [E, C] = a;
|
|
4093
4094
|
if (b < g || E < p)
|
|
4094
4095
|
return;
|
|
@@ -4105,11 +4106,11 @@ class gi {
|
|
|
4105
4106
|
const g = x + e.yArr[0], w = u + e.xArr[0];
|
|
4106
4107
|
i.set(`${g}-${w}`, !0);
|
|
4107
4108
|
}
|
|
4108
|
-
const { value: s } = e, r = s[0].length, o = s.length, a = this.ctx.autofill.xArr,
|
|
4109
|
+
const { value: s } = e, r = s[0].length, o = s.length, a = this.ctx.autofill.xArr, h = this.ctx.autofill.yArr;
|
|
4109
4110
|
let c = [];
|
|
4110
|
-
for (let x = 0; x <=
|
|
4111
|
+
for (let x = 0; x <= h[1] - h[0]; x++)
|
|
4111
4112
|
for (let u = 0; u <= a[1] - a[0]; u++) {
|
|
4112
|
-
const g = u + a[0], w = x +
|
|
4113
|
+
const g = u + a[0], w = x + h[0], p = s[x % o][u % r], y = this.ctx.database.getItemValueForRowIndexAndColIndex(w, g), b = `${w}-${g}`;
|
|
4113
4114
|
if (y && !i.has(b)) {
|
|
4114
4115
|
const { rowKey: m, key: E } = y;
|
|
4115
4116
|
this.ctx.database.getReadonly(m, E) || (t.add(m), c.push({
|
|
@@ -4172,7 +4173,7 @@ function at(n, t) {
|
|
|
4172
4173
|
function q(n) {
|
|
4173
4174
|
return n.split("-")[0];
|
|
4174
4175
|
}
|
|
4175
|
-
function
|
|
4176
|
+
function lt(n) {
|
|
4176
4177
|
return n.split("-")[1];
|
|
4177
4178
|
}
|
|
4178
4179
|
function re(n) {
|
|
@@ -4189,7 +4190,7 @@ function Mt(n) {
|
|
|
4189
4190
|
}
|
|
4190
4191
|
function yi(n, t, e) {
|
|
4191
4192
|
e === void 0 && (e = !1);
|
|
4192
|
-
const i =
|
|
4193
|
+
const i = lt(n), s = Mt(n), r = Lt(s);
|
|
4193
4194
|
let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4194
4195
|
return t.reference[r] > t.floating[r] && (o = xt(o)), [o, xt(o)];
|
|
4195
4196
|
}
|
|
@@ -4214,7 +4215,7 @@ function Ei(n, t, e) {
|
|
|
4214
4215
|
}
|
|
4215
4216
|
}
|
|
4216
4217
|
function bi(n, t, e, i) {
|
|
4217
|
-
const s =
|
|
4218
|
+
const s = lt(n);
|
|
4218
4219
|
let r = Ei(q(n), e === "start", i);
|
|
4219
4220
|
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
|
|
4220
4221
|
}
|
|
@@ -4261,9 +4262,9 @@ function Vt(n, t, e) {
|
|
|
4261
4262
|
reference: i,
|
|
4262
4263
|
floating: s
|
|
4263
4264
|
} = n;
|
|
4264
|
-
const r = J(t), o = Mt(t), a = Lt(o),
|
|
4265
|
+
const r = J(t), o = Mt(t), a = Lt(o), h = 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
4266
|
let u;
|
|
4266
|
-
switch (
|
|
4267
|
+
switch (h) {
|
|
4267
4268
|
case "top":
|
|
4268
4269
|
u = {
|
|
4269
4270
|
x: f,
|
|
@@ -4294,7 +4295,7 @@ function Vt(n, t, e) {
|
|
|
4294
4295
|
y: i.y
|
|
4295
4296
|
};
|
|
4296
4297
|
}
|
|
4297
|
-
switch (
|
|
4298
|
+
switch (lt(t)) {
|
|
4298
4299
|
case "start":
|
|
4299
4300
|
u[o] -= x * (e && c ? -1 : 1);
|
|
4300
4301
|
break;
|
|
@@ -4310,7 +4311,7 @@ const vi = async (n, t, e) => {
|
|
|
4310
4311
|
strategy: s = "absolute",
|
|
4311
4312
|
middleware: r = [],
|
|
4312
4313
|
platform: o
|
|
4313
|
-
} = e, a = r.filter(Boolean),
|
|
4314
|
+
} = e, a = r.filter(Boolean), h = await (o.isRTL == null ? void 0 : o.isRTL(t));
|
|
4314
4315
|
let c = await o.getElementRects({
|
|
4315
4316
|
reference: n,
|
|
4316
4317
|
floating: t,
|
|
@@ -4318,7 +4319,7 @@ const vi = async (n, t, e) => {
|
|
|
4318
4319
|
}), {
|
|
4319
4320
|
x: f,
|
|
4320
4321
|
y: d
|
|
4321
|
-
} = Vt(c, i,
|
|
4322
|
+
} = Vt(c, i, h), x = i, u = {}, g = 0;
|
|
4322
4323
|
for (let w = 0; w < a.length; w++) {
|
|
4323
4324
|
const {
|
|
4324
4325
|
name: p,
|
|
@@ -4355,7 +4356,7 @@ const vi = async (n, t, e) => {
|
|
|
4355
4356
|
}) : C.rects), {
|
|
4356
4357
|
x: f,
|
|
4357
4358
|
y: d
|
|
4358
|
-
} = Vt(c, x,
|
|
4359
|
+
} = Vt(c, x, h)), w = -1);
|
|
4359
4360
|
}
|
|
4360
4361
|
return {
|
|
4361
4362
|
x: f,
|
|
@@ -4374,7 +4375,7 @@ async function ne(n, t) {
|
|
|
4374
4375
|
platform: r,
|
|
4375
4376
|
rects: o,
|
|
4376
4377
|
elements: a,
|
|
4377
|
-
strategy:
|
|
4378
|
+
strategy: h
|
|
4378
4379
|
} = n, {
|
|
4379
4380
|
boundary: c = "clippingAncestors",
|
|
4380
4381
|
rootBoundary: f = "viewport",
|
|
@@ -4385,7 +4386,7 @@ async function ne(n, t) {
|
|
|
4385
4386
|
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
4387
|
boundary: c,
|
|
4387
4388
|
rootBoundary: f,
|
|
4388
|
-
strategy:
|
|
4389
|
+
strategy: h
|
|
4389
4390
|
})), b = d === "floating" ? {
|
|
4390
4391
|
x: i,
|
|
4391
4392
|
y: s,
|
|
@@ -4401,7 +4402,7 @@ async function ne(n, t) {
|
|
|
4401
4402
|
elements: a,
|
|
4402
4403
|
rect: b,
|
|
4403
4404
|
offsetParent: m,
|
|
4404
|
-
strategy:
|
|
4405
|
+
strategy: h
|
|
4405
4406
|
}) : b);
|
|
4406
4407
|
return {
|
|
4407
4408
|
top: (y.top - C.top + g.top) / E.y,
|
|
@@ -4421,7 +4422,7 @@ const Ri = (n) => ({
|
|
|
4421
4422
|
rects: r,
|
|
4422
4423
|
platform: o,
|
|
4423
4424
|
elements: a,
|
|
4424
|
-
middlewareData:
|
|
4425
|
+
middlewareData: h
|
|
4425
4426
|
} = t, {
|
|
4426
4427
|
element: c,
|
|
4427
4428
|
padding: f = 0
|
|
@@ -4434,7 +4435,7 @@ const Ri = (n) => ({
|
|
|
4434
4435
|
}, 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
4436
|
let T = R ? R[m] : 0;
|
|
4436
4437
|
(!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 = !
|
|
4438
|
+
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 = !h.arrow && lt(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
4439
|
return {
|
|
4439
4440
|
[u]: x[u] + k,
|
|
4440
4441
|
data: {
|
|
@@ -4458,7 +4459,7 @@ const Ri = (n) => ({
|
|
|
4458
4459
|
middlewareData: r,
|
|
4459
4460
|
rects: o,
|
|
4460
4461
|
initialPlacement: a,
|
|
4461
|
-
platform:
|
|
4462
|
+
platform: h,
|
|
4462
4463
|
elements: c
|
|
4463
4464
|
} = t, {
|
|
4464
4465
|
mainAxis: f = !0,
|
|
@@ -4471,7 +4472,7 @@ const Ri = (n) => ({
|
|
|
4471
4472
|
} = at(n, t);
|
|
4472
4473
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
4473
4474
|
return {};
|
|
4474
|
-
const y = q(s), b = J(a), m = q(a) === a, E = await (
|
|
4475
|
+
const y = q(s), b = J(a), m = q(a) === a, E = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), C = x || (m || !w ? [xt(a)] : mi(a)), R = g !== "none";
|
|
4475
4476
|
!x && R && C.push(...bi(a, w, g, E));
|
|
4476
4477
|
const T = [a, ...C], A = await ne(t, p), L = [];
|
|
4477
4478
|
let D = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
@@ -4532,7 +4533,7 @@ async function Ii(n, t) {
|
|
|
4532
4533
|
placement: e,
|
|
4533
4534
|
platform: i,
|
|
4534
4535
|
elements: s
|
|
4535
|
-
} = n, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), a =
|
|
4536
|
+
} = n, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), a = lt(e), h = J(e) === "y", c = ["left", "top"].includes(o) ? -1 : 1, f = r && h ? -1 : 1, d = at(t, n);
|
|
4536
4537
|
let {
|
|
4537
4538
|
mainAxis: x,
|
|
4538
4539
|
crossAxis: u,
|
|
@@ -4546,7 +4547,7 @@ async function Ii(n, t) {
|
|
|
4546
4547
|
crossAxis: d.crossAxis || 0,
|
|
4547
4548
|
alignmentAxis: d.alignmentAxis
|
|
4548
4549
|
};
|
|
4549
|
-
return a && typeof g == "number" && (u = a === "end" ? g * -1 : g),
|
|
4550
|
+
return a && typeof g == "number" && (u = a === "end" ? g * -1 : g), h ? {
|
|
4550
4551
|
x: u * f,
|
|
4551
4552
|
y: x * c
|
|
4552
4553
|
} : {
|
|
@@ -4565,12 +4566,12 @@ const Oi = function(n) {
|
|
|
4565
4566
|
y: r,
|
|
4566
4567
|
placement: o,
|
|
4567
4568
|
middlewareData: a
|
|
4568
|
-
} = t,
|
|
4569
|
+
} = t, h = await Ii(t, n);
|
|
4569
4570
|
return o === ((e = a.offset) == null ? void 0 : e.placement) && (i = a.arrow) != null && i.alignmentOffset ? {} : {
|
|
4570
|
-
x: s +
|
|
4571
|
-
y: r +
|
|
4571
|
+
x: s + h.x,
|
|
4572
|
+
y: r + h.y,
|
|
4572
4573
|
data: {
|
|
4573
|
-
...
|
|
4574
|
+
...h,
|
|
4574
4575
|
placement: o
|
|
4575
4576
|
}
|
|
4576
4577
|
};
|
|
@@ -4600,11 +4601,11 @@ const Oi = function(n) {
|
|
|
4600
4601
|
};
|
|
4601
4602
|
}
|
|
4602
4603
|
},
|
|
4603
|
-
...
|
|
4604
|
+
...h
|
|
4604
4605
|
} = at(n, t), c = {
|
|
4605
4606
|
x: e,
|
|
4606
4607
|
y: i
|
|
4607
|
-
}, f = await ne(t,
|
|
4608
|
+
}, f = await ne(t, h), d = J(q(s)), x = re(d);
|
|
4608
4609
|
let u = c[x], g = c[d];
|
|
4609
4610
|
if (r) {
|
|
4610
4611
|
const p = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", b = u + f[p], m = u - f[y];
|
|
@@ -4659,7 +4660,7 @@ function N(n) {
|
|
|
4659
4660
|
function zt(n) {
|
|
4660
4661
|
return !gt() || typeof ShadowRoot > "u" ? !1 : n instanceof ShadowRoot || n instanceof H(n).ShadowRoot;
|
|
4661
4662
|
}
|
|
4662
|
-
function
|
|
4663
|
+
function ht(n) {
|
|
4663
4664
|
const {
|
|
4664
4665
|
overflow: t,
|
|
4665
4666
|
overflowX: e,
|
|
@@ -4725,24 +4726,24 @@ function z(n) {
|
|
|
4725
4726
|
);
|
|
4726
4727
|
return zt(t) ? t.host : t;
|
|
4727
4728
|
}
|
|
4728
|
-
function
|
|
4729
|
+
function le(n) {
|
|
4729
4730
|
const t = z(n);
|
|
4730
|
-
return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) &&
|
|
4731
|
+
return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) && ht(t) ? t : le(t);
|
|
4731
4732
|
}
|
|
4732
4733
|
function Tt(n, t, e) {
|
|
4733
4734
|
var i;
|
|
4734
4735
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
4735
|
-
const s =
|
|
4736
|
+
const s = le(n), r = s === ((i = n.ownerDocument) == null ? void 0 : i.body), o = H(s);
|
|
4736
4737
|
if (r) {
|
|
4737
4738
|
const a = St(o);
|
|
4738
|
-
return t.concat(o, o.visualViewport || [],
|
|
4739
|
+
return t.concat(o, o.visualViewport || [], ht(s) ? s : [], a && e ? Tt(a) : []);
|
|
4739
4740
|
}
|
|
4740
4741
|
return t.concat(s, Tt(s, [], e));
|
|
4741
4742
|
}
|
|
4742
4743
|
function St(n) {
|
|
4743
4744
|
return n.parent && Object.getPrototypeOf(n.parent) ? n.frameElement : null;
|
|
4744
4745
|
}
|
|
4745
|
-
function
|
|
4746
|
+
function he(n) {
|
|
4746
4747
|
const t = X(n);
|
|
4747
4748
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
4748
4749
|
const s = N(n), r = s ? n.offsetWidth : e, o = s ? n.offsetHeight : i, a = ft(e) !== r || ft(i) !== o;
|
|
@@ -4763,7 +4764,7 @@ function Z(n) {
|
|
|
4763
4764
|
width: i,
|
|
4764
4765
|
height: s,
|
|
4765
4766
|
$: r
|
|
4766
|
-
} =
|
|
4767
|
+
} = he(t);
|
|
4767
4768
|
let o = (r ? ft(e.width) : e.width) / i, a = (r ? ft(e.height) : e.height) / s;
|
|
4768
4769
|
return (!o || !Number.isFinite(o)) && (o = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
4769
4770
|
x: o,
|
|
@@ -4787,19 +4788,19 @@ function ot(n, t, e, i) {
|
|
|
4787
4788
|
let o = V(1);
|
|
4788
4789
|
t && (i ? F(i) && (o = Z(i)) : o = Z(n));
|
|
4789
4790
|
const a = Mi(r, e, i) ? de(r) : V(0);
|
|
4790
|
-
let
|
|
4791
|
+
let h = (s.left + a.x) / o.x, c = (s.top + a.y) / o.y, f = s.width / o.x, d = s.height / o.y;
|
|
4791
4792
|
if (r) {
|
|
4792
4793
|
const x = H(r), u = i && F(i) ? H(i) : i;
|
|
4793
4794
|
let g = x, w = St(g);
|
|
4794
4795
|
for (; w && i && u !== g; ) {
|
|
4795
4796
|
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
|
-
|
|
4797
|
+
h *= p.x, c *= p.y, f *= p.x, d *= p.y, h += m, c += E, g = H(w), w = St(g);
|
|
4797
4798
|
}
|
|
4798
4799
|
}
|
|
4799
4800
|
return ut({
|
|
4800
4801
|
width: f,
|
|
4801
4802
|
height: d,
|
|
4802
|
-
x:
|
|
4803
|
+
x: h,
|
|
4803
4804
|
y: c
|
|
4804
4805
|
});
|
|
4805
4806
|
}
|
|
@@ -4813,20 +4814,20 @@ function Hi(n) {
|
|
|
4813
4814
|
const r = s === "fixed", o = Y(i), a = t ? wt(t.floating) : !1;
|
|
4814
4815
|
if (i === o || a && r)
|
|
4815
4816
|
return e;
|
|
4816
|
-
let
|
|
4817
|
+
let h = {
|
|
4817
4818
|
scrollLeft: 0,
|
|
4818
4819
|
scrollTop: 0
|
|
4819
4820
|
}, c = V(1);
|
|
4820
4821
|
const f = V(0), d = N(i);
|
|
4821
|
-
if ((d || !d && !r) && ((tt(i) !== "body" ||
|
|
4822
|
+
if ((d || !d && !r) && ((tt(i) !== "body" || ht(o)) && (h = pt(i)), N(i))) {
|
|
4822
4823
|
const x = ot(i);
|
|
4823
4824
|
c = Z(i), f.x = x.x + i.clientLeft, f.y = x.y + i.clientTop;
|
|
4824
4825
|
}
|
|
4825
4826
|
return {
|
|
4826
4827
|
width: e.width * c.x,
|
|
4827
4828
|
height: e.height * c.y,
|
|
4828
|
-
x: e.x * c.x -
|
|
4829
|
-
y: e.y * c.y -
|
|
4829
|
+
x: e.x * c.x - h.scrollLeft * c.x + f.x,
|
|
4830
|
+
y: e.y * c.y - h.scrollTop * c.y + f.y
|
|
4830
4831
|
};
|
|
4831
4832
|
}
|
|
4832
4833
|
function Di(n) {
|
|
@@ -4849,25 +4850,25 @@ function Fi(n) {
|
|
|
4849
4850
|
}
|
|
4850
4851
|
function Xi(n, t) {
|
|
4851
4852
|
const e = H(n), i = Y(n), s = e.visualViewport;
|
|
4852
|
-
let r = i.clientWidth, o = i.clientHeight, a = 0,
|
|
4853
|
+
let r = i.clientWidth, o = i.clientHeight, a = 0, h = 0;
|
|
4853
4854
|
if (s) {
|
|
4854
4855
|
r = s.width, o = s.height;
|
|
4855
4856
|
const c = Dt();
|
|
4856
|
-
(!c || c && t === "fixed") && (a = s.offsetLeft,
|
|
4857
|
+
(!c || c && t === "fixed") && (a = s.offsetLeft, h = s.offsetTop);
|
|
4857
4858
|
}
|
|
4858
4859
|
return {
|
|
4859
4860
|
width: r,
|
|
4860
4861
|
height: o,
|
|
4861
4862
|
x: a,
|
|
4862
|
-
y:
|
|
4863
|
+
y: h
|
|
4863
4864
|
};
|
|
4864
4865
|
}
|
|
4865
4866
|
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,
|
|
4867
|
+
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, h = s * r.x, c = i * r.y;
|
|
4867
4868
|
return {
|
|
4868
4869
|
width: o,
|
|
4869
4870
|
height: a,
|
|
4870
|
-
x:
|
|
4871
|
+
x: h,
|
|
4871
4872
|
y: c
|
|
4872
4873
|
};
|
|
4873
4874
|
}
|
|
@@ -4901,8 +4902,8 @@ function Ni(n, t) {
|
|
|
4901
4902
|
const r = X(n).position === "fixed";
|
|
4902
4903
|
let o = r ? z(n) : n;
|
|
4903
4904
|
for (; F(o) && !Q(o); ) {
|
|
4904
|
-
const a = X(o),
|
|
4905
|
-
!
|
|
4905
|
+
const a = X(o), h = Ht(o);
|
|
4906
|
+
!h && a.position === "fixed" && (s = null), (r ? !h && !s : !h && a.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && fe(n, o)) ? i = i.filter((f) => f !== o) : s = a, o = z(o);
|
|
4906
4907
|
}
|
|
4907
4908
|
return t.set(n, i), i;
|
|
4908
4909
|
}
|
|
@@ -4913,22 +4914,22 @@ function Ki(n) {
|
|
|
4913
4914
|
rootBoundary: i,
|
|
4914
4915
|
strategy: s
|
|
4915
4916
|
} = n;
|
|
4916
|
-
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0],
|
|
4917
|
+
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0], h = o.reduce((c, f) => {
|
|
4917
4918
|
const d = $t(t, f, s);
|
|
4918
4919
|
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
4920
|
}, $t(t, a, s));
|
|
4920
4921
|
return {
|
|
4921
|
-
width:
|
|
4922
|
-
height:
|
|
4923
|
-
x:
|
|
4924
|
-
y:
|
|
4922
|
+
width: h.right - h.left,
|
|
4923
|
+
height: h.bottom - h.top,
|
|
4924
|
+
x: h.left,
|
|
4925
|
+
y: h.top
|
|
4925
4926
|
};
|
|
4926
4927
|
}
|
|
4927
4928
|
function Yi(n) {
|
|
4928
4929
|
const {
|
|
4929
4930
|
width: t,
|
|
4930
4931
|
height: e
|
|
4931
|
-
} =
|
|
4932
|
+
} = he(n);
|
|
4932
4933
|
return {
|
|
4933
4934
|
width: t,
|
|
4934
4935
|
height: e
|
|
@@ -4940,19 +4941,19 @@ function Bi(n, t, e) {
|
|
|
4940
4941
|
scrollLeft: 0,
|
|
4941
4942
|
scrollTop: 0
|
|
4942
4943
|
};
|
|
4943
|
-
const
|
|
4944
|
+
const h = V(0);
|
|
4944
4945
|
if (i || !i && !r)
|
|
4945
|
-
if ((tt(t) !== "body" ||
|
|
4946
|
+
if ((tt(t) !== "body" || ht(s)) && (a = pt(t)), i) {
|
|
4946
4947
|
const u = ot(t, !0, r, t);
|
|
4947
|
-
|
|
4948
|
-
} else s && (
|
|
4948
|
+
h.x = u.x + t.clientLeft, h.y = u.y + t.clientTop;
|
|
4949
|
+
} else s && (h.x = At(s));
|
|
4949
4950
|
let c = 0, f = 0;
|
|
4950
4951
|
if (s && !i && !r) {
|
|
4951
4952
|
const u = s.getBoundingClientRect();
|
|
4952
4953
|
f = u.top + a.scrollTop, c = u.left + a.scrollLeft - // RTL <body> scrollbar.
|
|
4953
4954
|
At(s, u);
|
|
4954
4955
|
}
|
|
4955
|
-
const d = o.left + a.scrollLeft -
|
|
4956
|
+
const d = o.left + a.scrollLeft - h.x - c, x = o.top + a.scrollTop - h.y - f;
|
|
4956
4957
|
return {
|
|
4957
4958
|
x: d,
|
|
4958
4959
|
y: x,
|
|
@@ -5030,11 +5031,11 @@ const Vi = {
|
|
|
5030
5031
|
};
|
|
5031
5032
|
let $i = class {
|
|
5032
5033
|
constructor(t) {
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5034
|
+
l(this, "ctx");
|
|
5035
|
+
l(this, "enable", !1);
|
|
5036
|
+
l(this, "contentEl");
|
|
5037
|
+
l(this, "floatingEl");
|
|
5038
|
+
l(this, "arrowEl");
|
|
5038
5039
|
this.ctx = t;
|
|
5039
5040
|
const { TOOLTIP_BG_COLOR: e, TOOLTIP_TEXT_COLOR: i, TOOLTIP_ZINDEX: s, TOOLTIP_CUSTOM_STYLE: r, CSS_PREFIX: o } = this.ctx.config;
|
|
5040
5041
|
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 +5050,7 @@ let $i = class {
|
|
|
5049
5050
|
borderRadius: "4px",
|
|
5050
5051
|
fontSize: "12px",
|
|
5051
5052
|
...r
|
|
5052
|
-
},
|
|
5053
|
+
}, h = {
|
|
5053
5054
|
position: "absolute",
|
|
5054
5055
|
width: "10px",
|
|
5055
5056
|
height: "10px",
|
|
@@ -5058,7 +5059,7 @@ let $i = class {
|
|
|
5058
5059
|
transform: "rotate(45deg)",
|
|
5059
5060
|
zIndex: a.zIndex
|
|
5060
5061
|
};
|
|
5061
|
-
Object.assign(this.arrowEl.style,
|
|
5062
|
+
Object.assign(this.arrowEl.style, h), 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
5063
|
}
|
|
5063
5064
|
init() {
|
|
5064
5065
|
this.ctx.on("mousemove", (t) => {
|
|
@@ -5083,7 +5084,7 @@ let $i = class {
|
|
|
5083
5084
|
const i = this.ctx.containerElement.getBoundingClientRect();
|
|
5084
5085
|
if (!i)
|
|
5085
5086
|
return;
|
|
5086
|
-
this.enable = !0, this.contentEl.style.maxWidth = `${t.overflowTooltipMaxWidth || 500}px`, this.contentEl.style.width = "100%", this.contentEl.style.display = "inline-block", this.contentEl.style.wordBreak = "break-all", this.contentEl.style.lineHeight = "1.5", this.contentEl.innerText = e;
|
|
5087
|
+
this.enable = !0, this.contentEl.style.maxWidth = `${t.overflowTooltipMaxWidth || 500}px`, this.contentEl.style.minWidth = "100px", this.contentEl.style.width = "100%", this.contentEl.style.display = "inline-block", this.contentEl.style.wordBreak = "break-all", this.contentEl.style.lineHeight = "1.5", this.contentEl.innerText = e;
|
|
5087
5088
|
const s = t.drawX + i.x, r = t.drawY + i.y;
|
|
5088
5089
|
pe({
|
|
5089
5090
|
getBoundingClientRect() {
|
|
@@ -5102,10 +5103,10 @@ let $i = class {
|
|
|
5102
5103
|
placement: t.overflowTooltipPlacement,
|
|
5103
5104
|
middleware: [ge(), we(), ue(6), zi({ element: this.arrowEl })]
|
|
5104
5105
|
}).then((a) => {
|
|
5105
|
-
const { x:
|
|
5106
|
+
const { x: h, y: c, placement: f, middlewareData: d } = a;
|
|
5106
5107
|
if (Object.assign(this.floatingEl.style, {
|
|
5107
5108
|
top: `${c}px`,
|
|
5108
|
-
left: `${
|
|
5109
|
+
left: `${h}px`
|
|
5109
5110
|
}), d.arrow) {
|
|
5110
5111
|
const x = d.arrow;
|
|
5111
5112
|
["left", "left-start", "left-end"].includes(f) ? Object.assign(this.arrowEl.style, {
|
|
@@ -5141,13 +5142,13 @@ let $i = class {
|
|
|
5141
5142
|
};
|
|
5142
5143
|
class qi {
|
|
5143
5144
|
constructor(t) {
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5145
|
+
l(this, "editorEl");
|
|
5146
|
+
l(this, "inputEl");
|
|
5147
|
+
l(this, "enable", !1);
|
|
5148
|
+
l(this, "cellTarget", null);
|
|
5149
|
+
l(this, "ctx");
|
|
5150
|
+
l(this, "drawY", 0);
|
|
5151
|
+
l(this, "drawX", 0);
|
|
5151
5152
|
this.ctx = t, this.initTextEditor(), this.init();
|
|
5152
5153
|
}
|
|
5153
5154
|
init() {
|
|
@@ -5232,12 +5233,12 @@ class qi {
|
|
|
5232
5233
|
this.drawX = r, this.drawY = o;
|
|
5233
5234
|
let { height: a } = t;
|
|
5234
5235
|
const {
|
|
5235
|
-
config: { CELL_PADDING:
|
|
5236
|
+
config: { CELL_PADDING: h },
|
|
5236
5237
|
header: c
|
|
5237
5238
|
} = this.ctx;
|
|
5238
5239
|
let f = this.ctx.body.visibleHeight;
|
|
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
|
+
if (a > f && (a = f), this.editorEl.style.display = "inline-block", 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") {
|
|
5241
|
+
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 = `${h}px`, e !== null && (this.inputEl.value = e), this.inputEl.focus();
|
|
5241
5242
|
const d = this.inputEl.value.length;
|
|
5242
5243
|
this.inputEl.setSelectionRange(d, d);
|
|
5243
5244
|
} else
|
|
@@ -5245,7 +5246,7 @@ class qi {
|
|
|
5245
5246
|
(this.inputEl.scrollHeight > a || o < c.height) && this.autoSize();
|
|
5246
5247
|
}
|
|
5247
5248
|
doneEditByInput() {
|
|
5248
|
-
if (this.cellTarget && (this.editorEl.style.
|
|
5249
|
+
if (this.cellTarget && (this.editorEl.style.display = "none", this.cellTarget.editorType === "text")) {
|
|
5249
5250
|
const { rowKey: t, key: e } = this.cellTarget, i = this.cellTarget.getValue(), s = this.inputEl.value;
|
|
5250
5251
|
s !== i && !(s === "" && i === null) && this.ctx.database.setItemValue(t, e, s, !0, !0, !0), this.inputEl.value = "";
|
|
5251
5252
|
}
|
|
@@ -5271,8 +5272,8 @@ class qi {
|
|
|
5271
5272
|
const r = this.ctx.focusCell;
|
|
5272
5273
|
if (!r || ["index", "index-selection", "selection"].includes(r.type) || this.enable)
|
|
5273
5274
|
return;
|
|
5274
|
-
const { rowKey: o, key: a } = r,
|
|
5275
|
-
r && !
|
|
5275
|
+
const { rowKey: o, key: a } = r, h = this.ctx.database.getReadonly(o, a);
|
|
5276
|
+
r && !h && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = r, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
5276
5277
|
}
|
|
5277
5278
|
doneEdit() {
|
|
5278
5279
|
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.stageElement.focus(), this.ctx.editing = !1);
|
|
@@ -5284,18 +5285,18 @@ class qi {
|
|
|
5284
5285
|
}
|
|
5285
5286
|
class Gi {
|
|
5286
5287
|
constructor(t) {
|
|
5287
|
-
|
|
5288
|
-
|
|
5288
|
+
l(this, "ctx");
|
|
5289
|
+
l(this, "emptyEl");
|
|
5289
5290
|
this.ctx = t;
|
|
5290
5291
|
const { EMPTY_TEXT: e, EMPTY_CUSTOM_STYLE: i } = this.ctx.config;
|
|
5291
5292
|
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
|
|
5293
|
+
const h = r + (o + a) / 2, c = {
|
|
5293
5294
|
display: s === "empty" ? "block" : "none",
|
|
5294
5295
|
position: "absolute",
|
|
5295
5296
|
fontSize: "14px",
|
|
5296
5297
|
color: "#666",
|
|
5297
5298
|
left: "50%",
|
|
5298
|
-
top: `${
|
|
5299
|
+
top: `${h}px`,
|
|
5299
5300
|
transform: "translate(-50%, -50%)",
|
|
5300
5301
|
...i
|
|
5301
5302
|
};
|
|
@@ -5308,7 +5309,7 @@ class Gi {
|
|
|
5308
5309
|
}
|
|
5309
5310
|
class ji {
|
|
5310
5311
|
constructor(t) {
|
|
5311
|
-
|
|
5312
|
+
l(this, "ctx");
|
|
5312
5313
|
this.ctx = t;
|
|
5313
5314
|
}
|
|
5314
5315
|
draw() {
|
|
@@ -5335,9 +5336,9 @@ class ji {
|
|
|
5335
5336
|
fixedRightWidth: e,
|
|
5336
5337
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
5337
5338
|
} = this.ctx, { visibleWidth: r, visibleHeight: o, renderCellHeaders: a } = this.ctx.header;
|
|
5338
|
-
let
|
|
5339
|
+
let h = [], c = [], f = [];
|
|
5339
5340
|
a.forEach((p) => {
|
|
5340
|
-
p.render && (p.fixed === "left" ? c.push(p) : p.fixed === "right" ? f.push(p) :
|
|
5341
|
+
p.render && (p.fixed === "left" ? c.push(p) : p.fixed === "right" ? f.push(p) : h.push(p));
|
|
5341
5342
|
});
|
|
5342
5343
|
const d = e - i, x = {
|
|
5343
5344
|
key: "left",
|
|
@@ -5360,7 +5361,7 @@ class ji {
|
|
|
5360
5361
|
width: `${r - t - d + 1}px`,
|
|
5361
5362
|
height: `${o}px`
|
|
5362
5363
|
},
|
|
5363
|
-
cells:
|
|
5364
|
+
cells: h
|
|
5364
5365
|
}, g = {
|
|
5365
5366
|
key: "right",
|
|
5366
5367
|
style: {
|
|
@@ -5396,7 +5397,7 @@ class ji {
|
|
|
5396
5397
|
const {
|
|
5397
5398
|
fixedLeftWidth: r,
|
|
5398
5399
|
fixedRightWidth: o,
|
|
5399
|
-
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX:
|
|
5400
|
+
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX: h }
|
|
5400
5401
|
} = this.ctx, { visibleWidth: c, visibleHeight: f } = this.ctx.body, d = o - a, x = {
|
|
5401
5402
|
key: "left",
|
|
5402
5403
|
style: {
|
|
@@ -5433,7 +5434,7 @@ class ji {
|
|
|
5433
5434
|
};
|
|
5434
5435
|
return {
|
|
5435
5436
|
type: "body",
|
|
5436
|
-
class: `${
|
|
5437
|
+
class: `${h}-overlayer-body`,
|
|
5437
5438
|
style: {
|
|
5438
5439
|
position: "relative",
|
|
5439
5440
|
overflow: "hidden",
|
|
@@ -5454,7 +5455,7 @@ class ji {
|
|
|
5454
5455
|
fixedLeftWidth: s,
|
|
5455
5456
|
fixedRightWidth: r,
|
|
5456
5457
|
config: { SCROLLER_TRACK_SIZE: o, CSS_PREFIX: a }
|
|
5457
|
-
} = this.ctx, { visibleWidth:
|
|
5458
|
+
} = this.ctx, { visibleWidth: h, visibleHeight: c } = this.ctx.footer, f = r - o, d = {
|
|
5458
5459
|
key: "left",
|
|
5459
5460
|
style: {
|
|
5460
5461
|
position: "absolute",
|
|
@@ -5472,7 +5473,7 @@ class ji {
|
|
|
5472
5473
|
top: `${0.5}px`,
|
|
5473
5474
|
left: `${s - 0.5}px`,
|
|
5474
5475
|
overflow: "hidden",
|
|
5475
|
-
width: `${
|
|
5476
|
+
width: `${h - s - f}px`,
|
|
5476
5477
|
height: `${c}px`
|
|
5477
5478
|
},
|
|
5478
5479
|
cells: t
|
|
@@ -5494,7 +5495,7 @@ class ji {
|
|
|
5494
5495
|
style: {
|
|
5495
5496
|
position: "relative",
|
|
5496
5497
|
overflow: "hidden",
|
|
5497
|
-
width: `${
|
|
5498
|
+
width: `${h}px`,
|
|
5498
5499
|
height: `${c}px`
|
|
5499
5500
|
},
|
|
5500
5501
|
views: [d, x, u]
|
|
@@ -5503,17 +5504,17 @@ class ji {
|
|
|
5503
5504
|
}
|
|
5504
5505
|
class Ui {
|
|
5505
5506
|
constructor(t) {
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5507
|
+
l(this, "ctx");
|
|
5508
|
+
l(this, "contextMenuEl");
|
|
5509
|
+
l(this, "custom", !1);
|
|
5509
5510
|
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
5511
|
}
|
|
5511
5512
|
init() {
|
|
5512
5513
|
this.ctx.on("cellContextMenuClick", (t, e) => {
|
|
5513
5514
|
if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
|
|
5514
5515
|
e.preventDefault();
|
|
5515
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a,
|
|
5516
|
-
c >= a && c <=
|
|
5516
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a, h] = s, { rowIndex: c, colIndex: f } = t;
|
|
5517
|
+
c >= a && c <= h && f >= r && f <= o || this.ctx.emit("setSelectorCell", t, e);
|
|
5517
5518
|
const x = {
|
|
5518
5519
|
getBoundingClientRect: () => ({
|
|
5519
5520
|
width: 0,
|
|
@@ -5587,19 +5588,19 @@ class Ui {
|
|
|
5587
5588
|
}
|
|
5588
5589
|
class Qi {
|
|
5589
5590
|
constructor(t, e) {
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5591
|
+
l(this, "options");
|
|
5592
|
+
l(this, "scroller");
|
|
5593
|
+
l(this, "header");
|
|
5594
|
+
l(this, "body");
|
|
5595
|
+
l(this, "footer");
|
|
5596
|
+
l(this, "selector");
|
|
5597
|
+
l(this, "autofill");
|
|
5598
|
+
l(this, "tooltip");
|
|
5599
|
+
l(this, "editor");
|
|
5600
|
+
l(this, "empty");
|
|
5601
|
+
l(this, "overlayer");
|
|
5602
|
+
l(this, "contextMenu");
|
|
5603
|
+
l(this, "ctx");
|
|
5603
5604
|
this.options = e;
|
|
5604
5605
|
const { overlayerElement: i, editorElement: s, emptyElement: r, contextMenuElement: o } = e, a = this.createContainer(
|
|
5605
5606
|
t,
|
|
@@ -5608,7 +5609,7 @@ class Qi {
|
|
|
5608
5609
|
r,
|
|
5609
5610
|
o
|
|
5610
5611
|
);
|
|
5611
|
-
this.ctx = new
|
|
5612
|
+
this.ctx = new hi(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
5613
|
this.draw();
|
|
5613
5614
|
}), this.ctx.on("drawView", () => {
|
|
5614
5615
|
this.draw(!0);
|
|
@@ -5616,16 +5617,16 @@ class Qi {
|
|
|
5616
5617
|
}
|
|
5617
5618
|
createContainer(t, e, i, s, r) {
|
|
5618
5619
|
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",
|
|
5620
|
+
const o = document.createElement("div"), a = document.createElement("canvas"), h = e || document.createElement("div");
|
|
5621
|
+
o.className = "e-virt-table-stage", a.className = "e-virt-table-canvas", h.className = "e-virt-table-overlayer";
|
|
5621
5622
|
const c = i || document.createElement("div");
|
|
5622
5623
|
c.className = "e-virt-table-editor";
|
|
5623
5624
|
const f = s, d = r;
|
|
5624
|
-
return o.appendChild(a), o.appendChild(
|
|
5625
|
+
return o.appendChild(a), o.appendChild(h), t.appendChild(o), {
|
|
5625
5626
|
containerElement: t,
|
|
5626
5627
|
stageElement: o,
|
|
5627
5628
|
canvasElement: a,
|
|
5628
|
-
overlayerElement:
|
|
5629
|
+
overlayerElement: h,
|
|
5629
5630
|
editorElement: c,
|
|
5630
5631
|
emptyElement: f,
|
|
5631
5632
|
contextMenuElement: d
|
|
@@ -5696,8 +5697,8 @@ class Qi {
|
|
|
5696
5697
|
if (t && Array.isArray(s) && s.length) {
|
|
5697
5698
|
const [r] = s;
|
|
5698
5699
|
if (Array.isArray(r) && r.length) {
|
|
5699
|
-
const [o] = r, { rowKey: a, key:
|
|
5700
|
-
this.scrollToRowkey(a), this.scrollToColkey(
|
|
5700
|
+
const [o] = r, { rowKey: a, key: h } = o;
|
|
5701
|
+
this.scrollToRowkey(a), this.scrollToColkey(h);
|
|
5701
5702
|
}
|
|
5702
5703
|
}
|
|
5703
5704
|
i(s);
|
|
@@ -5722,7 +5723,7 @@ class Qi {
|
|
|
5722
5723
|
let r = [];
|
|
5723
5724
|
for (let o = 0; o < i.length; o++)
|
|
5724
5725
|
for (let a = 0; a < s.length; a++) {
|
|
5725
|
-
const
|
|
5726
|
+
const h = this.ctx.database.getRowKeyByItem(i[o]), f = s[a].key, d = await this.ctx.database.getValidator(h, f);
|
|
5726
5727
|
Array.isArray(d) && d.length && r.push(d);
|
|
5727
5728
|
}
|
|
5728
5729
|
r.length ? (e(r), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
|