e-virt-table 0.1.5 → 0.1.7
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 +124 -123
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Editor.js +9 -12
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/Selector.js +5 -6
- package/dist/lib/Selector.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -160,8 +160,8 @@ var Ft = /* @__PURE__ */ function(n) {
|
|
|
160
160
|
function Se(n, t, e, i, s) {
|
|
161
161
|
if (t.first) {
|
|
162
162
|
var r = new Promise(function(x, u) {
|
|
163
|
-
var g = function(
|
|
164
|
-
return i(
|
|
163
|
+
var g = function(p) {
|
|
164
|
+
return i(p), p.length ? u(new Ft(p, Ct(p))) : x(s);
|
|
165
165
|
}, w = Oe(n);
|
|
166
166
|
Xt(w, e, g);
|
|
167
167
|
});
|
|
@@ -170,13 +170,13 @@ function Se(n, t, e, i, s) {
|
|
|
170
170
|
}), r;
|
|
171
171
|
}
|
|
172
172
|
var o = t.firstFields === !0 ? Object.keys(n) : t.firstFields || [], a = Object.keys(n), l = a.length, c = 0, f = [], d = new Promise(function(x, u) {
|
|
173
|
-
var g = function(
|
|
174
|
-
if (f.push.apply(f,
|
|
173
|
+
var g = function(y) {
|
|
174
|
+
if (f.push.apply(f, y), c++, c === l)
|
|
175
175
|
return i(f), f.length ? u(new Ft(f, Ct(f))) : x(s);
|
|
176
176
|
};
|
|
177
177
|
a.length || (i(f), x(s)), a.forEach(function(w) {
|
|
178
|
-
var
|
|
179
|
-
o.indexOf(w) !== -1 ? Xt(
|
|
178
|
+
var y = n[w];
|
|
179
|
+
o.indexOf(w) !== -1 ? Xt(y, e, g) : Ie(y, e, g);
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
182
|
return d.catch(function(x) {
|
|
@@ -242,7 +242,7 @@ var jt = function(t, e, i, s, r, o) {
|
|
|
242
242
|
}, l.v6 = function(m) {
|
|
243
243
|
return m && m.exact ? a : new RegExp("" + t(m) + s + t(m), "g");
|
|
244
244
|
};
|
|
245
|
-
var c = "(?:(?:[a-z]+:)?//)", f = "(?:\\S+(?::\\S*)?@)?", d = l.v4().source, x = l.v6().source, u = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", g = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", w = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",
|
|
245
|
+
var c = "(?:(?:[a-z]+:)?//)", f = "(?:\\S+(?::\\S*)?@)?", d = l.v4().source, x = l.v6().source, u = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", g = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", w = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", y = "(?::\\d{2,5})?", p = '(?:[/?#][^\\s"]*)?', b = "(?:" + c + "|www\\.)" + f + "(?:localhost|" + d + "|" + x + "|" + u + g + w + ")" + y + p;
|
|
246
246
|
return ct = new RegExp("(?:^" + b + "$)", "i"), ct;
|
|
247
247
|
}, Yt = {
|
|
248
248
|
// http://emailregex.com/
|
|
@@ -537,17 +537,17 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
537
537
|
if (typeof l == "function" && (c = l, l = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
538
538
|
return c && c(null, a), Promise.resolve(a);
|
|
539
539
|
function f(w) {
|
|
540
|
-
var
|
|
540
|
+
var y = [], p = {};
|
|
541
541
|
function b(E) {
|
|
542
542
|
if (Array.isArray(E)) {
|
|
543
543
|
var C;
|
|
544
|
-
|
|
544
|
+
y = (C = y).concat.apply(C, E);
|
|
545
545
|
} else
|
|
546
|
-
|
|
546
|
+
y.push(E);
|
|
547
547
|
}
|
|
548
548
|
for (var m = 0; m < w.length; m++)
|
|
549
549
|
b(w[m]);
|
|
550
|
-
|
|
550
|
+
y.length ? (p = Ct(y), c(y, p)) : c(null, a);
|
|
551
551
|
}
|
|
552
552
|
if (l.messages) {
|
|
553
553
|
var d = this.messages();
|
|
@@ -556,44 +556,44 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
556
556
|
l.messages = this.messages();
|
|
557
557
|
var x = {}, u = l.keys || Object.keys(this.rules);
|
|
558
558
|
u.forEach(function(w) {
|
|
559
|
-
var
|
|
560
|
-
|
|
559
|
+
var y = o.rules[w], p = a[w];
|
|
560
|
+
y.forEach(function(b) {
|
|
561
561
|
var m = b;
|
|
562
|
-
typeof m.transform == "function" && (a === i && (a = $({}, a)),
|
|
562
|
+
typeof m.transform == "function" && (a === i && (a = $({}, a)), p = a[w] = m.transform(p)), typeof m == "function" ? m = {
|
|
563
563
|
validator: m
|
|
564
564
|
} : m = $({}, m), m.validator = o.getValidationMethod(m), m.validator && (m.field = w, m.fullField = m.fullField || w, m.type = o.getType(m), x[w] = x[w] || [], x[w].push({
|
|
565
565
|
rule: m,
|
|
566
|
-
value:
|
|
566
|
+
value: p,
|
|
567
567
|
source: a,
|
|
568
568
|
field: w
|
|
569
569
|
}));
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
572
|
var g = {};
|
|
573
|
-
return Se(x, l, function(w,
|
|
574
|
-
var
|
|
575
|
-
b = b && (
|
|
573
|
+
return Se(x, l, function(w, y) {
|
|
574
|
+
var p = w.rule, b = (p.type === "object" || p.type === "array") && (typeof p.fields == "object" || typeof p.defaultField == "object");
|
|
575
|
+
b = b && (p.required || !p.required && w.value), p.field = w.field;
|
|
576
576
|
function m(R, S) {
|
|
577
577
|
return $({}, S, {
|
|
578
|
-
fullField:
|
|
579
|
-
fullFields:
|
|
578
|
+
fullField: p.fullField + "." + R,
|
|
579
|
+
fullFields: p.fullFields ? [].concat(p.fullFields, [R]) : [R]
|
|
580
580
|
});
|
|
581
581
|
}
|
|
582
582
|
function E(R) {
|
|
583
583
|
R === void 0 && (R = []);
|
|
584
584
|
var S = Array.isArray(R) ? R : [R];
|
|
585
|
-
!l.suppressWarning && S.length && n.warning("async-validator:", S), S.length &&
|
|
586
|
-
var A = S.map(kt(
|
|
585
|
+
!l.suppressWarning && S.length && n.warning("async-validator:", S), S.length && p.message !== void 0 && (S = [].concat(p.message));
|
|
586
|
+
var A = S.map(kt(p, a));
|
|
587
587
|
if (l.first && A.length)
|
|
588
|
-
return g[
|
|
588
|
+
return g[p.field] = 1, y(A);
|
|
589
589
|
if (!b)
|
|
590
|
-
|
|
590
|
+
y(A);
|
|
591
591
|
else {
|
|
592
|
-
if (
|
|
593
|
-
return
|
|
592
|
+
if (p.required && !w.value)
|
|
593
|
+
return p.message !== void 0 ? A = [].concat(p.message).map(kt(p, a)) : l.error && (A = [l.error(p, M(l.messages.required, p.field))]), y(A);
|
|
594
594
|
var L = {};
|
|
595
|
-
|
|
596
|
-
L[I] =
|
|
595
|
+
p.defaultField && Object.keys(w.value).map(function(I) {
|
|
596
|
+
L[I] = p.defaultField;
|
|
597
597
|
}), L = $({}, L, w.rule.fields);
|
|
598
598
|
var D = {};
|
|
599
599
|
Object.keys(L).forEach(function(I) {
|
|
@@ -603,22 +603,22 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
603
603
|
var B = new n(D);
|
|
604
604
|
B.messages(l.messages), w.rule.options && (w.rule.options.messages = l.messages, w.rule.options.error = l.error), B.validate(w.value, w.rule.options || l, function(I) {
|
|
605
605
|
var T = [];
|
|
606
|
-
A && A.length && T.push.apply(T, A), I && I.length && T.push.apply(T, I),
|
|
606
|
+
A && A.length && T.push.apply(T, A), I && I.length && T.push.apply(T, I), y(T.length ? T : null);
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
610
|
var C;
|
|
611
|
-
if (
|
|
612
|
-
C =
|
|
613
|
-
else if (
|
|
611
|
+
if (p.asyncValidator)
|
|
612
|
+
C = p.asyncValidator(p, w.value, E, w.source, l);
|
|
613
|
+
else if (p.validator) {
|
|
614
614
|
try {
|
|
615
|
-
C =
|
|
615
|
+
C = p.validator(p, w.value, E, w.source, l);
|
|
616
616
|
} catch (R) {
|
|
617
617
|
console.error == null || console.error(R), l.suppressValidatorError || setTimeout(function() {
|
|
618
618
|
throw R;
|
|
619
619
|
}, 0), E(R.message);
|
|
620
620
|
}
|
|
621
|
-
C === !0 ? E() : C === !1 ? E(typeof
|
|
621
|
+
C === !0 ? E() : C === !1 ? E(typeof p.message == "function" ? p.message(p.fullField || p.field) : p.message || (p.fullField || p.field) + " fails") : C instanceof Array ? E(C) : C instanceof Error && E(C.message);
|
|
622
622
|
}
|
|
623
623
|
C && C.then && C.then(function() {
|
|
624
624
|
return E();
|
|
@@ -795,12 +795,12 @@ class ii {
|
|
|
795
795
|
const u = i._height || l, g = i._readonly;
|
|
796
796
|
let w = !0;
|
|
797
797
|
if (typeof c == "function" && (w = c), f) {
|
|
798
|
-
const
|
|
799
|
-
if (this.checkboxKeyMap.has(
|
|
800
|
-
const
|
|
801
|
-
|
|
798
|
+
const y = i[f];
|
|
799
|
+
if (this.checkboxKeyMap.has(y)) {
|
|
800
|
+
const p = this.checkboxKeyMap.get(y);
|
|
801
|
+
p.push(x), this.checkboxKeyMap.set(y, p);
|
|
802
802
|
} else
|
|
803
|
-
this.checkboxKeyMap.set(
|
|
803
|
+
this.checkboxKeyMap.set(y, [x]);
|
|
804
804
|
}
|
|
805
805
|
this.rowKeyMap.set(x, {
|
|
806
806
|
readonly: g,
|
|
@@ -2093,8 +2093,8 @@ class ee extends te {
|
|
|
2093
2093
|
} else
|
|
2094
2094
|
o = x * 8;
|
|
2095
2095
|
if (r) {
|
|
2096
|
-
let u = 20, g = 20, w = this.drawX + o + e,
|
|
2097
|
-
this.ctx.paint.drawImage(r, w,
|
|
2096
|
+
let u = 20, g = 20, w = this.drawX + o + e, y = this.drawY + (this.visibleHeight - g) / 2;
|
|
2097
|
+
this.ctx.paint.drawImage(r, w, y, u, g), this.drawImageX = w, this.drawImageY = y, this.drawImageWidth = u, this.drawImageHeight = g, this.drawImageName = a, this.drawImageSource = r, this.align = "left", this.drawTextX = o + this.drawX + u - 0.5;
|
|
2098
2098
|
}
|
|
2099
2099
|
}
|
|
2100
2100
|
}
|
|
@@ -2112,7 +2112,7 @@ class ee extends te {
|
|
|
2112
2112
|
HIGHLIGHT_HOVER_ROW_COLOR: d
|
|
2113
2113
|
} = this.ctx.config;
|
|
2114
2114
|
if (this.cellType === "footer") {
|
|
2115
|
-
let
|
|
2115
|
+
let p = a, b = o;
|
|
2116
2116
|
if (typeof r == "function") {
|
|
2117
2117
|
const m = r, { backgroundColor: E, color: C } = m({
|
|
2118
2118
|
row: this.row,
|
|
@@ -2121,37 +2121,37 @@ class ee extends te {
|
|
|
2121
2121
|
column: this.column,
|
|
2122
2122
|
value: this.getValue()
|
|
2123
2123
|
}) || {};
|
|
2124
|
-
E && (
|
|
2124
|
+
E && (p = E), C && (b = C);
|
|
2125
2125
|
}
|
|
2126
|
-
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor =
|
|
2126
|
+
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = p, this.drawTextColor = b;
|
|
2127
2127
|
return;
|
|
2128
2128
|
}
|
|
2129
2129
|
let x = "transparent";
|
|
2130
2130
|
const u = this.ctx.focusCell, g = this.ctx.hoverCell;
|
|
2131
2131
|
f && (g == null ? void 0 : g.rowKey) === this.rowKey && (x = d), l && (u == null ? void 0 : u.rowKey) === this.rowKey && (x = c), this.drawCellSkyBgColor = x;
|
|
2132
|
-
let w = e,
|
|
2132
|
+
let w = e, y = o;
|
|
2133
2133
|
if (["index", "index-selection", "selection"].includes(this.type)) {
|
|
2134
2134
|
this.drawCellBgColor = e, this.drawTextColor = o;
|
|
2135
2135
|
return;
|
|
2136
2136
|
}
|
|
2137
|
-
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (w = i,
|
|
2138
|
-
const
|
|
2137
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (w = i, y = o), typeof s == "function") {
|
|
2138
|
+
const p = s, { backgroundColor: b, color: m } = p({
|
|
2139
2139
|
row: this.row,
|
|
2140
2140
|
rowIndex: this.rowIndex,
|
|
2141
2141
|
colIndex: this.colIndex,
|
|
2142
2142
|
column: this.column,
|
|
2143
2143
|
value: this.getValue()
|
|
2144
2144
|
}) || {};
|
|
2145
|
-
b && (w = b), m && (
|
|
2145
|
+
b && (w = b), m && (y = m);
|
|
2146
2146
|
}
|
|
2147
|
-
this.drawCellBgColor = w, this.drawTextColor =
|
|
2147
|
+
this.drawCellBgColor = w, this.drawTextColor = y;
|
|
2148
2148
|
}
|
|
2149
2149
|
updateSelection() {
|
|
2150
2150
|
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: a, rowIndex: l, rowKey: c } = this;
|
|
2151
2151
|
if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(a)) {
|
|
2152
2152
|
const f = this.ctx.database.getRowSelection(c), d = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: x = 0 } = this.ctx.config, u = this.drawX + (e - x) / 2, g = this.drawY + (i - x) / 2;
|
|
2153
|
-
let w = this.ctx.icons.get("checkbox-uncheck"),
|
|
2154
|
-
f && d ? (w = this.ctx.icons.get("checkbox-check"),
|
|
2153
|
+
let w = this.ctx.icons.get("checkbox-uncheck"), y = "checkbox-uncheck";
|
|
2154
|
+
f && d ? (w = this.ctx.icons.get("checkbox-check"), y = "checkbox-check") : f && d ? (w = this.ctx.icons.get("checkbox-check-disabled"), y = "checkbox-check-disabled") : !f && d ? (w = this.ctx.icons.get("checkbox-uncheck"), y = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), y = "checkbox-disabled"), w && a == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(y)) && (this.drawImageX = u, this.drawImageY = g, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = y, this.drawImageSource = w) : w && a === "selection" && (this.drawImageX = u, this.drawImageY = g, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = y, this.drawImageSource = w);
|
|
2155
2155
|
}
|
|
2156
2156
|
}
|
|
2157
2157
|
updateHoverIcon() {
|
|
@@ -2338,31 +2338,31 @@ class ee extends te {
|
|
|
2338
2338
|
const { drawX: i, drawY: s, width: r, rowIndex: o, colIndex: a } = this;
|
|
2339
2339
|
let l = i + 0.5, c = s + 0.5, f = this.height;
|
|
2340
2340
|
o === 0 && (c = this.y + 1, f = f - 1), a === this.ctx.maxColIndex && (l = l - 1);
|
|
2341
|
-
const { xArr: d, yArr: x, lineDash: u = [], borderWidth: g = 1, borderColor: w, fillColor:
|
|
2342
|
-
a >=
|
|
2341
|
+
const { xArr: d, yArr: x, lineDash: u = [], borderWidth: g = 1, borderColor: w, fillColor: y } = e, p = d[0], b = d[1], m = x[0], E = x[1];
|
|
2342
|
+
a >= p && a <= b && o === m && this.ctx.paint.drawLine([l, c, l + r - 2, c], {
|
|
2343
2343
|
borderColor: w,
|
|
2344
|
-
fillColor:
|
|
2344
|
+
fillColor: y,
|
|
2345
2345
|
borderWidth: g,
|
|
2346
2346
|
lineCap: "round",
|
|
2347
2347
|
lineJoin: "round",
|
|
2348
2348
|
lineDash: u
|
|
2349
|
-
}), a >=
|
|
2349
|
+
}), a >= p && a <= b && o === E && this.ctx.paint.drawLine([l, c + f - 1.5, l + r, c + f - 1.5], {
|
|
2350
2350
|
borderColor: w,
|
|
2351
|
-
fillColor:
|
|
2351
|
+
fillColor: y,
|
|
2352
2352
|
borderWidth: g,
|
|
2353
2353
|
lineCap: "round",
|
|
2354
2354
|
lineJoin: "round",
|
|
2355
2355
|
lineDash: u
|
|
2356
|
-
}), a ===
|
|
2356
|
+
}), a === p && o >= m && o <= E && this.ctx.paint.drawLine([l, c, l, c + f - 1], {
|
|
2357
2357
|
borderColor: w,
|
|
2358
|
-
fillColor:
|
|
2358
|
+
fillColor: y,
|
|
2359
2359
|
borderWidth: g,
|
|
2360
2360
|
lineCap: "round",
|
|
2361
2361
|
lineJoin: "round",
|
|
2362
2362
|
lineDash: u
|
|
2363
2363
|
}), a === b && o >= m && o <= E && this.ctx.paint.drawLine([l + r - 1.5, c, l + r - 1.5, c + f - 1.5], {
|
|
2364
2364
|
borderColor: w,
|
|
2365
|
-
fillColor:
|
|
2365
|
+
fillColor: y,
|
|
2366
2366
|
borderWidth: g,
|
|
2367
2367
|
lineCap: "round",
|
|
2368
2368
|
lineJoin: "round",
|
|
@@ -3315,12 +3315,12 @@ class fi {
|
|
|
3315
3315
|
width: this.width,
|
|
3316
3316
|
height: this.data.length ? 0 : a + g
|
|
3317
3317
|
});
|
|
3318
|
-
let
|
|
3319
|
-
|
|
3320
|
-
let
|
|
3321
|
-
this.data.length && c ? (
|
|
3318
|
+
let y = this.height + e.height + r;
|
|
3319
|
+
y += g;
|
|
3320
|
+
let p = 0;
|
|
3321
|
+
this.data.length && c ? (p = window.innerHeight - u - f, p < 0 && (p = 32, console.error(
|
|
3322
3322
|
"There is an error in the height calculation ENABLE_OFFSET_HEIGHT and OFFSET_HEIGHT are invalid"
|
|
3323
|
-
))) : this.data.length && o ?
|
|
3323
|
+
))) : this.data.length && o ? p = o : this.data.length && l && y > l ? p = l : p = y, p > 0 && (this.ctx.stageHeight = Math.floor(p), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
|
|
3324
3324
|
let b = this.ctx.stageHeight - e.height - r;
|
|
3325
3325
|
s ? this.visibleHeight = b - g : this.visibleHeight = b, 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 = d;
|
|
3326
3326
|
const m = window.devicePixelRatio || 1, E = this.ctx.stageWidth * m, C = this.ctx.stageHeight * m;
|
|
@@ -3634,11 +3634,11 @@ class ui {
|
|
|
3634
3634
|
SELECTOR_AREA_MAX_Y: f,
|
|
3635
3635
|
SELECTOR_AREA_MAX_X_OFFSET: d,
|
|
3636
3636
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
3637
|
-
} = this.ctx.config, u = a, g = l || this.ctx.maxColIndex - d, w = c,
|
|
3638
|
-
let [
|
|
3639
|
-
if (
|
|
3637
|
+
} = this.ctx.config, u = a, g = l || this.ctx.maxColIndex - d, w = c, y = f || this.ctx.maxRowIndex - x;
|
|
3638
|
+
let [p, b] = r, [m, E] = o;
|
|
3639
|
+
if (p < u || b > g || m < w || E > y)
|
|
3640
3640
|
return;
|
|
3641
|
-
this.ctx.selector.xArr = [Math.max(u,
|
|
3641
|
+
this.ctx.selector.xArr = [Math.max(u, p), Math.min(g, b)], this.ctx.selector.yArr = [Math.max(w, m), Math.min(y, E)], this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
|
|
3642
3642
|
}
|
|
3643
3643
|
}
|
|
3644
3644
|
selectCols(t) {
|
|
@@ -3790,10 +3790,10 @@ class ui {
|
|
|
3790
3790
|
u
|
|
3791
3791
|
);
|
|
3792
3792
|
if (w) {
|
|
3793
|
-
const { rowKey:
|
|
3794
|
-
this.ctx.database.getReadonly(
|
|
3795
|
-
rowKey:
|
|
3796
|
-
key:
|
|
3793
|
+
const { rowKey: y, key: p } = w;
|
|
3794
|
+
this.ctx.database.getReadonly(y, p) || (s.add(y), a.push({
|
|
3795
|
+
rowKey: y,
|
|
3796
|
+
key: p,
|
|
3797
3797
|
value: g,
|
|
3798
3798
|
row: {}
|
|
3799
3799
|
//内部有设置
|
|
@@ -3904,17 +3904,18 @@ class ui {
|
|
|
3904
3904
|
fixedLeftWidth: r,
|
|
3905
3905
|
header: o,
|
|
3906
3906
|
footer: a,
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3907
|
+
body: l,
|
|
3908
|
+
scrollX: c,
|
|
3909
|
+
scrollY: f,
|
|
3910
|
+
config: { SCROLLER_TRACK_SIZE: d, FOOTER_FIXED: x }
|
|
3910
3911
|
} = this.ctx;
|
|
3911
|
-
if (!i || i.height >
|
|
3912
|
+
if (!i || i.height > l.visibleHeight || i.width > l.visibleWidth - r - s)
|
|
3912
3913
|
return;
|
|
3913
|
-
let
|
|
3914
|
-
if (
|
|
3914
|
+
let u = 0;
|
|
3915
|
+
if (x && (u = a.visibleHeight), i.fixed || !(i.drawX < r || i.drawX + i.width > e - s || i.drawY < this.ctx.header.height || i.drawY + i.height > t - u - d))
|
|
3915
3916
|
return;
|
|
3916
|
-
const
|
|
3917
|
-
|
|
3917
|
+
const g = r - i.drawX + 1, w = i.drawX + i.width - (e - s) + 1, y = o.height - i.drawY, p = i.drawY + i.height - (t - u - d);
|
|
3918
|
+
w > 0 && !i.fixed ? this.ctx.setScrollX(c + w) : g > 0 && !i.fixed && this.ctx.setScrollX(c - g), y > 0 ? this.ctx.setScrollY(f - y) : p > 0 && this.ctx.setScrollY(f + p), this.ctx.emit("adjustBoundaryPosition", i);
|
|
3918
3919
|
}
|
|
3919
3920
|
destroy() {
|
|
3920
3921
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
@@ -3930,8 +3931,8 @@ class gi {
|
|
|
3930
3931
|
this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default");
|
|
3931
3932
|
const { offsetX: i, offsetY: s } = this.ctx.getOffset(e), { xArr: r, yArr: o } = this.ctx.selector, a = r[1], l = o[1], { colIndex: c, rowIndex: f, drawX: d, drawY: x, width: u, height: g } = t;
|
|
3932
3933
|
if (this.ctx.config.ENABLE_AUTOFILL && c === a && f === l) {
|
|
3933
|
-
const
|
|
3934
|
-
i >
|
|
3934
|
+
const y = d + u - 6, p = x + g - 6;
|
|
3935
|
+
i > y && s > p && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
3935
3936
|
}
|
|
3936
3937
|
this.mouseenter(t);
|
|
3937
3938
|
}), this.ctx.on("cellMousedown", () => {
|
|
@@ -3977,11 +3978,11 @@ class gi {
|
|
|
3977
3978
|
SELECTOR_AREA_MAX_Y: d,
|
|
3978
3979
|
SELECTOR_AREA_MAX_X_OFFSET: x,
|
|
3979
3980
|
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
3980
|
-
} = this.ctx.config, g = l, w = c || this.ctx.maxColIndex - x,
|
|
3981
|
+
} = this.ctx.config, g = l, w = c || this.ctx.maxColIndex - x, y = f, p = d || this.ctx.maxRowIndex - u;
|
|
3981
3982
|
let [b, m] = o, [E, C] = a;
|
|
3982
|
-
if (b < g || E <
|
|
3983
|
+
if (b < g || E < y)
|
|
3983
3984
|
return;
|
|
3984
|
-
this.ctx.autofill.xArr = [Math.max(g, b), Math.min(w, m)], this.ctx.autofill.yArr = [Math.max(
|
|
3985
|
+
this.ctx.autofill.xArr = [Math.max(g, b), Math.min(w, m)], this.ctx.autofill.yArr = [Math.max(y, E), Math.min(p, C)], this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
|
|
3985
3986
|
}
|
|
3986
3987
|
}
|
|
3987
3988
|
/**
|
|
@@ -3998,9 +3999,9 @@ class gi {
|
|
|
3998
3999
|
let c = [];
|
|
3999
4000
|
for (let d = 0; d <= l[1] - l[0]; d++)
|
|
4000
4001
|
for (let x = 0; x <= a[1] - a[0]; x++) {
|
|
4001
|
-
const u = x + a[0], g = d + l[0], w = s[d % o][x % r],
|
|
4002
|
-
if (
|
|
4003
|
-
const { rowKey: b, key: m } =
|
|
4002
|
+
const u = x + a[0], g = d + l[0], w = s[d % o][x % r], y = this.ctx.database.getItemValueForRowIndexAndColIndex(g, u), p = `${g}-${u}`;
|
|
4003
|
+
if (y && !i.has(p)) {
|
|
4004
|
+
const { rowKey: b, key: m } = y;
|
|
4004
4005
|
this.ctx.database.getReadonly(b, m) || (t.add(b), c.push({
|
|
4005
4006
|
rowKey: b,
|
|
4006
4007
|
key: m,
|
|
@@ -4199,14 +4200,14 @@ const vi = async (n, t, e) => {
|
|
|
4199
4200
|
} = Vt(c, i, l), x = i, u = {}, g = 0;
|
|
4200
4201
|
for (let w = 0; w < a.length; w++) {
|
|
4201
4202
|
const {
|
|
4202
|
-
name:
|
|
4203
|
-
fn:
|
|
4203
|
+
name: y,
|
|
4204
|
+
fn: p
|
|
4204
4205
|
} = a[w], {
|
|
4205
4206
|
x: b,
|
|
4206
4207
|
y: m,
|
|
4207
4208
|
data: E,
|
|
4208
4209
|
reset: C
|
|
4209
|
-
} = await
|
|
4210
|
+
} = await p({
|
|
4210
4211
|
x: f,
|
|
4211
4212
|
y: d,
|
|
4212
4213
|
initialPlacement: i,
|
|
@@ -4222,8 +4223,8 @@ const vi = async (n, t, e) => {
|
|
|
4222
4223
|
});
|
|
4223
4224
|
f = b ?? f, d = m ?? d, u = {
|
|
4224
4225
|
...u,
|
|
4225
|
-
[
|
|
4226
|
-
...u[
|
|
4226
|
+
[y]: {
|
|
4227
|
+
...u[y],
|
|
4227
4228
|
...E
|
|
4228
4229
|
}
|
|
4229
4230
|
}, C && g <= 50 && (g++, typeof C == "object" && (C.placement && (x = C.placement), C.rects && (c = C.rects === !0 ? await o.getElementRects({
|
|
@@ -4259,8 +4260,8 @@ async function ne(n, t) {
|
|
|
4259
4260
|
elementContext: d = "floating",
|
|
4260
4261
|
altBoundary: x = !1,
|
|
4261
4262
|
padding: u = 0
|
|
4262
|
-
} = at(t, n), g = oe(u),
|
|
4263
|
-
element: (e = await (r.isElement == null ? void 0 : r.isElement(
|
|
4263
|
+
} = at(t, n), g = oe(u), y = a[x ? d === "floating" ? "reference" : "floating" : d], p = ut(await r.getClippingRect({
|
|
4264
|
+
element: (e = await (r.isElement == null ? void 0 : r.isElement(y))) == null || e ? y : y.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(a.floating)),
|
|
4264
4265
|
boundary: c,
|
|
4265
4266
|
rootBoundary: f,
|
|
4266
4267
|
strategy: l
|
|
@@ -4282,10 +4283,10 @@ async function ne(n, t) {
|
|
|
4282
4283
|
strategy: l
|
|
4283
4284
|
}) : b);
|
|
4284
4285
|
return {
|
|
4285
|
-
top: (
|
|
4286
|
-
bottom: (C.bottom -
|
|
4287
|
-
left: (
|
|
4288
|
-
right: (C.right -
|
|
4286
|
+
top: (p.top - C.top + g.top) / E.y,
|
|
4287
|
+
bottom: (C.bottom - p.bottom + g.bottom) / E.y,
|
|
4288
|
+
left: (p.left - C.left + g.left) / E.x,
|
|
4289
|
+
right: (C.right - p.right + g.right) / E.x
|
|
4289
4290
|
};
|
|
4290
4291
|
}
|
|
4291
4292
|
const Ri = (n) => ({
|
|
@@ -4309,10 +4310,10 @@ const Ri = (n) => ({
|
|
|
4309
4310
|
const d = oe(f), x = {
|
|
4310
4311
|
x: e,
|
|
4311
4312
|
y: i
|
|
4312
|
-
}, u = Mt(s), g = Lt(u), w = await o.getDimensions(c),
|
|
4313
|
+
}, u = Mt(s), g = Lt(u), w = await o.getDimensions(c), y = u === "y", p = y ? "top" : "left", b = y ? "bottom" : "right", m = y ? "clientHeight" : "clientWidth", E = r.reference[g] + r.reference[u] - x[u] - r.floating[g], C = x[u] - r.reference[u], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
|
|
4313
4314
|
let S = R ? R[m] : 0;
|
|
4314
4315
|
(!S || !await (o.isElement == null ? void 0 : o.isElement(R))) && (S = a.floating[m] || r.floating[g]);
|
|
4315
|
-
const A = E / 2 - C / 2, L = S / 2 - w[g] / 2 - 1, D = rt(d[
|
|
4316
|
+
const A = E / 2 - C / 2, L = S / 2 - w[g] / 2 - 1, D = rt(d[p], L), B = rt(d[b], L), I = D, T = S - w[g] - B, O = S / 2 - w[g] / 2 + A, G = It(I, O, T), Y = !l.arrow && ht(s) != null && O !== G && r.reference[g] / 2 - (O < I ? D : B) - w[g] / 2 < 0, k = Y ? O < I ? O - I : O - T : 0;
|
|
4316
4317
|
return {
|
|
4317
4318
|
[u]: x[u] + k,
|
|
4318
4319
|
data: {
|
|
@@ -4345,15 +4346,15 @@ const Ri = (n) => ({
|
|
|
4345
4346
|
fallbackStrategy: u = "bestFit",
|
|
4346
4347
|
fallbackAxisSideDirection: g = "none",
|
|
4347
4348
|
flipAlignment: w = !0,
|
|
4348
|
-
...
|
|
4349
|
+
...y
|
|
4349
4350
|
} = at(n, t);
|
|
4350
4351
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
4351
4352
|
return {};
|
|
4352
|
-
const
|
|
4353
|
+
const p = q(s), b = J(a), m = q(a) === a, E = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), C = x || (m || !w ? [xt(a)] : mi(a)), R = g !== "none";
|
|
4353
4354
|
!x && R && C.push(...bi(a, w, g, E));
|
|
4354
|
-
const S = [a, ...C], A = await ne(t,
|
|
4355
|
+
const S = [a, ...C], A = await ne(t, y), L = [];
|
|
4355
4356
|
let D = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
4356
|
-
if (f && L.push(A[
|
|
4357
|
+
if (f && L.push(A[p]), d) {
|
|
4357
4358
|
const O = yi(s, o, E);
|
|
4358
4359
|
L.push(A[O[0]], A[O[1]]);
|
|
4359
4360
|
}
|
|
@@ -4467,13 +4468,13 @@ const Oi = function(n) {
|
|
|
4467
4468
|
mainAxis: r = !0,
|
|
4468
4469
|
crossAxis: o = !1,
|
|
4469
4470
|
limiter: a = {
|
|
4470
|
-
fn: (
|
|
4471
|
+
fn: (y) => {
|
|
4471
4472
|
let {
|
|
4472
|
-
x:
|
|
4473
|
+
x: p,
|
|
4473
4474
|
y: b
|
|
4474
|
-
} =
|
|
4475
|
+
} = y;
|
|
4475
4476
|
return {
|
|
4476
|
-
x:
|
|
4477
|
+
x: p,
|
|
4477
4478
|
y: b
|
|
4478
4479
|
};
|
|
4479
4480
|
}
|
|
@@ -4485,11 +4486,11 @@ const Oi = function(n) {
|
|
|
4485
4486
|
}, f = await ne(t, l), d = J(q(s)), x = re(d);
|
|
4486
4487
|
let u = c[x], g = c[d];
|
|
4487
4488
|
if (r) {
|
|
4488
|
-
const
|
|
4489
|
+
const y = x === "y" ? "top" : "left", p = x === "y" ? "bottom" : "right", b = u + f[y], m = u - f[p];
|
|
4489
4490
|
u = It(b, u, m);
|
|
4490
4491
|
}
|
|
4491
4492
|
if (o) {
|
|
4492
|
-
const
|
|
4493
|
+
const y = d === "y" ? "top" : "left", p = d === "y" ? "bottom" : "right", b = g + f[y], m = g - f[p];
|
|
4493
4494
|
g = It(b, g, m);
|
|
4494
4495
|
}
|
|
4495
4496
|
const w = a.fn({
|
|
@@ -4670,8 +4671,8 @@ function ot(n, t, e, i) {
|
|
|
4670
4671
|
const x = H(r), u = i && X(i) ? H(i) : i;
|
|
4671
4672
|
let g = x, w = Tt(g);
|
|
4672
4673
|
for (; w && i && u !== g; ) {
|
|
4673
|
-
const
|
|
4674
|
-
l *=
|
|
4674
|
+
const y = Z(w), p = w.getBoundingClientRect(), b = F(w), m = p.left + (w.clientLeft + parseFloat(b.paddingLeft)) * y.x, E = p.top + (w.clientTop + parseFloat(b.paddingTop)) * y.y;
|
|
4675
|
+
l *= y.x, c *= y.y, f *= y.x, d *= y.y, l += m, c += E, g = H(w), w = Tt(g);
|
|
4675
4676
|
}
|
|
4676
4677
|
}
|
|
4677
4678
|
return ut({
|
|
@@ -5101,7 +5102,7 @@ class qi {
|
|
|
5101
5102
|
header: r,
|
|
5102
5103
|
config: { SCROLLER_TRACK_SIZE: o }
|
|
5103
5104
|
} = this.ctx, a = i - s.height - o;
|
|
5104
|
-
this.editorEl.style.bottom = "auto", (this.drawY + t > a || this.drawY < r.height) && (this.editorEl.style.left = `${this.drawX}px`, this.editorEl.style.top = "auto", this.editorEl.style.bottom = `${i - a}px`), this.inputEl.style.height = `${t}px`;
|
|
5105
|
+
this.editorEl.style.bottom = "auto", (this.drawY + t > a || this.drawY < r.height) && (this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = "auto", this.editorEl.style.bottom = `${i - a}px`), this.inputEl.style.height = `${t}px`;
|
|
5105
5106
|
}
|
|
5106
5107
|
startEditByInput(t) {
|
|
5107
5108
|
const e = t.getValue(), { width: i, editorType: s } = t, r = t.getDrawX();
|
|
@@ -5113,7 +5114,7 @@ class qi {
|
|
|
5113
5114
|
header: c
|
|
5114
5115
|
} = this.ctx;
|
|
5115
5116
|
let f = this.ctx.body.visibleHeight;
|
|
5116
|
-
if (a > f && (a = f), this.editorEl.style.left = `${r}px`, this.editorEl.style.top = `${o}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text") {
|
|
5117
|
+
if (a > f && (a = f), this.editorEl.style.left = `${r - 1}px`, this.editorEl.style.top = `${o - 1}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text") {
|
|
5117
5118
|
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${a - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${i - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${l}px`, e !== null && (this.inputEl.value = e), this.inputEl.focus();
|
|
5118
5119
|
const d = this.inputEl.value.length;
|
|
5119
5120
|
this.inputEl.setSelectionRange(d, d);
|
|
@@ -5152,7 +5153,7 @@ class qi {
|
|
|
5152
5153
|
r && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = r, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
5153
5154
|
}
|
|
5154
5155
|
doneEdit() {
|
|
5155
|
-
this.enable &&
|
|
5156
|
+
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.stageElement.focus(), this.ctx.editing = !1, this.ctx.emit("draw"));
|
|
5156
5157
|
}
|
|
5157
5158
|
destroy() {
|
|
5158
5159
|
var t;
|
|
@@ -5215,8 +5216,8 @@ class ji {
|
|
|
5215
5216
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
5216
5217
|
} = this.ctx, { visibleWidth: r, visibleHeight: o, renderCellHeaders: a } = this.ctx.header;
|
|
5217
5218
|
let l = [], c = [], f = [];
|
|
5218
|
-
a.forEach((
|
|
5219
|
-
|
|
5219
|
+
a.forEach((y) => {
|
|
5220
|
+
y.render && (y.fixed === "left" ? c.push(y) : y.fixed === "right" ? f.push(y) : l.push(y));
|
|
5220
5221
|
});
|
|
5221
5222
|
const d = e - i, x = {
|
|
5222
5223
|
key: "left",
|
|
@@ -5267,9 +5268,9 @@ class ji {
|
|
|
5267
5268
|
getBody() {
|
|
5268
5269
|
const t = [], e = [], i = [];
|
|
5269
5270
|
let s = this.ctx.body.renderRows;
|
|
5270
|
-
this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((
|
|
5271
|
-
|
|
5272
|
-
|
|
5271
|
+
this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((y) => {
|
|
5272
|
+
y.cells.forEach((p) => {
|
|
5273
|
+
p.cellType === "footer" && (p.render = p.renderFooter), p.render && (p.fixed === "left" ? e.push(p) : p.fixed === "right" ? i.push(p) : t.push(p));
|
|
5273
5274
|
});
|
|
5274
5275
|
});
|
|
5275
5276
|
const {
|
|
@@ -5325,8 +5326,8 @@ class ji {
|
|
|
5325
5326
|
getFooter() {
|
|
5326
5327
|
const t = [], e = [], i = [];
|
|
5327
5328
|
this.ctx.footer.renderRows.forEach((w) => {
|
|
5328
|
-
w.cells.forEach((
|
|
5329
|
-
|
|
5329
|
+
w.cells.forEach((y) => {
|
|
5330
|
+
y.cellType === "footer" && y.renderFooter && (y.render = y.renderFooter, y.fixed === "left" ? e.push(y) : y.fixed === "right" ? i.push(y) : t.push(y));
|
|
5330
5331
|
});
|
|
5331
5332
|
});
|
|
5332
5333
|
const {
|