e-virt-table 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -5
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +772 -782
- 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/Body.js +7 -2
- package/dist/lib/Body.js.map +1 -1
- package/dist/lib/Config.d.ts +2 -1
- package/dist/lib/Config.js +6 -0
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Context.js +4 -1
- package/dist/lib/Context.js.map +1 -1
- package/dist/lib/EVirtTable.js +1 -1
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/Footer.d.ts +1 -1
- package/dist/lib/Footer.js +16 -12
- package/dist/lib/Footer.js.map +1 -1
- package/dist/lib/Overlayer.js +10 -2
- package/dist/lib/Overlayer.js.map +1 -1
- package/dist/lib/Selector.js +8 -6
- package/dist/lib/Selector.js.map +1 -1
- package/dist/lib/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--e-virt-table-color-white: #fff;--e-virt-table-color-black: #000000;--e-virt-table-color-primary: rgb(82, 146, 247);--e-virt-table-text-color-primary: #333;--e-virt-table-text-color-regular: #666;--e-virt-table-text-color-secondary: #999;--e-virt-table-box-shadow: 0 2px 12px 0 #0000001a;--e-virt-table-editor-bg-color: #fff;--e-virt-table-border-color: #e1e6eb}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;z-index:10;border-radius:8px;border:1px solid var(--e-virt-table-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;border:none;outline:none;z-index:10}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;height:auto;line-height:0;z-index:100;overflow:hidden;background-color:var(--e-virt-table-editor-bg-color);border:2px solid var(--e-virt-table-color-primary);box-sizing:border-box;box-shadow:var(--e-virt-table-box-shadow);display:flex;align-items:center}.e-virt-table-overlayer{position:absolute;left:0;top:0;overflow:hidden;z-index:100;pointer-events:none}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;outline:none;font-weight:400;padding:8px;font-size:12px;color:inherit;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;line-height:1.5;margin:0;border:none;vertical-align:middle;background:var(--e-virt-table-color-white);overflow-y:auto;resize:none}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--e-virt-table-text-color-regular);background-color:var(--e-virt-table-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--e-virt-table-box-shadow);width:fit-content;padding:6px 0;z-index:9999;left:-99999px;top:-99999px}.e-virt-table-context-menu-item{cursor:pointer;padding:8px 24px;color:var(--e-virt-table-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--e-virt-table-color-primary);background-color:#f5f7fa}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
2
|
var me = Object.defineProperty;
|
|
3
3
|
var Ee = (n, t, e) => t in n ? me(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
4
|
-
var
|
|
4
|
+
var h = (n, t, e) => Ee(n, typeof t != "symbol" ? t + "" : t, e);
|
|
5
5
|
function $() {
|
|
6
6
|
return $ = Object.assign ? Object.assign.bind() : function(n) {
|
|
7
7
|
for (var t = 1; t < arguments.length; t++) {
|
|
@@ -39,7 +39,7 @@ function dt(n, t, e) {
|
|
|
39
39
|
return Ce() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
|
|
40
40
|
var a = [null];
|
|
41
41
|
a.push.apply(a, r);
|
|
42
|
-
var
|
|
42
|
+
var l = Function.bind.apply(s, a), c = new l();
|
|
43
43
|
return o && st(c, o.prototype), c;
|
|
44
44
|
}, dt.apply(null, arguments);
|
|
45
45
|
}
|
|
@@ -122,7 +122,7 @@ function _e(n) {
|
|
|
122
122
|
function _(n, t) {
|
|
123
123
|
return !!(n == null || t === "array" && Array.isArray(n) && !n.length || _e(t) && typeof n == "string" && !n);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Oe(n, t, e) {
|
|
126
126
|
var i = [], s = 0, r = n.length;
|
|
127
127
|
function o(a) {
|
|
128
128
|
i.push.apply(i, a || []), s++, s === r && e(i);
|
|
@@ -143,7 +143,7 @@ function Ft(n, t, e) {
|
|
|
143
143
|
}
|
|
144
144
|
r([]);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Ie(n) {
|
|
147
147
|
var t = [];
|
|
148
148
|
return Object.keys(n).forEach(function(e) {
|
|
149
149
|
t.push.apply(t, n[e] || []);
|
|
@@ -157,36 +157,36 @@ var Xt = /* @__PURE__ */ function(n) {
|
|
|
157
157
|
}
|
|
158
158
|
return t;
|
|
159
159
|
}(/* @__PURE__ */ bt(Error));
|
|
160
|
-
function
|
|
160
|
+
function Te(n, t, e, i, s) {
|
|
161
161
|
if (t.first) {
|
|
162
162
|
var r = new Promise(function(x, u) {
|
|
163
163
|
var g = function(y) {
|
|
164
164
|
return i(y), y.length ? u(new Xt(y, Ct(y))) : x(s);
|
|
165
|
-
}, w =
|
|
165
|
+
}, w = Ie(n);
|
|
166
166
|
Ft(w, e, g);
|
|
167
167
|
});
|
|
168
168
|
return r.catch(function(x) {
|
|
169
169
|
return x;
|
|
170
170
|
}), r;
|
|
171
171
|
}
|
|
172
|
-
var o = t.firstFields === !0 ? Object.keys(n) : t.firstFields || [], a = Object.keys(n),
|
|
172
|
+
var o = t.firstFields === !0 ? Object.keys(n) : t.firstFields || [], a = Object.keys(n), l = a.length, c = 0, d = [], f = new Promise(function(x, u) {
|
|
173
173
|
var g = function(p) {
|
|
174
|
-
if (d.push.apply(d, p), c++, c ===
|
|
174
|
+
if (d.push.apply(d, p), c++, c === l)
|
|
175
175
|
return i(d), d.length ? u(new Xt(d, Ct(d))) : x(s);
|
|
176
176
|
};
|
|
177
177
|
a.length || (i(d), x(s)), a.forEach(function(w) {
|
|
178
178
|
var p = n[w];
|
|
179
|
-
o.indexOf(w) !== -1 ? Ft(p, e, g) :
|
|
179
|
+
o.indexOf(w) !== -1 ? Ft(p, e, g) : Oe(p, e, g);
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
182
|
return f.catch(function(x) {
|
|
183
183
|
return x;
|
|
184
184
|
}), f;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function Se(n) {
|
|
187
187
|
return !!(n && n.message !== void 0);
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function Ae(n, t) {
|
|
190
190
|
for (var e = n, i = 0; i < t.length; i++) {
|
|
191
191
|
if (e == null)
|
|
192
192
|
return e;
|
|
@@ -197,7 +197,7 @@ function Se(n, t) {
|
|
|
197
197
|
function kt(n, t) {
|
|
198
198
|
return function(e) {
|
|
199
199
|
var i;
|
|
200
|
-
return n.fullFields ? i =
|
|
200
|
+
return n.fullFields ? i = Ae(t, n.fullFields) : i = t[e.field || n.fullField], Se(e) ? (e.field = e.field || n.fullField, e.fieldValue = i, e) : {
|
|
201
201
|
message: typeof e == "function" ? e() : e,
|
|
202
202
|
fieldValue: i,
|
|
203
203
|
field: e.field || n.fullField
|
|
@@ -234,15 +234,15 @@ var jt = function(t, e, i, s, r, o) {
|
|
|
234
234
|
(?:` + i + ":){1}(?:(?::" + i + "){0,4}:" + e + "|(?::" + i + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
235
235
|
(?::(?:(?::` + i + "){0,5}:" + e + "|(?::" + i + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
236
236
|
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
237
|
-
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), a = new RegExp("^" + s + "$"),
|
|
237
|
+
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), a = new RegExp("^" + s + "$"), l = function(E) {
|
|
238
238
|
return E && E.exact ? r : new RegExp("(?:" + t(E) + e + t(E) + ")|(?:" + t(E) + s + t(E) + ")", "g");
|
|
239
239
|
};
|
|
240
|
-
|
|
240
|
+
l.v4 = function(m) {
|
|
241
241
|
return m && m.exact ? o : new RegExp("" + t(m) + e + t(m), "g");
|
|
242
|
-
},
|
|
242
|
+
}, l.v6 = function(m) {
|
|
243
243
|
return m && m.exact ? a : new RegExp("" + t(m) + s + t(m), "g");
|
|
244
244
|
};
|
|
245
|
-
var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f =
|
|
245
|
+
var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = l.v4().source, x = l.v6().source, u = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", g = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", w = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", p = "(?::\\d{2,5})?", y = '(?:[/?#][^\\s"]*)?', b = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + x + "|" + u + g + w + ")" + p + y;
|
|
246
246
|
return ct = new RegExp("(?:^" + b + "$)", "i"), ct;
|
|
247
247
|
}, Kt = {
|
|
248
248
|
// http://emailregex.com/
|
|
@@ -300,10 +300,10 @@ var jt = function(t, e, i, s, r, o) {
|
|
|
300
300
|
var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], a = t.type;
|
|
301
301
|
o.indexOf(a) > -1 ? et[a](e) || s.push(M(r.messages.types[a], t.fullField, t.type)) : a && typeof e !== t.type && s.push(M(r.messages.types[a], t.fullField, t.type));
|
|
302
302
|
}, De = function(t, e, i, s, r) {
|
|
303
|
-
var o = typeof t.len == "number", a = typeof t.min == "number",
|
|
303
|
+
var o = typeof t.len == "number", a = typeof t.min == "number", l = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null, x = typeof e == "number", u = typeof e == "string", g = Array.isArray(e);
|
|
304
304
|
if (x ? f = "number" : u ? f = "string" : g && (f = "array"), !f)
|
|
305
305
|
return !1;
|
|
306
|
-
g && (d = e.length), u && (d = e.replace(c, "_").length), o ? d !== t.len && s.push(M(r.messages[f].len, t.fullField, t.len)) : a && !
|
|
306
|
+
g && (d = e.length), u && (d = e.replace(c, "_").length), o ? d !== t.len && s.push(M(r.messages[f].len, t.fullField, t.len)) : a && !l && d < t.min ? s.push(M(r.messages[f].min, t.fullField, t.min)) : l && !a && d > t.max ? s.push(M(r.messages[f].max, t.fullField, t.max)) : a && l && (d < t.min || d > t.max) && s.push(M(r.messages[f].range, t.fullField, t.min, t.max));
|
|
307
307
|
}, j = "enum", Fe = function(t, e, i, s, r) {
|
|
308
308
|
t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(M(r.messages[j], t.fullField, t[j].join(", ")));
|
|
309
309
|
}, Xe = function(t, e, i, s, r) {
|
|
@@ -416,8 +416,8 @@ var jt = function(t, e, i, s, r, o) {
|
|
|
416
416
|
if (_(e, "date") && !t.required)
|
|
417
417
|
return i();
|
|
418
418
|
if (v.required(t, e, s, o, r), !_(e, "date")) {
|
|
419
|
-
var
|
|
420
|
-
e instanceof Date ?
|
|
419
|
+
var l;
|
|
420
|
+
e instanceof Date ? l = e : l = new Date(e), v.type(t, l, s, o, r), l && v.range(t, l.getTime(), s, o, r);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
i(o);
|
|
@@ -425,8 +425,8 @@ var jt = function(t, e, i, s, r, o) {
|
|
|
425
425
|
var o = [], a = Array.isArray(e) ? "array" : typeof e;
|
|
426
426
|
v.required(t, e, s, o, r, a), i(o);
|
|
427
427
|
}, yt = function(t, e, i, s, r) {
|
|
428
|
-
var o = t.type, a = [],
|
|
429
|
-
if (
|
|
428
|
+
var o = t.type, a = [], l = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
429
|
+
if (l) {
|
|
430
430
|
if (_(e, o) && !t.required)
|
|
431
431
|
return i();
|
|
432
432
|
v.required(t, e, s, a, r, o), _(e, o) || v.type(t, e, s, a, r);
|
|
@@ -533,8 +533,8 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
533
533
|
var o = this;
|
|
534
534
|
s === void 0 && (s = {}), r === void 0 && (r = function() {
|
|
535
535
|
});
|
|
536
|
-
var a = i,
|
|
537
|
-
if (typeof
|
|
536
|
+
var a = i, l = s, c = r;
|
|
537
|
+
if (typeof l == "function" && (c = l, l = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
538
538
|
return c && c(null, a), Promise.resolve(a);
|
|
539
539
|
function d(w) {
|
|
540
540
|
var p = [], y = {};
|
|
@@ -549,12 +549,12 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
549
549
|
b(w[m]);
|
|
550
550
|
p.length ? (y = Ct(p), c(p, y)) : c(null, a);
|
|
551
551
|
}
|
|
552
|
-
if (
|
|
552
|
+
if (l.messages) {
|
|
553
553
|
var f = this.messages();
|
|
554
|
-
f === Rt && (f = vt()), Nt(f,
|
|
554
|
+
f === Rt && (f = vt()), Nt(f, l.messages), l.messages = f;
|
|
555
555
|
} else
|
|
556
|
-
|
|
557
|
-
var x = {}, u =
|
|
556
|
+
l.messages = this.messages();
|
|
557
|
+
var x = {}, u = l.keys || Object.keys(this.rules);
|
|
558
558
|
u.forEach(function(w) {
|
|
559
559
|
var p = o.rules[w], y = a[w];
|
|
560
560
|
p.forEach(function(b) {
|
|
@@ -570,51 +570,51 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
572
|
var g = {};
|
|
573
|
-
return
|
|
573
|
+
return Te(x, l, function(w, p) {
|
|
574
574
|
var y = w.rule, b = (y.type === "object" || y.type === "array") && (typeof y.fields == "object" || typeof y.defaultField == "object");
|
|
575
575
|
b = b && (y.required || !y.required && w.value), y.field = w.field;
|
|
576
|
-
function m(R,
|
|
577
|
-
return $({},
|
|
576
|
+
function m(R, O) {
|
|
577
|
+
return $({}, O, {
|
|
578
578
|
fullField: y.fullField + "." + R,
|
|
579
579
|
fullFields: y.fullFields ? [].concat(y.fullFields, [R]) : [R]
|
|
580
580
|
});
|
|
581
581
|
}
|
|
582
582
|
function E(R) {
|
|
583
583
|
R === void 0 && (R = []);
|
|
584
|
-
var
|
|
585
|
-
!
|
|
586
|
-
var S =
|
|
587
|
-
if (
|
|
584
|
+
var O = Array.isArray(R) ? R : [R];
|
|
585
|
+
!l.suppressWarning && O.length && n.warning("async-validator:", O), O.length && y.message !== void 0 && (O = [].concat(y.message));
|
|
586
|
+
var S = O.map(kt(y, a));
|
|
587
|
+
if (l.first && S.length)
|
|
588
588
|
return g[y.field] = 1, p(S);
|
|
589
589
|
if (!b)
|
|
590
590
|
p(S);
|
|
591
591
|
else {
|
|
592
592
|
if (y.required && !w.value)
|
|
593
|
-
return y.message !== void 0 ? S = [].concat(y.message).map(kt(y, a)) :
|
|
593
|
+
return y.message !== void 0 ? S = [].concat(y.message).map(kt(y, a)) : l.error && (S = [l.error(y, M(l.messages.required, y.field))]), p(S);
|
|
594
594
|
var L = {};
|
|
595
595
|
y.defaultField && Object.keys(w.value).map(function(I) {
|
|
596
596
|
L[I] = y.defaultField;
|
|
597
597
|
}), L = $({}, L, w.rule.fields);
|
|
598
598
|
var D = {};
|
|
599
599
|
Object.keys(L).forEach(function(I) {
|
|
600
|
-
var
|
|
601
|
-
D[I] =
|
|
600
|
+
var A = L[I], T = Array.isArray(A) ? A : [A];
|
|
601
|
+
D[I] = T.map(m.bind(null, I));
|
|
602
602
|
});
|
|
603
603
|
var B = new n(D);
|
|
604
|
-
B.messages(
|
|
605
|
-
var
|
|
606
|
-
S && S.length &&
|
|
604
|
+
B.messages(l.messages), w.rule.options && (w.rule.options.messages = l.messages, w.rule.options.error = l.error), B.validate(w.value, w.rule.options || l, function(I) {
|
|
605
|
+
var A = [];
|
|
606
|
+
S && S.length && A.push.apply(A, S), I && I.length && A.push.apply(A, I), p(A.length ? A : null);
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
610
|
var C;
|
|
611
611
|
if (y.asyncValidator)
|
|
612
|
-
C = y.asyncValidator(y, w.value, E, w.source,
|
|
612
|
+
C = y.asyncValidator(y, w.value, E, w.source, l);
|
|
613
613
|
else if (y.validator) {
|
|
614
614
|
try {
|
|
615
|
-
C = y.validator(y, w.value, E, w.source,
|
|
615
|
+
C = y.validator(y, w.value, E, w.source, l);
|
|
616
616
|
} catch (R) {
|
|
617
|
-
console.error == null || console.error(R),
|
|
617
|
+
console.error == null || console.error(R), l.suppressValidatorError || setTimeout(function() {
|
|
618
618
|
throw R;
|
|
619
619
|
}, 0), E(R.message);
|
|
620
620
|
}
|
|
@@ -724,10 +724,10 @@ function ti(n) {
|
|
|
724
724
|
if (n.startsWith('"')) {
|
|
725
725
|
let o = 0, a = !0;
|
|
726
726
|
for (; a; ) {
|
|
727
|
-
const
|
|
728
|
-
|
|
727
|
+
const l = n.slice(0, 1);
|
|
728
|
+
l === '"' && (o += 1), r += l, n = n.slice(1), (n.length === 0 || n.match(/^[\t\r\n]/) && o % 2 === 0) && (a = !1);
|
|
729
729
|
}
|
|
730
|
-
r = r.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (
|
|
730
|
+
r = r.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (l) => new Array(Math.floor(l.length / 2)).fill('"').join(""));
|
|
731
731
|
} else {
|
|
732
732
|
const o = n.match(Qe);
|
|
733
733
|
r = o ? o[0] : "", n = n.slice(r.length);
|
|
@@ -750,24 +750,24 @@ function ei(n) {
|
|
|
750
750
|
class ii {
|
|
751
751
|
//虚拟滚动位置
|
|
752
752
|
constructor(t, e) {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
753
|
+
h(this, "loading", !1);
|
|
754
|
+
h(this, "ctx");
|
|
755
|
+
h(this, "data");
|
|
756
|
+
h(this, "columns");
|
|
757
|
+
h(this, "footerData", []);
|
|
758
|
+
h(this, "rowKeyMap", /* @__PURE__ */ new Map());
|
|
759
|
+
h(this, "colIndexKeyMap", /* @__PURE__ */ new Map());
|
|
760
|
+
h(this, "headerMap", /* @__PURE__ */ new Map());
|
|
761
|
+
h(this, "rowIndexRowKeyMap", /* @__PURE__ */ new Map());
|
|
762
|
+
h(this, "checkboxKeyMap", /* @__PURE__ */ new Map());
|
|
763
|
+
h(this, "originalDataMap", /* @__PURE__ */ new Map());
|
|
764
|
+
h(this, "changedDataMap", /* @__PURE__ */ new Map());
|
|
765
|
+
h(this, "validationErrorMap", /* @__PURE__ */ new Map());
|
|
766
|
+
h(this, "itemRowKeyMap", /* @__PURE__ */ new WeakMap());
|
|
767
|
+
h(this, "bufferData", []);
|
|
768
|
+
h(this, "sumHeight", 0);
|
|
769
|
+
h(this, "filterMethod");
|
|
770
|
+
h(this, "positions", []);
|
|
771
771
|
this.ctx = t;
|
|
772
772
|
const { data: i = [], columns: s = [], footerData: r = [] } = e;
|
|
773
773
|
this.data = i, this.footerData = r, this.columns = s, this.setLoading(!0), this.init();
|
|
@@ -790,9 +790,9 @@ class ii {
|
|
|
790
790
|
t.forEach((i, s) => {
|
|
791
791
|
let r = i._hasChildren || !1;
|
|
792
792
|
Array.isArray(i.children) && i.children.length && (r = !0, this.initData(i.children, e + 1));
|
|
793
|
-
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: a, CELL_HEIGHT:
|
|
793
|
+
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: a, CELL_HEIGHT: l, SELECTABLE_METHOD: c, CHECKBOX_KEY: d } = this.ctx.config, f = i[o], x = f != null ? `${f}` : Ut();
|
|
794
794
|
this.itemRowKeyMap.set(i, x);
|
|
795
|
-
const u = i._height ||
|
|
795
|
+
const u = i._height || l, g = i._readonly;
|
|
796
796
|
let w = !0;
|
|
797
797
|
if (typeof c == "function" && (w = c), d) {
|
|
798
798
|
const p = i[d];
|
|
@@ -877,12 +877,12 @@ class ii {
|
|
|
877
877
|
const i = (r) => {
|
|
878
878
|
r.forEach((o) => {
|
|
879
879
|
t.push(o);
|
|
880
|
-
const a = this.itemRowKeyMap.get(o), { expand:
|
|
880
|
+
const a = this.itemRowKeyMap.get(o), { expand: l, hasChildren: c, height: d } = this.rowKeyMap.get(a), f = this.sumHeight;
|
|
881
881
|
this.sumHeight += d, this.rowIndexRowKeyMap.set(e, a), this.positions.push({
|
|
882
882
|
top: f,
|
|
883
883
|
height: d,
|
|
884
884
|
bottom: this.sumHeight
|
|
885
|
-
}), e += 1,
|
|
885
|
+
}), e += 1, l && c && i(o.children);
|
|
886
886
|
});
|
|
887
887
|
};
|
|
888
888
|
this.rowIndexRowKeyMap.clear();
|
|
@@ -1038,7 +1038,7 @@ class ii {
|
|
|
1038
1038
|
});
|
|
1039
1039
|
});
|
|
1040
1040
|
let a = [];
|
|
1041
|
-
const
|
|
1041
|
+
const l = i.map((d) => {
|
|
1042
1042
|
const f = this.ctx.database.getRowDataItemForRowKey(d.rowKey);
|
|
1043
1043
|
return {
|
|
1044
1044
|
rowKey: d.rowKey,
|
|
@@ -1050,10 +1050,10 @@ class ii {
|
|
|
1050
1050
|
s.forEach((d) => {
|
|
1051
1051
|
a.push(this.ctx.database.getRowDataItemForRowKey(d));
|
|
1052
1052
|
});
|
|
1053
|
-
const c =
|
|
1053
|
+
const c = l.map(({ rowKey: d, key: f }) => this.getValidator(d, f));
|
|
1054
1054
|
Promise.all(c).then(() => {
|
|
1055
1055
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1056
|
-
}), this.ctx.emit("change",
|
|
1056
|
+
}), this.ctx.emit("change", l, a), e && this.ctx.history.pushState({
|
|
1057
1057
|
changeList: i,
|
|
1058
1058
|
scrollX: this.ctx.scrollX,
|
|
1059
1059
|
scrollY: this.ctx.scrollY,
|
|
@@ -1074,15 +1074,15 @@ class ii {
|
|
|
1074
1074
|
if (!this.rowKeyMap.has(t))
|
|
1075
1075
|
return {};
|
|
1076
1076
|
const { item: a } = this.rowKeyMap.get(t);
|
|
1077
|
-
let
|
|
1077
|
+
let l = a[e];
|
|
1078
1078
|
if (this.ctx.database.getReadonly(t, e))
|
|
1079
1079
|
return {
|
|
1080
|
-
oldValue:
|
|
1081
|
-
newValue:
|
|
1080
|
+
oldValue: l,
|
|
1081
|
+
newValue: l
|
|
1082
1082
|
};
|
|
1083
|
-
a[e] !== null && typeof a[e] == "object" && (
|
|
1083
|
+
a[e] !== null && typeof a[e] == "object" && (l = JSON.parse(JSON.stringify(a[e])));
|
|
1084
1084
|
const c = `${t}_${e}`;
|
|
1085
|
-
this.originalDataMap.has(c) || this.originalDataMap.set(c,
|
|
1085
|
+
this.originalDataMap.has(c) || this.originalDataMap.set(c, l);
|
|
1086
1086
|
const d = this.originalDataMap.get(c);
|
|
1087
1087
|
let f = i;
|
|
1088
1088
|
if (o) {
|
|
@@ -1111,7 +1111,7 @@ class ii {
|
|
|
1111
1111
|
}), this.ctx.emit("change", [g], [u]), this.ctx.emit("editChange", {
|
|
1112
1112
|
rowKey: t,
|
|
1113
1113
|
key: e,
|
|
1114
|
-
oldValue:
|
|
1114
|
+
oldValue: l,
|
|
1115
1115
|
value: f,
|
|
1116
1116
|
originalValue: d,
|
|
1117
1117
|
row: u
|
|
@@ -1121,7 +1121,7 @@ class ii {
|
|
|
1121
1121
|
return this.ctx.hasEvent("iterationChange") && this.ctx.emit("iterationChange", {
|
|
1122
1122
|
rowKey: t,
|
|
1123
1123
|
key: e,
|
|
1124
|
-
oldValue:
|
|
1124
|
+
oldValue: l,
|
|
1125
1125
|
value: f,
|
|
1126
1126
|
originalValue: this.originalDataMap.get(c),
|
|
1127
1127
|
row: this.ctx.database.getRowDataItemForRowKey(t)
|
|
@@ -1133,12 +1133,12 @@ class ii {
|
|
|
1133
1133
|
{
|
|
1134
1134
|
rowKey: t,
|
|
1135
1135
|
key: e,
|
|
1136
|
-
oldValue:
|
|
1136
|
+
oldValue: l,
|
|
1137
1137
|
newValue: f
|
|
1138
1138
|
}
|
|
1139
1139
|
]
|
|
1140
1140
|
}), r && this.ctx.emit("draw"), {
|
|
1141
|
-
oldValue:
|
|
1141
|
+
oldValue: l,
|
|
1142
1142
|
newValue: f
|
|
1143
1143
|
};
|
|
1144
1144
|
}
|
|
@@ -1165,8 +1165,8 @@ class ii {
|
|
|
1165
1165
|
return !1;
|
|
1166
1166
|
const { item: s } = this.rowKeyMap.get(t), r = s[i];
|
|
1167
1167
|
this.checkboxKeyMap.has(r) && (this.checkboxKeyMap.get(r) || []).forEach((a) => {
|
|
1168
|
-
const
|
|
1169
|
-
|
|
1168
|
+
const l = this.rowKeyMap.get(a);
|
|
1169
|
+
l.check = e;
|
|
1170
1170
|
});
|
|
1171
1171
|
}
|
|
1172
1172
|
}
|
|
@@ -1329,9 +1329,9 @@ class ii {
|
|
|
1329
1329
|
const { DISABLED: i } = this.ctx.config;
|
|
1330
1330
|
if (i)
|
|
1331
1331
|
return !0;
|
|
1332
|
-
const s = this.rowKeyMap.get(t), r = this.headerMap.get(e), o = s == null ? void 0 : s.readonly, a = r == null ? void 0 : r.readonly, { BODY_CELL_READONLY_METHOD:
|
|
1333
|
-
if (typeof
|
|
1334
|
-
const d =
|
|
1332
|
+
const s = this.rowKeyMap.get(t), r = this.headerMap.get(e), o = s == null ? void 0 : s.readonly, a = r == null ? void 0 : r.readonly, { BODY_CELL_READONLY_METHOD: l } = this.ctx.config;
|
|
1333
|
+
if (typeof l == "function" && r) {
|
|
1334
|
+
const d = l({
|
|
1335
1335
|
row: s.item,
|
|
1336
1336
|
rowIndex: s.rowIndex,
|
|
1337
1337
|
colIndex: r.colIndex,
|
|
@@ -1355,7 +1355,7 @@ class ii {
|
|
|
1355
1355
|
if (r === void 0)
|
|
1356
1356
|
return i([]);
|
|
1357
1357
|
const a = r.column;
|
|
1358
|
-
let
|
|
1358
|
+
let l = a.rules;
|
|
1359
1359
|
if (typeof o == "function") {
|
|
1360
1360
|
const d = o({
|
|
1361
1361
|
row: s.item,
|
|
@@ -1364,12 +1364,12 @@ class ii {
|
|
|
1364
1364
|
column: a,
|
|
1365
1365
|
value: this.getItemValue(t, e)
|
|
1366
1366
|
});
|
|
1367
|
-
d && (
|
|
1367
|
+
d && (l = d);
|
|
1368
1368
|
}
|
|
1369
|
-
if (
|
|
1369
|
+
if (l) {
|
|
1370
1370
|
let c = {}, d = {};
|
|
1371
|
-
if (d[e] = this.getItemValue(t, e), Array.isArray(
|
|
1372
|
-
const x =
|
|
1371
|
+
if (d[e] = this.getItemValue(t, e), Array.isArray(l)) {
|
|
1372
|
+
const x = l.map((u) => ({
|
|
1373
1373
|
...u,
|
|
1374
1374
|
row: s.item,
|
|
1375
1375
|
column: a,
|
|
@@ -1379,7 +1379,7 @@ class ii {
|
|
|
1379
1379
|
c[e] = x;
|
|
1380
1380
|
} else
|
|
1381
1381
|
c[e] = {
|
|
1382
|
-
...
|
|
1382
|
+
...l,
|
|
1383
1383
|
row: s.item,
|
|
1384
1384
|
column: a,
|
|
1385
1385
|
rowIndex: s.rowIndex,
|
|
@@ -1438,9 +1438,9 @@ class ii {
|
|
|
1438
1438
|
}
|
|
1439
1439
|
class si {
|
|
1440
1440
|
constructor(t) {
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1441
|
+
h(this, "ctx");
|
|
1442
|
+
h(this, "history", []);
|
|
1443
|
+
h(this, "historyIndex", -1);
|
|
1444
1444
|
this.ctx = t, this.init();
|
|
1445
1445
|
}
|
|
1446
1446
|
init() {
|
|
@@ -1493,8 +1493,8 @@ class si {
|
|
|
1493
1493
|
}
|
|
1494
1494
|
class ri {
|
|
1495
1495
|
constructor(t) {
|
|
1496
|
-
|
|
1497
|
-
|
|
1496
|
+
h(this, "eventTasks", /* @__PURE__ */ new Map());
|
|
1497
|
+
h(this, "ctx");
|
|
1498
1498
|
this.ctx = t, this.init();
|
|
1499
1499
|
}
|
|
1500
1500
|
init() {
|
|
@@ -1548,7 +1548,7 @@ class ri {
|
|
|
1548
1548
|
}
|
|
1549
1549
|
class oi {
|
|
1550
1550
|
constructor() {
|
|
1551
|
-
|
|
1551
|
+
h(this, "events", /* @__PURE__ */ new Map());
|
|
1552
1552
|
}
|
|
1553
1553
|
has(t) {
|
|
1554
1554
|
return this.events.has(t);
|
|
@@ -1586,7 +1586,7 @@ class oi {
|
|
|
1586
1586
|
}
|
|
1587
1587
|
class ni {
|
|
1588
1588
|
constructor(t) {
|
|
1589
|
-
|
|
1589
|
+
h(this, "ctx");
|
|
1590
1590
|
const e = t.getContext("2d");
|
|
1591
1591
|
if (!e) throw new Error("canvas context not found");
|
|
1592
1592
|
this.ctx = e;
|
|
@@ -1620,21 +1620,21 @@ class ni {
|
|
|
1620
1620
|
* @param {string} color - 阴影的颜色
|
|
1621
1621
|
*/
|
|
1622
1622
|
drawShadow(t, e, i, s, r) {
|
|
1623
|
-
const { fillColor: o, side: a, shadowWidth:
|
|
1623
|
+
const { fillColor: o, side: a, shadowWidth: l, colorStart: c, colorEnd: d } = r;
|
|
1624
1624
|
this.ctx.save(), o && (this.ctx.fillStyle = o, this.ctx.fillRect(t, e, i, s));
|
|
1625
1625
|
let f;
|
|
1626
1626
|
switch (a) {
|
|
1627
1627
|
case "left":
|
|
1628
|
-
f = this.ctx.createLinearGradient(t -
|
|
1628
|
+
f = this.ctx.createLinearGradient(t - l, e, t, e), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t - l, e, l, s);
|
|
1629
1629
|
break;
|
|
1630
1630
|
case "right":
|
|
1631
|
-
f = this.ctx.createLinearGradient(t + i, e, t + i +
|
|
1631
|
+
f = this.ctx.createLinearGradient(t + i, e, t + i + l, e), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t + i, e, l, s);
|
|
1632
1632
|
break;
|
|
1633
1633
|
case "top":
|
|
1634
|
-
f = this.ctx.createLinearGradient(t, e -
|
|
1634
|
+
f = this.ctx.createLinearGradient(t, e - l, t, e), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e - l, i, l);
|
|
1635
1635
|
break;
|
|
1636
1636
|
case "bottom":
|
|
1637
|
-
f = this.ctx.createLinearGradient(t, e + s, t, e + s +
|
|
1637
|
+
f = this.ctx.createLinearGradient(t, e + s, t, e + s + l), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e + s, i, l);
|
|
1638
1638
|
break;
|
|
1639
1639
|
default:
|
|
1640
1640
|
console.error("Invalid side specified for shadow");
|
|
@@ -1655,11 +1655,11 @@ class ni {
|
|
|
1655
1655
|
drawImage(t, e, i, s, r) {
|
|
1656
1656
|
this.ctx.save(), this.ctx.drawImage(t, e, i, s, r), this.ctx.restore();
|
|
1657
1657
|
}
|
|
1658
|
-
drawRect(t, e, i, s, { borderWidth: r = 1, borderColor: o, fillColor: a, radius:
|
|
1659
|
-
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),
|
|
1658
|
+
drawRect(t, e, i, s, { borderWidth: r = 1, borderColor: o, fillColor: a, radius: l = 0 } = {}) {
|
|
1659
|
+
if (this.ctx.save(), this.ctx.beginPath(), a !== void 0 && (this.ctx.fillStyle = a), o !== void 0 && (this.ctx.lineWidth = r, this.ctx.strokeStyle = o), l === 0)
|
|
1660
1660
|
this.ctx.rect(t - 0.5, e - 0.5, i, s);
|
|
1661
1661
|
else {
|
|
1662
|
-
const [c, d, f, x] = typeof
|
|
1662
|
+
const [c, d, f, x] = typeof l == "number" ? [l, l, l, l] : l;
|
|
1663
1663
|
this.ctx.moveTo(t + c, e), this.ctx.arcTo(t + i, e, t + i, e + d, d), this.ctx.arcTo(t + i, e + s, t + i - f, e + s, f), this.ctx.arcTo(t, e + s, t, e + s - x, x), this.ctx.arcTo(t, e, t + c, e, c);
|
|
1664
1664
|
}
|
|
1665
1665
|
a !== void 0 && this.ctx.fill(), o !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
@@ -1678,16 +1678,16 @@ class ni {
|
|
|
1678
1678
|
this.ctx.save();
|
|
1679
1679
|
const {
|
|
1680
1680
|
font: a = "12px Arial",
|
|
1681
|
-
align:
|
|
1681
|
+
align: l = "center",
|
|
1682
1682
|
color: c = "#495060",
|
|
1683
1683
|
padding: d = 0,
|
|
1684
1684
|
verticalAlign: f = "middle"
|
|
1685
1685
|
} = o;
|
|
1686
|
-
this.ctx.font = a, this.ctx.fillStyle = c, this.ctx.textBaseline = f, this.ctx.textAlign =
|
|
1686
|
+
this.ctx.font = a, this.ctx.fillStyle = c, this.ctx.textBaseline = f, this.ctx.textAlign = l;
|
|
1687
1687
|
let x = 0;
|
|
1688
1688
|
f === "top" ? x = i + d : f === "bottom" ? x = i + r - d : x = i + (r + 1) / 2;
|
|
1689
1689
|
let u = 0;
|
|
1690
|
-
|
|
1690
|
+
l === "left" ? u = e + d : l === "right" ? u = e + s - d : u = e + s / 2;
|
|
1691
1691
|
const { _text: g, ellipsis: w } = this.handleEllipsis(t, s, d, a);
|
|
1692
1692
|
return this.ctx.fillText(g, u, x), this.ctx.restore(), w;
|
|
1693
1693
|
}
|
|
@@ -1698,8 +1698,8 @@ class ni {
|
|
|
1698
1698
|
_text: "",
|
|
1699
1699
|
ellipsis: r
|
|
1700
1700
|
};
|
|
1701
|
-
const a = this.ctx.measureText("...").width,
|
|
1702
|
-
if (
|
|
1701
|
+
const a = this.ctx.measureText("...").width, l = this.ctx.measureText(t).width;
|
|
1702
|
+
if (l && l + a >= e - i * 2) {
|
|
1703
1703
|
r = !0;
|
|
1704
1704
|
let c = 0;
|
|
1705
1705
|
for (let d = 0; d < t.length; d++)
|
|
@@ -1716,133 +1716,134 @@ class ni {
|
|
|
1716
1716
|
}
|
|
1717
1717
|
class Wt {
|
|
1718
1718
|
constructor(t) {
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1719
|
+
h(this, "CSS_PREFIX", "e-virt-table");
|
|
1720
|
+
h(this, "ICONS", []);
|
|
1721
|
+
h(this, "ROW_KEY", "");
|
|
1722
|
+
h(this, "DISABLED", !1);
|
|
1723
1723
|
//禁用编辑,优先等级最高
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1724
|
+
h(this, "HEADER_FONT", "12px normal Arial");
|
|
1725
|
+
h(this, "BODY_FONT", "12px normal Arial");
|
|
1726
|
+
h(this, "BORDER_COLOR", "#e1e6eb");
|
|
1727
|
+
h(this, "WIDTH", 0);
|
|
1728
|
+
h(this, "RESIZE_MIN_WIDTH", 40);
|
|
1729
|
+
h(this, "HEIGHT", 0);
|
|
1730
|
+
h(this, "EMPTY_BODY_HEIGHT", 120);
|
|
1731
|
+
h(this, "EMPTY_CUSTOM_STYLE", {});
|
|
1732
|
+
h(this, "EMPTY_TEXT", "暂无数据");
|
|
1733
|
+
h(this, "MAX_HEIGHT", 1e3);
|
|
1734
|
+
h(this, "BORDER_RADIUS", 8);
|
|
1735
|
+
h(this, "ENABLE_OFFSET_HEIGHT", !1);
|
|
1736
|
+
h(this, "OFFSET_HEIGHT", 0);
|
|
1737
|
+
h(this, "HEADER_HEIGHT", 36);
|
|
1738
|
+
h(this, "ENABLE_HEADER_STICKY", !1);
|
|
1739
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
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1740
|
+
h(this, "HEADER_BG_COLOR", "#F8FAFF");
|
|
1741
|
+
h(this, "BODY_BG_COLOR", "#FFF");
|
|
1742
|
+
h(this, "HEADER_TEXT_COLOR", "#1D2129");
|
|
1743
|
+
h(this, "LOADING_ICON_SVG", "");
|
|
1744
|
+
h(this, "LOADING_ICON_COLOR", "#4E5969");
|
|
1745
|
+
h(this, "EXPAND_ICON_SVG", "");
|
|
1746
|
+
h(this, "SHRINK_ICON_SVG", "");
|
|
1747
|
+
h(this, "EXPAND_ICON_COLOR", "#4E5969");
|
|
1748
|
+
h(this, "SHRINK_ICON_COLOR", "#4E5969");
|
|
1749
|
+
h(this, "ERROR_TIP_ICON_COLOR", "red");
|
|
1750
|
+
h(this, "ERROR_TIP_ICON_SIZE", 6);
|
|
1751
|
+
h(this, "EXPAND_LAZY", !0);
|
|
1752
|
+
h(this, "DEFAULT_EXPAND_ALL", !1);
|
|
1753
|
+
h(this, "CELL_WIDTH", 100);
|
|
1754
|
+
h(this, "CELL_HEIGHT", 36);
|
|
1755
|
+
h(this, "CELL_PADDING", 8);
|
|
1756
|
+
h(this, "CELL_HOVER_ICON_SIZE", 20);
|
|
1757
|
+
h(this, "SCROLLER_TRACK_SIZE", 14);
|
|
1758
|
+
h(this, "SCROLLER_SIZE", 8);
|
|
1759
|
+
h(this, "SCROLLER_COLOR", "#dee0e3");
|
|
1760
|
+
h(this, "SCROLLER_TRACK_COLOR", "#fff");
|
|
1761
|
+
h(this, "SCROLLER_FOCUS_COLOR", "#bbbec4");
|
|
1762
|
+
h(this, "SELECT_BORDER_COLOR", "rgb(82,146,247)");
|
|
1763
|
+
h(this, "SELECT_AREA_COLOR", "rgba(82,146,247,0.1)");
|
|
1764
|
+
h(this, "SELECT_BG_COLOR", "rgba(82,146,247,0.1)");
|
|
1765
|
+
h(this, "AUTOFILL_POINT_BORDER_COLOR", "#fff");
|
|
1766
|
+
h(this, "EDIT_BG_COLOR", "#fcf6ed");
|
|
1767
|
+
h(this, "CHECKBOX_KEY", "");
|
|
1768
|
+
h(this, "CHECKBOX_COLOR", "rgb(82,146,247)");
|
|
1769
|
+
h(this, "CHECKBOX_SIZE", 20);
|
|
1770
|
+
h(this, "CHECKBOX_DISABLED_SVG", "");
|
|
1771
|
+
h(this, "CHECKBOX_CHECK_SVG", "");
|
|
1772
|
+
h(this, "CHECKBOX_UNCHECK_SVG", "");
|
|
1773
|
+
h(this, "CHECKBOX_INDETERMINATE_SVG", "");
|
|
1774
|
+
h(this, "READONLY_COLOR", "#fff");
|
|
1775
|
+
h(this, "READONLY_TEXT_COLOR", "#4E5969");
|
|
1776
|
+
h(this, "ERROR_TIP_COLOR", "#ED3F14");
|
|
1777
|
+
h(this, "FOOTER_BG_COLOR", "#fafafa");
|
|
1778
|
+
h(this, "FOOTER_FIXED", !0);
|
|
1779
|
+
h(this, "FOOTER_POSITION", "bottom");
|
|
1780
|
+
h(this, "CELL_FOOTER_HEIGHT", 36);
|
|
1781
|
+
h(this, "ENABLE_SELECTOR", !1);
|
|
1782
|
+
h(this, "ENABLE_EDIT_SINGLE_CLICK", !1);
|
|
1782
1783
|
// 启用单点击立马编辑
|
|
1783
|
-
|
|
1784
|
+
h(this, "ENABLE_EDIT_CLICK_SELECTOR", !0);
|
|
1784
1785
|
// 启用点击选择器编辑
|
|
1785
|
-
|
|
1786
|
+
h(this, "SELECTOR_AREA_MIN_X", 0);
|
|
1786
1787
|
// 选择器X最小范围
|
|
1787
|
-
|
|
1788
|
+
h(this, "SELECTOR_AREA_MAX_X_OFFSET", 0);
|
|
1788
1789
|
// 选择器X最大范围colMax - offset
|
|
1789
|
-
|
|
1790
|
+
h(this, "SELECTOR_AREA_MAX_X", 0);
|
|
1790
1791
|
// 选择器X最大范围,0默认最大colMax
|
|
1791
|
-
|
|
1792
|
+
h(this, "SELECTOR_AREA_MIN_Y", 0);
|
|
1792
1793
|
// 选择器Y最小范围
|
|
1793
|
-
|
|
1794
|
+
h(this, "SELECTOR_AREA_MAX_Y", 0);
|
|
1794
1795
|
// 选择器Y最大范围,0默认rowMax
|
|
1795
|
-
|
|
1796
|
+
h(this, "SELECTOR_AREA_MAX_Y_OFFSET", 0);
|
|
1796
1797
|
// 选择器Y最大范围,0默认rowMax
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1798
|
+
h(this, "ENABLE_SELECTOR_SINGLE", !1);
|
|
1799
|
+
h(this, "ENABLE_SELECTOR_SPAN_COL", !0);
|
|
1800
|
+
h(this, "ENABLE_SELECTOR_SPAN_ROW", !0);
|
|
1801
|
+
h(this, "ENABLE_SELECTOR_ALL_ROWS", !0);
|
|
1802
|
+
h(this, "ENABLE_SELECTOR_ALL_COLS", !0);
|
|
1803
|
+
h(this, "ENABLE_AUTOFILL", !1);
|
|
1804
|
+
h(this, "ENABLE_CONTEXT_MENU", !1);
|
|
1805
|
+
h(this, "ENABLE_COPY", !0);
|
|
1806
|
+
h(this, "ENABLE_PASTER", !0);
|
|
1807
|
+
h(this, "ENABLE_RESIZE_ROW", !0);
|
|
1808
|
+
h(this, "ENABLE_RESIZE_COLUMN", !0);
|
|
1809
|
+
h(this, "RESIZE_ROW_LINE_COLOR", "#e1e6eb");
|
|
1810
|
+
h(this, "RESIZE_COLUMN_LINE_COLOR", "#e1e6eb");
|
|
1811
|
+
h(this, "RESIZE_ROW_MIN_HEIGHT", 36);
|
|
1812
|
+
h(this, "RESIZE_COLUMN_MIN_WIDTH", 40);
|
|
1813
|
+
h(this, "ENABLE_KEYBOARD", !0);
|
|
1814
|
+
h(this, "ENABLE_HISTORY", !1);
|
|
1815
|
+
h(this, "ENABLE_VALIDATOR_IMMEDIATE", !0);
|
|
1816
|
+
h(this, "HISTORY_NUM", 50);
|
|
1817
|
+
h(this, "HIGHLIGHT_HOVER_ROW", !1);
|
|
1818
|
+
h(this, "HIGHLIGHT_HOVER_ROW_COLOR", "rgba(186,203,231,0.1)");
|
|
1819
|
+
h(this, "HIGHLIGHT_SELECTED_ROW", !1);
|
|
1820
|
+
h(this, "HIGHLIGHT_SELECTED_ROW_COLOR", "rgba(82,146,247,0.1)");
|
|
1821
|
+
h(this, "TOOLTIP_BG_COLOR", "#303133");
|
|
1822
|
+
h(this, "TOOLTIP_TEXT_COLOR", "#fff");
|
|
1823
|
+
h(this, "TOOLTIP_ZINDEX", 3e3);
|
|
1824
|
+
h(this, "TOOLTIP_CUSTOM_STYLE", {});
|
|
1825
|
+
h(this, "CONTEXT_MENU", [
|
|
1825
1826
|
{ label: "复制", value: "copy" },
|
|
1826
1827
|
{ label: "剪切", value: "cut" },
|
|
1827
1828
|
{ label: "粘贴", value: "paste" },
|
|
1828
1829
|
{ label: "清空选中内容", value: "clearSelected" }
|
|
1829
1830
|
]);
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1831
|
+
h(this, "HEADER_CELL_STYLE_METHOD");
|
|
1832
|
+
h(this, "BODY_CELL_STYLE_METHOD");
|
|
1833
|
+
h(this, "FOOTER_CELL_STYLE_METHOD");
|
|
1834
|
+
h(this, "BODY_CELL_READONLY_METHOD");
|
|
1835
|
+
h(this, "BODY_CELL_FORMATTER_METHOD");
|
|
1836
|
+
h(this, "BODY_CELL_RULES_METHOD");
|
|
1837
|
+
h(this, "BODY_CELL_TYPE_METHOD");
|
|
1838
|
+
h(this, "BODY_CELL_EDITOR_METHOD");
|
|
1839
|
+
h(this, "BODY_CELL_RENDER_METHOD");
|
|
1840
|
+
h(this, "BODY_CELL_HOVER_ICON_METHOD");
|
|
1841
|
+
h(this, "SPAN_METHOD");
|
|
1842
|
+
h(this, "SELECTABLE_METHOD");
|
|
1843
|
+
h(this, "EXPAND_LAZY_METHOD");
|
|
1844
|
+
h(this, "BEFORE_VALUE_CHANGE_METHOD");
|
|
1845
|
+
h(this, "BEFORE_PASTE_CHANGE_METHOD");
|
|
1846
|
+
h(this, "BEFORE_AUTOFILL_CHANGE_METHOD");
|
|
1846
1847
|
Object.assign(this, t);
|
|
1847
1848
|
}
|
|
1848
1849
|
init(t) {
|
|
@@ -1851,8 +1852,8 @@ class Wt {
|
|
|
1851
1852
|
}
|
|
1852
1853
|
class ai {
|
|
1853
1854
|
constructor(t) {
|
|
1854
|
-
|
|
1855
|
-
|
|
1855
|
+
h(this, "ctx");
|
|
1856
|
+
h(this, "list", [
|
|
1856
1857
|
{
|
|
1857
1858
|
name: "loading",
|
|
1858
1859
|
configName: "LOADING_ICON_SVG",
|
|
@@ -1914,7 +1915,7 @@ class ai {
|
|
|
1914
1915
|
color: ""
|
|
1915
1916
|
}
|
|
1916
1917
|
]);
|
|
1917
|
-
|
|
1918
|
+
h(this, "icons", /* @__PURE__ */ new Map());
|
|
1918
1919
|
this.ctx = t, this.init();
|
|
1919
1920
|
}
|
|
1920
1921
|
async init() {
|
|
@@ -1948,8 +1949,8 @@ class ai {
|
|
|
1948
1949
|
});
|
|
1949
1950
|
const o = new Image(), a = new Blob([new XMLSerializer().serializeToString(r)], {
|
|
1950
1951
|
type: "image/svg+xml"
|
|
1951
|
-
}),
|
|
1952
|
-
return o.src =
|
|
1952
|
+
}), l = URL.createObjectURL(a);
|
|
1953
|
+
return o.src = l, new Promise((c, d) => {
|
|
1953
1954
|
o.onerror = () => d(new Error("Failed to load image")), o.onload = () => {
|
|
1954
1955
|
c(o);
|
|
1955
1956
|
};
|
|
@@ -1961,13 +1962,13 @@ class ai {
|
|
|
1961
1962
|
}
|
|
1962
1963
|
class te {
|
|
1963
1964
|
constructor(t, e, i, s, r, o, a) {
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1965
|
+
h(this, "ctx");
|
|
1966
|
+
h(this, "x", 0);
|
|
1967
|
+
h(this, "y", 0);
|
|
1968
|
+
h(this, "width", 0);
|
|
1969
|
+
h(this, "height", 0);
|
|
1970
|
+
h(this, "fixed");
|
|
1971
|
+
h(this, "cellType");
|
|
1971
1972
|
this.ctx = t, this.x = e, this.y = i, this.width = s, this.height = r, this.fixed = a, this.cellType = o;
|
|
1972
1973
|
}
|
|
1973
1974
|
isHorizontalVisible() {
|
|
@@ -2006,58 +2007,58 @@ class te {
|
|
|
2006
2007
|
}
|
|
2007
2008
|
}
|
|
2008
2009
|
class ee extends te {
|
|
2009
|
-
constructor(e, i, s, r, o, a,
|
|
2010
|
-
super(e, r, o, a,
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2010
|
+
constructor(e, i, s, r, o, a, l, c, d, f = "body") {
|
|
2011
|
+
super(e, r, o, a, l, f, c.fixed);
|
|
2012
|
+
h(this, "formatter");
|
|
2013
|
+
h(this, "formatterFooter");
|
|
2014
|
+
h(this, "hoverIconName", "");
|
|
2015
|
+
h(this, "operation", !1);
|
|
2016
|
+
h(this, "align");
|
|
2017
|
+
h(this, "verticalAlign");
|
|
2018
|
+
h(this, "fixed");
|
|
2019
|
+
h(this, "type");
|
|
2020
|
+
h(this, "editorType");
|
|
2021
|
+
h(this, "editorProps");
|
|
2022
|
+
h(this, "cellType");
|
|
2023
|
+
h(this, "level");
|
|
2024
|
+
h(this, "colspan", 1);
|
|
2025
|
+
h(this, "rowspan", 1);
|
|
2026
|
+
h(this, "key");
|
|
2027
|
+
h(this, "column");
|
|
2028
|
+
h(this, "rowIndex");
|
|
2029
|
+
h(this, "colIndex");
|
|
2030
|
+
h(this, "rowKey");
|
|
2031
|
+
h(this, "row");
|
|
2032
|
+
h(this, "value");
|
|
2033
|
+
h(this, "render");
|
|
2034
|
+
h(this, "renderFooter");
|
|
2035
|
+
h(this, "style", {});
|
|
2036
|
+
h(this, "rules", []);
|
|
2037
|
+
h(this, "message", "");
|
|
2038
|
+
h(this, "text", "");
|
|
2039
|
+
h(this, "displayText", "");
|
|
2040
|
+
h(this, "visibleWidth", 0);
|
|
2041
|
+
h(this, "visibleHeight", 0);
|
|
2042
|
+
h(this, "isHasChanged", !1);
|
|
2043
|
+
h(this, "drawX", 0);
|
|
2044
|
+
h(this, "drawY", 0);
|
|
2045
|
+
h(this, "drawCellBgColor", "");
|
|
2046
|
+
h(this, "drawCellSkyBgColor", "");
|
|
2047
|
+
h(this, "drawTextColor", "");
|
|
2048
|
+
h(this, "drawTextX", 0);
|
|
2049
|
+
h(this, "drawTextY", 0);
|
|
2050
|
+
h(this, "drawImageX", 0);
|
|
2051
|
+
h(this, "drawImageY", 0);
|
|
2052
|
+
h(this, "drawImageWidth", 0);
|
|
2053
|
+
h(this, "drawImageHeight", 0);
|
|
2054
|
+
h(this, "drawImageName", "");
|
|
2055
|
+
h(this, "drawImageSource");
|
|
2056
|
+
h(this, "ellipsis", !1);
|
|
2057
|
+
h(this, "rowExpand", !1);
|
|
2058
|
+
h(this, "rowHasChildren", !1);
|
|
2059
|
+
h(this, "overflowTooltipShow", !0);
|
|
2060
|
+
h(this, "overflowTooltipMaxWidth", 500);
|
|
2061
|
+
h(this, "overflowTooltipPlacement", "top");
|
|
2061
2062
|
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.editorProps = c.editorProps || {}, this.cellType = f, 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 = d, 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();
|
|
2062
2063
|
}
|
|
2063
2064
|
getValidationMessage() {
|
|
@@ -2155,7 +2156,7 @@ class ee extends te {
|
|
|
2155
2156
|
const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
|
|
2156
2157
|
let r, o = 0, a = "";
|
|
2157
2158
|
if (this.type === "tree" && s === "body") {
|
|
2158
|
-
const
|
|
2159
|
+
const l = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: d = !1, expandLoading: f = !1, level: x = 0 } = l || {};
|
|
2159
2160
|
if (this.rowExpand = c, this.rowHasChildren = d, f) {
|
|
2160
2161
|
const w = this.ctx.icons.get("loading");
|
|
2161
2162
|
a = "loading", r = w, o = x * 8;
|
|
@@ -2180,7 +2181,7 @@ class ee extends te {
|
|
|
2180
2181
|
FOOTER_CELL_STYLE_METHOD: r,
|
|
2181
2182
|
READONLY_TEXT_COLOR: o,
|
|
2182
2183
|
FOOTER_BG_COLOR: a,
|
|
2183
|
-
HIGHLIGHT_SELECTED_ROW:
|
|
2184
|
+
HIGHLIGHT_SELECTED_ROW: l,
|
|
2184
2185
|
HIGHLIGHT_SELECTED_ROW_COLOR: c,
|
|
2185
2186
|
HIGHLIGHT_HOVER_ROW: d,
|
|
2186
2187
|
HIGHLIGHT_HOVER_ROW_COLOR: f
|
|
@@ -2202,7 +2203,7 @@ class ee extends te {
|
|
|
2202
2203
|
}
|
|
2203
2204
|
let x = "transparent";
|
|
2204
2205
|
const u = this.ctx.focusCell, g = this.ctx.hoverCell;
|
|
2205
|
-
d && (g == null ? void 0 : g.rowKey) === this.rowKey && (x = f),
|
|
2206
|
+
d && (g == null ? void 0 : g.rowKey) === this.rowKey && (x = f), l && (u == null ? void 0 : u.rowKey) === this.rowKey && (x = c), this.drawCellSkyBgColor = x;
|
|
2206
2207
|
let w = e, p = o;
|
|
2207
2208
|
if (["index", "index-selection", "selection"].includes(this.type)) {
|
|
2208
2209
|
this.drawCellBgColor = e, this.drawTextColor = o;
|
|
@@ -2222,24 +2223,24 @@ class ee extends te {
|
|
|
2222
2223
|
this.drawCellBgColor = w, this.drawTextColor = p;
|
|
2223
2224
|
}
|
|
2224
2225
|
updateSelection() {
|
|
2225
|
-
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: a, rowIndex:
|
|
2226
|
+
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: a, rowIndex: l, rowKey: c } = this;
|
|
2226
2227
|
if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(a)) {
|
|
2227
2228
|
const d = this.ctx.database.getRowSelection(c), f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: x = 0 } = this.ctx.config, u = this.drawX + (e - x) / 2, g = this.drawY + (i - x) / 2;
|
|
2228
2229
|
let w = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck";
|
|
2229
|
-
d && f ? (w = this.ctx.icons.get("checkbox-check"), p = "checkbox-check") : d && f ? (w = this.ctx.icons.get("checkbox-check-disabled"), p = "checkbox-check-disabled") : !d && f ? (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 ===
|
|
2230
|
+
d && f ? (w = this.ctx.icons.get("checkbox-check"), p = "checkbox-check") : d && f ? (w = this.ctx.icons.get("checkbox-check-disabled"), p = "checkbox-check-disabled") : !d && f ? (w = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), p = "checkbox-disabled"), w && a == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(p)) && (this.drawImageX = u, this.drawImageY = g, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = p, this.drawImageSource = w) : w && a === "selection" && (this.drawImageX = u, this.drawImageY = g, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = p, this.drawImageSource = w);
|
|
2230
2231
|
}
|
|
2231
2232
|
}
|
|
2232
2233
|
updateHoverIcon() {
|
|
2233
2234
|
const { BODY_CELL_HOVER_ICON_METHOD: e, CELL_HOVER_ICON_SIZE: i, CELL_PADDING: s } = this.ctx.config;
|
|
2234
2235
|
if (typeof e == "function") {
|
|
2235
|
-
const
|
|
2236
|
+
const l = e({
|
|
2236
2237
|
row: this.row,
|
|
2237
2238
|
rowIndex: this.rowIndex,
|
|
2238
2239
|
colIndex: this.colIndex,
|
|
2239
2240
|
column: this.column,
|
|
2240
2241
|
value: this.getValue()
|
|
2241
2242
|
});
|
|
2242
|
-
|
|
2243
|
+
l !== void 0 && (this.hoverIconName = l);
|
|
2243
2244
|
}
|
|
2244
2245
|
const r = this.drawX + this.width - i - s, o = this.drawY + (this.height - i) / 2;
|
|
2245
2246
|
if (this.hoverIconName && this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === this.rowIndex) {
|
|
@@ -2363,8 +2364,8 @@ class ee extends te {
|
|
|
2363
2364
|
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: r } = this.ctx.config;
|
|
2364
2365
|
if (!s || !i)
|
|
2365
2366
|
return;
|
|
2366
|
-
const { xArr: o, yArr: a } = this.ctx.selector,
|
|
2367
|
-
d ===
|
|
2367
|
+
const { xArr: o, yArr: a } = this.ctx.selector, l = o[1], c = a[1], { colIndex: d, rowIndex: f, drawX: x, drawY: u } = this;
|
|
2368
|
+
d === l && f === c && this.ctx.paint.drawRect(x + this.width - 6, u + this.height - 6, 6, 6, {
|
|
2368
2369
|
borderColor: r,
|
|
2369
2370
|
fillColor: e
|
|
2370
2371
|
});
|
|
@@ -2419,31 +2420,31 @@ class ee extends te {
|
|
|
2419
2420
|
}
|
|
2420
2421
|
drawBorder(e) {
|
|
2421
2422
|
const { drawX: i, drawY: s, width: r, rowIndex: o, colIndex: a } = this;
|
|
2422
|
-
let
|
|
2423
|
-
o === 0 && (c = this.y + 1, d = d - 1), a === this.ctx.maxColIndex && (
|
|
2423
|
+
let l = i + 0.5, c = s + 0.5, d = this.height;
|
|
2424
|
+
o === 0 && (c = this.y + 1, d = d - 1), a === this.ctx.maxColIndex && (l = l - 1);
|
|
2424
2425
|
const { xArr: f, yArr: x, lineDash: u = [], borderWidth: g = 1, borderColor: w, fillColor: p } = e, y = f[0], b = f[1], m = x[0], E = x[1];
|
|
2425
|
-
a >= y && a <= b && o === m && this.ctx.paint.drawLine([
|
|
2426
|
+
a >= y && a <= b && o === m && this.ctx.paint.drawLine([l, c, l + r - 2, c], {
|
|
2426
2427
|
borderColor: w,
|
|
2427
2428
|
fillColor: p,
|
|
2428
2429
|
borderWidth: g,
|
|
2429
2430
|
lineCap: "round",
|
|
2430
2431
|
lineJoin: "round",
|
|
2431
2432
|
lineDash: u
|
|
2432
|
-
}), a >= y && a <= b && o === E && this.ctx.paint.drawLine([
|
|
2433
|
+
}), a >= y && a <= b && o === E && this.ctx.paint.drawLine([l, c + d - 1.5, l + r, c + d - 1.5], {
|
|
2433
2434
|
borderColor: w,
|
|
2434
2435
|
fillColor: p,
|
|
2435
2436
|
borderWidth: g,
|
|
2436
2437
|
lineCap: "round",
|
|
2437
2438
|
lineJoin: "round",
|
|
2438
2439
|
lineDash: u
|
|
2439
|
-
}), a === y && o >= m && o <= E && this.ctx.paint.drawLine([
|
|
2440
|
+
}), a === y && o >= m && o <= E && this.ctx.paint.drawLine([l, c, l, c + d - 1], {
|
|
2440
2441
|
borderColor: w,
|
|
2441
2442
|
fillColor: p,
|
|
2442
2443
|
borderWidth: g,
|
|
2443
2444
|
lineCap: "round",
|
|
2444
2445
|
lineJoin: "round",
|
|
2445
2446
|
lineDash: u
|
|
2446
|
-
}), a === b && o >= m && o <= E && this.ctx.paint.drawLine([
|
|
2447
|
+
}), a === b && o >= m && o <= E && this.ctx.paint.drawLine([l + r - 1.5, c, l + r - 1.5, c + d - 1.5], {
|
|
2447
2448
|
borderColor: w,
|
|
2448
2449
|
fillColor: p,
|
|
2449
2450
|
borderWidth: g,
|
|
@@ -2454,43 +2455,43 @@ class ee extends te {
|
|
|
2454
2455
|
}
|
|
2455
2456
|
}
|
|
2456
2457
|
class ie extends te {
|
|
2457
|
-
constructor(e, i, s, r, o, a,
|
|
2458
|
-
super(e, s, r, o, a, "header",
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = a, this.colIndex = i, this.key =
|
|
2458
|
+
constructor(e, i, s, r, o, a, l) {
|
|
2459
|
+
super(e, s, r, o, a, "header", l.fixed);
|
|
2460
|
+
h(this, "align");
|
|
2461
|
+
h(this, "verticalAlign", "middle");
|
|
2462
|
+
h(this, "fixed");
|
|
2463
|
+
h(this, "widthFillDisable");
|
|
2464
|
+
h(this, "type");
|
|
2465
|
+
h(this, "operation", !1);
|
|
2466
|
+
h(this, "editorType");
|
|
2467
|
+
h(this, "level");
|
|
2468
|
+
h(this, "text");
|
|
2469
|
+
h(this, "displayText", "");
|
|
2470
|
+
h(this, "colspan");
|
|
2471
|
+
h(this, "rowspan");
|
|
2472
|
+
h(this, "row");
|
|
2473
|
+
h(this, "key");
|
|
2474
|
+
h(this, "required", !1);
|
|
2475
|
+
h(this, "readonly", !1);
|
|
2476
|
+
h(this, "children", []);
|
|
2477
|
+
h(this, "column");
|
|
2478
|
+
h(this, "colIndex");
|
|
2479
|
+
h(this, "rowKey");
|
|
2480
|
+
h(this, "rules");
|
|
2481
|
+
h(this, "hasChildren");
|
|
2482
|
+
h(this, "render");
|
|
2483
|
+
h(this, "style", {});
|
|
2484
|
+
h(this, "drawX", 0);
|
|
2485
|
+
h(this, "drawY", 0);
|
|
2486
|
+
h(this, "drawCellBgColor", "");
|
|
2487
|
+
h(this, "drawTextColor", "");
|
|
2488
|
+
h(this, "drawImageX", 0);
|
|
2489
|
+
h(this, "drawImageY", 0);
|
|
2490
|
+
h(this, "drawImageWidth", 0);
|
|
2491
|
+
h(this, "drawImageHeight", 0);
|
|
2492
|
+
h(this, "drawImageName", "");
|
|
2493
|
+
h(this, "drawImageSource");
|
|
2494
|
+
this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = a, this.colIndex = i, this.key = l.key, this.type = l.type || "", this.editorType = l.editorType || "text", this.align = l.align || "center", this.verticalAlign = l.verticalAlign || "middle", this.fixed = l.fixed, this.level = l.level || 0, this.operation = l.operation || !1, this.text = l.title, this.column = l, this.colspan = l.colspan || 1, this.widthFillDisable = l.widthFillDisable || !1, this.rowspan = l.rowspan || 1, this.rules = l.rules, this.readonly = l.readonly || !1, this.required = l.required || !1, this.rowKey = Ut(), this.hasChildren = l.children && l.children.length > 0 || !1, this.render = l.renderHeader;
|
|
2494
2495
|
}
|
|
2495
2496
|
/**
|
|
2496
2497
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -2510,11 +2511,11 @@ class ie extends te {
|
|
|
2510
2511
|
const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
|
|
2511
2512
|
let r = i, o = s;
|
|
2512
2513
|
if (typeof e == "function") {
|
|
2513
|
-
const a = e, { backgroundColor:
|
|
2514
|
+
const a = e, { backgroundColor: l, color: c } = a({
|
|
2514
2515
|
colIndex: this.colIndex,
|
|
2515
2516
|
column: this.column
|
|
2516
2517
|
}) || {};
|
|
2517
|
-
|
|
2518
|
+
l && (r = l), c && (o = c);
|
|
2518
2519
|
}
|
|
2519
2520
|
this.drawCellBgColor = r, this.drawTextColor = o;
|
|
2520
2521
|
}
|
|
@@ -2525,11 +2526,11 @@ class ie extends te {
|
|
|
2525
2526
|
const {
|
|
2526
2527
|
paint: e,
|
|
2527
2528
|
config: { BORDER_COLOR: i, CELL_PADDING: s, HEADER_FONT: r }
|
|
2528
|
-
} = this.ctx, { drawX: o, drawY: a, displayText:
|
|
2529
|
+
} = this.ctx, { drawX: o, drawY: a, displayText: l } = this;
|
|
2529
2530
|
e.drawRect(o, a, this.width, this.height, {
|
|
2530
2531
|
borderColor: i,
|
|
2531
2532
|
fillColor: this.drawCellBgColor
|
|
2532
|
-
}), e.drawText(
|
|
2533
|
+
}), e.drawText(l, o, a, this.width, this.height, {
|
|
2533
2534
|
font: r,
|
|
2534
2535
|
padding: s,
|
|
2535
2536
|
color: this.drawTextColor,
|
|
@@ -2540,9 +2541,9 @@ class ie extends te {
|
|
|
2540
2541
|
drawSelection() {
|
|
2541
2542
|
const { width: e, height: i, type: s } = this;
|
|
2542
2543
|
if (["index-selection", "selection"].includes(s)) {
|
|
2543
|
-
const { indeterminate: r, check: o, selectable: a } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE:
|
|
2544
|
+
const { indeterminate: r, check: o, selectable: a } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: l = 0 } = this.ctx.config, c = this.drawX + (e - l) / 2, d = this.drawY + (i - l) / 2;
|
|
2544
2545
|
let f = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck";
|
|
2545
|
-
r ? (f = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : o && a ? (f = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : o && a ? (f = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !o && a ? (f = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (f = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), f && (this.drawImageX = c, this.drawImageY = d, this.drawImageWidth =
|
|
2546
|
+
r ? (f = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : o && a ? (f = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : o && a ? (f = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !o && a ? (f = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (f = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), f && (this.drawImageX = c, this.drawImageY = d, this.drawImageWidth = l, this.drawImageHeight = l, this.drawImageName = x, this.drawImageSource = f, this.ctx.paint.drawImage(
|
|
2546
2547
|
this.drawImageSource,
|
|
2547
2548
|
this.drawImageX,
|
|
2548
2549
|
this.drawImageY,
|
|
@@ -2571,11 +2572,11 @@ class ie extends te {
|
|
|
2571
2572
|
};
|
|
2572
2573
|
}
|
|
2573
2574
|
}
|
|
2574
|
-
class
|
|
2575
|
+
class hi {
|
|
2575
2576
|
constructor(t) {
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2577
|
+
h(this, "ctx");
|
|
2578
|
+
h(this, "visibleHoverCell");
|
|
2579
|
+
h(this, "resizeObserver");
|
|
2579
2580
|
this.ctx = t, this.init();
|
|
2580
2581
|
}
|
|
2581
2582
|
init() {
|
|
@@ -2665,10 +2666,10 @@ class li {
|
|
|
2665
2666
|
colIndex: t.colIndex,
|
|
2666
2667
|
column: t.column,
|
|
2667
2668
|
value: t.getValue()
|
|
2668
|
-
}).then((
|
|
2669
|
-
this.ctx.database.setExpandChildren(t.rowKey,
|
|
2670
|
-
}).catch((
|
|
2671
|
-
this.ctx.database.expandLoading(t.rowKey, !1), console.error(
|
|
2669
|
+
}).then((l) => {
|
|
2670
|
+
this.ctx.database.setExpandChildren(t.rowKey, l), this.ctx.database.expandLoading(t.rowKey, !1), this.ctx.emit("expandChange", this.ctx.database.getExpandRowKeys());
|
|
2671
|
+
}).catch((l) => {
|
|
2672
|
+
this.ctx.database.expandLoading(t.rowKey, !1), console.error(l);
|
|
2672
2673
|
}));
|
|
2673
2674
|
else {
|
|
2674
2675
|
const a = this.ctx.database.getIsExpand(t.rowKey);
|
|
@@ -2695,15 +2696,15 @@ class li {
|
|
|
2695
2696
|
handleBodyEvent(t, e, i, s, r = !1) {
|
|
2696
2697
|
for (const o of i) {
|
|
2697
2698
|
const a = o.fixedCells.concat(o.noFixedCells);
|
|
2698
|
-
for (const
|
|
2699
|
-
const c =
|
|
2699
|
+
for (const l of a) {
|
|
2700
|
+
const c = l.getDrawX(), d = l.getDrawY();
|
|
2700
2701
|
if (r) {
|
|
2701
|
-
if (t > c && t < c +
|
|
2702
|
-
s(
|
|
2702
|
+
if (t > c && t < c + l.visibleWidth && e > d && e < d + l.visibleHeight) {
|
|
2703
|
+
s(l);
|
|
2703
2704
|
return;
|
|
2704
2705
|
}
|
|
2705
|
-
} else if (t > c && t < c +
|
|
2706
|
-
s(
|
|
2706
|
+
} else if (t > c && t < c + l.width && e > d && e < d + l.height) {
|
|
2707
|
+
s(l);
|
|
2707
2708
|
return;
|
|
2708
2709
|
}
|
|
2709
2710
|
}
|
|
@@ -2722,57 +2723,57 @@ class li {
|
|
|
2722
2723
|
this.resizeObserver.unobserve(this.ctx.stageElement);
|
|
2723
2724
|
}
|
|
2724
2725
|
}
|
|
2725
|
-
class
|
|
2726
|
+
class li {
|
|
2726
2727
|
constructor(t, e) {
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2728
|
+
h(this, "eventBus");
|
|
2729
|
+
h(this, "eventBrowser");
|
|
2730
|
+
h(this, "eventTable");
|
|
2731
|
+
h(this, "containerElement");
|
|
2732
|
+
h(this, "stageElement");
|
|
2733
|
+
h(this, "canvasElement");
|
|
2734
|
+
h(this, "overlayerElement");
|
|
2735
|
+
h(this, "editorElement");
|
|
2736
|
+
h(this, "emptyElement");
|
|
2737
|
+
h(this, "contextMenuElement");
|
|
2738
|
+
h(this, "stageWidth", 0);
|
|
2739
|
+
h(this, "stageHeight", 0);
|
|
2740
|
+
h(this, "paint");
|
|
2741
|
+
h(this, "icons");
|
|
2742
|
+
h(this, "isInsideTargetContainer", !1);
|
|
2743
|
+
h(this, "mousedown", !1);
|
|
2744
|
+
h(this, "isPointer", !1);
|
|
2745
|
+
h(this, "rowResizing", !1);
|
|
2745
2746
|
// 行调整大小中
|
|
2746
|
-
|
|
2747
|
+
h(this, "columnResizing", !1);
|
|
2747
2748
|
// 列调整大小中
|
|
2748
|
-
|
|
2749
|
+
h(this, "scrollerMove", !1);
|
|
2749
2750
|
// 滚动条移动中
|
|
2750
|
-
|
|
2751
|
+
h(this, "scrollerFocus", !1);
|
|
2751
2752
|
// 滚动条focus中
|
|
2752
|
-
|
|
2753
|
+
h(this, "autofillMove", !1);
|
|
2753
2754
|
// 自动填充移动中
|
|
2754
|
-
|
|
2755
|
+
h(this, "selectorMove", !1);
|
|
2755
2756
|
// 选择器移动中
|
|
2756
|
-
|
|
2757
|
+
h(this, "selectOnlyOne", !1);
|
|
2757
2758
|
// 只选择一个单元格
|
|
2758
|
-
|
|
2759
|
+
h(this, "adjustPositioning", !1);
|
|
2759
2760
|
// 调整位置中
|
|
2760
|
-
|
|
2761
|
+
h(this, "editing", !1);
|
|
2761
2762
|
// 编辑中
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2763
|
+
h(this, "scrollY", 0);
|
|
2764
|
+
h(this, "scrollX", 0);
|
|
2765
|
+
h(this, "fixedLeftWidth", 0);
|
|
2766
|
+
h(this, "fixedRightWidth", 0);
|
|
2767
|
+
h(this, "maxColIndex", 0);
|
|
2768
|
+
h(this, "maxRowIndex", 0);
|
|
2769
|
+
h(this, "hoverRow");
|
|
2770
|
+
h(this, "clickCell");
|
|
2771
|
+
h(this, "focusCell");
|
|
2772
|
+
h(this, "hoverCell");
|
|
2773
|
+
h(this, "clickCellHeader");
|
|
2774
|
+
h(this, "focusCellHeader");
|
|
2775
|
+
h(this, "hoverCellHeader");
|
|
2776
|
+
h(this, "body", {
|
|
2776
2777
|
x: 0,
|
|
2777
2778
|
y: 0,
|
|
2778
2779
|
width: 0,
|
|
@@ -2785,7 +2786,7 @@ class hi {
|
|
|
2785
2786
|
renderRows: [],
|
|
2786
2787
|
data: []
|
|
2787
2788
|
});
|
|
2788
|
-
|
|
2789
|
+
h(this, "footer", {
|
|
2789
2790
|
x: 0,
|
|
2790
2791
|
y: 0,
|
|
2791
2792
|
width: 0,
|
|
@@ -2794,7 +2795,7 @@ class hi {
|
|
|
2794
2795
|
visibleWidth: 0,
|
|
2795
2796
|
renderRows: []
|
|
2796
2797
|
});
|
|
2797
|
-
|
|
2798
|
+
h(this, "header", {
|
|
2798
2799
|
x: 0,
|
|
2799
2800
|
y: 0,
|
|
2800
2801
|
width: 0,
|
|
@@ -2809,31 +2810,31 @@ class hi {
|
|
|
2809
2810
|
fixedRightCellHeaders: [],
|
|
2810
2811
|
renderCenterCellHeaders: []
|
|
2811
2812
|
});
|
|
2812
|
-
|
|
2813
|
+
h(this, "selector", {
|
|
2813
2814
|
enable: !1,
|
|
2814
2815
|
xArr: [-1, -1],
|
|
2815
2816
|
yArr: [-1, -1],
|
|
2816
2817
|
xArrCopy: [-1, -1],
|
|
2817
2818
|
yArrCopy: [-1, -1]
|
|
2818
2819
|
});
|
|
2819
|
-
|
|
2820
|
+
h(this, "autofill", {
|
|
2820
2821
|
enable: !1,
|
|
2821
2822
|
xArr: [-1, -1],
|
|
2822
2823
|
yArr: [-1, -1]
|
|
2823
2824
|
});
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2825
|
+
h(this, "database");
|
|
2826
|
+
h(this, "history");
|
|
2827
|
+
h(this, "config");
|
|
2827
2828
|
const {
|
|
2828
2829
|
containerElement: i,
|
|
2829
2830
|
stageElement: s,
|
|
2830
2831
|
canvasElement: r,
|
|
2831
2832
|
overlayerElement: o,
|
|
2832
2833
|
editorElement: a,
|
|
2833
|
-
emptyElement:
|
|
2834
|
+
emptyElement: l,
|
|
2834
2835
|
contextMenuElement: c
|
|
2835
2836
|
} = t;
|
|
2836
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = a, this.emptyElement =
|
|
2837
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = a, this.emptyElement = l, this.contextMenuElement = c, this.config = new Wt(e.config || {}), this.eventBus = new oi(), this.eventBrowser = new ri(this), this.eventTable = new hi(this), this.paint = new ni(this.canvasElement), this.database = new ii(this, e), this.history = new si(this), this.icons = new ai(this);
|
|
2837
2838
|
}
|
|
2838
2839
|
setConfig(t) {
|
|
2839
2840
|
this.config = new Wt(t);
|
|
@@ -2868,7 +2869,7 @@ class hi {
|
|
|
2868
2869
|
for (let r = 0; r <= e[1] - e[0]; r++) {
|
|
2869
2870
|
const o = [];
|
|
2870
2871
|
for (let a = 0; a <= i[1] - i[0]; a++) {
|
|
2871
|
-
const
|
|
2872
|
+
const l = r + e[0], c = a + i[0], d = this.database.getItemValueForRowIndexAndColIndex(l, c);
|
|
2872
2873
|
d && o.push(d.value);
|
|
2873
2874
|
}
|
|
2874
2875
|
s += `${o.join(" ")}\r`, t.push(o);
|
|
@@ -2884,9 +2885,8 @@ class hi {
|
|
|
2884
2885
|
let i = Math.floor(t);
|
|
2885
2886
|
const s = this.body.width - this.body.visibleWidth;
|
|
2886
2887
|
i < 0 ? i = 0 : i > s && (i = s);
|
|
2887
|
-
let r = Math.floor(e);
|
|
2888
|
-
|
|
2889
|
-
r < 0 ? r = 0 : r > o && (r = o), this.emit("setScroll", i, r);
|
|
2888
|
+
let r = Math.floor(e), o = this.body.height - this.body.visibleHeight;
|
|
2889
|
+
this.config.FOOTER_FIXED || (o = this.body.height + this.footer.height - this.body.visibleHeight), r < 0 ? r = 0 : r > o && (r = o), this.emit("setScroll", i, r);
|
|
2890
2890
|
}
|
|
2891
2891
|
setScrollX(t) {
|
|
2892
2892
|
let e = Math.floor(t);
|
|
@@ -2930,29 +2930,29 @@ class hi {
|
|
|
2930
2930
|
}
|
|
2931
2931
|
class Pt {
|
|
2932
2932
|
constructor(t, e) {
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2933
|
+
h(this, "ctx");
|
|
2934
|
+
h(this, "type");
|
|
2935
|
+
h(this, "isFocus", !1);
|
|
2936
|
+
h(this, "trackX", 0);
|
|
2937
|
+
h(this, "trackY", 0);
|
|
2938
|
+
h(this, "trackWidth", 0);
|
|
2939
|
+
h(this, "trackHeight", 0);
|
|
2940
|
+
h(this, "splitPoints", []);
|
|
2941
2941
|
//分割线
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2942
|
+
h(this, "barX", 0);
|
|
2943
|
+
h(this, "barY", 0);
|
|
2944
|
+
h(this, "barWidth", 0);
|
|
2945
|
+
h(this, "barHeight", 0);
|
|
2946
|
+
h(this, "distance", 0);
|
|
2947
2947
|
// 滚动条的长度
|
|
2948
|
-
|
|
2948
|
+
h(this, "visibleDistance", 0);
|
|
2949
2949
|
//可见区域的长度
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2950
|
+
h(this, "clientX", 0);
|
|
2951
|
+
h(this, "clientY", 0);
|
|
2952
|
+
h(this, "dragStart", 0);
|
|
2953
2953
|
// 拖拽开始的位置
|
|
2954
|
-
|
|
2955
|
-
|
|
2954
|
+
h(this, "isDragging", !1);
|
|
2955
|
+
h(this, "scroll", 0);
|
|
2956
2956
|
this.ctx = t, this.type = e, this.type === "vertical" ? this.scroll = this.ctx.scrollY : this.scroll = this.ctx.scrollX;
|
|
2957
2957
|
}
|
|
2958
2958
|
onWheel(t) {
|
|
@@ -3008,19 +3008,19 @@ class Pt {
|
|
|
3008
3008
|
stageHeight: i,
|
|
3009
3009
|
stageWidth: s,
|
|
3010
3010
|
config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0 }
|
|
3011
|
-
} = this.ctx, a = s,
|
|
3011
|
+
} = this.ctx, a = s, l = i, c = e.height, d = e.width, f = t.height, x = this.ctx.footer.height;
|
|
3012
3012
|
if (this.type === "vertical") {
|
|
3013
|
-
this.visibleDistance =
|
|
3013
|
+
this.visibleDistance = l - r - c, this.distance = f - this.visibleDistance + x, this.trackX = a - r, this.trackY = 0, this.splitPoints = [this.trackX, c, this.trackX + r, c], this.trackWidth = r, this.trackHeight = l, this.barX = this.trackX - 0.5 + (r - o) / 2, this.barWidth = o;
|
|
3014
3014
|
const u = this.distance ? this.visibleDistance / (f + x) : 0;
|
|
3015
3015
|
let g = Math.floor(u * this.visibleDistance);
|
|
3016
3016
|
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));
|
|
3017
3017
|
} else {
|
|
3018
3018
|
this.visibleDistance = a - r, this.distance = d - this.visibleDistance, this.splitPoints = [
|
|
3019
3019
|
a - r,
|
|
3020
|
-
|
|
3020
|
+
l - r,
|
|
3021
3021
|
a - r,
|
|
3022
|
-
|
|
3023
|
-
], this.trackX = 0, this.trackY =
|
|
3022
|
+
l
|
|
3023
|
+
], this.trackX = 0, this.trackY = l - r, this.trackWidth = a, this.trackHeight = r;
|
|
3024
3024
|
const u = this.distance ? this.visibleDistance / d : 0;
|
|
3025
3025
|
let g = Math.floor(u * this.visibleDistance);
|
|
3026
3026
|
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));
|
|
@@ -3044,9 +3044,9 @@ class Pt {
|
|
|
3044
3044
|
}
|
|
3045
3045
|
class ci {
|
|
3046
3046
|
constructor(t) {
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3047
|
+
h(this, "ctx");
|
|
3048
|
+
h(this, "verticalScrollbar");
|
|
3049
|
+
h(this, "horizontalScrollbar");
|
|
3050
3050
|
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) => {
|
|
3051
3051
|
this.setScroll(e, i);
|
|
3052
3052
|
}), this.ctx.on("setScrollX", (e) => {
|
|
@@ -3100,41 +3100,41 @@ class ci {
|
|
|
3100
3100
|
}
|
|
3101
3101
|
class di {
|
|
3102
3102
|
constructor(t) {
|
|
3103
|
-
|
|
3103
|
+
h(this, "ctx");
|
|
3104
3104
|
// 上下文
|
|
3105
|
-
|
|
3105
|
+
h(this, "x", 0);
|
|
3106
3106
|
// x坐标
|
|
3107
|
-
|
|
3107
|
+
h(this, "y", 0);
|
|
3108
3108
|
// y坐标
|
|
3109
|
-
|
|
3109
|
+
h(this, "width", 0);
|
|
3110
3110
|
// 宽度
|
|
3111
|
-
|
|
3111
|
+
h(this, "height", 0);
|
|
3112
3112
|
// 高度
|
|
3113
|
-
|
|
3113
|
+
h(this, "resizeTarget", null);
|
|
3114
3114
|
//调整表头
|
|
3115
|
-
|
|
3115
|
+
h(this, "resizeNum", 0);
|
|
3116
3116
|
// 调整列的数量
|
|
3117
|
-
|
|
3117
|
+
h(this, "isResizing", !1);
|
|
3118
3118
|
// 是否移动中
|
|
3119
|
-
|
|
3119
|
+
h(this, "clientX", 0);
|
|
3120
3120
|
// 鼠标按下时的x轴位置
|
|
3121
|
-
|
|
3121
|
+
h(this, "resizeDiff", 0);
|
|
3122
3122
|
// 是否移动中
|
|
3123
|
-
|
|
3124
|
-
|
|
3123
|
+
h(this, "columnIndex", 0);
|
|
3124
|
+
h(this, "isMouseDown", !1);
|
|
3125
3125
|
// 是否按下
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3126
|
+
h(this, "columns");
|
|
3127
|
+
h(this, "visibleLeafColumns", []);
|
|
3128
|
+
h(this, "visibleHeight", 0);
|
|
3129
|
+
h(this, "visibleWidth", 0);
|
|
3130
|
+
h(this, "allCellHeaders", []);
|
|
3131
|
+
h(this, "leafCellHeaders", []);
|
|
3132
|
+
h(this, "renderLeafCellHeaders", []);
|
|
3133
|
+
h(this, "fixedLeftCellHeaders", []);
|
|
3134
|
+
h(this, "centerCellHeaders", []);
|
|
3135
|
+
h(this, "fixedRightCellHeaders", []);
|
|
3136
|
+
h(this, "renderCenterCellHeaders", []);
|
|
3137
|
+
h(this, "renderFixedCellHeaders", []);
|
|
3138
3138
|
this.ctx = t, this.ctx.on(
|
|
3139
3139
|
"resetHeader",
|
|
3140
3140
|
Zt(() => {
|
|
@@ -3153,9 +3153,9 @@ class di {
|
|
|
3153
3153
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3154
3154
|
const a = this.ctx.containerElement.getBoundingClientRect();
|
|
3155
3155
|
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;
|
|
3156
|
-
const
|
|
3157
|
-
if (this.resizeNum &&
|
|
3158
|
-
const f = Math.floor(
|
|
3156
|
+
const l = this.visibleWidth - this.width;
|
|
3157
|
+
if (this.resizeNum && l > 0) {
|
|
3158
|
+
const f = Math.floor(l / this.resizeNum * 100) / 100;
|
|
3159
3159
|
this.resizeAllColumn(f);
|
|
3160
3160
|
}
|
|
3161
3161
|
const c = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
@@ -3188,9 +3188,9 @@ class di {
|
|
|
3188
3188
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3189
3189
|
const r = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
3190
3190
|
for (const o of r) {
|
|
3191
|
-
const { offsetX: a, offsetY:
|
|
3191
|
+
const { offsetX: a, offsetY: l } = this.ctx.getOffset(e), c = a, d = o.getDrawX();
|
|
3192
3192
|
c > d + o.width - 5 && c < d + o.width + 4 && c < i - 4 && // 视窗中最后一列不允许调整宽
|
|
3193
|
-
o.colspan <= 1 && this.ctx.isTarget() &&
|
|
3193
|
+
o.colspan <= 1 && this.ctx.isTarget() && l <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = o);
|
|
3194
3194
|
}
|
|
3195
3195
|
}
|
|
3196
3196
|
}));
|
|
@@ -3244,10 +3244,10 @@ class di {
|
|
|
3244
3244
|
let s = e;
|
|
3245
3245
|
const { HEADER_HEIGHT: r = 0 } = this.ctx.config;
|
|
3246
3246
|
for (let o = 0; o < i; o++) {
|
|
3247
|
-
const a = t[o],
|
|
3247
|
+
const a = t[o], l = r * (a.rowspan || 0), c = r * (a.level || 0);
|
|
3248
3248
|
let d = a.width || 100;
|
|
3249
3249
|
a.children && (d = _t(a.children).reduce((u, g) => u + ((g == null ? void 0 : g.width) || 100), 0));
|
|
3250
|
-
const f = new ie(this.ctx, this.columnIndex, s, c, d,
|
|
3250
|
+
const f = new ie(this.ctx, this.columnIndex, s, c, d, l, a);
|
|
3251
3251
|
this.ctx.database.setHeader(a.key, f), this.allCellHeaders.push(f), a.children || (this.leafCellHeaders.push(f), f.column.widthFillDisable || this.resizeNum++), a.fixed === "left" ? this.fixedLeftCellHeaders.push(f) : a.fixed === "right" ? this.fixedRightCellHeaders.push(f) : this.centerCellHeaders.push(f), !a.children && this.columnIndex++, a.children && this.render(a.children, s), s += d;
|
|
3252
3252
|
}
|
|
3253
3253
|
}
|
|
@@ -3279,8 +3279,8 @@ class di {
|
|
|
3279
3279
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3280
3280
|
colorEnd: "rgba(0,0,0,0)"
|
|
3281
3281
|
}), i < Math.floor(s.width - r - 1) && e !== a) {
|
|
3282
|
-
const
|
|
3283
|
-
this.ctx.paint.drawShadow(
|
|
3282
|
+
const l = s.width - (this.x + this.width) + r - e;
|
|
3283
|
+
this.ctx.paint.drawShadow(l + 1, this.y, e, this.height, {
|
|
3284
3284
|
fillColor: o,
|
|
3285
3285
|
side: "left",
|
|
3286
3286
|
shadowWidth: 4,
|
|
@@ -3308,20 +3308,20 @@ class di {
|
|
|
3308
3308
|
}
|
|
3309
3309
|
}
|
|
3310
3310
|
class se {
|
|
3311
|
-
constructor(t, e, i = 0, s = 0, r = 0, o = 0, a,
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
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 =
|
|
3311
|
+
constructor(t, e, i = 0, s = 0, r = 0, o = 0, a, l = "body") {
|
|
3312
|
+
h(this, "ctx");
|
|
3313
|
+
h(this, "x", 0);
|
|
3314
|
+
h(this, "y", 0);
|
|
3315
|
+
h(this, "width", 0);
|
|
3316
|
+
h(this, "height");
|
|
3317
|
+
h(this, "cells", []);
|
|
3318
|
+
h(this, "fixedCells", []);
|
|
3319
|
+
h(this, "noFixedCells", []);
|
|
3320
|
+
h(this, "rowIndex", 0);
|
|
3321
|
+
h(this, "rowKey", "");
|
|
3322
|
+
h(this, "rowType", "body");
|
|
3323
|
+
h(this, "data");
|
|
3324
|
+
this.ctx = t, this.x = i, this.y = s, this.width = r, this.height = o, this.rowIndex = e, this.rowKey = t.database.getRowKeyForRowIndex(e) || "", this.rowType = l, this.data = a, this.update();
|
|
3325
3325
|
}
|
|
3326
3326
|
update() {
|
|
3327
3327
|
const { header: t } = this.ctx, e = [], i = [], s = [];
|
|
@@ -3361,77 +3361,79 @@ class se {
|
|
|
3361
3361
|
}
|
|
3362
3362
|
class fi {
|
|
3363
3363
|
constructor(t) {
|
|
3364
|
-
|
|
3364
|
+
h(this, "resizeTarget", null);
|
|
3365
3365
|
//调整行大小的目标
|
|
3366
|
-
|
|
3366
|
+
h(this, "isMouseDown", !1);
|
|
3367
3367
|
// 是否按下
|
|
3368
|
-
|
|
3368
|
+
h(this, "resizeDiff", 0);
|
|
3369
3369
|
// 是否移动中
|
|
3370
|
-
|
|
3370
|
+
h(this, "clientY", 0);
|
|
3371
3371
|
// 鼠标按下时的y轴位置
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3372
|
+
h(this, "ctx");
|
|
3373
|
+
h(this, "x", 0);
|
|
3374
|
+
h(this, "y", 0);
|
|
3375
|
+
h(this, "width", 0);
|
|
3376
|
+
h(this, "height", 0);
|
|
3377
|
+
h(this, "headIndex", 0);
|
|
3378
|
+
h(this, "tailIndex", 0);
|
|
3379
|
+
h(this, "isResizing", !1);
|
|
3380
3380
|
//是否正在调整大小
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3381
|
+
h(this, "renderRows", []);
|
|
3382
|
+
h(this, "visibleRows", []);
|
|
3383
|
+
h(this, "visibleHeight", 0);
|
|
3384
|
+
h(this, "visibleWidth", 0);
|
|
3385
|
+
h(this, "data", []);
|
|
3386
3386
|
this.ctx = t, this.init(), this.initResizeRow();
|
|
3387
3387
|
}
|
|
3388
3388
|
init() {
|
|
3389
3389
|
const {
|
|
3390
3390
|
canvasElement: t,
|
|
3391
3391
|
header: e,
|
|
3392
|
-
|
|
3392
|
+
footer: i,
|
|
3393
|
+
database: s,
|
|
3393
3394
|
config: {
|
|
3394
|
-
FOOTER_FIXED:
|
|
3395
|
-
SCROLLER_TRACK_SIZE:
|
|
3396
|
-
HEIGHT:
|
|
3397
|
-
EMPTY_BODY_HEIGHT:
|
|
3398
|
-
MAX_HEIGHT:
|
|
3399
|
-
ENABLE_OFFSET_HEIGHT:
|
|
3400
|
-
OFFSET_HEIGHT:
|
|
3395
|
+
FOOTER_FIXED: r,
|
|
3396
|
+
SCROLLER_TRACK_SIZE: o = 0,
|
|
3397
|
+
HEIGHT: a,
|
|
3398
|
+
EMPTY_BODY_HEIGHT: l = 0,
|
|
3399
|
+
MAX_HEIGHT: c = 0,
|
|
3400
|
+
ENABLE_OFFSET_HEIGHT: d = 0,
|
|
3401
|
+
OFFSET_HEIGHT: f = 0,
|
|
3402
|
+
FOOTER_POSITION: x
|
|
3401
3403
|
}
|
|
3402
3404
|
} = this.ctx;
|
|
3403
3405
|
if (!e.width)
|
|
3404
3406
|
return;
|
|
3405
|
-
this.x = 0, this.y = e.height;
|
|
3406
|
-
const { data:
|
|
3407
|
-
this.height =
|
|
3408
|
-
const { top:
|
|
3409
|
-
this.width = e.width, this.visibleWidth = this.ctx.stageWidth -
|
|
3410
|
-
const
|
|
3411
|
-
!this.data.length && !
|
|
3412
|
-
const
|
|
3407
|
+
this.x = 0, x === "top" && r ? this.y = e.height + i.height : this.y = e.height;
|
|
3408
|
+
const { data: u, sumHeight: g } = s.getData();
|
|
3409
|
+
this.height = g, this.data = u;
|
|
3410
|
+
const { top: w } = t.getBoundingClientRect();
|
|
3411
|
+
this.width = e.width, this.visibleWidth = this.ctx.stageWidth - o;
|
|
3412
|
+
const p = this.ctx.footer.height;
|
|
3413
|
+
!this.data.length && !a ? this.height = l : !this.data.length && a && (this.height = a - e.height - p - o);
|
|
3414
|
+
const y = this.data.length ? "not-empty" : "empty";
|
|
3413
3415
|
this.ctx.emit("emptyChange", {
|
|
3414
|
-
isEmpty:
|
|
3415
|
-
type:
|
|
3416
|
+
isEmpty: y,
|
|
3417
|
+
type: y,
|
|
3416
3418
|
headerHeight: e.height,
|
|
3417
3419
|
bodyHeight: this.height,
|
|
3418
|
-
footerHeight:
|
|
3420
|
+
footerHeight: p,
|
|
3419
3421
|
width: this.width,
|
|
3420
|
-
height: this.data.length ? 0 :
|
|
3422
|
+
height: this.data.length ? 0 : l + p
|
|
3421
3423
|
});
|
|
3422
|
-
let
|
|
3423
|
-
|
|
3424
|
-
let
|
|
3425
|
-
this.data.length &&
|
|
3424
|
+
let b = this.height + e.height + o;
|
|
3425
|
+
b += p;
|
|
3426
|
+
let m = 0;
|
|
3427
|
+
this.data.length && d ? (m = window.innerHeight - w - f, m < 0 && (m = 32, console.error(
|
|
3426
3428
|
"There is an error in the height calculation ENABLE_OFFSET_HEIGHT and OFFSET_HEIGHT are invalid"
|
|
3427
|
-
))) : this.data.length &&
|
|
3428
|
-
let
|
|
3429
|
-
|
|
3430
|
-
const
|
|
3431
|
-
t.width = Math.floor(
|
|
3429
|
+
))) : this.data.length && a ? m = a : this.data.length && c && b > c ? m = c : m = b, m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
|
|
3430
|
+
let E = this.ctx.stageHeight - e.height - o;
|
|
3431
|
+
r ? this.visibleHeight = E - p : this.visibleHeight = E, 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 = u;
|
|
3432
|
+
const C = window.devicePixelRatio || 1, R = this.ctx.stageWidth * C, O = this.ctx.stageHeight * C;
|
|
3433
|
+
t.width = Math.floor(R), t.height = Math.floor(O), this.ctx.canvasElement.setAttribute(
|
|
3432
3434
|
"style",
|
|
3433
3435
|
` height:${this.ctx.stageHeight}px;width:${this.ctx.stageWidth}px;`
|
|
3434
|
-
), this.ctx.paint.scale(
|
|
3436
|
+
), this.ctx.paint.scale(C);
|
|
3435
3437
|
}
|
|
3436
3438
|
// 调整行的高度
|
|
3437
3439
|
initResizeRow() {
|
|
@@ -3447,7 +3449,7 @@ class fi {
|
|
|
3447
3449
|
}), this.ctx.on("mousemove", (e) => {
|
|
3448
3450
|
if (this.ctx.editing) return;
|
|
3449
3451
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s, a = e.clientY, {
|
|
3450
|
-
stageHeight:
|
|
3452
|
+
stageHeight: l,
|
|
3451
3453
|
scrollY: c,
|
|
3452
3454
|
config: { RESIZE_ROW_MIN_HEIGHT: d = 0 }
|
|
3453
3455
|
} = this.ctx;
|
|
@@ -3461,7 +3463,7 @@ class fi {
|
|
|
3461
3463
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3462
3464
|
for (let f = 0; f < this.renderRows.length; f++) {
|
|
3463
3465
|
const x = this.renderRows[f];
|
|
3464
|
-
if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r <
|
|
3466
|
+
if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r < l - 4)
|
|
3465
3467
|
for (let g = 0; g < x.cells.length; g++) {
|
|
3466
3468
|
const w = x.cells[g];
|
|
3467
3469
|
o > w.drawX + 10 && o < w.drawX + w.width - 10 && w.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = x);
|
|
@@ -3510,8 +3512,8 @@ class fi {
|
|
|
3510
3512
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3511
3513
|
colorEnd: "rgba(0,0,0,0)"
|
|
3512
3514
|
}), i < Math.floor(s.width - r - 1) && e !== a) {
|
|
3513
|
-
const
|
|
3514
|
-
this.ctx.paint.drawShadow(
|
|
3515
|
+
const l = s.width - (this.x + this.width) + r - e;
|
|
3516
|
+
this.ctx.paint.drawShadow(l + 1, this.y, e, this.height, {
|
|
3515
3517
|
fillColor: o,
|
|
3516
3518
|
side: "left",
|
|
3517
3519
|
shadowWidth: 4,
|
|
@@ -3535,8 +3537,8 @@ class fi {
|
|
|
3535
3537
|
const { header: t, database: e, scrollY: i } = this.ctx, s = i, { data: r, positions: o } = e.getData();
|
|
3536
3538
|
this.ctx.maxRowIndex = r.length - 1;
|
|
3537
3539
|
const a = this.binarySearch(o, s);
|
|
3538
|
-
let
|
|
3539
|
-
|
|
3540
|
+
let l = this.binarySearch(o, s + this.visibleHeight);
|
|
3541
|
+
l === -1 && (l = r.length), this.headIndex = Math.max(0, a), this.tailIndex = Math.min(this.ctx.maxRowIndex, l + 1), this.visibleRows = r.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
|
|
3540
3542
|
const c = [];
|
|
3541
3543
|
for (let d = 0; d < this.visibleRows.length; d++) {
|
|
3542
3544
|
const f = this.headIndex + d, x = this.visibleRows[d], { height: u, top: g } = this.ctx.database.getPositionForRowIndex(f), w = new se(this.ctx, f, 0, g + this.y, t.width, u, x);
|
|
@@ -3554,15 +3556,15 @@ class fi {
|
|
|
3554
3556
|
}
|
|
3555
3557
|
class xi {
|
|
3556
3558
|
constructor(t) {
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3559
|
+
h(this, "ctx");
|
|
3560
|
+
h(this, "renderRows", []);
|
|
3561
|
+
h(this, "data", []);
|
|
3562
|
+
h(this, "x", 0);
|
|
3563
|
+
h(this, "y", 0);
|
|
3564
|
+
h(this, "width", 0);
|
|
3565
|
+
h(this, "height", 0);
|
|
3566
|
+
h(this, "visibleWidth", 0);
|
|
3567
|
+
h(this, "visibleHeight", 0);
|
|
3566
3568
|
this.ctx = t, this.init();
|
|
3567
3569
|
}
|
|
3568
3570
|
init() {
|
|
@@ -3570,9 +3572,9 @@ class xi {
|
|
|
3570
3572
|
const {
|
|
3571
3573
|
header: t,
|
|
3572
3574
|
body: e,
|
|
3573
|
-
config: { CELL_FOOTER_HEIGHT: i, FOOTER_FIXED: s, SCROLLER_TRACK_SIZE: r }
|
|
3575
|
+
config: { CELL_FOOTER_HEIGHT: i, FOOTER_FIXED: s, SCROLLER_TRACK_SIZE: r, FOOTER_POSITION: o }
|
|
3574
3576
|
} = this.ctx;
|
|
3575
|
-
this.width = t.width, this.visibleWidth = t.visibleWidth, this.height = this.data.reduce((
|
|
3577
|
+
this.width = t.width, this.visibleWidth = t.visibleWidth, this.height = this.data.reduce((a) => a + i, 0), this.visibleHeight = this.height, s ? o === "top" ? this.y = this.ctx.header.height : this.y = this.ctx.stageHeight - this.height - r : this.y = e.y + e.height, this.ctx.footer.x = this.x, this.ctx.footer.y = this.y, this.ctx.footer.height = this.height, this.ctx.footer.width = this.width, this.ctx.footer.visibleWidth = this.visibleWidth, this.ctx.footer.visibleHeight = this.visibleHeight;
|
|
3576
3578
|
}
|
|
3577
3579
|
drawFiexShadow() {
|
|
3578
3580
|
const {
|
|
@@ -3583,8 +3585,8 @@ class xi {
|
|
|
3583
3585
|
stageWidth: r,
|
|
3584
3586
|
config: { HEADER_BG_COLOR: o, SCROLLER_TRACK_SIZE: a }
|
|
3585
3587
|
} = this.ctx;
|
|
3586
|
-
let
|
|
3587
|
-
if (this.ctx.config.FOOTER_FIXED || (
|
|
3588
|
+
let l = this.y;
|
|
3589
|
+
if (this.ctx.config.FOOTER_FIXED || (l = this.y - this.ctx.scrollY), i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, l, t, this.height, {
|
|
3588
3590
|
fillColor: o,
|
|
3589
3591
|
side: "right",
|
|
3590
3592
|
shadowWidth: 4,
|
|
@@ -3592,7 +3594,7 @@ class xi {
|
|
|
3592
3594
|
colorEnd: "rgba(0,0,0,0)"
|
|
3593
3595
|
}), i < Math.floor(s.width - r - 1) && e !== a) {
|
|
3594
3596
|
const c = s.width - (this.x + this.width) + r - e;
|
|
3595
|
-
this.ctx.paint.drawShadow(c + 1,
|
|
3597
|
+
this.ctx.paint.drawShadow(c + 1, l, e, this.height, {
|
|
3596
3598
|
fillColor: o,
|
|
3597
3599
|
side: "left",
|
|
3598
3600
|
shadowWidth: 4,
|
|
@@ -3607,16 +3609,7 @@ class xi {
|
|
|
3607
3609
|
let e = this.y;
|
|
3608
3610
|
const i = [];
|
|
3609
3611
|
this.data.forEach((s, r) => {
|
|
3610
|
-
const o = new se(
|
|
3611
|
-
this.ctx,
|
|
3612
|
-
r,
|
|
3613
|
-
0,
|
|
3614
|
-
e,
|
|
3615
|
-
this.width,
|
|
3616
|
-
t,
|
|
3617
|
-
s,
|
|
3618
|
-
"footer"
|
|
3619
|
-
);
|
|
3612
|
+
const o = new se(this.ctx, r, 0, e, this.width, t, s, "footer");
|
|
3620
3613
|
e += t, i.push(o);
|
|
3621
3614
|
}), this.renderRows = i, this.ctx.footer.renderRows = this.renderRows;
|
|
3622
3615
|
}
|
|
@@ -3631,15 +3624,15 @@ class xi {
|
|
|
3631
3624
|
class ui {
|
|
3632
3625
|
// 垂直滚动定时器
|
|
3633
3626
|
constructor(t) {
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3627
|
+
h(this, "isCut", !1);
|
|
3628
|
+
h(this, "isMultipleRow", !1);
|
|
3629
|
+
h(this, "mousedownHeader", !1);
|
|
3630
|
+
h(this, "ctx");
|
|
3631
|
+
h(this, "adjustPositionX", "");
|
|
3632
|
+
h(this, "adjustPositionY", "");
|
|
3633
|
+
h(this, "timerX", 0);
|
|
3641
3634
|
// 水平滚动定时器
|
|
3642
|
-
|
|
3635
|
+
h(this, "timerY", 0);
|
|
3643
3636
|
this.ctx = t, this.init();
|
|
3644
3637
|
}
|
|
3645
3638
|
init() {
|
|
@@ -3705,7 +3698,7 @@ class ui {
|
|
|
3705
3698
|
return;
|
|
3706
3699
|
}
|
|
3707
3700
|
if (t.code === "Delete" || t.code === "Backspace") {
|
|
3708
|
-
t.preventDefault()
|
|
3701
|
+
t.preventDefault();
|
|
3709
3702
|
const { xArr: e, yArr: i } = this.ctx.selector;
|
|
3710
3703
|
this.clearSelectedData(e, i);
|
|
3711
3704
|
return;
|
|
@@ -3741,12 +3734,12 @@ class ui {
|
|
|
3741
3734
|
this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0;
|
|
3742
3735
|
const {
|
|
3743
3736
|
SELECTOR_AREA_MIN_X: a,
|
|
3744
|
-
SELECTOR_AREA_MAX_X:
|
|
3737
|
+
SELECTOR_AREA_MAX_X: l,
|
|
3745
3738
|
SELECTOR_AREA_MIN_Y: c,
|
|
3746
3739
|
SELECTOR_AREA_MAX_Y: d,
|
|
3747
3740
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
3748
3741
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
3749
|
-
} = this.ctx.config, u = a, g =
|
|
3742
|
+
} = this.ctx.config, u = a, g = l || this.ctx.maxColIndex - f, w = c, p = d || this.ctx.maxRowIndex - x;
|
|
3750
3743
|
let [y, b] = r, [m, E] = o;
|
|
3751
3744
|
if (y < u || b > g || m < w || E > p)
|
|
3752
3745
|
return;
|
|
@@ -3764,15 +3757,15 @@ class ui {
|
|
|
3764
3757
|
if (this.ctx.mousedown && this.ctx.focusCellHeader) {
|
|
3765
3758
|
const { colIndex: a } = this.ctx.focusCellHeader;
|
|
3766
3759
|
if (this.ctx.clearSelector(), t.colIndex >= a) {
|
|
3767
|
-
const
|
|
3768
|
-
this.setSelector(
|
|
3760
|
+
const l = [a, t.colIndex + t.colspan - 1], c = [r, o];
|
|
3761
|
+
this.setSelector(l, c);
|
|
3769
3762
|
} else {
|
|
3770
|
-
const
|
|
3771
|
-
this.setSelector(
|
|
3763
|
+
const l = [t.colIndex, a], c = [r, o];
|
|
3764
|
+
this.setSelector(l, c);
|
|
3772
3765
|
}
|
|
3773
3766
|
} else {
|
|
3774
|
-
const a = [t.colIndex, t.colIndex + t.colspan - 1],
|
|
3775
|
-
this.setSelector(a,
|
|
3767
|
+
const a = [t.colIndex, t.colIndex + t.colspan - 1], l = [r, o];
|
|
3768
|
+
this.setSelector(a, l);
|
|
3776
3769
|
}
|
|
3777
3770
|
}
|
|
3778
3771
|
selectAll() {
|
|
@@ -3786,8 +3779,8 @@ class ui {
|
|
|
3786
3779
|
SELECTOR_AREA_MIN_Y: r,
|
|
3787
3780
|
SELECTOR_AREA_MAX_Y: o,
|
|
3788
3781
|
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
3789
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
3790
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - a, f = r, x = o || this.ctx.maxRowIndex -
|
|
3782
|
+
SELECTOR_AREA_MAX_Y_OFFSET: l
|
|
3783
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - a, f = r, x = o || this.ctx.maxRowIndex - l, u = [c, d], g = [f, x];
|
|
3791
3784
|
this.setSelector(u, g);
|
|
3792
3785
|
}
|
|
3793
3786
|
}
|
|
@@ -3797,16 +3790,16 @@ class ui {
|
|
|
3797
3790
|
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;
|
|
3798
3791
|
if (e) {
|
|
3799
3792
|
this.ctx.setFocusCell(t);
|
|
3800
|
-
const
|
|
3801
|
-
this.setSelector(
|
|
3793
|
+
const l = [a, o], c = [t.rowIndex, t.rowIndex];
|
|
3794
|
+
this.setSelector(l, c);
|
|
3802
3795
|
}
|
|
3803
3796
|
if (this.ctx.focusCell && this.ctx.mousedown) {
|
|
3804
|
-
const { rowIndex:
|
|
3805
|
-
if (t.rowIndex >=
|
|
3806
|
-
const c = [a, o], d = [
|
|
3797
|
+
const { rowIndex: l } = this.ctx.focusCell;
|
|
3798
|
+
if (t.rowIndex >= l) {
|
|
3799
|
+
const c = [a, o], d = [l, t.rowIndex];
|
|
3807
3800
|
this.setSelector(c, d);
|
|
3808
3801
|
} else {
|
|
3809
|
-
const c = [a, o], d = [t.rowIndex,
|
|
3802
|
+
const c = [a, o], d = [t.rowIndex, l];
|
|
3810
3803
|
this.setSelector(c, d);
|
|
3811
3804
|
}
|
|
3812
3805
|
}
|
|
@@ -3816,7 +3809,7 @@ class ui {
|
|
|
3816
3809
|
return;
|
|
3817
3810
|
const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
|
|
3818
3811
|
if (t && e && i) {
|
|
3819
|
-
const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), a = Math.max(i.colIndex, r),
|
|
3812
|
+
const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), a = Math.max(i.colIndex, r), l = Math.min(i.rowIndex, s), c = Math.max(i.rowIndex, s), d = [o, a], f = [l, c];
|
|
3820
3813
|
this.setSelector(d, f);
|
|
3821
3814
|
}
|
|
3822
3815
|
}
|
|
@@ -3824,7 +3817,7 @@ class ui {
|
|
|
3824
3817
|
const { focusCell: e, clickCell: i } = this.ctx;
|
|
3825
3818
|
if (e && this.isInSettingRange(e.rowIndex, e.colIndex))
|
|
3826
3819
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
3827
|
-
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: a } = e,
|
|
3820
|
+
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: a } = e, l = Math.min(o, s), c = Math.max(o, s), d = Math.min(a, r), f = Math.max(a, r), x = [l, c], u = [d, f];
|
|
3828
3821
|
this.setSelector(x, u);
|
|
3829
3822
|
} else {
|
|
3830
3823
|
this.ctx.emit("cellSelectedClick", e);
|
|
@@ -3865,8 +3858,8 @@ class ui {
|
|
|
3865
3858
|
let s = [];
|
|
3866
3859
|
const r = /* @__PURE__ */ new Set();
|
|
3867
3860
|
for (let a = 0; a <= e[1] - e[0]; a++)
|
|
3868
|
-
for (let
|
|
3869
|
-
const c = a + e[0], d =
|
|
3861
|
+
for (let l = 0; l <= t[1] - t[0]; l++) {
|
|
3862
|
+
const c = a + e[0], d = l + t[0], f = this.ctx.database.getItemValueForRowIndexAndColIndex(c, d);
|
|
3870
3863
|
if (f) {
|
|
3871
3864
|
const { rowKey: x, key: u } = f;
|
|
3872
3865
|
this.ctx.database.getReadonly(x, u) || (r.add(x), s.push({
|
|
@@ -3897,10 +3890,7 @@ class ui {
|
|
|
3897
3890
|
if (this.ctx.selector.enable && t) {
|
|
3898
3891
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
3899
3892
|
navigator.clipboard.readText().then(async (r) => {
|
|
3900
|
-
|
|
3901
|
-
let o = ti(r);
|
|
3902
|
-
console.log(o);
|
|
3903
|
-
let a = [];
|
|
3893
|
+
let o = ti(r), a = [];
|
|
3904
3894
|
for (let d = 0; d <= o.length - 1; d++) {
|
|
3905
3895
|
const f = o[d].length;
|
|
3906
3896
|
for (let x = 0; x <= f - 1; x++) {
|
|
@@ -3933,9 +3923,9 @@ class ui {
|
|
|
3933
3923
|
}
|
|
3934
3924
|
if (!a.length)
|
|
3935
3925
|
return;
|
|
3936
|
-
const { BEFORE_PASTE_CHANGE_METHOD:
|
|
3937
|
-
if (typeof
|
|
3938
|
-
const d =
|
|
3926
|
+
const { BEFORE_PASTE_CHANGE_METHOD: l } = this.ctx.config;
|
|
3927
|
+
if (typeof l == "function") {
|
|
3928
|
+
const d = l, f = a.map((x) => ({
|
|
3939
3929
|
rowKey: x.rowKey,
|
|
3940
3930
|
key: x.key,
|
|
3941
3931
|
value: x.value,
|
|
@@ -3964,7 +3954,7 @@ class ui {
|
|
|
3964
3954
|
if (!e)
|
|
3965
3955
|
return;
|
|
3966
3956
|
let { colIndex: i = 0, rowIndex: s = 0 } = e;
|
|
3967
|
-
const r = 0, o = 0, a = this.ctx.maxColIndex,
|
|
3957
|
+
const r = 0, o = 0, a = this.ctx.maxColIndex, l = this.ctx.maxRowIndex;
|
|
3968
3958
|
switch (t) {
|
|
3969
3959
|
case "LEFT":
|
|
3970
3960
|
i > r && i--;
|
|
@@ -3976,7 +3966,7 @@ class ui {
|
|
|
3976
3966
|
i < a && i++;
|
|
3977
3967
|
break;
|
|
3978
3968
|
case "BOTTOM":
|
|
3979
|
-
s <
|
|
3969
|
+
s < l && s++;
|
|
3980
3970
|
break;
|
|
3981
3971
|
}
|
|
3982
3972
|
const c = [i, i], d = [s, s], f = this.getCell(s, i);
|
|
@@ -3993,8 +3983,8 @@ class ui {
|
|
|
3993
3983
|
SELECTOR_AREA_MIN_Y: r,
|
|
3994
3984
|
SELECTOR_AREA_MAX_Y: o,
|
|
3995
3985
|
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
3996
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
3997
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - a, f = r, x = o || this.ctx.maxRowIndex -
|
|
3986
|
+
SELECTOR_AREA_MAX_Y_OFFSET: l
|
|
3987
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - a, f = r, x = o || this.ctx.maxRowIndex - l;
|
|
3998
3988
|
return !(e < c || e > d || t < f || t > x);
|
|
3999
3989
|
}
|
|
4000
3990
|
/**
|
|
@@ -4008,7 +3998,7 @@ class ui {
|
|
|
4008
3998
|
let a = 10 * (s === "left" ? -1 : 1);
|
|
4009
3999
|
this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
|
|
4010
4000
|
a *= 1.5;
|
|
4011
|
-
const { scrollX:
|
|
4001
|
+
const { scrollX: l } = this.ctx, c = l + a;
|
|
4012
4002
|
(c < 0 || c > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(c);
|
|
4013
4003
|
}, 100);
|
|
4014
4004
|
}
|
|
@@ -4017,7 +4007,7 @@ class ui {
|
|
|
4017
4007
|
let a = 10 * (r === "top" ? -1 : 1);
|
|
4018
4008
|
this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
|
|
4019
4009
|
a *= 1.5;
|
|
4020
|
-
const { scrollY:
|
|
4010
|
+
const { scrollY: l } = this.ctx, c = l + a;
|
|
4021
4011
|
(c < 0 || c > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(c);
|
|
4022
4012
|
}, 100);
|
|
4023
4013
|
}
|
|
@@ -4034,21 +4024,21 @@ class ui {
|
|
|
4034
4024
|
fixedLeftWidth: r,
|
|
4035
4025
|
header: o,
|
|
4036
4026
|
footer: a,
|
|
4037
|
-
body:
|
|
4027
|
+
body: l,
|
|
4038
4028
|
scrollX: c,
|
|
4039
4029
|
scrollY: d,
|
|
4040
|
-
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: x }
|
|
4030
|
+
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: x, FOOTER_POSITION: u }
|
|
4041
4031
|
} = this.ctx;
|
|
4042
4032
|
if (!i)
|
|
4043
4033
|
return;
|
|
4044
|
-
const
|
|
4045
|
-
let p = i.height;
|
|
4046
|
-
|
|
4047
|
-
let
|
|
4048
|
-
x && (
|
|
4049
|
-
const
|
|
4050
|
-
let
|
|
4051
|
-
|
|
4034
|
+
const g = r - i.drawX + 1, w = i.drawX + i.width - (e - s) + 1;
|
|
4035
|
+
let p = o.height - i.drawY, y = i.height;
|
|
4036
|
+
y > l.visibleHeight && (y = l.visibleHeight);
|
|
4037
|
+
let b = 0;
|
|
4038
|
+
x && (u === "top" ? p = o.height + a.height - i.drawY : b = a.visibleHeight);
|
|
4039
|
+
const m = i.drawY + y - (t - b - f);
|
|
4040
|
+
let E = c, C = d;
|
|
4041
|
+
w > 0 && !i.fixed ? E = Math.floor(c + w) : g > 0 && !i.fixed && (E = Math.floor(c - g)), p > 0 ? C = Math.floor(d - p) : m > 0 && (C = Math.floor(d + m)), (Math.abs(c - E) > 2 || Math.abs(d - C) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(E, C), this.ctx.emit("adjustBoundaryPosition", i));
|
|
4052
4042
|
}
|
|
4053
4043
|
destroy() {
|
|
4054
4044
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
@@ -4056,14 +4046,14 @@ class ui {
|
|
|
4056
4046
|
}
|
|
4057
4047
|
class gi {
|
|
4058
4048
|
constructor(t) {
|
|
4059
|
-
|
|
4049
|
+
h(this, "ctx");
|
|
4060
4050
|
this.ctx = t, this.init();
|
|
4061
4051
|
}
|
|
4062
4052
|
init() {
|
|
4063
4053
|
this.ctx.on("cellMouseenter", (t, e) => {
|
|
4064
4054
|
this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default");
|
|
4065
|
-
const { offsetX: i, offsetY: s } = this.ctx.getOffset(e), { xArr: r, yArr: o } = this.ctx.selector, a = r[1],
|
|
4066
|
-
if (this.ctx.config.ENABLE_AUTOFILL && c === a && d ===
|
|
4055
|
+
const { offsetX: i, offsetY: s } = this.ctx.getOffset(e), { xArr: r, yArr: o } = this.ctx.selector, a = r[1], l = o[1], { colIndex: c, rowIndex: d, drawX: f, drawY: x, width: u, height: g } = t;
|
|
4056
|
+
if (this.ctx.config.ENABLE_AUTOFILL && c === a && d === l) {
|
|
4067
4057
|
const p = f + u - 6, y = x + g - 6;
|
|
4068
4058
|
i > p && s > y && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4069
4059
|
}
|
|
@@ -4096,22 +4086,22 @@ class gi {
|
|
|
4096
4086
|
return;
|
|
4097
4087
|
let o = t, a = e;
|
|
4098
4088
|
if (!r) {
|
|
4099
|
-
const [
|
|
4100
|
-
a = [
|
|
4089
|
+
const [l] = a;
|
|
4090
|
+
a = [l, l];
|
|
4101
4091
|
}
|
|
4102
4092
|
if (!s) {
|
|
4103
|
-
const [
|
|
4104
|
-
o = [
|
|
4093
|
+
const [l] = o;
|
|
4094
|
+
o = [l, l];
|
|
4105
4095
|
}
|
|
4106
4096
|
if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(o) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(a)) {
|
|
4107
4097
|
const {
|
|
4108
|
-
SELECTOR_AREA_MIN_X:
|
|
4098
|
+
SELECTOR_AREA_MIN_X: l,
|
|
4109
4099
|
SELECTOR_AREA_MAX_X: c,
|
|
4110
4100
|
SELECTOR_AREA_MIN_Y: d,
|
|
4111
4101
|
SELECTOR_AREA_MAX_Y: f,
|
|
4112
4102
|
SELECTOR_AREA_MAX_X_OFFSET: x,
|
|
4113
4103
|
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
4114
|
-
} = this.ctx.config, g =
|
|
4104
|
+
} = this.ctx.config, g = l, w = c || this.ctx.maxColIndex - x, p = d, y = f || this.ctx.maxRowIndex - u;
|
|
4115
4105
|
let [b, m] = o, [E, C] = a;
|
|
4116
4106
|
if (b < g || E < p)
|
|
4117
4107
|
return;
|
|
@@ -4128,11 +4118,11 @@ class gi {
|
|
|
4128
4118
|
const g = x + e.yArr[0], w = u + e.xArr[0];
|
|
4129
4119
|
i.set(`${g}-${w}`, !0);
|
|
4130
4120
|
}
|
|
4131
|
-
const { value: s } = e, r = s[0].length, o = s.length, a = this.ctx.autofill.xArr,
|
|
4121
|
+
const { value: s } = e, r = s[0].length, o = s.length, a = this.ctx.autofill.xArr, l = this.ctx.autofill.yArr;
|
|
4132
4122
|
let c = [];
|
|
4133
|
-
for (let x = 0; x <=
|
|
4123
|
+
for (let x = 0; x <= l[1] - l[0]; x++)
|
|
4134
4124
|
for (let u = 0; u <= a[1] - a[0]; u++) {
|
|
4135
|
-
const g = u + a[0], w = x +
|
|
4125
|
+
const g = u + a[0], w = x + l[0], p = s[x % o][u % r], y = this.ctx.database.getItemValueForRowIndexAndColIndex(w, g), b = `${w}-${g}`;
|
|
4136
4126
|
if (y && !i.has(b)) {
|
|
4137
4127
|
const { rowKey: m, key: E } = y;
|
|
4138
4128
|
this.ctx.database.getReadonly(m, E) || (t.add(m), c.push({
|
|
@@ -4186,7 +4176,7 @@ const rt = Math.min, U = Math.max, ft = Math.round, V = (n) => ({
|
|
|
4186
4176
|
start: "end",
|
|
4187
4177
|
end: "start"
|
|
4188
4178
|
};
|
|
4189
|
-
function
|
|
4179
|
+
function Ot(n, t, e) {
|
|
4190
4180
|
return U(n, rt(t, e));
|
|
4191
4181
|
}
|
|
4192
4182
|
function at(n, t) {
|
|
@@ -4195,7 +4185,7 @@ function at(n, t) {
|
|
|
4195
4185
|
function q(n) {
|
|
4196
4186
|
return n.split("-")[0];
|
|
4197
4187
|
}
|
|
4198
|
-
function
|
|
4188
|
+
function ht(n) {
|
|
4199
4189
|
return n.split("-")[1];
|
|
4200
4190
|
}
|
|
4201
4191
|
function re(n) {
|
|
@@ -4212,15 +4202,15 @@ function Mt(n) {
|
|
|
4212
4202
|
}
|
|
4213
4203
|
function yi(n, t, e) {
|
|
4214
4204
|
e === void 0 && (e = !1);
|
|
4215
|
-
const i =
|
|
4205
|
+
const i = ht(n), s = Mt(n), r = Lt(s);
|
|
4216
4206
|
let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4217
4207
|
return t.reference[r] > t.floating[r] && (o = xt(o)), [o, xt(o)];
|
|
4218
4208
|
}
|
|
4219
4209
|
function mi(n) {
|
|
4220
4210
|
const t = xt(n);
|
|
4221
|
-
return [
|
|
4211
|
+
return [It(n), t, It(t)];
|
|
4222
4212
|
}
|
|
4223
|
-
function
|
|
4213
|
+
function It(n) {
|
|
4224
4214
|
return n.replace(/start|end/g, (t) => pi[t]);
|
|
4225
4215
|
}
|
|
4226
4216
|
function Ei(n, t, e) {
|
|
@@ -4237,9 +4227,9 @@ function Ei(n, t, e) {
|
|
|
4237
4227
|
}
|
|
4238
4228
|
}
|
|
4239
4229
|
function bi(n, t, e, i) {
|
|
4240
|
-
const s =
|
|
4230
|
+
const s = ht(n);
|
|
4241
4231
|
let r = Ei(q(n), e === "start", i);
|
|
4242
|
-
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(
|
|
4232
|
+
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(It)))), r;
|
|
4243
4233
|
}
|
|
4244
4234
|
function xt(n) {
|
|
4245
4235
|
return n.replace(/left|right|bottom|top/g, (t) => wi[t]);
|
|
@@ -4284,9 +4274,9 @@ function Vt(n, t, e) {
|
|
|
4284
4274
|
reference: i,
|
|
4285
4275
|
floating: s
|
|
4286
4276
|
} = n;
|
|
4287
|
-
const r = J(t), o = Mt(t), a = Lt(o),
|
|
4277
|
+
const r = J(t), o = Mt(t), a = Lt(o), l = q(t), c = r === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, x = i[a] / 2 - s[a] / 2;
|
|
4288
4278
|
let u;
|
|
4289
|
-
switch (
|
|
4279
|
+
switch (l) {
|
|
4290
4280
|
case "top":
|
|
4291
4281
|
u = {
|
|
4292
4282
|
x: d,
|
|
@@ -4317,7 +4307,7 @@ function Vt(n, t, e) {
|
|
|
4317
4307
|
y: i.y
|
|
4318
4308
|
};
|
|
4319
4309
|
}
|
|
4320
|
-
switch (
|
|
4310
|
+
switch (ht(t)) {
|
|
4321
4311
|
case "start":
|
|
4322
4312
|
u[o] -= x * (e && c ? -1 : 1);
|
|
4323
4313
|
break;
|
|
@@ -4333,7 +4323,7 @@ const vi = async (n, t, e) => {
|
|
|
4333
4323
|
strategy: s = "absolute",
|
|
4334
4324
|
middleware: r = [],
|
|
4335
4325
|
platform: o
|
|
4336
|
-
} = e, a = r.filter(Boolean),
|
|
4326
|
+
} = e, a = r.filter(Boolean), l = await (o.isRTL == null ? void 0 : o.isRTL(t));
|
|
4337
4327
|
let c = await o.getElementRects({
|
|
4338
4328
|
reference: n,
|
|
4339
4329
|
floating: t,
|
|
@@ -4341,7 +4331,7 @@ const vi = async (n, t, e) => {
|
|
|
4341
4331
|
}), {
|
|
4342
4332
|
x: d,
|
|
4343
4333
|
y: f
|
|
4344
|
-
} = Vt(c, i,
|
|
4334
|
+
} = Vt(c, i, l), x = i, u = {}, g = 0;
|
|
4345
4335
|
for (let w = 0; w < a.length; w++) {
|
|
4346
4336
|
const {
|
|
4347
4337
|
name: p,
|
|
@@ -4378,7 +4368,7 @@ const vi = async (n, t, e) => {
|
|
|
4378
4368
|
}) : C.rects), {
|
|
4379
4369
|
x: d,
|
|
4380
4370
|
y: f
|
|
4381
|
-
} = Vt(c, x,
|
|
4371
|
+
} = Vt(c, x, l)), w = -1);
|
|
4382
4372
|
}
|
|
4383
4373
|
return {
|
|
4384
4374
|
x: d,
|
|
@@ -4397,7 +4387,7 @@ async function ne(n, t) {
|
|
|
4397
4387
|
platform: r,
|
|
4398
4388
|
rects: o,
|
|
4399
4389
|
elements: a,
|
|
4400
|
-
strategy:
|
|
4390
|
+
strategy: l
|
|
4401
4391
|
} = n, {
|
|
4402
4392
|
boundary: c = "clippingAncestors",
|
|
4403
4393
|
rootBoundary: d = "viewport",
|
|
@@ -4408,7 +4398,7 @@ async function ne(n, t) {
|
|
|
4408
4398
|
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)),
|
|
4409
4399
|
boundary: c,
|
|
4410
4400
|
rootBoundary: d,
|
|
4411
|
-
strategy:
|
|
4401
|
+
strategy: l
|
|
4412
4402
|
})), b = f === "floating" ? {
|
|
4413
4403
|
x: i,
|
|
4414
4404
|
y: s,
|
|
@@ -4424,7 +4414,7 @@ async function ne(n, t) {
|
|
|
4424
4414
|
elements: a,
|
|
4425
4415
|
rect: b,
|
|
4426
4416
|
offsetParent: m,
|
|
4427
|
-
strategy:
|
|
4417
|
+
strategy: l
|
|
4428
4418
|
}) : b);
|
|
4429
4419
|
return {
|
|
4430
4420
|
top: (y.top - C.top + g.top) / E.y,
|
|
@@ -4444,7 +4434,7 @@ const Ri = (n) => ({
|
|
|
4444
4434
|
rects: r,
|
|
4445
4435
|
platform: o,
|
|
4446
4436
|
elements: a,
|
|
4447
|
-
middlewareData:
|
|
4437
|
+
middlewareData: l
|
|
4448
4438
|
} = t, {
|
|
4449
4439
|
element: c,
|
|
4450
4440
|
padding: d = 0
|
|
@@ -4455,14 +4445,14 @@ const Ri = (n) => ({
|
|
|
4455
4445
|
x: e,
|
|
4456
4446
|
y: i
|
|
4457
4447
|
}, 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));
|
|
4458
|
-
let
|
|
4459
|
-
(!
|
|
4460
|
-
const S = E / 2 - C / 2, L =
|
|
4448
|
+
let O = R ? R[m] : 0;
|
|
4449
|
+
(!O || !await (o.isElement == null ? void 0 : o.isElement(R))) && (O = a.floating[m] || r.floating[g]);
|
|
4450
|
+
const S = E / 2 - C / 2, L = O / 2 - w[g] / 2 - 1, D = rt(f[y], L), B = rt(f[b], L), I = D, A = O - w[g] - B, T = O / 2 - w[g] / 2 + S, G = Ot(I, T, A), K = !l.arrow && ht(s) != null && T !== G && r.reference[g] / 2 - (T < I ? D : B) - w[g] / 2 < 0, k = K ? T < I ? T - I : T - A : 0;
|
|
4461
4451
|
return {
|
|
4462
4452
|
[u]: x[u] + k,
|
|
4463
4453
|
data: {
|
|
4464
4454
|
[u]: G,
|
|
4465
|
-
centerOffset:
|
|
4455
|
+
centerOffset: T - G - k,
|
|
4466
4456
|
...K && {
|
|
4467
4457
|
alignmentOffset: k
|
|
4468
4458
|
}
|
|
@@ -4481,7 +4471,7 @@ const Ri = (n) => ({
|
|
|
4481
4471
|
middlewareData: r,
|
|
4482
4472
|
rects: o,
|
|
4483
4473
|
initialPlacement: a,
|
|
4484
|
-
platform:
|
|
4474
|
+
platform: l,
|
|
4485
4475
|
elements: c
|
|
4486
4476
|
} = t, {
|
|
4487
4477
|
mainAxis: d = !0,
|
|
@@ -4494,24 +4484,24 @@ const Ri = (n) => ({
|
|
|
4494
4484
|
} = at(n, t);
|
|
4495
4485
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
4496
4486
|
return {};
|
|
4497
|
-
const y = q(s), b = J(a), m = q(a) === a, E = await (
|
|
4487
|
+
const y = q(s), b = J(a), m = q(a) === a, E = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), C = x || (m || !w ? [xt(a)] : mi(a)), R = g !== "none";
|
|
4498
4488
|
!x && R && C.push(...bi(a, w, g, E));
|
|
4499
|
-
const
|
|
4489
|
+
const O = [a, ...C], S = await ne(t, p), L = [];
|
|
4500
4490
|
let D = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
4501
4491
|
if (d && L.push(S[y]), f) {
|
|
4502
|
-
const
|
|
4503
|
-
L.push(S[
|
|
4492
|
+
const T = yi(s, o, E);
|
|
4493
|
+
L.push(S[T[0]], S[T[1]]);
|
|
4504
4494
|
}
|
|
4505
4495
|
if (D = [...D, {
|
|
4506
4496
|
placement: s,
|
|
4507
4497
|
overflows: L
|
|
4508
|
-
}], !L.every((
|
|
4498
|
+
}], !L.every((T) => T <= 0)) {
|
|
4509
4499
|
var B, I;
|
|
4510
|
-
const
|
|
4500
|
+
const T = (((B = r.flip) == null ? void 0 : B.index) || 0) + 1, G = O[T];
|
|
4511
4501
|
if (G)
|
|
4512
4502
|
return {
|
|
4513
4503
|
data: {
|
|
4514
|
-
index:
|
|
4504
|
+
index: T,
|
|
4515
4505
|
overflows: D
|
|
4516
4506
|
},
|
|
4517
4507
|
reset: {
|
|
@@ -4522,8 +4512,8 @@ const Ri = (n) => ({
|
|
|
4522
4512
|
if (!K)
|
|
4523
4513
|
switch (u) {
|
|
4524
4514
|
case "bestFit": {
|
|
4525
|
-
var
|
|
4526
|
-
const k = (
|
|
4515
|
+
var A;
|
|
4516
|
+
const k = (A = D.filter((W) => {
|
|
4527
4517
|
if (R) {
|
|
4528
4518
|
const P = J(W.placement);
|
|
4529
4519
|
return P === b || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -4531,7 +4521,7 @@ const Ri = (n) => ({
|
|
|
4531
4521
|
P === "y";
|
|
4532
4522
|
}
|
|
4533
4523
|
return !0;
|
|
4534
|
-
}).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, ye) => P + ye, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 :
|
|
4524
|
+
}).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, ye) => P + ye, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 : A[0];
|
|
4535
4525
|
k && (K = k);
|
|
4536
4526
|
break;
|
|
4537
4527
|
}
|
|
@@ -4550,12 +4540,12 @@ const Ri = (n) => ({
|
|
|
4550
4540
|
}
|
|
4551
4541
|
};
|
|
4552
4542
|
};
|
|
4553
|
-
async function
|
|
4543
|
+
async function Oi(n, t) {
|
|
4554
4544
|
const {
|
|
4555
4545
|
placement: e,
|
|
4556
4546
|
platform: i,
|
|
4557
4547
|
elements: s
|
|
4558
|
-
} = n, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), a =
|
|
4548
|
+
} = n, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), a = ht(e), l = J(e) === "y", c = ["left", "top"].includes(o) ? -1 : 1, d = r && l ? -1 : 1, f = at(t, n);
|
|
4559
4549
|
let {
|
|
4560
4550
|
mainAxis: x,
|
|
4561
4551
|
crossAxis: u,
|
|
@@ -4569,7 +4559,7 @@ async function Ii(n, t) {
|
|
|
4569
4559
|
crossAxis: f.crossAxis || 0,
|
|
4570
4560
|
alignmentAxis: f.alignmentAxis
|
|
4571
4561
|
};
|
|
4572
|
-
return a && typeof g == "number" && (u = a === "end" ? g * -1 : g),
|
|
4562
|
+
return a && typeof g == "number" && (u = a === "end" ? g * -1 : g), l ? {
|
|
4573
4563
|
x: u * d,
|
|
4574
4564
|
y: x * c
|
|
4575
4565
|
} : {
|
|
@@ -4577,7 +4567,7 @@ async function Ii(n, t) {
|
|
|
4577
4567
|
y: u * d
|
|
4578
4568
|
};
|
|
4579
4569
|
}
|
|
4580
|
-
const
|
|
4570
|
+
const Ii = function(n) {
|
|
4581
4571
|
return n === void 0 && (n = 0), {
|
|
4582
4572
|
name: "offset",
|
|
4583
4573
|
options: n,
|
|
@@ -4588,18 +4578,18 @@ const Oi = function(n) {
|
|
|
4588
4578
|
y: r,
|
|
4589
4579
|
placement: o,
|
|
4590
4580
|
middlewareData: a
|
|
4591
|
-
} = t,
|
|
4581
|
+
} = t, l = await Oi(t, n);
|
|
4592
4582
|
return o === ((e = a.offset) == null ? void 0 : e.placement) && (i = a.arrow) != null && i.alignmentOffset ? {} : {
|
|
4593
|
-
x: s +
|
|
4594
|
-
y: r +
|
|
4583
|
+
x: s + l.x,
|
|
4584
|
+
y: r + l.y,
|
|
4595
4585
|
data: {
|
|
4596
|
-
...
|
|
4586
|
+
...l,
|
|
4597
4587
|
placement: o
|
|
4598
4588
|
}
|
|
4599
4589
|
};
|
|
4600
4590
|
}
|
|
4601
4591
|
};
|
|
4602
|
-
},
|
|
4592
|
+
}, Ti = function(n) {
|
|
4603
4593
|
return n === void 0 && (n = {}), {
|
|
4604
4594
|
name: "shift",
|
|
4605
4595
|
options: n,
|
|
@@ -4623,19 +4613,19 @@ const Oi = function(n) {
|
|
|
4623
4613
|
};
|
|
4624
4614
|
}
|
|
4625
4615
|
},
|
|
4626
|
-
...
|
|
4616
|
+
...l
|
|
4627
4617
|
} = at(n, t), c = {
|
|
4628
4618
|
x: e,
|
|
4629
4619
|
y: i
|
|
4630
|
-
}, d = await ne(t,
|
|
4620
|
+
}, d = await ne(t, l), f = J(q(s)), x = re(f);
|
|
4631
4621
|
let u = c[x], g = c[f];
|
|
4632
4622
|
if (r) {
|
|
4633
4623
|
const p = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", b = u + d[p], m = u - d[y];
|
|
4634
|
-
u =
|
|
4624
|
+
u = Ot(b, u, m);
|
|
4635
4625
|
}
|
|
4636
4626
|
if (o) {
|
|
4637
4627
|
const p = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", b = g + d[p], m = g - d[y];
|
|
4638
|
-
g =
|
|
4628
|
+
g = Ot(b, g, m);
|
|
4639
4629
|
}
|
|
4640
4630
|
const w = a.fn({
|
|
4641
4631
|
...t,
|
|
@@ -4682,7 +4672,7 @@ function N(n) {
|
|
|
4682
4672
|
function zt(n) {
|
|
4683
4673
|
return !gt() || typeof ShadowRoot > "u" ? !1 : n instanceof ShadowRoot || n instanceof H(n).ShadowRoot;
|
|
4684
4674
|
}
|
|
4685
|
-
function
|
|
4675
|
+
function lt(n) {
|
|
4686
4676
|
const {
|
|
4687
4677
|
overflow: t,
|
|
4688
4678
|
overflowX: e,
|
|
@@ -4691,7 +4681,7 @@ function ht(n) {
|
|
|
4691
4681
|
} = X(n);
|
|
4692
4682
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
|
|
4693
4683
|
}
|
|
4694
|
-
function
|
|
4684
|
+
function Si(n) {
|
|
4695
4685
|
return ["table", "td", "th"].includes(tt(n));
|
|
4696
4686
|
}
|
|
4697
4687
|
function wt(n) {
|
|
@@ -4707,7 +4697,7 @@ function Ht(n) {
|
|
|
4707
4697
|
const t = Dt(), e = F(n) ? X(n) : n;
|
|
4708
4698
|
return e.transform !== "none" || e.perspective !== "none" || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (e.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (e.contain || "").includes(i));
|
|
4709
4699
|
}
|
|
4710
|
-
function
|
|
4700
|
+
function Ai(n) {
|
|
4711
4701
|
let t = z(n);
|
|
4712
4702
|
for (; N(t) && !Q(t); ) {
|
|
4713
4703
|
if (Ht(t))
|
|
@@ -4748,24 +4738,24 @@ function z(n) {
|
|
|
4748
4738
|
);
|
|
4749
4739
|
return zt(t) ? t.host : t;
|
|
4750
4740
|
}
|
|
4751
|
-
function
|
|
4741
|
+
function he(n) {
|
|
4752
4742
|
const t = z(n);
|
|
4753
|
-
return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) &&
|
|
4743
|
+
return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) && lt(t) ? t : he(t);
|
|
4754
4744
|
}
|
|
4755
|
-
function
|
|
4745
|
+
function Tt(n, t, e) {
|
|
4756
4746
|
var i;
|
|
4757
4747
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
4758
|
-
const s =
|
|
4748
|
+
const s = he(n), r = s === ((i = n.ownerDocument) == null ? void 0 : i.body), o = H(s);
|
|
4759
4749
|
if (r) {
|
|
4760
|
-
const a =
|
|
4761
|
-
return t.concat(o, o.visualViewport || [],
|
|
4750
|
+
const a = St(o);
|
|
4751
|
+
return t.concat(o, o.visualViewport || [], lt(s) ? s : [], a && e ? Tt(a) : []);
|
|
4762
4752
|
}
|
|
4763
|
-
return t.concat(s,
|
|
4753
|
+
return t.concat(s, Tt(s, [], e));
|
|
4764
4754
|
}
|
|
4765
|
-
function
|
|
4755
|
+
function St(n) {
|
|
4766
4756
|
return n.parent && Object.getPrototypeOf(n.parent) ? n.frameElement : null;
|
|
4767
4757
|
}
|
|
4768
|
-
function
|
|
4758
|
+
function le(n) {
|
|
4769
4759
|
const t = X(n);
|
|
4770
4760
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
4771
4761
|
const s = N(n), r = s ? n.offsetWidth : e, o = s ? n.offsetHeight : i, a = ft(e) !== r || ft(i) !== o;
|
|
@@ -4786,7 +4776,7 @@ function Z(n) {
|
|
|
4786
4776
|
width: i,
|
|
4787
4777
|
height: s,
|
|
4788
4778
|
$: r
|
|
4789
|
-
} =
|
|
4779
|
+
} = le(t);
|
|
4790
4780
|
let o = (r ? ft(e.width) : e.width) / i, a = (r ? ft(e.height) : e.height) / s;
|
|
4791
4781
|
return (!o || !Number.isFinite(o)) && (o = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
4792
4782
|
x: o,
|
|
@@ -4810,19 +4800,19 @@ function ot(n, t, e, i) {
|
|
|
4810
4800
|
let o = V(1);
|
|
4811
4801
|
t && (i ? F(i) && (o = Z(i)) : o = Z(n));
|
|
4812
4802
|
const a = Mi(r, e, i) ? de(r) : V(0);
|
|
4813
|
-
let
|
|
4803
|
+
let l = (s.left + a.x) / o.x, c = (s.top + a.y) / o.y, d = s.width / o.x, f = s.height / o.y;
|
|
4814
4804
|
if (r) {
|
|
4815
4805
|
const x = H(r), u = i && F(i) ? H(i) : i;
|
|
4816
|
-
let g = x, w =
|
|
4806
|
+
let g = x, w = St(g);
|
|
4817
4807
|
for (; w && i && u !== g; ) {
|
|
4818
4808
|
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;
|
|
4819
|
-
|
|
4809
|
+
l *= p.x, c *= p.y, d *= p.x, f *= p.y, l += m, c += E, g = H(w), w = St(g);
|
|
4820
4810
|
}
|
|
4821
4811
|
}
|
|
4822
4812
|
return ut({
|
|
4823
4813
|
width: d,
|
|
4824
4814
|
height: f,
|
|
4825
|
-
x:
|
|
4815
|
+
x: l,
|
|
4826
4816
|
y: c
|
|
4827
4817
|
});
|
|
4828
4818
|
}
|
|
@@ -4836,32 +4826,32 @@ function Hi(n) {
|
|
|
4836
4826
|
const r = s === "fixed", o = Y(i), a = t ? wt(t.floating) : !1;
|
|
4837
4827
|
if (i === o || a && r)
|
|
4838
4828
|
return e;
|
|
4839
|
-
let
|
|
4829
|
+
let l = {
|
|
4840
4830
|
scrollLeft: 0,
|
|
4841
4831
|
scrollTop: 0
|
|
4842
4832
|
}, c = V(1);
|
|
4843
4833
|
const d = V(0), f = N(i);
|
|
4844
|
-
if ((f || !f && !r) && ((tt(i) !== "body" ||
|
|
4834
|
+
if ((f || !f && !r) && ((tt(i) !== "body" || lt(o)) && (l = pt(i)), N(i))) {
|
|
4845
4835
|
const x = ot(i);
|
|
4846
4836
|
c = Z(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
|
|
4847
4837
|
}
|
|
4848
4838
|
return {
|
|
4849
4839
|
width: e.width * c.x,
|
|
4850
4840
|
height: e.height * c.y,
|
|
4851
|
-
x: e.x * c.x -
|
|
4852
|
-
y: e.y * c.y -
|
|
4841
|
+
x: e.x * c.x - l.scrollLeft * c.x + d.x,
|
|
4842
|
+
y: e.y * c.y - l.scrollTop * c.y + d.y
|
|
4853
4843
|
};
|
|
4854
4844
|
}
|
|
4855
4845
|
function Di(n) {
|
|
4856
4846
|
return Array.from(n.getClientRects());
|
|
4857
4847
|
}
|
|
4858
|
-
function
|
|
4848
|
+
function At(n, t) {
|
|
4859
4849
|
const e = pt(n).scrollLeft;
|
|
4860
4850
|
return t ? t.left + e : ot(Y(n)).left + e;
|
|
4861
4851
|
}
|
|
4862
4852
|
function Fi(n) {
|
|
4863
4853
|
const t = Y(n), e = pt(n), i = n.ownerDocument.body, s = U(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), r = U(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
|
|
4864
|
-
let o = -e.scrollLeft +
|
|
4854
|
+
let o = -e.scrollLeft + At(n);
|
|
4865
4855
|
const a = -e.scrollTop;
|
|
4866
4856
|
return X(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
|
|
4867
4857
|
width: s,
|
|
@@ -4872,25 +4862,25 @@ function Fi(n) {
|
|
|
4872
4862
|
}
|
|
4873
4863
|
function Xi(n, t) {
|
|
4874
4864
|
const e = H(n), i = Y(n), s = e.visualViewport;
|
|
4875
|
-
let r = i.clientWidth, o = i.clientHeight, a = 0,
|
|
4865
|
+
let r = i.clientWidth, o = i.clientHeight, a = 0, l = 0;
|
|
4876
4866
|
if (s) {
|
|
4877
4867
|
r = s.width, o = s.height;
|
|
4878
4868
|
const c = Dt();
|
|
4879
|
-
(!c || c && t === "fixed") && (a = s.offsetLeft,
|
|
4869
|
+
(!c || c && t === "fixed") && (a = s.offsetLeft, l = s.offsetTop);
|
|
4880
4870
|
}
|
|
4881
4871
|
return {
|
|
4882
4872
|
width: r,
|
|
4883
4873
|
height: o,
|
|
4884
4874
|
x: a,
|
|
4885
|
-
y:
|
|
4875
|
+
y: l
|
|
4886
4876
|
};
|
|
4887
4877
|
}
|
|
4888
4878
|
function ki(n, t) {
|
|
4889
|
-
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,
|
|
4879
|
+
const e = ot(n, !0, t === "fixed"), i = e.top + n.clientTop, s = e.left + n.clientLeft, r = N(n) ? Z(n) : V(1), o = n.clientWidth * r.x, a = n.clientHeight * r.y, l = s * r.x, c = i * r.y;
|
|
4890
4880
|
return {
|
|
4891
4881
|
width: o,
|
|
4892
4882
|
height: a,
|
|
4893
|
-
x:
|
|
4883
|
+
x: l,
|
|
4894
4884
|
y: c
|
|
4895
4885
|
};
|
|
4896
4886
|
}
|
|
@@ -4920,12 +4910,12 @@ function Ni(n, t) {
|
|
|
4920
4910
|
const e = t.get(n);
|
|
4921
4911
|
if (e)
|
|
4922
4912
|
return e;
|
|
4923
|
-
let i =
|
|
4913
|
+
let i = Tt(n, [], !1).filter((a) => F(a) && tt(a) !== "body"), s = null;
|
|
4924
4914
|
const r = X(n).position === "fixed";
|
|
4925
4915
|
let o = r ? z(n) : n;
|
|
4926
4916
|
for (; F(o) && !Q(o); ) {
|
|
4927
|
-
const a = X(o),
|
|
4928
|
-
!
|
|
4917
|
+
const a = X(o), l = Ht(o);
|
|
4918
|
+
!l && a.position === "fixed" && (s = null), (r ? !l && !s : !l && a.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || lt(o) && !l && fe(n, o)) ? i = i.filter((d) => d !== o) : s = a, o = z(o);
|
|
4929
4919
|
}
|
|
4930
4920
|
return t.set(n, i), i;
|
|
4931
4921
|
}
|
|
@@ -4936,22 +4926,22 @@ function Ki(n) {
|
|
|
4936
4926
|
rootBoundary: i,
|
|
4937
4927
|
strategy: s
|
|
4938
4928
|
} = n;
|
|
4939
|
-
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0],
|
|
4929
|
+
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0], l = o.reduce((c, d) => {
|
|
4940
4930
|
const f = $t(t, d, s);
|
|
4941
4931
|
return c.top = U(f.top, c.top), c.right = rt(f.right, c.right), c.bottom = rt(f.bottom, c.bottom), c.left = U(f.left, c.left), c;
|
|
4942
4932
|
}, $t(t, a, s));
|
|
4943
4933
|
return {
|
|
4944
|
-
width:
|
|
4945
|
-
height:
|
|
4946
|
-
x:
|
|
4947
|
-
y:
|
|
4934
|
+
width: l.right - l.left,
|
|
4935
|
+
height: l.bottom - l.top,
|
|
4936
|
+
x: l.left,
|
|
4937
|
+
y: l.top
|
|
4948
4938
|
};
|
|
4949
4939
|
}
|
|
4950
4940
|
function Yi(n) {
|
|
4951
4941
|
const {
|
|
4952
4942
|
width: t,
|
|
4953
4943
|
height: e
|
|
4954
|
-
} =
|
|
4944
|
+
} = le(n);
|
|
4955
4945
|
return {
|
|
4956
4946
|
width: t,
|
|
4957
4947
|
height: e
|
|
@@ -4963,19 +4953,19 @@ function Bi(n, t, e) {
|
|
|
4963
4953
|
scrollLeft: 0,
|
|
4964
4954
|
scrollTop: 0
|
|
4965
4955
|
};
|
|
4966
|
-
const
|
|
4956
|
+
const l = V(0);
|
|
4967
4957
|
if (i || !i && !r)
|
|
4968
|
-
if ((tt(t) !== "body" ||
|
|
4958
|
+
if ((tt(t) !== "body" || lt(s)) && (a = pt(t)), i) {
|
|
4969
4959
|
const u = ot(t, !0, r, t);
|
|
4970
|
-
|
|
4971
|
-
} else s && (
|
|
4960
|
+
l.x = u.x + t.clientLeft, l.y = u.y + t.clientTop;
|
|
4961
|
+
} else s && (l.x = At(s));
|
|
4972
4962
|
let c = 0, d = 0;
|
|
4973
4963
|
if (s && !i && !r) {
|
|
4974
4964
|
const u = s.getBoundingClientRect();
|
|
4975
4965
|
d = u.top + a.scrollTop, c = u.left + a.scrollLeft - // RTL <body> scrollbar.
|
|
4976
|
-
|
|
4966
|
+
At(s, u);
|
|
4977
4967
|
}
|
|
4978
|
-
const f = o.left + a.scrollLeft -
|
|
4968
|
+
const f = o.left + a.scrollLeft - l.x - c, x = o.top + a.scrollTop - l.y - d;
|
|
4979
4969
|
return {
|
|
4980
4970
|
x: f,
|
|
4981
4971
|
y: x,
|
|
@@ -5008,9 +4998,9 @@ function xe(n, t) {
|
|
|
5008
4998
|
return e;
|
|
5009
4999
|
}
|
|
5010
5000
|
let i = qt(n, t);
|
|
5011
|
-
for (; i &&
|
|
5001
|
+
for (; i && Si(i) && mt(i); )
|
|
5012
5002
|
i = qt(i, t);
|
|
5013
|
-
return i && Q(i) && mt(i) && !Ht(i) ? e : i ||
|
|
5003
|
+
return i && Q(i) && mt(i) && !Ht(i) ? e : i || Ai(n) || e;
|
|
5014
5004
|
}
|
|
5015
5005
|
const Wi = async function(n) {
|
|
5016
5006
|
const t = this.getOffsetParent || xe, e = this.getDimensions, i = await e(n.floating);
|
|
@@ -5038,7 +5028,7 @@ const Vi = {
|
|
|
5038
5028
|
getScale: Z,
|
|
5039
5029
|
isElement: F,
|
|
5040
5030
|
isRTL: Pi
|
|
5041
|
-
}, ue =
|
|
5031
|
+
}, ue = Ii, ge = Ti, we = _i, zi = Ri, pe = (n, t, e) => {
|
|
5042
5032
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
5043
5033
|
platform: Vi,
|
|
5044
5034
|
...e
|
|
@@ -5053,11 +5043,11 @@ const Vi = {
|
|
|
5053
5043
|
};
|
|
5054
5044
|
let $i = class {
|
|
5055
5045
|
constructor(t) {
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5046
|
+
h(this, "ctx");
|
|
5047
|
+
h(this, "enable", !1);
|
|
5048
|
+
h(this, "contentEl");
|
|
5049
|
+
h(this, "floatingEl");
|
|
5050
|
+
h(this, "arrowEl");
|
|
5061
5051
|
this.ctx = t;
|
|
5062
5052
|
const { TOOLTIP_BG_COLOR: e, TOOLTIP_TEXT_COLOR: i, TOOLTIP_ZINDEX: s, TOOLTIP_CUSTOM_STYLE: r, CSS_PREFIX: o } = this.ctx.config;
|
|
5063
5053
|
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`;
|
|
@@ -5072,7 +5062,7 @@ let $i = class {
|
|
|
5072
5062
|
borderRadius: "4px",
|
|
5073
5063
|
fontSize: "12px",
|
|
5074
5064
|
...r
|
|
5075
|
-
},
|
|
5065
|
+
}, l = {
|
|
5076
5066
|
position: "absolute",
|
|
5077
5067
|
width: "10px",
|
|
5078
5068
|
height: "10px",
|
|
@@ -5081,7 +5071,7 @@ let $i = class {
|
|
|
5081
5071
|
transform: "rotate(45deg)",
|
|
5082
5072
|
zIndex: a.zIndex
|
|
5083
5073
|
};
|
|
5084
|
-
Object.assign(this.arrowEl.style,
|
|
5074
|
+
Object.assign(this.arrowEl.style, l), Object.assign(this.floatingEl.style, a), this.floatingEl.appendChild(this.contentEl), this.floatingEl.appendChild(this.arrowEl), this.ctx.containerElement.appendChild(this.floatingEl), this.init();
|
|
5085
5075
|
}
|
|
5086
5076
|
init() {
|
|
5087
5077
|
this.ctx.on("mousemove", (t) => {
|
|
@@ -5125,10 +5115,10 @@ let $i = class {
|
|
|
5125
5115
|
placement: t.overflowTooltipPlacement,
|
|
5126
5116
|
middleware: [ge(), we(), ue(6), zi({ element: this.arrowEl })]
|
|
5127
5117
|
}).then((a) => {
|
|
5128
|
-
const { x:
|
|
5118
|
+
const { x: l, y: c, placement: d, middlewareData: f } = a;
|
|
5129
5119
|
if (Object.assign(this.floatingEl.style, {
|
|
5130
5120
|
top: `${c}px`,
|
|
5131
|
-
left: `${
|
|
5121
|
+
left: `${l}px`
|
|
5132
5122
|
}), f.arrow) {
|
|
5133
5123
|
const x = f.arrow;
|
|
5134
5124
|
["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
@@ -5164,13 +5154,13 @@ let $i = class {
|
|
|
5164
5154
|
};
|
|
5165
5155
|
class qi {
|
|
5166
5156
|
constructor(t) {
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5157
|
+
h(this, "editorEl");
|
|
5158
|
+
h(this, "inputEl");
|
|
5159
|
+
h(this, "enable", !1);
|
|
5160
|
+
h(this, "cellTarget", null);
|
|
5161
|
+
h(this, "ctx");
|
|
5162
|
+
h(this, "drawY", 0);
|
|
5163
|
+
h(this, "drawX", 0);
|
|
5174
5164
|
this.ctx = t, this.initTextEditor(), this.init();
|
|
5175
5165
|
}
|
|
5176
5166
|
init() {
|
|
@@ -5257,12 +5247,12 @@ class qi {
|
|
|
5257
5247
|
this.drawX = r, this.drawY = o;
|
|
5258
5248
|
let { height: a } = t;
|
|
5259
5249
|
const {
|
|
5260
|
-
config: { CELL_PADDING:
|
|
5250
|
+
config: { CELL_PADDING: l },
|
|
5261
5251
|
header: c
|
|
5262
5252
|
} = this.ctx;
|
|
5263
5253
|
let d = this.ctx.body.visibleHeight;
|
|
5264
5254
|
if (a > d && (a = d), 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 = `${d}px`, s === "text") {
|
|
5265
|
-
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${a - 1}px`, this.inputEl.style.maxHeight = `${d}px`, this.inputEl.style.width = `${i - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${
|
|
5255
|
+
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${a - 1}px`, this.inputEl.style.maxHeight = `${d}px`, this.inputEl.style.width = `${i - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${l}px`, e !== null && (this.inputEl.value = e), this.inputEl.focus();
|
|
5266
5256
|
const f = this.inputEl.value.length;
|
|
5267
5257
|
this.inputEl.setSelectionRange(f, f);
|
|
5268
5258
|
} else
|
|
@@ -5296,8 +5286,8 @@ class qi {
|
|
|
5296
5286
|
const r = this.ctx.focusCell;
|
|
5297
5287
|
if (!r || ["index", "index-selection", "selection"].includes(r.type) || this.enable)
|
|
5298
5288
|
return;
|
|
5299
|
-
const { rowKey: o, key: a } = r,
|
|
5300
|
-
r && !
|
|
5289
|
+
const { rowKey: o, key: a } = r, l = this.ctx.database.getReadonly(o, a);
|
|
5290
|
+
r && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = r, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
5301
5291
|
}
|
|
5302
5292
|
doneEdit() {
|
|
5303
5293
|
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1);
|
|
@@ -5309,18 +5299,18 @@ class qi {
|
|
|
5309
5299
|
}
|
|
5310
5300
|
class Gi {
|
|
5311
5301
|
constructor(t) {
|
|
5312
|
-
|
|
5313
|
-
|
|
5302
|
+
h(this, "ctx");
|
|
5303
|
+
h(this, "emptyEl");
|
|
5314
5304
|
this.ctx = t;
|
|
5315
5305
|
const { EMPTY_TEXT: e, EMPTY_CUSTOM_STYLE: i } = this.ctx.config;
|
|
5316
5306
|
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 }) => {
|
|
5317
|
-
const
|
|
5307
|
+
const l = r + (o + a) / 2, c = {
|
|
5318
5308
|
display: s === "empty" ? "block" : "none",
|
|
5319
5309
|
position: "absolute",
|
|
5320
5310
|
fontSize: "14px",
|
|
5321
5311
|
color: "#666",
|
|
5322
5312
|
left: "50%",
|
|
5323
|
-
top: `${
|
|
5313
|
+
top: `${l}px`,
|
|
5324
5314
|
transform: "translate(-50%, -50%)",
|
|
5325
5315
|
...i
|
|
5326
5316
|
};
|
|
@@ -5333,7 +5323,7 @@ class Gi {
|
|
|
5333
5323
|
}
|
|
5334
5324
|
class ji {
|
|
5335
5325
|
constructor(t) {
|
|
5336
|
-
|
|
5326
|
+
h(this, "ctx");
|
|
5337
5327
|
this.ctx = t;
|
|
5338
5328
|
}
|
|
5339
5329
|
draw() {
|
|
@@ -5348,9 +5338,9 @@ class ji {
|
|
|
5348
5338
|
}
|
|
5349
5339
|
getContainer() {
|
|
5350
5340
|
const t = this.getHeader(), e = this.getBody(), i = this.getFooter();
|
|
5351
|
-
let s = [
|
|
5352
|
-
const { FOOTER_FIXED: r } = this.ctx.config;
|
|
5353
|
-
return r
|
|
5341
|
+
let s = [];
|
|
5342
|
+
const { FOOTER_FIXED: r, FOOTER_POSITION: o } = this.ctx.config;
|
|
5343
|
+
return r ? o === "top" ? s = [t, i, e] : s = [t, e, i] : s = [t, e], {
|
|
5354
5344
|
views: s
|
|
5355
5345
|
};
|
|
5356
5346
|
}
|
|
@@ -5360,9 +5350,9 @@ class ji {
|
|
|
5360
5350
|
fixedRightWidth: e,
|
|
5361
5351
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
5362
5352
|
} = this.ctx, { visibleWidth: r, visibleHeight: o, renderCellHeaders: a } = this.ctx.header;
|
|
5363
|
-
let
|
|
5353
|
+
let l = [], c = [], d = [];
|
|
5364
5354
|
a.forEach((p) => {
|
|
5365
|
-
p.render && (p.fixed === "left" ? c.push(p) : p.fixed === "right" ? d.push(p) :
|
|
5355
|
+
p.render && (p.fixed === "left" ? c.push(p) : p.fixed === "right" ? d.push(p) : l.push(p));
|
|
5366
5356
|
});
|
|
5367
5357
|
const f = e - i, x = {
|
|
5368
5358
|
key: "left",
|
|
@@ -5385,7 +5375,7 @@ class ji {
|
|
|
5385
5375
|
width: `${r - t - f + 1}px`,
|
|
5386
5376
|
height: `${o}px`
|
|
5387
5377
|
},
|
|
5388
|
-
cells:
|
|
5378
|
+
cells: l
|
|
5389
5379
|
}, g = {
|
|
5390
5380
|
key: "right",
|
|
5391
5381
|
style: {
|
|
@@ -5421,7 +5411,7 @@ class ji {
|
|
|
5421
5411
|
const {
|
|
5422
5412
|
fixedLeftWidth: r,
|
|
5423
5413
|
fixedRightWidth: o,
|
|
5424
|
-
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX:
|
|
5414
|
+
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX: l }
|
|
5425
5415
|
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - a, x = {
|
|
5426
5416
|
key: "left",
|
|
5427
5417
|
style: {
|
|
@@ -5458,7 +5448,7 @@ class ji {
|
|
|
5458
5448
|
};
|
|
5459
5449
|
return {
|
|
5460
5450
|
type: "body",
|
|
5461
|
-
class: `${
|
|
5451
|
+
class: `${l}-overlayer-body`,
|
|
5462
5452
|
style: {
|
|
5463
5453
|
position: "relative",
|
|
5464
5454
|
overflow: "hidden",
|
|
@@ -5479,7 +5469,7 @@ class ji {
|
|
|
5479
5469
|
fixedLeftWidth: s,
|
|
5480
5470
|
fixedRightWidth: r,
|
|
5481
5471
|
config: { SCROLLER_TRACK_SIZE: o, CSS_PREFIX: a }
|
|
5482
|
-
} = this.ctx, { visibleWidth:
|
|
5472
|
+
} = this.ctx, { visibleWidth: l, visibleHeight: c } = this.ctx.footer, d = r - o, f = {
|
|
5483
5473
|
key: "left",
|
|
5484
5474
|
style: {
|
|
5485
5475
|
position: "absolute",
|
|
@@ -5497,7 +5487,7 @@ class ji {
|
|
|
5497
5487
|
top: `${0.5}px`,
|
|
5498
5488
|
left: `${s - 0.5}px`,
|
|
5499
5489
|
overflow: "hidden",
|
|
5500
|
-
width: `${
|
|
5490
|
+
width: `${l - s - d}px`,
|
|
5501
5491
|
height: `${c}px`
|
|
5502
5492
|
},
|
|
5503
5493
|
cells: t
|
|
@@ -5519,7 +5509,7 @@ class ji {
|
|
|
5519
5509
|
style: {
|
|
5520
5510
|
position: "relative",
|
|
5521
5511
|
overflow: "hidden",
|
|
5522
|
-
width: `${
|
|
5512
|
+
width: `${l}px`,
|
|
5523
5513
|
height: `${c}px`
|
|
5524
5514
|
},
|
|
5525
5515
|
views: [f, x, u]
|
|
@@ -5528,17 +5518,17 @@ class ji {
|
|
|
5528
5518
|
}
|
|
5529
5519
|
class Ui {
|
|
5530
5520
|
constructor(t) {
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5521
|
+
h(this, "ctx");
|
|
5522
|
+
h(this, "contextMenuEl");
|
|
5523
|
+
h(this, "custom", !1);
|
|
5534
5524
|
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();
|
|
5535
5525
|
}
|
|
5536
5526
|
init() {
|
|
5537
5527
|
this.ctx.on("cellContextMenuClick", (t, e) => {
|
|
5538
5528
|
if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
|
|
5539
5529
|
e.preventDefault();
|
|
5540
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a,
|
|
5541
|
-
c >= a && c <=
|
|
5530
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a, l] = s, { rowIndex: c, colIndex: d } = t;
|
|
5531
|
+
c >= a && c <= l && d >= r && d <= o || this.ctx.emit("setSelectorCell", t, e);
|
|
5542
5532
|
const x = {
|
|
5543
5533
|
getBoundingClientRect: () => ({
|
|
5544
5534
|
width: 0,
|
|
@@ -5612,19 +5602,19 @@ class Ui {
|
|
|
5612
5602
|
}
|
|
5613
5603
|
class Qi {
|
|
5614
5604
|
constructor(t, e) {
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5605
|
+
h(this, "options");
|
|
5606
|
+
h(this, "scroller");
|
|
5607
|
+
h(this, "header");
|
|
5608
|
+
h(this, "body");
|
|
5609
|
+
h(this, "footer");
|
|
5610
|
+
h(this, "selector");
|
|
5611
|
+
h(this, "autofill");
|
|
5612
|
+
h(this, "tooltip");
|
|
5613
|
+
h(this, "editor");
|
|
5614
|
+
h(this, "empty");
|
|
5615
|
+
h(this, "overlayer");
|
|
5616
|
+
h(this, "contextMenu");
|
|
5617
|
+
h(this, "ctx");
|
|
5628
5618
|
this.options = e;
|
|
5629
5619
|
const { overlayerElement: i, editorElement: s, emptyElement: r, contextMenuElement: o } = e, a = this.createContainer(
|
|
5630
5620
|
t,
|
|
@@ -5633,7 +5623,7 @@ class Qi {
|
|
|
5633
5623
|
r,
|
|
5634
5624
|
o
|
|
5635
5625
|
);
|
|
5636
|
-
this.ctx = new
|
|
5626
|
+
this.ctx = new li(a, this.options), this.header = new di(this.ctx), this.footer = new xi(this.ctx), this.body = new fi(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", () => {
|
|
5637
5627
|
this.draw();
|
|
5638
5628
|
}), this.ctx.on("drawView", () => {
|
|
5639
5629
|
this.draw(!0);
|
|
@@ -5641,16 +5631,16 @@ class Qi {
|
|
|
5641
5631
|
}
|
|
5642
5632
|
createContainer(t, e, i, s, r) {
|
|
5643
5633
|
t.className = "e-virt-table-container";
|
|
5644
|
-
const o = document.createElement("div"), a = document.createElement("canvas"),
|
|
5645
|
-
o.className = "e-virt-table-stage", a.className = "e-virt-table-canvas",
|
|
5634
|
+
const o = document.createElement("div"), a = document.createElement("canvas"), l = e || document.createElement("div");
|
|
5635
|
+
o.className = "e-virt-table-stage", a.className = "e-virt-table-canvas", l.className = "e-virt-table-overlayer";
|
|
5646
5636
|
const c = i || document.createElement("div");
|
|
5647
5637
|
c.className = "e-virt-table-editor";
|
|
5648
5638
|
const d = s, f = r;
|
|
5649
|
-
return o.appendChild(a), o.appendChild(
|
|
5639
|
+
return o.appendChild(a), o.appendChild(l), t.appendChild(o), {
|
|
5650
5640
|
containerElement: t,
|
|
5651
5641
|
stageElement: o,
|
|
5652
5642
|
canvasElement: a,
|
|
5653
|
-
overlayerElement:
|
|
5643
|
+
overlayerElement: l,
|
|
5654
5644
|
editorElement: c,
|
|
5655
5645
|
emptyElement: d,
|
|
5656
5646
|
contextMenuElement: f
|
|
@@ -5721,8 +5711,8 @@ class Qi {
|
|
|
5721
5711
|
if (t && Array.isArray(s) && s.length) {
|
|
5722
5712
|
const [r] = s;
|
|
5723
5713
|
if (Array.isArray(r) && r.length) {
|
|
5724
|
-
const [o] = r, { rowKey: a, key:
|
|
5725
|
-
this.scrollToRowkey(a), this.scrollToColkey(
|
|
5714
|
+
const [o] = r, { rowKey: a, key: l } = o;
|
|
5715
|
+
this.scrollToRowkey(a), this.scrollToColkey(l);
|
|
5726
5716
|
}
|
|
5727
5717
|
}
|
|
5728
5718
|
i(s);
|
|
@@ -5747,7 +5737,7 @@ class Qi {
|
|
|
5747
5737
|
let r = [];
|
|
5748
5738
|
for (let o = 0; o < i.length; o++)
|
|
5749
5739
|
for (let a = 0; a < s.length; a++) {
|
|
5750
|
-
const
|
|
5740
|
+
const l = this.ctx.database.getRowKeyByItem(i[o]), d = s[a].key, f = await this.ctx.database.getValidator(l, d);
|
|
5751
5741
|
Array.isArray(f) && f.length && r.push(f);
|
|
5752
5742
|
}
|
|
5753
5743
|
r.length ? (e(r), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
|