e-virt-table 1.2.9 → 1.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +267 -265
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Body.js +5 -3
- package/dist/lib/Body.js.map +1 -1
- package/dist/lib/Paint.js +1 -0
- package/dist/lib/Paint.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -159,28 +159,28 @@ var Ft = /* @__PURE__ */ function(a) {
|
|
|
159
159
|
}(/* @__PURE__ */ Ct(Error));
|
|
160
160
|
function Ae(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 m = function(p) {
|
|
164
|
-
return i(p), p.length ? g(new Ft(p, bt(p))) :
|
|
165
|
-
},
|
|
166
|
-
Nt(
|
|
164
|
+
return i(p), p.length ? g(new Ft(p, bt(p))) : u(s);
|
|
165
|
+
}, x = Te(a);
|
|
166
|
+
Nt(x, e, m);
|
|
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 m = function(w) {
|
|
174
174
|
if (d.push.apply(d, w), c++, c === h)
|
|
175
|
-
return i(d), d.length ? g(new Ft(d, bt(d))) :
|
|
175
|
+
return i(d), d.length ? g(new Ft(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 ? Nt(w, e, m) : Se(w, e, m);
|
|
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]+)", m = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", x = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", p = '(?:[/?#][^\\s"]*)?', C = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + u + "|" + g + m + x + ")" + w + p;
|
|
246
246
|
return ct = new RegExp("(?:^" + C + "$)", "i"), ct;
|
|
247
247
|
}, Kt = {
|
|
248
248
|
// http://emailregex.com/
|
|
@@ -300,8 +300,8 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
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
302
|
}, Fe = 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,
|
|
304
|
-
if (
|
|
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", m = Array.isArray(e);
|
|
304
|
+
if (u ? f = "number" : g ? f = "string" : m && (f = "array"), !f)
|
|
305
305
|
return !1;
|
|
306
306
|
m && (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) {
|
|
@@ -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 = [], p = {};
|
|
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 ? (p = bt(w), c(w, p)) : 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], p = n[x];
|
|
560
560
|
w.forEach(function(C) {
|
|
561
561
|
var y = C;
|
|
562
|
-
typeof y.transform == "function" && (n === i && (n = q({}, n)), p = n[
|
|
562
|
+
typeof y.transform == "function" && (n === i && (n = q({}, n)), p = n[x] = y.transform(p)), 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: p,
|
|
567
567
|
source: n,
|
|
568
|
-
field:
|
|
568
|
+
field: x
|
|
569
569
|
}));
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
572
|
var m = {};
|
|
573
|
-
return Ae(
|
|
574
|
-
var p =
|
|
575
|
-
C = C && (p.required || !p.required &&
|
|
573
|
+
return Ae(u, h, function(x, w) {
|
|
574
|
+
var p = x.rule, C = (p.type === "object" || p.type === "array") && (typeof p.fields == "object" || typeof p.defaultField == "object");
|
|
575
|
+
C = C && (p.required || !p.required && x.value), p.field = x.field;
|
|
576
576
|
function y(R, O) {
|
|
577
577
|
return q({}, O, {
|
|
578
578
|
fullField: p.fullField + "." + R,
|
|
@@ -589,19 +589,19 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
589
589
|
if (!C)
|
|
590
590
|
w(I);
|
|
591
591
|
else {
|
|
592
|
-
if (p.required && !
|
|
592
|
+
if (p.required && !x.value)
|
|
593
593
|
return p.message !== void 0 ? I = [].concat(p.message).map(Bt(p, n)) : h.error && (I = [h.error(p, D(h.messages.required, p.field))]), w(I);
|
|
594
594
|
var _ = {};
|
|
595
|
-
p.defaultField && Object.keys(
|
|
595
|
+
p.defaultField && Object.keys(x.value).map(function(T) {
|
|
596
596
|
_[T] = p.defaultField;
|
|
597
|
-
}), _ = q({}, _,
|
|
597
|
+
}), _ = q({}, _, x.rule.fields);
|
|
598
598
|
var v = {};
|
|
599
599
|
Object.keys(_).forEach(function(T) {
|
|
600
600
|
var M = _[T], A = Array.isArray(M) ? M : [M];
|
|
601
601
|
v[T] = A.map(y.bind(null, T));
|
|
602
602
|
});
|
|
603
603
|
var S = new a(v);
|
|
604
|
-
S.messages(h.messages),
|
|
604
|
+
S.messages(h.messages), x.rule.options && (x.rule.options.messages = h.messages, x.rule.options.error = h.error), S.validate(x.value, x.rule.options || h, function(T) {
|
|
605
605
|
var M = [];
|
|
606
606
|
I && I.length && M.push.apply(M, I), T && T.length && M.push.apply(M, T), 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 (p.asyncValidator)
|
|
612
|
-
E = p.asyncValidator(p,
|
|
612
|
+
E = p.asyncValidator(p, x.value, b, x.source, h);
|
|
613
613
|
else if (p.validator) {
|
|
614
614
|
try {
|
|
615
|
-
E = p.validator(p,
|
|
615
|
+
E = p.validator(p, x.value, b, x.source, h);
|
|
616
616
|
} catch (R) {
|
|
617
617
|
console.error == null || console.error(R), h.suppressValidatorError || setTimeout(function() {
|
|
618
618
|
throw R;
|
|
@@ -625,8 +625,8 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
625
625
|
}, function(R) {
|
|
626
626
|
return b(R);
|
|
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))
|
|
@@ -1019,19 +1019,19 @@ class At extends re {
|
|
|
1019
1019
|
const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
|
|
1020
1020
|
let r, o = 0, n = "";
|
|
1021
1021
|
if (this.type === "tree" && s === "body") {
|
|
1022
|
-
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 || {};
|
|
1023
1023
|
if (this.rowExpand = c, this.rowHasChildren = d, f) {
|
|
1024
|
-
const
|
|
1025
|
-
n = "loading", r =
|
|
1024
|
+
const x = this.ctx.icons.get("loading");
|
|
1025
|
+
n = "loading", r = x, o = u * 8;
|
|
1026
1026
|
} else if (d) {
|
|
1027
|
-
const
|
|
1028
|
-
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;
|
|
1029
1029
|
} else
|
|
1030
|
-
o =
|
|
1030
|
+
o = u * 8;
|
|
1031
1031
|
let g = 20, m = 20;
|
|
1032
1032
|
if (r) {
|
|
1033
|
-
let
|
|
1034
|
-
this.ctx.paint.drawImage(r,
|
|
1033
|
+
let x = this.drawX + o + e, w = this.drawY + (this.visibleHeight - m) / 2;
|
|
1034
|
+
this.ctx.paint.drawImage(r, x, w, g, m), this.drawImageX = x, this.drawImageY = w, this.drawImageWidth = g, this.drawImageHeight = m, this.drawImageName = n, this.drawImageSource = r;
|
|
1035
1035
|
}
|
|
1036
1036
|
this.align = "left", this.drawTextX = o + this.drawX + g - 0.5;
|
|
1037
1037
|
}
|
|
@@ -1048,10 +1048,10 @@ class At extends re {
|
|
|
1048
1048
|
FOOTER_BG_COLOR: c,
|
|
1049
1049
|
HIGHLIGHT_SELECTED_ROW: d,
|
|
1050
1050
|
HIGHLIGHT_SELECTED_ROW_COLOR: f,
|
|
1051
|
-
HIGHLIGHT_HOVER_ROW:
|
|
1051
|
+
HIGHLIGHT_HOVER_ROW: u,
|
|
1052
1052
|
HIGHLIGHT_HOVER_ROW_COLOR: g,
|
|
1053
1053
|
STRIPE: m,
|
|
1054
|
-
STRIPE_COLOR:
|
|
1054
|
+
STRIPE_COLOR: x
|
|
1055
1055
|
} = this.ctx.config;
|
|
1056
1056
|
if (this.cellType === "footer") {
|
|
1057
1057
|
let O = c, I = h;
|
|
@@ -1071,13 +1071,13 @@ class At extends re {
|
|
|
1071
1071
|
let w = "transparent";
|
|
1072
1072
|
const p = this.ctx.focusCell, C = this.ctx.hoverCell;
|
|
1073
1073
|
let y = this.rowIndex, b = this.rowIndex;
|
|
1074
|
-
if (this.rowspan !== 1 && (
|
|
1074
|
+
if (this.rowspan !== 1 && (u || d)) {
|
|
1075
1075
|
const O = this.getSpanInfo(), { yArr: I } = O;
|
|
1076
1076
|
y = I[0], b = I[1];
|
|
1077
1077
|
}
|
|
1078
|
-
|
|
1078
|
+
u && C && (C.rowKey === this.rowKey && (w = g), C.rowIndex >= y && C.rowIndex <= b && (w = g)), d && p && (p.rowKey === this.rowKey && (w = f), p.rowIndex >= y && p.rowIndex <= b && (w = f)), this.drawCellSkyBgColor = w;
|
|
1079
1079
|
let E = e, R = n;
|
|
1080
|
-
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (E = i, R = o), m && (this.rowIndex % 2 ? E =
|
|
1080
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (E = i, R = o), m && (this.rowIndex % 2 ? E = x : E = e), typeof s == "function") {
|
|
1081
1081
|
const O = s, { backgroundColor: I, color: _ } = O({
|
|
1082
1082
|
row: this.row,
|
|
1083
1083
|
rowIndex: this.rowIndex,
|
|
@@ -1093,9 +1093,9 @@ class At extends re {
|
|
|
1093
1093
|
updateSelection() {
|
|
1094
1094
|
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: n, rowIndex: h, rowKey: c } = this;
|
|
1095
1095
|
if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(n)) {
|
|
1096
|
-
const d = this.ctx.database.getRowSelection(c), f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE:
|
|
1097
|
-
let
|
|
1098
|
-
d && f ? (
|
|
1096
|
+
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, m = this.drawY + (i - u) / 2;
|
|
1097
|
+
let x = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck";
|
|
1098
|
+
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 = m, this.drawImageWidth = u, this.drawImageHeight = u, this.drawImageName = w, this.drawImageSource = x) : x && n === "selection" && (this.drawImageX = g, this.drawImageY = m, this.drawImageWidth = u, this.drawImageHeight = u, this.drawImageName = w, this.drawImageSource = x);
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
1101
|
updateHoverIcon() {
|
|
@@ -1116,10 +1116,10 @@ class At extends re {
|
|
|
1116
1116
|
if (this.hoverIconName && !this.ctx.editing && n) {
|
|
1117
1117
|
let h = 0, c = 0;
|
|
1118
1118
|
if (n.rowKey === this.rowKey && (h = this.drawX + this.width - s - r, c = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && o) {
|
|
1119
|
-
const f = this.getSpanInfo(), { yArr:
|
|
1119
|
+
const f = this.getSpanInfo(), { yArr: u } = f, g = u[0], m = u[1];
|
|
1120
1120
|
if (n.rowIndex >= g && n.rowIndex <= m) {
|
|
1121
|
-
const { width:
|
|
1122
|
-
h = this.drawX - C +
|
|
1121
|
+
const { width: x, height: w, offsetTop: p, offsetLeft: C } = f;
|
|
1122
|
+
h = this.drawX - C + x - s - r, c = this.drawY - p + (w - s) / 2;
|
|
1123
1123
|
}
|
|
1124
1124
|
}
|
|
1125
1125
|
const d = this.ctx.icons.get(this.hoverIconName);
|
|
@@ -1218,10 +1218,10 @@ class At extends re {
|
|
|
1218
1218
|
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: r } = this.ctx.config;
|
|
1219
1219
|
if (!s || !i || this.ctx.editing)
|
|
1220
1220
|
return;
|
|
1221
|
-
const { xArr: o, yArr: n } = this.ctx.selector, h = o[1], c = n[1], { colIndex: d, rowIndex: f, drawX:
|
|
1221
|
+
const { xArr: o, yArr: n } = this.ctx.selector, h = o[1], c = n[1], { colIndex: d, rowIndex: f, drawX: u, drawY: g } = this;
|
|
1222
1222
|
if (d === h && f === c) {
|
|
1223
|
-
const
|
|
1224
|
-
this.ctx.paint.drawRect(
|
|
1223
|
+
const x = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
|
|
1224
|
+
this.ctx.paint.drawRect(u + this.width - x, g + this.height - x, 6, 6, {
|
|
1225
1225
|
borderColor: r,
|
|
1226
1226
|
fillColor: e
|
|
1227
1227
|
});
|
|
@@ -1348,11 +1348,11 @@ class At extends re {
|
|
|
1348
1348
|
drawBorder(e) {
|
|
1349
1349
|
const { drawX: i, drawY: s, rowIndex: r, colIndex: o, height: n, width: h } = this;
|
|
1350
1350
|
let c = i, d = s;
|
|
1351
|
-
const { xArr: f, yArr:
|
|
1351
|
+
const { xArr: f, yArr: u, lineDash: g = [], borderWidth: m = 1, borderColor: x, fillColor: w } = e, p = f[0], C = f[1], y = u[0], b = u[1];
|
|
1352
1352
|
if (o >= p && o <= C && r === y) {
|
|
1353
1353
|
const E = o === C ? 1 : 0, R = o === p ? 1 : 0;
|
|
1354
1354
|
this.ctx.paint.drawLine([c + R, d + 1, c + h - E, d + 1], {
|
|
1355
|
-
borderColor:
|
|
1355
|
+
borderColor: x,
|
|
1356
1356
|
fillColor: w,
|
|
1357
1357
|
borderWidth: m,
|
|
1358
1358
|
lineCap: "round",
|
|
@@ -1363,7 +1363,7 @@ class At extends re {
|
|
|
1363
1363
|
if (o === C && r >= y && r <= b) {
|
|
1364
1364
|
const E = r === y ? 1 : 0, R = r === b ? 1 : 0;
|
|
1365
1365
|
this.ctx.paint.drawLine([c + h - 1, d + E, c + h - 1, d + n - R], {
|
|
1366
|
-
borderColor:
|
|
1366
|
+
borderColor: x,
|
|
1367
1367
|
fillColor: w,
|
|
1368
1368
|
borderWidth: m,
|
|
1369
1369
|
lineCap: "round",
|
|
@@ -1374,7 +1374,7 @@ class At extends re {
|
|
|
1374
1374
|
if (o >= p && o <= C && r === b) {
|
|
1375
1375
|
const E = o === C ? 1 : 0, R = o === p ? 1 : 0;
|
|
1376
1376
|
this.ctx.paint.drawLine([c + R, d + n - 1, c + h - E, d + n - 1], {
|
|
1377
|
-
borderColor:
|
|
1377
|
+
borderColor: x,
|
|
1378
1378
|
fillColor: w,
|
|
1379
1379
|
borderWidth: m,
|
|
1380
1380
|
lineCap: "round",
|
|
@@ -1385,7 +1385,7 @@ class At extends re {
|
|
|
1385
1385
|
if (o === p && r >= y && r <= b) {
|
|
1386
1386
|
const E = r === b ? 1 : 0, R = r === y ? 1 : 0;
|
|
1387
1387
|
this.ctx.paint.drawLine([c + 1, d + R, c + 1, d + n - E], {
|
|
1388
|
-
borderColor:
|
|
1388
|
+
borderColor: x,
|
|
1389
1389
|
fillColor: w,
|
|
1390
1390
|
borderWidth: m,
|
|
1391
1391
|
lineCap: "round",
|
|
@@ -1449,30 +1449,30 @@ class li {
|
|
|
1449
1449
|
var w;
|
|
1450
1450
|
let r = i._hasChildren || !1;
|
|
1451
1451
|
Array.isArray(i.children) && i.children.length && (r = !0, this.initData(i.children, e + 1));
|
|
1452
|
-
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: d } = this.ctx.config, f = i[o],
|
|
1453
|
-
this.itemRowKeyMap.set(i,
|
|
1452
|
+
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();
|
|
1453
|
+
this.itemRowKeyMap.set(i, u);
|
|
1454
1454
|
const g = i._height || h, m = i._readonly;
|
|
1455
|
-
let
|
|
1456
|
-
if (typeof c == "function" && (
|
|
1455
|
+
let x = !0;
|
|
1456
|
+
if (typeof c == "function" && (x = c), d) {
|
|
1457
1457
|
const p = i[d];
|
|
1458
1458
|
if (this.checkboxKeyMap.has(p)) {
|
|
1459
1459
|
const C = this.checkboxKeyMap.get(p) || [];
|
|
1460
|
-
C.push(
|
|
1460
|
+
C.push(u), this.checkboxKeyMap.set(p, C);
|
|
1461
1461
|
} else
|
|
1462
|
-
this.checkboxKeyMap.set(p, [
|
|
1462
|
+
this.checkboxKeyMap.set(p, [u]);
|
|
1463
1463
|
}
|
|
1464
|
-
this.selectionMap.set(
|
|
1465
|
-
key: d ? i[d] :
|
|
1464
|
+
this.selectionMap.set(u, {
|
|
1465
|
+
key: d ? i[d] : u,
|
|
1466
1466
|
row: i,
|
|
1467
|
-
check: ((w = this.selectionMap.get(
|
|
1468
|
-
}), this.rowKeyMap.set(
|
|
1467
|
+
check: ((w = this.selectionMap.get(u)) == null ? void 0 : w.check) || !1
|
|
1468
|
+
}), this.rowKeyMap.set(u, {
|
|
1469
1469
|
readonly: m,
|
|
1470
1470
|
index: s,
|
|
1471
1471
|
rowIndex: s,
|
|
1472
1472
|
level: e,
|
|
1473
1473
|
height: g,
|
|
1474
1474
|
check: !1,
|
|
1475
|
-
selectable:
|
|
1475
|
+
selectable: x,
|
|
1476
1476
|
expand: n,
|
|
1477
1477
|
expandLazy: !1,
|
|
1478
1478
|
hasChildren: r,
|
|
@@ -1684,19 +1684,19 @@ class li {
|
|
|
1684
1684
|
let i = [];
|
|
1685
1685
|
const s = /* @__PURE__ */ new Set();
|
|
1686
1686
|
let r = [], o = t.map((d) => {
|
|
1687
|
-
const { rowKey: f, key:
|
|
1687
|
+
const { rowKey: f, key: u } = d;
|
|
1688
1688
|
let g = d.value, m = g;
|
|
1689
|
-
const
|
|
1689
|
+
const x = this.getRowDataItemForRowKey(f), w = this.getItemValue(f, u), p = this.getVirtualBodyCellByKey(f, u);
|
|
1690
1690
|
return (p == null ? void 0 : p.type) === "number" && (["", void 0, null].includes(g) ? m = null : /^-?\d+(\.\d+)?$/.test(`${g}`) ? m = Number(g) : (m = w, r.push({
|
|
1691
1691
|
...d,
|
|
1692
1692
|
value: m,
|
|
1693
1693
|
oldValue: w,
|
|
1694
|
-
row:
|
|
1694
|
+
row: x
|
|
1695
1695
|
}))), {
|
|
1696
1696
|
...d,
|
|
1697
1697
|
value: m,
|
|
1698
1698
|
oldValue: w,
|
|
1699
|
-
row:
|
|
1699
|
+
row: x
|
|
1700
1700
|
};
|
|
1701
1701
|
});
|
|
1702
1702
|
if (o = o.filter((d) => !r.some((f) => d.rowKey === f.rowKey && d.key === f.key)), r.length) {
|
|
@@ -1711,9 +1711,9 @@ class li {
|
|
|
1711
1711
|
return;
|
|
1712
1712
|
const { BEFORE_VALUE_CHANGE_METHOD: n } = this.ctx.config;
|
|
1713
1713
|
typeof n == "function" && (o = await n(o)), o.forEach((d) => {
|
|
1714
|
-
const { value: f, rowKey:
|
|
1715
|
-
s.add(
|
|
1716
|
-
rowKey:
|
|
1714
|
+
const { value: f, rowKey: u, key: g, oldValue: m } = d;
|
|
1715
|
+
s.add(u), this.setItemValue(u, g, f), i.push({
|
|
1716
|
+
rowKey: u,
|
|
1717
1717
|
key: g,
|
|
1718
1718
|
oldValue: m,
|
|
1719
1719
|
newValue: f
|
|
@@ -1756,7 +1756,7 @@ class li {
|
|
|
1756
1756
|
n[e] !== null && typeof n[e] == "object" && (h = JSON.parse(JSON.stringify(n[e])));
|
|
1757
1757
|
const d = `${t}_${e}`;
|
|
1758
1758
|
this.originalDataMap.has(d) || this.originalDataMap.set(d, h);
|
|
1759
|
-
const f = this.originalDataMap.get(d),
|
|
1759
|
+
const f = this.originalDataMap.get(d), u = this.getRowDataItemForRowKey(t);
|
|
1760
1760
|
if (o) {
|
|
1761
1761
|
const g = this.getVirtualBodyCellByKey(t, e);
|
|
1762
1762
|
if ((g == null ? void 0 : g.type) === "number")
|
|
@@ -1775,7 +1775,7 @@ class li {
|
|
|
1775
1775
|
key: e,
|
|
1776
1776
|
value: c,
|
|
1777
1777
|
oldValue: h,
|
|
1778
|
-
row:
|
|
1778
|
+
row: u
|
|
1779
1779
|
}
|
|
1780
1780
|
]
|
|
1781
1781
|
};
|
|
@@ -1794,28 +1794,28 @@ class li {
|
|
|
1794
1794
|
key: e,
|
|
1795
1795
|
value: c,
|
|
1796
1796
|
oldValue: n[e],
|
|
1797
|
-
row:
|
|
1797
|
+
row: u
|
|
1798
1798
|
}
|
|
1799
1799
|
]);
|
|
1800
1800
|
p && p.length && (c = p[0].value);
|
|
1801
1801
|
}
|
|
1802
1802
|
this.changedDataMap.set(d, c), n[e] = c;
|
|
1803
|
-
const
|
|
1803
|
+
const x = {
|
|
1804
1804
|
rowKey: t,
|
|
1805
1805
|
key: e,
|
|
1806
1806
|
oldValue: h,
|
|
1807
1807
|
value: c,
|
|
1808
|
-
row:
|
|
1808
|
+
row: u
|
|
1809
1809
|
};
|
|
1810
1810
|
this.getValidator(t, e).then(() => {
|
|
1811
1811
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1812
|
-
}), this.ctx.emit("change", [
|
|
1812
|
+
}), this.ctx.emit("change", [x], [u]), this.ctx.emit("editChange", {
|
|
1813
1813
|
rowKey: t,
|
|
1814
1814
|
key: e,
|
|
1815
1815
|
oldValue: h,
|
|
1816
1816
|
value: c,
|
|
1817
1817
|
originalValue: f,
|
|
1818
|
-
row:
|
|
1818
|
+
row: u
|
|
1819
1819
|
});
|
|
1820
1820
|
} else
|
|
1821
1821
|
this.changedDataMap.set(d, c), n[e] = c;
|
|
@@ -1825,7 +1825,7 @@ class li {
|
|
|
1825
1825
|
oldValue: h,
|
|
1826
1826
|
value: c,
|
|
1827
1827
|
originalValue: this.originalDataMap.get(d),
|
|
1828
|
-
row:
|
|
1828
|
+
row: u
|
|
1829
1829
|
}), s && this.ctx.history.pushState({
|
|
1830
1830
|
type: "single",
|
|
1831
1831
|
scrollX: this.ctx.scrollX,
|
|
@@ -1954,14 +1954,14 @@ class li {
|
|
|
1954
1954
|
return e;
|
|
1955
1955
|
const i = this.rowKeyMap.size;
|
|
1956
1956
|
let s = 0, r = 0;
|
|
1957
|
-
const o = this.selectionMap.size, n = Array.from(this.selectionMap.values()).some((
|
|
1958
|
-
this.rowKeyMap.forEach((
|
|
1959
|
-
var
|
|
1960
|
-
(
|
|
1961
|
-
let m =
|
|
1957
|
+
const o = this.selectionMap.size, n = Array.from(this.selectionMap.values()).some((u) => u.check);
|
|
1958
|
+
this.rowKeyMap.forEach((u, g) => {
|
|
1959
|
+
var x;
|
|
1960
|
+
(x = this.selectionMap.get(g)) != null && x.check && (s += 1);
|
|
1961
|
+
let m = u.selectable;
|
|
1962
1962
|
typeof m == "function" && (m = m({
|
|
1963
|
-
row:
|
|
1964
|
-
rowIndex:
|
|
1963
|
+
row: u.item,
|
|
1964
|
+
rowIndex: u.rowIndex
|
|
1965
1965
|
})), m && (r += 1);
|
|
1966
1966
|
});
|
|
1967
1967
|
const h = o > i && s === 0 && n, c = r && r > s && s > 0 || h, d = r !== 0, f = !!r && r === s;
|
|
@@ -2103,14 +2103,14 @@ class li {
|
|
|
2103
2103
|
if (h) {
|
|
2104
2104
|
let c = {}, d = {};
|
|
2105
2105
|
if (d[e] = this.getItemValue(t, e), Array.isArray(h)) {
|
|
2106
|
-
const
|
|
2106
|
+
const u = h.map((g) => ({
|
|
2107
2107
|
...g,
|
|
2108
2108
|
row: s.item,
|
|
2109
2109
|
column: n,
|
|
2110
2110
|
rowIndex: s.rowIndex,
|
|
2111
2111
|
colIndex: r.colIndex
|
|
2112
2112
|
}));
|
|
2113
|
-
c[e] =
|
|
2113
|
+
c[e] = u;
|
|
2114
2114
|
} else
|
|
2115
2115
|
c[e] = {
|
|
2116
2116
|
...h,
|
|
@@ -2121,8 +2121,8 @@ class li {
|
|
|
2121
2121
|
};
|
|
2122
2122
|
new nt(c).validate(d).then(() => {
|
|
2123
2123
|
this.clearValidationError(t, e), i([]);
|
|
2124
|
-
}).catch(({ errors:
|
|
2125
|
-
const g =
|
|
2124
|
+
}).catch(({ errors: u }) => {
|
|
2125
|
+
const g = u.map((m) => ({
|
|
2126
2126
|
...m,
|
|
2127
2127
|
column: n,
|
|
2128
2128
|
key: e,
|
|
@@ -2155,10 +2155,10 @@ class li {
|
|
|
2155
2155
|
relationColKeys: c,
|
|
2156
2156
|
rowspan: d,
|
|
2157
2157
|
height: f,
|
|
2158
|
-
width:
|
|
2158
|
+
width: u,
|
|
2159
2159
|
colspan: g,
|
|
2160
2160
|
mergeRow: m,
|
|
2161
|
-
mergeCol:
|
|
2161
|
+
mergeCol: x
|
|
2162
2162
|
} = t;
|
|
2163
2163
|
if (d === 1 && g === 1)
|
|
2164
2164
|
return {
|
|
@@ -2167,7 +2167,7 @@ class li {
|
|
|
2167
2167
|
rowspan: d,
|
|
2168
2168
|
colspan: g,
|
|
2169
2169
|
height: f,
|
|
2170
|
-
width:
|
|
2170
|
+
width: u,
|
|
2171
2171
|
offsetTop: 0,
|
|
2172
2172
|
offsetLeft: 0,
|
|
2173
2173
|
dataList: [
|
|
@@ -2181,7 +2181,7 @@ class li {
|
|
|
2181
2181
|
};
|
|
2182
2182
|
let w = e, p = e, C = n, y = n, b = [], E = 0, R = 0, O = 0, I = 0;
|
|
2183
2183
|
if (d !== 1 && m) {
|
|
2184
|
-
I =
|
|
2184
|
+
I = u;
|
|
2185
2185
|
const _ = h.reduce((v, S) => {
|
|
2186
2186
|
const T = this.getItemValue(s, S) ?? "";
|
|
2187
2187
|
return `${v}${T}`;
|
|
@@ -2222,7 +2222,7 @@ class li {
|
|
|
2222
2222
|
});
|
|
2223
2223
|
}
|
|
2224
2224
|
}
|
|
2225
|
-
if (g !== 1 &&
|
|
2225
|
+
if (g !== 1 && x) {
|
|
2226
2226
|
O = f;
|
|
2227
2227
|
for (let _ = n - 1; _ >= 0; _--) {
|
|
2228
2228
|
const v = this.getColumnByColIndex(_);
|
|
@@ -2491,7 +2491,7 @@ class fi {
|
|
|
2491
2491
|
this.ctx = e;
|
|
2492
2492
|
}
|
|
2493
2493
|
scale(t) {
|
|
2494
|
-
this.ctx.scale(t, t);
|
|
2494
|
+
this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.scale(t, t);
|
|
2495
2495
|
}
|
|
2496
2496
|
save() {
|
|
2497
2497
|
this.ctx.save();
|
|
@@ -2558,8 +2558,8 @@ class fi {
|
|
|
2558
2558
|
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)
|
|
2559
2559
|
this.ctx.rect(t - 0.5, e - 0.5, i, s);
|
|
2560
2560
|
else {
|
|
2561
|
-
const [c, d, f,
|
|
2562
|
-
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 -
|
|
2561
|
+
const [c, d, f, u] = typeof h == "number" ? [h, h, h, h] : h;
|
|
2562
|
+
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);
|
|
2563
2563
|
}
|
|
2564
2564
|
n !== void 0 && this.ctx.fill(), o !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
2565
2565
|
}
|
|
@@ -2583,12 +2583,12 @@ class fi {
|
|
|
2583
2583
|
verticalAlign: f = "middle"
|
|
2584
2584
|
} = o;
|
|
2585
2585
|
this.ctx.font = n, this.ctx.fillStyle = c, this.ctx.textBaseline = f, this.ctx.textAlign = h;
|
|
2586
|
-
let
|
|
2587
|
-
f === "top" ?
|
|
2586
|
+
let u = 0;
|
|
2587
|
+
f === "top" ? u = i + d : f === "bottom" ? u = i + r - d : u = i + (r + 1) / 2;
|
|
2588
2588
|
let g = 0;
|
|
2589
2589
|
h === "left" ? g = e + d : h === "right" ? g = e + s - d : g = e + s / 2;
|
|
2590
|
-
const { _text: m, ellipsis:
|
|
2591
|
-
return this.ctx.fillText(m, g,
|
|
2590
|
+
const { _text: m, ellipsis: x } = this.handleEllipsis(t, s, d, n);
|
|
2591
|
+
return this.ctx.fillText(m, g, u), this.ctx.restore(), x;
|
|
2592
2592
|
}
|
|
2593
2593
|
handleEllipsis(t, e, i = 0, s = "12px Arial") {
|
|
2594
2594
|
let r = !1, o = t;
|
|
@@ -2779,7 +2779,7 @@ class Wt {
|
|
|
2779
2779
|
}
|
|
2780
2780
|
}
|
|
2781
2781
|
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>';
|
|
2782
|
-
class
|
|
2782
|
+
class ui {
|
|
2783
2783
|
constructor(t) {
|
|
2784
2784
|
l(this, "ctx");
|
|
2785
2785
|
l(this, "list", [
|
|
@@ -3010,8 +3010,8 @@ class oe extends re {
|
|
|
3010
3010
|
const { width: e, height: i, type: s } = this;
|
|
3011
3011
|
if (["index-selection", "selection"].includes(s)) {
|
|
3012
3012
|
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;
|
|
3013
|
-
let f = this.ctx.icons.get("checkbox-uncheck"),
|
|
3014
|
-
r ? (f = this.ctx.icons.get("checkbox-indeterminate"),
|
|
3013
|
+
let f = this.ctx.icons.get("checkbox-uncheck"), u = "checkbox-uncheck";
|
|
3014
|
+
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(
|
|
3015
3015
|
this.drawImageSource,
|
|
3016
3016
|
this.drawImageX,
|
|
3017
3017
|
this.drawImageY,
|
|
@@ -3040,7 +3040,7 @@ class oe extends re {
|
|
|
3040
3040
|
};
|
|
3041
3041
|
}
|
|
3042
3042
|
}
|
|
3043
|
-
class
|
|
3043
|
+
class xi {
|
|
3044
3044
|
constructor(t) {
|
|
3045
3045
|
l(this, "ctx");
|
|
3046
3046
|
l(this, "visibleHoverCell");
|
|
@@ -3327,7 +3327,7 @@ class gi {
|
|
|
3327
3327
|
emptyElement: h,
|
|
3328
3328
|
contextMenuElement: c
|
|
3329
3329
|
} = t;
|
|
3330
|
-
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
|
|
3330
|
+
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);
|
|
3331
3331
|
}
|
|
3332
3332
|
setConfig(t) {
|
|
3333
3333
|
this.config = new Wt(t);
|
|
@@ -3533,12 +3533,12 @@ class zt {
|
|
|
3533
3533
|
stageHeight: i,
|
|
3534
3534
|
stageWidth: s,
|
|
3535
3535
|
config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0, BORDER: n }
|
|
3536
|
-
} = this.ctx, h = s, c = i, d = e.height, f = e.width,
|
|
3536
|
+
} = this.ctx, h = s, c = i, d = e.height, f = e.width, u = t.height, g = this.ctx.footer.height;
|
|
3537
3537
|
if (this.type === "vertical") {
|
|
3538
|
-
this.visibleDistance = c - r - d, this.distance =
|
|
3539
|
-
const m = this.distance ? this.visibleDistance / (
|
|
3540
|
-
let
|
|
3541
|
-
|
|
3538
|
+
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;
|
|
3539
|
+
const m = this.distance ? this.visibleDistance / (u + g) : 0;
|
|
3540
|
+
let x = Math.floor(m * this.visibleDistance);
|
|
3541
|
+
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));
|
|
3542
3542
|
} else {
|
|
3543
3543
|
this.visibleDistance = h - r, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
3544
3544
|
h - r,
|
|
@@ -3548,8 +3548,8 @@ class zt {
|
|
|
3548
3548
|
];
|
|
3549
3549
|
const m = n ? 0 : 0.5;
|
|
3550
3550
|
this.trackX = 0, this.trackY = c - r + m, this.trackWidth = h, this.trackHeight = r;
|
|
3551
|
-
const
|
|
3552
|
-
let w = Math.floor(
|
|
3551
|
+
const x = this.distance ? this.visibleDistance / f : 0;
|
|
3552
|
+
let w = Math.floor(x * this.visibleDistance);
|
|
3553
3553
|
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));
|
|
3554
3554
|
}
|
|
3555
3555
|
}
|
|
@@ -3688,7 +3688,7 @@ class pi {
|
|
|
3688
3688
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3689
3689
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3690
3690
|
const s = te(i), r = _t(i);
|
|
3691
|
-
this.height = t * s, this.width = r.reduce((f,
|
|
3691
|
+
this.height = t * s, this.width = r.reduce((f, u) => f + ((u == null ? void 0 : u.width) || 100), 0), this.visibleHeight = this.height;
|
|
3692
3692
|
const o = ei(ee(i, s));
|
|
3693
3693
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3694
3694
|
const n = this.ctx.containerElement.getBoundingClientRect();
|
|
@@ -3699,9 +3699,9 @@ class pi {
|
|
|
3699
3699
|
this.resizeAllColumn(f);
|
|
3700
3700
|
}
|
|
3701
3701
|
const c = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
3702
|
-
this.ctx.fixedLeftWidth = c.reduce((f,
|
|
3702
|
+
this.ctx.fixedLeftWidth = c.reduce((f, u) => f + u.width, 0);
|
|
3703
3703
|
const d = this.fixedRightCellHeaders.filter((f) => !f.hasChildren);
|
|
3704
|
-
this.ctx.fixedRightWidth = d.reduce((f,
|
|
3704
|
+
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;
|
|
3705
3705
|
}
|
|
3706
3706
|
// 调整表头的宽度
|
|
3707
3707
|
initResizeColumn() {
|
|
@@ -3961,41 +3961,43 @@ class mi {
|
|
|
3961
3961
|
MAX_HEIGHT: c = 0,
|
|
3962
3962
|
ENABLE_OFFSET_HEIGHT: d = 0,
|
|
3963
3963
|
OFFSET_HEIGHT: f = 0,
|
|
3964
|
-
FOOTER_POSITION:
|
|
3964
|
+
FOOTER_POSITION: u
|
|
3965
3965
|
}
|
|
3966
3966
|
} = this.ctx;
|
|
3967
3967
|
if (!e.width)
|
|
3968
3968
|
return;
|
|
3969
|
-
this.x = 0,
|
|
3969
|
+
this.x = 0, u === "top" && r ? this.y = e.height + i.height : this.y = e.height;
|
|
3970
3970
|
const { data: g, sumHeight: m } = s.getData();
|
|
3971
3971
|
this.height = m, this.data = g, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - o;
|
|
3972
|
-
const
|
|
3973
|
-
!this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height -
|
|
3972
|
+
const x = this.ctx.footer.height;
|
|
3973
|
+
!this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height - x - o);
|
|
3974
3974
|
let w = this.height + e.height + o;
|
|
3975
|
-
w +=
|
|
3975
|
+
w += x;
|
|
3976
3976
|
let p = w;
|
|
3977
3977
|
const C = window.innerHeight, { top: y } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
3978
3978
|
if (C > y && d && !n) {
|
|
3979
|
-
const
|
|
3980
|
-
|
|
3979
|
+
const T = C - y - f;
|
|
3980
|
+
T > e.height + o ? p = T : w > c && (p = c);
|
|
3981
3981
|
} else this.data.length && n ? p = n : this.data.length && c && w > c && (p = c);
|
|
3982
3982
|
p > 0 && (this.ctx.stageHeight = Math.floor(p), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
|
|
3983
3983
|
let b = this.ctx.stageHeight - e.height - o;
|
|
3984
|
-
r ? this.visibleHeight = b -
|
|
3984
|
+
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;
|
|
3985
3985
|
const E = window.devicePixelRatio || 1, R = this.ctx.stageWidth * E, O = this.ctx.stageHeight * E;
|
|
3986
|
-
t.width = Math.
|
|
3986
|
+
t.width = Math.round(R), t.height = Math.round(O);
|
|
3987
3987
|
const I = this.data.length ? "not-empty" : "empty";
|
|
3988
3988
|
this.ctx.emit("emptyChange", {
|
|
3989
3989
|
isEmpty: I,
|
|
3990
3990
|
type: I,
|
|
3991
3991
|
headerHeight: e.height,
|
|
3992
3992
|
bodyHeight: this.height,
|
|
3993
|
-
footerHeight:
|
|
3993
|
+
footerHeight: x,
|
|
3994
3994
|
width: this.width,
|
|
3995
|
-
height: this.data.length ? 0 : h +
|
|
3996
|
-
})
|
|
3995
|
+
height: this.data.length ? 0 : h + x
|
|
3996
|
+
});
|
|
3997
|
+
const _ = Math.round(t.width / E * 1e4) / 1e4, v = Math.round(t.height / E * 1e4) / 1e4;
|
|
3998
|
+
this.ctx.canvasElement.setAttribute(
|
|
3997
3999
|
"style",
|
|
3998
|
-
`
|
|
4000
|
+
`height:${v}px;width:${_}px;`
|
|
3999
4001
|
), this.ctx.paint.scale(E);
|
|
4000
4002
|
}
|
|
4001
4003
|
// 调整行的高度
|
|
@@ -4022,8 +4024,8 @@ class mi {
|
|
|
4022
4024
|
} = this.ctx;
|
|
4023
4025
|
if (this.isResizing && this.resizeTarget) {
|
|
4024
4026
|
const f = this.resizeTarget.height;
|
|
4025
|
-
let
|
|
4026
|
-
|
|
4027
|
+
let u = n - this.clientY;
|
|
4028
|
+
u + f < d && (u = -(f - d)), this.resizeDiff = u, this.ctx.emit("draw");
|
|
4027
4029
|
} else {
|
|
4028
4030
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
4029
4031
|
return;
|
|
@@ -4035,11 +4037,11 @@ class mi {
|
|
|
4035
4037
|
return;
|
|
4036
4038
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4037
4039
|
for (let f = 0; f < this.renderRows.length; f++) {
|
|
4038
|
-
const
|
|
4039
|
-
if (r >
|
|
4040
|
-
for (let m = 0; m <
|
|
4041
|
-
const
|
|
4042
|
-
o >
|
|
4040
|
+
const u = this.renderRows[f];
|
|
4041
|
+
if (r > u.y - c + u.height - 1.5 && r < u.y - c + u.height + 1.5 && r < h - 4)
|
|
4042
|
+
for (let m = 0; m < u.cells.length; m++) {
|
|
4043
|
+
const x = u.cells[m];
|
|
4044
|
+
o > x.drawX + 10 && o < x.drawX + x.width - 10 && x.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = u);
|
|
4043
4045
|
}
|
|
4044
4046
|
}
|
|
4045
4047
|
}
|
|
@@ -4122,7 +4124,7 @@ class mi {
|
|
|
4122
4124
|
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;
|
|
4123
4125
|
const d = [];
|
|
4124
4126
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
4125
|
-
const
|
|
4127
|
+
const u = this.headIndex + f, g = this.visibleRows[f], { height: m, top: x } = this.ctx.database.getPositionForRowIndex(u), w = new ne(this.ctx, u, 0, x + this.y, t.width, m, g);
|
|
4126
4128
|
d.push(w);
|
|
4127
4129
|
}
|
|
4128
4130
|
this.renderRows = d, this.ctx.body.renderRows = d;
|
|
@@ -4339,16 +4341,16 @@ class Ei {
|
|
|
4339
4341
|
SELECTOR_AREA_MIN_Y: c,
|
|
4340
4342
|
SELECTOR_AREA_MAX_Y: d,
|
|
4341
4343
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
4342
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4343
|
-
} = this.ctx.config, g = n, m = h || this.ctx.maxColIndex - f,
|
|
4344
|
+
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
4345
|
+
} = this.ctx.config, g = n, m = h || this.ctx.maxColIndex - f, x = c, w = d || this.ctx.maxRowIndex - u;
|
|
4344
4346
|
let [p, C] = r, [y, b] = o;
|
|
4345
|
-
if (p < g || C > m || y <
|
|
4347
|
+
if (p < g || C > m || y < x || b > w)
|
|
4346
4348
|
return;
|
|
4347
4349
|
if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
4348
4350
|
const R = this.adjustMergeCells(r, o);
|
|
4349
4351
|
y = R.yArr[0], b = R.yArr[1], p = R.xArr[0], C = R.xArr[1], this.ctx.onlyMergeCell = R.onlyMergeCell;
|
|
4350
4352
|
}
|
|
4351
|
-
p === C && y === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(g, p), Math.min(m, C)], o = [Math.max(
|
|
4353
|
+
p === C && y === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(g, p), Math.min(m, C)], o = [Math.max(x, y), Math.min(w, b)];
|
|
4352
4354
|
const { BEFORE_SET_SELECTOR_METHOD: E } = this.ctx.config;
|
|
4353
4355
|
if (typeof E == "function") {
|
|
4354
4356
|
const O = E({
|
|
@@ -4367,38 +4369,38 @@ class Ei {
|
|
|
4367
4369
|
var m;
|
|
4368
4370
|
const [i, s] = e, [r, o] = t;
|
|
4369
4371
|
let n = [], h = [];
|
|
4370
|
-
for (let
|
|
4372
|
+
for (let x = 0; x <= e[1] - e[0]; x++)
|
|
4371
4373
|
for (let w = 0; w <= t[1] - t[0]; w++) {
|
|
4372
|
-
const p =
|
|
4374
|
+
const p = x + e[0], C = w + t[0], y = this.ctx.database.getVirtualBodyCell(p, C);
|
|
4373
4375
|
y && ((p === i || p === s) && n.push(y), (C === r || C === o) && h.push(y));
|
|
4374
4376
|
}
|
|
4375
4377
|
const c = n.reduce(
|
|
4376
|
-
(
|
|
4378
|
+
(x, w) => {
|
|
4377
4379
|
const { yArr: p } = w.getSpanInfo(), [C, y] = p;
|
|
4378
|
-
return
|
|
4380
|
+
return x.minY = Math.min(x.minY, C), x.maxY = Math.max(x.maxY, y), x;
|
|
4379
4381
|
},
|
|
4380
4382
|
{
|
|
4381
4383
|
minY: i,
|
|
4382
4384
|
maxY: s
|
|
4383
4385
|
}
|
|
4384
4386
|
), d = h.reduce(
|
|
4385
|
-
(
|
|
4387
|
+
(x, w) => {
|
|
4386
4388
|
const { xArr: p } = w.getSpanInfo(), [C, y] = p;
|
|
4387
|
-
return
|
|
4389
|
+
return x.minX = Math.min(x.minX, C), x.maxX = Math.max(x.maxX, y), x;
|
|
4388
4390
|
},
|
|
4389
4391
|
{
|
|
4390
4392
|
minX: r,
|
|
4391
4393
|
maxX: o
|
|
4392
4394
|
}
|
|
4393
|
-
), f = [d.minX, d.maxX],
|
|
4395
|
+
), f = [d.minX, d.maxX], u = [c.minY, c.maxY];
|
|
4394
4396
|
let g = !1;
|
|
4395
4397
|
if (d.minX !== d.maxX || c.minY !== c.maxY) {
|
|
4396
|
-
const
|
|
4397
|
-
g = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) ===
|
|
4398
|
+
const x = JSON.stringify(f) + JSON.stringify(u), w = (m = this.ctx.focusCell) == null ? void 0 : m.getSpanInfo();
|
|
4399
|
+
g = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) === x;
|
|
4398
4400
|
}
|
|
4399
4401
|
return {
|
|
4400
4402
|
xArr: f,
|
|
4401
|
-
yArr:
|
|
4403
|
+
yArr: u,
|
|
4402
4404
|
onlyMergeCell: g
|
|
4403
4405
|
};
|
|
4404
4406
|
}
|
|
@@ -4436,7 +4438,7 @@ class Ei {
|
|
|
4436
4438
|
SELECTOR_AREA_MAX_Y: o,
|
|
4437
4439
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
4438
4440
|
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4439
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r,
|
|
4441
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, u = o || this.ctx.maxRowIndex - h, g = [c, d], m = [f, u];
|
|
4440
4442
|
this.setSelector(g, m);
|
|
4441
4443
|
}
|
|
4442
4444
|
}
|
|
@@ -4475,8 +4477,8 @@ class Ei {
|
|
|
4475
4477
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
4476
4478
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
|
|
4477
4479
|
return;
|
|
4478
|
-
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),
|
|
4479
|
-
this.setSelector(
|
|
4480
|
+
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];
|
|
4481
|
+
this.setSelector(u, g);
|
|
4480
4482
|
} else {
|
|
4481
4483
|
this.ctx.emit("cellSelectedClick", e);
|
|
4482
4484
|
const s = [e.colIndex, e.colIndex], r = [e.rowIndex, e.rowIndex];
|
|
@@ -4544,9 +4546,9 @@ class Ei {
|
|
|
4544
4546
|
for (let h = 0; h <= t[1] - t[0]; h++) {
|
|
4545
4547
|
const c = n + e[0], d = h + t[0], f = this.ctx.database.getItemValueForRowIndexAndColIndex(c, d);
|
|
4546
4548
|
if (f) {
|
|
4547
|
-
const { rowKey:
|
|
4548
|
-
this.ctx.database.getReadonly(
|
|
4549
|
-
rowKey:
|
|
4549
|
+
const { rowKey: u, key: g } = f;
|
|
4550
|
+
this.ctx.database.getReadonly(u, g) || (r.add(u), s.push({
|
|
4551
|
+
rowKey: u,
|
|
4550
4552
|
key: g,
|
|
4551
4553
|
value: null,
|
|
4552
4554
|
row: {}
|
|
@@ -4574,18 +4576,18 @@ class Ei {
|
|
|
4574
4576
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
4575
4577
|
navigator.clipboard.readText().then(async (r) => {
|
|
4576
4578
|
let o = si(r);
|
|
4577
|
-
const n = [i, i + o[0].length - 1], h = [e, e + o.length - 1], [c, d] = h, [f,
|
|
4579
|
+
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, m = u - this.ctx.maxColIndex;
|
|
4578
4580
|
(g > 0 || m > 0) && this.ctx.emit("onPastedDataOverflow", {
|
|
4579
4581
|
maxY: d,
|
|
4580
|
-
maxX:
|
|
4582
|
+
maxX: u,
|
|
4581
4583
|
minY: c,
|
|
4582
4584
|
minX: f,
|
|
4583
4585
|
overflowRowCount: g,
|
|
4584
4586
|
overflowColCount: m,
|
|
4585
4587
|
textArr: o
|
|
4586
4588
|
});
|
|
4587
|
-
const
|
|
4588
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !
|
|
4589
|
+
const x = o.length === 1 && o[0].length === 1;
|
|
4590
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !x) {
|
|
4589
4591
|
const y = {
|
|
4590
4592
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
4591
4593
|
message: "Merged cells cannot span paste data"
|
|
@@ -4688,8 +4690,8 @@ class Ei {
|
|
|
4688
4690
|
SELECTOR_AREA_MAX_Y: o,
|
|
4689
4691
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
4690
4692
|
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4691
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r,
|
|
4692
|
-
return !(e < c || e > d || t < f || t >
|
|
4693
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, u = o || this.ctx.maxRowIndex - h;
|
|
4694
|
+
return !(e < c || e > d || t < f || t > u);
|
|
4693
4695
|
}
|
|
4694
4696
|
/**
|
|
4695
4697
|
* 调整滚动条位置,让到达边界时自动滚动
|
|
@@ -4731,16 +4733,16 @@ class Ei {
|
|
|
4731
4733
|
body: h,
|
|
4732
4734
|
scrollX: c,
|
|
4733
4735
|
scrollY: d,
|
|
4734
|
-
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED:
|
|
4736
|
+
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: u, FOOTER_POSITION: g, ENABLE_MERGE_CELL_LINK: m }
|
|
4735
4737
|
} = this.ctx;
|
|
4736
4738
|
if (!i)
|
|
4737
4739
|
return;
|
|
4738
4740
|
m && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
4739
|
-
const { drawX:
|
|
4741
|
+
const { drawX: x, drawY: w, width: p, height: C, fixed: y } = i, b = r - x + 1, E = i.drawX + p - (e - s) + 1;
|
|
4740
4742
|
let R = o.height - w, O = C;
|
|
4741
4743
|
O > h.visibleHeight && (O = h.visibleHeight);
|
|
4742
4744
|
let I = 0;
|
|
4743
|
-
|
|
4745
|
+
u && (g === "top" ? R = o.height + n.height - w : I = n.visibleHeight);
|
|
4744
4746
|
const _ = w + O - (t - I - f);
|
|
4745
4747
|
let v = c, S = d;
|
|
4746
4748
|
E > 0 && !y ? v = Math.floor(c + E) : b > 0 && !y && (v = Math.floor(c - b)), R > 0 ? S = Math.floor(d - R) : _ > 0 && (S = Math.floor(d + _)), (Math.abs(c - v) > 2 || Math.abs(d - S) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(v, S), this.ctx.emit("adjustBoundaryPosition", i));
|
|
@@ -4759,8 +4761,8 @@ class Ci {
|
|
|
4759
4761
|
this.ctx.on("mousemove", (t) => {
|
|
4760
4762
|
if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
|
|
4761
4763
|
return;
|
|
4762
|
-
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,
|
|
4763
|
-
e >
|
|
4764
|
+
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;
|
|
4765
|
+
e > u && i > g && e < u + d && i < g + d && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4764
4766
|
}), this.ctx.on("cellMouseenter", (t) => {
|
|
4765
4767
|
const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], r = i[1], { colIndex: o, rowIndex: n } = t;
|
|
4766
4768
|
this.ctx.config.ENABLE_AUTOFILL && o === s && n === r && (this.maxColRowCell = t), this.mouseenter(t);
|
|
@@ -4805,13 +4807,13 @@ class Ci {
|
|
|
4805
4807
|
SELECTOR_AREA_MAX_X: c,
|
|
4806
4808
|
SELECTOR_AREA_MIN_Y: d,
|
|
4807
4809
|
SELECTOR_AREA_MAX_Y: f,
|
|
4808
|
-
SELECTOR_AREA_MAX_X_OFFSET:
|
|
4810
|
+
SELECTOR_AREA_MAX_X_OFFSET: u,
|
|
4809
4811
|
SELECTOR_AREA_MAX_Y_OFFSET: g
|
|
4810
|
-
} = this.ctx.config, m = h,
|
|
4812
|
+
} = this.ctx.config, m = h, x = c || this.ctx.maxColIndex - u, w = d, p = f || this.ctx.maxRowIndex - g;
|
|
4811
4813
|
let [C, y] = o, [b, E] = n;
|
|
4812
4814
|
if (C < m || b < w)
|
|
4813
4815
|
return;
|
|
4814
|
-
o = [Math.max(m, C), Math.min(
|
|
4816
|
+
o = [Math.max(m, C), Math.min(x, y)], n = [Math.max(w, b), Math.min(p, E)];
|
|
4815
4817
|
const { BEFORE_SET_AUTOFILL_METHOD: R } = this.ctx.config;
|
|
4816
4818
|
if (typeof R == "function") {
|
|
4817
4819
|
const I = R({
|
|
@@ -4833,8 +4835,8 @@ class Ci {
|
|
|
4833
4835
|
const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
|
|
4834
4836
|
for (let g = 0; g <= e.yArr[1] - e.yArr[0]; g++)
|
|
4835
4837
|
for (let m = 0; m <= e.xArr[1] - e.xArr[0]; m++) {
|
|
4836
|
-
const
|
|
4837
|
-
i.set(`${
|
|
4838
|
+
const x = g + e.yArr[0], w = m + e.xArr[0];
|
|
4839
|
+
i.set(`${x}-${w}`, !0);
|
|
4838
4840
|
}
|
|
4839
4841
|
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;
|
|
4840
4842
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !c) {
|
|
@@ -4848,7 +4850,7 @@ class Ci {
|
|
|
4848
4850
|
let d = [];
|
|
4849
4851
|
for (let g = 0; g <= h[1] - h[0]; g++)
|
|
4850
4852
|
for (let m = 0; m <= n[1] - n[0]; m++) {
|
|
4851
|
-
const
|
|
4853
|
+
const x = m + n[0], w = g + h[0], p = s[g % o][m % r], C = this.ctx.database.getItemValueForRowIndexAndColIndex(w, x), y = `${w}-${x}`;
|
|
4852
4854
|
if (C && !i.has(y)) {
|
|
4853
4855
|
const { rowKey: b, key: E } = C;
|
|
4854
4856
|
this.ctx.database.getReadonly(b, E) || (t.add(b), d.push({
|
|
@@ -4864,21 +4866,21 @@ class Ci {
|
|
|
4864
4866
|
this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr;
|
|
4865
4867
|
const { BEFORE_AUTOFILL_DATA_METHOD: f } = this.ctx.config;
|
|
4866
4868
|
if (typeof f == "function") {
|
|
4867
|
-
const g = f, m = d.map((
|
|
4868
|
-
rowKey:
|
|
4869
|
-
key:
|
|
4870
|
-
value:
|
|
4871
|
-
oldValue: this.ctx.database.getItemValue(
|
|
4872
|
-
row: this.ctx.database.getRowDataItemForRowKey(
|
|
4869
|
+
const g = f, m = d.map((x) => ({
|
|
4870
|
+
rowKey: x.rowKey,
|
|
4871
|
+
key: x.key,
|
|
4872
|
+
value: x.value,
|
|
4873
|
+
oldValue: this.ctx.database.getItemValue(x.rowKey, x.key),
|
|
4874
|
+
row: this.ctx.database.getRowDataItemForRowKey(x.rowKey)
|
|
4873
4875
|
}));
|
|
4874
4876
|
if (d = await g(m, n, h), d && !d.length)
|
|
4875
4877
|
return;
|
|
4876
4878
|
}
|
|
4877
4879
|
this.ctx.batchSetItemValueByEditor(d, !0);
|
|
4878
|
-
let
|
|
4880
|
+
let u = [];
|
|
4879
4881
|
t.forEach((g) => {
|
|
4880
|
-
|
|
4881
|
-
}), this.ctx.emit("autofillChange", d,
|
|
4882
|
+
u.push(this.ctx.database.getRowDataItemForRowKey(g));
|
|
4883
|
+
}), this.ctx.emit("autofillChange", d, u);
|
|
4882
4884
|
}
|
|
4883
4885
|
mouseenter(t) {
|
|
4884
4886
|
if (["index", "selection", "index-selection"].includes(t.type))
|
|
@@ -4932,10 +4934,10 @@ function Ri(a, t, e) {
|
|
|
4932
4934
|
e === void 0 && (e = !1);
|
|
4933
4935
|
const i = lt(a), s = Ht(a), r = Mt(s);
|
|
4934
4936
|
let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4935
|
-
return t.reference[r] > t.floating[r] && (o =
|
|
4937
|
+
return t.reference[r] > t.floating[r] && (o = ut(o)), [o, ut(o)];
|
|
4936
4938
|
}
|
|
4937
4939
|
function _i(a) {
|
|
4938
|
-
const t =
|
|
4940
|
+
const t = ut(a);
|
|
4939
4941
|
return [Ot(a), t, Ot(t)];
|
|
4940
4942
|
}
|
|
4941
4943
|
function Ot(a) {
|
|
@@ -4959,7 +4961,7 @@ function Oi(a, t, e, i) {
|
|
|
4959
4961
|
let r = Ii(G(a), e === "start", i);
|
|
4960
4962
|
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
|
|
4961
4963
|
}
|
|
4962
|
-
function
|
|
4964
|
+
function ut(a) {
|
|
4963
4965
|
return a.replace(/left|right|bottom|top/g, (t) => bi[t]);
|
|
4964
4966
|
}
|
|
4965
4967
|
function Li(a) {
|
|
@@ -4979,7 +4981,7 @@ function le(a) {
|
|
|
4979
4981
|
left: a
|
|
4980
4982
|
};
|
|
4981
4983
|
}
|
|
4982
|
-
function
|
|
4984
|
+
function xt(a) {
|
|
4983
4985
|
const {
|
|
4984
4986
|
x: t,
|
|
4985
4987
|
y: e,
|
|
@@ -5002,7 +5004,7 @@ function $t(a, t, e) {
|
|
|
5002
5004
|
reference: i,
|
|
5003
5005
|
floating: s
|
|
5004
5006
|
} = a;
|
|
5005
|
-
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,
|
|
5007
|
+
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;
|
|
5006
5008
|
let g;
|
|
5007
5009
|
switch (h) {
|
|
5008
5010
|
case "top":
|
|
@@ -5037,10 +5039,10 @@ function $t(a, t, e) {
|
|
|
5037
5039
|
}
|
|
5038
5040
|
switch (lt(t)) {
|
|
5039
5041
|
case "start":
|
|
5040
|
-
g[o] -=
|
|
5042
|
+
g[o] -= u * (e && c ? -1 : 1);
|
|
5041
5043
|
break;
|
|
5042
5044
|
case "end":
|
|
5043
|
-
g[o] +=
|
|
5045
|
+
g[o] += u * (e && c ? -1 : 1);
|
|
5044
5046
|
break;
|
|
5045
5047
|
}
|
|
5046
5048
|
return g;
|
|
@@ -5059,12 +5061,12 @@ const Si = async (a, t, e) => {
|
|
|
5059
5061
|
}), {
|
|
5060
5062
|
x: d,
|
|
5061
5063
|
y: f
|
|
5062
|
-
} = $t(c, i, h),
|
|
5063
|
-
for (let
|
|
5064
|
+
} = $t(c, i, h), u = i, g = {}, m = 0;
|
|
5065
|
+
for (let x = 0; x < n.length; x++) {
|
|
5064
5066
|
const {
|
|
5065
5067
|
name: w,
|
|
5066
5068
|
fn: p
|
|
5067
|
-
} = n[
|
|
5069
|
+
} = n[x], {
|
|
5068
5070
|
x: C,
|
|
5069
5071
|
y,
|
|
5070
5072
|
data: b,
|
|
@@ -5073,7 +5075,7 @@ const Si = async (a, t, e) => {
|
|
|
5073
5075
|
x: d,
|
|
5074
5076
|
y: f,
|
|
5075
5077
|
initialPlacement: i,
|
|
5076
|
-
placement:
|
|
5078
|
+
placement: u,
|
|
5077
5079
|
strategy: s,
|
|
5078
5080
|
middlewareData: g,
|
|
5079
5081
|
rects: c,
|
|
@@ -5089,19 +5091,19 @@ const Si = async (a, t, e) => {
|
|
|
5089
5091
|
...g[w],
|
|
5090
5092
|
...b
|
|
5091
5093
|
}
|
|
5092
|
-
}, E && m <= 50 && (m++, typeof E == "object" && (E.placement && (
|
|
5094
|
+
}, E && m <= 50 && (m++, typeof E == "object" && (E.placement && (u = E.placement), E.rects && (c = E.rects === !0 ? await o.getElementRects({
|
|
5093
5095
|
reference: a,
|
|
5094
5096
|
floating: t,
|
|
5095
5097
|
strategy: s
|
|
5096
5098
|
}) : E.rects), {
|
|
5097
5099
|
x: d,
|
|
5098
5100
|
y: f
|
|
5099
|
-
} = $t(c,
|
|
5101
|
+
} = $t(c, u, h)), x = -1);
|
|
5100
5102
|
}
|
|
5101
5103
|
return {
|
|
5102
5104
|
x: d,
|
|
5103
5105
|
y: f,
|
|
5104
|
-
placement:
|
|
5106
|
+
placement: u,
|
|
5105
5107
|
strategy: s,
|
|
5106
5108
|
middlewareData: g
|
|
5107
5109
|
};
|
|
@@ -5120,9 +5122,9 @@ async function he(a, t) {
|
|
|
5120
5122
|
boundary: c = "clippingAncestors",
|
|
5121
5123
|
rootBoundary: d = "viewport",
|
|
5122
5124
|
elementContext: f = "floating",
|
|
5123
|
-
altBoundary:
|
|
5125
|
+
altBoundary: u = !1,
|
|
5124
5126
|
padding: g = 0
|
|
5125
|
-
} = at(t, a), m = le(g), w = n[
|
|
5127
|
+
} = at(t, a), m = le(g), w = n[u ? f === "floating" ? "reference" : "floating" : f], p = xt(await r.getClippingRect({
|
|
5126
5128
|
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)),
|
|
5127
5129
|
boundary: c,
|
|
5128
5130
|
rootBoundary: d,
|
|
@@ -5138,7 +5140,7 @@ async function he(a, t) {
|
|
|
5138
5140
|
} : {
|
|
5139
5141
|
x: 1,
|
|
5140
5142
|
y: 1
|
|
5141
|
-
}, E =
|
|
5143
|
+
}, E = xt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
5142
5144
|
elements: n,
|
|
5143
5145
|
rect: C,
|
|
5144
5146
|
offsetParent: y,
|
|
@@ -5169,15 +5171,15 @@ const Ti = (a) => ({
|
|
|
5169
5171
|
} = at(a, t) || {};
|
|
5170
5172
|
if (c == null)
|
|
5171
5173
|
return {};
|
|
5172
|
-
const f = le(d),
|
|
5174
|
+
const f = le(d), u = {
|
|
5173
5175
|
x: e,
|
|
5174
5176
|
y: i
|
|
5175
|
-
}, g = Ht(s), m = Mt(g),
|
|
5177
|
+
}, g = Ht(s), m = Mt(g), x = await o.getDimensions(c), w = g === "y", p = w ? "top" : "left", C = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = r.reference[m] + r.reference[g] - u[g] - r.floating[m], E = u[g] - r.reference[g], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
|
|
5176
5178
|
let O = R ? R[y] : 0;
|
|
5177
5179
|
(!O || !await (o.isElement == null ? void 0 : o.isElement(R))) && (O = n.floating[y] || r.floating[m]);
|
|
5178
|
-
const I = b / 2 - E / 2, _ = O / 2 -
|
|
5180
|
+
const I = b / 2 - E / 2, _ = O / 2 - x[m] / 2 - 1, v = rt(f[p], _), S = rt(f[C], _), T = v, M = O - x[m] - S, A = O / 2 - x[m] / 2 + I, B = It(T, A, M), Y = !h.arrow && lt(s) != null && A !== B && r.reference[m] / 2 - (A < T ? v : S) - x[m] / 2 < 0, k = Y ? A < T ? A - T : A - M : 0;
|
|
5179
5181
|
return {
|
|
5180
|
-
[g]:
|
|
5182
|
+
[g]: u[g] + k,
|
|
5181
5183
|
data: {
|
|
5182
5184
|
[g]: B,
|
|
5183
5185
|
centerOffset: A - B - k,
|
|
@@ -5204,16 +5206,16 @@ const Ti = (a) => ({
|
|
|
5204
5206
|
} = t, {
|
|
5205
5207
|
mainAxis: d = !0,
|
|
5206
5208
|
crossAxis: f = !0,
|
|
5207
|
-
fallbackPlacements:
|
|
5209
|
+
fallbackPlacements: u,
|
|
5208
5210
|
fallbackStrategy: g = "bestFit",
|
|
5209
5211
|
fallbackAxisSideDirection: m = "none",
|
|
5210
|
-
flipAlignment:
|
|
5212
|
+
flipAlignment: x = !0,
|
|
5211
5213
|
...w
|
|
5212
5214
|
} = at(a, t);
|
|
5213
5215
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
5214
5216
|
return {};
|
|
5215
|
-
const p = G(s), C = J(n), y = G(n) === n, b = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), E =
|
|
5216
|
-
!
|
|
5217
|
+
const p = G(s), C = J(n), y = G(n) === n, b = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), E = u || (y || !x ? [ut(n)] : _i(n)), R = m !== "none";
|
|
5218
|
+
!u && R && E.push(...Oi(n, x, m, b));
|
|
5217
5219
|
const O = [n, ...E], I = await he(t, w), _ = [];
|
|
5218
5220
|
let v = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
5219
5221
|
if (d && _.push(I[p]), f) {
|
|
@@ -5275,7 +5277,7 @@ async function Mi(a, t) {
|
|
|
5275
5277
|
elements: s
|
|
5276
5278
|
} = 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);
|
|
5277
5279
|
let {
|
|
5278
|
-
mainAxis:
|
|
5280
|
+
mainAxis: u,
|
|
5279
5281
|
crossAxis: g,
|
|
5280
5282
|
alignmentAxis: m
|
|
5281
5283
|
} = typeof f == "number" ? {
|
|
@@ -5289,9 +5291,9 @@ async function Mi(a, t) {
|
|
|
5289
5291
|
};
|
|
5290
5292
|
return n && typeof m == "number" && (g = n === "end" ? m * -1 : m), h ? {
|
|
5291
5293
|
x: g * d,
|
|
5292
|
-
y:
|
|
5294
|
+
y: u * c
|
|
5293
5295
|
} : {
|
|
5294
|
-
x:
|
|
5296
|
+
x: u * c,
|
|
5295
5297
|
y: g * d
|
|
5296
5298
|
};
|
|
5297
5299
|
}
|
|
@@ -5345,28 +5347,28 @@ const Hi = function(a) {
|
|
|
5345
5347
|
} = at(a, t), c = {
|
|
5346
5348
|
x: e,
|
|
5347
5349
|
y: i
|
|
5348
|
-
}, d = await he(t, h), f = J(G(s)),
|
|
5349
|
-
let g = c[
|
|
5350
|
+
}, d = await he(t, h), f = J(G(s)), u = ae(f);
|
|
5351
|
+
let g = c[u], m = c[f];
|
|
5350
5352
|
if (r) {
|
|
5351
|
-
const w =
|
|
5353
|
+
const w = u === "y" ? "top" : "left", p = u === "y" ? "bottom" : "right", C = g + d[w], y = g - d[p];
|
|
5352
5354
|
g = It(C, g, y);
|
|
5353
5355
|
}
|
|
5354
5356
|
if (o) {
|
|
5355
5357
|
const w = f === "y" ? "top" : "left", p = f === "y" ? "bottom" : "right", C = m + d[w], y = m - d[p];
|
|
5356
5358
|
m = It(C, m, y);
|
|
5357
5359
|
}
|
|
5358
|
-
const
|
|
5360
|
+
const x = n.fn({
|
|
5359
5361
|
...t,
|
|
5360
|
-
[
|
|
5362
|
+
[u]: g,
|
|
5361
5363
|
[f]: m
|
|
5362
5364
|
});
|
|
5363
5365
|
return {
|
|
5364
|
-
...
|
|
5366
|
+
...x,
|
|
5365
5367
|
data: {
|
|
5366
|
-
x:
|
|
5367
|
-
y:
|
|
5368
|
+
x: x.x - e,
|
|
5369
|
+
y: x.y - i,
|
|
5368
5370
|
enabled: {
|
|
5369
|
-
[
|
|
5371
|
+
[u]: r,
|
|
5370
5372
|
[f]: o
|
|
5371
5373
|
}
|
|
5372
5374
|
}
|
|
@@ -5493,11 +5495,11 @@ function fe(a) {
|
|
|
5493
5495
|
$: n
|
|
5494
5496
|
};
|
|
5495
5497
|
}
|
|
5496
|
-
function
|
|
5498
|
+
function ue(a) {
|
|
5497
5499
|
return N(a) ? a : a.contextElement;
|
|
5498
5500
|
}
|
|
5499
5501
|
function Z(a) {
|
|
5500
|
-
const t =
|
|
5502
|
+
const t = ue(a);
|
|
5501
5503
|
if (!K(t))
|
|
5502
5504
|
return z(1);
|
|
5503
5505
|
const e = t.getBoundingClientRect(), {
|
|
@@ -5512,7 +5514,7 @@ function Z(a) {
|
|
|
5512
5514
|
};
|
|
5513
5515
|
}
|
|
5514
5516
|
const Fi = /* @__PURE__ */ z(0);
|
|
5515
|
-
function
|
|
5517
|
+
function xe(a) {
|
|
5516
5518
|
const t = X(a);
|
|
5517
5519
|
return !Xt() || !t.visualViewport ? Fi : {
|
|
5518
5520
|
x: t.visualViewport.offsetLeft,
|
|
@@ -5524,20 +5526,20 @@ function Bi(a, t, e) {
|
|
|
5524
5526
|
}
|
|
5525
5527
|
function ot(a, t, e, i) {
|
|
5526
5528
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
5527
|
-
const s = a.getBoundingClientRect(), r =
|
|
5529
|
+
const s = a.getBoundingClientRect(), r = ue(a);
|
|
5528
5530
|
let o = z(1);
|
|
5529
5531
|
t && (i ? N(i) && (o = Z(i)) : o = Z(a));
|
|
5530
|
-
const n = Bi(r, e, i) ?
|
|
5532
|
+
const n = Bi(r, e, i) ? xe(r) : z(0);
|
|
5531
5533
|
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;
|
|
5532
5534
|
if (r) {
|
|
5533
|
-
const
|
|
5534
|
-
let m =
|
|
5535
|
-
for (;
|
|
5536
|
-
const w = Z(
|
|
5537
|
-
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b, m = X(
|
|
5535
|
+
const u = X(r), g = i && N(i) ? X(i) : i;
|
|
5536
|
+
let m = u, x = St(m);
|
|
5537
|
+
for (; x && i && g !== m; ) {
|
|
5538
|
+
const w = Z(x), p = x.getBoundingClientRect(), C = F(x), y = p.left + (x.clientLeft + parseFloat(C.paddingLeft)) * w.x, b = p.top + (x.clientTop + parseFloat(C.paddingTop)) * w.y;
|
|
5539
|
+
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b, m = X(x), x = St(m);
|
|
5538
5540
|
}
|
|
5539
5541
|
}
|
|
5540
|
-
return
|
|
5542
|
+
return xt({
|
|
5541
5543
|
width: d,
|
|
5542
5544
|
height: f,
|
|
5543
5545
|
x: h,
|
|
@@ -5560,8 +5562,8 @@ function ki(a) {
|
|
|
5560
5562
|
}, c = z(1);
|
|
5561
5563
|
const d = z(0), f = K(i);
|
|
5562
5564
|
if ((f || !f && !r) && ((tt(i) !== "body" || ht(o)) && (h = pt(i)), K(i))) {
|
|
5563
|
-
const
|
|
5564
|
-
c = Z(i), d.x =
|
|
5565
|
+
const u = ot(i);
|
|
5566
|
+
c = Z(i), d.x = u.x + i.clientLeft, d.y = u.y + i.clientTop;
|
|
5565
5567
|
}
|
|
5566
5568
|
return {
|
|
5567
5569
|
width: e.width * c.x,
|
|
@@ -5621,14 +5623,14 @@ function Gt(a, t, e) {
|
|
|
5621
5623
|
else if (N(t))
|
|
5622
5624
|
i = Wi(t, e);
|
|
5623
5625
|
else {
|
|
5624
|
-
const s =
|
|
5626
|
+
const s = xe(a);
|
|
5625
5627
|
i = {
|
|
5626
5628
|
...t,
|
|
5627
5629
|
x: t.x - s.x,
|
|
5628
5630
|
y: t.y - s.y
|
|
5629
5631
|
};
|
|
5630
5632
|
}
|
|
5631
|
-
return
|
|
5633
|
+
return xt(i);
|
|
5632
5634
|
}
|
|
5633
5635
|
function ge(a, t) {
|
|
5634
5636
|
const e = $(a);
|
|
@@ -5693,10 +5695,10 @@ function qi(a, t, e) {
|
|
|
5693
5695
|
d = g.top + n.scrollTop, c = g.left + n.scrollLeft - // RTL <body> scrollbar.
|
|
5694
5696
|
Tt(s, g);
|
|
5695
5697
|
}
|
|
5696
|
-
const f = o.left + n.scrollLeft - h.x - c,
|
|
5698
|
+
const f = o.left + n.scrollLeft - h.x - c, u = o.top + n.scrollTop - h.y - d;
|
|
5697
5699
|
return {
|
|
5698
5700
|
x: f,
|
|
5699
|
-
y:
|
|
5701
|
+
y: u,
|
|
5700
5702
|
width: o.width,
|
|
5701
5703
|
height: o.height
|
|
5702
5704
|
};
|
|
@@ -5848,26 +5850,26 @@ let Ji = class {
|
|
|
5848
5850
|
top: `${c}px`,
|
|
5849
5851
|
left: `${h}px`
|
|
5850
5852
|
}), f.arrow) {
|
|
5851
|
-
const
|
|
5853
|
+
const u = f.arrow;
|
|
5852
5854
|
["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5853
|
-
top: `${
|
|
5855
|
+
top: `${u.y}px`,
|
|
5854
5856
|
bottom: "",
|
|
5855
5857
|
left: "",
|
|
5856
5858
|
right: "-5px"
|
|
5857
5859
|
}) : ["right", "right-start", "right-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5858
|
-
top: `${
|
|
5860
|
+
top: `${u.y}px`,
|
|
5859
5861
|
bottom: "",
|
|
5860
5862
|
left: "-5px",
|
|
5861
5863
|
right: ""
|
|
5862
5864
|
}) : ["bottom", "bottom-start", "bottom-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5863
5865
|
top: "-5px",
|
|
5864
5866
|
bottom: "",
|
|
5865
|
-
left: `${
|
|
5867
|
+
left: `${u.x}px`,
|
|
5866
5868
|
right: ""
|
|
5867
5869
|
}) : ["top", "top-start", "top-end"].includes(d) && Object.assign(this.arrowEl.style, {
|
|
5868
5870
|
top: "",
|
|
5869
5871
|
bottom: "-5px",
|
|
5870
|
-
left: `${
|
|
5872
|
+
left: `${u.x}px`,
|
|
5871
5873
|
right: ""
|
|
5872
5874
|
});
|
|
5873
5875
|
}
|
|
@@ -6031,8 +6033,8 @@ class Qi {
|
|
|
6031
6033
|
let f = this.ctx.body.visibleHeight;
|
|
6032
6034
|
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") {
|
|
6033
6035
|
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 });
|
|
6034
|
-
const
|
|
6035
|
-
this.inputEl.setSelectionRange(
|
|
6036
|
+
const u = this.inputEl.value.length;
|
|
6037
|
+
this.inputEl.setSelectionRange(u, u);
|
|
6036
6038
|
} else
|
|
6037
6039
|
this.inputEl.style.display = "none";
|
|
6038
6040
|
(this.inputEl.scrollHeight > r || this.drawY < d.height) && this.autoSize();
|
|
@@ -6139,7 +6141,7 @@ class es {
|
|
|
6139
6141
|
n.forEach((w) => {
|
|
6140
6142
|
w.render && (w.fixed === "left" ? c.push(w) : w.fixed === "right" ? d.push(w) : h.push(w));
|
|
6141
6143
|
});
|
|
6142
|
-
const f = e - i,
|
|
6144
|
+
const f = e - i, u = {
|
|
6143
6145
|
key: "left",
|
|
6144
6146
|
style: {
|
|
6145
6147
|
position: "absolute",
|
|
@@ -6182,7 +6184,7 @@ class es {
|
|
|
6182
6184
|
width: `${r}px`,
|
|
6183
6185
|
height: `${o}px`
|
|
6184
6186
|
},
|
|
6185
|
-
views: [
|
|
6187
|
+
views: [u, g, m]
|
|
6186
6188
|
};
|
|
6187
6189
|
}
|
|
6188
6190
|
getBody() {
|
|
@@ -6197,7 +6199,7 @@ class es {
|
|
|
6197
6199
|
fixedLeftWidth: r,
|
|
6198
6200
|
fixedRightWidth: o,
|
|
6199
6201
|
config: { SCROLLER_TRACK_SIZE: n, CSS_PREFIX: h }
|
|
6200
|
-
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - n,
|
|
6202
|
+
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - n, u = {
|
|
6201
6203
|
key: "left",
|
|
6202
6204
|
style: {
|
|
6203
6205
|
position: "absolute",
|
|
@@ -6240,13 +6242,13 @@ class es {
|
|
|
6240
6242
|
width: `${c}px`,
|
|
6241
6243
|
height: `${d}px`
|
|
6242
6244
|
},
|
|
6243
|
-
views: [
|
|
6245
|
+
views: [u, g, m]
|
|
6244
6246
|
};
|
|
6245
6247
|
}
|
|
6246
6248
|
getFooter() {
|
|
6247
6249
|
const t = [], e = [], i = [];
|
|
6248
|
-
this.ctx.footer.renderRows.forEach((
|
|
6249
|
-
|
|
6250
|
+
this.ctx.footer.renderRows.forEach((x) => {
|
|
6251
|
+
x.cells.forEach((w) => {
|
|
6250
6252
|
w.cellType === "footer" && w.renderFooter && (w.render = w.renderFooter, w.fixed === "left" ? e.push(w) : w.fixed === "right" ? i.push(w) : t.push(w));
|
|
6251
6253
|
});
|
|
6252
6254
|
});
|
|
@@ -6265,7 +6267,7 @@ class es {
|
|
|
6265
6267
|
height: `${c}px`
|
|
6266
6268
|
},
|
|
6267
6269
|
cells: e
|
|
6268
|
-
},
|
|
6270
|
+
}, u = {
|
|
6269
6271
|
key: "center",
|
|
6270
6272
|
style: {
|
|
6271
6273
|
position: "absolute",
|
|
@@ -6297,7 +6299,7 @@ class es {
|
|
|
6297
6299
|
width: `${h}px`,
|
|
6298
6300
|
height: `${c}px`
|
|
6299
6301
|
},
|
|
6300
|
-
views: [f,
|
|
6302
|
+
views: [f, u, g]
|
|
6301
6303
|
};
|
|
6302
6304
|
}
|
|
6303
6305
|
}
|
|
@@ -6314,7 +6316,7 @@ class is {
|
|
|
6314
6316
|
e.preventDefault();
|
|
6315
6317
|
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [n, h] = s, { rowIndex: c, colIndex: d } = t;
|
|
6316
6318
|
c >= n && c <= h && d >= r && d <= o || this.ctx.emit("setSelectorCell", t, e);
|
|
6317
|
-
const
|
|
6319
|
+
const u = {
|
|
6318
6320
|
getBoundingClientRect: () => ({
|
|
6319
6321
|
width: 0,
|
|
6320
6322
|
height: 0,
|
|
@@ -6327,7 +6329,7 @@ class is {
|
|
|
6327
6329
|
}),
|
|
6328
6330
|
contextElement: document.body
|
|
6329
6331
|
};
|
|
6330
|
-
Ee(
|
|
6332
|
+
Ee(u, this.contextMenuEl, {
|
|
6331
6333
|
placement: "right-start",
|
|
6332
6334
|
middleware: [pe(), me(), ye()]
|
|
6333
6335
|
}).then(({ x: g, y: m }) => {
|