e-virt-table 1.2.3 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +442 -419
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Config.d.ts +3 -0
- package/dist/lib/Config.js +28 -2
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/EventTable.d.ts +1 -0
- package/dist/lib/EventTable.js +21 -0
- package/dist/lib/EventTable.js.map +1 -1
- package/dist/lib/util.d.ts +8 -1
- package/dist/lib/util.js +12 -1
- package/dist/lib/util.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(':root{--evt-header-font: "12px normal Arial";--evt-body-font: "12px normal Arial";--evt-color-white: #fff;--evt-color-black: #000000;--evt-color-primary: rgb(82, 146, 247);--evt-text-color-primary: #333;--evt-text-color-regular: #666;--evt-text-color-secondary: #999;--evt-box-shadow: 0 2px 12px 0 #0000001a;--evt-editor-bg-color: #fff;--evt-editor-text-color: #333;--evt-border-color: #e1e6eb;--evt-stripe-color: #fafafa;--evt-placeholder-color: #cdd0dc;--evt-header-bg-color: #f8faff;--evt-body-bg-color: #fff;--evt-header-text-color: #1d2129;--evt-loading-icon-color: #4e5969;--evt-expand-icon-color: #4e5969;--evt-shrink-icon-color: #4e5969;--evt-error-tip-icon-color: red;--evt-cell-hover-icon-bg-color: #fff;--evt-cell-hover-icon-border-color: #dde0ea;--evt-scroller-color: #dee0e3;--evt-scroller-track-color: #fff;--evt-scroller-focus-color: #bbbec4;--evt-select-border-color: var(--evt-color-primary);--evt-select-area-color: rgba(82, 146, 247, .1);--evt-select-row-col-bg-color: transparent;--evt-autofill-point-border-color: #fff;--evt-edit-bg-color: #fcf6ed;--evt-checkbox-color: var(--evt-color-primary);--evt-readonly-color: #fff;--evt-readonly-text-color: #4e5969;--evt-error-tip-color: #ed3f14;--evt-footer-bg-color: #fafafa;--evt-highlight-hover-row-color: rgba(186, 203, 231, .1);--evt-highlight-selected-row-color: rgba(82, 146, 247, .1);--evt-tooltip-bg-color: #303133;--evt-tooltip-text-color: #fff;--evt-resize-row-line-color: #e1e6eb;--evt-resize-column-line-color: #e1e6eb}.dark{--evt-border-color: #363637;--evt-header-bg-color: #141414;--evt-body-bg-color: #141414;--evt-header-text-color: #a3a6ad;--evt-scroller-color: #414243;--evt-scroller-track-color: #141414;--evt-scroller-focus-color: #a3a6ad;--evt-edit-bg-color: #141414;--evt-readonly-text-color: #cfd3dc;--evt-footer-bg-color: #262727;--evt-autofill-point-border-color: #fff;--evt-editor-bg-color: #434343;--evt-editor-text-color: #cfd3dc}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;box-sizing:border-box;z-index:10;border-radius:8px;border:1px solid var(--evt-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;border:none;outline:none;z-index:10}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;height:auto;line-height:0;z-index:100;overflow:hidden;background-color:var(--evt-editor-bg-color);border:2px solid var(--evt-color-primary);box-sizing:border-box;box-shadow:var(--evt-box-shadow);display:flex;align-items:center}.e-virt-table-overlayer{position:absolute;left:0;top:0;overflow:hidden;z-index:100;pointer-events:none}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;outline:none;font-weight:400;padding:8px;font-size:12px;color:inherit;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;line-height:1.5;margin:0;border:none;vertical-align:middle;background:var(--evt-editor-bg-color);color:var(--evt-editor-text-color);overflow-y:auto;resize:none}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--evt-text-color-regular);background-color:var(--evt-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--evt-box-shadow);width:fit-content;padding:6px 0;z-index:9999;left:-99999px;top:-99999px}.e-virt-table-context-menu-item{cursor:pointer;padding:8px 24px;color:var(--evt-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--evt-color-primary);background-color:#f5f7fa}')),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
2
|
var be = Object.defineProperty;
|
|
3
3
|
var ve = (a, t, e) => t in a ? be(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
4
4
|
var l = (a, t, e) => ve(a, typeof t != "symbol" ? t + "" : t, e);
|
|
@@ -25,7 +25,7 @@ function st(a, t) {
|
|
|
25
25
|
return i.__proto__ = s, i;
|
|
26
26
|
}, st(a, t);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function _e() {
|
|
29
29
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
30
30
|
if (typeof Proxy == "function") return !0;
|
|
31
31
|
try {
|
|
@@ -36,20 +36,20 @@ function Ie() {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
function dt(a, t, e) {
|
|
39
|
-
return
|
|
39
|
+
return _e() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
|
|
40
40
|
var n = [null];
|
|
41
41
|
n.push.apply(n, r);
|
|
42
42
|
var h = Function.bind.apply(s, n), c = new h();
|
|
43
43
|
return o && st(c, o.prototype), c;
|
|
44
44
|
}, dt.apply(null, arguments);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Ie(a) {
|
|
47
47
|
return Function.toString.call(a).indexOf("[native code]") !== -1;
|
|
48
48
|
}
|
|
49
49
|
function Ct(a) {
|
|
50
50
|
var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
51
51
|
return Ct = function(i) {
|
|
52
|
-
if (i === null || !
|
|
52
|
+
if (i === null || !Ie(i)) return i;
|
|
53
53
|
if (typeof i != "function")
|
|
54
54
|
throw new TypeError("Super expression must either be null or a function");
|
|
55
55
|
if (typeof t < "u") {
|
|
@@ -131,7 +131,7 @@ function Se(a, t, e) {
|
|
|
131
131
|
t(n, o);
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function Ft(a, t, e) {
|
|
135
135
|
var i = 0, s = a.length;
|
|
136
136
|
function r(o) {
|
|
137
137
|
if (o && o.length) {
|
|
@@ -149,7 +149,7 @@ function Ae(a) {
|
|
|
149
149
|
t.push.apply(t, a[e] || []);
|
|
150
150
|
}), t;
|
|
151
151
|
}
|
|
152
|
-
var
|
|
152
|
+
var Xt = /* @__PURE__ */ function(a) {
|
|
153
153
|
Re(t, a);
|
|
154
154
|
function t(e, i) {
|
|
155
155
|
var s;
|
|
@@ -159,28 +159,28 @@ var Ft = /* @__PURE__ */ function(a) {
|
|
|
159
159
|
}(/* @__PURE__ */ Ct(Error));
|
|
160
160
|
function Te(a, t, e, i, s) {
|
|
161
161
|
if (t.first) {
|
|
162
|
-
var r = new Promise(function(
|
|
162
|
+
var r = new Promise(function(u, g) {
|
|
163
163
|
var p = function(m) {
|
|
164
|
-
return i(m), m.length ? g(new
|
|
165
|
-
},
|
|
166
|
-
|
|
164
|
+
return i(m), m.length ? g(new Xt(m, bt(m))) : u(s);
|
|
165
|
+
}, x = Ae(a);
|
|
166
|
+
Ft(x, e, p);
|
|
167
167
|
});
|
|
168
|
-
return r.catch(function(
|
|
169
|
-
return
|
|
168
|
+
return r.catch(function(u) {
|
|
169
|
+
return u;
|
|
170
170
|
}), r;
|
|
171
171
|
}
|
|
172
|
-
var o = t.firstFields === !0 ? Object.keys(a) : t.firstFields || [], n = Object.keys(a), h = n.length, c = 0, d = [], f = new Promise(function(
|
|
172
|
+
var o = t.firstFields === !0 ? Object.keys(a) : t.firstFields || [], n = Object.keys(a), h = n.length, c = 0, d = [], f = new Promise(function(u, g) {
|
|
173
173
|
var p = function(w) {
|
|
174
174
|
if (d.push.apply(d, w), c++, c === h)
|
|
175
|
-
return i(d), d.length ? g(new
|
|
175
|
+
return i(d), d.length ? g(new Xt(d, bt(d))) : u(s);
|
|
176
176
|
};
|
|
177
|
-
n.length || (i(d),
|
|
178
|
-
var w = a[
|
|
179
|
-
o.indexOf(
|
|
177
|
+
n.length || (i(d), u(s)), n.forEach(function(x) {
|
|
178
|
+
var w = a[x];
|
|
179
|
+
o.indexOf(x) !== -1 ? Ft(w, e, p) : Se(w, e, p);
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
|
-
return f.catch(function(
|
|
183
|
-
return
|
|
182
|
+
return f.catch(function(u) {
|
|
183
|
+
return u;
|
|
184
184
|
}), f;
|
|
185
185
|
}
|
|
186
186
|
function Me(a) {
|
|
@@ -242,7 +242,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
242
242
|
}, h.v6 = function(y) {
|
|
243
243
|
return y && y.exact ? n : new RegExp("" + t(y) + s + t(y), "g");
|
|
244
244
|
};
|
|
245
|
-
var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source,
|
|
245
|
+
var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source, u = h.v6().source, g = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", p = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", x = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", m = '(?:[/?#][^\\s"]*)?', C = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + u + "|" + g + p + x + ")" + w + m;
|
|
246
246
|
return ct = new RegExp("(?:^" + C + "$)", "i"), ct;
|
|
247
247
|
}, Kt = {
|
|
248
248
|
// http://emailregex.com/
|
|
@@ -292,16 +292,16 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
292
292
|
hex: function(t) {
|
|
293
293
|
return typeof t == "string" && !!t.match(Kt.hex);
|
|
294
294
|
}
|
|
295
|
-
},
|
|
295
|
+
}, Fe = function(t, e, i, s, r) {
|
|
296
296
|
if (t.required && e === void 0) {
|
|
297
297
|
Zt(t, e, i, s, r);
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
300
|
var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], n = t.type;
|
|
301
301
|
o.indexOf(n) > -1 ? et[n](e) || s.push(D(r.messages.types[n], t.fullField, t.type)) : n && typeof e !== t.type && s.push(D(r.messages.types[n], t.fullField, t.type));
|
|
302
|
-
},
|
|
303
|
-
var o = typeof t.len == "number", n = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null,
|
|
304
|
-
if (
|
|
302
|
+
}, Xe = function(t, e, i, s, r) {
|
|
303
|
+
var o = typeof t.len == "number", n = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null, u = typeof e == "number", g = typeof e == "string", p = Array.isArray(e);
|
|
304
|
+
if (u ? f = "number" : g ? f = "string" : p && (f = "array"), !f)
|
|
305
305
|
return !1;
|
|
306
306
|
p && (d = e.length), g && (d = e.replace(c, "_").length), o ? d !== t.len && s.push(D(r.messages[f].len, t.fullField, t.len)) : n && !h && d < t.min ? s.push(D(r.messages[f].min, t.fullField, t.min)) : h && !n && d > t.max ? s.push(D(r.messages[f].max, t.fullField, t.max)) : n && h && (d < t.min || d > t.max) && s.push(D(r.messages[f].range, t.fullField, t.min, t.max));
|
|
307
307
|
}, j = "enum", Be = function(t, e, i, s, r) {
|
|
@@ -318,8 +318,8 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
318
318
|
}, O = {
|
|
319
319
|
required: Zt,
|
|
320
320
|
whitespace: De,
|
|
321
|
-
type:
|
|
322
|
-
range:
|
|
321
|
+
type: Fe,
|
|
322
|
+
range: Xe,
|
|
323
323
|
enum: Be,
|
|
324
324
|
pattern: ke
|
|
325
325
|
}, Ke = function(t, e, i, s, r) {
|
|
@@ -536,7 +536,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
536
536
|
var n = i, h = s, c = r;
|
|
537
537
|
if (typeof h == "function" && (c = h, h = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
538
538
|
return c && c(null, n), Promise.resolve(n);
|
|
539
|
-
function d(
|
|
539
|
+
function d(x) {
|
|
540
540
|
var w = [], m = {};
|
|
541
541
|
function C(b) {
|
|
542
542
|
if (Array.isArray(b)) {
|
|
@@ -545,8 +545,8 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
545
545
|
} else
|
|
546
546
|
w.push(b);
|
|
547
547
|
}
|
|
548
|
-
for (var y = 0; y <
|
|
549
|
-
C(
|
|
548
|
+
for (var y = 0; y < x.length; y++)
|
|
549
|
+
C(x[y]);
|
|
550
550
|
w.length ? (m = bt(w), c(w, m)) : c(null, n);
|
|
551
551
|
}
|
|
552
552
|
if (h.messages) {
|
|
@@ -554,54 +554,54 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
554
554
|
f === Rt && (f = vt()), kt(f, h.messages), h.messages = f;
|
|
555
555
|
} else
|
|
556
556
|
h.messages = this.messages();
|
|
557
|
-
var
|
|
558
|
-
g.forEach(function(
|
|
559
|
-
var w = o.rules[
|
|
557
|
+
var u = {}, g = h.keys || Object.keys(this.rules);
|
|
558
|
+
g.forEach(function(x) {
|
|
559
|
+
var w = o.rules[x], m = n[x];
|
|
560
560
|
w.forEach(function(C) {
|
|
561
561
|
var y = C;
|
|
562
|
-
typeof y.transform == "function" && (n === i && (n = q({}, n)), m = n[
|
|
562
|
+
typeof y.transform == "function" && (n === i && (n = q({}, n)), m = n[x] = y.transform(m)), typeof y == "function" ? y = {
|
|
563
563
|
validator: y
|
|
564
|
-
} : y = q({}, y), y.validator = o.getValidationMethod(y), y.validator && (y.field =
|
|
564
|
+
} : y = q({}, y), y.validator = o.getValidationMethod(y), y.validator && (y.field = x, y.fullField = y.fullField || x, y.type = o.getType(y), u[x] = u[x] || [], u[x].push({
|
|
565
565
|
rule: y,
|
|
566
566
|
value: m,
|
|
567
567
|
source: n,
|
|
568
|
-
field:
|
|
568
|
+
field: x
|
|
569
569
|
}));
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
572
|
var p = {};
|
|
573
|
-
return Te(
|
|
574
|
-
var m =
|
|
575
|
-
C = C && (m.required || !m.required &&
|
|
576
|
-
function y(v,
|
|
577
|
-
return q({},
|
|
573
|
+
return Te(u, h, function(x, w) {
|
|
574
|
+
var m = x.rule, C = (m.type === "object" || m.type === "array") && (typeof m.fields == "object" || typeof m.defaultField == "object");
|
|
575
|
+
C = C && (m.required || !m.required && x.value), m.field = x.field;
|
|
576
|
+
function y(v, I) {
|
|
577
|
+
return q({}, I, {
|
|
578
578
|
fullField: m.fullField + "." + v,
|
|
579
579
|
fullFields: m.fullFields ? [].concat(m.fullFields, [v]) : [v]
|
|
580
580
|
});
|
|
581
581
|
}
|
|
582
582
|
function b(v) {
|
|
583
583
|
v === void 0 && (v = []);
|
|
584
|
-
var
|
|
585
|
-
!h.suppressWarning &&
|
|
586
|
-
var L =
|
|
584
|
+
var I = Array.isArray(v) ? v : [v];
|
|
585
|
+
!h.suppressWarning && I.length && a.warning("async-validator:", I), I.length && m.message !== void 0 && (I = [].concat(m.message));
|
|
586
|
+
var L = I.map(Bt(m, n));
|
|
587
587
|
if (h.first && L.length)
|
|
588
588
|
return p[m.field] = 1, w(L);
|
|
589
589
|
if (!C)
|
|
590
590
|
w(L);
|
|
591
591
|
else {
|
|
592
|
-
if (m.required && !
|
|
592
|
+
if (m.required && !x.value)
|
|
593
593
|
return m.message !== void 0 ? L = [].concat(m.message).map(Bt(m, n)) : h.error && (L = [h.error(m, D(h.messages.required, m.field))]), w(L);
|
|
594
|
-
var
|
|
595
|
-
m.defaultField && Object.keys(
|
|
596
|
-
|
|
597
|
-
}),
|
|
594
|
+
var _ = {};
|
|
595
|
+
m.defaultField && Object.keys(x.value).map(function(S) {
|
|
596
|
+
_[S] = m.defaultField;
|
|
597
|
+
}), _ = q({}, _, x.rule.fields);
|
|
598
598
|
var R = {};
|
|
599
|
-
Object.keys(
|
|
600
|
-
var M =
|
|
599
|
+
Object.keys(_).forEach(function(S) {
|
|
600
|
+
var M = _[S], T = Array.isArray(M) ? M : [M];
|
|
601
601
|
R[S] = T.map(y.bind(null, S));
|
|
602
602
|
});
|
|
603
603
|
var A = new a(R);
|
|
604
|
-
A.messages(h.messages),
|
|
604
|
+
A.messages(h.messages), x.rule.options && (x.rule.options.messages = h.messages, x.rule.options.error = h.error), A.validate(x.value, x.rule.options || h, function(S) {
|
|
605
605
|
var M = [];
|
|
606
606
|
L && L.length && M.push.apply(M, L), S && S.length && M.push.apply(M, S), w(M.length ? M : null);
|
|
607
607
|
});
|
|
@@ -609,10 +609,10 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
609
609
|
}
|
|
610
610
|
var E;
|
|
611
611
|
if (m.asyncValidator)
|
|
612
|
-
E = m.asyncValidator(m,
|
|
612
|
+
E = m.asyncValidator(m, x.value, b, x.source, h);
|
|
613
613
|
else if (m.validator) {
|
|
614
614
|
try {
|
|
615
|
-
E = m.validator(m,
|
|
615
|
+
E = m.validator(m, x.value, b, x.source, h);
|
|
616
616
|
} catch (v) {
|
|
617
617
|
console.error == null || console.error(v), h.suppressValidatorError || setTimeout(function() {
|
|
618
618
|
throw v;
|
|
@@ -625,8 +625,8 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
625
625
|
}, function(v) {
|
|
626
626
|
return b(v);
|
|
627
627
|
});
|
|
628
|
-
}, function(
|
|
629
|
-
d(
|
|
628
|
+
}, function(x) {
|
|
629
|
+
d(x);
|
|
630
630
|
}, n);
|
|
631
631
|
}, t.getType = function(i) {
|
|
632
632
|
if (i.type === void 0 && i.pattern instanceof RegExp && (i.type = "pattern"), typeof i.validator != "function" && i.type && !it.hasOwnProperty(i.type))
|
|
@@ -702,10 +702,10 @@ function ee(a = [], t = 1, e = 0) {
|
|
|
702
702
|
};
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function _t(a = []) {
|
|
706
706
|
let t = [];
|
|
707
707
|
return a.forEach((e) => {
|
|
708
|
-
e.children ? t = t.concat(
|
|
708
|
+
e.children ? t = t.concat(_t(e.children)) : t.push(e);
|
|
709
709
|
}), t;
|
|
710
710
|
}
|
|
711
711
|
const Yt = /^(\r\n|\n\r|\r|\n)/, ii = /^[^\t\r\n]+/, Vt = /^\t/;
|
|
@@ -797,6 +797,10 @@ function ni(a, t = []) {
|
|
|
797
797
|
};
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
|
+
function ai(a, t = document.documentElement) {
|
|
801
|
+
const e = a.startsWith("--") ? a : `--${a}`;
|
|
802
|
+
return getComputedStyle(t).getPropertyValue(e).trim();
|
|
803
|
+
}
|
|
800
804
|
class re {
|
|
801
805
|
constructor(t, e, i, s, r, o, n) {
|
|
802
806
|
l(this, "ctx");
|
|
@@ -1015,19 +1019,19 @@ class Tt extends re {
|
|
|
1015
1019
|
const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
|
|
1016
1020
|
let r, o = 0, n = "";
|
|
1017
1021
|
if (this.type === "tree" && s === "body") {
|
|
1018
|
-
const h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: d = !1, expandLoading: f = !1, level:
|
|
1022
|
+
const h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: d = !1, expandLoading: f = !1, level: u = 0 } = h || {};
|
|
1019
1023
|
if (this.rowExpand = c, this.rowHasChildren = d, f) {
|
|
1020
|
-
const
|
|
1021
|
-
n = "loading", r =
|
|
1024
|
+
const x = this.ctx.icons.get("loading");
|
|
1025
|
+
n = "loading", r = x, o = u * 8;
|
|
1022
1026
|
} else if (d) {
|
|
1023
|
-
const
|
|
1024
|
-
r = c ? w :
|
|
1027
|
+
const x = this.ctx.icons.get("expand"), w = this.ctx.icons.get("shrink");
|
|
1028
|
+
r = c ? w : x, n = c ? "shrink" : "expand", o = u * 8;
|
|
1025
1029
|
} else
|
|
1026
|
-
o =
|
|
1030
|
+
o = u * 8;
|
|
1027
1031
|
let g = 20, p = 20;
|
|
1028
1032
|
if (r) {
|
|
1029
|
-
let
|
|
1030
|
-
this.ctx.paint.drawImage(r,
|
|
1033
|
+
let x = this.drawX + o + e, w = this.drawY + (this.visibleHeight - p) / 2;
|
|
1034
|
+
this.ctx.paint.drawImage(r, x, w, g, p), this.drawImageX = x, this.drawImageY = w, this.drawImageWidth = g, this.drawImageHeight = p, this.drawImageName = n, this.drawImageSource = r;
|
|
1031
1035
|
}
|
|
1032
1036
|
this.align = "left", this.drawTextX = o + this.drawX + g - 0.5;
|
|
1033
1037
|
}
|
|
@@ -1044,35 +1048,35 @@ class Tt extends re {
|
|
|
1044
1048
|
HIGHLIGHT_SELECTED_ROW_COLOR: c,
|
|
1045
1049
|
HIGHLIGHT_HOVER_ROW: d,
|
|
1046
1050
|
HIGHLIGHT_HOVER_ROW_COLOR: f,
|
|
1047
|
-
STRIPE:
|
|
1051
|
+
STRIPE: u,
|
|
1048
1052
|
STRIPE_COLOR: g
|
|
1049
1053
|
} = this.ctx.config;
|
|
1050
1054
|
if (this.cellType === "footer") {
|
|
1051
1055
|
let E = n, v = o;
|
|
1052
1056
|
if (typeof r == "function") {
|
|
1053
|
-
const
|
|
1057
|
+
const I = r, { backgroundColor: L, color: _ } = I({
|
|
1054
1058
|
row: this.row,
|
|
1055
1059
|
rowIndex: this.rowIndex,
|
|
1056
1060
|
colIndex: this.colIndex,
|
|
1057
1061
|
column: this.column,
|
|
1058
1062
|
value: this.getValue()
|
|
1059
1063
|
}) || {};
|
|
1060
|
-
L && (E = L),
|
|
1064
|
+
L && (E = L), _ && (v = _);
|
|
1061
1065
|
}
|
|
1062
1066
|
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = E, this.drawTextColor = v;
|
|
1063
1067
|
return;
|
|
1064
1068
|
}
|
|
1065
1069
|
let p = "transparent";
|
|
1066
|
-
const
|
|
1070
|
+
const x = this.ctx.focusCell, w = this.ctx.hoverCell;
|
|
1067
1071
|
let m = this.rowIndex, C = this.rowIndex;
|
|
1068
1072
|
if (this.rowspan !== 1 && (d || h)) {
|
|
1069
1073
|
const E = this.getSpanInfo(), { yArr: v } = E;
|
|
1070
1074
|
m = v[0], C = v[1];
|
|
1071
1075
|
}
|
|
1072
|
-
d && w && (w.rowKey === this.rowKey && (p = f), w.rowIndex >= m && w.rowIndex <= C && (p = f)), h &&
|
|
1076
|
+
d && w && (w.rowKey === this.rowKey && (p = f), w.rowIndex >= m && w.rowIndex <= C && (p = f)), h && x && (x.rowKey === this.rowKey && (p = c), x.rowIndex >= m && x.rowIndex <= C && (p = c)), this.drawCellSkyBgColor = p;
|
|
1073
1077
|
let y = e, b = o;
|
|
1074
|
-
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (y = i, b = o),
|
|
1075
|
-
const E = s, { backgroundColor: v, color:
|
|
1078
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (y = i, b = o), u && (this.rowIndex % 2 ? y = g : y = e), typeof s == "function") {
|
|
1079
|
+
const E = s, { backgroundColor: v, color: I } = E({
|
|
1076
1080
|
row: this.row,
|
|
1077
1081
|
rowIndex: this.rowIndex,
|
|
1078
1082
|
colIndex: this.colIndex,
|
|
@@ -1080,16 +1084,16 @@ class Tt extends re {
|
|
|
1080
1084
|
isHasChanged: this.isHasChanged,
|
|
1081
1085
|
value: this.getValue()
|
|
1082
1086
|
}) || {};
|
|
1083
|
-
v && (y = v),
|
|
1087
|
+
v && (y = v), I && (b = I);
|
|
1084
1088
|
}
|
|
1085
1089
|
this.drawCellBgColor = y, this.drawTextColor = b;
|
|
1086
1090
|
}
|
|
1087
1091
|
updateSelection() {
|
|
1088
1092
|
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: n, rowIndex: h, rowKey: c } = this;
|
|
1089
1093
|
if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(n)) {
|
|
1090
|
-
const d = this.ctx.database.getRowSelection(c), f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE:
|
|
1091
|
-
let
|
|
1092
|
-
d && f ? (
|
|
1094
|
+
const d = this.ctx.database.getRowSelection(c), f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: u = 0 } = this.ctx.config, g = this.drawX + (e - u) / 2, p = this.drawY + (i - u) / 2;
|
|
1095
|
+
let x = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck";
|
|
1096
|
+
d && f ? (x = this.ctx.icons.get("checkbox-check"), w = "checkbox-check") : d && f ? (x = this.ctx.icons.get("checkbox-check-disabled"), w = "checkbox-check-disabled") : !d && f ? (x = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck") : (x = this.ctx.icons.get("checkbox-disabled"), w = "checkbox-disabled"), x && n == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === h || ["checkbox-disabled", "checkbox-check"].includes(w)) && (this.drawImageX = g, this.drawImageY = p, this.drawImageWidth = u, this.drawImageHeight = u, this.drawImageName = w, this.drawImageSource = x) : x && n === "selection" && (this.drawImageX = g, this.drawImageY = p, this.drawImageWidth = u, this.drawImageHeight = u, this.drawImageName = w, this.drawImageSource = x);
|
|
1093
1097
|
}
|
|
1094
1098
|
}
|
|
1095
1099
|
updateHoverIcon() {
|
|
@@ -1110,10 +1114,10 @@ class Tt extends re {
|
|
|
1110
1114
|
if (this.hoverIconName && !this.ctx.editing && n) {
|
|
1111
1115
|
let h = 0, c = 0;
|
|
1112
1116
|
if (n.rowKey === this.rowKey && (h = this.drawX + this.width - s - r, c = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && o) {
|
|
1113
|
-
const f = this.getSpanInfo(), { yArr:
|
|
1117
|
+
const f = this.getSpanInfo(), { yArr: u } = f, g = u[0], p = u[1];
|
|
1114
1118
|
if (n.rowIndex >= g && n.rowIndex <= p) {
|
|
1115
|
-
const { width:
|
|
1116
|
-
h = this.drawX - C +
|
|
1119
|
+
const { width: x, height: w, offsetTop: m, offsetLeft: C } = f;
|
|
1120
|
+
h = this.drawX - C + x - s - r, c = this.drawY - m + (w - s) / 2;
|
|
1117
1121
|
}
|
|
1118
1122
|
}
|
|
1119
1123
|
const d = this.ctx.icons.get(this.hoverIconName);
|
|
@@ -1212,10 +1216,10 @@ class Tt extends re {
|
|
|
1212
1216
|
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: r } = this.ctx.config;
|
|
1213
1217
|
if (!s || !i || this.ctx.editing)
|
|
1214
1218
|
return;
|
|
1215
|
-
const { xArr: o, yArr: n } = this.ctx.selector, h = o[1], c = n[1], { colIndex: d, rowIndex: f, drawX:
|
|
1219
|
+
const { xArr: o, yArr: n } = this.ctx.selector, h = o[1], c = n[1], { colIndex: d, rowIndex: f, drawX: u, drawY: g } = this;
|
|
1216
1220
|
if (d === h && f === c) {
|
|
1217
|
-
const
|
|
1218
|
-
this.ctx.paint.drawRect(
|
|
1221
|
+
const x = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
|
|
1222
|
+
this.ctx.paint.drawRect(u + this.width - x, g + this.height - x, 6, 6, {
|
|
1219
1223
|
borderColor: r,
|
|
1220
1224
|
fillColor: e
|
|
1221
1225
|
});
|
|
@@ -1336,11 +1340,11 @@ class Tt extends re {
|
|
|
1336
1340
|
drawBorder(e) {
|
|
1337
1341
|
const { drawX: i, drawY: s, rowIndex: r, colIndex: o, height: n, width: h } = this;
|
|
1338
1342
|
let c = i, d = s;
|
|
1339
|
-
const { xArr: f, yArr:
|
|
1343
|
+
const { xArr: f, yArr: u, lineDash: g = [], borderWidth: p = 1, borderColor: x, fillColor: w } = e, m = f[0], C = f[1], y = u[0], b = u[1];
|
|
1340
1344
|
if (o >= m && o <= C && r === y) {
|
|
1341
1345
|
const E = o === C ? 1 : 0, v = o === m ? 1 : 0;
|
|
1342
1346
|
this.ctx.paint.drawLine([c + v, d + 1, c + h - E, d + 1], {
|
|
1343
|
-
borderColor:
|
|
1347
|
+
borderColor: x,
|
|
1344
1348
|
fillColor: w,
|
|
1345
1349
|
borderWidth: p,
|
|
1346
1350
|
lineCap: "round",
|
|
@@ -1351,7 +1355,7 @@ class Tt extends re {
|
|
|
1351
1355
|
if (o === C && r >= y && r <= b) {
|
|
1352
1356
|
const E = r === y ? 1 : 0, v = r === b ? 1 : 0;
|
|
1353
1357
|
this.ctx.paint.drawLine([c + h - 1, d + E, c + h - 1, d + n - v], {
|
|
1354
|
-
borderColor:
|
|
1358
|
+
borderColor: x,
|
|
1355
1359
|
fillColor: w,
|
|
1356
1360
|
borderWidth: p,
|
|
1357
1361
|
lineCap: "round",
|
|
@@ -1362,7 +1366,7 @@ class Tt extends re {
|
|
|
1362
1366
|
if (o >= m && o <= C && r === b) {
|
|
1363
1367
|
const E = o === C ? 1 : 0, v = o === m ? 1 : 0;
|
|
1364
1368
|
this.ctx.paint.drawLine([c + v, d + n - 1, c + h - E, d + n - 1], {
|
|
1365
|
-
borderColor:
|
|
1369
|
+
borderColor: x,
|
|
1366
1370
|
fillColor: w,
|
|
1367
1371
|
borderWidth: p,
|
|
1368
1372
|
lineCap: "round",
|
|
@@ -1373,7 +1377,7 @@ class Tt extends re {
|
|
|
1373
1377
|
if (o === m && r >= y && r <= b) {
|
|
1374
1378
|
const E = r === b ? 1 : 0, v = r === y ? 1 : 0;
|
|
1375
1379
|
this.ctx.paint.drawLine([c + 1, d + v, c + 1, d + n - E], {
|
|
1376
|
-
borderColor:
|
|
1380
|
+
borderColor: x,
|
|
1377
1381
|
fillColor: w,
|
|
1378
1382
|
borderWidth: p,
|
|
1379
1383
|
lineCap: "round",
|
|
@@ -1383,7 +1387,7 @@ class Tt extends re {
|
|
|
1383
1387
|
}
|
|
1384
1388
|
}
|
|
1385
1389
|
}
|
|
1386
|
-
class
|
|
1390
|
+
class li {
|
|
1387
1391
|
//虚拟滚动位置
|
|
1388
1392
|
constructor(t, e) {
|
|
1389
1393
|
l(this, "loading", !1);
|
|
@@ -1436,30 +1440,30 @@ class ai {
|
|
|
1436
1440
|
var w;
|
|
1437
1441
|
let r = i._hasChildren || !1;
|
|
1438
1442
|
Array.isArray(i.children) && i.children.length && (r = !0, this.initData(i.children, e + 1));
|
|
1439
|
-
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: d } = this.ctx.config, f = i[o],
|
|
1440
|
-
this.itemRowKeyMap.set(i,
|
|
1443
|
+
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: d } = this.ctx.config, f = i[o], u = f != null ? `${f}` : Jt();
|
|
1444
|
+
this.itemRowKeyMap.set(i, u);
|
|
1441
1445
|
const g = i._height || h, p = i._readonly;
|
|
1442
|
-
let
|
|
1443
|
-
if (typeof c == "function" && (
|
|
1446
|
+
let x = !0;
|
|
1447
|
+
if (typeof c == "function" && (x = c), d) {
|
|
1444
1448
|
const m = i[d];
|
|
1445
1449
|
if (this.checkboxKeyMap.has(m)) {
|
|
1446
1450
|
const C = this.checkboxKeyMap.get(m) || [];
|
|
1447
|
-
C.push(
|
|
1451
|
+
C.push(u), this.checkboxKeyMap.set(m, C);
|
|
1448
1452
|
} else
|
|
1449
|
-
this.checkboxKeyMap.set(m, [
|
|
1453
|
+
this.checkboxKeyMap.set(m, [u]);
|
|
1450
1454
|
}
|
|
1451
|
-
this.selectionMap.set(
|
|
1452
|
-
key: d ? i[d] :
|
|
1455
|
+
this.selectionMap.set(u, {
|
|
1456
|
+
key: d ? i[d] : u,
|
|
1453
1457
|
row: i,
|
|
1454
|
-
check: ((w = this.selectionMap.get(
|
|
1455
|
-
}), this.rowKeyMap.set(
|
|
1458
|
+
check: ((w = this.selectionMap.get(u)) == null ? void 0 : w.check) || !1
|
|
1459
|
+
}), this.rowKeyMap.set(u, {
|
|
1456
1460
|
readonly: p,
|
|
1457
1461
|
index: s,
|
|
1458
1462
|
rowIndex: s,
|
|
1459
1463
|
level: e,
|
|
1460
1464
|
height: g,
|
|
1461
1465
|
check: !1,
|
|
1462
|
-
selectable:
|
|
1466
|
+
selectable: x,
|
|
1463
1467
|
expand: n,
|
|
1464
1468
|
expandLazy: !1,
|
|
1465
1469
|
hasChildren: r,
|
|
@@ -1671,19 +1675,19 @@ class ai {
|
|
|
1671
1675
|
let i = [];
|
|
1672
1676
|
const s = /* @__PURE__ */ new Set();
|
|
1673
1677
|
let r = [], o = t.map((d) => {
|
|
1674
|
-
const { rowKey: f, key:
|
|
1678
|
+
const { rowKey: f, key: u } = d;
|
|
1675
1679
|
let g = d.value, p = g;
|
|
1676
|
-
const
|
|
1680
|
+
const x = this.getRowDataItemForRowKey(f), w = this.getItemValue(f, u), m = this.getVirtualBodyCellByKey(f, u);
|
|
1677
1681
|
return (m == null ? void 0 : m.type) === "number" && (["", void 0, null].includes(g) ? p = null : /^-?\d+(\.\d+)?$/.test(`${g}`) ? p = Number(g) : (p = w, r.push({
|
|
1678
1682
|
...d,
|
|
1679
1683
|
value: p,
|
|
1680
1684
|
oldValue: w,
|
|
1681
|
-
row:
|
|
1685
|
+
row: x
|
|
1682
1686
|
}))), {
|
|
1683
1687
|
...d,
|
|
1684
1688
|
value: p,
|
|
1685
1689
|
oldValue: w,
|
|
1686
|
-
row:
|
|
1690
|
+
row: x
|
|
1687
1691
|
};
|
|
1688
1692
|
});
|
|
1689
1693
|
if (o = o.filter((d) => !r.some((f) => d.rowKey === f.rowKey && d.key === f.key)), r.length) {
|
|
@@ -1698,9 +1702,9 @@ class ai {
|
|
|
1698
1702
|
return;
|
|
1699
1703
|
const { BEFORE_VALUE_CHANGE_METHOD: n } = this.ctx.config;
|
|
1700
1704
|
typeof n == "function" && (o = await n(o)), o.forEach((d) => {
|
|
1701
|
-
const { value: f, rowKey:
|
|
1702
|
-
s.add(
|
|
1703
|
-
rowKey:
|
|
1705
|
+
const { value: f, rowKey: u, key: g, oldValue: p } = d;
|
|
1706
|
+
s.add(u), this.setItemValue(u, g, f), i.push({
|
|
1707
|
+
rowKey: u,
|
|
1704
1708
|
key: g,
|
|
1705
1709
|
oldValue: p,
|
|
1706
1710
|
newValue: f
|
|
@@ -1743,7 +1747,7 @@ class ai {
|
|
|
1743
1747
|
n[e] !== null && typeof n[e] == "object" && (h = JSON.parse(JSON.stringify(n[e])));
|
|
1744
1748
|
const d = `${t}_${e}`;
|
|
1745
1749
|
this.originalDataMap.has(d) || this.originalDataMap.set(d, h);
|
|
1746
|
-
const f = this.originalDataMap.get(d),
|
|
1750
|
+
const f = this.originalDataMap.get(d), u = this.getRowDataItemForRowKey(t);
|
|
1747
1751
|
if (o) {
|
|
1748
1752
|
const g = this.getVirtualBodyCellByKey(t, e);
|
|
1749
1753
|
if ((g == null ? void 0 : g.type) === "number")
|
|
@@ -1762,7 +1766,7 @@ class ai {
|
|
|
1762
1766
|
key: e,
|
|
1763
1767
|
value: c,
|
|
1764
1768
|
oldValue: h,
|
|
1765
|
-
row:
|
|
1769
|
+
row: u
|
|
1766
1770
|
}
|
|
1767
1771
|
]
|
|
1768
1772
|
};
|
|
@@ -1781,28 +1785,28 @@ class ai {
|
|
|
1781
1785
|
key: e,
|
|
1782
1786
|
value: c,
|
|
1783
1787
|
oldValue: n[e],
|
|
1784
|
-
row:
|
|
1788
|
+
row: u
|
|
1785
1789
|
}
|
|
1786
1790
|
]);
|
|
1787
1791
|
m && m.length && (c = m[0].value);
|
|
1788
1792
|
}
|
|
1789
1793
|
this.changedDataMap.set(d, c), n[e] = c;
|
|
1790
|
-
const
|
|
1794
|
+
const x = {
|
|
1791
1795
|
rowKey: t,
|
|
1792
1796
|
key: e,
|
|
1793
1797
|
oldValue: h,
|
|
1794
1798
|
value: c,
|
|
1795
|
-
row:
|
|
1799
|
+
row: u
|
|
1796
1800
|
};
|
|
1797
1801
|
this.getValidator(t, e).then(() => {
|
|
1798
1802
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1799
|
-
}), this.ctx.emit("change", [
|
|
1803
|
+
}), this.ctx.emit("change", [x], [u]), this.ctx.emit("editChange", {
|
|
1800
1804
|
rowKey: t,
|
|
1801
1805
|
key: e,
|
|
1802
1806
|
oldValue: h,
|
|
1803
1807
|
value: c,
|
|
1804
1808
|
originalValue: f,
|
|
1805
|
-
row:
|
|
1809
|
+
row: u
|
|
1806
1810
|
});
|
|
1807
1811
|
} else
|
|
1808
1812
|
this.changedDataMap.set(d, c), n[e] = c;
|
|
@@ -1812,7 +1816,7 @@ class ai {
|
|
|
1812
1816
|
oldValue: h,
|
|
1813
1817
|
value: c,
|
|
1814
1818
|
originalValue: this.originalDataMap.get(d),
|
|
1815
|
-
row:
|
|
1819
|
+
row: u
|
|
1816
1820
|
}), s && this.ctx.history.pushState({
|
|
1817
1821
|
type: "single",
|
|
1818
1822
|
scrollX: this.ctx.scrollX,
|
|
@@ -1941,14 +1945,14 @@ class ai {
|
|
|
1941
1945
|
return e;
|
|
1942
1946
|
const i = this.rowKeyMap.size;
|
|
1943
1947
|
let s = 0, r = 0;
|
|
1944
|
-
const o = this.selectionMap.size, n = Array.from(this.selectionMap.values()).some((
|
|
1945
|
-
this.rowKeyMap.forEach((
|
|
1946
|
-
var
|
|
1947
|
-
(
|
|
1948
|
-
let p =
|
|
1948
|
+
const o = this.selectionMap.size, n = Array.from(this.selectionMap.values()).some((u) => u.check);
|
|
1949
|
+
this.rowKeyMap.forEach((u, g) => {
|
|
1950
|
+
var x;
|
|
1951
|
+
(x = this.selectionMap.get(g)) != null && x.check && (s += 1);
|
|
1952
|
+
let p = u.selectable;
|
|
1949
1953
|
typeof p == "function" && (p = p({
|
|
1950
|
-
row:
|
|
1951
|
-
rowIndex:
|
|
1954
|
+
row: u.item,
|
|
1955
|
+
rowIndex: u.rowIndex
|
|
1952
1956
|
})), p && (r += 1);
|
|
1953
1957
|
});
|
|
1954
1958
|
const h = o > i && s === 0 && n, c = r && r > s && s > 0 || h, d = r !== 0, f = !!r && r === s;
|
|
@@ -2090,14 +2094,14 @@ class ai {
|
|
|
2090
2094
|
if (h) {
|
|
2091
2095
|
let c = {}, d = {};
|
|
2092
2096
|
if (d[e] = this.getItemValue(t, e), Array.isArray(h)) {
|
|
2093
|
-
const
|
|
2097
|
+
const u = h.map((g) => ({
|
|
2094
2098
|
...g,
|
|
2095
2099
|
row: s.item,
|
|
2096
2100
|
column: n,
|
|
2097
2101
|
rowIndex: s.rowIndex,
|
|
2098
2102
|
colIndex: r.colIndex
|
|
2099
2103
|
}));
|
|
2100
|
-
c[e] =
|
|
2104
|
+
c[e] = u;
|
|
2101
2105
|
} else
|
|
2102
2106
|
c[e] = {
|
|
2103
2107
|
...h,
|
|
@@ -2108,8 +2112,8 @@ class ai {
|
|
|
2108
2112
|
};
|
|
2109
2113
|
new nt(c).validate(d).then(() => {
|
|
2110
2114
|
this.clearValidationError(t, e), i([]);
|
|
2111
|
-
}).catch(({ errors:
|
|
2112
|
-
const g =
|
|
2115
|
+
}).catch(({ errors: u }) => {
|
|
2116
|
+
const g = u.map((p) => ({
|
|
2113
2117
|
...p,
|
|
2114
2118
|
column: n,
|
|
2115
2119
|
key: e,
|
|
@@ -2142,10 +2146,10 @@ class ai {
|
|
|
2142
2146
|
relationColKeys: c,
|
|
2143
2147
|
rowspan: d,
|
|
2144
2148
|
height: f,
|
|
2145
|
-
width:
|
|
2149
|
+
width: u,
|
|
2146
2150
|
colspan: g,
|
|
2147
2151
|
mergeRow: p,
|
|
2148
|
-
mergeCol:
|
|
2152
|
+
mergeCol: x
|
|
2149
2153
|
} = t;
|
|
2150
2154
|
if (d === 1 && g === 1)
|
|
2151
2155
|
return {
|
|
@@ -2154,7 +2158,7 @@ class ai {
|
|
|
2154
2158
|
rowspan: d,
|
|
2155
2159
|
colspan: g,
|
|
2156
2160
|
height: f,
|
|
2157
|
-
width:
|
|
2161
|
+
width: u,
|
|
2158
2162
|
offsetTop: 0,
|
|
2159
2163
|
offsetLeft: 0,
|
|
2160
2164
|
dataList: [
|
|
@@ -2166,10 +2170,10 @@ class ai {
|
|
|
2166
2170
|
}
|
|
2167
2171
|
]
|
|
2168
2172
|
};
|
|
2169
|
-
let w = e, m = e, C = n, y = n, b = [], E = 0, v = 0,
|
|
2173
|
+
let w = e, m = e, C = n, y = n, b = [], E = 0, v = 0, I = 0, L = 0;
|
|
2170
2174
|
if (d !== 1 && p) {
|
|
2171
|
-
L =
|
|
2172
|
-
const
|
|
2175
|
+
L = u;
|
|
2176
|
+
const _ = h.reduce((R, A) => {
|
|
2173
2177
|
const S = this.getItemValue(s, A) ?? "";
|
|
2174
2178
|
return `${R}${S}`;
|
|
2175
2179
|
}, "");
|
|
@@ -2178,7 +2182,7 @@ class ai {
|
|
|
2178
2182
|
const B = this.getItemValue(A, T) ?? "";
|
|
2179
2183
|
return `${M}${B}`;
|
|
2180
2184
|
}, "");
|
|
2181
|
-
if (
|
|
2185
|
+
if (_ === S)
|
|
2182
2186
|
w = R;
|
|
2183
2187
|
else
|
|
2184
2188
|
break;
|
|
@@ -2188,7 +2192,7 @@ class ai {
|
|
|
2188
2192
|
const B = this.getItemValue(A, T) ?? "";
|
|
2189
2193
|
return `${M}${B}`;
|
|
2190
2194
|
}, "");
|
|
2191
|
-
if (
|
|
2195
|
+
if (_ === S)
|
|
2192
2196
|
m = R;
|
|
2193
2197
|
else
|
|
2194
2198
|
break;
|
|
@@ -2199,7 +2203,7 @@ class ai {
|
|
|
2199
2203
|
}
|
|
2200
2204
|
for (let R = w; R <= m; R++) {
|
|
2201
2205
|
const { height: A } = this.positions[R];
|
|
2202
|
-
|
|
2206
|
+
I += A;
|
|
2203
2207
|
const S = this.rowIndexRowKeyMap.get(R) || "", { item: M } = this.rowKeyMap.get(S), T = this.getItemValue(S, i);
|
|
2204
2208
|
b.push({
|
|
2205
2209
|
rowKey: S,
|
|
@@ -2209,36 +2213,36 @@ class ai {
|
|
|
2209
2213
|
});
|
|
2210
2214
|
}
|
|
2211
2215
|
}
|
|
2212
|
-
if (g !== 1 &&
|
|
2213
|
-
|
|
2214
|
-
for (let
|
|
2215
|
-
const R = this.getColumnByColIndex(
|
|
2216
|
+
if (g !== 1 && x) {
|
|
2217
|
+
I = f;
|
|
2218
|
+
for (let _ = n - 1; _ >= 0; _--) {
|
|
2219
|
+
const R = this.getColumnByColIndex(_);
|
|
2216
2220
|
if (!R)
|
|
2217
2221
|
break;
|
|
2218
2222
|
const A = this.getItemValue(s, i), S = this.getItemValue(s, R.key);
|
|
2219
2223
|
if (A === S && c.includes(R.key))
|
|
2220
|
-
C =
|
|
2224
|
+
C = _;
|
|
2221
2225
|
else
|
|
2222
2226
|
break;
|
|
2223
2227
|
}
|
|
2224
|
-
for (let
|
|
2225
|
-
const R = this.getColumnByColIndex(
|
|
2228
|
+
for (let _ = n; _ <= this.ctx.maxColIndex; _++) {
|
|
2229
|
+
const R = this.getColumnByColIndex(_);
|
|
2226
2230
|
if (!R)
|
|
2227
2231
|
break;
|
|
2228
2232
|
const A = this.getItemValue(s, i), S = this.getItemValue(s, R.key);
|
|
2229
2233
|
if (A === S && c.includes(R.key))
|
|
2230
|
-
y =
|
|
2234
|
+
y = _;
|
|
2231
2235
|
else
|
|
2232
2236
|
break;
|
|
2233
2237
|
}
|
|
2234
|
-
for (let
|
|
2235
|
-
const R = this.getColumnByColIndex(
|
|
2238
|
+
for (let _ = C; _ < n; _++) {
|
|
2239
|
+
const R = this.getColumnByColIndex(_);
|
|
2236
2240
|
if (!R)
|
|
2237
2241
|
break;
|
|
2238
2242
|
v += R.width || 100;
|
|
2239
2243
|
}
|
|
2240
|
-
for (let
|
|
2241
|
-
const R = this.getColumnByColIndex(
|
|
2244
|
+
for (let _ = C; _ <= y; _++) {
|
|
2245
|
+
const R = this.getColumnByColIndex(_);
|
|
2242
2246
|
if (!R)
|
|
2243
2247
|
break;
|
|
2244
2248
|
L += R.width || 100, b.push({
|
|
@@ -2254,7 +2258,7 @@ class ai {
|
|
|
2254
2258
|
yArr: [w, m],
|
|
2255
2259
|
rowspan: d,
|
|
2256
2260
|
colspan: g,
|
|
2257
|
-
height:
|
|
2261
|
+
height: I,
|
|
2258
2262
|
width: L,
|
|
2259
2263
|
offsetTop: E,
|
|
2260
2264
|
offsetLeft: v,
|
|
@@ -2310,7 +2314,7 @@ class ai {
|
|
|
2310
2314
|
return i;
|
|
2311
2315
|
}
|
|
2312
2316
|
}
|
|
2313
|
-
class
|
|
2317
|
+
class hi {
|
|
2314
2318
|
constructor(t) {
|
|
2315
2319
|
l(this, "ctx");
|
|
2316
2320
|
l(this, "history", []);
|
|
@@ -2365,7 +2369,7 @@ class li {
|
|
|
2365
2369
|
this.history = [], this.historyIndex = -1;
|
|
2366
2370
|
}
|
|
2367
2371
|
}
|
|
2368
|
-
class
|
|
2372
|
+
class ci {
|
|
2369
2373
|
constructor(t) {
|
|
2370
2374
|
l(this, "eventTasks", /* @__PURE__ */ new Map());
|
|
2371
2375
|
l(this, "ctx");
|
|
@@ -2432,7 +2436,7 @@ class hi {
|
|
|
2432
2436
|
t.removeEventListener(e, i), this.eventTasks.delete(e);
|
|
2433
2437
|
}
|
|
2434
2438
|
}
|
|
2435
|
-
class
|
|
2439
|
+
class di {
|
|
2436
2440
|
constructor() {
|
|
2437
2441
|
l(this, "events", /* @__PURE__ */ new Map());
|
|
2438
2442
|
}
|
|
@@ -2470,7 +2474,7 @@ class ci {
|
|
|
2470
2474
|
this.events.clear();
|
|
2471
2475
|
}
|
|
2472
2476
|
}
|
|
2473
|
-
class
|
|
2477
|
+
class fi {
|
|
2474
2478
|
constructor(t) {
|
|
2475
2479
|
l(this, "ctx");
|
|
2476
2480
|
const e = t.getContext("2d");
|
|
@@ -2545,8 +2549,8 @@ class di {
|
|
|
2545
2549
|
if (this.ctx.save(), this.ctx.beginPath(), n !== void 0 && (this.ctx.fillStyle = n), o !== void 0 && (this.ctx.lineWidth = r, this.ctx.strokeStyle = o), h === 0)
|
|
2546
2550
|
this.ctx.rect(t - 0.5, e - 0.5, i, s);
|
|
2547
2551
|
else {
|
|
2548
|
-
const [c, d, f,
|
|
2549
|
-
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 -
|
|
2552
|
+
const [c, d, f, u] = typeof h == "number" ? [h, h, h, h] : h;
|
|
2553
|
+
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 - u, u), this.ctx.arcTo(t, e, t + c, e, c);
|
|
2550
2554
|
}
|
|
2551
2555
|
n !== void 0 && this.ctx.fill(), o !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
2552
2556
|
}
|
|
@@ -2570,12 +2574,12 @@ class di {
|
|
|
2570
2574
|
verticalAlign: f = "middle"
|
|
2571
2575
|
} = o;
|
|
2572
2576
|
this.ctx.font = n, this.ctx.fillStyle = c, this.ctx.textBaseline = f, this.ctx.textAlign = h;
|
|
2573
|
-
let
|
|
2574
|
-
f === "top" ?
|
|
2577
|
+
let u = 0;
|
|
2578
|
+
f === "top" ? u = i + d : f === "bottom" ? u = i + r - d : u = i + (r + 1) / 2;
|
|
2575
2579
|
let g = 0;
|
|
2576
2580
|
h === "left" ? g = e + d : h === "right" ? g = e + s - d : g = e + s / 2;
|
|
2577
|
-
const { _text: p, ellipsis:
|
|
2578
|
-
return this.ctx.fillText(p, g,
|
|
2581
|
+
const { _text: p, ellipsis: x } = this.handleEllipsis(t, s, d, n);
|
|
2582
|
+
return this.ctx.fillText(p, g, u), this.ctx.restore(), x;
|
|
2579
2583
|
}
|
|
2580
2584
|
handleEllipsis(t, e, i = 0, s = "12px Arial") {
|
|
2581
2585
|
let r = !1, o = t;
|
|
@@ -2602,6 +2606,7 @@ class di {
|
|
|
2602
2606
|
}
|
|
2603
2607
|
class Wt {
|
|
2604
2608
|
constructor(t) {
|
|
2609
|
+
l(this, "_config", {});
|
|
2605
2610
|
l(this, "CSS_PREFIX", "e-virt-table");
|
|
2606
2611
|
l(this, "ICONS", []);
|
|
2607
2612
|
l(this, "ROW_KEY", "");
|
|
@@ -2691,6 +2696,7 @@ class Wt {
|
|
|
2691
2696
|
// 选择器Y最大范围,0默认rowMax
|
|
2692
2697
|
l(this, "SELECTOR_AREA_MAX_Y_OFFSET", 0);
|
|
2693
2698
|
// 选择器Y最大范围,0默认rowMax
|
|
2699
|
+
l(this, "ENABLE_AUTO_THEME", !0);
|
|
2694
2700
|
l(this, "ENABLE_SELECTOR_SINGLE", !1);
|
|
2695
2701
|
l(this, "ENABLE_SELECTOR_SPAN_COL", !0);
|
|
2696
2702
|
l(this, "ENABLE_SELECTOR_SPAN_ROW", !0);
|
|
@@ -2745,14 +2751,23 @@ class Wt {
|
|
|
2745
2751
|
l(this, "BEFORE_SET_SELECTOR_METHOD");
|
|
2746
2752
|
l(this, "BEFORE_SET_AUTOFILL_METHOD");
|
|
2747
2753
|
l(this, "BEFORE_COPY_METHOD");
|
|
2748
|
-
|
|
2754
|
+
this._config = t, this.updateCssVar();
|
|
2749
2755
|
}
|
|
2750
2756
|
init(t) {
|
|
2751
|
-
|
|
2757
|
+
this._config = t, this.updateCssVar();
|
|
2758
|
+
}
|
|
2759
|
+
// 同步css 样式变量
|
|
2760
|
+
updateCssVar() {
|
|
2761
|
+
Object.keys(this).forEach((t) => {
|
|
2762
|
+
if (t.endsWith("_COLOR")) {
|
|
2763
|
+
const e = `--evt-${t.toLocaleLowerCase().replace(/_/g, "-")}`, i = ai(e);
|
|
2764
|
+
this[t] = i;
|
|
2765
|
+
}
|
|
2766
|
+
}), Object.assign(this, this._config);
|
|
2752
2767
|
}
|
|
2753
2768
|
}
|
|
2754
2769
|
const Pt = '<svg t="1724122044148" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M707.648 401.28L489.28 560.704l22.656 30.976 22.656-30.976L316.16 401.216q-3.072-2.24-6.464-3.84-3.456-1.536-7.104-2.432-3.712-0.896-7.488-1.088-3.776-0.128-7.488 0.448-3.776 0.64-7.296 1.92-3.584 1.28-6.784 3.2-3.2 1.984-6.016 4.544-2.816 2.56-5.056 5.632-2.176 3.072-3.84 6.464-1.536 3.456-2.432 7.104-0.896 3.712-1.088 7.488-0.128 3.776 0.448 7.488 0.64 3.776 1.92 7.296 1.28 3.584 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992l218.368 159.552q4.928 3.584 10.752 5.504 5.76 1.92 11.904 1.92 6.08 0 11.904-1.92 5.76-1.92 10.752-5.504l218.368-159.552q3.008-2.24 5.568-4.992 2.56-2.816 4.544-6.016 1.92-3.2 3.264-6.784 1.28-3.52 1.92-7.296 0.576-3.712 0.384-7.488-0.128-3.84-1.024-7.488-0.896-3.648-2.496-7.04-1.6-3.456-3.84-6.528-2.24-3.072-4.992-5.632-2.816-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.584-1.28-7.296-1.856-3.712-0.64-7.488-0.448-3.84 0.192-7.488 1.088-3.648 0.896-7.04 2.496-3.456 1.536-6.528 3.84z m61.056 30.976q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.472-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.72-3.584-3.456-1.408-7.168-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.656 3.584-3.136 2.112-5.76 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.584 6.656-1.408 3.52-2.176 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.176 7.168 1.472 3.52 3.584 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.168-2.176 3.52-1.408 6.656-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.048-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z m-436.736 0q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.408-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.592 3.584-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.24 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.24 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z" p-id="4552"></path></svg>';
|
|
2755
|
-
class
|
|
2770
|
+
class ui {
|
|
2756
2771
|
constructor(t) {
|
|
2757
2772
|
l(this, "ctx");
|
|
2758
2773
|
l(this, "list", [
|
|
@@ -2983,8 +2998,8 @@ class oe extends re {
|
|
|
2983
2998
|
const { width: e, height: i, type: s } = this;
|
|
2984
2999
|
if (["index-selection", "selection"].includes(s)) {
|
|
2985
3000
|
const { indeterminate: r, check: o, selectable: n } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: h = 0 } = this.ctx.config, c = this.drawX + (e - h) / 2, d = this.drawY + (i - h) / 2;
|
|
2986
|
-
let f = this.ctx.icons.get("checkbox-uncheck"),
|
|
2987
|
-
r ? (f = this.ctx.icons.get("checkbox-indeterminate"),
|
|
3001
|
+
let f = this.ctx.icons.get("checkbox-uncheck"), u = "checkbox-uncheck";
|
|
3002
|
+
r ? (f = this.ctx.icons.get("checkbox-indeterminate"), u = "checkbox-indeterminate") : o && n ? (f = this.ctx.icons.get("checkbox-check"), u = "checkbox-check") : o && n ? (f = this.ctx.icons.get("checkbox-check-disabled"), u = "checkbox-check-disabled") : !o && n ? (f = this.ctx.icons.get("checkbox-uncheck"), u = "checkbox-uncheck") : (f = this.ctx.icons.get("checkbox-disabled"), u = "checkbox-disabled"), f && (this.drawImageX = c, this.drawImageY = d, this.drawImageWidth = h, this.drawImageHeight = h, this.drawImageName = u, this.drawImageSource = f, this.ctx.paint.drawImage(
|
|
2988
3003
|
this.drawImageSource,
|
|
2989
3004
|
this.drawImageX,
|
|
2990
3005
|
this.drawImageY,
|
|
@@ -3018,12 +3033,20 @@ class xi {
|
|
|
3018
3033
|
l(this, "ctx");
|
|
3019
3034
|
l(this, "visibleHoverCell");
|
|
3020
3035
|
l(this, "resizeObserver");
|
|
3036
|
+
l(this, "mutationObserver");
|
|
3021
3037
|
this.ctx = t, this.init();
|
|
3022
3038
|
}
|
|
3023
3039
|
init() {
|
|
3024
3040
|
this.resizeObserver = new ResizeObserver(() => {
|
|
3025
3041
|
this.ctx.emit("resetHeader"), this.ctx.emit("resizeObserver");
|
|
3026
|
-
}), this.resizeObserver.observe(this.ctx.containerElement), this.
|
|
3042
|
+
}), this.resizeObserver.observe(this.ctx.containerElement), this.mutationObserver = new MutationObserver((t) => {
|
|
3043
|
+
for (const e of t)
|
|
3044
|
+
e.type === "attributes" && e.attributeName === "class" && (this.ctx.config.updateCssVar(), this.ctx.emit("draw"));
|
|
3045
|
+
}), this.ctx.config.ENABLE_AUTO_THEME && this.mutationObserver.observe(document.documentElement, {
|
|
3046
|
+
attributes: !0,
|
|
3047
|
+
attributeFilter: ["class"]
|
|
3048
|
+
// ✅ 只监听 class 更改
|
|
3049
|
+
}), this.ctx.on("mousedown", (t) => {
|
|
3027
3050
|
if (t.button !== 0 || this.isBusy(t))
|
|
3028
3051
|
return;
|
|
3029
3052
|
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, r = i;
|
|
@@ -3175,10 +3198,10 @@ class xi {
|
|
|
3175
3198
|
return t > this.ctx.body.y && t < this.ctx.body.y + this.ctx.body.visibleHeight;
|
|
3176
3199
|
}
|
|
3177
3200
|
destroy() {
|
|
3178
|
-
this.resizeObserver.unobserve(this.ctx.stageElement);
|
|
3201
|
+
this.resizeObserver.unobserve(this.ctx.stageElement), this.mutationObserver.disconnect();
|
|
3179
3202
|
}
|
|
3180
3203
|
}
|
|
3181
|
-
class
|
|
3204
|
+
class gi {
|
|
3182
3205
|
constructor(t, e) {
|
|
3183
3206
|
l(this, "eventBus");
|
|
3184
3207
|
l(this, "eventBrowser");
|
|
@@ -3292,7 +3315,7 @@ class ui {
|
|
|
3292
3315
|
emptyElement: h,
|
|
3293
3316
|
contextMenuElement: c
|
|
3294
3317
|
} = t;
|
|
3295
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = n, this.emptyElement = h, this.contextMenuElement = c, this.config = new Wt(e.config || {}), this.eventBus = new
|
|
3318
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = n, this.emptyElement = h, this.contextMenuElement = c, this.config = new Wt(e.config || {}), this.eventBus = new di(), this.eventBrowser = new ci(this), this.eventTable = new xi(this), this.paint = new fi(this.canvasElement), this.database = new li(this, e), this.history = new hi(this), this.icons = new ui(this);
|
|
3296
3319
|
}
|
|
3297
3320
|
setConfig(t) {
|
|
3298
3321
|
this.config = new Wt(t);
|
|
@@ -3498,12 +3521,12 @@ class zt {
|
|
|
3498
3521
|
stageHeight: i,
|
|
3499
3522
|
stageWidth: s,
|
|
3500
3523
|
config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0, BORDER: n }
|
|
3501
|
-
} = this.ctx, h = s, c = i, d = e.height, f = e.width,
|
|
3524
|
+
} = this.ctx, h = s, c = i, d = e.height, f = e.width, u = t.height, g = this.ctx.footer.height;
|
|
3502
3525
|
if (this.type === "vertical") {
|
|
3503
|
-
this.visibleDistance = c - r - d, this.distance =
|
|
3504
|
-
const p = this.distance ? this.visibleDistance / (
|
|
3505
|
-
let
|
|
3506
|
-
|
|
3526
|
+
this.visibleDistance = c - r - d, this.distance = u - this.visibleDistance + g, this.trackX = h - r, this.trackY = 0, this.splitPoints = [this.trackX, d, this.trackX + r, d], this.trackWidth = r, this.trackHeight = c, this.barX = this.trackX - 1 + (r - o) / 2, this.barWidth = o;
|
|
3527
|
+
const p = this.distance ? this.visibleDistance / (u + g) : 0;
|
|
3528
|
+
let x = Math.floor(p * this.visibleDistance);
|
|
3529
|
+
x < 30 ? x = 30 : x > this.visibleDistance && (x = 0), this.barHeight = x, this.barY = d + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3507
3530
|
} else {
|
|
3508
3531
|
this.visibleDistance = h - r, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
3509
3532
|
h - r,
|
|
@@ -3513,8 +3536,8 @@ class zt {
|
|
|
3513
3536
|
];
|
|
3514
3537
|
const p = n ? 0 : 0.5;
|
|
3515
3538
|
this.trackX = 0, this.trackY = c - r + p, this.trackWidth = h, this.trackHeight = r;
|
|
3516
|
-
const
|
|
3517
|
-
let w = Math.floor(
|
|
3539
|
+
const x = this.distance ? this.visibleDistance / f : 0;
|
|
3540
|
+
let w = Math.floor(x * this.visibleDistance);
|
|
3518
3541
|
this.barY = this.trackY - 1 + (r - o) / 2, w < 30 ? w = 30 : w >= this.visibleDistance && (w = 0), this.barWidth = w, this.barHeight = o, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3519
3542
|
}
|
|
3520
3543
|
}
|
|
@@ -3536,7 +3559,7 @@ class zt {
|
|
|
3536
3559
|
}), this.ctx.scrollerFocus = this.isFocus;
|
|
3537
3560
|
}
|
|
3538
3561
|
}
|
|
3539
|
-
class
|
|
3562
|
+
class wi {
|
|
3540
3563
|
constructor(t) {
|
|
3541
3564
|
l(this, "ctx");
|
|
3542
3565
|
l(this, "verticalScrollbar");
|
|
@@ -3600,7 +3623,7 @@ class gi {
|
|
|
3600
3623
|
this.setScrollY(r - e.visibleHeight / 2);
|
|
3601
3624
|
}
|
|
3602
3625
|
}
|
|
3603
|
-
class
|
|
3626
|
+
class pi {
|
|
3604
3627
|
constructor(t) {
|
|
3605
3628
|
l(this, "ctx");
|
|
3606
3629
|
// 上下文
|
|
@@ -3649,8 +3672,8 @@ class wi {
|
|
|
3649
3672
|
config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
|
|
3650
3673
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3651
3674
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3652
|
-
const s = te(i), r =
|
|
3653
|
-
this.height = t * s, this.width = r.reduce((f,
|
|
3675
|
+
const s = te(i), r = _t(i);
|
|
3676
|
+
this.height = t * s, this.width = r.reduce((f, u) => f + ((u == null ? void 0 : u.width) || 100), 0), this.visibleHeight = this.height;
|
|
3654
3677
|
const o = ei(ee(i, s));
|
|
3655
3678
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3656
3679
|
const n = this.ctx.containerElement.getBoundingClientRect();
|
|
@@ -3661,9 +3684,9 @@ class wi {
|
|
|
3661
3684
|
this.resizeAllColumn(f);
|
|
3662
3685
|
}
|
|
3663
3686
|
const c = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
3664
|
-
this.ctx.fixedLeftWidth = c.reduce((f,
|
|
3687
|
+
this.ctx.fixedLeftWidth = c.reduce((f, u) => f + u.width, 0);
|
|
3665
3688
|
const d = this.fixedRightCellHeaders.filter((f) => !f.hasChildren);
|
|
3666
|
-
this.ctx.fixedRightWidth = d.reduce((f,
|
|
3689
|
+
this.ctx.fixedRightWidth = d.reduce((f, u) => f + u.width, e), this.ctx.maxColIndex = this.leafCellHeaders.length - 1, this.ctx.header.x = this.x, this.ctx.header.y = this.y, this.ctx.header.width = this.width, this.ctx.header.height = this.height, this.ctx.header.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
|
|
3667
3690
|
}
|
|
3668
3691
|
// 调整表头的宽度
|
|
3669
3692
|
initResizeColumn() {
|
|
@@ -3752,7 +3775,7 @@ class wi {
|
|
|
3752
3775
|
for (let o = 0; o < i; o++) {
|
|
3753
3776
|
const n = t[o], h = r * (n.rowspan || 0), c = r * (n.level || 0);
|
|
3754
3777
|
let d = n.width || 100;
|
|
3755
|
-
n.children && (d =
|
|
3778
|
+
n.children && (d = _t(n.children).reduce((g, p) => g + ((p == null ? void 0 : p.width) || 100), 0));
|
|
3756
3779
|
const f = new oe(this.ctx, this.columnIndex, s, c, d, h, n);
|
|
3757
3780
|
this.ctx.database.setHeader(n.key, f), this.allCellHeaders.push(f), n.children || (this.leafCellHeaders.push(f), f.column.widthFillDisable || this.resizeNum++), n.fixed === "left" ? this.fixedLeftCellHeaders.push(f) : n.fixed === "right" ? this.fixedRightCellHeaders.push(f) : this.centerCellHeaders.push(f), !n.children && this.columnIndex++, n.children && this.render(n.children, s), s += d;
|
|
3758
3781
|
}
|
|
@@ -3882,7 +3905,7 @@ class ne {
|
|
|
3882
3905
|
});
|
|
3883
3906
|
}
|
|
3884
3907
|
}
|
|
3885
|
-
class
|
|
3908
|
+
class mi {
|
|
3886
3909
|
constructor(t) {
|
|
3887
3910
|
l(this, "resizeTarget", null);
|
|
3888
3911
|
//调整行大小的目标
|
|
@@ -3923,18 +3946,18 @@ class pi {
|
|
|
3923
3946
|
MAX_HEIGHT: c = 0,
|
|
3924
3947
|
ENABLE_OFFSET_HEIGHT: d = 0,
|
|
3925
3948
|
OFFSET_HEIGHT: f = 0,
|
|
3926
|
-
FOOTER_POSITION:
|
|
3949
|
+
FOOTER_POSITION: u
|
|
3927
3950
|
}
|
|
3928
3951
|
} = this.ctx;
|
|
3929
3952
|
if (!e.width)
|
|
3930
3953
|
return;
|
|
3931
|
-
this.x = 0,
|
|
3954
|
+
this.x = 0, u === "top" && r ? this.y = e.height + i.height : this.y = e.height;
|
|
3932
3955
|
const { data: g, sumHeight: p } = s.getData();
|
|
3933
3956
|
this.height = p, this.data = g, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - o;
|
|
3934
|
-
const
|
|
3935
|
-
!this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height -
|
|
3957
|
+
const x = this.ctx.footer.height;
|
|
3958
|
+
!this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height - x - o);
|
|
3936
3959
|
let w = this.height + e.height + o;
|
|
3937
|
-
w +=
|
|
3960
|
+
w += x;
|
|
3938
3961
|
let m = w;
|
|
3939
3962
|
const C = window.innerHeight, { top: y } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
3940
3963
|
if (C > y && d && !n) {
|
|
@@ -3943,18 +3966,18 @@ class pi {
|
|
|
3943
3966
|
} else this.data.length && n ? m = n : this.data.length && c && w > c && (m = c);
|
|
3944
3967
|
m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
|
|
3945
3968
|
let b = this.ctx.stageHeight - e.height - o;
|
|
3946
|
-
r ? this.visibleHeight = b -
|
|
3947
|
-
const E = window.devicePixelRatio || 1, v = this.ctx.stageWidth * E,
|
|
3948
|
-
t.width = Math.floor(v), t.height = Math.floor(
|
|
3969
|
+
r ? this.visibleHeight = b - x : this.visibleHeight = b, this.data.length || (this.height = this.visibleHeight), this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = g;
|
|
3970
|
+
const E = window.devicePixelRatio || 1, v = this.ctx.stageWidth * E, I = this.ctx.stageHeight * E;
|
|
3971
|
+
t.width = Math.floor(v), t.height = Math.floor(I);
|
|
3949
3972
|
const L = this.data.length ? "not-empty" : "empty";
|
|
3950
3973
|
this.ctx.emit("emptyChange", {
|
|
3951
3974
|
isEmpty: L,
|
|
3952
3975
|
type: L,
|
|
3953
3976
|
headerHeight: e.height,
|
|
3954
3977
|
bodyHeight: this.height,
|
|
3955
|
-
footerHeight:
|
|
3978
|
+
footerHeight: x,
|
|
3956
3979
|
width: this.width,
|
|
3957
|
-
height: this.data.length ? 0 : h +
|
|
3980
|
+
height: this.data.length ? 0 : h + x
|
|
3958
3981
|
}), this.ctx.canvasElement.setAttribute(
|
|
3959
3982
|
"style",
|
|
3960
3983
|
` height:${this.ctx.stageHeight}px;width:${this.ctx.stageWidth}px;`
|
|
@@ -3984,8 +4007,8 @@ class pi {
|
|
|
3984
4007
|
} = this.ctx;
|
|
3985
4008
|
if (this.isResizing && this.resizeTarget) {
|
|
3986
4009
|
const f = this.resizeTarget.height;
|
|
3987
|
-
let
|
|
3988
|
-
|
|
4010
|
+
let u = n - this.clientY;
|
|
4011
|
+
u + f < d && (u = -(f - d)), this.resizeDiff = u, this.ctx.emit("draw");
|
|
3989
4012
|
} else {
|
|
3990
4013
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
3991
4014
|
return;
|
|
@@ -3997,11 +4020,11 @@ class pi {
|
|
|
3997
4020
|
return;
|
|
3998
4021
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3999
4022
|
for (let f = 0; f < this.renderRows.length; f++) {
|
|
4000
|
-
const
|
|
4001
|
-
if (r >
|
|
4002
|
-
for (let p = 0; p <
|
|
4003
|
-
const
|
|
4004
|
-
o >
|
|
4023
|
+
const u = this.renderRows[f];
|
|
4024
|
+
if (r > u.y - c + u.height - 1.5 && r < u.y - c + u.height + 1.5 && r < h - 4)
|
|
4025
|
+
for (let p = 0; p < u.cells.length; p++) {
|
|
4026
|
+
const x = u.cells[p];
|
|
4027
|
+
o > x.drawX + 10 && o < x.drawX + x.width - 10 && x.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = u);
|
|
4005
4028
|
}
|
|
4006
4029
|
}
|
|
4007
4030
|
}
|
|
@@ -4084,7 +4107,7 @@ class pi {
|
|
|
4084
4107
|
this.headIndex = Math.max(0, h), this.tailIndex = Math.min(this.ctx.maxRowIndex, c + 1), this.visibleRows = o.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
|
|
4085
4108
|
const d = [];
|
|
4086
4109
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
4087
|
-
const
|
|
4110
|
+
const u = this.headIndex + f, g = this.visibleRows[f], { height: p, top: x } = this.ctx.database.getPositionForRowIndex(u), w = new ne(this.ctx, u, 0, x + this.y, t.width, p, g);
|
|
4088
4111
|
d.push(w);
|
|
4089
4112
|
}
|
|
4090
4113
|
this.renderRows = d, this.ctx.body.renderRows = d;
|
|
@@ -4101,7 +4124,7 @@ class pi {
|
|
|
4101
4124
|
}), this.drawTipLine();
|
|
4102
4125
|
}
|
|
4103
4126
|
}
|
|
4104
|
-
class
|
|
4127
|
+
class yi {
|
|
4105
4128
|
constructor(t) {
|
|
4106
4129
|
l(this, "ctx");
|
|
4107
4130
|
l(this, "renderRows", []);
|
|
@@ -4182,7 +4205,7 @@ class mi {
|
|
|
4182
4205
|
}), this.drawTopLine();
|
|
4183
4206
|
}
|
|
4184
4207
|
}
|
|
4185
|
-
class
|
|
4208
|
+
class Ei {
|
|
4186
4209
|
// 垂直滚动定时器
|
|
4187
4210
|
constructor(t) {
|
|
4188
4211
|
l(this, "isCut", !1);
|
|
@@ -4301,26 +4324,26 @@ class yi {
|
|
|
4301
4324
|
SELECTOR_AREA_MIN_Y: c,
|
|
4302
4325
|
SELECTOR_AREA_MAX_Y: d,
|
|
4303
4326
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
4304
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4305
|
-
} = this.ctx.config, g = n, p = h || this.ctx.maxColIndex - f,
|
|
4327
|
+
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
4328
|
+
} = this.ctx.config, g = n, p = h || this.ctx.maxColIndex - f, x = c, w = d || this.ctx.maxRowIndex - u;
|
|
4306
4329
|
let [m, C] = r, [y, b] = o;
|
|
4307
|
-
if (m < g || C > p || y <
|
|
4330
|
+
if (m < g || C > p || y < x || b > w)
|
|
4308
4331
|
return;
|
|
4309
4332
|
if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
4310
4333
|
const v = this.adjustMergeCells(r, o);
|
|
4311
4334
|
y = v.yArr[0], b = v.yArr[1], m = v.xArr[0], C = v.xArr[1], this.ctx.onlyMergeCell = v.onlyMergeCell;
|
|
4312
4335
|
}
|
|
4313
|
-
m === C && y === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(g, m), Math.min(p, C)], o = [Math.max(
|
|
4336
|
+
m === C && y === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(g, m), Math.min(p, C)], o = [Math.max(x, y), Math.min(w, b)];
|
|
4314
4337
|
const { BEFORE_SET_SELECTOR_METHOD: E } = this.ctx.config;
|
|
4315
4338
|
if (typeof E == "function") {
|
|
4316
|
-
const
|
|
4339
|
+
const I = E({
|
|
4317
4340
|
focusCell: this.ctx.focusCell,
|
|
4318
4341
|
xArr: r,
|
|
4319
4342
|
yArr: o
|
|
4320
4343
|
});
|
|
4321
|
-
if (!
|
|
4344
|
+
if (!I)
|
|
4322
4345
|
return;
|
|
4323
|
-
r =
|
|
4346
|
+
r = I.xArr, o = I.yArr;
|
|
4324
4347
|
}
|
|
4325
4348
|
this.ctx.selector.xArr = r, this.ctx.selector.yArr = o, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
|
|
4326
4349
|
}
|
|
@@ -4329,38 +4352,38 @@ class yi {
|
|
|
4329
4352
|
var p;
|
|
4330
4353
|
const [i, s] = e, [r, o] = t;
|
|
4331
4354
|
let n = [], h = [];
|
|
4332
|
-
for (let
|
|
4355
|
+
for (let x = 0; x <= e[1] - e[0]; x++)
|
|
4333
4356
|
for (let w = 0; w <= t[1] - t[0]; w++) {
|
|
4334
|
-
const m =
|
|
4357
|
+
const m = x + e[0], C = w + t[0], y = this.ctx.database.getVirtualBodyCell(m, C);
|
|
4335
4358
|
y && ((m === i || m === s) && n.push(y), (C === r || C === o) && h.push(y));
|
|
4336
4359
|
}
|
|
4337
4360
|
const c = n.reduce(
|
|
4338
|
-
(
|
|
4361
|
+
(x, w) => {
|
|
4339
4362
|
const { yArr: m } = w.getSpanInfo(), [C, y] = m;
|
|
4340
|
-
return
|
|
4363
|
+
return x.minY = Math.min(x.minY, C), x.maxY = Math.max(x.maxY, y), x;
|
|
4341
4364
|
},
|
|
4342
4365
|
{
|
|
4343
4366
|
minY: i,
|
|
4344
4367
|
maxY: s
|
|
4345
4368
|
}
|
|
4346
4369
|
), d = h.reduce(
|
|
4347
|
-
(
|
|
4370
|
+
(x, w) => {
|
|
4348
4371
|
const { xArr: m } = w.getSpanInfo(), [C, y] = m;
|
|
4349
|
-
return
|
|
4372
|
+
return x.minX = Math.min(x.minX, C), x.maxX = Math.max(x.maxX, y), x;
|
|
4350
4373
|
},
|
|
4351
4374
|
{
|
|
4352
4375
|
minX: r,
|
|
4353
4376
|
maxX: o
|
|
4354
4377
|
}
|
|
4355
|
-
), f = [d.minX, d.maxX],
|
|
4378
|
+
), f = [d.minX, d.maxX], u = [c.minY, c.maxY];
|
|
4356
4379
|
let g = !1;
|
|
4357
4380
|
if (d.minX !== d.maxX || c.minY !== c.maxY) {
|
|
4358
|
-
const
|
|
4359
|
-
g = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) ===
|
|
4381
|
+
const x = JSON.stringify(f) + JSON.stringify(u), w = (p = this.ctx.focusCell) == null ? void 0 : p.getSpanInfo();
|
|
4382
|
+
g = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) === x;
|
|
4360
4383
|
}
|
|
4361
4384
|
return {
|
|
4362
4385
|
xArr: f,
|
|
4363
|
-
yArr:
|
|
4386
|
+
yArr: u,
|
|
4364
4387
|
onlyMergeCell: g
|
|
4365
4388
|
};
|
|
4366
4389
|
}
|
|
@@ -4398,7 +4421,7 @@ class yi {
|
|
|
4398
4421
|
SELECTOR_AREA_MAX_Y: o,
|
|
4399
4422
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
4400
4423
|
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4401
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r,
|
|
4424
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, u = o || this.ctx.maxRowIndex - h, g = [c, d], p = [f, u];
|
|
4402
4425
|
this.setSelector(g, p);
|
|
4403
4426
|
}
|
|
4404
4427
|
}
|
|
@@ -4437,8 +4460,8 @@ class yi {
|
|
|
4437
4460
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
4438
4461
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
|
|
4439
4462
|
return;
|
|
4440
|
-
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: n } = e, h = Math.min(o, s), c = Math.max(o, s), d = Math.min(n, r), f = Math.max(n, r),
|
|
4441
|
-
this.setSelector(
|
|
4463
|
+
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: n } = e, h = Math.min(o, s), c = Math.max(o, s), d = Math.min(n, r), f = Math.max(n, r), u = [h, c], g = [d, f];
|
|
4464
|
+
this.setSelector(u, g);
|
|
4442
4465
|
} else {
|
|
4443
4466
|
this.ctx.emit("cellSelectedClick", e);
|
|
4444
4467
|
const s = [e.colIndex, e.colIndex], r = [e.rowIndex, e.rowIndex];
|
|
@@ -4506,9 +4529,9 @@ class yi {
|
|
|
4506
4529
|
for (let h = 0; h <= t[1] - t[0]; h++) {
|
|
4507
4530
|
const c = n + e[0], d = h + t[0], f = this.ctx.database.getItemValueForRowIndexAndColIndex(c, d);
|
|
4508
4531
|
if (f) {
|
|
4509
|
-
const { rowKey:
|
|
4510
|
-
this.ctx.database.getReadonly(
|
|
4511
|
-
rowKey:
|
|
4532
|
+
const { rowKey: u, key: g } = f;
|
|
4533
|
+
this.ctx.database.getReadonly(u, g) || (r.add(u), s.push({
|
|
4534
|
+
rowKey: u,
|
|
4512
4535
|
key: g,
|
|
4513
4536
|
value: null,
|
|
4514
4537
|
row: {}
|
|
@@ -4536,18 +4559,18 @@ class yi {
|
|
|
4536
4559
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
4537
4560
|
navigator.clipboard.readText().then(async (r) => {
|
|
4538
4561
|
let o = si(r);
|
|
4539
|
-
const n = [i, i + o[0].length - 1], h = [e, e + o.length - 1], [c, d] = h, [f,
|
|
4562
|
+
const n = [i, i + o[0].length - 1], h = [e, e + o.length - 1], [c, d] = h, [f, u] = n, g = d - this.ctx.maxRowIndex, p = u - this.ctx.maxColIndex;
|
|
4540
4563
|
(g > 0 || p > 0) && this.ctx.emit("onPastedDataOverflow", {
|
|
4541
4564
|
maxY: d,
|
|
4542
|
-
maxX:
|
|
4565
|
+
maxX: u,
|
|
4543
4566
|
minY: c,
|
|
4544
4567
|
minX: f,
|
|
4545
4568
|
overflowRowCount: g,
|
|
4546
4569
|
overflowColCount: p,
|
|
4547
4570
|
textArr: o
|
|
4548
4571
|
});
|
|
4549
|
-
const
|
|
4550
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !
|
|
4572
|
+
const x = o.length === 1 && o[0].length === 1;
|
|
4573
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !x) {
|
|
4551
4574
|
const y = {
|
|
4552
4575
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
4553
4576
|
message: "Merged cells cannot span paste data"
|
|
@@ -4559,12 +4582,12 @@ class yi {
|
|
|
4559
4582
|
for (let y = 0; y <= o.length - 1; y++) {
|
|
4560
4583
|
const b = o[y].length;
|
|
4561
4584
|
for (let E = 0; E <= b - 1; E++) {
|
|
4562
|
-
const v = y + e,
|
|
4585
|
+
const v = y + e, I = E + i, L = o[y][E], _ = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
4563
4586
|
v,
|
|
4564
|
-
|
|
4587
|
+
I
|
|
4565
4588
|
);
|
|
4566
|
-
if (
|
|
4567
|
-
const { rowKey: R, key: A } =
|
|
4589
|
+
if (_) {
|
|
4590
|
+
const { rowKey: R, key: A } = _;
|
|
4568
4591
|
this.ctx.database.getReadonly(R, A) || (s.add(R), w.push({
|
|
4569
4592
|
rowKey: R,
|
|
4570
4593
|
key: A,
|
|
@@ -4650,8 +4673,8 @@ class yi {
|
|
|
4650
4673
|
SELECTOR_AREA_MAX_Y: o,
|
|
4651
4674
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
4652
4675
|
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4653
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r,
|
|
4654
|
-
return !(e < c || e > d || t < f || t >
|
|
4676
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, u = o || this.ctx.maxRowIndex - h;
|
|
4677
|
+
return !(e < c || e > d || t < f || t > u);
|
|
4655
4678
|
}
|
|
4656
4679
|
/**
|
|
4657
4680
|
* 调整滚动条位置,让到达边界时自动滚动
|
|
@@ -4693,25 +4716,25 @@ class yi {
|
|
|
4693
4716
|
body: h,
|
|
4694
4717
|
scrollX: c,
|
|
4695
4718
|
scrollY: d,
|
|
4696
|
-
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED:
|
|
4719
|
+
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: u, FOOTER_POSITION: g, ENABLE_MERGE_CELL_LINK: p }
|
|
4697
4720
|
} = this.ctx;
|
|
4698
4721
|
if (!i)
|
|
4699
4722
|
return;
|
|
4700
4723
|
p && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
4701
|
-
const { drawX:
|
|
4702
|
-
let v = o.height - w,
|
|
4703
|
-
|
|
4724
|
+
const { drawX: x, drawY: w, width: m, height: C, fixed: y } = i, b = r - x + 1, E = i.drawX + m - (e - s) + 1;
|
|
4725
|
+
let v = o.height - w, I = C;
|
|
4726
|
+
I > h.visibleHeight && (I = h.visibleHeight);
|
|
4704
4727
|
let L = 0;
|
|
4705
|
-
|
|
4706
|
-
const
|
|
4728
|
+
u && (g === "top" ? v = o.height + n.height - w : L = n.visibleHeight);
|
|
4729
|
+
const _ = w + I - (t - L - f);
|
|
4707
4730
|
let R = c, A = d;
|
|
4708
|
-
E > 0 && !y ? R = Math.floor(c + E) : b > 0 && !y && (R = Math.floor(c - b)), v > 0 ? A = Math.floor(d - v) :
|
|
4731
|
+
E > 0 && !y ? R = Math.floor(c + E) : b > 0 && !y && (R = Math.floor(c - b)), v > 0 ? A = Math.floor(d - v) : _ > 0 && (A = Math.floor(d + _)), (Math.abs(c - R) > 2 || Math.abs(d - A) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(R, A), this.ctx.emit("adjustBoundaryPosition", i));
|
|
4709
4732
|
}
|
|
4710
4733
|
destroy() {
|
|
4711
4734
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
4712
4735
|
}
|
|
4713
4736
|
}
|
|
4714
|
-
class
|
|
4737
|
+
class Ci {
|
|
4715
4738
|
constructor(t) {
|
|
4716
4739
|
l(this, "ctx");
|
|
4717
4740
|
l(this, "maxColRowCell");
|
|
@@ -4721,8 +4744,8 @@ class Ei {
|
|
|
4721
4744
|
this.ctx.on("mousemove", (t) => {
|
|
4722
4745
|
if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
|
|
4723
4746
|
return;
|
|
4724
|
-
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: r, drawX: o, drawY: n, width: h, height: c } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || r === this.ctx.maxRowIndex ? 0 : 2,
|
|
4725
|
-
e >
|
|
4747
|
+
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: r, drawX: o, drawY: n, width: h, height: c } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || r === this.ctx.maxRowIndex ? 0 : 2, u = o + h - d + f, g = n + c - d + f;
|
|
4748
|
+
e > u && i > g && e < u + d && i < g + d && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4726
4749
|
}), this.ctx.on("cellMouseenter", (t) => {
|
|
4727
4750
|
const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], r = i[1], { colIndex: o, rowIndex: n } = t;
|
|
4728
4751
|
this.ctx.config.ENABLE_AUTOFILL && o === s && n === r && (this.maxColRowCell = t), this.mouseenter(t);
|
|
@@ -4767,13 +4790,13 @@ class Ei {
|
|
|
4767
4790
|
SELECTOR_AREA_MAX_X: c,
|
|
4768
4791
|
SELECTOR_AREA_MIN_Y: d,
|
|
4769
4792
|
SELECTOR_AREA_MAX_Y: f,
|
|
4770
|
-
SELECTOR_AREA_MAX_X_OFFSET:
|
|
4793
|
+
SELECTOR_AREA_MAX_X_OFFSET: u,
|
|
4771
4794
|
SELECTOR_AREA_MAX_Y_OFFSET: g
|
|
4772
|
-
} = this.ctx.config, p = h,
|
|
4795
|
+
} = this.ctx.config, p = h, x = c || this.ctx.maxColIndex - u, w = d, m = f || this.ctx.maxRowIndex - g;
|
|
4773
4796
|
let [C, y] = o, [b, E] = n;
|
|
4774
4797
|
if (C < p || b < w)
|
|
4775
4798
|
return;
|
|
4776
|
-
o = [Math.max(p, C), Math.min(
|
|
4799
|
+
o = [Math.max(p, C), Math.min(x, y)], n = [Math.max(w, b), Math.min(m, E)];
|
|
4777
4800
|
const { BEFORE_SET_AUTOFILL_METHOD: v } = this.ctx.config;
|
|
4778
4801
|
if (typeof v == "function") {
|
|
4779
4802
|
const L = v({
|
|
@@ -4795,8 +4818,8 @@ class Ei {
|
|
|
4795
4818
|
const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
|
|
4796
4819
|
for (let g = 0; g <= e.yArr[1] - e.yArr[0]; g++)
|
|
4797
4820
|
for (let p = 0; p <= e.xArr[1] - e.xArr[0]; p++) {
|
|
4798
|
-
const
|
|
4799
|
-
i.set(`${
|
|
4821
|
+
const x = g + e.yArr[0], w = p + e.xArr[0];
|
|
4822
|
+
i.set(`${x}-${w}`, !0);
|
|
4800
4823
|
}
|
|
4801
4824
|
const { value: s } = e, r = s[0].length, o = s.length, n = this.ctx.autofill.xArr, h = this.ctx.autofill.yArr, c = r === 1 && o === 1;
|
|
4802
4825
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !c) {
|
|
@@ -4810,7 +4833,7 @@ class Ei {
|
|
|
4810
4833
|
let d = [];
|
|
4811
4834
|
for (let g = 0; g <= h[1] - h[0]; g++)
|
|
4812
4835
|
for (let p = 0; p <= n[1] - n[0]; p++) {
|
|
4813
|
-
const
|
|
4836
|
+
const x = p + n[0], w = g + h[0], m = s[g % o][p % r], C = this.ctx.database.getItemValueForRowIndexAndColIndex(w, x), y = `${w}-${x}`;
|
|
4814
4837
|
if (C && !i.has(y)) {
|
|
4815
4838
|
const { rowKey: b, key: E } = C;
|
|
4816
4839
|
this.ctx.database.getReadonly(b, E) || (t.add(b), d.push({
|
|
@@ -4826,21 +4849,21 @@ class Ei {
|
|
|
4826
4849
|
this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr;
|
|
4827
4850
|
const { BEFORE_AUTOFILL_DATA_METHOD: f } = this.ctx.config;
|
|
4828
4851
|
if (typeof f == "function") {
|
|
4829
|
-
const g = f, p = d.map((
|
|
4830
|
-
rowKey:
|
|
4831
|
-
key:
|
|
4832
|
-
value:
|
|
4833
|
-
oldValue: this.ctx.database.getItemValue(
|
|
4834
|
-
row: this.ctx.database.getRowDataItemForRowKey(
|
|
4852
|
+
const g = f, p = d.map((x) => ({
|
|
4853
|
+
rowKey: x.rowKey,
|
|
4854
|
+
key: x.key,
|
|
4855
|
+
value: x.value,
|
|
4856
|
+
oldValue: this.ctx.database.getItemValue(x.rowKey, x.key),
|
|
4857
|
+
row: this.ctx.database.getRowDataItemForRowKey(x.rowKey)
|
|
4835
4858
|
}));
|
|
4836
4859
|
if (d = await g(p, n, h), d && !d.length)
|
|
4837
4860
|
return;
|
|
4838
4861
|
}
|
|
4839
4862
|
this.ctx.batchSetItemValueByEditor(d, !0);
|
|
4840
|
-
let
|
|
4863
|
+
let u = [];
|
|
4841
4864
|
t.forEach((g) => {
|
|
4842
|
-
|
|
4843
|
-
}), this.ctx.emit("autofillChange", d,
|
|
4865
|
+
u.push(this.ctx.database.getRowDataItemForRowKey(g));
|
|
4866
|
+
}), this.ctx.emit("autofillChange", d, u);
|
|
4844
4867
|
}
|
|
4845
4868
|
mouseenter(t) {
|
|
4846
4869
|
if (["index", "selection", "index-selection"].includes(t.type))
|
|
@@ -4857,16 +4880,16 @@ class Ei {
|
|
|
4857
4880
|
const rt = Math.min, U = Math.max, ft = Math.round, z = (a) => ({
|
|
4858
4881
|
x: a,
|
|
4859
4882
|
y: a
|
|
4860
|
-
}),
|
|
4883
|
+
}), bi = {
|
|
4861
4884
|
left: "right",
|
|
4862
4885
|
right: "left",
|
|
4863
4886
|
bottom: "top",
|
|
4864
4887
|
top: "bottom"
|
|
4865
|
-
},
|
|
4888
|
+
}, vi = {
|
|
4866
4889
|
start: "end",
|
|
4867
4890
|
end: "start"
|
|
4868
4891
|
};
|
|
4869
|
-
function
|
|
4892
|
+
function It(a, t, e) {
|
|
4870
4893
|
return U(a, rt(t, e));
|
|
4871
4894
|
}
|
|
4872
4895
|
function at(a, t) {
|
|
@@ -4890,18 +4913,18 @@ function J(a) {
|
|
|
4890
4913
|
function Ht(a) {
|
|
4891
4914
|
return ae(J(a));
|
|
4892
4915
|
}
|
|
4893
|
-
function
|
|
4916
|
+
function Ri(a, t, e) {
|
|
4894
4917
|
e === void 0 && (e = !1);
|
|
4895
4918
|
const i = lt(a), s = Ht(a), r = Mt(s);
|
|
4896
4919
|
let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4897
|
-
return t.reference[r] > t.floating[r] && (o =
|
|
4920
|
+
return t.reference[r] > t.floating[r] && (o = ut(o)), [o, ut(o)];
|
|
4898
4921
|
}
|
|
4899
|
-
function
|
|
4900
|
-
const t =
|
|
4922
|
+
function _i(a) {
|
|
4923
|
+
const t = ut(a);
|
|
4901
4924
|
return [Ot(a), t, Ot(t)];
|
|
4902
4925
|
}
|
|
4903
4926
|
function Ot(a) {
|
|
4904
|
-
return a.replace(/start|end/g, (t) =>
|
|
4927
|
+
return a.replace(/start|end/g, (t) => vi[t]);
|
|
4905
4928
|
}
|
|
4906
4929
|
function Ii(a, t, e) {
|
|
4907
4930
|
const i = ["left", "right"], s = ["right", "left"], r = ["top", "bottom"], o = ["bottom", "top"];
|
|
@@ -4916,15 +4939,15 @@ function Ii(a, t, e) {
|
|
|
4916
4939
|
return [];
|
|
4917
4940
|
}
|
|
4918
4941
|
}
|
|
4919
|
-
function
|
|
4942
|
+
function Oi(a, t, e, i) {
|
|
4920
4943
|
const s = lt(a);
|
|
4921
4944
|
let r = Ii(G(a), e === "start", i);
|
|
4922
4945
|
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
|
|
4923
4946
|
}
|
|
4924
|
-
function
|
|
4925
|
-
return a.replace(/left|right|bottom|top/g, (t) =>
|
|
4947
|
+
function ut(a) {
|
|
4948
|
+
return a.replace(/left|right|bottom|top/g, (t) => bi[t]);
|
|
4926
4949
|
}
|
|
4927
|
-
function
|
|
4950
|
+
function Li(a) {
|
|
4928
4951
|
return {
|
|
4929
4952
|
top: 0,
|
|
4930
4953
|
right: 0,
|
|
@@ -4934,14 +4957,14 @@ function Oi(a) {
|
|
|
4934
4957
|
};
|
|
4935
4958
|
}
|
|
4936
4959
|
function le(a) {
|
|
4937
|
-
return typeof a != "number" ?
|
|
4960
|
+
return typeof a != "number" ? Li(a) : {
|
|
4938
4961
|
top: a,
|
|
4939
4962
|
right: a,
|
|
4940
4963
|
bottom: a,
|
|
4941
4964
|
left: a
|
|
4942
4965
|
};
|
|
4943
4966
|
}
|
|
4944
|
-
function
|
|
4967
|
+
function xt(a) {
|
|
4945
4968
|
const {
|
|
4946
4969
|
x: t,
|
|
4947
4970
|
y: e,
|
|
@@ -4964,7 +4987,7 @@ function $t(a, t, e) {
|
|
|
4964
4987
|
reference: i,
|
|
4965
4988
|
floating: s
|
|
4966
4989
|
} = a;
|
|
4967
|
-
const r = J(t), o = Ht(t), n = Mt(o), h = G(t), c = r === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2,
|
|
4990
|
+
const r = J(t), o = Ht(t), n = Mt(o), h = G(t), c = r === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, u = i[n] / 2 - s[n] / 2;
|
|
4968
4991
|
let g;
|
|
4969
4992
|
switch (h) {
|
|
4970
4993
|
case "top":
|
|
@@ -4999,15 +5022,15 @@ function $t(a, t, e) {
|
|
|
4999
5022
|
}
|
|
5000
5023
|
switch (lt(t)) {
|
|
5001
5024
|
case "start":
|
|
5002
|
-
g[o] -=
|
|
5025
|
+
g[o] -= u * (e && c ? -1 : 1);
|
|
5003
5026
|
break;
|
|
5004
5027
|
case "end":
|
|
5005
|
-
g[o] +=
|
|
5028
|
+
g[o] += u * (e && c ? -1 : 1);
|
|
5006
5029
|
break;
|
|
5007
5030
|
}
|
|
5008
5031
|
return g;
|
|
5009
5032
|
}
|
|
5010
|
-
const
|
|
5033
|
+
const Si = async (a, t, e) => {
|
|
5011
5034
|
const {
|
|
5012
5035
|
placement: i = "bottom",
|
|
5013
5036
|
strategy: s = "absolute",
|
|
@@ -5021,12 +5044,12 @@ const Li = async (a, t, e) => {
|
|
|
5021
5044
|
}), {
|
|
5022
5045
|
x: d,
|
|
5023
5046
|
y: f
|
|
5024
|
-
} = $t(c, i, h),
|
|
5025
|
-
for (let
|
|
5047
|
+
} = $t(c, i, h), u = i, g = {}, p = 0;
|
|
5048
|
+
for (let x = 0; x < n.length; x++) {
|
|
5026
5049
|
const {
|
|
5027
5050
|
name: w,
|
|
5028
5051
|
fn: m
|
|
5029
|
-
} = n[
|
|
5052
|
+
} = n[x], {
|
|
5030
5053
|
x: C,
|
|
5031
5054
|
y,
|
|
5032
5055
|
data: b,
|
|
@@ -5035,7 +5058,7 @@ const Li = async (a, t, e) => {
|
|
|
5035
5058
|
x: d,
|
|
5036
5059
|
y: f,
|
|
5037
5060
|
initialPlacement: i,
|
|
5038
|
-
placement:
|
|
5061
|
+
placement: u,
|
|
5039
5062
|
strategy: s,
|
|
5040
5063
|
middlewareData: g,
|
|
5041
5064
|
rects: c,
|
|
@@ -5051,19 +5074,19 @@ const Li = async (a, t, e) => {
|
|
|
5051
5074
|
...g[w],
|
|
5052
5075
|
...b
|
|
5053
5076
|
}
|
|
5054
|
-
}, E && p <= 50 && (p++, typeof E == "object" && (E.placement && (
|
|
5077
|
+
}, E && p <= 50 && (p++, typeof E == "object" && (E.placement && (u = E.placement), E.rects && (c = E.rects === !0 ? await o.getElementRects({
|
|
5055
5078
|
reference: a,
|
|
5056
5079
|
floating: t,
|
|
5057
5080
|
strategy: s
|
|
5058
5081
|
}) : E.rects), {
|
|
5059
5082
|
x: d,
|
|
5060
5083
|
y: f
|
|
5061
|
-
} = $t(c,
|
|
5084
|
+
} = $t(c, u, h)), x = -1);
|
|
5062
5085
|
}
|
|
5063
5086
|
return {
|
|
5064
5087
|
x: d,
|
|
5065
5088
|
y: f,
|
|
5066
|
-
placement:
|
|
5089
|
+
placement: u,
|
|
5067
5090
|
strategy: s,
|
|
5068
5091
|
middlewareData: g
|
|
5069
5092
|
};
|
|
@@ -5082,9 +5105,9 @@ async function he(a, t) {
|
|
|
5082
5105
|
boundary: c = "clippingAncestors",
|
|
5083
5106
|
rootBoundary: d = "viewport",
|
|
5084
5107
|
elementContext: f = "floating",
|
|
5085
|
-
altBoundary:
|
|
5108
|
+
altBoundary: u = !1,
|
|
5086
5109
|
padding: g = 0
|
|
5087
|
-
} = at(t, a), p = le(g), w = n[
|
|
5110
|
+
} = at(t, a), p = le(g), w = n[u ? f === "floating" ? "reference" : "floating" : f], m = xt(await r.getClippingRect({
|
|
5088
5111
|
element: (e = await (r.isElement == null ? void 0 : r.isElement(w))) == null || e ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(n.floating)),
|
|
5089
5112
|
boundary: c,
|
|
5090
5113
|
rootBoundary: d,
|
|
@@ -5100,7 +5123,7 @@ async function he(a, t) {
|
|
|
5100
5123
|
} : {
|
|
5101
5124
|
x: 1,
|
|
5102
5125
|
y: 1
|
|
5103
|
-
}, E =
|
|
5126
|
+
}, E = xt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
5104
5127
|
elements: n,
|
|
5105
5128
|
rect: C,
|
|
5106
5129
|
offsetParent: y,
|
|
@@ -5113,7 +5136,7 @@ async function he(a, t) {
|
|
|
5113
5136
|
right: (E.right - m.right + p.right) / b.x
|
|
5114
5137
|
};
|
|
5115
5138
|
}
|
|
5116
|
-
const
|
|
5139
|
+
const Ai = (a) => ({
|
|
5117
5140
|
name: "arrow",
|
|
5118
5141
|
options: a,
|
|
5119
5142
|
async fn(t) {
|
|
@@ -5131,15 +5154,15 @@ const Si = (a) => ({
|
|
|
5131
5154
|
} = at(a, t) || {};
|
|
5132
5155
|
if (c == null)
|
|
5133
5156
|
return {};
|
|
5134
|
-
const f = le(d),
|
|
5157
|
+
const f = le(d), u = {
|
|
5135
5158
|
x: e,
|
|
5136
5159
|
y: i
|
|
5137
|
-
}, g = Ht(s), p = Mt(g),
|
|
5138
|
-
let
|
|
5139
|
-
(!
|
|
5140
|
-
const L = b / 2 - E / 2,
|
|
5160
|
+
}, g = Ht(s), p = Mt(g), x = await o.getDimensions(c), w = g === "y", m = w ? "top" : "left", C = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = r.reference[p] + r.reference[g] - u[g] - r.floating[p], E = u[g] - r.reference[g], v = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
|
|
5161
|
+
let I = v ? v[y] : 0;
|
|
5162
|
+
(!I || !await (o.isElement == null ? void 0 : o.isElement(v))) && (I = n.floating[y] || r.floating[p]);
|
|
5163
|
+
const L = b / 2 - E / 2, _ = I / 2 - x[p] / 2 - 1, R = rt(f[m], _), A = rt(f[C], _), S = R, M = I - x[p] - A, T = I / 2 - x[p] / 2 + L, B = It(S, T, M), Y = !h.arrow && lt(s) != null && T !== B && r.reference[p] / 2 - (T < S ? R : A) - x[p] / 2 < 0, k = Y ? T < S ? T - S : T - M : 0;
|
|
5141
5164
|
return {
|
|
5142
|
-
[g]:
|
|
5165
|
+
[g]: u[g] + k,
|
|
5143
5166
|
data: {
|
|
5144
5167
|
[g]: B,
|
|
5145
5168
|
centerOffset: T - B - k,
|
|
@@ -5150,7 +5173,7 @@ const Si = (a) => ({
|
|
|
5150
5173
|
reset: Y
|
|
5151
5174
|
};
|
|
5152
5175
|
}
|
|
5153
|
-
}),
|
|
5176
|
+
}), Ti = function(a) {
|
|
5154
5177
|
return a === void 0 && (a = {}), {
|
|
5155
5178
|
name: "flip",
|
|
5156
5179
|
options: a,
|
|
@@ -5166,28 +5189,28 @@ const Si = (a) => ({
|
|
|
5166
5189
|
} = t, {
|
|
5167
5190
|
mainAxis: d = !0,
|
|
5168
5191
|
crossAxis: f = !0,
|
|
5169
|
-
fallbackPlacements:
|
|
5192
|
+
fallbackPlacements: u,
|
|
5170
5193
|
fallbackStrategy: g = "bestFit",
|
|
5171
5194
|
fallbackAxisSideDirection: p = "none",
|
|
5172
|
-
flipAlignment:
|
|
5195
|
+
flipAlignment: x = !0,
|
|
5173
5196
|
...w
|
|
5174
5197
|
} = at(a, t);
|
|
5175
5198
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
5176
5199
|
return {};
|
|
5177
|
-
const m = G(s), C = J(n), y = G(n) === n, b = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), E =
|
|
5178
|
-
!
|
|
5179
|
-
const
|
|
5200
|
+
const m = G(s), C = J(n), y = G(n) === n, b = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), E = u || (y || !x ? [ut(n)] : _i(n)), v = p !== "none";
|
|
5201
|
+
!u && v && E.push(...Oi(n, x, p, b));
|
|
5202
|
+
const I = [n, ...E], L = await he(t, w), _ = [];
|
|
5180
5203
|
let R = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
5181
|
-
if (d &&
|
|
5182
|
-
const T =
|
|
5183
|
-
|
|
5204
|
+
if (d && _.push(L[m]), f) {
|
|
5205
|
+
const T = Ri(s, o, b);
|
|
5206
|
+
_.push(L[T[0]], L[T[1]]);
|
|
5184
5207
|
}
|
|
5185
5208
|
if (R = [...R, {
|
|
5186
5209
|
placement: s,
|
|
5187
|
-
overflows:
|
|
5188
|
-
}], !
|
|
5210
|
+
overflows: _
|
|
5211
|
+
}], !_.every((T) => T <= 0)) {
|
|
5189
5212
|
var A, S;
|
|
5190
|
-
const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, B =
|
|
5213
|
+
const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, B = I[T];
|
|
5191
5214
|
if (B)
|
|
5192
5215
|
return {
|
|
5193
5216
|
data: {
|
|
@@ -5230,14 +5253,14 @@ const Si = (a) => ({
|
|
|
5230
5253
|
}
|
|
5231
5254
|
};
|
|
5232
5255
|
};
|
|
5233
|
-
async function
|
|
5256
|
+
async function Mi(a, t) {
|
|
5234
5257
|
const {
|
|
5235
5258
|
placement: e,
|
|
5236
5259
|
platform: i,
|
|
5237
5260
|
elements: s
|
|
5238
5261
|
} = a, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = G(e), n = lt(e), h = J(e) === "y", c = ["left", "top"].includes(o) ? -1 : 1, d = r && h ? -1 : 1, f = at(t, a);
|
|
5239
5262
|
let {
|
|
5240
|
-
mainAxis:
|
|
5263
|
+
mainAxis: u,
|
|
5241
5264
|
crossAxis: g,
|
|
5242
5265
|
alignmentAxis: p
|
|
5243
5266
|
} = typeof f == "number" ? {
|
|
@@ -5251,13 +5274,13 @@ async function Ti(a, t) {
|
|
|
5251
5274
|
};
|
|
5252
5275
|
return n && typeof p == "number" && (g = n === "end" ? p * -1 : p), h ? {
|
|
5253
5276
|
x: g * d,
|
|
5254
|
-
y:
|
|
5277
|
+
y: u * c
|
|
5255
5278
|
} : {
|
|
5256
|
-
x:
|
|
5279
|
+
x: u * c,
|
|
5257
5280
|
y: g * d
|
|
5258
5281
|
};
|
|
5259
5282
|
}
|
|
5260
|
-
const
|
|
5283
|
+
const Hi = function(a) {
|
|
5261
5284
|
return a === void 0 && (a = 0), {
|
|
5262
5285
|
name: "offset",
|
|
5263
5286
|
options: a,
|
|
@@ -5268,7 +5291,7 @@ const Mi = function(a) {
|
|
|
5268
5291
|
y: r,
|
|
5269
5292
|
placement: o,
|
|
5270
5293
|
middlewareData: n
|
|
5271
|
-
} = t, h = await
|
|
5294
|
+
} = t, h = await Mi(t, a);
|
|
5272
5295
|
return o === ((e = n.offset) == null ? void 0 : e.placement) && (i = n.arrow) != null && i.alignmentOffset ? {} : {
|
|
5273
5296
|
x: s + h.x,
|
|
5274
5297
|
y: r + h.y,
|
|
@@ -5279,7 +5302,7 @@ const Mi = function(a) {
|
|
|
5279
5302
|
};
|
|
5280
5303
|
}
|
|
5281
5304
|
};
|
|
5282
|
-
},
|
|
5305
|
+
}, Di = function(a) {
|
|
5283
5306
|
return a === void 0 && (a = {}), {
|
|
5284
5307
|
name: "shift",
|
|
5285
5308
|
options: a,
|
|
@@ -5307,28 +5330,28 @@ const Mi = function(a) {
|
|
|
5307
5330
|
} = at(a, t), c = {
|
|
5308
5331
|
x: e,
|
|
5309
5332
|
y: i
|
|
5310
|
-
}, d = await he(t, h), f = J(G(s)),
|
|
5311
|
-
let g = c[
|
|
5333
|
+
}, d = await he(t, h), f = J(G(s)), u = ae(f);
|
|
5334
|
+
let g = c[u], p = c[f];
|
|
5312
5335
|
if (r) {
|
|
5313
|
-
const w =
|
|
5314
|
-
g =
|
|
5336
|
+
const w = u === "y" ? "top" : "left", m = u === "y" ? "bottom" : "right", C = g + d[w], y = g - d[m];
|
|
5337
|
+
g = It(C, g, y);
|
|
5315
5338
|
}
|
|
5316
5339
|
if (o) {
|
|
5317
5340
|
const w = f === "y" ? "top" : "left", m = f === "y" ? "bottom" : "right", C = p + d[w], y = p - d[m];
|
|
5318
|
-
p =
|
|
5341
|
+
p = It(C, p, y);
|
|
5319
5342
|
}
|
|
5320
|
-
const
|
|
5343
|
+
const x = n.fn({
|
|
5321
5344
|
...t,
|
|
5322
|
-
[
|
|
5345
|
+
[u]: g,
|
|
5323
5346
|
[f]: p
|
|
5324
5347
|
});
|
|
5325
5348
|
return {
|
|
5326
|
-
...
|
|
5349
|
+
...x,
|
|
5327
5350
|
data: {
|
|
5328
|
-
x:
|
|
5329
|
-
y:
|
|
5351
|
+
x: x.x - e,
|
|
5352
|
+
y: x.y - i,
|
|
5330
5353
|
enabled: {
|
|
5331
|
-
[
|
|
5354
|
+
[u]: r,
|
|
5332
5355
|
[f]: o
|
|
5333
5356
|
}
|
|
5334
5357
|
}
|
|
@@ -5353,7 +5376,7 @@ function V(a) {
|
|
|
5353
5376
|
function ce(a) {
|
|
5354
5377
|
return gt() ? a instanceof Node || a instanceof N(a).Node : !1;
|
|
5355
5378
|
}
|
|
5356
|
-
function
|
|
5379
|
+
function F(a) {
|
|
5357
5380
|
return gt() ? a instanceof Element || a instanceof N(a).Element : !1;
|
|
5358
5381
|
}
|
|
5359
5382
|
function K(a) {
|
|
@@ -5368,10 +5391,10 @@ function ht(a) {
|
|
|
5368
5391
|
overflowX: e,
|
|
5369
5392
|
overflowY: i,
|
|
5370
5393
|
display: s
|
|
5371
|
-
} =
|
|
5394
|
+
} = X(a);
|
|
5372
5395
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
|
|
5373
5396
|
}
|
|
5374
|
-
function
|
|
5397
|
+
function Ni(a) {
|
|
5375
5398
|
return ["table", "td", "th"].includes(tt(a));
|
|
5376
5399
|
}
|
|
5377
5400
|
function wt(a) {
|
|
@@ -5384,10 +5407,10 @@ function wt(a) {
|
|
|
5384
5407
|
});
|
|
5385
5408
|
}
|
|
5386
5409
|
function Dt(a) {
|
|
5387
|
-
const t = Nt(), e =
|
|
5410
|
+
const t = Nt(), e = F(a) ? X(a) : a;
|
|
5388
5411
|
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));
|
|
5389
5412
|
}
|
|
5390
|
-
function
|
|
5413
|
+
function Fi(a) {
|
|
5391
5414
|
let t = $(a);
|
|
5392
5415
|
for (; K(t) && !Q(t); ) {
|
|
5393
5416
|
if (Dt(t))
|
|
@@ -5404,11 +5427,11 @@ function Nt() {
|
|
|
5404
5427
|
function Q(a) {
|
|
5405
5428
|
return ["html", "body", "#document"].includes(tt(a));
|
|
5406
5429
|
}
|
|
5407
|
-
function
|
|
5430
|
+
function X(a) {
|
|
5408
5431
|
return N(a).getComputedStyle(a);
|
|
5409
5432
|
}
|
|
5410
5433
|
function pt(a) {
|
|
5411
|
-
return
|
|
5434
|
+
return F(a) ? {
|
|
5412
5435
|
scrollLeft: a.scrollLeft,
|
|
5413
5436
|
scrollTop: a.scrollTop
|
|
5414
5437
|
} : {
|
|
@@ -5446,7 +5469,7 @@ function St(a) {
|
|
|
5446
5469
|
return a.parent && Object.getPrototypeOf(a.parent) ? a.frameElement : null;
|
|
5447
5470
|
}
|
|
5448
5471
|
function fe(a) {
|
|
5449
|
-
const t =
|
|
5472
|
+
const t = X(a);
|
|
5450
5473
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
5451
5474
|
const s = K(a), r = s ? a.offsetWidth : e, o = s ? a.offsetHeight : i, n = ft(e) !== r || ft(i) !== o;
|
|
5452
5475
|
return n && (e = r, i = o), {
|
|
@@ -5455,11 +5478,11 @@ function fe(a) {
|
|
|
5455
5478
|
$: n
|
|
5456
5479
|
};
|
|
5457
5480
|
}
|
|
5458
|
-
function
|
|
5459
|
-
return
|
|
5481
|
+
function ue(a) {
|
|
5482
|
+
return F(a) ? a : a.contextElement;
|
|
5460
5483
|
}
|
|
5461
5484
|
function Z(a) {
|
|
5462
|
-
const t =
|
|
5485
|
+
const t = ue(a);
|
|
5463
5486
|
if (!K(t))
|
|
5464
5487
|
return z(1);
|
|
5465
5488
|
const e = t.getBoundingClientRect(), {
|
|
@@ -5474,39 +5497,39 @@ function Z(a) {
|
|
|
5474
5497
|
};
|
|
5475
5498
|
}
|
|
5476
5499
|
const Xi = /* @__PURE__ */ z(0);
|
|
5477
|
-
function
|
|
5500
|
+
function xe(a) {
|
|
5478
5501
|
const t = N(a);
|
|
5479
5502
|
return !Nt() || !t.visualViewport ? Xi : {
|
|
5480
5503
|
x: t.visualViewport.offsetLeft,
|
|
5481
5504
|
y: t.visualViewport.offsetTop
|
|
5482
5505
|
};
|
|
5483
5506
|
}
|
|
5484
|
-
function
|
|
5507
|
+
function Bi(a, t, e) {
|
|
5485
5508
|
return t === void 0 && (t = !1), !e || t && e !== N(a) ? !1 : t;
|
|
5486
5509
|
}
|
|
5487
5510
|
function ot(a, t, e, i) {
|
|
5488
5511
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
5489
|
-
const s = a.getBoundingClientRect(), r =
|
|
5512
|
+
const s = a.getBoundingClientRect(), r = ue(a);
|
|
5490
5513
|
let o = z(1);
|
|
5491
|
-
t && (i ?
|
|
5492
|
-
const n =
|
|
5514
|
+
t && (i ? F(i) && (o = Z(i)) : o = Z(a));
|
|
5515
|
+
const n = Bi(r, e, i) ? xe(r) : z(0);
|
|
5493
5516
|
let h = (s.left + n.x) / o.x, c = (s.top + n.y) / o.y, d = s.width / o.x, f = s.height / o.y;
|
|
5494
5517
|
if (r) {
|
|
5495
|
-
const
|
|
5496
|
-
let p =
|
|
5497
|
-
for (;
|
|
5498
|
-
const w = Z(
|
|
5499
|
-
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b, p = N(
|
|
5518
|
+
const u = N(r), g = i && F(i) ? N(i) : i;
|
|
5519
|
+
let p = u, x = St(p);
|
|
5520
|
+
for (; x && i && g !== p; ) {
|
|
5521
|
+
const w = Z(x), m = x.getBoundingClientRect(), C = X(x), y = m.left + (x.clientLeft + parseFloat(C.paddingLeft)) * w.x, b = m.top + (x.clientTop + parseFloat(C.paddingTop)) * w.y;
|
|
5522
|
+
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b, p = N(x), x = St(p);
|
|
5500
5523
|
}
|
|
5501
5524
|
}
|
|
5502
|
-
return
|
|
5525
|
+
return xt({
|
|
5503
5526
|
width: d,
|
|
5504
5527
|
height: f,
|
|
5505
5528
|
x: h,
|
|
5506
5529
|
y: c
|
|
5507
5530
|
});
|
|
5508
5531
|
}
|
|
5509
|
-
function
|
|
5532
|
+
function ki(a) {
|
|
5510
5533
|
let {
|
|
5511
5534
|
elements: t,
|
|
5512
5535
|
rect: e,
|
|
@@ -5522,8 +5545,8 @@ function Bi(a) {
|
|
|
5522
5545
|
}, c = z(1);
|
|
5523
5546
|
const d = z(0), f = K(i);
|
|
5524
5547
|
if ((f || !f && !r) && ((tt(i) !== "body" || ht(o)) && (h = pt(i)), K(i))) {
|
|
5525
|
-
const
|
|
5526
|
-
c = Z(i), d.x =
|
|
5548
|
+
const u = ot(i);
|
|
5549
|
+
c = Z(i), d.x = u.x + i.clientLeft, d.y = u.y + i.clientTop;
|
|
5527
5550
|
}
|
|
5528
5551
|
return {
|
|
5529
5552
|
width: e.width * c.x,
|
|
@@ -5532,25 +5555,25 @@ function Bi(a) {
|
|
|
5532
5555
|
y: e.y * c.y - h.scrollTop * c.y + d.y
|
|
5533
5556
|
};
|
|
5534
5557
|
}
|
|
5535
|
-
function
|
|
5558
|
+
function Ki(a) {
|
|
5536
5559
|
return Array.from(a.getClientRects());
|
|
5537
5560
|
}
|
|
5538
5561
|
function At(a, t) {
|
|
5539
5562
|
const e = pt(a).scrollLeft;
|
|
5540
5563
|
return t ? t.left + e : ot(V(a)).left + e;
|
|
5541
5564
|
}
|
|
5542
|
-
function
|
|
5565
|
+
function Yi(a) {
|
|
5543
5566
|
const t = V(a), e = pt(a), i = a.ownerDocument.body, s = U(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), r = U(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
|
|
5544
5567
|
let o = -e.scrollLeft + At(a);
|
|
5545
5568
|
const n = -e.scrollTop;
|
|
5546
|
-
return
|
|
5569
|
+
return X(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
|
|
5547
5570
|
width: s,
|
|
5548
5571
|
height: r,
|
|
5549
5572
|
x: o,
|
|
5550
5573
|
y: n
|
|
5551
5574
|
};
|
|
5552
5575
|
}
|
|
5553
|
-
function
|
|
5576
|
+
function Vi(a, t) {
|
|
5554
5577
|
const e = N(a), i = V(a), s = e.visualViewport;
|
|
5555
5578
|
let r = i.clientWidth, o = i.clientHeight, n = 0, h = 0;
|
|
5556
5579
|
if (s) {
|
|
@@ -5565,7 +5588,7 @@ function Yi(a, t) {
|
|
|
5565
5588
|
y: h
|
|
5566
5589
|
};
|
|
5567
5590
|
}
|
|
5568
|
-
function
|
|
5591
|
+
function Wi(a, t) {
|
|
5569
5592
|
const e = ot(a, !0, t === "fixed"), i = e.top + a.clientTop, s = e.left + a.clientLeft, r = K(a) ? Z(a) : z(1), o = a.clientWidth * r.x, n = a.clientHeight * r.y, h = s * r.x, c = i * r.y;
|
|
5570
5593
|
return {
|
|
5571
5594
|
width: o,
|
|
@@ -5577,46 +5600,46 @@ function Vi(a, t) {
|
|
|
5577
5600
|
function Gt(a, t, e) {
|
|
5578
5601
|
let i;
|
|
5579
5602
|
if (t === "viewport")
|
|
5580
|
-
i =
|
|
5603
|
+
i = Vi(a, e);
|
|
5581
5604
|
else if (t === "document")
|
|
5582
|
-
i =
|
|
5583
|
-
else if (
|
|
5584
|
-
i =
|
|
5605
|
+
i = Yi(V(a));
|
|
5606
|
+
else if (F(t))
|
|
5607
|
+
i = Wi(t, e);
|
|
5585
5608
|
else {
|
|
5586
|
-
const s =
|
|
5609
|
+
const s = xe(a);
|
|
5587
5610
|
i = {
|
|
5588
5611
|
...t,
|
|
5589
5612
|
x: t.x - s.x,
|
|
5590
5613
|
y: t.y - s.y
|
|
5591
5614
|
};
|
|
5592
5615
|
}
|
|
5593
|
-
return
|
|
5616
|
+
return xt(i);
|
|
5594
5617
|
}
|
|
5595
5618
|
function ge(a, t) {
|
|
5596
5619
|
const e = $(a);
|
|
5597
|
-
return e === t || !
|
|
5620
|
+
return e === t || !F(e) || Q(e) ? !1 : X(e).position === "fixed" || ge(e, t);
|
|
5598
5621
|
}
|
|
5599
|
-
function
|
|
5622
|
+
function Pi(a, t) {
|
|
5600
5623
|
const e = t.get(a);
|
|
5601
5624
|
if (e)
|
|
5602
5625
|
return e;
|
|
5603
|
-
let i = Lt(a, [], !1).filter((n) =>
|
|
5604
|
-
const r =
|
|
5626
|
+
let i = Lt(a, [], !1).filter((n) => F(n) && tt(n) !== "body"), s = null;
|
|
5627
|
+
const r = X(a).position === "fixed";
|
|
5605
5628
|
let o = r ? $(a) : a;
|
|
5606
|
-
for (;
|
|
5607
|
-
const n =
|
|
5629
|
+
for (; F(o) && !Q(o); ) {
|
|
5630
|
+
const n = X(o), h = Dt(o);
|
|
5608
5631
|
!h && n.position === "fixed" && (s = null), (r ? !h && !s : !h && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && ge(a, o)) ? i = i.filter((d) => d !== o) : s = n, o = $(o);
|
|
5609
5632
|
}
|
|
5610
5633
|
return t.set(a, i), i;
|
|
5611
5634
|
}
|
|
5612
|
-
function
|
|
5635
|
+
function zi(a) {
|
|
5613
5636
|
let {
|
|
5614
5637
|
element: t,
|
|
5615
5638
|
boundary: e,
|
|
5616
5639
|
rootBoundary: i,
|
|
5617
5640
|
strategy: s
|
|
5618
5641
|
} = a;
|
|
5619
|
-
const o = [...e === "clippingAncestors" ? wt(t) ? [] :
|
|
5642
|
+
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Pi(t, this._c) : [].concat(e), i], n = o[0], h = o.reduce((c, d) => {
|
|
5620
5643
|
const f = Gt(t, d, s);
|
|
5621
5644
|
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;
|
|
5622
5645
|
}, Gt(t, n, s));
|
|
@@ -5627,7 +5650,7 @@ function Pi(a) {
|
|
|
5627
5650
|
y: h.top
|
|
5628
5651
|
};
|
|
5629
5652
|
}
|
|
5630
|
-
function
|
|
5653
|
+
function $i(a) {
|
|
5631
5654
|
const {
|
|
5632
5655
|
width: t,
|
|
5633
5656
|
height: e
|
|
@@ -5637,7 +5660,7 @@ function zi(a) {
|
|
|
5637
5660
|
height: e
|
|
5638
5661
|
};
|
|
5639
5662
|
}
|
|
5640
|
-
function
|
|
5663
|
+
function qi(a, t, e) {
|
|
5641
5664
|
const i = K(t), s = V(t), r = e === "fixed", o = ot(a, !0, r, t);
|
|
5642
5665
|
let n = {
|
|
5643
5666
|
scrollLeft: 0,
|
|
@@ -5655,19 +5678,19 @@ function $i(a, t, e) {
|
|
|
5655
5678
|
d = g.top + n.scrollTop, c = g.left + n.scrollLeft - // RTL <body> scrollbar.
|
|
5656
5679
|
At(s, g);
|
|
5657
5680
|
}
|
|
5658
|
-
const f = o.left + n.scrollLeft - h.x - c,
|
|
5681
|
+
const f = o.left + n.scrollLeft - h.x - c, u = o.top + n.scrollTop - h.y - d;
|
|
5659
5682
|
return {
|
|
5660
5683
|
x: f,
|
|
5661
|
-
y:
|
|
5684
|
+
y: u,
|
|
5662
5685
|
width: o.width,
|
|
5663
5686
|
height: o.height
|
|
5664
5687
|
};
|
|
5665
5688
|
}
|
|
5666
5689
|
function yt(a) {
|
|
5667
|
-
return
|
|
5690
|
+
return X(a).position === "static";
|
|
5668
5691
|
}
|
|
5669
5692
|
function jt(a, t) {
|
|
5670
|
-
if (!K(a) ||
|
|
5693
|
+
if (!K(a) || X(a).position === "fixed")
|
|
5671
5694
|
return null;
|
|
5672
5695
|
if (t)
|
|
5673
5696
|
return t(a);
|
|
@@ -5681,21 +5704,21 @@ function we(a, t) {
|
|
|
5681
5704
|
if (!K(a)) {
|
|
5682
5705
|
let s = $(a);
|
|
5683
5706
|
for (; s && !Q(s); ) {
|
|
5684
|
-
if (
|
|
5707
|
+
if (F(s) && !yt(s))
|
|
5685
5708
|
return s;
|
|
5686
5709
|
s = $(s);
|
|
5687
5710
|
}
|
|
5688
5711
|
return e;
|
|
5689
5712
|
}
|
|
5690
5713
|
let i = jt(a, t);
|
|
5691
|
-
for (; i &&
|
|
5714
|
+
for (; i && Ni(i) && yt(i); )
|
|
5692
5715
|
i = jt(i, t);
|
|
5693
|
-
return i && Q(i) && yt(i) && !Dt(i) ? e : i ||
|
|
5716
|
+
return i && Q(i) && yt(i) && !Dt(i) ? e : i || Fi(a) || e;
|
|
5694
5717
|
}
|
|
5695
|
-
const
|
|
5718
|
+
const Gi = async function(a) {
|
|
5696
5719
|
const t = this.getOffsetParent || we, e = this.getDimensions, i = await e(a.floating);
|
|
5697
5720
|
return {
|
|
5698
|
-
reference:
|
|
5721
|
+
reference: qi(a.reference, await t(a.floating), a.strategy),
|
|
5699
5722
|
floating: {
|
|
5700
5723
|
x: 0,
|
|
5701
5724
|
y: 0,
|
|
@@ -5704,34 +5727,34 @@ const qi = async function(a) {
|
|
|
5704
5727
|
}
|
|
5705
5728
|
};
|
|
5706
5729
|
};
|
|
5707
|
-
function
|
|
5708
|
-
return
|
|
5730
|
+
function ji(a) {
|
|
5731
|
+
return X(a).direction === "rtl";
|
|
5709
5732
|
}
|
|
5710
|
-
const
|
|
5711
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
5733
|
+
const Ui = {
|
|
5734
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ki,
|
|
5712
5735
|
getDocumentElement: V,
|
|
5713
|
-
getClippingRect:
|
|
5736
|
+
getClippingRect: zi,
|
|
5714
5737
|
getOffsetParent: we,
|
|
5715
|
-
getElementRects:
|
|
5716
|
-
getClientRects:
|
|
5717
|
-
getDimensions:
|
|
5738
|
+
getElementRects: Gi,
|
|
5739
|
+
getClientRects: Ki,
|
|
5740
|
+
getDimensions: $i,
|
|
5718
5741
|
getScale: Z,
|
|
5719
|
-
isElement:
|
|
5720
|
-
isRTL:
|
|
5721
|
-
}, pe =
|
|
5742
|
+
isElement: F,
|
|
5743
|
+
isRTL: ji
|
|
5744
|
+
}, pe = Hi, me = Di, ye = Ti, Zi = Ai, Ee = (a, t, e) => {
|
|
5722
5745
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
5723
|
-
platform:
|
|
5746
|
+
platform: Ui,
|
|
5724
5747
|
...e
|
|
5725
5748
|
}, r = {
|
|
5726
5749
|
...s.platform,
|
|
5727
5750
|
_c: i
|
|
5728
5751
|
};
|
|
5729
|
-
return
|
|
5752
|
+
return Si(a, t, {
|
|
5730
5753
|
...s,
|
|
5731
5754
|
platform: r
|
|
5732
5755
|
});
|
|
5733
5756
|
};
|
|
5734
|
-
let
|
|
5757
|
+
let Ji = class {
|
|
5735
5758
|
constructor(t) {
|
|
5736
5759
|
l(this, "ctx");
|
|
5737
5760
|
l(this, "enable", !1);
|
|
@@ -5803,33 +5826,33 @@ let Zi = class {
|
|
|
5803
5826
|
}
|
|
5804
5827
|
}, this.floatingEl, {
|
|
5805
5828
|
placement: t.overflowTooltipPlacement,
|
|
5806
|
-
middleware: [me(), ye(), pe(6),
|
|
5829
|
+
middleware: [me(), ye(), pe(6), Zi({ element: this.arrowEl })]
|
|
5807
5830
|
}).then((n) => {
|
|
5808
5831
|
const { x: h, y: c, placement: d, middlewareData: f } = n;
|
|
5809
5832
|
if (Object.assign(this.floatingEl.style, {
|
|
5810
5833
|
top: `${c}px`,
|
|
5811
5834
|
left: `${h}px`
|
|
5812
5835
|
}), f.arrow) {
|
|
5813
|
-
const
|
|
5836
|
+
const u = f.arrow;
|
|
5814
5837
|
["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5815
|
-
top: `${
|
|
5838
|
+
top: `${u.y}px`,
|
|
5816
5839
|
bottom: "",
|
|
5817
5840
|
left: "",
|
|
5818
5841
|
right: "-5px"
|
|
5819
5842
|
}) : ["right", "right-start", "right-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5820
|
-
top: `${
|
|
5843
|
+
top: `${u.y}px`,
|
|
5821
5844
|
bottom: "",
|
|
5822
5845
|
left: "-5px",
|
|
5823
5846
|
right: ""
|
|
5824
5847
|
}) : ["bottom", "bottom-start", "bottom-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5825
5848
|
top: "-5px",
|
|
5826
5849
|
bottom: "",
|
|
5827
|
-
left: `${
|
|
5850
|
+
left: `${u.x}px`,
|
|
5828
5851
|
right: ""
|
|
5829
5852
|
}) : ["top", "top-start", "top-end"].includes(d) && Object.assign(this.arrowEl.style, {
|
|
5830
5853
|
top: "",
|
|
5831
5854
|
bottom: "-5px",
|
|
5832
|
-
left: `${
|
|
5855
|
+
left: `${u.x}px`,
|
|
5833
5856
|
right: ""
|
|
5834
5857
|
});
|
|
5835
5858
|
}
|
|
@@ -5842,7 +5865,7 @@ let Zi = class {
|
|
|
5842
5865
|
this.contentEl.remove(), this.arrowEl.remove(), this.floatingEl.remove();
|
|
5843
5866
|
}
|
|
5844
5867
|
};
|
|
5845
|
-
class
|
|
5868
|
+
class Qi {
|
|
5846
5869
|
constructor(t) {
|
|
5847
5870
|
l(this, "editorEl");
|
|
5848
5871
|
l(this, "inputEl");
|
|
@@ -5993,8 +6016,8 @@ class Ji {
|
|
|
5993
6016
|
let f = this.ctx.body.visibleHeight;
|
|
5994
6017
|
if (r > f && (r = f), this.editorEl.style.display = "inline-block", this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = `${this.drawY - 1}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text") {
|
|
5995
6018
|
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${o - 1}px`, this.inputEl.style.minHeight = `${r - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${o - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${c}px`, i !== null && (this.inputEl.value = i), this.inputEl.focus({ preventScroll: !0 });
|
|
5996
|
-
const
|
|
5997
|
-
this.inputEl.setSelectionRange(
|
|
6019
|
+
const u = this.inputEl.value.length;
|
|
6020
|
+
this.inputEl.setSelectionRange(u, u);
|
|
5998
6021
|
} else
|
|
5999
6022
|
this.inputEl.style.display = "none";
|
|
6000
6023
|
(this.inputEl.scrollHeight > r || this.drawY < d.height) && this.autoSize();
|
|
@@ -6044,7 +6067,7 @@ class Ji {
|
|
|
6044
6067
|
(t = this.editorEl) == null || t.remove();
|
|
6045
6068
|
}
|
|
6046
6069
|
}
|
|
6047
|
-
class
|
|
6070
|
+
class ts {
|
|
6048
6071
|
constructor(t) {
|
|
6049
6072
|
l(this, "ctx");
|
|
6050
6073
|
l(this, "emptyEl");
|
|
@@ -6068,7 +6091,7 @@ class Qi {
|
|
|
6068
6091
|
this.emptyEl.remove();
|
|
6069
6092
|
}
|
|
6070
6093
|
}
|
|
6071
|
-
class
|
|
6094
|
+
class es {
|
|
6072
6095
|
constructor(t) {
|
|
6073
6096
|
l(this, "ctx");
|
|
6074
6097
|
this.ctx = t;
|
|
@@ -6101,7 +6124,7 @@ class ts {
|
|
|
6101
6124
|
n.forEach((w) => {
|
|
6102
6125
|
w.render && (w.fixed === "left" ? c.push(w) : w.fixed === "right" ? d.push(w) : h.push(w));
|
|
6103
6126
|
});
|
|
6104
|
-
const f = e - i,
|
|
6127
|
+
const f = e - i, u = {
|
|
6105
6128
|
key: "left",
|
|
6106
6129
|
style: {
|
|
6107
6130
|
position: "absolute",
|
|
@@ -6144,7 +6167,7 @@ class ts {
|
|
|
6144
6167
|
width: `${r}px`,
|
|
6145
6168
|
height: `${o}px`
|
|
6146
6169
|
},
|
|
6147
|
-
views: [
|
|
6170
|
+
views: [u, g, p]
|
|
6148
6171
|
};
|
|
6149
6172
|
}
|
|
6150
6173
|
getBody() {
|
|
@@ -6159,7 +6182,7 @@ class ts {
|
|
|
6159
6182
|
fixedLeftWidth: r,
|
|
6160
6183
|
fixedRightWidth: o,
|
|
6161
6184
|
config: { SCROLLER_TRACK_SIZE: n, CSS_PREFIX: h }
|
|
6162
|
-
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - n,
|
|
6185
|
+
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - n, u = {
|
|
6163
6186
|
key: "left",
|
|
6164
6187
|
style: {
|
|
6165
6188
|
position: "absolute",
|
|
@@ -6202,13 +6225,13 @@ class ts {
|
|
|
6202
6225
|
width: `${c}px`,
|
|
6203
6226
|
height: `${d}px`
|
|
6204
6227
|
},
|
|
6205
|
-
views: [
|
|
6228
|
+
views: [u, g, p]
|
|
6206
6229
|
};
|
|
6207
6230
|
}
|
|
6208
6231
|
getFooter() {
|
|
6209
6232
|
const t = [], e = [], i = [];
|
|
6210
|
-
this.ctx.footer.renderRows.forEach((
|
|
6211
|
-
|
|
6233
|
+
this.ctx.footer.renderRows.forEach((x) => {
|
|
6234
|
+
x.cells.forEach((w) => {
|
|
6212
6235
|
w.cellType === "footer" && w.renderFooter && (w.render = w.renderFooter, w.fixed === "left" ? e.push(w) : w.fixed === "right" ? i.push(w) : t.push(w));
|
|
6213
6236
|
});
|
|
6214
6237
|
});
|
|
@@ -6227,7 +6250,7 @@ class ts {
|
|
|
6227
6250
|
height: `${c}px`
|
|
6228
6251
|
},
|
|
6229
6252
|
cells: e
|
|
6230
|
-
},
|
|
6253
|
+
}, u = {
|
|
6231
6254
|
key: "center",
|
|
6232
6255
|
style: {
|
|
6233
6256
|
position: "absolute",
|
|
@@ -6259,11 +6282,11 @@ class ts {
|
|
|
6259
6282
|
width: `${h}px`,
|
|
6260
6283
|
height: `${c}px`
|
|
6261
6284
|
},
|
|
6262
|
-
views: [f,
|
|
6285
|
+
views: [f, u, g]
|
|
6263
6286
|
};
|
|
6264
6287
|
}
|
|
6265
6288
|
}
|
|
6266
|
-
class
|
|
6289
|
+
class is {
|
|
6267
6290
|
constructor(t) {
|
|
6268
6291
|
l(this, "ctx");
|
|
6269
6292
|
l(this, "contextMenuEl");
|
|
@@ -6276,7 +6299,7 @@ class es {
|
|
|
6276
6299
|
e.preventDefault();
|
|
6277
6300
|
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [n, h] = s, { rowIndex: c, colIndex: d } = t;
|
|
6278
6301
|
c >= n && c <= h && d >= r && d <= o || this.ctx.emit("setSelectorCell", t, e);
|
|
6279
|
-
const
|
|
6302
|
+
const u = {
|
|
6280
6303
|
getBoundingClientRect: () => ({
|
|
6281
6304
|
width: 0,
|
|
6282
6305
|
height: 0,
|
|
@@ -6289,7 +6312,7 @@ class es {
|
|
|
6289
6312
|
}),
|
|
6290
6313
|
contextElement: document.body
|
|
6291
6314
|
};
|
|
6292
|
-
Ee(
|
|
6315
|
+
Ee(u, this.contextMenuEl, {
|
|
6293
6316
|
placement: "right-start",
|
|
6294
6317
|
middleware: [pe(), me(), ye()]
|
|
6295
6318
|
}).then(({ x: g, y: p }) => {
|
|
@@ -6347,7 +6370,7 @@ class es {
|
|
|
6347
6370
|
this.contextMenuEl.remove();
|
|
6348
6371
|
}
|
|
6349
6372
|
}
|
|
6350
|
-
class
|
|
6373
|
+
class os {
|
|
6351
6374
|
constructor(t, e) {
|
|
6352
6375
|
l(this, "options");
|
|
6353
6376
|
l(this, "scroller");
|
|
@@ -6370,7 +6393,7 @@ class rs {
|
|
|
6370
6393
|
r,
|
|
6371
6394
|
o
|
|
6372
6395
|
);
|
|
6373
|
-
this.ctx = new
|
|
6396
|
+
this.ctx = new gi(n, this.options), this.header = new pi(this.ctx), this.footer = new yi(this.ctx), this.body = new mi(this.ctx), this.scroller = new wi(this.ctx), this.selector = new Ei(this.ctx), this.autofill = new Ci(this.ctx), this.tooltip = new Ji(this.ctx), this.empty = new ts(this.ctx), this.editor = new Qi(this.ctx), this.overlayer = new es(this.ctx), this.contextMenu = new is(this.ctx), this.ctx.on("draw", () => {
|
|
6374
6397
|
this.draw();
|
|
6375
6398
|
}), this.ctx.on("drawView", () => {
|
|
6376
6399
|
this.draw(!0);
|
|
@@ -6602,6 +6625,6 @@ class rs {
|
|
|
6602
6625
|
}
|
|
6603
6626
|
}
|
|
6604
6627
|
export {
|
|
6605
|
-
|
|
6628
|
+
os as default
|
|
6606
6629
|
};
|
|
6607
6630
|
//# sourceMappingURL=index.es.js.map
|