e-virt-table 1.2.3 → 1.2.4
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 +381 -359
- 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 +2 -0
- package/dist/lib/Config.js +19 -0
- 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-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);
|
|
@@ -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,25 +554,25 @@ 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 &&
|
|
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
576
|
function y(v, _) {
|
|
577
577
|
return q({}, _, {
|
|
578
578
|
fullField: m.fullField + "." + v,
|
|
@@ -589,19 +589,19 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
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
594
|
var I = {};
|
|
595
|
-
m.defaultField && Object.keys(
|
|
595
|
+
m.defaultField && Object.keys(x.value).map(function(S) {
|
|
596
596
|
I[S] = m.defaultField;
|
|
597
|
-
}), I = q({}, I,
|
|
597
|
+
}), I = q({}, I, x.rule.fields);
|
|
598
598
|
var R = {};
|
|
599
599
|
Object.keys(I).forEach(function(S) {
|
|
600
600
|
var M = I[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))
|
|
@@ -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,7 +1048,7 @@ 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") {
|
|
@@ -1063,15 +1067,15 @@ class Tt extends re {
|
|
|
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),
|
|
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") {
|
|
1075
1079
|
const E = s, { backgroundColor: v, color: _ } = E({
|
|
1076
1080
|
row: this.row,
|
|
1077
1081
|
rowIndex: this.rowIndex,
|
|
@@ -1087,9 +1091,9 @@ class Tt extends re {
|
|
|
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: [
|
|
@@ -2168,7 +2172,7 @@ class ai {
|
|
|
2168
2172
|
};
|
|
2169
2173
|
let w = e, m = e, C = n, y = n, b = [], E = 0, v = 0, _ = 0, L = 0;
|
|
2170
2174
|
if (d !== 1 && p) {
|
|
2171
|
-
L =
|
|
2175
|
+
L = u;
|
|
2172
2176
|
const I = h.reduce((R, A) => {
|
|
2173
2177
|
const S = this.getItemValue(s, A) ?? "";
|
|
2174
2178
|
return `${R}${S}`;
|
|
@@ -2209,7 +2213,7 @@ class ai {
|
|
|
2209
2213
|
});
|
|
2210
2214
|
}
|
|
2211
2215
|
}
|
|
2212
|
-
if (g !== 1 &&
|
|
2216
|
+
if (g !== 1 && x) {
|
|
2213
2217
|
_ = f;
|
|
2214
2218
|
for (let I = n - 1; I >= 0; I--) {
|
|
2215
2219
|
const R = this.getColumnByColIndex(I);
|
|
@@ -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;
|
|
@@ -2691,6 +2695,7 @@ class Wt {
|
|
|
2691
2695
|
// 选择器Y最大范围,0默认rowMax
|
|
2692
2696
|
l(this, "SELECTOR_AREA_MAX_Y_OFFSET", 0);
|
|
2693
2697
|
// 选择器Y最大范围,0默认rowMax
|
|
2698
|
+
l(this, "ENABLE_AUTO_THEME", !0);
|
|
2694
2699
|
l(this, "ENABLE_SELECTOR_SINGLE", !1);
|
|
2695
2700
|
l(this, "ENABLE_SELECTOR_SPAN_COL", !0);
|
|
2696
2701
|
l(this, "ENABLE_SELECTOR_SPAN_ROW", !0);
|
|
@@ -2745,14 +2750,23 @@ class Wt {
|
|
|
2745
2750
|
l(this, "BEFORE_SET_SELECTOR_METHOD");
|
|
2746
2751
|
l(this, "BEFORE_SET_AUTOFILL_METHOD");
|
|
2747
2752
|
l(this, "BEFORE_COPY_METHOD");
|
|
2748
|
-
Object.assign(this, t);
|
|
2753
|
+
this.updateCssVar(), Object.assign(this, t);
|
|
2749
2754
|
}
|
|
2750
2755
|
init(t) {
|
|
2751
|
-
Object.assign(this, t);
|
|
2756
|
+
this.updateCssVar(), Object.assign(this, t);
|
|
2757
|
+
}
|
|
2758
|
+
// 同步css 样式变量
|
|
2759
|
+
updateCssVar() {
|
|
2760
|
+
Object.keys(this).forEach((t) => {
|
|
2761
|
+
if (t.endsWith("_COLOR")) {
|
|
2762
|
+
const e = `--evt-${t.toLocaleLowerCase().replace(/_/g, "-")}`, i = ai(e);
|
|
2763
|
+
this[t] = i;
|
|
2764
|
+
}
|
|
2765
|
+
});
|
|
2752
2766
|
}
|
|
2753
2767
|
}
|
|
2754
2768
|
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
|
|
2769
|
+
class ui {
|
|
2756
2770
|
constructor(t) {
|
|
2757
2771
|
l(this, "ctx");
|
|
2758
2772
|
l(this, "list", [
|
|
@@ -2983,8 +2997,8 @@ class oe extends re {
|
|
|
2983
2997
|
const { width: e, height: i, type: s } = this;
|
|
2984
2998
|
if (["index-selection", "selection"].includes(s)) {
|
|
2985
2999
|
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"),
|
|
3000
|
+
let f = this.ctx.icons.get("checkbox-uncheck"), u = "checkbox-uncheck";
|
|
3001
|
+
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
3002
|
this.drawImageSource,
|
|
2989
3003
|
this.drawImageX,
|
|
2990
3004
|
this.drawImageY,
|
|
@@ -3018,12 +3032,20 @@ class xi {
|
|
|
3018
3032
|
l(this, "ctx");
|
|
3019
3033
|
l(this, "visibleHoverCell");
|
|
3020
3034
|
l(this, "resizeObserver");
|
|
3035
|
+
l(this, "mutationObserver");
|
|
3021
3036
|
this.ctx = t, this.init();
|
|
3022
3037
|
}
|
|
3023
3038
|
init() {
|
|
3024
3039
|
this.resizeObserver = new ResizeObserver(() => {
|
|
3025
3040
|
this.ctx.emit("resetHeader"), this.ctx.emit("resizeObserver");
|
|
3026
|
-
}), this.resizeObserver.observe(this.ctx.containerElement), this.
|
|
3041
|
+
}), this.resizeObserver.observe(this.ctx.containerElement), this.mutationObserver = new MutationObserver((t) => {
|
|
3042
|
+
for (const e of t)
|
|
3043
|
+
e.type === "attributes" && e.attributeName === "class" && (this.ctx.config.updateCssVar(), this.ctx.emit("draw"));
|
|
3044
|
+
}), this.ctx.config.ENABLE_AUTO_THEME && this.mutationObserver.observe(document.documentElement, {
|
|
3045
|
+
attributes: !0,
|
|
3046
|
+
attributeFilter: ["class"]
|
|
3047
|
+
// ✅ 只监听 class 更改
|
|
3048
|
+
}), this.ctx.on("mousedown", (t) => {
|
|
3027
3049
|
if (t.button !== 0 || this.isBusy(t))
|
|
3028
3050
|
return;
|
|
3029
3051
|
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, r = i;
|
|
@@ -3175,10 +3197,10 @@ class xi {
|
|
|
3175
3197
|
return t > this.ctx.body.y && t < this.ctx.body.y + this.ctx.body.visibleHeight;
|
|
3176
3198
|
}
|
|
3177
3199
|
destroy() {
|
|
3178
|
-
this.resizeObserver.unobserve(this.ctx.stageElement);
|
|
3200
|
+
this.resizeObserver.unobserve(this.ctx.stageElement), this.mutationObserver.disconnect();
|
|
3179
3201
|
}
|
|
3180
3202
|
}
|
|
3181
|
-
class
|
|
3203
|
+
class gi {
|
|
3182
3204
|
constructor(t, e) {
|
|
3183
3205
|
l(this, "eventBus");
|
|
3184
3206
|
l(this, "eventBrowser");
|
|
@@ -3292,7 +3314,7 @@ class ui {
|
|
|
3292
3314
|
emptyElement: h,
|
|
3293
3315
|
contextMenuElement: c
|
|
3294
3316
|
} = 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
|
|
3317
|
+
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
3318
|
}
|
|
3297
3319
|
setConfig(t) {
|
|
3298
3320
|
this.config = new Wt(t);
|
|
@@ -3498,12 +3520,12 @@ class zt {
|
|
|
3498
3520
|
stageHeight: i,
|
|
3499
3521
|
stageWidth: s,
|
|
3500
3522
|
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,
|
|
3523
|
+
} = this.ctx, h = s, c = i, d = e.height, f = e.width, u = t.height, g = this.ctx.footer.height;
|
|
3502
3524
|
if (this.type === "vertical") {
|
|
3503
|
-
this.visibleDistance = c - r - d, this.distance =
|
|
3504
|
-
const p = this.distance ? this.visibleDistance / (
|
|
3505
|
-
let
|
|
3506
|
-
|
|
3525
|
+
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;
|
|
3526
|
+
const p = this.distance ? this.visibleDistance / (u + g) : 0;
|
|
3527
|
+
let x = Math.floor(p * this.visibleDistance);
|
|
3528
|
+
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
3529
|
} else {
|
|
3508
3530
|
this.visibleDistance = h - r, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
3509
3531
|
h - r,
|
|
@@ -3513,8 +3535,8 @@ class zt {
|
|
|
3513
3535
|
];
|
|
3514
3536
|
const p = n ? 0 : 0.5;
|
|
3515
3537
|
this.trackX = 0, this.trackY = c - r + p, this.trackWidth = h, this.trackHeight = r;
|
|
3516
|
-
const
|
|
3517
|
-
let w = Math.floor(
|
|
3538
|
+
const x = this.distance ? this.visibleDistance / f : 0;
|
|
3539
|
+
let w = Math.floor(x * this.visibleDistance);
|
|
3518
3540
|
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
3541
|
}
|
|
3520
3542
|
}
|
|
@@ -3536,7 +3558,7 @@ class zt {
|
|
|
3536
3558
|
}), this.ctx.scrollerFocus = this.isFocus;
|
|
3537
3559
|
}
|
|
3538
3560
|
}
|
|
3539
|
-
class
|
|
3561
|
+
class wi {
|
|
3540
3562
|
constructor(t) {
|
|
3541
3563
|
l(this, "ctx");
|
|
3542
3564
|
l(this, "verticalScrollbar");
|
|
@@ -3600,7 +3622,7 @@ class gi {
|
|
|
3600
3622
|
this.setScrollY(r - e.visibleHeight / 2);
|
|
3601
3623
|
}
|
|
3602
3624
|
}
|
|
3603
|
-
class
|
|
3625
|
+
class pi {
|
|
3604
3626
|
constructor(t) {
|
|
3605
3627
|
l(this, "ctx");
|
|
3606
3628
|
// 上下文
|
|
@@ -3650,7 +3672,7 @@ class wi {
|
|
|
3650
3672
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3651
3673
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3652
3674
|
const s = te(i), r = It(i);
|
|
3653
|
-
this.height = t * s, this.width = r.reduce((f,
|
|
3675
|
+
this.height = t * s, this.width = r.reduce((f, u) => f + ((u == null ? void 0 : u.width) || 100), 0), this.visibleHeight = this.height;
|
|
3654
3676
|
const o = ei(ee(i, s));
|
|
3655
3677
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3656
3678
|
const n = this.ctx.containerElement.getBoundingClientRect();
|
|
@@ -3661,9 +3683,9 @@ class wi {
|
|
|
3661
3683
|
this.resizeAllColumn(f);
|
|
3662
3684
|
}
|
|
3663
3685
|
const c = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
3664
|
-
this.ctx.fixedLeftWidth = c.reduce((f,
|
|
3686
|
+
this.ctx.fixedLeftWidth = c.reduce((f, u) => f + u.width, 0);
|
|
3665
3687
|
const d = this.fixedRightCellHeaders.filter((f) => !f.hasChildren);
|
|
3666
|
-
this.ctx.fixedRightWidth = d.reduce((f,
|
|
3688
|
+
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
3689
|
}
|
|
3668
3690
|
// 调整表头的宽度
|
|
3669
3691
|
initResizeColumn() {
|
|
@@ -3882,7 +3904,7 @@ class ne {
|
|
|
3882
3904
|
});
|
|
3883
3905
|
}
|
|
3884
3906
|
}
|
|
3885
|
-
class
|
|
3907
|
+
class mi {
|
|
3886
3908
|
constructor(t) {
|
|
3887
3909
|
l(this, "resizeTarget", null);
|
|
3888
3910
|
//调整行大小的目标
|
|
@@ -3923,18 +3945,18 @@ class pi {
|
|
|
3923
3945
|
MAX_HEIGHT: c = 0,
|
|
3924
3946
|
ENABLE_OFFSET_HEIGHT: d = 0,
|
|
3925
3947
|
OFFSET_HEIGHT: f = 0,
|
|
3926
|
-
FOOTER_POSITION:
|
|
3948
|
+
FOOTER_POSITION: u
|
|
3927
3949
|
}
|
|
3928
3950
|
} = this.ctx;
|
|
3929
3951
|
if (!e.width)
|
|
3930
3952
|
return;
|
|
3931
|
-
this.x = 0,
|
|
3953
|
+
this.x = 0, u === "top" && r ? this.y = e.height + i.height : this.y = e.height;
|
|
3932
3954
|
const { data: g, sumHeight: p } = s.getData();
|
|
3933
3955
|
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 -
|
|
3956
|
+
const x = this.ctx.footer.height;
|
|
3957
|
+
!this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height - x - o);
|
|
3936
3958
|
let w = this.height + e.height + o;
|
|
3937
|
-
w +=
|
|
3959
|
+
w += x;
|
|
3938
3960
|
let m = w;
|
|
3939
3961
|
const C = window.innerHeight, { top: y } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
3940
3962
|
if (C > y && d && !n) {
|
|
@@ -3943,7 +3965,7 @@ class pi {
|
|
|
3943
3965
|
} else this.data.length && n ? m = n : this.data.length && c && w > c && (m = c);
|
|
3944
3966
|
m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
|
|
3945
3967
|
let b = this.ctx.stageHeight - e.height - o;
|
|
3946
|
-
r ? this.visibleHeight = b -
|
|
3968
|
+
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;
|
|
3947
3969
|
const E = window.devicePixelRatio || 1, v = this.ctx.stageWidth * E, _ = this.ctx.stageHeight * E;
|
|
3948
3970
|
t.width = Math.floor(v), t.height = Math.floor(_);
|
|
3949
3971
|
const L = this.data.length ? "not-empty" : "empty";
|
|
@@ -3952,9 +3974,9 @@ class pi {
|
|
|
3952
3974
|
type: L,
|
|
3953
3975
|
headerHeight: e.height,
|
|
3954
3976
|
bodyHeight: this.height,
|
|
3955
|
-
footerHeight:
|
|
3977
|
+
footerHeight: x,
|
|
3956
3978
|
width: this.width,
|
|
3957
|
-
height: this.data.length ? 0 : h +
|
|
3979
|
+
height: this.data.length ? 0 : h + x
|
|
3958
3980
|
}), this.ctx.canvasElement.setAttribute(
|
|
3959
3981
|
"style",
|
|
3960
3982
|
` height:${this.ctx.stageHeight}px;width:${this.ctx.stageWidth}px;`
|
|
@@ -3984,8 +4006,8 @@ class pi {
|
|
|
3984
4006
|
} = this.ctx;
|
|
3985
4007
|
if (this.isResizing && this.resizeTarget) {
|
|
3986
4008
|
const f = this.resizeTarget.height;
|
|
3987
|
-
let
|
|
3988
|
-
|
|
4009
|
+
let u = n - this.clientY;
|
|
4010
|
+
u + f < d && (u = -(f - d)), this.resizeDiff = u, this.ctx.emit("draw");
|
|
3989
4011
|
} else {
|
|
3990
4012
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
3991
4013
|
return;
|
|
@@ -3997,11 +4019,11 @@ class pi {
|
|
|
3997
4019
|
return;
|
|
3998
4020
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3999
4021
|
for (let f = 0; f < this.renderRows.length; f++) {
|
|
4000
|
-
const
|
|
4001
|
-
if (r >
|
|
4002
|
-
for (let p = 0; p <
|
|
4003
|
-
const
|
|
4004
|
-
o >
|
|
4022
|
+
const u = this.renderRows[f];
|
|
4023
|
+
if (r > u.y - c + u.height - 1.5 && r < u.y - c + u.height + 1.5 && r < h - 4)
|
|
4024
|
+
for (let p = 0; p < u.cells.length; p++) {
|
|
4025
|
+
const x = u.cells[p];
|
|
4026
|
+
o > x.drawX + 10 && o < x.drawX + x.width - 10 && x.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = u);
|
|
4005
4027
|
}
|
|
4006
4028
|
}
|
|
4007
4029
|
}
|
|
@@ -4084,7 +4106,7 @@ class pi {
|
|
|
4084
4106
|
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
4107
|
const d = [];
|
|
4086
4108
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
4087
|
-
const
|
|
4109
|
+
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
4110
|
d.push(w);
|
|
4089
4111
|
}
|
|
4090
4112
|
this.renderRows = d, this.ctx.body.renderRows = d;
|
|
@@ -4101,7 +4123,7 @@ class pi {
|
|
|
4101
4123
|
}), this.drawTipLine();
|
|
4102
4124
|
}
|
|
4103
4125
|
}
|
|
4104
|
-
class
|
|
4126
|
+
class yi {
|
|
4105
4127
|
constructor(t) {
|
|
4106
4128
|
l(this, "ctx");
|
|
4107
4129
|
l(this, "renderRows", []);
|
|
@@ -4182,7 +4204,7 @@ class mi {
|
|
|
4182
4204
|
}), this.drawTopLine();
|
|
4183
4205
|
}
|
|
4184
4206
|
}
|
|
4185
|
-
class
|
|
4207
|
+
class Ei {
|
|
4186
4208
|
// 垂直滚动定时器
|
|
4187
4209
|
constructor(t) {
|
|
4188
4210
|
l(this, "isCut", !1);
|
|
@@ -4301,16 +4323,16 @@ class yi {
|
|
|
4301
4323
|
SELECTOR_AREA_MIN_Y: c,
|
|
4302
4324
|
SELECTOR_AREA_MAX_Y: d,
|
|
4303
4325
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
4304
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4305
|
-
} = this.ctx.config, g = n, p = h || this.ctx.maxColIndex - f,
|
|
4326
|
+
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
4327
|
+
} = this.ctx.config, g = n, p = h || this.ctx.maxColIndex - f, x = c, w = d || this.ctx.maxRowIndex - u;
|
|
4306
4328
|
let [m, C] = r, [y, b] = o;
|
|
4307
|
-
if (m < g || C > p || y <
|
|
4329
|
+
if (m < g || C > p || y < x || b > w)
|
|
4308
4330
|
return;
|
|
4309
4331
|
if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
4310
4332
|
const v = this.adjustMergeCells(r, o);
|
|
4311
4333
|
y = v.yArr[0], b = v.yArr[1], m = v.xArr[0], C = v.xArr[1], this.ctx.onlyMergeCell = v.onlyMergeCell;
|
|
4312
4334
|
}
|
|
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(
|
|
4335
|
+
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
4336
|
const { BEFORE_SET_SELECTOR_METHOD: E } = this.ctx.config;
|
|
4315
4337
|
if (typeof E == "function") {
|
|
4316
4338
|
const _ = E({
|
|
@@ -4329,38 +4351,38 @@ class yi {
|
|
|
4329
4351
|
var p;
|
|
4330
4352
|
const [i, s] = e, [r, o] = t;
|
|
4331
4353
|
let n = [], h = [];
|
|
4332
|
-
for (let
|
|
4354
|
+
for (let x = 0; x <= e[1] - e[0]; x++)
|
|
4333
4355
|
for (let w = 0; w <= t[1] - t[0]; w++) {
|
|
4334
|
-
const m =
|
|
4356
|
+
const m = x + e[0], C = w + t[0], y = this.ctx.database.getVirtualBodyCell(m, C);
|
|
4335
4357
|
y && ((m === i || m === s) && n.push(y), (C === r || C === o) && h.push(y));
|
|
4336
4358
|
}
|
|
4337
4359
|
const c = n.reduce(
|
|
4338
|
-
(
|
|
4360
|
+
(x, w) => {
|
|
4339
4361
|
const { yArr: m } = w.getSpanInfo(), [C, y] = m;
|
|
4340
|
-
return
|
|
4362
|
+
return x.minY = Math.min(x.minY, C), x.maxY = Math.max(x.maxY, y), x;
|
|
4341
4363
|
},
|
|
4342
4364
|
{
|
|
4343
4365
|
minY: i,
|
|
4344
4366
|
maxY: s
|
|
4345
4367
|
}
|
|
4346
4368
|
), d = h.reduce(
|
|
4347
|
-
(
|
|
4369
|
+
(x, w) => {
|
|
4348
4370
|
const { xArr: m } = w.getSpanInfo(), [C, y] = m;
|
|
4349
|
-
return
|
|
4371
|
+
return x.minX = Math.min(x.minX, C), x.maxX = Math.max(x.maxX, y), x;
|
|
4350
4372
|
},
|
|
4351
4373
|
{
|
|
4352
4374
|
minX: r,
|
|
4353
4375
|
maxX: o
|
|
4354
4376
|
}
|
|
4355
|
-
), f = [d.minX, d.maxX],
|
|
4377
|
+
), f = [d.minX, d.maxX], u = [c.minY, c.maxY];
|
|
4356
4378
|
let g = !1;
|
|
4357
4379
|
if (d.minX !== d.maxX || c.minY !== c.maxY) {
|
|
4358
|
-
const
|
|
4359
|
-
g = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) ===
|
|
4380
|
+
const x = JSON.stringify(f) + JSON.stringify(u), w = (p = this.ctx.focusCell) == null ? void 0 : p.getSpanInfo();
|
|
4381
|
+
g = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) === x;
|
|
4360
4382
|
}
|
|
4361
4383
|
return {
|
|
4362
4384
|
xArr: f,
|
|
4363
|
-
yArr:
|
|
4385
|
+
yArr: u,
|
|
4364
4386
|
onlyMergeCell: g
|
|
4365
4387
|
};
|
|
4366
4388
|
}
|
|
@@ -4398,7 +4420,7 @@ class yi {
|
|
|
4398
4420
|
SELECTOR_AREA_MAX_Y: o,
|
|
4399
4421
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
4400
4422
|
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4401
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r,
|
|
4423
|
+
} = 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
4424
|
this.setSelector(g, p);
|
|
4403
4425
|
}
|
|
4404
4426
|
}
|
|
@@ -4437,8 +4459,8 @@ class yi {
|
|
|
4437
4459
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
4438
4460
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
|
|
4439
4461
|
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(
|
|
4462
|
+
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];
|
|
4463
|
+
this.setSelector(u, g);
|
|
4442
4464
|
} else {
|
|
4443
4465
|
this.ctx.emit("cellSelectedClick", e);
|
|
4444
4466
|
const s = [e.colIndex, e.colIndex], r = [e.rowIndex, e.rowIndex];
|
|
@@ -4506,9 +4528,9 @@ class yi {
|
|
|
4506
4528
|
for (let h = 0; h <= t[1] - t[0]; h++) {
|
|
4507
4529
|
const c = n + e[0], d = h + t[0], f = this.ctx.database.getItemValueForRowIndexAndColIndex(c, d);
|
|
4508
4530
|
if (f) {
|
|
4509
|
-
const { rowKey:
|
|
4510
|
-
this.ctx.database.getReadonly(
|
|
4511
|
-
rowKey:
|
|
4531
|
+
const { rowKey: u, key: g } = f;
|
|
4532
|
+
this.ctx.database.getReadonly(u, g) || (r.add(u), s.push({
|
|
4533
|
+
rowKey: u,
|
|
4512
4534
|
key: g,
|
|
4513
4535
|
value: null,
|
|
4514
4536
|
row: {}
|
|
@@ -4536,18 +4558,18 @@ class yi {
|
|
|
4536
4558
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
4537
4559
|
navigator.clipboard.readText().then(async (r) => {
|
|
4538
4560
|
let o = si(r);
|
|
4539
|
-
const n = [i, i + o[0].length - 1], h = [e, e + o.length - 1], [c, d] = h, [f,
|
|
4561
|
+
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
4562
|
(g > 0 || p > 0) && this.ctx.emit("onPastedDataOverflow", {
|
|
4541
4563
|
maxY: d,
|
|
4542
|
-
maxX:
|
|
4564
|
+
maxX: u,
|
|
4543
4565
|
minY: c,
|
|
4544
4566
|
minX: f,
|
|
4545
4567
|
overflowRowCount: g,
|
|
4546
4568
|
overflowColCount: p,
|
|
4547
4569
|
textArr: o
|
|
4548
4570
|
});
|
|
4549
|
-
const
|
|
4550
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !
|
|
4571
|
+
const x = o.length === 1 && o[0].length === 1;
|
|
4572
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !x) {
|
|
4551
4573
|
const y = {
|
|
4552
4574
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
4553
4575
|
message: "Merged cells cannot span paste data"
|
|
@@ -4650,8 +4672,8 @@ class yi {
|
|
|
4650
4672
|
SELECTOR_AREA_MAX_Y: o,
|
|
4651
4673
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
4652
4674
|
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 >
|
|
4675
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, u = o || this.ctx.maxRowIndex - h;
|
|
4676
|
+
return !(e < c || e > d || t < f || t > u);
|
|
4655
4677
|
}
|
|
4656
4678
|
/**
|
|
4657
4679
|
* 调整滚动条位置,让到达边界时自动滚动
|
|
@@ -4693,16 +4715,16 @@ class yi {
|
|
|
4693
4715
|
body: h,
|
|
4694
4716
|
scrollX: c,
|
|
4695
4717
|
scrollY: d,
|
|
4696
|
-
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED:
|
|
4718
|
+
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: u, FOOTER_POSITION: g, ENABLE_MERGE_CELL_LINK: p }
|
|
4697
4719
|
} = this.ctx;
|
|
4698
4720
|
if (!i)
|
|
4699
4721
|
return;
|
|
4700
4722
|
p && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
4701
|
-
const { drawX:
|
|
4723
|
+
const { drawX: x, drawY: w, width: m, height: C, fixed: y } = i, b = r - x + 1, E = i.drawX + m - (e - s) + 1;
|
|
4702
4724
|
let v = o.height - w, _ = C;
|
|
4703
4725
|
_ > h.visibleHeight && (_ = h.visibleHeight);
|
|
4704
4726
|
let L = 0;
|
|
4705
|
-
|
|
4727
|
+
u && (g === "top" ? v = o.height + n.height - w : L = n.visibleHeight);
|
|
4706
4728
|
const I = w + _ - (t - L - f);
|
|
4707
4729
|
let R = c, A = d;
|
|
4708
4730
|
E > 0 && !y ? R = Math.floor(c + E) : b > 0 && !y && (R = Math.floor(c - b)), v > 0 ? A = Math.floor(d - v) : I > 0 && (A = Math.floor(d + I)), (Math.abs(c - R) > 2 || Math.abs(d - A) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(R, A), this.ctx.emit("adjustBoundaryPosition", i));
|
|
@@ -4711,7 +4733,7 @@ class yi {
|
|
|
4711
4733
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
4712
4734
|
}
|
|
4713
4735
|
}
|
|
4714
|
-
class
|
|
4736
|
+
class Ci {
|
|
4715
4737
|
constructor(t) {
|
|
4716
4738
|
l(this, "ctx");
|
|
4717
4739
|
l(this, "maxColRowCell");
|
|
@@ -4721,8 +4743,8 @@ class Ei {
|
|
|
4721
4743
|
this.ctx.on("mousemove", (t) => {
|
|
4722
4744
|
if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
|
|
4723
4745
|
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 >
|
|
4746
|
+
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;
|
|
4747
|
+
e > u && i > g && e < u + d && i < g + d && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4726
4748
|
}), this.ctx.on("cellMouseenter", (t) => {
|
|
4727
4749
|
const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], r = i[1], { colIndex: o, rowIndex: n } = t;
|
|
4728
4750
|
this.ctx.config.ENABLE_AUTOFILL && o === s && n === r && (this.maxColRowCell = t), this.mouseenter(t);
|
|
@@ -4767,13 +4789,13 @@ class Ei {
|
|
|
4767
4789
|
SELECTOR_AREA_MAX_X: c,
|
|
4768
4790
|
SELECTOR_AREA_MIN_Y: d,
|
|
4769
4791
|
SELECTOR_AREA_MAX_Y: f,
|
|
4770
|
-
SELECTOR_AREA_MAX_X_OFFSET:
|
|
4792
|
+
SELECTOR_AREA_MAX_X_OFFSET: u,
|
|
4771
4793
|
SELECTOR_AREA_MAX_Y_OFFSET: g
|
|
4772
|
-
} = this.ctx.config, p = h,
|
|
4794
|
+
} = this.ctx.config, p = h, x = c || this.ctx.maxColIndex - u, w = d, m = f || this.ctx.maxRowIndex - g;
|
|
4773
4795
|
let [C, y] = o, [b, E] = n;
|
|
4774
4796
|
if (C < p || b < w)
|
|
4775
4797
|
return;
|
|
4776
|
-
o = [Math.max(p, C), Math.min(
|
|
4798
|
+
o = [Math.max(p, C), Math.min(x, y)], n = [Math.max(w, b), Math.min(m, E)];
|
|
4777
4799
|
const { BEFORE_SET_AUTOFILL_METHOD: v } = this.ctx.config;
|
|
4778
4800
|
if (typeof v == "function") {
|
|
4779
4801
|
const L = v({
|
|
@@ -4795,8 +4817,8 @@ class Ei {
|
|
|
4795
4817
|
const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
|
|
4796
4818
|
for (let g = 0; g <= e.yArr[1] - e.yArr[0]; g++)
|
|
4797
4819
|
for (let p = 0; p <= e.xArr[1] - e.xArr[0]; p++) {
|
|
4798
|
-
const
|
|
4799
|
-
i.set(`${
|
|
4820
|
+
const x = g + e.yArr[0], w = p + e.xArr[0];
|
|
4821
|
+
i.set(`${x}-${w}`, !0);
|
|
4800
4822
|
}
|
|
4801
4823
|
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
4824
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !c) {
|
|
@@ -4810,7 +4832,7 @@ class Ei {
|
|
|
4810
4832
|
let d = [];
|
|
4811
4833
|
for (let g = 0; g <= h[1] - h[0]; g++)
|
|
4812
4834
|
for (let p = 0; p <= n[1] - n[0]; p++) {
|
|
4813
|
-
const
|
|
4835
|
+
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
4836
|
if (C && !i.has(y)) {
|
|
4815
4837
|
const { rowKey: b, key: E } = C;
|
|
4816
4838
|
this.ctx.database.getReadonly(b, E) || (t.add(b), d.push({
|
|
@@ -4826,21 +4848,21 @@ class Ei {
|
|
|
4826
4848
|
this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr;
|
|
4827
4849
|
const { BEFORE_AUTOFILL_DATA_METHOD: f } = this.ctx.config;
|
|
4828
4850
|
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(
|
|
4851
|
+
const g = f, p = d.map((x) => ({
|
|
4852
|
+
rowKey: x.rowKey,
|
|
4853
|
+
key: x.key,
|
|
4854
|
+
value: x.value,
|
|
4855
|
+
oldValue: this.ctx.database.getItemValue(x.rowKey, x.key),
|
|
4856
|
+
row: this.ctx.database.getRowDataItemForRowKey(x.rowKey)
|
|
4835
4857
|
}));
|
|
4836
4858
|
if (d = await g(p, n, h), d && !d.length)
|
|
4837
4859
|
return;
|
|
4838
4860
|
}
|
|
4839
4861
|
this.ctx.batchSetItemValueByEditor(d, !0);
|
|
4840
|
-
let
|
|
4862
|
+
let u = [];
|
|
4841
4863
|
t.forEach((g) => {
|
|
4842
|
-
|
|
4843
|
-
}), this.ctx.emit("autofillChange", d,
|
|
4864
|
+
u.push(this.ctx.database.getRowDataItemForRowKey(g));
|
|
4865
|
+
}), this.ctx.emit("autofillChange", d, u);
|
|
4844
4866
|
}
|
|
4845
4867
|
mouseenter(t) {
|
|
4846
4868
|
if (["index", "selection", "index-selection"].includes(t.type))
|
|
@@ -4857,12 +4879,12 @@ class Ei {
|
|
|
4857
4879
|
const rt = Math.min, U = Math.max, ft = Math.round, z = (a) => ({
|
|
4858
4880
|
x: a,
|
|
4859
4881
|
y: a
|
|
4860
|
-
}),
|
|
4882
|
+
}), bi = {
|
|
4861
4883
|
left: "right",
|
|
4862
4884
|
right: "left",
|
|
4863
4885
|
bottom: "top",
|
|
4864
4886
|
top: "bottom"
|
|
4865
|
-
},
|
|
4887
|
+
}, vi = {
|
|
4866
4888
|
start: "end",
|
|
4867
4889
|
end: "start"
|
|
4868
4890
|
};
|
|
@@ -4890,20 +4912,20 @@ function J(a) {
|
|
|
4890
4912
|
function Ht(a) {
|
|
4891
4913
|
return ae(J(a));
|
|
4892
4914
|
}
|
|
4893
|
-
function
|
|
4915
|
+
function Ri(a, t, e) {
|
|
4894
4916
|
e === void 0 && (e = !1);
|
|
4895
4917
|
const i = lt(a), s = Ht(a), r = Mt(s);
|
|
4896
4918
|
let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4897
|
-
return t.reference[r] > t.floating[r] && (o =
|
|
4919
|
+
return t.reference[r] > t.floating[r] && (o = ut(o)), [o, ut(o)];
|
|
4898
4920
|
}
|
|
4899
|
-
function
|
|
4900
|
-
const t =
|
|
4921
|
+
function Ii(a) {
|
|
4922
|
+
const t = ut(a);
|
|
4901
4923
|
return [Ot(a), t, Ot(t)];
|
|
4902
4924
|
}
|
|
4903
4925
|
function Ot(a) {
|
|
4904
|
-
return a.replace(/start|end/g, (t) =>
|
|
4926
|
+
return a.replace(/start|end/g, (t) => vi[t]);
|
|
4905
4927
|
}
|
|
4906
|
-
function
|
|
4928
|
+
function _i(a, t, e) {
|
|
4907
4929
|
const i = ["left", "right"], s = ["right", "left"], r = ["top", "bottom"], o = ["bottom", "top"];
|
|
4908
4930
|
switch (a) {
|
|
4909
4931
|
case "top":
|
|
@@ -4916,15 +4938,15 @@ function Ii(a, t, e) {
|
|
|
4916
4938
|
return [];
|
|
4917
4939
|
}
|
|
4918
4940
|
}
|
|
4919
|
-
function
|
|
4941
|
+
function Oi(a, t, e, i) {
|
|
4920
4942
|
const s = lt(a);
|
|
4921
|
-
let r =
|
|
4943
|
+
let r = _i(G(a), e === "start", i);
|
|
4922
4944
|
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
|
|
4923
4945
|
}
|
|
4924
|
-
function
|
|
4925
|
-
return a.replace(/left|right|bottom|top/g, (t) =>
|
|
4946
|
+
function ut(a) {
|
|
4947
|
+
return a.replace(/left|right|bottom|top/g, (t) => bi[t]);
|
|
4926
4948
|
}
|
|
4927
|
-
function
|
|
4949
|
+
function Li(a) {
|
|
4928
4950
|
return {
|
|
4929
4951
|
top: 0,
|
|
4930
4952
|
right: 0,
|
|
@@ -4934,14 +4956,14 @@ function Oi(a) {
|
|
|
4934
4956
|
};
|
|
4935
4957
|
}
|
|
4936
4958
|
function le(a) {
|
|
4937
|
-
return typeof a != "number" ?
|
|
4959
|
+
return typeof a != "number" ? Li(a) : {
|
|
4938
4960
|
top: a,
|
|
4939
4961
|
right: a,
|
|
4940
4962
|
bottom: a,
|
|
4941
4963
|
left: a
|
|
4942
4964
|
};
|
|
4943
4965
|
}
|
|
4944
|
-
function
|
|
4966
|
+
function xt(a) {
|
|
4945
4967
|
const {
|
|
4946
4968
|
x: t,
|
|
4947
4969
|
y: e,
|
|
@@ -4964,7 +4986,7 @@ function $t(a, t, e) {
|
|
|
4964
4986
|
reference: i,
|
|
4965
4987
|
floating: s
|
|
4966
4988
|
} = 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,
|
|
4989
|
+
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
4990
|
let g;
|
|
4969
4991
|
switch (h) {
|
|
4970
4992
|
case "top":
|
|
@@ -4999,15 +5021,15 @@ function $t(a, t, e) {
|
|
|
4999
5021
|
}
|
|
5000
5022
|
switch (lt(t)) {
|
|
5001
5023
|
case "start":
|
|
5002
|
-
g[o] -=
|
|
5024
|
+
g[o] -= u * (e && c ? -1 : 1);
|
|
5003
5025
|
break;
|
|
5004
5026
|
case "end":
|
|
5005
|
-
g[o] +=
|
|
5027
|
+
g[o] += u * (e && c ? -1 : 1);
|
|
5006
5028
|
break;
|
|
5007
5029
|
}
|
|
5008
5030
|
return g;
|
|
5009
5031
|
}
|
|
5010
|
-
const
|
|
5032
|
+
const Si = async (a, t, e) => {
|
|
5011
5033
|
const {
|
|
5012
5034
|
placement: i = "bottom",
|
|
5013
5035
|
strategy: s = "absolute",
|
|
@@ -5021,12 +5043,12 @@ const Li = async (a, t, e) => {
|
|
|
5021
5043
|
}), {
|
|
5022
5044
|
x: d,
|
|
5023
5045
|
y: f
|
|
5024
|
-
} = $t(c, i, h),
|
|
5025
|
-
for (let
|
|
5046
|
+
} = $t(c, i, h), u = i, g = {}, p = 0;
|
|
5047
|
+
for (let x = 0; x < n.length; x++) {
|
|
5026
5048
|
const {
|
|
5027
5049
|
name: w,
|
|
5028
5050
|
fn: m
|
|
5029
|
-
} = n[
|
|
5051
|
+
} = n[x], {
|
|
5030
5052
|
x: C,
|
|
5031
5053
|
y,
|
|
5032
5054
|
data: b,
|
|
@@ -5035,7 +5057,7 @@ const Li = async (a, t, e) => {
|
|
|
5035
5057
|
x: d,
|
|
5036
5058
|
y: f,
|
|
5037
5059
|
initialPlacement: i,
|
|
5038
|
-
placement:
|
|
5060
|
+
placement: u,
|
|
5039
5061
|
strategy: s,
|
|
5040
5062
|
middlewareData: g,
|
|
5041
5063
|
rects: c,
|
|
@@ -5051,19 +5073,19 @@ const Li = async (a, t, e) => {
|
|
|
5051
5073
|
...g[w],
|
|
5052
5074
|
...b
|
|
5053
5075
|
}
|
|
5054
|
-
}, E && p <= 50 && (p++, typeof E == "object" && (E.placement && (
|
|
5076
|
+
}, E && p <= 50 && (p++, typeof E == "object" && (E.placement && (u = E.placement), E.rects && (c = E.rects === !0 ? await o.getElementRects({
|
|
5055
5077
|
reference: a,
|
|
5056
5078
|
floating: t,
|
|
5057
5079
|
strategy: s
|
|
5058
5080
|
}) : E.rects), {
|
|
5059
5081
|
x: d,
|
|
5060
5082
|
y: f
|
|
5061
|
-
} = $t(c,
|
|
5083
|
+
} = $t(c, u, h)), x = -1);
|
|
5062
5084
|
}
|
|
5063
5085
|
return {
|
|
5064
5086
|
x: d,
|
|
5065
5087
|
y: f,
|
|
5066
|
-
placement:
|
|
5088
|
+
placement: u,
|
|
5067
5089
|
strategy: s,
|
|
5068
5090
|
middlewareData: g
|
|
5069
5091
|
};
|
|
@@ -5082,9 +5104,9 @@ async function he(a, t) {
|
|
|
5082
5104
|
boundary: c = "clippingAncestors",
|
|
5083
5105
|
rootBoundary: d = "viewport",
|
|
5084
5106
|
elementContext: f = "floating",
|
|
5085
|
-
altBoundary:
|
|
5107
|
+
altBoundary: u = !1,
|
|
5086
5108
|
padding: g = 0
|
|
5087
|
-
} = at(t, a), p = le(g), w = n[
|
|
5109
|
+
} = at(t, a), p = le(g), w = n[u ? f === "floating" ? "reference" : "floating" : f], m = xt(await r.getClippingRect({
|
|
5088
5110
|
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
5111
|
boundary: c,
|
|
5090
5112
|
rootBoundary: d,
|
|
@@ -5100,7 +5122,7 @@ async function he(a, t) {
|
|
|
5100
5122
|
} : {
|
|
5101
5123
|
x: 1,
|
|
5102
5124
|
y: 1
|
|
5103
|
-
}, E =
|
|
5125
|
+
}, E = xt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
5104
5126
|
elements: n,
|
|
5105
5127
|
rect: C,
|
|
5106
5128
|
offsetParent: y,
|
|
@@ -5113,7 +5135,7 @@ async function he(a, t) {
|
|
|
5113
5135
|
right: (E.right - m.right + p.right) / b.x
|
|
5114
5136
|
};
|
|
5115
5137
|
}
|
|
5116
|
-
const
|
|
5138
|
+
const Ai = (a) => ({
|
|
5117
5139
|
name: "arrow",
|
|
5118
5140
|
options: a,
|
|
5119
5141
|
async fn(t) {
|
|
@@ -5131,15 +5153,15 @@ const Si = (a) => ({
|
|
|
5131
5153
|
} = at(a, t) || {};
|
|
5132
5154
|
if (c == null)
|
|
5133
5155
|
return {};
|
|
5134
|
-
const f = le(d),
|
|
5156
|
+
const f = le(d), u = {
|
|
5135
5157
|
x: e,
|
|
5136
5158
|
y: i
|
|
5137
|
-
}, g = Ht(s), p = Mt(g),
|
|
5159
|
+
}, 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));
|
|
5138
5160
|
let _ = v ? v[y] : 0;
|
|
5139
5161
|
(!_ || !await (o.isElement == null ? void 0 : o.isElement(v))) && (_ = n.floating[y] || r.floating[p]);
|
|
5140
|
-
const L = b / 2 - E / 2, I = _ / 2 -
|
|
5162
|
+
const L = b / 2 - E / 2, I = _ / 2 - x[p] / 2 - 1, R = rt(f[m], I), A = rt(f[C], I), S = R, M = _ - x[p] - A, T = _ / 2 - x[p] / 2 + L, B = _t(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
5163
|
return {
|
|
5142
|
-
[g]:
|
|
5164
|
+
[g]: u[g] + k,
|
|
5143
5165
|
data: {
|
|
5144
5166
|
[g]: B,
|
|
5145
5167
|
centerOffset: T - B - k,
|
|
@@ -5150,7 +5172,7 @@ const Si = (a) => ({
|
|
|
5150
5172
|
reset: Y
|
|
5151
5173
|
};
|
|
5152
5174
|
}
|
|
5153
|
-
}),
|
|
5175
|
+
}), Ti = function(a) {
|
|
5154
5176
|
return a === void 0 && (a = {}), {
|
|
5155
5177
|
name: "flip",
|
|
5156
5178
|
options: a,
|
|
@@ -5166,20 +5188,20 @@ const Si = (a) => ({
|
|
|
5166
5188
|
} = t, {
|
|
5167
5189
|
mainAxis: d = !0,
|
|
5168
5190
|
crossAxis: f = !0,
|
|
5169
|
-
fallbackPlacements:
|
|
5191
|
+
fallbackPlacements: u,
|
|
5170
5192
|
fallbackStrategy: g = "bestFit",
|
|
5171
5193
|
fallbackAxisSideDirection: p = "none",
|
|
5172
|
-
flipAlignment:
|
|
5194
|
+
flipAlignment: x = !0,
|
|
5173
5195
|
...w
|
|
5174
5196
|
} = at(a, t);
|
|
5175
5197
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
5176
5198
|
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
|
-
!
|
|
5199
|
+
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)] : Ii(n)), v = p !== "none";
|
|
5200
|
+
!u && v && E.push(...Oi(n, x, p, b));
|
|
5179
5201
|
const _ = [n, ...E], L = await he(t, w), I = [];
|
|
5180
5202
|
let R = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
5181
5203
|
if (d && I.push(L[m]), f) {
|
|
5182
|
-
const T =
|
|
5204
|
+
const T = Ri(s, o, b);
|
|
5183
5205
|
I.push(L[T[0]], L[T[1]]);
|
|
5184
5206
|
}
|
|
5185
5207
|
if (R = [...R, {
|
|
@@ -5230,14 +5252,14 @@ const Si = (a) => ({
|
|
|
5230
5252
|
}
|
|
5231
5253
|
};
|
|
5232
5254
|
};
|
|
5233
|
-
async function
|
|
5255
|
+
async function Mi(a, t) {
|
|
5234
5256
|
const {
|
|
5235
5257
|
placement: e,
|
|
5236
5258
|
platform: i,
|
|
5237
5259
|
elements: s
|
|
5238
5260
|
} = 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
5261
|
let {
|
|
5240
|
-
mainAxis:
|
|
5262
|
+
mainAxis: u,
|
|
5241
5263
|
crossAxis: g,
|
|
5242
5264
|
alignmentAxis: p
|
|
5243
5265
|
} = typeof f == "number" ? {
|
|
@@ -5251,13 +5273,13 @@ async function Ti(a, t) {
|
|
|
5251
5273
|
};
|
|
5252
5274
|
return n && typeof p == "number" && (g = n === "end" ? p * -1 : p), h ? {
|
|
5253
5275
|
x: g * d,
|
|
5254
|
-
y:
|
|
5276
|
+
y: u * c
|
|
5255
5277
|
} : {
|
|
5256
|
-
x:
|
|
5278
|
+
x: u * c,
|
|
5257
5279
|
y: g * d
|
|
5258
5280
|
};
|
|
5259
5281
|
}
|
|
5260
|
-
const
|
|
5282
|
+
const Hi = function(a) {
|
|
5261
5283
|
return a === void 0 && (a = 0), {
|
|
5262
5284
|
name: "offset",
|
|
5263
5285
|
options: a,
|
|
@@ -5268,7 +5290,7 @@ const Mi = function(a) {
|
|
|
5268
5290
|
y: r,
|
|
5269
5291
|
placement: o,
|
|
5270
5292
|
middlewareData: n
|
|
5271
|
-
} = t, h = await
|
|
5293
|
+
} = t, h = await Mi(t, a);
|
|
5272
5294
|
return o === ((e = n.offset) == null ? void 0 : e.placement) && (i = n.arrow) != null && i.alignmentOffset ? {} : {
|
|
5273
5295
|
x: s + h.x,
|
|
5274
5296
|
y: r + h.y,
|
|
@@ -5279,7 +5301,7 @@ const Mi = function(a) {
|
|
|
5279
5301
|
};
|
|
5280
5302
|
}
|
|
5281
5303
|
};
|
|
5282
|
-
},
|
|
5304
|
+
}, Di = function(a) {
|
|
5283
5305
|
return a === void 0 && (a = {}), {
|
|
5284
5306
|
name: "shift",
|
|
5285
5307
|
options: a,
|
|
@@ -5307,28 +5329,28 @@ const Mi = function(a) {
|
|
|
5307
5329
|
} = at(a, t), c = {
|
|
5308
5330
|
x: e,
|
|
5309
5331
|
y: i
|
|
5310
|
-
}, d = await he(t, h), f = J(G(s)),
|
|
5311
|
-
let g = c[
|
|
5332
|
+
}, d = await he(t, h), f = J(G(s)), u = ae(f);
|
|
5333
|
+
let g = c[u], p = c[f];
|
|
5312
5334
|
if (r) {
|
|
5313
|
-
const w =
|
|
5335
|
+
const w = u === "y" ? "top" : "left", m = u === "y" ? "bottom" : "right", C = g + d[w], y = g - d[m];
|
|
5314
5336
|
g = _t(C, g, y);
|
|
5315
5337
|
}
|
|
5316
5338
|
if (o) {
|
|
5317
5339
|
const w = f === "y" ? "top" : "left", m = f === "y" ? "bottom" : "right", C = p + d[w], y = p - d[m];
|
|
5318
5340
|
p = _t(C, p, y);
|
|
5319
5341
|
}
|
|
5320
|
-
const
|
|
5342
|
+
const x = n.fn({
|
|
5321
5343
|
...t,
|
|
5322
|
-
[
|
|
5344
|
+
[u]: g,
|
|
5323
5345
|
[f]: p
|
|
5324
5346
|
});
|
|
5325
5347
|
return {
|
|
5326
|
-
...
|
|
5348
|
+
...x,
|
|
5327
5349
|
data: {
|
|
5328
|
-
x:
|
|
5329
|
-
y:
|
|
5350
|
+
x: x.x - e,
|
|
5351
|
+
y: x.y - i,
|
|
5330
5352
|
enabled: {
|
|
5331
|
-
[
|
|
5353
|
+
[u]: r,
|
|
5332
5354
|
[f]: o
|
|
5333
5355
|
}
|
|
5334
5356
|
}
|
|
@@ -5353,7 +5375,7 @@ function V(a) {
|
|
|
5353
5375
|
function ce(a) {
|
|
5354
5376
|
return gt() ? a instanceof Node || a instanceof N(a).Node : !1;
|
|
5355
5377
|
}
|
|
5356
|
-
function
|
|
5378
|
+
function F(a) {
|
|
5357
5379
|
return gt() ? a instanceof Element || a instanceof N(a).Element : !1;
|
|
5358
5380
|
}
|
|
5359
5381
|
function K(a) {
|
|
@@ -5368,10 +5390,10 @@ function ht(a) {
|
|
|
5368
5390
|
overflowX: e,
|
|
5369
5391
|
overflowY: i,
|
|
5370
5392
|
display: s
|
|
5371
|
-
} =
|
|
5393
|
+
} = X(a);
|
|
5372
5394
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
|
|
5373
5395
|
}
|
|
5374
|
-
function
|
|
5396
|
+
function Ni(a) {
|
|
5375
5397
|
return ["table", "td", "th"].includes(tt(a));
|
|
5376
5398
|
}
|
|
5377
5399
|
function wt(a) {
|
|
@@ -5384,10 +5406,10 @@ function wt(a) {
|
|
|
5384
5406
|
});
|
|
5385
5407
|
}
|
|
5386
5408
|
function Dt(a) {
|
|
5387
|
-
const t = Nt(), e =
|
|
5409
|
+
const t = Nt(), e = F(a) ? X(a) : a;
|
|
5388
5410
|
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
5411
|
}
|
|
5390
|
-
function
|
|
5412
|
+
function Fi(a) {
|
|
5391
5413
|
let t = $(a);
|
|
5392
5414
|
for (; K(t) && !Q(t); ) {
|
|
5393
5415
|
if (Dt(t))
|
|
@@ -5404,11 +5426,11 @@ function Nt() {
|
|
|
5404
5426
|
function Q(a) {
|
|
5405
5427
|
return ["html", "body", "#document"].includes(tt(a));
|
|
5406
5428
|
}
|
|
5407
|
-
function
|
|
5429
|
+
function X(a) {
|
|
5408
5430
|
return N(a).getComputedStyle(a);
|
|
5409
5431
|
}
|
|
5410
5432
|
function pt(a) {
|
|
5411
|
-
return
|
|
5433
|
+
return F(a) ? {
|
|
5412
5434
|
scrollLeft: a.scrollLeft,
|
|
5413
5435
|
scrollTop: a.scrollTop
|
|
5414
5436
|
} : {
|
|
@@ -5446,7 +5468,7 @@ function St(a) {
|
|
|
5446
5468
|
return a.parent && Object.getPrototypeOf(a.parent) ? a.frameElement : null;
|
|
5447
5469
|
}
|
|
5448
5470
|
function fe(a) {
|
|
5449
|
-
const t =
|
|
5471
|
+
const t = X(a);
|
|
5450
5472
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
5451
5473
|
const s = K(a), r = s ? a.offsetWidth : e, o = s ? a.offsetHeight : i, n = ft(e) !== r || ft(i) !== o;
|
|
5452
5474
|
return n && (e = r, i = o), {
|
|
@@ -5455,11 +5477,11 @@ function fe(a) {
|
|
|
5455
5477
|
$: n
|
|
5456
5478
|
};
|
|
5457
5479
|
}
|
|
5458
|
-
function
|
|
5459
|
-
return
|
|
5480
|
+
function ue(a) {
|
|
5481
|
+
return F(a) ? a : a.contextElement;
|
|
5460
5482
|
}
|
|
5461
5483
|
function Z(a) {
|
|
5462
|
-
const t =
|
|
5484
|
+
const t = ue(a);
|
|
5463
5485
|
if (!K(t))
|
|
5464
5486
|
return z(1);
|
|
5465
5487
|
const e = t.getBoundingClientRect(), {
|
|
@@ -5474,39 +5496,39 @@ function Z(a) {
|
|
|
5474
5496
|
};
|
|
5475
5497
|
}
|
|
5476
5498
|
const Xi = /* @__PURE__ */ z(0);
|
|
5477
|
-
function
|
|
5499
|
+
function xe(a) {
|
|
5478
5500
|
const t = N(a);
|
|
5479
5501
|
return !Nt() || !t.visualViewport ? Xi : {
|
|
5480
5502
|
x: t.visualViewport.offsetLeft,
|
|
5481
5503
|
y: t.visualViewport.offsetTop
|
|
5482
5504
|
};
|
|
5483
5505
|
}
|
|
5484
|
-
function
|
|
5506
|
+
function Bi(a, t, e) {
|
|
5485
5507
|
return t === void 0 && (t = !1), !e || t && e !== N(a) ? !1 : t;
|
|
5486
5508
|
}
|
|
5487
5509
|
function ot(a, t, e, i) {
|
|
5488
5510
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
5489
|
-
const s = a.getBoundingClientRect(), r =
|
|
5511
|
+
const s = a.getBoundingClientRect(), r = ue(a);
|
|
5490
5512
|
let o = z(1);
|
|
5491
|
-
t && (i ?
|
|
5492
|
-
const n =
|
|
5513
|
+
t && (i ? F(i) && (o = Z(i)) : o = Z(a));
|
|
5514
|
+
const n = Bi(r, e, i) ? xe(r) : z(0);
|
|
5493
5515
|
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
5516
|
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(
|
|
5517
|
+
const u = N(r), g = i && F(i) ? N(i) : i;
|
|
5518
|
+
let p = u, x = St(p);
|
|
5519
|
+
for (; x && i && g !== p; ) {
|
|
5520
|
+
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;
|
|
5521
|
+
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b, p = N(x), x = St(p);
|
|
5500
5522
|
}
|
|
5501
5523
|
}
|
|
5502
|
-
return
|
|
5524
|
+
return xt({
|
|
5503
5525
|
width: d,
|
|
5504
5526
|
height: f,
|
|
5505
5527
|
x: h,
|
|
5506
5528
|
y: c
|
|
5507
5529
|
});
|
|
5508
5530
|
}
|
|
5509
|
-
function
|
|
5531
|
+
function ki(a) {
|
|
5510
5532
|
let {
|
|
5511
5533
|
elements: t,
|
|
5512
5534
|
rect: e,
|
|
@@ -5522,8 +5544,8 @@ function Bi(a) {
|
|
|
5522
5544
|
}, c = z(1);
|
|
5523
5545
|
const d = z(0), f = K(i);
|
|
5524
5546
|
if ((f || !f && !r) && ((tt(i) !== "body" || ht(o)) && (h = pt(i)), K(i))) {
|
|
5525
|
-
const
|
|
5526
|
-
c = Z(i), d.x =
|
|
5547
|
+
const u = ot(i);
|
|
5548
|
+
c = Z(i), d.x = u.x + i.clientLeft, d.y = u.y + i.clientTop;
|
|
5527
5549
|
}
|
|
5528
5550
|
return {
|
|
5529
5551
|
width: e.width * c.x,
|
|
@@ -5532,25 +5554,25 @@ function Bi(a) {
|
|
|
5532
5554
|
y: e.y * c.y - h.scrollTop * c.y + d.y
|
|
5533
5555
|
};
|
|
5534
5556
|
}
|
|
5535
|
-
function
|
|
5557
|
+
function Ki(a) {
|
|
5536
5558
|
return Array.from(a.getClientRects());
|
|
5537
5559
|
}
|
|
5538
5560
|
function At(a, t) {
|
|
5539
5561
|
const e = pt(a).scrollLeft;
|
|
5540
5562
|
return t ? t.left + e : ot(V(a)).left + e;
|
|
5541
5563
|
}
|
|
5542
|
-
function
|
|
5564
|
+
function Yi(a) {
|
|
5543
5565
|
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
5566
|
let o = -e.scrollLeft + At(a);
|
|
5545
5567
|
const n = -e.scrollTop;
|
|
5546
|
-
return
|
|
5568
|
+
return X(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
|
|
5547
5569
|
width: s,
|
|
5548
5570
|
height: r,
|
|
5549
5571
|
x: o,
|
|
5550
5572
|
y: n
|
|
5551
5573
|
};
|
|
5552
5574
|
}
|
|
5553
|
-
function
|
|
5575
|
+
function Vi(a, t) {
|
|
5554
5576
|
const e = N(a), i = V(a), s = e.visualViewport;
|
|
5555
5577
|
let r = i.clientWidth, o = i.clientHeight, n = 0, h = 0;
|
|
5556
5578
|
if (s) {
|
|
@@ -5565,7 +5587,7 @@ function Yi(a, t) {
|
|
|
5565
5587
|
y: h
|
|
5566
5588
|
};
|
|
5567
5589
|
}
|
|
5568
|
-
function
|
|
5590
|
+
function Wi(a, t) {
|
|
5569
5591
|
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
5592
|
return {
|
|
5571
5593
|
width: o,
|
|
@@ -5577,46 +5599,46 @@ function Vi(a, t) {
|
|
|
5577
5599
|
function Gt(a, t, e) {
|
|
5578
5600
|
let i;
|
|
5579
5601
|
if (t === "viewport")
|
|
5580
|
-
i =
|
|
5602
|
+
i = Vi(a, e);
|
|
5581
5603
|
else if (t === "document")
|
|
5582
|
-
i =
|
|
5583
|
-
else if (
|
|
5584
|
-
i =
|
|
5604
|
+
i = Yi(V(a));
|
|
5605
|
+
else if (F(t))
|
|
5606
|
+
i = Wi(t, e);
|
|
5585
5607
|
else {
|
|
5586
|
-
const s =
|
|
5608
|
+
const s = xe(a);
|
|
5587
5609
|
i = {
|
|
5588
5610
|
...t,
|
|
5589
5611
|
x: t.x - s.x,
|
|
5590
5612
|
y: t.y - s.y
|
|
5591
5613
|
};
|
|
5592
5614
|
}
|
|
5593
|
-
return
|
|
5615
|
+
return xt(i);
|
|
5594
5616
|
}
|
|
5595
5617
|
function ge(a, t) {
|
|
5596
5618
|
const e = $(a);
|
|
5597
|
-
return e === t || !
|
|
5619
|
+
return e === t || !F(e) || Q(e) ? !1 : X(e).position === "fixed" || ge(e, t);
|
|
5598
5620
|
}
|
|
5599
|
-
function
|
|
5621
|
+
function Pi(a, t) {
|
|
5600
5622
|
const e = t.get(a);
|
|
5601
5623
|
if (e)
|
|
5602
5624
|
return e;
|
|
5603
|
-
let i = Lt(a, [], !1).filter((n) =>
|
|
5604
|
-
const r =
|
|
5625
|
+
let i = Lt(a, [], !1).filter((n) => F(n) && tt(n) !== "body"), s = null;
|
|
5626
|
+
const r = X(a).position === "fixed";
|
|
5605
5627
|
let o = r ? $(a) : a;
|
|
5606
|
-
for (;
|
|
5607
|
-
const n =
|
|
5628
|
+
for (; F(o) && !Q(o); ) {
|
|
5629
|
+
const n = X(o), h = Dt(o);
|
|
5608
5630
|
!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
5631
|
}
|
|
5610
5632
|
return t.set(a, i), i;
|
|
5611
5633
|
}
|
|
5612
|
-
function
|
|
5634
|
+
function zi(a) {
|
|
5613
5635
|
let {
|
|
5614
5636
|
element: t,
|
|
5615
5637
|
boundary: e,
|
|
5616
5638
|
rootBoundary: i,
|
|
5617
5639
|
strategy: s
|
|
5618
5640
|
} = a;
|
|
5619
|
-
const o = [...e === "clippingAncestors" ? wt(t) ? [] :
|
|
5641
|
+
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Pi(t, this._c) : [].concat(e), i], n = o[0], h = o.reduce((c, d) => {
|
|
5620
5642
|
const f = Gt(t, d, s);
|
|
5621
5643
|
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
5644
|
}, Gt(t, n, s));
|
|
@@ -5627,7 +5649,7 @@ function Pi(a) {
|
|
|
5627
5649
|
y: h.top
|
|
5628
5650
|
};
|
|
5629
5651
|
}
|
|
5630
|
-
function
|
|
5652
|
+
function $i(a) {
|
|
5631
5653
|
const {
|
|
5632
5654
|
width: t,
|
|
5633
5655
|
height: e
|
|
@@ -5637,7 +5659,7 @@ function zi(a) {
|
|
|
5637
5659
|
height: e
|
|
5638
5660
|
};
|
|
5639
5661
|
}
|
|
5640
|
-
function
|
|
5662
|
+
function qi(a, t, e) {
|
|
5641
5663
|
const i = K(t), s = V(t), r = e === "fixed", o = ot(a, !0, r, t);
|
|
5642
5664
|
let n = {
|
|
5643
5665
|
scrollLeft: 0,
|
|
@@ -5655,19 +5677,19 @@ function $i(a, t, e) {
|
|
|
5655
5677
|
d = g.top + n.scrollTop, c = g.left + n.scrollLeft - // RTL <body> scrollbar.
|
|
5656
5678
|
At(s, g);
|
|
5657
5679
|
}
|
|
5658
|
-
const f = o.left + n.scrollLeft - h.x - c,
|
|
5680
|
+
const f = o.left + n.scrollLeft - h.x - c, u = o.top + n.scrollTop - h.y - d;
|
|
5659
5681
|
return {
|
|
5660
5682
|
x: f,
|
|
5661
|
-
y:
|
|
5683
|
+
y: u,
|
|
5662
5684
|
width: o.width,
|
|
5663
5685
|
height: o.height
|
|
5664
5686
|
};
|
|
5665
5687
|
}
|
|
5666
5688
|
function yt(a) {
|
|
5667
|
-
return
|
|
5689
|
+
return X(a).position === "static";
|
|
5668
5690
|
}
|
|
5669
5691
|
function jt(a, t) {
|
|
5670
|
-
if (!K(a) ||
|
|
5692
|
+
if (!K(a) || X(a).position === "fixed")
|
|
5671
5693
|
return null;
|
|
5672
5694
|
if (t)
|
|
5673
5695
|
return t(a);
|
|
@@ -5681,21 +5703,21 @@ function we(a, t) {
|
|
|
5681
5703
|
if (!K(a)) {
|
|
5682
5704
|
let s = $(a);
|
|
5683
5705
|
for (; s && !Q(s); ) {
|
|
5684
|
-
if (
|
|
5706
|
+
if (F(s) && !yt(s))
|
|
5685
5707
|
return s;
|
|
5686
5708
|
s = $(s);
|
|
5687
5709
|
}
|
|
5688
5710
|
return e;
|
|
5689
5711
|
}
|
|
5690
5712
|
let i = jt(a, t);
|
|
5691
|
-
for (; i &&
|
|
5713
|
+
for (; i && Ni(i) && yt(i); )
|
|
5692
5714
|
i = jt(i, t);
|
|
5693
|
-
return i && Q(i) && yt(i) && !Dt(i) ? e : i ||
|
|
5715
|
+
return i && Q(i) && yt(i) && !Dt(i) ? e : i || Fi(a) || e;
|
|
5694
5716
|
}
|
|
5695
|
-
const
|
|
5717
|
+
const Gi = async function(a) {
|
|
5696
5718
|
const t = this.getOffsetParent || we, e = this.getDimensions, i = await e(a.floating);
|
|
5697
5719
|
return {
|
|
5698
|
-
reference:
|
|
5720
|
+
reference: qi(a.reference, await t(a.floating), a.strategy),
|
|
5699
5721
|
floating: {
|
|
5700
5722
|
x: 0,
|
|
5701
5723
|
y: 0,
|
|
@@ -5704,34 +5726,34 @@ const qi = async function(a) {
|
|
|
5704
5726
|
}
|
|
5705
5727
|
};
|
|
5706
5728
|
};
|
|
5707
|
-
function
|
|
5708
|
-
return
|
|
5729
|
+
function ji(a) {
|
|
5730
|
+
return X(a).direction === "rtl";
|
|
5709
5731
|
}
|
|
5710
|
-
const
|
|
5711
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
5732
|
+
const Ui = {
|
|
5733
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ki,
|
|
5712
5734
|
getDocumentElement: V,
|
|
5713
|
-
getClippingRect:
|
|
5735
|
+
getClippingRect: zi,
|
|
5714
5736
|
getOffsetParent: we,
|
|
5715
|
-
getElementRects:
|
|
5716
|
-
getClientRects:
|
|
5717
|
-
getDimensions:
|
|
5737
|
+
getElementRects: Gi,
|
|
5738
|
+
getClientRects: Ki,
|
|
5739
|
+
getDimensions: $i,
|
|
5718
5740
|
getScale: Z,
|
|
5719
|
-
isElement:
|
|
5720
|
-
isRTL:
|
|
5721
|
-
}, pe =
|
|
5741
|
+
isElement: F,
|
|
5742
|
+
isRTL: ji
|
|
5743
|
+
}, pe = Hi, me = Di, ye = Ti, Zi = Ai, Ee = (a, t, e) => {
|
|
5722
5744
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
5723
|
-
platform:
|
|
5745
|
+
platform: Ui,
|
|
5724
5746
|
...e
|
|
5725
5747
|
}, r = {
|
|
5726
5748
|
...s.platform,
|
|
5727
5749
|
_c: i
|
|
5728
5750
|
};
|
|
5729
|
-
return
|
|
5751
|
+
return Si(a, t, {
|
|
5730
5752
|
...s,
|
|
5731
5753
|
platform: r
|
|
5732
5754
|
});
|
|
5733
5755
|
};
|
|
5734
|
-
let
|
|
5756
|
+
let Ji = class {
|
|
5735
5757
|
constructor(t) {
|
|
5736
5758
|
l(this, "ctx");
|
|
5737
5759
|
l(this, "enable", !1);
|
|
@@ -5803,33 +5825,33 @@ let Zi = class {
|
|
|
5803
5825
|
}
|
|
5804
5826
|
}, this.floatingEl, {
|
|
5805
5827
|
placement: t.overflowTooltipPlacement,
|
|
5806
|
-
middleware: [me(), ye(), pe(6),
|
|
5828
|
+
middleware: [me(), ye(), pe(6), Zi({ element: this.arrowEl })]
|
|
5807
5829
|
}).then((n) => {
|
|
5808
5830
|
const { x: h, y: c, placement: d, middlewareData: f } = n;
|
|
5809
5831
|
if (Object.assign(this.floatingEl.style, {
|
|
5810
5832
|
top: `${c}px`,
|
|
5811
5833
|
left: `${h}px`
|
|
5812
5834
|
}), f.arrow) {
|
|
5813
|
-
const
|
|
5835
|
+
const u = f.arrow;
|
|
5814
5836
|
["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5815
|
-
top: `${
|
|
5837
|
+
top: `${u.y}px`,
|
|
5816
5838
|
bottom: "",
|
|
5817
5839
|
left: "",
|
|
5818
5840
|
right: "-5px"
|
|
5819
5841
|
}) : ["right", "right-start", "right-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5820
|
-
top: `${
|
|
5842
|
+
top: `${u.y}px`,
|
|
5821
5843
|
bottom: "",
|
|
5822
5844
|
left: "-5px",
|
|
5823
5845
|
right: ""
|
|
5824
5846
|
}) : ["bottom", "bottom-start", "bottom-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5825
5847
|
top: "-5px",
|
|
5826
5848
|
bottom: "",
|
|
5827
|
-
left: `${
|
|
5849
|
+
left: `${u.x}px`,
|
|
5828
5850
|
right: ""
|
|
5829
5851
|
}) : ["top", "top-start", "top-end"].includes(d) && Object.assign(this.arrowEl.style, {
|
|
5830
5852
|
top: "",
|
|
5831
5853
|
bottom: "-5px",
|
|
5832
|
-
left: `${
|
|
5854
|
+
left: `${u.x}px`,
|
|
5833
5855
|
right: ""
|
|
5834
5856
|
});
|
|
5835
5857
|
}
|
|
@@ -5842,7 +5864,7 @@ let Zi = class {
|
|
|
5842
5864
|
this.contentEl.remove(), this.arrowEl.remove(), this.floatingEl.remove();
|
|
5843
5865
|
}
|
|
5844
5866
|
};
|
|
5845
|
-
class
|
|
5867
|
+
class Qi {
|
|
5846
5868
|
constructor(t) {
|
|
5847
5869
|
l(this, "editorEl");
|
|
5848
5870
|
l(this, "inputEl");
|
|
@@ -5993,8 +6015,8 @@ class Ji {
|
|
|
5993
6015
|
let f = this.ctx.body.visibleHeight;
|
|
5994
6016
|
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
6017
|
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(
|
|
6018
|
+
const u = this.inputEl.value.length;
|
|
6019
|
+
this.inputEl.setSelectionRange(u, u);
|
|
5998
6020
|
} else
|
|
5999
6021
|
this.inputEl.style.display = "none";
|
|
6000
6022
|
(this.inputEl.scrollHeight > r || this.drawY < d.height) && this.autoSize();
|
|
@@ -6044,7 +6066,7 @@ class Ji {
|
|
|
6044
6066
|
(t = this.editorEl) == null || t.remove();
|
|
6045
6067
|
}
|
|
6046
6068
|
}
|
|
6047
|
-
class
|
|
6069
|
+
class ts {
|
|
6048
6070
|
constructor(t) {
|
|
6049
6071
|
l(this, "ctx");
|
|
6050
6072
|
l(this, "emptyEl");
|
|
@@ -6068,7 +6090,7 @@ class Qi {
|
|
|
6068
6090
|
this.emptyEl.remove();
|
|
6069
6091
|
}
|
|
6070
6092
|
}
|
|
6071
|
-
class
|
|
6093
|
+
class es {
|
|
6072
6094
|
constructor(t) {
|
|
6073
6095
|
l(this, "ctx");
|
|
6074
6096
|
this.ctx = t;
|
|
@@ -6101,7 +6123,7 @@ class ts {
|
|
|
6101
6123
|
n.forEach((w) => {
|
|
6102
6124
|
w.render && (w.fixed === "left" ? c.push(w) : w.fixed === "right" ? d.push(w) : h.push(w));
|
|
6103
6125
|
});
|
|
6104
|
-
const f = e - i,
|
|
6126
|
+
const f = e - i, u = {
|
|
6105
6127
|
key: "left",
|
|
6106
6128
|
style: {
|
|
6107
6129
|
position: "absolute",
|
|
@@ -6144,7 +6166,7 @@ class ts {
|
|
|
6144
6166
|
width: `${r}px`,
|
|
6145
6167
|
height: `${o}px`
|
|
6146
6168
|
},
|
|
6147
|
-
views: [
|
|
6169
|
+
views: [u, g, p]
|
|
6148
6170
|
};
|
|
6149
6171
|
}
|
|
6150
6172
|
getBody() {
|
|
@@ -6159,7 +6181,7 @@ class ts {
|
|
|
6159
6181
|
fixedLeftWidth: r,
|
|
6160
6182
|
fixedRightWidth: o,
|
|
6161
6183
|
config: { SCROLLER_TRACK_SIZE: n, CSS_PREFIX: h }
|
|
6162
|
-
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - n,
|
|
6184
|
+
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - n, u = {
|
|
6163
6185
|
key: "left",
|
|
6164
6186
|
style: {
|
|
6165
6187
|
position: "absolute",
|
|
@@ -6202,13 +6224,13 @@ class ts {
|
|
|
6202
6224
|
width: `${c}px`,
|
|
6203
6225
|
height: `${d}px`
|
|
6204
6226
|
},
|
|
6205
|
-
views: [
|
|
6227
|
+
views: [u, g, p]
|
|
6206
6228
|
};
|
|
6207
6229
|
}
|
|
6208
6230
|
getFooter() {
|
|
6209
6231
|
const t = [], e = [], i = [];
|
|
6210
|
-
this.ctx.footer.renderRows.forEach((
|
|
6211
|
-
|
|
6232
|
+
this.ctx.footer.renderRows.forEach((x) => {
|
|
6233
|
+
x.cells.forEach((w) => {
|
|
6212
6234
|
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
6235
|
});
|
|
6214
6236
|
});
|
|
@@ -6227,7 +6249,7 @@ class ts {
|
|
|
6227
6249
|
height: `${c}px`
|
|
6228
6250
|
},
|
|
6229
6251
|
cells: e
|
|
6230
|
-
},
|
|
6252
|
+
}, u = {
|
|
6231
6253
|
key: "center",
|
|
6232
6254
|
style: {
|
|
6233
6255
|
position: "absolute",
|
|
@@ -6259,11 +6281,11 @@ class ts {
|
|
|
6259
6281
|
width: `${h}px`,
|
|
6260
6282
|
height: `${c}px`
|
|
6261
6283
|
},
|
|
6262
|
-
views: [f,
|
|
6284
|
+
views: [f, u, g]
|
|
6263
6285
|
};
|
|
6264
6286
|
}
|
|
6265
6287
|
}
|
|
6266
|
-
class
|
|
6288
|
+
class is {
|
|
6267
6289
|
constructor(t) {
|
|
6268
6290
|
l(this, "ctx");
|
|
6269
6291
|
l(this, "contextMenuEl");
|
|
@@ -6276,7 +6298,7 @@ class es {
|
|
|
6276
6298
|
e.preventDefault();
|
|
6277
6299
|
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [n, h] = s, { rowIndex: c, colIndex: d } = t;
|
|
6278
6300
|
c >= n && c <= h && d >= r && d <= o || this.ctx.emit("setSelectorCell", t, e);
|
|
6279
|
-
const
|
|
6301
|
+
const u = {
|
|
6280
6302
|
getBoundingClientRect: () => ({
|
|
6281
6303
|
width: 0,
|
|
6282
6304
|
height: 0,
|
|
@@ -6289,7 +6311,7 @@ class es {
|
|
|
6289
6311
|
}),
|
|
6290
6312
|
contextElement: document.body
|
|
6291
6313
|
};
|
|
6292
|
-
Ee(
|
|
6314
|
+
Ee(u, this.contextMenuEl, {
|
|
6293
6315
|
placement: "right-start",
|
|
6294
6316
|
middleware: [pe(), me(), ye()]
|
|
6295
6317
|
}).then(({ x: g, y: p }) => {
|
|
@@ -6347,7 +6369,7 @@ class es {
|
|
|
6347
6369
|
this.contextMenuEl.remove();
|
|
6348
6370
|
}
|
|
6349
6371
|
}
|
|
6350
|
-
class
|
|
6372
|
+
class os {
|
|
6351
6373
|
constructor(t, e) {
|
|
6352
6374
|
l(this, "options");
|
|
6353
6375
|
l(this, "scroller");
|
|
@@ -6370,7 +6392,7 @@ class rs {
|
|
|
6370
6392
|
r,
|
|
6371
6393
|
o
|
|
6372
6394
|
);
|
|
6373
|
-
this.ctx = new
|
|
6395
|
+
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
6396
|
this.draw();
|
|
6375
6397
|
}), this.ctx.on("drawView", () => {
|
|
6376
6398
|
this.draw(!0);
|
|
@@ -6602,6 +6624,6 @@ class rs {
|
|
|
6602
6624
|
}
|
|
6603
6625
|
}
|
|
6604
6626
|
export {
|
|
6605
|
-
|
|
6627
|
+
os as default
|
|
6606
6628
|
};
|
|
6607
6629
|
//# sourceMappingURL=index.es.js.map
|