e-virt-table 1.0.0 → 1.0.2
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 +782 -788
- 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 +2 -1
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/EventTable.d.ts +1 -0
- package/dist/lib/EventTable.js +6 -0
- package/dist/lib/EventTable.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);
|
|
@@ -2693,21 +2694,22 @@ class li {
|
|
|
2693
2694
|
return !!(this.ctx.scrollerMove || this.ctx.scrollerFocus || s > this.ctx.stageHeight - o || r > this.ctx.stageWidth - o);
|
|
2694
2695
|
}
|
|
2695
2696
|
handleBodyEvent(t, e, i, s, r = !1) {
|
|
2696
|
-
|
|
2697
|
-
const
|
|
2698
|
-
|
|
2699
|
-
const
|
|
2700
|
-
|
|
2701
|
-
if (
|
|
2702
|
-
|
|
2697
|
+
if (this.isInsideBody(e))
|
|
2698
|
+
for (const o of i) {
|
|
2699
|
+
const a = o.fixedCells.concat(o.noFixedCells);
|
|
2700
|
+
for (const l of a) {
|
|
2701
|
+
const c = l.getDrawX(), d = l.getDrawY();
|
|
2702
|
+
if (r) {
|
|
2703
|
+
if (t > c && t < c + l.visibleWidth && e > d && e < d + l.visibleHeight) {
|
|
2704
|
+
s(l);
|
|
2705
|
+
return;
|
|
2706
|
+
}
|
|
2707
|
+
} else if (t > c && t < c + l.width && e > d && e < d + l.height) {
|
|
2708
|
+
s(l);
|
|
2703
2709
|
return;
|
|
2704
2710
|
}
|
|
2705
|
-
} else if (t > c && t < c + h.width && e > d && e < d + h.height) {
|
|
2706
|
-
s(h);
|
|
2707
|
-
return;
|
|
2708
2711
|
}
|
|
2709
2712
|
}
|
|
2710
|
-
}
|
|
2711
2713
|
}
|
|
2712
2714
|
handleHeaderEvent(t, e, i, s) {
|
|
2713
2715
|
for (const r of i) {
|
|
@@ -2718,61 +2720,64 @@ class li {
|
|
|
2718
2720
|
}
|
|
2719
2721
|
}
|
|
2720
2722
|
}
|
|
2723
|
+
isInsideBody(t) {
|
|
2724
|
+
return t > this.ctx.body.y && t < this.ctx.body.y + this.ctx.body.visibleHeight;
|
|
2725
|
+
}
|
|
2721
2726
|
destroy() {
|
|
2722
2727
|
this.resizeObserver.unobserve(this.ctx.stageElement);
|
|
2723
2728
|
}
|
|
2724
2729
|
}
|
|
2725
|
-
class
|
|
2730
|
+
class li {
|
|
2726
2731
|
constructor(t, e) {
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2732
|
+
h(this, "eventBus");
|
|
2733
|
+
h(this, "eventBrowser");
|
|
2734
|
+
h(this, "eventTable");
|
|
2735
|
+
h(this, "containerElement");
|
|
2736
|
+
h(this, "stageElement");
|
|
2737
|
+
h(this, "canvasElement");
|
|
2738
|
+
h(this, "overlayerElement");
|
|
2739
|
+
h(this, "editorElement");
|
|
2740
|
+
h(this, "emptyElement");
|
|
2741
|
+
h(this, "contextMenuElement");
|
|
2742
|
+
h(this, "stageWidth", 0);
|
|
2743
|
+
h(this, "stageHeight", 0);
|
|
2744
|
+
h(this, "paint");
|
|
2745
|
+
h(this, "icons");
|
|
2746
|
+
h(this, "isInsideTargetContainer", !1);
|
|
2747
|
+
h(this, "mousedown", !1);
|
|
2748
|
+
h(this, "isPointer", !1);
|
|
2749
|
+
h(this, "rowResizing", !1);
|
|
2745
2750
|
// 行调整大小中
|
|
2746
|
-
|
|
2751
|
+
h(this, "columnResizing", !1);
|
|
2747
2752
|
// 列调整大小中
|
|
2748
|
-
|
|
2753
|
+
h(this, "scrollerMove", !1);
|
|
2749
2754
|
// 滚动条移动中
|
|
2750
|
-
|
|
2755
|
+
h(this, "scrollerFocus", !1);
|
|
2751
2756
|
// 滚动条focus中
|
|
2752
|
-
|
|
2757
|
+
h(this, "autofillMove", !1);
|
|
2753
2758
|
// 自动填充移动中
|
|
2754
|
-
|
|
2759
|
+
h(this, "selectorMove", !1);
|
|
2755
2760
|
// 选择器移动中
|
|
2756
|
-
|
|
2761
|
+
h(this, "selectOnlyOne", !1);
|
|
2757
2762
|
// 只选择一个单元格
|
|
2758
|
-
|
|
2763
|
+
h(this, "adjustPositioning", !1);
|
|
2759
2764
|
// 调整位置中
|
|
2760
|
-
|
|
2765
|
+
h(this, "editing", !1);
|
|
2761
2766
|
// 编辑中
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2767
|
+
h(this, "scrollY", 0);
|
|
2768
|
+
h(this, "scrollX", 0);
|
|
2769
|
+
h(this, "fixedLeftWidth", 0);
|
|
2770
|
+
h(this, "fixedRightWidth", 0);
|
|
2771
|
+
h(this, "maxColIndex", 0);
|
|
2772
|
+
h(this, "maxRowIndex", 0);
|
|
2773
|
+
h(this, "hoverRow");
|
|
2774
|
+
h(this, "clickCell");
|
|
2775
|
+
h(this, "focusCell");
|
|
2776
|
+
h(this, "hoverCell");
|
|
2777
|
+
h(this, "clickCellHeader");
|
|
2778
|
+
h(this, "focusCellHeader");
|
|
2779
|
+
h(this, "hoverCellHeader");
|
|
2780
|
+
h(this, "body", {
|
|
2776
2781
|
x: 0,
|
|
2777
2782
|
y: 0,
|
|
2778
2783
|
width: 0,
|
|
@@ -2785,7 +2790,7 @@ class hi {
|
|
|
2785
2790
|
renderRows: [],
|
|
2786
2791
|
data: []
|
|
2787
2792
|
});
|
|
2788
|
-
|
|
2793
|
+
h(this, "footer", {
|
|
2789
2794
|
x: 0,
|
|
2790
2795
|
y: 0,
|
|
2791
2796
|
width: 0,
|
|
@@ -2794,7 +2799,7 @@ class hi {
|
|
|
2794
2799
|
visibleWidth: 0,
|
|
2795
2800
|
renderRows: []
|
|
2796
2801
|
});
|
|
2797
|
-
|
|
2802
|
+
h(this, "header", {
|
|
2798
2803
|
x: 0,
|
|
2799
2804
|
y: 0,
|
|
2800
2805
|
width: 0,
|
|
@@ -2809,31 +2814,31 @@ class hi {
|
|
|
2809
2814
|
fixedRightCellHeaders: [],
|
|
2810
2815
|
renderCenterCellHeaders: []
|
|
2811
2816
|
});
|
|
2812
|
-
|
|
2817
|
+
h(this, "selector", {
|
|
2813
2818
|
enable: !1,
|
|
2814
2819
|
xArr: [-1, -1],
|
|
2815
2820
|
yArr: [-1, -1],
|
|
2816
2821
|
xArrCopy: [-1, -1],
|
|
2817
2822
|
yArrCopy: [-1, -1]
|
|
2818
2823
|
});
|
|
2819
|
-
|
|
2824
|
+
h(this, "autofill", {
|
|
2820
2825
|
enable: !1,
|
|
2821
2826
|
xArr: [-1, -1],
|
|
2822
2827
|
yArr: [-1, -1]
|
|
2823
2828
|
});
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2829
|
+
h(this, "database");
|
|
2830
|
+
h(this, "history");
|
|
2831
|
+
h(this, "config");
|
|
2827
2832
|
const {
|
|
2828
2833
|
containerElement: i,
|
|
2829
2834
|
stageElement: s,
|
|
2830
2835
|
canvasElement: r,
|
|
2831
2836
|
overlayerElement: o,
|
|
2832
2837
|
editorElement: a,
|
|
2833
|
-
emptyElement:
|
|
2838
|
+
emptyElement: l,
|
|
2834
2839
|
contextMenuElement: c
|
|
2835
2840
|
} = t;
|
|
2836
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = a, this.emptyElement =
|
|
2841
|
+
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
2842
|
}
|
|
2838
2843
|
setConfig(t) {
|
|
2839
2844
|
this.config = new Wt(t);
|
|
@@ -2868,7 +2873,7 @@ class hi {
|
|
|
2868
2873
|
for (let r = 0; r <= e[1] - e[0]; r++) {
|
|
2869
2874
|
const o = [];
|
|
2870
2875
|
for (let a = 0; a <= i[1] - i[0]; a++) {
|
|
2871
|
-
const
|
|
2876
|
+
const l = r + e[0], c = a + i[0], d = this.database.getItemValueForRowIndexAndColIndex(l, c);
|
|
2872
2877
|
d && o.push(d.value);
|
|
2873
2878
|
}
|
|
2874
2879
|
s += `${o.join(" ")}\r`, t.push(o);
|
|
@@ -2884,9 +2889,8 @@ class hi {
|
|
|
2884
2889
|
let i = Math.floor(t);
|
|
2885
2890
|
const s = this.body.width - this.body.visibleWidth;
|
|
2886
2891
|
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);
|
|
2892
|
+
let r = Math.floor(e), o = this.body.height - this.body.visibleHeight;
|
|
2893
|
+
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
2894
|
}
|
|
2891
2895
|
setScrollX(t) {
|
|
2892
2896
|
let e = Math.floor(t);
|
|
@@ -2930,29 +2934,29 @@ class hi {
|
|
|
2930
2934
|
}
|
|
2931
2935
|
class Pt {
|
|
2932
2936
|
constructor(t, e) {
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2937
|
+
h(this, "ctx");
|
|
2938
|
+
h(this, "type");
|
|
2939
|
+
h(this, "isFocus", !1);
|
|
2940
|
+
h(this, "trackX", 0);
|
|
2941
|
+
h(this, "trackY", 0);
|
|
2942
|
+
h(this, "trackWidth", 0);
|
|
2943
|
+
h(this, "trackHeight", 0);
|
|
2944
|
+
h(this, "splitPoints", []);
|
|
2941
2945
|
//分割线
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2946
|
+
h(this, "barX", 0);
|
|
2947
|
+
h(this, "barY", 0);
|
|
2948
|
+
h(this, "barWidth", 0);
|
|
2949
|
+
h(this, "barHeight", 0);
|
|
2950
|
+
h(this, "distance", 0);
|
|
2947
2951
|
// 滚动条的长度
|
|
2948
|
-
|
|
2952
|
+
h(this, "visibleDistance", 0);
|
|
2949
2953
|
//可见区域的长度
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2954
|
+
h(this, "clientX", 0);
|
|
2955
|
+
h(this, "clientY", 0);
|
|
2956
|
+
h(this, "dragStart", 0);
|
|
2953
2957
|
// 拖拽开始的位置
|
|
2954
|
-
|
|
2955
|
-
|
|
2958
|
+
h(this, "isDragging", !1);
|
|
2959
|
+
h(this, "scroll", 0);
|
|
2956
2960
|
this.ctx = t, this.type = e, this.type === "vertical" ? this.scroll = this.ctx.scrollY : this.scroll = this.ctx.scrollX;
|
|
2957
2961
|
}
|
|
2958
2962
|
onWheel(t) {
|
|
@@ -3008,19 +3012,19 @@ class Pt {
|
|
|
3008
3012
|
stageHeight: i,
|
|
3009
3013
|
stageWidth: s,
|
|
3010
3014
|
config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0 }
|
|
3011
|
-
} = this.ctx, a = s,
|
|
3015
|
+
} = this.ctx, a = s, l = i, c = e.height, d = e.width, f = t.height, x = this.ctx.footer.height;
|
|
3012
3016
|
if (this.type === "vertical") {
|
|
3013
|
-
this.visibleDistance =
|
|
3017
|
+
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
3018
|
const u = this.distance ? this.visibleDistance / (f + x) : 0;
|
|
3015
3019
|
let g = Math.floor(u * this.visibleDistance);
|
|
3016
3020
|
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
3021
|
} else {
|
|
3018
3022
|
this.visibleDistance = a - r, this.distance = d - this.visibleDistance, this.splitPoints = [
|
|
3019
3023
|
a - r,
|
|
3020
|
-
|
|
3024
|
+
l - r,
|
|
3021
3025
|
a - r,
|
|
3022
|
-
|
|
3023
|
-
], this.trackX = 0, this.trackY =
|
|
3026
|
+
l
|
|
3027
|
+
], this.trackX = 0, this.trackY = l - r, this.trackWidth = a, this.trackHeight = r;
|
|
3024
3028
|
const u = this.distance ? this.visibleDistance / d : 0;
|
|
3025
3029
|
let g = Math.floor(u * this.visibleDistance);
|
|
3026
3030
|
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 +3048,9 @@ class Pt {
|
|
|
3044
3048
|
}
|
|
3045
3049
|
class ci {
|
|
3046
3050
|
constructor(t) {
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3051
|
+
h(this, "ctx");
|
|
3052
|
+
h(this, "verticalScrollbar");
|
|
3053
|
+
h(this, "horizontalScrollbar");
|
|
3050
3054
|
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
3055
|
this.setScroll(e, i);
|
|
3052
3056
|
}), this.ctx.on("setScrollX", (e) => {
|
|
@@ -3100,41 +3104,41 @@ class ci {
|
|
|
3100
3104
|
}
|
|
3101
3105
|
class di {
|
|
3102
3106
|
constructor(t) {
|
|
3103
|
-
|
|
3107
|
+
h(this, "ctx");
|
|
3104
3108
|
// 上下文
|
|
3105
|
-
|
|
3109
|
+
h(this, "x", 0);
|
|
3106
3110
|
// x坐标
|
|
3107
|
-
|
|
3111
|
+
h(this, "y", 0);
|
|
3108
3112
|
// y坐标
|
|
3109
|
-
|
|
3113
|
+
h(this, "width", 0);
|
|
3110
3114
|
// 宽度
|
|
3111
|
-
|
|
3115
|
+
h(this, "height", 0);
|
|
3112
3116
|
// 高度
|
|
3113
|
-
|
|
3117
|
+
h(this, "resizeTarget", null);
|
|
3114
3118
|
//调整表头
|
|
3115
|
-
|
|
3119
|
+
h(this, "resizeNum", 0);
|
|
3116
3120
|
// 调整列的数量
|
|
3117
|
-
|
|
3121
|
+
h(this, "isResizing", !1);
|
|
3118
3122
|
// 是否移动中
|
|
3119
|
-
|
|
3123
|
+
h(this, "clientX", 0);
|
|
3120
3124
|
// 鼠标按下时的x轴位置
|
|
3121
|
-
|
|
3125
|
+
h(this, "resizeDiff", 0);
|
|
3122
3126
|
// 是否移动中
|
|
3123
|
-
|
|
3124
|
-
|
|
3127
|
+
h(this, "columnIndex", 0);
|
|
3128
|
+
h(this, "isMouseDown", !1);
|
|
3125
3129
|
// 是否按下
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3130
|
+
h(this, "columns");
|
|
3131
|
+
h(this, "visibleLeafColumns", []);
|
|
3132
|
+
h(this, "visibleHeight", 0);
|
|
3133
|
+
h(this, "visibleWidth", 0);
|
|
3134
|
+
h(this, "allCellHeaders", []);
|
|
3135
|
+
h(this, "leafCellHeaders", []);
|
|
3136
|
+
h(this, "renderLeafCellHeaders", []);
|
|
3137
|
+
h(this, "fixedLeftCellHeaders", []);
|
|
3138
|
+
h(this, "centerCellHeaders", []);
|
|
3139
|
+
h(this, "fixedRightCellHeaders", []);
|
|
3140
|
+
h(this, "renderCenterCellHeaders", []);
|
|
3141
|
+
h(this, "renderFixedCellHeaders", []);
|
|
3138
3142
|
this.ctx = t, this.ctx.on(
|
|
3139
3143
|
"resetHeader",
|
|
3140
3144
|
Zt(() => {
|
|
@@ -3153,9 +3157,9 @@ class di {
|
|
|
3153
3157
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3154
3158
|
const a = this.ctx.containerElement.getBoundingClientRect();
|
|
3155
3159
|
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(
|
|
3160
|
+
const l = this.visibleWidth - this.width;
|
|
3161
|
+
if (this.resizeNum && l > 0) {
|
|
3162
|
+
const f = Math.floor(l / this.resizeNum * 100) / 100;
|
|
3159
3163
|
this.resizeAllColumn(f);
|
|
3160
3164
|
}
|
|
3161
3165
|
const c = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
@@ -3188,9 +3192,9 @@ class di {
|
|
|
3188
3192
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3189
3193
|
const r = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
3190
3194
|
for (const o of r) {
|
|
3191
|
-
const { offsetX: a, offsetY:
|
|
3195
|
+
const { offsetX: a, offsetY: l } = this.ctx.getOffset(e), c = a, d = o.getDrawX();
|
|
3192
3196
|
c > d + o.width - 5 && c < d + o.width + 4 && c < i - 4 && // 视窗中最后一列不允许调整宽
|
|
3193
|
-
o.colspan <= 1 && this.ctx.isTarget() &&
|
|
3197
|
+
o.colspan <= 1 && this.ctx.isTarget() && l <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = o);
|
|
3194
3198
|
}
|
|
3195
3199
|
}
|
|
3196
3200
|
}));
|
|
@@ -3244,10 +3248,10 @@ class di {
|
|
|
3244
3248
|
let s = e;
|
|
3245
3249
|
const { HEADER_HEIGHT: r = 0 } = this.ctx.config;
|
|
3246
3250
|
for (let o = 0; o < i; o++) {
|
|
3247
|
-
const a = t[o],
|
|
3251
|
+
const a = t[o], l = r * (a.rowspan || 0), c = r * (a.level || 0);
|
|
3248
3252
|
let d = a.width || 100;
|
|
3249
3253
|
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,
|
|
3254
|
+
const f = new ie(this.ctx, this.columnIndex, s, c, d, l, a);
|
|
3251
3255
|
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
3256
|
}
|
|
3253
3257
|
}
|
|
@@ -3279,8 +3283,8 @@ class di {
|
|
|
3279
3283
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3280
3284
|
colorEnd: "rgba(0,0,0,0)"
|
|
3281
3285
|
}), i < Math.floor(s.width - r - 1) && e !== a) {
|
|
3282
|
-
const
|
|
3283
|
-
this.ctx.paint.drawShadow(
|
|
3286
|
+
const l = s.width - (this.x + this.width) + r - e;
|
|
3287
|
+
this.ctx.paint.drawShadow(l + 1, this.y, e, this.height, {
|
|
3284
3288
|
fillColor: o,
|
|
3285
3289
|
side: "left",
|
|
3286
3290
|
shadowWidth: 4,
|
|
@@ -3308,20 +3312,20 @@ class di {
|
|
|
3308
3312
|
}
|
|
3309
3313
|
}
|
|
3310
3314
|
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 =
|
|
3315
|
+
constructor(t, e, i = 0, s = 0, r = 0, o = 0, a, l = "body") {
|
|
3316
|
+
h(this, "ctx");
|
|
3317
|
+
h(this, "x", 0);
|
|
3318
|
+
h(this, "y", 0);
|
|
3319
|
+
h(this, "width", 0);
|
|
3320
|
+
h(this, "height");
|
|
3321
|
+
h(this, "cells", []);
|
|
3322
|
+
h(this, "fixedCells", []);
|
|
3323
|
+
h(this, "noFixedCells", []);
|
|
3324
|
+
h(this, "rowIndex", 0);
|
|
3325
|
+
h(this, "rowKey", "");
|
|
3326
|
+
h(this, "rowType", "body");
|
|
3327
|
+
h(this, "data");
|
|
3328
|
+
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
3329
|
}
|
|
3326
3330
|
update() {
|
|
3327
3331
|
const { header: t } = this.ctx, e = [], i = [], s = [];
|
|
@@ -3361,77 +3365,79 @@ class se {
|
|
|
3361
3365
|
}
|
|
3362
3366
|
class fi {
|
|
3363
3367
|
constructor(t) {
|
|
3364
|
-
|
|
3368
|
+
h(this, "resizeTarget", null);
|
|
3365
3369
|
//调整行大小的目标
|
|
3366
|
-
|
|
3370
|
+
h(this, "isMouseDown", !1);
|
|
3367
3371
|
// 是否按下
|
|
3368
|
-
|
|
3372
|
+
h(this, "resizeDiff", 0);
|
|
3369
3373
|
// 是否移动中
|
|
3370
|
-
|
|
3374
|
+
h(this, "clientY", 0);
|
|
3371
3375
|
// 鼠标按下时的y轴位置
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3376
|
+
h(this, "ctx");
|
|
3377
|
+
h(this, "x", 0);
|
|
3378
|
+
h(this, "y", 0);
|
|
3379
|
+
h(this, "width", 0);
|
|
3380
|
+
h(this, "height", 0);
|
|
3381
|
+
h(this, "headIndex", 0);
|
|
3382
|
+
h(this, "tailIndex", 0);
|
|
3383
|
+
h(this, "isResizing", !1);
|
|
3380
3384
|
//是否正在调整大小
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3385
|
+
h(this, "renderRows", []);
|
|
3386
|
+
h(this, "visibleRows", []);
|
|
3387
|
+
h(this, "visibleHeight", 0);
|
|
3388
|
+
h(this, "visibleWidth", 0);
|
|
3389
|
+
h(this, "data", []);
|
|
3386
3390
|
this.ctx = t, this.init(), this.initResizeRow();
|
|
3387
3391
|
}
|
|
3388
3392
|
init() {
|
|
3389
3393
|
const {
|
|
3390
3394
|
canvasElement: t,
|
|
3391
3395
|
header: e,
|
|
3392
|
-
|
|
3396
|
+
footer: i,
|
|
3397
|
+
database: s,
|
|
3393
3398
|
config: {
|
|
3394
|
-
FOOTER_FIXED:
|
|
3395
|
-
SCROLLER_TRACK_SIZE:
|
|
3396
|
-
HEIGHT:
|
|
3397
|
-
EMPTY_BODY_HEIGHT:
|
|
3398
|
-
MAX_HEIGHT:
|
|
3399
|
-
ENABLE_OFFSET_HEIGHT:
|
|
3400
|
-
OFFSET_HEIGHT:
|
|
3399
|
+
FOOTER_FIXED: r,
|
|
3400
|
+
SCROLLER_TRACK_SIZE: o = 0,
|
|
3401
|
+
HEIGHT: a,
|
|
3402
|
+
EMPTY_BODY_HEIGHT: l = 0,
|
|
3403
|
+
MAX_HEIGHT: c = 0,
|
|
3404
|
+
ENABLE_OFFSET_HEIGHT: d = 0,
|
|
3405
|
+
OFFSET_HEIGHT: f = 0,
|
|
3406
|
+
FOOTER_POSITION: x
|
|
3401
3407
|
}
|
|
3402
3408
|
} = this.ctx;
|
|
3403
3409
|
if (!e.width)
|
|
3404
3410
|
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
|
|
3411
|
+
this.x = 0, x === "top" && r ? this.y = e.height + i.height : this.y = e.height;
|
|
3412
|
+
const { data: u, sumHeight: g } = s.getData();
|
|
3413
|
+
this.height = g, this.data = u;
|
|
3414
|
+
const { top: w } = t.getBoundingClientRect();
|
|
3415
|
+
this.width = e.width, this.visibleWidth = this.ctx.stageWidth - o;
|
|
3416
|
+
const p = this.ctx.footer.height;
|
|
3417
|
+
!this.data.length && !a ? this.height = l : !this.data.length && a && (this.height = a - e.height - p - o);
|
|
3418
|
+
const y = this.data.length ? "not-empty" : "empty";
|
|
3413
3419
|
this.ctx.emit("emptyChange", {
|
|
3414
|
-
isEmpty:
|
|
3415
|
-
type:
|
|
3420
|
+
isEmpty: y,
|
|
3421
|
+
type: y,
|
|
3416
3422
|
headerHeight: e.height,
|
|
3417
3423
|
bodyHeight: this.height,
|
|
3418
|
-
footerHeight:
|
|
3424
|
+
footerHeight: p,
|
|
3419
3425
|
width: this.width,
|
|
3420
|
-
height: this.data.length ? 0 :
|
|
3426
|
+
height: this.data.length ? 0 : l + p
|
|
3421
3427
|
});
|
|
3422
|
-
let
|
|
3423
|
-
|
|
3424
|
-
let
|
|
3425
|
-
this.data.length &&
|
|
3428
|
+
let b = this.height + e.height + o;
|
|
3429
|
+
b += p;
|
|
3430
|
+
let m = 0;
|
|
3431
|
+
this.data.length && d ? (m = window.innerHeight - w - f, m < 0 && (m = 32, console.error(
|
|
3426
3432
|
"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(
|
|
3433
|
+
))) : 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`);
|
|
3434
|
+
let E = this.ctx.stageHeight - e.height - o;
|
|
3435
|
+
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;
|
|
3436
|
+
const C = window.devicePixelRatio || 1, R = this.ctx.stageWidth * C, O = this.ctx.stageHeight * C;
|
|
3437
|
+
t.width = Math.floor(R), t.height = Math.floor(O), this.ctx.canvasElement.setAttribute(
|
|
3432
3438
|
"style",
|
|
3433
3439
|
` height:${this.ctx.stageHeight}px;width:${this.ctx.stageWidth}px;`
|
|
3434
|
-
), this.ctx.paint.scale(
|
|
3440
|
+
), this.ctx.paint.scale(C);
|
|
3435
3441
|
}
|
|
3436
3442
|
// 调整行的高度
|
|
3437
3443
|
initResizeRow() {
|
|
@@ -3447,7 +3453,7 @@ class fi {
|
|
|
3447
3453
|
}), this.ctx.on("mousemove", (e) => {
|
|
3448
3454
|
if (this.ctx.editing) return;
|
|
3449
3455
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s, a = e.clientY, {
|
|
3450
|
-
stageHeight:
|
|
3456
|
+
stageHeight: l,
|
|
3451
3457
|
scrollY: c,
|
|
3452
3458
|
config: { RESIZE_ROW_MIN_HEIGHT: d = 0 }
|
|
3453
3459
|
} = this.ctx;
|
|
@@ -3461,7 +3467,7 @@ class fi {
|
|
|
3461
3467
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3462
3468
|
for (let f = 0; f < this.renderRows.length; f++) {
|
|
3463
3469
|
const x = this.renderRows[f];
|
|
3464
|
-
if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r <
|
|
3470
|
+
if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r < l - 4)
|
|
3465
3471
|
for (let g = 0; g < x.cells.length; g++) {
|
|
3466
3472
|
const w = x.cells[g];
|
|
3467
3473
|
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 +3516,8 @@ class fi {
|
|
|
3510
3516
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3511
3517
|
colorEnd: "rgba(0,0,0,0)"
|
|
3512
3518
|
}), i < Math.floor(s.width - r - 1) && e !== a) {
|
|
3513
|
-
const
|
|
3514
|
-
this.ctx.paint.drawShadow(
|
|
3519
|
+
const l = s.width - (this.x + this.width) + r - e;
|
|
3520
|
+
this.ctx.paint.drawShadow(l + 1, this.y, e, this.height, {
|
|
3515
3521
|
fillColor: o,
|
|
3516
3522
|
side: "left",
|
|
3517
3523
|
shadowWidth: 4,
|
|
@@ -3535,8 +3541,8 @@ class fi {
|
|
|
3535
3541
|
const { header: t, database: e, scrollY: i } = this.ctx, s = i, { data: r, positions: o } = e.getData();
|
|
3536
3542
|
this.ctx.maxRowIndex = r.length - 1;
|
|
3537
3543
|
const a = this.binarySearch(o, s);
|
|
3538
|
-
let
|
|
3539
|
-
|
|
3544
|
+
let l = this.binarySearch(o, s + this.visibleHeight);
|
|
3545
|
+
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
3546
|
const c = [];
|
|
3541
3547
|
for (let d = 0; d < this.visibleRows.length; d++) {
|
|
3542
3548
|
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 +3560,15 @@ class fi {
|
|
|
3554
3560
|
}
|
|
3555
3561
|
class xi {
|
|
3556
3562
|
constructor(t) {
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3563
|
+
h(this, "ctx");
|
|
3564
|
+
h(this, "renderRows", []);
|
|
3565
|
+
h(this, "data", []);
|
|
3566
|
+
h(this, "x", 0);
|
|
3567
|
+
h(this, "y", 0);
|
|
3568
|
+
h(this, "width", 0);
|
|
3569
|
+
h(this, "height", 0);
|
|
3570
|
+
h(this, "visibleWidth", 0);
|
|
3571
|
+
h(this, "visibleHeight", 0);
|
|
3566
3572
|
this.ctx = t, this.init();
|
|
3567
3573
|
}
|
|
3568
3574
|
init() {
|
|
@@ -3570,9 +3576,9 @@ class xi {
|
|
|
3570
3576
|
const {
|
|
3571
3577
|
header: t,
|
|
3572
3578
|
body: e,
|
|
3573
|
-
config: { CELL_FOOTER_HEIGHT: i, FOOTER_FIXED: s, SCROLLER_TRACK_SIZE: r }
|
|
3579
|
+
config: { CELL_FOOTER_HEIGHT: i, FOOTER_FIXED: s, SCROLLER_TRACK_SIZE: r, FOOTER_POSITION: o }
|
|
3574
3580
|
} = this.ctx;
|
|
3575
|
-
this.width = t.width, this.visibleWidth = t.visibleWidth, this.height = this.data.reduce((
|
|
3581
|
+
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
3582
|
}
|
|
3577
3583
|
drawFiexShadow() {
|
|
3578
3584
|
const {
|
|
@@ -3583,8 +3589,8 @@ class xi {
|
|
|
3583
3589
|
stageWidth: r,
|
|
3584
3590
|
config: { HEADER_BG_COLOR: o, SCROLLER_TRACK_SIZE: a }
|
|
3585
3591
|
} = this.ctx;
|
|
3586
|
-
let
|
|
3587
|
-
if (this.ctx.config.FOOTER_FIXED || (
|
|
3592
|
+
let l = this.y;
|
|
3593
|
+
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
3594
|
fillColor: o,
|
|
3589
3595
|
side: "right",
|
|
3590
3596
|
shadowWidth: 4,
|
|
@@ -3592,7 +3598,7 @@ class xi {
|
|
|
3592
3598
|
colorEnd: "rgba(0,0,0,0)"
|
|
3593
3599
|
}), i < Math.floor(s.width - r - 1) && e !== a) {
|
|
3594
3600
|
const c = s.width - (this.x + this.width) + r - e;
|
|
3595
|
-
this.ctx.paint.drawShadow(c + 1,
|
|
3601
|
+
this.ctx.paint.drawShadow(c + 1, l, e, this.height, {
|
|
3596
3602
|
fillColor: o,
|
|
3597
3603
|
side: "left",
|
|
3598
3604
|
shadowWidth: 4,
|
|
@@ -3607,16 +3613,7 @@ class xi {
|
|
|
3607
3613
|
let e = this.y;
|
|
3608
3614
|
const i = [];
|
|
3609
3615
|
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
|
-
);
|
|
3616
|
+
const o = new se(this.ctx, r, 0, e, this.width, t, s, "footer");
|
|
3620
3617
|
e += t, i.push(o);
|
|
3621
3618
|
}), this.renderRows = i, this.ctx.footer.renderRows = this.renderRows;
|
|
3622
3619
|
}
|
|
@@ -3631,15 +3628,15 @@ class xi {
|
|
|
3631
3628
|
class ui {
|
|
3632
3629
|
// 垂直滚动定时器
|
|
3633
3630
|
constructor(t) {
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3631
|
+
h(this, "isCut", !1);
|
|
3632
|
+
h(this, "isMultipleRow", !1);
|
|
3633
|
+
h(this, "mousedownHeader", !1);
|
|
3634
|
+
h(this, "ctx");
|
|
3635
|
+
h(this, "adjustPositionX", "");
|
|
3636
|
+
h(this, "adjustPositionY", "");
|
|
3637
|
+
h(this, "timerX", 0);
|
|
3641
3638
|
// 水平滚动定时器
|
|
3642
|
-
|
|
3639
|
+
h(this, "timerY", 0);
|
|
3643
3640
|
this.ctx = t, this.init();
|
|
3644
3641
|
}
|
|
3645
3642
|
init() {
|
|
@@ -3705,7 +3702,7 @@ class ui {
|
|
|
3705
3702
|
return;
|
|
3706
3703
|
}
|
|
3707
3704
|
if (t.code === "Delete" || t.code === "Backspace") {
|
|
3708
|
-
t.preventDefault()
|
|
3705
|
+
t.preventDefault();
|
|
3709
3706
|
const { xArr: e, yArr: i } = this.ctx.selector;
|
|
3710
3707
|
this.clearSelectedData(e, i);
|
|
3711
3708
|
return;
|
|
@@ -3741,12 +3738,12 @@ class ui {
|
|
|
3741
3738
|
this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0;
|
|
3742
3739
|
const {
|
|
3743
3740
|
SELECTOR_AREA_MIN_X: a,
|
|
3744
|
-
SELECTOR_AREA_MAX_X:
|
|
3741
|
+
SELECTOR_AREA_MAX_X: l,
|
|
3745
3742
|
SELECTOR_AREA_MIN_Y: c,
|
|
3746
3743
|
SELECTOR_AREA_MAX_Y: d,
|
|
3747
3744
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
3748
3745
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
3749
|
-
} = this.ctx.config, u = a, g =
|
|
3746
|
+
} = this.ctx.config, u = a, g = l || this.ctx.maxColIndex - f, w = c, p = d || this.ctx.maxRowIndex - x;
|
|
3750
3747
|
let [y, b] = r, [m, E] = o;
|
|
3751
3748
|
if (y < u || b > g || m < w || E > p)
|
|
3752
3749
|
return;
|
|
@@ -3764,15 +3761,15 @@ class ui {
|
|
|
3764
3761
|
if (this.ctx.mousedown && this.ctx.focusCellHeader) {
|
|
3765
3762
|
const { colIndex: a } = this.ctx.focusCellHeader;
|
|
3766
3763
|
if (this.ctx.clearSelector(), t.colIndex >= a) {
|
|
3767
|
-
const
|
|
3768
|
-
this.setSelector(
|
|
3764
|
+
const l = [a, t.colIndex + t.colspan - 1], c = [r, o];
|
|
3765
|
+
this.setSelector(l, c);
|
|
3769
3766
|
} else {
|
|
3770
|
-
const
|
|
3771
|
-
this.setSelector(
|
|
3767
|
+
const l = [t.colIndex, a], c = [r, o];
|
|
3768
|
+
this.setSelector(l, c);
|
|
3772
3769
|
}
|
|
3773
3770
|
} else {
|
|
3774
|
-
const a = [t.colIndex, t.colIndex + t.colspan - 1],
|
|
3775
|
-
this.setSelector(a,
|
|
3771
|
+
const a = [t.colIndex, t.colIndex + t.colspan - 1], l = [r, o];
|
|
3772
|
+
this.setSelector(a, l);
|
|
3776
3773
|
}
|
|
3777
3774
|
}
|
|
3778
3775
|
selectAll() {
|
|
@@ -3786,8 +3783,8 @@ class ui {
|
|
|
3786
3783
|
SELECTOR_AREA_MIN_Y: r,
|
|
3787
3784
|
SELECTOR_AREA_MAX_Y: o,
|
|
3788
3785
|
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 -
|
|
3786
|
+
SELECTOR_AREA_MAX_Y_OFFSET: l
|
|
3787
|
+
} = 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
3788
|
this.setSelector(u, g);
|
|
3792
3789
|
}
|
|
3793
3790
|
}
|
|
@@ -3797,16 +3794,16 @@ class ui {
|
|
|
3797
3794
|
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
3795
|
if (e) {
|
|
3799
3796
|
this.ctx.setFocusCell(t);
|
|
3800
|
-
const
|
|
3801
|
-
this.setSelector(
|
|
3797
|
+
const l = [a, o], c = [t.rowIndex, t.rowIndex];
|
|
3798
|
+
this.setSelector(l, c);
|
|
3802
3799
|
}
|
|
3803
3800
|
if (this.ctx.focusCell && this.ctx.mousedown) {
|
|
3804
|
-
const { rowIndex:
|
|
3805
|
-
if (t.rowIndex >=
|
|
3806
|
-
const c = [a, o], d = [
|
|
3801
|
+
const { rowIndex: l } = this.ctx.focusCell;
|
|
3802
|
+
if (t.rowIndex >= l) {
|
|
3803
|
+
const c = [a, o], d = [l, t.rowIndex];
|
|
3807
3804
|
this.setSelector(c, d);
|
|
3808
3805
|
} else {
|
|
3809
|
-
const c = [a, o], d = [t.rowIndex,
|
|
3806
|
+
const c = [a, o], d = [t.rowIndex, l];
|
|
3810
3807
|
this.setSelector(c, d);
|
|
3811
3808
|
}
|
|
3812
3809
|
}
|
|
@@ -3816,7 +3813,7 @@ class ui {
|
|
|
3816
3813
|
return;
|
|
3817
3814
|
const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
|
|
3818
3815
|
if (t && e && i) {
|
|
3819
|
-
const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), a = Math.max(i.colIndex, r),
|
|
3816
|
+
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
3817
|
this.setSelector(d, f);
|
|
3821
3818
|
}
|
|
3822
3819
|
}
|
|
@@ -3824,7 +3821,7 @@ class ui {
|
|
|
3824
3821
|
const { focusCell: e, clickCell: i } = this.ctx;
|
|
3825
3822
|
if (e && this.isInSettingRange(e.rowIndex, e.colIndex))
|
|
3826
3823
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
3827
|
-
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: a } = e,
|
|
3824
|
+
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
3825
|
this.setSelector(x, u);
|
|
3829
3826
|
} else {
|
|
3830
3827
|
this.ctx.emit("cellSelectedClick", e);
|
|
@@ -3865,8 +3862,8 @@ class ui {
|
|
|
3865
3862
|
let s = [];
|
|
3866
3863
|
const r = /* @__PURE__ */ new Set();
|
|
3867
3864
|
for (let a = 0; a <= e[1] - e[0]; a++)
|
|
3868
|
-
for (let
|
|
3869
|
-
const c = a + e[0], d =
|
|
3865
|
+
for (let l = 0; l <= t[1] - t[0]; l++) {
|
|
3866
|
+
const c = a + e[0], d = l + t[0], f = this.ctx.database.getItemValueForRowIndexAndColIndex(c, d);
|
|
3870
3867
|
if (f) {
|
|
3871
3868
|
const { rowKey: x, key: u } = f;
|
|
3872
3869
|
this.ctx.database.getReadonly(x, u) || (r.add(x), s.push({
|
|
@@ -3897,10 +3894,7 @@ class ui {
|
|
|
3897
3894
|
if (this.ctx.selector.enable && t) {
|
|
3898
3895
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
3899
3896
|
navigator.clipboard.readText().then(async (r) => {
|
|
3900
|
-
|
|
3901
|
-
let o = ti(r);
|
|
3902
|
-
console.log(o);
|
|
3903
|
-
let a = [];
|
|
3897
|
+
let o = ti(r), a = [];
|
|
3904
3898
|
for (let d = 0; d <= o.length - 1; d++) {
|
|
3905
3899
|
const f = o[d].length;
|
|
3906
3900
|
for (let x = 0; x <= f - 1; x++) {
|
|
@@ -3933,9 +3927,9 @@ class ui {
|
|
|
3933
3927
|
}
|
|
3934
3928
|
if (!a.length)
|
|
3935
3929
|
return;
|
|
3936
|
-
const { BEFORE_PASTE_CHANGE_METHOD:
|
|
3937
|
-
if (typeof
|
|
3938
|
-
const d =
|
|
3930
|
+
const { BEFORE_PASTE_CHANGE_METHOD: l } = this.ctx.config;
|
|
3931
|
+
if (typeof l == "function") {
|
|
3932
|
+
const d = l, f = a.map((x) => ({
|
|
3939
3933
|
rowKey: x.rowKey,
|
|
3940
3934
|
key: x.key,
|
|
3941
3935
|
value: x.value,
|
|
@@ -3964,7 +3958,7 @@ class ui {
|
|
|
3964
3958
|
if (!e)
|
|
3965
3959
|
return;
|
|
3966
3960
|
let { colIndex: i = 0, rowIndex: s = 0 } = e;
|
|
3967
|
-
const r = 0, o = 0, a = this.ctx.maxColIndex,
|
|
3961
|
+
const r = 0, o = 0, a = this.ctx.maxColIndex, l = this.ctx.maxRowIndex;
|
|
3968
3962
|
switch (t) {
|
|
3969
3963
|
case "LEFT":
|
|
3970
3964
|
i > r && i--;
|
|
@@ -3976,7 +3970,7 @@ class ui {
|
|
|
3976
3970
|
i < a && i++;
|
|
3977
3971
|
break;
|
|
3978
3972
|
case "BOTTOM":
|
|
3979
|
-
s <
|
|
3973
|
+
s < l && s++;
|
|
3980
3974
|
break;
|
|
3981
3975
|
}
|
|
3982
3976
|
const c = [i, i], d = [s, s], f = this.getCell(s, i);
|
|
@@ -3993,8 +3987,8 @@ class ui {
|
|
|
3993
3987
|
SELECTOR_AREA_MIN_Y: r,
|
|
3994
3988
|
SELECTOR_AREA_MAX_Y: o,
|
|
3995
3989
|
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 -
|
|
3990
|
+
SELECTOR_AREA_MAX_Y_OFFSET: l
|
|
3991
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - a, f = r, x = o || this.ctx.maxRowIndex - l;
|
|
3998
3992
|
return !(e < c || e > d || t < f || t > x);
|
|
3999
3993
|
}
|
|
4000
3994
|
/**
|
|
@@ -4008,7 +4002,7 @@ class ui {
|
|
|
4008
4002
|
let a = 10 * (s === "left" ? -1 : 1);
|
|
4009
4003
|
this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
|
|
4010
4004
|
a *= 1.5;
|
|
4011
|
-
const { scrollX:
|
|
4005
|
+
const { scrollX: l } = this.ctx, c = l + a;
|
|
4012
4006
|
(c < 0 || c > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(c);
|
|
4013
4007
|
}, 100);
|
|
4014
4008
|
}
|
|
@@ -4017,7 +4011,7 @@ class ui {
|
|
|
4017
4011
|
let a = 10 * (r === "top" ? -1 : 1);
|
|
4018
4012
|
this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
|
|
4019
4013
|
a *= 1.5;
|
|
4020
|
-
const { scrollY:
|
|
4014
|
+
const { scrollY: l } = this.ctx, c = l + a;
|
|
4021
4015
|
(c < 0 || c > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(c);
|
|
4022
4016
|
}, 100);
|
|
4023
4017
|
}
|
|
@@ -4034,21 +4028,21 @@ class ui {
|
|
|
4034
4028
|
fixedLeftWidth: r,
|
|
4035
4029
|
header: o,
|
|
4036
4030
|
footer: a,
|
|
4037
|
-
body:
|
|
4031
|
+
body: l,
|
|
4038
4032
|
scrollX: c,
|
|
4039
4033
|
scrollY: d,
|
|
4040
|
-
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: x }
|
|
4034
|
+
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: x, FOOTER_POSITION: u }
|
|
4041
4035
|
} = this.ctx;
|
|
4042
4036
|
if (!i)
|
|
4043
4037
|
return;
|
|
4044
|
-
const
|
|
4045
|
-
let p = i.height;
|
|
4046
|
-
|
|
4047
|
-
let
|
|
4048
|
-
x && (
|
|
4049
|
-
const
|
|
4050
|
-
let
|
|
4051
|
-
|
|
4038
|
+
const g = r - i.drawX + 1, w = i.drawX + i.width - (e - s) + 1;
|
|
4039
|
+
let p = o.height - i.drawY, y = i.height;
|
|
4040
|
+
y > l.visibleHeight && (y = l.visibleHeight);
|
|
4041
|
+
let b = 0;
|
|
4042
|
+
x && (u === "top" ? p = o.height + a.height - i.drawY : b = a.visibleHeight);
|
|
4043
|
+
const m = i.drawY + y - (t - b - f);
|
|
4044
|
+
let E = c, C = d;
|
|
4045
|
+
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
4046
|
}
|
|
4053
4047
|
destroy() {
|
|
4054
4048
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
@@ -4056,14 +4050,14 @@ class ui {
|
|
|
4056
4050
|
}
|
|
4057
4051
|
class gi {
|
|
4058
4052
|
constructor(t) {
|
|
4059
|
-
|
|
4053
|
+
h(this, "ctx");
|
|
4060
4054
|
this.ctx = t, this.init();
|
|
4061
4055
|
}
|
|
4062
4056
|
init() {
|
|
4063
4057
|
this.ctx.on("cellMouseenter", (t, e) => {
|
|
4064
4058
|
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 ===
|
|
4059
|
+
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;
|
|
4060
|
+
if (this.ctx.config.ENABLE_AUTOFILL && c === a && d === l) {
|
|
4067
4061
|
const p = f + u - 6, y = x + g - 6;
|
|
4068
4062
|
i > p && s > y && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4069
4063
|
}
|
|
@@ -4096,22 +4090,22 @@ class gi {
|
|
|
4096
4090
|
return;
|
|
4097
4091
|
let o = t, a = e;
|
|
4098
4092
|
if (!r) {
|
|
4099
|
-
const [
|
|
4100
|
-
a = [
|
|
4093
|
+
const [l] = a;
|
|
4094
|
+
a = [l, l];
|
|
4101
4095
|
}
|
|
4102
4096
|
if (!s) {
|
|
4103
|
-
const [
|
|
4104
|
-
o = [
|
|
4097
|
+
const [l] = o;
|
|
4098
|
+
o = [l, l];
|
|
4105
4099
|
}
|
|
4106
4100
|
if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(o) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(a)) {
|
|
4107
4101
|
const {
|
|
4108
|
-
SELECTOR_AREA_MIN_X:
|
|
4102
|
+
SELECTOR_AREA_MIN_X: l,
|
|
4109
4103
|
SELECTOR_AREA_MAX_X: c,
|
|
4110
4104
|
SELECTOR_AREA_MIN_Y: d,
|
|
4111
4105
|
SELECTOR_AREA_MAX_Y: f,
|
|
4112
4106
|
SELECTOR_AREA_MAX_X_OFFSET: x,
|
|
4113
4107
|
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
4114
|
-
} = this.ctx.config, g =
|
|
4108
|
+
} = this.ctx.config, g = l, w = c || this.ctx.maxColIndex - x, p = d, y = f || this.ctx.maxRowIndex - u;
|
|
4115
4109
|
let [b, m] = o, [E, C] = a;
|
|
4116
4110
|
if (b < g || E < p)
|
|
4117
4111
|
return;
|
|
@@ -4128,11 +4122,11 @@ class gi {
|
|
|
4128
4122
|
const g = x + e.yArr[0], w = u + e.xArr[0];
|
|
4129
4123
|
i.set(`${g}-${w}`, !0);
|
|
4130
4124
|
}
|
|
4131
|
-
const { value: s } = e, r = s[0].length, o = s.length, a = this.ctx.autofill.xArr,
|
|
4125
|
+
const { value: s } = e, r = s[0].length, o = s.length, a = this.ctx.autofill.xArr, l = this.ctx.autofill.yArr;
|
|
4132
4126
|
let c = [];
|
|
4133
|
-
for (let x = 0; x <=
|
|
4127
|
+
for (let x = 0; x <= l[1] - l[0]; x++)
|
|
4134
4128
|
for (let u = 0; u <= a[1] - a[0]; u++) {
|
|
4135
|
-
const g = u + a[0], w = x +
|
|
4129
|
+
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
4130
|
if (y && !i.has(b)) {
|
|
4137
4131
|
const { rowKey: m, key: E } = y;
|
|
4138
4132
|
this.ctx.database.getReadonly(m, E) || (t.add(m), c.push({
|
|
@@ -4186,7 +4180,7 @@ const rt = Math.min, U = Math.max, ft = Math.round, V = (n) => ({
|
|
|
4186
4180
|
start: "end",
|
|
4187
4181
|
end: "start"
|
|
4188
4182
|
};
|
|
4189
|
-
function
|
|
4183
|
+
function Ot(n, t, e) {
|
|
4190
4184
|
return U(n, rt(t, e));
|
|
4191
4185
|
}
|
|
4192
4186
|
function at(n, t) {
|
|
@@ -4195,7 +4189,7 @@ function at(n, t) {
|
|
|
4195
4189
|
function q(n) {
|
|
4196
4190
|
return n.split("-")[0];
|
|
4197
4191
|
}
|
|
4198
|
-
function
|
|
4192
|
+
function ht(n) {
|
|
4199
4193
|
return n.split("-")[1];
|
|
4200
4194
|
}
|
|
4201
4195
|
function re(n) {
|
|
@@ -4212,15 +4206,15 @@ function Mt(n) {
|
|
|
4212
4206
|
}
|
|
4213
4207
|
function yi(n, t, e) {
|
|
4214
4208
|
e === void 0 && (e = !1);
|
|
4215
|
-
const i =
|
|
4209
|
+
const i = ht(n), s = Mt(n), r = Lt(s);
|
|
4216
4210
|
let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4217
4211
|
return t.reference[r] > t.floating[r] && (o = xt(o)), [o, xt(o)];
|
|
4218
4212
|
}
|
|
4219
4213
|
function mi(n) {
|
|
4220
4214
|
const t = xt(n);
|
|
4221
|
-
return [
|
|
4215
|
+
return [It(n), t, It(t)];
|
|
4222
4216
|
}
|
|
4223
|
-
function
|
|
4217
|
+
function It(n) {
|
|
4224
4218
|
return n.replace(/start|end/g, (t) => pi[t]);
|
|
4225
4219
|
}
|
|
4226
4220
|
function Ei(n, t, e) {
|
|
@@ -4237,9 +4231,9 @@ function Ei(n, t, e) {
|
|
|
4237
4231
|
}
|
|
4238
4232
|
}
|
|
4239
4233
|
function bi(n, t, e, i) {
|
|
4240
|
-
const s =
|
|
4234
|
+
const s = ht(n);
|
|
4241
4235
|
let r = Ei(q(n), e === "start", i);
|
|
4242
|
-
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(
|
|
4236
|
+
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(It)))), r;
|
|
4243
4237
|
}
|
|
4244
4238
|
function xt(n) {
|
|
4245
4239
|
return n.replace(/left|right|bottom|top/g, (t) => wi[t]);
|
|
@@ -4284,9 +4278,9 @@ function Vt(n, t, e) {
|
|
|
4284
4278
|
reference: i,
|
|
4285
4279
|
floating: s
|
|
4286
4280
|
} = n;
|
|
4287
|
-
const r = J(t), o = Mt(t), a = Lt(o),
|
|
4281
|
+
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
4282
|
let u;
|
|
4289
|
-
switch (
|
|
4283
|
+
switch (l) {
|
|
4290
4284
|
case "top":
|
|
4291
4285
|
u = {
|
|
4292
4286
|
x: d,
|
|
@@ -4317,7 +4311,7 @@ function Vt(n, t, e) {
|
|
|
4317
4311
|
y: i.y
|
|
4318
4312
|
};
|
|
4319
4313
|
}
|
|
4320
|
-
switch (
|
|
4314
|
+
switch (ht(t)) {
|
|
4321
4315
|
case "start":
|
|
4322
4316
|
u[o] -= x * (e && c ? -1 : 1);
|
|
4323
4317
|
break;
|
|
@@ -4333,7 +4327,7 @@ const vi = async (n, t, e) => {
|
|
|
4333
4327
|
strategy: s = "absolute",
|
|
4334
4328
|
middleware: r = [],
|
|
4335
4329
|
platform: o
|
|
4336
|
-
} = e, a = r.filter(Boolean),
|
|
4330
|
+
} = e, a = r.filter(Boolean), l = await (o.isRTL == null ? void 0 : o.isRTL(t));
|
|
4337
4331
|
let c = await o.getElementRects({
|
|
4338
4332
|
reference: n,
|
|
4339
4333
|
floating: t,
|
|
@@ -4341,7 +4335,7 @@ const vi = async (n, t, e) => {
|
|
|
4341
4335
|
}), {
|
|
4342
4336
|
x: d,
|
|
4343
4337
|
y: f
|
|
4344
|
-
} = Vt(c, i,
|
|
4338
|
+
} = Vt(c, i, l), x = i, u = {}, g = 0;
|
|
4345
4339
|
for (let w = 0; w < a.length; w++) {
|
|
4346
4340
|
const {
|
|
4347
4341
|
name: p,
|
|
@@ -4378,7 +4372,7 @@ const vi = async (n, t, e) => {
|
|
|
4378
4372
|
}) : C.rects), {
|
|
4379
4373
|
x: d,
|
|
4380
4374
|
y: f
|
|
4381
|
-
} = Vt(c, x,
|
|
4375
|
+
} = Vt(c, x, l)), w = -1);
|
|
4382
4376
|
}
|
|
4383
4377
|
return {
|
|
4384
4378
|
x: d,
|
|
@@ -4397,7 +4391,7 @@ async function ne(n, t) {
|
|
|
4397
4391
|
platform: r,
|
|
4398
4392
|
rects: o,
|
|
4399
4393
|
elements: a,
|
|
4400
|
-
strategy:
|
|
4394
|
+
strategy: l
|
|
4401
4395
|
} = n, {
|
|
4402
4396
|
boundary: c = "clippingAncestors",
|
|
4403
4397
|
rootBoundary: d = "viewport",
|
|
@@ -4408,7 +4402,7 @@ async function ne(n, t) {
|
|
|
4408
4402
|
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
4403
|
boundary: c,
|
|
4410
4404
|
rootBoundary: d,
|
|
4411
|
-
strategy:
|
|
4405
|
+
strategy: l
|
|
4412
4406
|
})), b = f === "floating" ? {
|
|
4413
4407
|
x: i,
|
|
4414
4408
|
y: s,
|
|
@@ -4424,7 +4418,7 @@ async function ne(n, t) {
|
|
|
4424
4418
|
elements: a,
|
|
4425
4419
|
rect: b,
|
|
4426
4420
|
offsetParent: m,
|
|
4427
|
-
strategy:
|
|
4421
|
+
strategy: l
|
|
4428
4422
|
}) : b);
|
|
4429
4423
|
return {
|
|
4430
4424
|
top: (y.top - C.top + g.top) / E.y,
|
|
@@ -4444,7 +4438,7 @@ const Ri = (n) => ({
|
|
|
4444
4438
|
rects: r,
|
|
4445
4439
|
platform: o,
|
|
4446
4440
|
elements: a,
|
|
4447
|
-
middlewareData:
|
|
4441
|
+
middlewareData: l
|
|
4448
4442
|
} = t, {
|
|
4449
4443
|
element: c,
|
|
4450
4444
|
padding: d = 0
|
|
@@ -4455,14 +4449,14 @@ const Ri = (n) => ({
|
|
|
4455
4449
|
x: e,
|
|
4456
4450
|
y: i
|
|
4457
4451
|
}, 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 =
|
|
4452
|
+
let O = R ? R[m] : 0;
|
|
4453
|
+
(!O || !await (o.isElement == null ? void 0 : o.isElement(R))) && (O = a.floating[m] || r.floating[g]);
|
|
4454
|
+
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
4455
|
return {
|
|
4462
4456
|
[u]: x[u] + k,
|
|
4463
4457
|
data: {
|
|
4464
4458
|
[u]: G,
|
|
4465
|
-
centerOffset:
|
|
4459
|
+
centerOffset: T - G - k,
|
|
4466
4460
|
...K && {
|
|
4467
4461
|
alignmentOffset: k
|
|
4468
4462
|
}
|
|
@@ -4481,7 +4475,7 @@ const Ri = (n) => ({
|
|
|
4481
4475
|
middlewareData: r,
|
|
4482
4476
|
rects: o,
|
|
4483
4477
|
initialPlacement: a,
|
|
4484
|
-
platform:
|
|
4478
|
+
platform: l,
|
|
4485
4479
|
elements: c
|
|
4486
4480
|
} = t, {
|
|
4487
4481
|
mainAxis: d = !0,
|
|
@@ -4494,24 +4488,24 @@ const Ri = (n) => ({
|
|
|
4494
4488
|
} = at(n, t);
|
|
4495
4489
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
4496
4490
|
return {};
|
|
4497
|
-
const y = q(s), b = J(a), m = q(a) === a, E = await (
|
|
4491
|
+
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
4492
|
!x && R && C.push(...bi(a, w, g, E));
|
|
4499
|
-
const
|
|
4493
|
+
const O = [a, ...C], S = await ne(t, p), L = [];
|
|
4500
4494
|
let D = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
4501
4495
|
if (d && L.push(S[y]), f) {
|
|
4502
|
-
const
|
|
4503
|
-
L.push(S[
|
|
4496
|
+
const T = yi(s, o, E);
|
|
4497
|
+
L.push(S[T[0]], S[T[1]]);
|
|
4504
4498
|
}
|
|
4505
4499
|
if (D = [...D, {
|
|
4506
4500
|
placement: s,
|
|
4507
4501
|
overflows: L
|
|
4508
|
-
}], !L.every((
|
|
4502
|
+
}], !L.every((T) => T <= 0)) {
|
|
4509
4503
|
var B, I;
|
|
4510
|
-
const
|
|
4504
|
+
const T = (((B = r.flip) == null ? void 0 : B.index) || 0) + 1, G = O[T];
|
|
4511
4505
|
if (G)
|
|
4512
4506
|
return {
|
|
4513
4507
|
data: {
|
|
4514
|
-
index:
|
|
4508
|
+
index: T,
|
|
4515
4509
|
overflows: D
|
|
4516
4510
|
},
|
|
4517
4511
|
reset: {
|
|
@@ -4522,8 +4516,8 @@ const Ri = (n) => ({
|
|
|
4522
4516
|
if (!K)
|
|
4523
4517
|
switch (u) {
|
|
4524
4518
|
case "bestFit": {
|
|
4525
|
-
var
|
|
4526
|
-
const k = (
|
|
4519
|
+
var A;
|
|
4520
|
+
const k = (A = D.filter((W) => {
|
|
4527
4521
|
if (R) {
|
|
4528
4522
|
const P = J(W.placement);
|
|
4529
4523
|
return P === b || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -4531,7 +4525,7 @@ const Ri = (n) => ({
|
|
|
4531
4525
|
P === "y";
|
|
4532
4526
|
}
|
|
4533
4527
|
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 :
|
|
4528
|
+
}).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
4529
|
k && (K = k);
|
|
4536
4530
|
break;
|
|
4537
4531
|
}
|
|
@@ -4550,12 +4544,12 @@ const Ri = (n) => ({
|
|
|
4550
4544
|
}
|
|
4551
4545
|
};
|
|
4552
4546
|
};
|
|
4553
|
-
async function
|
|
4547
|
+
async function Oi(n, t) {
|
|
4554
4548
|
const {
|
|
4555
4549
|
placement: e,
|
|
4556
4550
|
platform: i,
|
|
4557
4551
|
elements: s
|
|
4558
|
-
} = n, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), a =
|
|
4552
|
+
} = 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
4553
|
let {
|
|
4560
4554
|
mainAxis: x,
|
|
4561
4555
|
crossAxis: u,
|
|
@@ -4569,7 +4563,7 @@ async function Ii(n, t) {
|
|
|
4569
4563
|
crossAxis: f.crossAxis || 0,
|
|
4570
4564
|
alignmentAxis: f.alignmentAxis
|
|
4571
4565
|
};
|
|
4572
|
-
return a && typeof g == "number" && (u = a === "end" ? g * -1 : g),
|
|
4566
|
+
return a && typeof g == "number" && (u = a === "end" ? g * -1 : g), l ? {
|
|
4573
4567
|
x: u * d,
|
|
4574
4568
|
y: x * c
|
|
4575
4569
|
} : {
|
|
@@ -4577,7 +4571,7 @@ async function Ii(n, t) {
|
|
|
4577
4571
|
y: u * d
|
|
4578
4572
|
};
|
|
4579
4573
|
}
|
|
4580
|
-
const
|
|
4574
|
+
const Ii = function(n) {
|
|
4581
4575
|
return n === void 0 && (n = 0), {
|
|
4582
4576
|
name: "offset",
|
|
4583
4577
|
options: n,
|
|
@@ -4588,18 +4582,18 @@ const Oi = function(n) {
|
|
|
4588
4582
|
y: r,
|
|
4589
4583
|
placement: o,
|
|
4590
4584
|
middlewareData: a
|
|
4591
|
-
} = t,
|
|
4585
|
+
} = t, l = await Oi(t, n);
|
|
4592
4586
|
return o === ((e = a.offset) == null ? void 0 : e.placement) && (i = a.arrow) != null && i.alignmentOffset ? {} : {
|
|
4593
|
-
x: s +
|
|
4594
|
-
y: r +
|
|
4587
|
+
x: s + l.x,
|
|
4588
|
+
y: r + l.y,
|
|
4595
4589
|
data: {
|
|
4596
|
-
...
|
|
4590
|
+
...l,
|
|
4597
4591
|
placement: o
|
|
4598
4592
|
}
|
|
4599
4593
|
};
|
|
4600
4594
|
}
|
|
4601
4595
|
};
|
|
4602
|
-
},
|
|
4596
|
+
}, Ti = function(n) {
|
|
4603
4597
|
return n === void 0 && (n = {}), {
|
|
4604
4598
|
name: "shift",
|
|
4605
4599
|
options: n,
|
|
@@ -4623,19 +4617,19 @@ const Oi = function(n) {
|
|
|
4623
4617
|
};
|
|
4624
4618
|
}
|
|
4625
4619
|
},
|
|
4626
|
-
...
|
|
4620
|
+
...l
|
|
4627
4621
|
} = at(n, t), c = {
|
|
4628
4622
|
x: e,
|
|
4629
4623
|
y: i
|
|
4630
|
-
}, d = await ne(t,
|
|
4624
|
+
}, d = await ne(t, l), f = J(q(s)), x = re(f);
|
|
4631
4625
|
let u = c[x], g = c[f];
|
|
4632
4626
|
if (r) {
|
|
4633
4627
|
const p = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", b = u + d[p], m = u - d[y];
|
|
4634
|
-
u =
|
|
4628
|
+
u = Ot(b, u, m);
|
|
4635
4629
|
}
|
|
4636
4630
|
if (o) {
|
|
4637
4631
|
const p = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", b = g + d[p], m = g - d[y];
|
|
4638
|
-
g =
|
|
4632
|
+
g = Ot(b, g, m);
|
|
4639
4633
|
}
|
|
4640
4634
|
const w = a.fn({
|
|
4641
4635
|
...t,
|
|
@@ -4682,7 +4676,7 @@ function N(n) {
|
|
|
4682
4676
|
function zt(n) {
|
|
4683
4677
|
return !gt() || typeof ShadowRoot > "u" ? !1 : n instanceof ShadowRoot || n instanceof H(n).ShadowRoot;
|
|
4684
4678
|
}
|
|
4685
|
-
function
|
|
4679
|
+
function lt(n) {
|
|
4686
4680
|
const {
|
|
4687
4681
|
overflow: t,
|
|
4688
4682
|
overflowX: e,
|
|
@@ -4691,7 +4685,7 @@ function ht(n) {
|
|
|
4691
4685
|
} = X(n);
|
|
4692
4686
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
|
|
4693
4687
|
}
|
|
4694
|
-
function
|
|
4688
|
+
function Si(n) {
|
|
4695
4689
|
return ["table", "td", "th"].includes(tt(n));
|
|
4696
4690
|
}
|
|
4697
4691
|
function wt(n) {
|
|
@@ -4707,7 +4701,7 @@ function Ht(n) {
|
|
|
4707
4701
|
const t = Dt(), e = F(n) ? X(n) : n;
|
|
4708
4702
|
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
4703
|
}
|
|
4710
|
-
function
|
|
4704
|
+
function Ai(n) {
|
|
4711
4705
|
let t = z(n);
|
|
4712
4706
|
for (; N(t) && !Q(t); ) {
|
|
4713
4707
|
if (Ht(t))
|
|
@@ -4748,24 +4742,24 @@ function z(n) {
|
|
|
4748
4742
|
);
|
|
4749
4743
|
return zt(t) ? t.host : t;
|
|
4750
4744
|
}
|
|
4751
|
-
function
|
|
4745
|
+
function he(n) {
|
|
4752
4746
|
const t = z(n);
|
|
4753
|
-
return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) &&
|
|
4747
|
+
return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) && lt(t) ? t : he(t);
|
|
4754
4748
|
}
|
|
4755
|
-
function
|
|
4749
|
+
function Tt(n, t, e) {
|
|
4756
4750
|
var i;
|
|
4757
4751
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
4758
|
-
const s =
|
|
4752
|
+
const s = he(n), r = s === ((i = n.ownerDocument) == null ? void 0 : i.body), o = H(s);
|
|
4759
4753
|
if (r) {
|
|
4760
|
-
const a =
|
|
4761
|
-
return t.concat(o, o.visualViewport || [],
|
|
4754
|
+
const a = St(o);
|
|
4755
|
+
return t.concat(o, o.visualViewport || [], lt(s) ? s : [], a && e ? Tt(a) : []);
|
|
4762
4756
|
}
|
|
4763
|
-
return t.concat(s,
|
|
4757
|
+
return t.concat(s, Tt(s, [], e));
|
|
4764
4758
|
}
|
|
4765
|
-
function
|
|
4759
|
+
function St(n) {
|
|
4766
4760
|
return n.parent && Object.getPrototypeOf(n.parent) ? n.frameElement : null;
|
|
4767
4761
|
}
|
|
4768
|
-
function
|
|
4762
|
+
function le(n) {
|
|
4769
4763
|
const t = X(n);
|
|
4770
4764
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
4771
4765
|
const s = N(n), r = s ? n.offsetWidth : e, o = s ? n.offsetHeight : i, a = ft(e) !== r || ft(i) !== o;
|
|
@@ -4786,7 +4780,7 @@ function Z(n) {
|
|
|
4786
4780
|
width: i,
|
|
4787
4781
|
height: s,
|
|
4788
4782
|
$: r
|
|
4789
|
-
} =
|
|
4783
|
+
} = le(t);
|
|
4790
4784
|
let o = (r ? ft(e.width) : e.width) / i, a = (r ? ft(e.height) : e.height) / s;
|
|
4791
4785
|
return (!o || !Number.isFinite(o)) && (o = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
4792
4786
|
x: o,
|
|
@@ -4810,19 +4804,19 @@ function ot(n, t, e, i) {
|
|
|
4810
4804
|
let o = V(1);
|
|
4811
4805
|
t && (i ? F(i) && (o = Z(i)) : o = Z(n));
|
|
4812
4806
|
const a = Mi(r, e, i) ? de(r) : V(0);
|
|
4813
|
-
let
|
|
4807
|
+
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
4808
|
if (r) {
|
|
4815
4809
|
const x = H(r), u = i && F(i) ? H(i) : i;
|
|
4816
|
-
let g = x, w =
|
|
4810
|
+
let g = x, w = St(g);
|
|
4817
4811
|
for (; w && i && u !== g; ) {
|
|
4818
4812
|
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
|
-
|
|
4813
|
+
l *= p.x, c *= p.y, d *= p.x, f *= p.y, l += m, c += E, g = H(w), w = St(g);
|
|
4820
4814
|
}
|
|
4821
4815
|
}
|
|
4822
4816
|
return ut({
|
|
4823
4817
|
width: d,
|
|
4824
4818
|
height: f,
|
|
4825
|
-
x:
|
|
4819
|
+
x: l,
|
|
4826
4820
|
y: c
|
|
4827
4821
|
});
|
|
4828
4822
|
}
|
|
@@ -4836,32 +4830,32 @@ function Hi(n) {
|
|
|
4836
4830
|
const r = s === "fixed", o = Y(i), a = t ? wt(t.floating) : !1;
|
|
4837
4831
|
if (i === o || a && r)
|
|
4838
4832
|
return e;
|
|
4839
|
-
let
|
|
4833
|
+
let l = {
|
|
4840
4834
|
scrollLeft: 0,
|
|
4841
4835
|
scrollTop: 0
|
|
4842
4836
|
}, c = V(1);
|
|
4843
4837
|
const d = V(0), f = N(i);
|
|
4844
|
-
if ((f || !f && !r) && ((tt(i) !== "body" ||
|
|
4838
|
+
if ((f || !f && !r) && ((tt(i) !== "body" || lt(o)) && (l = pt(i)), N(i))) {
|
|
4845
4839
|
const x = ot(i);
|
|
4846
4840
|
c = Z(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
|
|
4847
4841
|
}
|
|
4848
4842
|
return {
|
|
4849
4843
|
width: e.width * c.x,
|
|
4850
4844
|
height: e.height * c.y,
|
|
4851
|
-
x: e.x * c.x -
|
|
4852
|
-
y: e.y * c.y -
|
|
4845
|
+
x: e.x * c.x - l.scrollLeft * c.x + d.x,
|
|
4846
|
+
y: e.y * c.y - l.scrollTop * c.y + d.y
|
|
4853
4847
|
};
|
|
4854
4848
|
}
|
|
4855
4849
|
function Di(n) {
|
|
4856
4850
|
return Array.from(n.getClientRects());
|
|
4857
4851
|
}
|
|
4858
|
-
function
|
|
4852
|
+
function At(n, t) {
|
|
4859
4853
|
const e = pt(n).scrollLeft;
|
|
4860
4854
|
return t ? t.left + e : ot(Y(n)).left + e;
|
|
4861
4855
|
}
|
|
4862
4856
|
function Fi(n) {
|
|
4863
4857
|
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 +
|
|
4858
|
+
let o = -e.scrollLeft + At(n);
|
|
4865
4859
|
const a = -e.scrollTop;
|
|
4866
4860
|
return X(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
|
|
4867
4861
|
width: s,
|
|
@@ -4872,25 +4866,25 @@ function Fi(n) {
|
|
|
4872
4866
|
}
|
|
4873
4867
|
function Xi(n, t) {
|
|
4874
4868
|
const e = H(n), i = Y(n), s = e.visualViewport;
|
|
4875
|
-
let r = i.clientWidth, o = i.clientHeight, a = 0,
|
|
4869
|
+
let r = i.clientWidth, o = i.clientHeight, a = 0, l = 0;
|
|
4876
4870
|
if (s) {
|
|
4877
4871
|
r = s.width, o = s.height;
|
|
4878
4872
|
const c = Dt();
|
|
4879
|
-
(!c || c && t === "fixed") && (a = s.offsetLeft,
|
|
4873
|
+
(!c || c && t === "fixed") && (a = s.offsetLeft, l = s.offsetTop);
|
|
4880
4874
|
}
|
|
4881
4875
|
return {
|
|
4882
4876
|
width: r,
|
|
4883
4877
|
height: o,
|
|
4884
4878
|
x: a,
|
|
4885
|
-
y:
|
|
4879
|
+
y: l
|
|
4886
4880
|
};
|
|
4887
4881
|
}
|
|
4888
4882
|
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,
|
|
4883
|
+
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
4884
|
return {
|
|
4891
4885
|
width: o,
|
|
4892
4886
|
height: a,
|
|
4893
|
-
x:
|
|
4887
|
+
x: l,
|
|
4894
4888
|
y: c
|
|
4895
4889
|
};
|
|
4896
4890
|
}
|
|
@@ -4920,12 +4914,12 @@ function Ni(n, t) {
|
|
|
4920
4914
|
const e = t.get(n);
|
|
4921
4915
|
if (e)
|
|
4922
4916
|
return e;
|
|
4923
|
-
let i =
|
|
4917
|
+
let i = Tt(n, [], !1).filter((a) => F(a) && tt(a) !== "body"), s = null;
|
|
4924
4918
|
const r = X(n).position === "fixed";
|
|
4925
4919
|
let o = r ? z(n) : n;
|
|
4926
4920
|
for (; F(o) && !Q(o); ) {
|
|
4927
|
-
const a = X(o),
|
|
4928
|
-
!
|
|
4921
|
+
const a = X(o), l = Ht(o);
|
|
4922
|
+
!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
4923
|
}
|
|
4930
4924
|
return t.set(n, i), i;
|
|
4931
4925
|
}
|
|
@@ -4936,22 +4930,22 @@ function Ki(n) {
|
|
|
4936
4930
|
rootBoundary: i,
|
|
4937
4931
|
strategy: s
|
|
4938
4932
|
} = n;
|
|
4939
|
-
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0],
|
|
4933
|
+
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0], l = o.reduce((c, d) => {
|
|
4940
4934
|
const f = $t(t, d, s);
|
|
4941
4935
|
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
4936
|
}, $t(t, a, s));
|
|
4943
4937
|
return {
|
|
4944
|
-
width:
|
|
4945
|
-
height:
|
|
4946
|
-
x:
|
|
4947
|
-
y:
|
|
4938
|
+
width: l.right - l.left,
|
|
4939
|
+
height: l.bottom - l.top,
|
|
4940
|
+
x: l.left,
|
|
4941
|
+
y: l.top
|
|
4948
4942
|
};
|
|
4949
4943
|
}
|
|
4950
4944
|
function Yi(n) {
|
|
4951
4945
|
const {
|
|
4952
4946
|
width: t,
|
|
4953
4947
|
height: e
|
|
4954
|
-
} =
|
|
4948
|
+
} = le(n);
|
|
4955
4949
|
return {
|
|
4956
4950
|
width: t,
|
|
4957
4951
|
height: e
|
|
@@ -4963,19 +4957,19 @@ function Bi(n, t, e) {
|
|
|
4963
4957
|
scrollLeft: 0,
|
|
4964
4958
|
scrollTop: 0
|
|
4965
4959
|
};
|
|
4966
|
-
const
|
|
4960
|
+
const l = V(0);
|
|
4967
4961
|
if (i || !i && !r)
|
|
4968
|
-
if ((tt(t) !== "body" ||
|
|
4962
|
+
if ((tt(t) !== "body" || lt(s)) && (a = pt(t)), i) {
|
|
4969
4963
|
const u = ot(t, !0, r, t);
|
|
4970
|
-
|
|
4971
|
-
} else s && (
|
|
4964
|
+
l.x = u.x + t.clientLeft, l.y = u.y + t.clientTop;
|
|
4965
|
+
} else s && (l.x = At(s));
|
|
4972
4966
|
let c = 0, d = 0;
|
|
4973
4967
|
if (s && !i && !r) {
|
|
4974
4968
|
const u = s.getBoundingClientRect();
|
|
4975
4969
|
d = u.top + a.scrollTop, c = u.left + a.scrollLeft - // RTL <body> scrollbar.
|
|
4976
|
-
|
|
4970
|
+
At(s, u);
|
|
4977
4971
|
}
|
|
4978
|
-
const f = o.left + a.scrollLeft -
|
|
4972
|
+
const f = o.left + a.scrollLeft - l.x - c, x = o.top + a.scrollTop - l.y - d;
|
|
4979
4973
|
return {
|
|
4980
4974
|
x: f,
|
|
4981
4975
|
y: x,
|
|
@@ -5008,9 +5002,9 @@ function xe(n, t) {
|
|
|
5008
5002
|
return e;
|
|
5009
5003
|
}
|
|
5010
5004
|
let i = qt(n, t);
|
|
5011
|
-
for (; i &&
|
|
5005
|
+
for (; i && Si(i) && mt(i); )
|
|
5012
5006
|
i = qt(i, t);
|
|
5013
|
-
return i && Q(i) && mt(i) && !Ht(i) ? e : i ||
|
|
5007
|
+
return i && Q(i) && mt(i) && !Ht(i) ? e : i || Ai(n) || e;
|
|
5014
5008
|
}
|
|
5015
5009
|
const Wi = async function(n) {
|
|
5016
5010
|
const t = this.getOffsetParent || xe, e = this.getDimensions, i = await e(n.floating);
|
|
@@ -5038,7 +5032,7 @@ const Vi = {
|
|
|
5038
5032
|
getScale: Z,
|
|
5039
5033
|
isElement: F,
|
|
5040
5034
|
isRTL: Pi
|
|
5041
|
-
}, ue =
|
|
5035
|
+
}, ue = Ii, ge = Ti, we = _i, zi = Ri, pe = (n, t, e) => {
|
|
5042
5036
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
5043
5037
|
platform: Vi,
|
|
5044
5038
|
...e
|
|
@@ -5053,11 +5047,11 @@ const Vi = {
|
|
|
5053
5047
|
};
|
|
5054
5048
|
let $i = class {
|
|
5055
5049
|
constructor(t) {
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5050
|
+
h(this, "ctx");
|
|
5051
|
+
h(this, "enable", !1);
|
|
5052
|
+
h(this, "contentEl");
|
|
5053
|
+
h(this, "floatingEl");
|
|
5054
|
+
h(this, "arrowEl");
|
|
5061
5055
|
this.ctx = t;
|
|
5062
5056
|
const { TOOLTIP_BG_COLOR: e, TOOLTIP_TEXT_COLOR: i, TOOLTIP_ZINDEX: s, TOOLTIP_CUSTOM_STYLE: r, CSS_PREFIX: o } = this.ctx.config;
|
|
5063
5057
|
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 +5066,7 @@ let $i = class {
|
|
|
5072
5066
|
borderRadius: "4px",
|
|
5073
5067
|
fontSize: "12px",
|
|
5074
5068
|
...r
|
|
5075
|
-
},
|
|
5069
|
+
}, l = {
|
|
5076
5070
|
position: "absolute",
|
|
5077
5071
|
width: "10px",
|
|
5078
5072
|
height: "10px",
|
|
@@ -5081,7 +5075,7 @@ let $i = class {
|
|
|
5081
5075
|
transform: "rotate(45deg)",
|
|
5082
5076
|
zIndex: a.zIndex
|
|
5083
5077
|
};
|
|
5084
|
-
Object.assign(this.arrowEl.style,
|
|
5078
|
+
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
5079
|
}
|
|
5086
5080
|
init() {
|
|
5087
5081
|
this.ctx.on("mousemove", (t) => {
|
|
@@ -5125,10 +5119,10 @@ let $i = class {
|
|
|
5125
5119
|
placement: t.overflowTooltipPlacement,
|
|
5126
5120
|
middleware: [ge(), we(), ue(6), zi({ element: this.arrowEl })]
|
|
5127
5121
|
}).then((a) => {
|
|
5128
|
-
const { x:
|
|
5122
|
+
const { x: l, y: c, placement: d, middlewareData: f } = a;
|
|
5129
5123
|
if (Object.assign(this.floatingEl.style, {
|
|
5130
5124
|
top: `${c}px`,
|
|
5131
|
-
left: `${
|
|
5125
|
+
left: `${l}px`
|
|
5132
5126
|
}), f.arrow) {
|
|
5133
5127
|
const x = f.arrow;
|
|
5134
5128
|
["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
@@ -5164,13 +5158,13 @@ let $i = class {
|
|
|
5164
5158
|
};
|
|
5165
5159
|
class qi {
|
|
5166
5160
|
constructor(t) {
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5161
|
+
h(this, "editorEl");
|
|
5162
|
+
h(this, "inputEl");
|
|
5163
|
+
h(this, "enable", !1);
|
|
5164
|
+
h(this, "cellTarget", null);
|
|
5165
|
+
h(this, "ctx");
|
|
5166
|
+
h(this, "drawY", 0);
|
|
5167
|
+
h(this, "drawX", 0);
|
|
5174
5168
|
this.ctx = t, this.initTextEditor(), this.init();
|
|
5175
5169
|
}
|
|
5176
5170
|
init() {
|
|
@@ -5257,12 +5251,12 @@ class qi {
|
|
|
5257
5251
|
this.drawX = r, this.drawY = o;
|
|
5258
5252
|
let { height: a } = t;
|
|
5259
5253
|
const {
|
|
5260
|
-
config: { CELL_PADDING:
|
|
5254
|
+
config: { CELL_PADDING: l },
|
|
5261
5255
|
header: c
|
|
5262
5256
|
} = this.ctx;
|
|
5263
5257
|
let d = this.ctx.body.visibleHeight;
|
|
5264
5258
|
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 = `${
|
|
5259
|
+
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
5260
|
const f = this.inputEl.value.length;
|
|
5267
5261
|
this.inputEl.setSelectionRange(f, f);
|
|
5268
5262
|
} else
|
|
@@ -5296,8 +5290,8 @@ class qi {
|
|
|
5296
5290
|
const r = this.ctx.focusCell;
|
|
5297
5291
|
if (!r || ["index", "index-selection", "selection"].includes(r.type) || this.enable)
|
|
5298
5292
|
return;
|
|
5299
|
-
const { rowKey: o, key: a } = r,
|
|
5300
|
-
r && !
|
|
5293
|
+
const { rowKey: o, key: a } = r, l = this.ctx.database.getReadonly(o, a);
|
|
5294
|
+
r && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = r, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
5301
5295
|
}
|
|
5302
5296
|
doneEdit() {
|
|
5303
5297
|
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1);
|
|
@@ -5309,18 +5303,18 @@ class qi {
|
|
|
5309
5303
|
}
|
|
5310
5304
|
class Gi {
|
|
5311
5305
|
constructor(t) {
|
|
5312
|
-
|
|
5313
|
-
|
|
5306
|
+
h(this, "ctx");
|
|
5307
|
+
h(this, "emptyEl");
|
|
5314
5308
|
this.ctx = t;
|
|
5315
5309
|
const { EMPTY_TEXT: e, EMPTY_CUSTOM_STYLE: i } = this.ctx.config;
|
|
5316
5310
|
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
|
|
5311
|
+
const l = r + (o + a) / 2, c = {
|
|
5318
5312
|
display: s === "empty" ? "block" : "none",
|
|
5319
5313
|
position: "absolute",
|
|
5320
5314
|
fontSize: "14px",
|
|
5321
5315
|
color: "#666",
|
|
5322
5316
|
left: "50%",
|
|
5323
|
-
top: `${
|
|
5317
|
+
top: `${l}px`,
|
|
5324
5318
|
transform: "translate(-50%, -50%)",
|
|
5325
5319
|
...i
|
|
5326
5320
|
};
|
|
@@ -5333,7 +5327,7 @@ class Gi {
|
|
|
5333
5327
|
}
|
|
5334
5328
|
class ji {
|
|
5335
5329
|
constructor(t) {
|
|
5336
|
-
|
|
5330
|
+
h(this, "ctx");
|
|
5337
5331
|
this.ctx = t;
|
|
5338
5332
|
}
|
|
5339
5333
|
draw() {
|
|
@@ -5348,9 +5342,9 @@ class ji {
|
|
|
5348
5342
|
}
|
|
5349
5343
|
getContainer() {
|
|
5350
5344
|
const t = this.getHeader(), e = this.getBody(), i = this.getFooter();
|
|
5351
|
-
let s = [
|
|
5352
|
-
const { FOOTER_FIXED: r } = this.ctx.config;
|
|
5353
|
-
return r
|
|
5345
|
+
let s = [];
|
|
5346
|
+
const { FOOTER_FIXED: r, FOOTER_POSITION: o } = this.ctx.config;
|
|
5347
|
+
return r ? o === "top" ? s = [t, i, e] : s = [t, e, i] : s = [t, e], {
|
|
5354
5348
|
views: s
|
|
5355
5349
|
};
|
|
5356
5350
|
}
|
|
@@ -5360,9 +5354,9 @@ class ji {
|
|
|
5360
5354
|
fixedRightWidth: e,
|
|
5361
5355
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
5362
5356
|
} = this.ctx, { visibleWidth: r, visibleHeight: o, renderCellHeaders: a } = this.ctx.header;
|
|
5363
|
-
let
|
|
5357
|
+
let l = [], c = [], d = [];
|
|
5364
5358
|
a.forEach((p) => {
|
|
5365
|
-
p.render && (p.fixed === "left" ? c.push(p) : p.fixed === "right" ? d.push(p) :
|
|
5359
|
+
p.render && (p.fixed === "left" ? c.push(p) : p.fixed === "right" ? d.push(p) : l.push(p));
|
|
5366
5360
|
});
|
|
5367
5361
|
const f = e - i, x = {
|
|
5368
5362
|
key: "left",
|
|
@@ -5385,7 +5379,7 @@ class ji {
|
|
|
5385
5379
|
width: `${r - t - f + 1}px`,
|
|
5386
5380
|
height: `${o}px`
|
|
5387
5381
|
},
|
|
5388
|
-
cells:
|
|
5382
|
+
cells: l
|
|
5389
5383
|
}, g = {
|
|
5390
5384
|
key: "right",
|
|
5391
5385
|
style: {
|
|
@@ -5421,7 +5415,7 @@ class ji {
|
|
|
5421
5415
|
const {
|
|
5422
5416
|
fixedLeftWidth: r,
|
|
5423
5417
|
fixedRightWidth: o,
|
|
5424
|
-
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX:
|
|
5418
|
+
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX: l }
|
|
5425
5419
|
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - a, x = {
|
|
5426
5420
|
key: "left",
|
|
5427
5421
|
style: {
|
|
@@ -5458,7 +5452,7 @@ class ji {
|
|
|
5458
5452
|
};
|
|
5459
5453
|
return {
|
|
5460
5454
|
type: "body",
|
|
5461
|
-
class: `${
|
|
5455
|
+
class: `${l}-overlayer-body`,
|
|
5462
5456
|
style: {
|
|
5463
5457
|
position: "relative",
|
|
5464
5458
|
overflow: "hidden",
|
|
@@ -5479,7 +5473,7 @@ class ji {
|
|
|
5479
5473
|
fixedLeftWidth: s,
|
|
5480
5474
|
fixedRightWidth: r,
|
|
5481
5475
|
config: { SCROLLER_TRACK_SIZE: o, CSS_PREFIX: a }
|
|
5482
|
-
} = this.ctx, { visibleWidth:
|
|
5476
|
+
} = this.ctx, { visibleWidth: l, visibleHeight: c } = this.ctx.footer, d = r - o, f = {
|
|
5483
5477
|
key: "left",
|
|
5484
5478
|
style: {
|
|
5485
5479
|
position: "absolute",
|
|
@@ -5497,7 +5491,7 @@ class ji {
|
|
|
5497
5491
|
top: `${0.5}px`,
|
|
5498
5492
|
left: `${s - 0.5}px`,
|
|
5499
5493
|
overflow: "hidden",
|
|
5500
|
-
width: `${
|
|
5494
|
+
width: `${l - s - d}px`,
|
|
5501
5495
|
height: `${c}px`
|
|
5502
5496
|
},
|
|
5503
5497
|
cells: t
|
|
@@ -5519,7 +5513,7 @@ class ji {
|
|
|
5519
5513
|
style: {
|
|
5520
5514
|
position: "relative",
|
|
5521
5515
|
overflow: "hidden",
|
|
5522
|
-
width: `${
|
|
5516
|
+
width: `${l}px`,
|
|
5523
5517
|
height: `${c}px`
|
|
5524
5518
|
},
|
|
5525
5519
|
views: [f, x, u]
|
|
@@ -5528,17 +5522,17 @@ class ji {
|
|
|
5528
5522
|
}
|
|
5529
5523
|
class Ui {
|
|
5530
5524
|
constructor(t) {
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5525
|
+
h(this, "ctx");
|
|
5526
|
+
h(this, "contextMenuEl");
|
|
5527
|
+
h(this, "custom", !1);
|
|
5534
5528
|
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
5529
|
}
|
|
5536
5530
|
init() {
|
|
5537
5531
|
this.ctx.on("cellContextMenuClick", (t, e) => {
|
|
5538
5532
|
if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
|
|
5539
5533
|
e.preventDefault();
|
|
5540
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a,
|
|
5541
|
-
c >= a && c <=
|
|
5534
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a, l] = s, { rowIndex: c, colIndex: d } = t;
|
|
5535
|
+
c >= a && c <= l && d >= r && d <= o || this.ctx.emit("setSelectorCell", t, e);
|
|
5542
5536
|
const x = {
|
|
5543
5537
|
getBoundingClientRect: () => ({
|
|
5544
5538
|
width: 0,
|
|
@@ -5612,19 +5606,19 @@ class Ui {
|
|
|
5612
5606
|
}
|
|
5613
5607
|
class Qi {
|
|
5614
5608
|
constructor(t, e) {
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5609
|
+
h(this, "options");
|
|
5610
|
+
h(this, "scroller");
|
|
5611
|
+
h(this, "header");
|
|
5612
|
+
h(this, "body");
|
|
5613
|
+
h(this, "footer");
|
|
5614
|
+
h(this, "selector");
|
|
5615
|
+
h(this, "autofill");
|
|
5616
|
+
h(this, "tooltip");
|
|
5617
|
+
h(this, "editor");
|
|
5618
|
+
h(this, "empty");
|
|
5619
|
+
h(this, "overlayer");
|
|
5620
|
+
h(this, "contextMenu");
|
|
5621
|
+
h(this, "ctx");
|
|
5628
5622
|
this.options = e;
|
|
5629
5623
|
const { overlayerElement: i, editorElement: s, emptyElement: r, contextMenuElement: o } = e, a = this.createContainer(
|
|
5630
5624
|
t,
|
|
@@ -5633,7 +5627,7 @@ class Qi {
|
|
|
5633
5627
|
r,
|
|
5634
5628
|
o
|
|
5635
5629
|
);
|
|
5636
|
-
this.ctx = new
|
|
5630
|
+
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
5631
|
this.draw();
|
|
5638
5632
|
}), this.ctx.on("drawView", () => {
|
|
5639
5633
|
this.draw(!0);
|
|
@@ -5641,16 +5635,16 @@ class Qi {
|
|
|
5641
5635
|
}
|
|
5642
5636
|
createContainer(t, e, i, s, r) {
|
|
5643
5637
|
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",
|
|
5638
|
+
const o = document.createElement("div"), a = document.createElement("canvas"), l = e || document.createElement("div");
|
|
5639
|
+
o.className = "e-virt-table-stage", a.className = "e-virt-table-canvas", l.className = "e-virt-table-overlayer";
|
|
5646
5640
|
const c = i || document.createElement("div");
|
|
5647
5641
|
c.className = "e-virt-table-editor";
|
|
5648
5642
|
const d = s, f = r;
|
|
5649
|
-
return o.appendChild(a), o.appendChild(
|
|
5643
|
+
return o.appendChild(a), o.appendChild(l), t.appendChild(o), {
|
|
5650
5644
|
containerElement: t,
|
|
5651
5645
|
stageElement: o,
|
|
5652
5646
|
canvasElement: a,
|
|
5653
|
-
overlayerElement:
|
|
5647
|
+
overlayerElement: l,
|
|
5654
5648
|
editorElement: c,
|
|
5655
5649
|
emptyElement: d,
|
|
5656
5650
|
contextMenuElement: f
|
|
@@ -5686,7 +5680,7 @@ class Qi {
|
|
|
5686
5680
|
this.ctx.off(t, e);
|
|
5687
5681
|
}
|
|
5688
5682
|
filterMethod(t) {
|
|
5689
|
-
this.ctx.setScrollY(0), this.ctx.setScrollX(0), this.ctx.database.init(), this.ctx.database.setFilterMethod(t), this.ctx.emit("draw");
|
|
5683
|
+
this.ctx.setScrollY(0), this.ctx.setScrollX(0), this.ctx.database.init(), this.header.init(), this.ctx.database.setFilterMethod(t), this.ctx.emit("draw");
|
|
5690
5684
|
}
|
|
5691
5685
|
editCell(t, e) {
|
|
5692
5686
|
this.editor.editCell(t, e);
|
|
@@ -5721,8 +5715,8 @@ class Qi {
|
|
|
5721
5715
|
if (t && Array.isArray(s) && s.length) {
|
|
5722
5716
|
const [r] = s;
|
|
5723
5717
|
if (Array.isArray(r) && r.length) {
|
|
5724
|
-
const [o] = r, { rowKey: a, key:
|
|
5725
|
-
this.scrollToRowkey(a), this.scrollToColkey(
|
|
5718
|
+
const [o] = r, { rowKey: a, key: l } = o;
|
|
5719
|
+
this.scrollToRowkey(a), this.scrollToColkey(l);
|
|
5726
5720
|
}
|
|
5727
5721
|
}
|
|
5728
5722
|
i(s);
|
|
@@ -5747,7 +5741,7 @@ class Qi {
|
|
|
5747
5741
|
let r = [];
|
|
5748
5742
|
for (let o = 0; o < i.length; o++)
|
|
5749
5743
|
for (let a = 0; a < s.length; a++) {
|
|
5750
|
-
const
|
|
5744
|
+
const l = this.ctx.database.getRowKeyByItem(i[o]), d = s[a].key, f = await this.ctx.database.getValidator(l, d);
|
|
5751
5745
|
Array.isArray(f) && f.length && r.push(f);
|
|
5752
5746
|
}
|
|
5753
5747
|
r.length ? (e(r), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
|