e-virt-table 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +131 -107
- 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.d.ts +1 -0
- package/dist/lib/Editor.js +35 -9
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/Selector.js +4 -0
- package/dist/lib/Selector.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -69,9 +69,9 @@ function bt(n) {
|
|
|
69
69
|
}), st(s, i);
|
|
70
70
|
}, bt(n);
|
|
71
71
|
}
|
|
72
|
-
var Re = /%[sdj%]/g,
|
|
72
|
+
var Re = /%[sdj%]/g, Jt = function() {
|
|
73
73
|
};
|
|
74
|
-
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (
|
|
74
|
+
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (Jt = function(t, e) {
|
|
75
75
|
typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && e.every(function(i) {
|
|
76
76
|
return typeof i == "string";
|
|
77
77
|
}) && console.warn(t, e);
|
|
@@ -131,7 +131,7 @@ function Ie(n, t, e) {
|
|
|
131
131
|
t(a, o);
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function Yt(n, t, e) {
|
|
135
135
|
var i = 0, s = n.length;
|
|
136
136
|
function r(o) {
|
|
137
137
|
if (o && o.length) {
|
|
@@ -149,7 +149,7 @@ function Oe(n) {
|
|
|
149
149
|
t.push.apply(t, n[e] || []);
|
|
150
150
|
}), t;
|
|
151
151
|
}
|
|
152
|
-
var
|
|
152
|
+
var Kt = /* @__PURE__ */ function(n) {
|
|
153
153
|
be(t, n);
|
|
154
154
|
function t(e, i) {
|
|
155
155
|
var s;
|
|
@@ -161,9 +161,9 @@ function Te(n, t, e, i, s) {
|
|
|
161
161
|
if (t.first) {
|
|
162
162
|
var r = new Promise(function(x, u) {
|
|
163
163
|
var g = function(y) {
|
|
164
|
-
return i(y), y.length ? u(new
|
|
164
|
+
return i(y), y.length ? u(new Kt(y, Ct(y))) : x(s);
|
|
165
165
|
}, w = Oe(n);
|
|
166
|
-
|
|
166
|
+
Yt(w, e, g);
|
|
167
167
|
});
|
|
168
168
|
return r.catch(function(x) {
|
|
169
169
|
return x;
|
|
@@ -172,11 +172,11 @@ function Te(n, t, e, i, s) {
|
|
|
172
172
|
var o = t.firstFields === !0 ? Object.keys(n) : t.firstFields || [], a = Object.keys(n), h = a.length, l = 0, f = [], d = new Promise(function(x, u) {
|
|
173
173
|
var g = function(p) {
|
|
174
174
|
if (f.push.apply(f, p), l++, l === h)
|
|
175
|
-
return i(f), f.length ? u(new
|
|
175
|
+
return i(f), f.length ? u(new Kt(f, Ct(f))) : x(s);
|
|
176
176
|
};
|
|
177
177
|
a.length || (i(f), x(s)), a.forEach(function(w) {
|
|
178
178
|
var p = n[w];
|
|
179
|
-
o.indexOf(w) !== -1 ?
|
|
179
|
+
o.indexOf(w) !== -1 ? Yt(p, e, g) : Ie(p, e, g);
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
182
|
return d.catch(function(x) {
|
|
@@ -194,7 +194,7 @@ function Ae(n, t) {
|
|
|
194
194
|
}
|
|
195
195
|
return e;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function Bt(n, t) {
|
|
198
198
|
return function(e) {
|
|
199
199
|
var i;
|
|
200
200
|
return n.fullFields ? i = Ae(t, n.fullFields) : i = t[e.field || n.fullField], Se(e) ? (e.field = e.field || n.fullField, e.fieldValue = i, e) : {
|
|
@@ -204,7 +204,7 @@ function kt(n, t) {
|
|
|
204
204
|
};
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Wt(n, t) {
|
|
208
208
|
if (t) {
|
|
209
209
|
for (var e in t)
|
|
210
210
|
if (t.hasOwnProperty(e)) {
|
|
@@ -214,7 +214,7 @@ function Nt(n, t) {
|
|
|
214
214
|
}
|
|
215
215
|
return n;
|
|
216
216
|
}
|
|
217
|
-
var
|
|
217
|
+
var Qt = function(t, e, i, s, r, o) {
|
|
218
218
|
t.required && (!i.hasOwnProperty(t.field) || _(e, o || t.type)) && s.push(M(r.messages.required, t.fullField));
|
|
219
219
|
}, Le = function(t, e, i, s, r) {
|
|
220
220
|
(/^\s+$/.test(e) || e === "") && s.push(M(r.messages.whitespace, t.fullField));
|
|
@@ -244,7 +244,7 @@ var jt = function(t, e, i, s, r, o) {
|
|
|
244
244
|
};
|
|
245
245
|
var l = "(?:(?:[a-z]+:)?//)", f = "(?:\\S+(?::\\S*)?@)?", d = h.v4().source, x = h.v6().source, u = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", g = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", w = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", p = "(?::\\d{2,5})?", y = '(?:[/?#][^\\s"]*)?', b = "(?:" + l + "|www\\.)" + f + "(?:localhost|" + d + "|" + x + "|" + u + g + w + ")" + p + y;
|
|
246
246
|
return lt = new RegExp("(?:^" + b + "$)", "i"), lt;
|
|
247
|
-
},
|
|
247
|
+
}, Pt = {
|
|
248
248
|
// http://emailregex.com/
|
|
249
249
|
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
|
|
250
250
|
// url: new RegExp(
|
|
@@ -284,17 +284,17 @@ var jt = function(t, e, i, s, r, o) {
|
|
|
284
284
|
return typeof t == "function";
|
|
285
285
|
},
|
|
286
286
|
email: function(t) {
|
|
287
|
-
return typeof t == "string" && t.length <= 320 && !!t.match(
|
|
287
|
+
return typeof t == "string" && t.length <= 320 && !!t.match(Pt.email);
|
|
288
288
|
},
|
|
289
289
|
url: function(t) {
|
|
290
290
|
return typeof t == "string" && t.length <= 2048 && !!t.match(Me());
|
|
291
291
|
},
|
|
292
292
|
hex: function(t) {
|
|
293
|
-
return typeof t == "string" && !!t.match(
|
|
293
|
+
return typeof t == "string" && !!t.match(Pt.hex);
|
|
294
294
|
}
|
|
295
295
|
}, He = function(t, e, i, s, r) {
|
|
296
296
|
if (t.required && e === void 0) {
|
|
297
|
-
|
|
297
|
+
Qt(t, e, i, s, r);
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
300
|
var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], a = t.type;
|
|
@@ -316,7 +316,7 @@ var jt = function(t, e, i, s, r, o) {
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}, v = {
|
|
319
|
-
required:
|
|
319
|
+
required: Qt,
|
|
320
320
|
whitespace: Le,
|
|
321
321
|
type: He,
|
|
322
322
|
range: De,
|
|
@@ -528,7 +528,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
528
528
|
s.rules[r] = Array.isArray(o) ? o : [o];
|
|
529
529
|
});
|
|
530
530
|
}, t.messages = function(i) {
|
|
531
|
-
return i && (this._messages =
|
|
531
|
+
return i && (this._messages = Wt(vt(), i)), this._messages;
|
|
532
532
|
}, t.validate = function(i, s, r) {
|
|
533
533
|
var o = this;
|
|
534
534
|
s === void 0 && (s = {}), r === void 0 && (r = function() {
|
|
@@ -551,7 +551,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
551
551
|
}
|
|
552
552
|
if (h.messages) {
|
|
553
553
|
var d = this.messages();
|
|
554
|
-
d === Rt && (d = vt()),
|
|
554
|
+
d === Rt && (d = vt()), Wt(d, h.messages), h.messages = d;
|
|
555
555
|
} else
|
|
556
556
|
h.messages = this.messages();
|
|
557
557
|
var x = {}, u = h.keys || Object.keys(this.rules);
|
|
@@ -583,14 +583,14 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
583
583
|
R === void 0 && (R = []);
|
|
584
584
|
var T = Array.isArray(R) ? R : [R];
|
|
585
585
|
!h.suppressWarning && T.length && n.warning("async-validator:", T), T.length && y.message !== void 0 && (T = [].concat(y.message));
|
|
586
|
-
var A = T.map(
|
|
586
|
+
var A = T.map(Bt(y, a));
|
|
587
587
|
if (h.first && A.length)
|
|
588
588
|
return g[y.field] = 1, p(A);
|
|
589
589
|
if (!b)
|
|
590
590
|
p(A);
|
|
591
591
|
else {
|
|
592
592
|
if (y.required && !w.value)
|
|
593
|
-
return y.message !== void 0 ? A = [].concat(y.message).map(
|
|
593
|
+
return y.message !== void 0 ? A = [].concat(y.message).map(Bt(y, a)) : h.error && (A = [h.error(y, M(h.messages.required, y.field))]), p(A);
|
|
594
594
|
var L = {};
|
|
595
595
|
y.defaultField && Object.keys(w.value).map(function(I) {
|
|
596
596
|
L[I] = y.defaultField;
|
|
@@ -644,16 +644,16 @@ nt.register = function(t, e) {
|
|
|
644
644
|
throw new Error("Cannot register a validator by type, validator is not a function");
|
|
645
645
|
it[t] = e;
|
|
646
646
|
};
|
|
647
|
-
nt.warning =
|
|
647
|
+
nt.warning = Jt;
|
|
648
648
|
nt.messages = Rt;
|
|
649
649
|
nt.validators = it;
|
|
650
|
-
function
|
|
650
|
+
function te() {
|
|
651
651
|
return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(n) {
|
|
652
652
|
const t = Math.random() * 16 | 0;
|
|
653
653
|
return (n === "x" ? t : t & 3 | 8).toString(16);
|
|
654
654
|
});
|
|
655
655
|
}
|
|
656
|
-
function
|
|
656
|
+
function ee(n, t) {
|
|
657
657
|
let e = 0, i;
|
|
658
658
|
return function(...s) {
|
|
659
659
|
const r = (/* @__PURE__ */ new Date()).getTime(), o = r - e;
|
|
@@ -662,8 +662,8 @@ function Zt(n, t) {
|
|
|
662
662
|
}, t - o));
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
|
-
function
|
|
666
|
-
return n ? n.map((t) =>
|
|
665
|
+
function ie(n) {
|
|
666
|
+
return n ? n.map((t) => ie(t.children) + 1).sort((t, e) => e - t)[0] : 0;
|
|
667
667
|
}
|
|
668
668
|
function Je(n = []) {
|
|
669
669
|
let t = [], e = [], i = [];
|
|
@@ -675,14 +675,14 @@ function Je(n = []) {
|
|
|
675
675
|
...i.sort((s, r) => s.sort - r.sort)
|
|
676
676
|
];
|
|
677
677
|
}
|
|
678
|
-
function
|
|
678
|
+
function se(n = [], t = 1, e = 0) {
|
|
679
679
|
return n.map((i) => {
|
|
680
680
|
if (i.children) {
|
|
681
681
|
let s = 0, r = i.fixed;
|
|
682
682
|
i.children.forEach((a) => {
|
|
683
683
|
a.fixed = r;
|
|
684
684
|
});
|
|
685
|
-
const o =
|
|
685
|
+
const o = se(i.children, t - 1, e + 1);
|
|
686
686
|
return o && o.forEach((a) => {
|
|
687
687
|
s += a.colspan;
|
|
688
688
|
}), {
|
|
@@ -708,17 +708,17 @@ function _t(n = []) {
|
|
|
708
708
|
e.children ? t = t.concat(_t(e.children)) : t.push(e);
|
|
709
709
|
}), t;
|
|
710
710
|
}
|
|
711
|
-
const
|
|
711
|
+
const Vt = /^(\r\n|\n\r|\r|\n)/, Qe = /^[^\t\r\n]+/, zt = /^\t/;
|
|
712
712
|
function ti(n) {
|
|
713
713
|
let t = [[""]];
|
|
714
714
|
if (n.length === 0)
|
|
715
715
|
return t;
|
|
716
716
|
let e = 0, i = 0, s;
|
|
717
717
|
for (; n.length > 0 && s !== n.length; )
|
|
718
|
-
if (s = n.length, n.match(
|
|
719
|
-
n = n.replace(
|
|
720
|
-
else if (n.match(
|
|
721
|
-
n = n.replace(
|
|
718
|
+
if (s = n.length, n.match(zt))
|
|
719
|
+
n = n.replace(zt, ""), e += 1, t[i][e] = "";
|
|
720
|
+
else if (n.match(Vt))
|
|
721
|
+
n = n.replace(Vt, ""), e = 0, i += 1, t[i] = [""];
|
|
722
722
|
else {
|
|
723
723
|
let r = "";
|
|
724
724
|
if (n.startsWith('"')) {
|
|
@@ -790,7 +790,7 @@ class ii {
|
|
|
790
790
|
t.forEach((i, s) => {
|
|
791
791
|
let r = !1;
|
|
792
792
|
Array.isArray(i.children) && (r = !0, this.initData(i.children, e + 1));
|
|
793
|
-
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: a, CELL_HEIGHT: h, SELECTABLE_METHOD: l, CHECKBOX_KEY: f } = this.ctx.config, d = i[o], x = d ??
|
|
793
|
+
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: a, CELL_HEIGHT: h, SELECTABLE_METHOD: l, CHECKBOX_KEY: f } = this.ctx.config, d = i[o], x = d ?? te();
|
|
794
794
|
this.itemRowKeyMap.set(i, x);
|
|
795
795
|
const u = i._height || h, g = i._readonly;
|
|
796
796
|
let w = !0;
|
|
@@ -1652,7 +1652,7 @@ class ni {
|
|
|
1652
1652
|
};
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
|
-
class
|
|
1655
|
+
class $t {
|
|
1656
1656
|
constructor(t) {
|
|
1657
1657
|
c(this, "PROCESSOR_NUM", 50);
|
|
1658
1658
|
c(this, "CSS_PREFIX", "e-virt-table");
|
|
@@ -1893,7 +1893,7 @@ class ai {
|
|
|
1893
1893
|
return this.icons.get(t);
|
|
1894
1894
|
}
|
|
1895
1895
|
}
|
|
1896
|
-
class
|
|
1896
|
+
class re {
|
|
1897
1897
|
constructor(t, e, i, s, r, o, a) {
|
|
1898
1898
|
c(this, "ctx");
|
|
1899
1899
|
c(this, "x", 0);
|
|
@@ -1939,7 +1939,7 @@ class te {
|
|
|
1939
1939
|
getRightFixedX() {
|
|
1940
1940
|
}
|
|
1941
1941
|
}
|
|
1942
|
-
class
|
|
1942
|
+
class oe extends re {
|
|
1943
1943
|
constructor(e, i, s, r, o, a, h, l, f, d = "body") {
|
|
1944
1944
|
super(e, r, o, a, h, l.fixed, d);
|
|
1945
1945
|
c(this, "formatter");
|
|
@@ -2370,7 +2370,7 @@ class ee extends te {
|
|
|
2370
2370
|
});
|
|
2371
2371
|
}
|
|
2372
2372
|
}
|
|
2373
|
-
class
|
|
2373
|
+
class ne extends re {
|
|
2374
2374
|
constructor(e, i, s, r, o, a, h) {
|
|
2375
2375
|
super(e, s, r, o, a, h.fixed, "header");
|
|
2376
2376
|
c(this, "align");
|
|
@@ -2406,7 +2406,7 @@ class ie extends te {
|
|
|
2406
2406
|
c(this, "drawImageHeight", 0);
|
|
2407
2407
|
c(this, "drawImageName", "");
|
|
2408
2408
|
c(this, "drawImageSource");
|
|
2409
|
-
this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = a, this.colIndex = i, this.key = h.key, this.type = h.type, this.editorType = h.editorType || "text", this.align = h.align || "center", this.verticalAlign = h.verticalAlign || "middle", this.fixed = h.fixed, this.level = h.level, this.operation = h.operation || !1, this.text = h.title, this.column = h, this.colspan = h.colspan, this.widthFillDisable = h.widthFillDisable, this.rowspan = h.rowspan, this.rules = h.rules, this.readonly = h.readonly, this.required = h.required, this.rowKey =
|
|
2409
|
+
this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = a, this.colIndex = i, this.key = h.key, this.type = h.type, this.editorType = h.editorType || "text", this.align = h.align || "center", this.verticalAlign = h.verticalAlign || "middle", this.fixed = h.fixed, this.level = h.level, this.operation = h.operation || !1, this.text = h.title, this.column = h, this.colspan = h.colspan, this.widthFillDisable = h.widthFillDisable, this.rowspan = h.rowspan, this.rules = h.rules, this.readonly = h.readonly, this.required = h.required, this.rowKey = te(), this.hasChildren = h.children && h.children.length > 0 || !1, this.render = h.renderHeader;
|
|
2410
2410
|
}
|
|
2411
2411
|
/**
|
|
2412
2412
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -2557,7 +2557,7 @@ class ci {
|
|
|
2557
2557
|
*/
|
|
2558
2558
|
selectionClick(t) {
|
|
2559
2559
|
if (["selection", "index-selection"].includes(t.type) && this.ctx.isPointer)
|
|
2560
|
-
if (t instanceof
|
|
2560
|
+
if (t instanceof ne)
|
|
2561
2561
|
t.drawImageName === "checkbox-uncheck" || t.drawImageName === "checkbox-indeterminate" ? this.ctx.database.toggleAllSelection() : t.drawImageName === "checkbox-check" && this.ctx.database.clearSelection();
|
|
2562
2562
|
else {
|
|
2563
2563
|
if (!this.ctx.database.getRowSelectable(t.rowKey))
|
|
@@ -2597,7 +2597,7 @@ class ci {
|
|
|
2597
2597
|
*/
|
|
2598
2598
|
imageEnterAndLeave(t, e) {
|
|
2599
2599
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s;
|
|
2600
|
-
o > t.drawImageX && o < t.drawImageX + t.drawImageWidth && r > t.drawImageY && r < t.drawImageY + t.drawImageHeight ? (this.ctx.stageElement.style.cursor = "pointer", this.ctx.isPointer = !0, t instanceof
|
|
2600
|
+
o > t.drawImageX && o < t.drawImageX + t.drawImageWidth && r > t.drawImageY && r < t.drawImageY + t.drawImageHeight ? (this.ctx.stageElement.style.cursor = "pointer", this.ctx.isPointer = !0, t instanceof oe && ["selection", "index-selection"].includes(t.type) && (this.ctx.database.getRowSelectable(t.rowKey) || (this.ctx.stageElement.style.cursor = "not-allowed"))) : (this.ctx.isPointer = !1, this.ctx.stageElement.style.cursor === "pointer" && (this.ctx.stageElement.style.cursor = "default"));
|
|
2601
2601
|
}
|
|
2602
2602
|
isBusy(t) {
|
|
2603
2603
|
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, r = i;
|
|
@@ -2732,10 +2732,10 @@ class hi {
|
|
|
2732
2732
|
c(this, "history");
|
|
2733
2733
|
c(this, "config");
|
|
2734
2734
|
const { containerElement: i, stageElement: s, canvasElement: r, overlayerElement: o } = t;
|
|
2735
|
-
this.containerElement = i, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.config = new
|
|
2735
|
+
this.containerElement = i, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.config = new $t(e.config || {}), this.eventBus = new oi(), this.eventBrowser = new ri(this), this.eventTable = new ci(this), this.paint = new ni(this.canvasElement), this.database = new ii(this, e), this.history = new si(this), this.icons = new ai(this);
|
|
2736
2736
|
}
|
|
2737
2737
|
setConfig(t) {
|
|
2738
|
-
this.config = new
|
|
2738
|
+
this.config = new $t(t);
|
|
2739
2739
|
}
|
|
2740
2740
|
setFocusCell(t) {
|
|
2741
2741
|
var e;
|
|
@@ -2826,7 +2826,7 @@ class hi {
|
|
|
2826
2826
|
this.eventTable.destroy(), this.eventBrowser.destroy(), this.eventBus.destroy();
|
|
2827
2827
|
}
|
|
2828
2828
|
}
|
|
2829
|
-
class
|
|
2829
|
+
class qt {
|
|
2830
2830
|
constructor(t, e) {
|
|
2831
2831
|
c(this, "ctx");
|
|
2832
2832
|
c(this, "type");
|
|
@@ -2942,7 +2942,7 @@ class li {
|
|
|
2942
2942
|
c(this, "ctx");
|
|
2943
2943
|
c(this, "verticalScrollbar");
|
|
2944
2944
|
c(this, "horizontalScrollbar");
|
|
2945
|
-
this.ctx = t, this.verticalScrollbar = new
|
|
2945
|
+
this.ctx = t, this.verticalScrollbar = new qt(t, "vertical"), this.horizontalScrollbar = new qt(t, "horizontal"), this.ctx.on("wheel", (e) => this.onWheel(e)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("setScroll", (e, i) => {
|
|
2946
2946
|
this.setScroll(e, i);
|
|
2947
2947
|
}), this.ctx.on("setScrollX", (e) => {
|
|
2948
2948
|
this.setScrollX(e);
|
|
@@ -3032,7 +3032,7 @@ class di {
|
|
|
3032
3032
|
c(this, "renderFixedCellHeaders", []);
|
|
3033
3033
|
this.ctx = t, this.ctx.on(
|
|
3034
3034
|
"resetHeader",
|
|
3035
|
-
|
|
3035
|
+
ee(() => {
|
|
3036
3036
|
this.init(), this.ctx.emit("draw");
|
|
3037
3037
|
}, 100)
|
|
3038
3038
|
), this.init(), this.initResizeColumn();
|
|
@@ -3042,9 +3042,9 @@ class di {
|
|
|
3042
3042
|
config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
|
|
3043
3043
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3044
3044
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3045
|
-
const s =
|
|
3045
|
+
const s = ie(i), r = _t(i);
|
|
3046
3046
|
this.height = t * s, this.width = r.reduce((d, x) => d + ((x == null ? void 0 : x.width) || 100), 0), this.visibleHeight = this.height;
|
|
3047
|
-
const o = Je(
|
|
3047
|
+
const o = Je(se(i, s));
|
|
3048
3048
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3049
3049
|
const a = this.ctx.containerElement.getBoundingClientRect();
|
|
3050
3050
|
this.resizeNum > 0 ? this.ctx.stageWidth = Math.floor(a.width) : this.ctx.stageWidth = Math.floor(this.width + e), this.ctx.stageElement.style.width = this.ctx.stageWidth - 0.5 + "px", this.visibleWidth = this.ctx.stageWidth - e;
|
|
@@ -3142,7 +3142,7 @@ class di {
|
|
|
3142
3142
|
const a = t[o], h = r * (a.rowspan || 1), l = r * a.level;
|
|
3143
3143
|
let f = a.width || 100;
|
|
3144
3144
|
a.children && (f = _t(a.children).reduce((u, g) => u + ((g == null ? void 0 : g.width) || 100), 0));
|
|
3145
|
-
const d = new
|
|
3145
|
+
const d = new ne(this.ctx, this.columnIndex, s, l, f, h, a);
|
|
3146
3146
|
this.ctx.database.setHeader(a.key, d), this.allCellHeaders.push(d), a.children || (this.leafCellHeaders.push(d), d.column.widthFillDisable || this.resizeNum++), a.fixed === "left" ? this.fixedLeftCellHeaders.push(d) : a.fixed === "right" ? this.fixedRightCellHeaders.push(d) : this.centerCellHeaders.push(d), !a.children && this.columnIndex++, a.children && this.render(a.children, s), s += f;
|
|
3147
3147
|
}
|
|
3148
3148
|
}
|
|
@@ -3202,7 +3202,7 @@ class di {
|
|
|
3202
3202
|
}), this.drawTipLine();
|
|
3203
3203
|
}
|
|
3204
3204
|
}
|
|
3205
|
-
class
|
|
3205
|
+
class ae {
|
|
3206
3206
|
constructor(t, e, i = 0, s = 0, r = 0, o = 0, a, h = "body") {
|
|
3207
3207
|
c(this, "ctx");
|
|
3208
3208
|
c(this, "x", 0);
|
|
@@ -3221,7 +3221,7 @@ class se {
|
|
|
3221
3221
|
update() {
|
|
3222
3222
|
const { header: t } = this.ctx, e = [], i = [], s = [];
|
|
3223
3223
|
t.renderLeafCellHeaders.forEach((r) => {
|
|
3224
|
-
const o = new
|
|
3224
|
+
const o = new oe(
|
|
3225
3225
|
this.ctx,
|
|
3226
3226
|
this.rowIndex,
|
|
3227
3227
|
r.colIndex,
|
|
@@ -3434,7 +3434,7 @@ class fi {
|
|
|
3434
3434
|
h === -1 && (h = r.length), this.headIndex = Math.max(0, a), this.tailIndex = Math.min(this.ctx.maxRowIndex, h + 1), this.visibleRows = r.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
|
|
3435
3435
|
const l = [];
|
|
3436
3436
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
3437
|
-
const d = this.headIndex + f, x = this.visibleRows[f], { height: u, top: g } = this.ctx.database.getPositionForRowIndex(d), w = new
|
|
3437
|
+
const d = this.headIndex + f, x = this.visibleRows[f], { height: u, top: g } = this.ctx.database.getPositionForRowIndex(d), w = new ae(this.ctx, d, 0, g + this.y, t.width, u, x);
|
|
3438
3438
|
l.push(w);
|
|
3439
3439
|
}
|
|
3440
3440
|
this.renderRows = l, this.ctx.body.renderRows = l;
|
|
@@ -3502,7 +3502,7 @@ class xi {
|
|
|
3502
3502
|
let e = this.y;
|
|
3503
3503
|
const i = [];
|
|
3504
3504
|
this.data.forEach((s, r) => {
|
|
3505
|
-
const o = new
|
|
3505
|
+
const o = new ae(
|
|
3506
3506
|
this.ctx,
|
|
3507
3507
|
r,
|
|
3508
3508
|
0,
|
|
@@ -3540,7 +3540,7 @@ class ui {
|
|
|
3540
3540
|
init() {
|
|
3541
3541
|
this.ctx.on(
|
|
3542
3542
|
"mousemove",
|
|
3543
|
-
|
|
3543
|
+
ee((t) => {
|
|
3544
3544
|
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = this.ctx.isTarget() && i > 0 && i < this.ctx.body.visibleWidth && e > this.ctx.header.visibleHeight && e < this.ctx.header.visibleHeight + this.ctx.body.visibleHeight;
|
|
3545
3545
|
(this.ctx.selectorMove || this.ctx.autofillMove) && (s ? this.stopAdjustPosition() : this.startAdjustPosition(t));
|
|
3546
3546
|
}, 100)
|
|
@@ -3914,7 +3914,7 @@ class ui {
|
|
|
3914
3914
|
d && (x = a.visibleHeight);
|
|
3915
3915
|
const u = r - i.drawX + 1, g = i.drawX + i.width - (e - s) + 1, w = o.height - i.drawY, p = i.drawY + i.height - (t - x - f);
|
|
3916
3916
|
this.adjustTimer && (clearTimeout(this.adjustTimer), this.adjustTimer = 0), this.adjustTimer = setTimeout(() => {
|
|
3917
|
-
g > 0 && !i.fixed ? this.ctx.setScrollX(h + g) : u > 0 && !i.fixed && this.ctx.setScrollX(h - u), w > 0 ? this.ctx.setScrollY(l - w) : p > 0 && this.ctx.setScrollY(l + p);
|
|
3917
|
+
this.ctx.editing || (g > 0 && !i.fixed ? this.ctx.setScrollX(h + g) : u > 0 && !i.fixed && this.ctx.setScrollX(h - u), w > 0 ? this.ctx.setScrollY(l - w) : p > 0 && this.ctx.setScrollY(l + p));
|
|
3918
3918
|
}, 167);
|
|
3919
3919
|
}
|
|
3920
3920
|
destroy() {
|
|
@@ -4054,7 +4054,7 @@ function q(n) {
|
|
|
4054
4054
|
function ct(n) {
|
|
4055
4055
|
return n.split("-")[1];
|
|
4056
4056
|
}
|
|
4057
|
-
function
|
|
4057
|
+
function ce(n) {
|
|
4058
4058
|
return n === "x" ? "y" : "x";
|
|
4059
4059
|
}
|
|
4060
4060
|
function Lt(n) {
|
|
@@ -4064,7 +4064,7 @@ function J(n) {
|
|
|
4064
4064
|
return ["top", "bottom"].includes(q(n)) ? "y" : "x";
|
|
4065
4065
|
}
|
|
4066
4066
|
function Mt(n) {
|
|
4067
|
-
return
|
|
4067
|
+
return ce(J(n));
|
|
4068
4068
|
}
|
|
4069
4069
|
function yi(n, t, e) {
|
|
4070
4070
|
e === void 0 && (e = !1);
|
|
@@ -4109,7 +4109,7 @@ function Ci(n) {
|
|
|
4109
4109
|
...n
|
|
4110
4110
|
};
|
|
4111
4111
|
}
|
|
4112
|
-
function
|
|
4112
|
+
function he(n) {
|
|
4113
4113
|
return typeof n != "number" ? Ci(n) : {
|
|
4114
4114
|
top: n,
|
|
4115
4115
|
right: n,
|
|
@@ -4135,7 +4135,7 @@ function ut(n) {
|
|
|
4135
4135
|
y: e
|
|
4136
4136
|
};
|
|
4137
4137
|
}
|
|
4138
|
-
function
|
|
4138
|
+
function Gt(n, t, e) {
|
|
4139
4139
|
let {
|
|
4140
4140
|
reference: i,
|
|
4141
4141
|
floating: s
|
|
@@ -4197,7 +4197,7 @@ const vi = async (n, t, e) => {
|
|
|
4197
4197
|
}), {
|
|
4198
4198
|
x: f,
|
|
4199
4199
|
y: d
|
|
4200
|
-
} =
|
|
4200
|
+
} = Gt(l, i, h), x = i, u = {}, g = 0;
|
|
4201
4201
|
for (let w = 0; w < a.length; w++) {
|
|
4202
4202
|
const {
|
|
4203
4203
|
name: p,
|
|
@@ -4234,7 +4234,7 @@ const vi = async (n, t, e) => {
|
|
|
4234
4234
|
}) : C.rects), {
|
|
4235
4235
|
x: f,
|
|
4236
4236
|
y: d
|
|
4237
|
-
} =
|
|
4237
|
+
} = Gt(l, x, h)), w = -1);
|
|
4238
4238
|
}
|
|
4239
4239
|
return {
|
|
4240
4240
|
x: f,
|
|
@@ -4244,7 +4244,7 @@ const vi = async (n, t, e) => {
|
|
|
4244
4244
|
middlewareData: u
|
|
4245
4245
|
};
|
|
4246
4246
|
};
|
|
4247
|
-
async function
|
|
4247
|
+
async function le(n, t) {
|
|
4248
4248
|
var e;
|
|
4249
4249
|
t === void 0 && (t = {});
|
|
4250
4250
|
const {
|
|
@@ -4260,7 +4260,7 @@ async function ne(n, t) {
|
|
|
4260
4260
|
elementContext: d = "floating",
|
|
4261
4261
|
altBoundary: x = !1,
|
|
4262
4262
|
padding: u = 0
|
|
4263
|
-
} = at(t, n), g =
|
|
4263
|
+
} = at(t, n), g = he(u), p = a[x ? d === "floating" ? "reference" : "floating" : d], y = ut(await r.getClippingRect({
|
|
4264
4264
|
element: (e = await (r.isElement == null ? void 0 : r.isElement(p))) == null || e ? p : p.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(a.floating)),
|
|
4265
4265
|
boundary: l,
|
|
4266
4266
|
rootBoundary: f,
|
|
@@ -4307,7 +4307,7 @@ const Ri = (n) => ({
|
|
|
4307
4307
|
} = at(n, t) || {};
|
|
4308
4308
|
if (l == null)
|
|
4309
4309
|
return {};
|
|
4310
|
-
const d =
|
|
4310
|
+
const d = he(f), x = {
|
|
4311
4311
|
x: e,
|
|
4312
4312
|
y: i
|
|
4313
4313
|
}, u = Mt(s), g = Lt(u), w = await o.getDimensions(l), p = u === "y", y = p ? "top" : "left", b = p ? "bottom" : "right", m = p ? "clientHeight" : "clientWidth", E = r.reference[g] + r.reference[u] - x[u] - r.floating[g], C = x[u] - r.reference[u], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l));
|
|
@@ -4352,7 +4352,7 @@ const Ri = (n) => ({
|
|
|
4352
4352
|
return {};
|
|
4353
4353
|
const y = q(s), b = J(a), m = q(a) === a, E = await (h.isRTL == null ? void 0 : h.isRTL(l.floating)), C = x || (m || !w ? [xt(a)] : mi(a)), R = g !== "none";
|
|
4354
4354
|
!x && R && C.push(...bi(a, w, g, E));
|
|
4355
|
-
const T = [a, ...C], A = await
|
|
4355
|
+
const T = [a, ...C], A = await le(t, p), L = [];
|
|
4356
4356
|
let D = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
4357
4357
|
if (f && L.push(A[y]), d) {
|
|
4358
4358
|
const O = yi(s, o, E);
|
|
@@ -4483,7 +4483,7 @@ const Oi = function(n) {
|
|
|
4483
4483
|
} = at(n, t), l = {
|
|
4484
4484
|
x: e,
|
|
4485
4485
|
y: i
|
|
4486
|
-
}, f = await
|
|
4486
|
+
}, f = await le(t, h), d = J(q(s)), x = ce(d);
|
|
4487
4487
|
let u = l[x], g = l[d];
|
|
4488
4488
|
if (r) {
|
|
4489
4489
|
const p = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", b = u + f[p], m = u - f[y];
|
|
@@ -4516,7 +4516,7 @@ function gt() {
|
|
|
4516
4516
|
return typeof window < "u";
|
|
4517
4517
|
}
|
|
4518
4518
|
function tt(n) {
|
|
4519
|
-
return
|
|
4519
|
+
return de(n) ? (n.nodeName || "").toLowerCase() : "#document";
|
|
4520
4520
|
}
|
|
4521
4521
|
function H(n) {
|
|
4522
4522
|
var t;
|
|
@@ -4524,9 +4524,9 @@ function H(n) {
|
|
|
4524
4524
|
}
|
|
4525
4525
|
function K(n) {
|
|
4526
4526
|
var t;
|
|
4527
|
-
return (t = (
|
|
4527
|
+
return (t = (de(n) ? n.ownerDocument : n.document) || window.document) == null ? void 0 : t.documentElement;
|
|
4528
4528
|
}
|
|
4529
|
-
function
|
|
4529
|
+
function de(n) {
|
|
4530
4530
|
return gt() ? n instanceof Node || n instanceof H(n).Node : !1;
|
|
4531
4531
|
}
|
|
4532
4532
|
function X(n) {
|
|
@@ -4535,7 +4535,7 @@ function X(n) {
|
|
|
4535
4535
|
function N(n) {
|
|
4536
4536
|
return gt() ? n instanceof HTMLElement || n instanceof H(n).HTMLElement : !1;
|
|
4537
4537
|
}
|
|
4538
|
-
function
|
|
4538
|
+
function jt(n) {
|
|
4539
4539
|
return !gt() || typeof ShadowRoot > "u" ? !1 : n instanceof ShadowRoot || n instanceof H(n).ShadowRoot;
|
|
4540
4540
|
}
|
|
4541
4541
|
function ht(n) {
|
|
@@ -4599,19 +4599,19 @@ function z(n) {
|
|
|
4599
4599
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
4600
4600
|
n.assignedSlot || // DOM Element detected.
|
|
4601
4601
|
n.parentNode || // ShadowRoot detected.
|
|
4602
|
-
|
|
4602
|
+
jt(n) && n.host || // Fallback.
|
|
4603
4603
|
K(n)
|
|
4604
4604
|
);
|
|
4605
|
-
return
|
|
4605
|
+
return jt(t) ? t.host : t;
|
|
4606
4606
|
}
|
|
4607
|
-
function
|
|
4607
|
+
function fe(n) {
|
|
4608
4608
|
const t = z(n);
|
|
4609
|
-
return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) && ht(t) ? t :
|
|
4609
|
+
return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) && ht(t) ? t : fe(t);
|
|
4610
4610
|
}
|
|
4611
4611
|
function Tt(n, t, e) {
|
|
4612
4612
|
var i;
|
|
4613
4613
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
4614
|
-
const s =
|
|
4614
|
+
const s = fe(n), r = s === ((i = n.ownerDocument) == null ? void 0 : i.body), o = H(s);
|
|
4615
4615
|
if (r) {
|
|
4616
4616
|
const a = St(o);
|
|
4617
4617
|
return t.concat(o, o.visualViewport || [], ht(s) ? s : [], a && e ? Tt(a) : []);
|
|
@@ -4621,7 +4621,7 @@ function Tt(n, t, e) {
|
|
|
4621
4621
|
function St(n) {
|
|
4622
4622
|
return n.parent && Object.getPrototypeOf(n.parent) ? n.frameElement : null;
|
|
4623
4623
|
}
|
|
4624
|
-
function
|
|
4624
|
+
function xe(n) {
|
|
4625
4625
|
const t = F(n);
|
|
4626
4626
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
4627
4627
|
const s = N(n), r = s ? n.offsetWidth : e, o = s ? n.offsetHeight : i, a = ft(e) !== r || ft(i) !== o;
|
|
@@ -4631,18 +4631,18 @@ function he(n) {
|
|
|
4631
4631
|
$: a
|
|
4632
4632
|
};
|
|
4633
4633
|
}
|
|
4634
|
-
function
|
|
4634
|
+
function ue(n) {
|
|
4635
4635
|
return X(n) ? n : n.contextElement;
|
|
4636
4636
|
}
|
|
4637
4637
|
function Z(n) {
|
|
4638
|
-
const t =
|
|
4638
|
+
const t = ue(n);
|
|
4639
4639
|
if (!N(t))
|
|
4640
4640
|
return V(1);
|
|
4641
4641
|
const e = t.getBoundingClientRect(), {
|
|
4642
4642
|
width: i,
|
|
4643
4643
|
height: s,
|
|
4644
4644
|
$: r
|
|
4645
|
-
} =
|
|
4645
|
+
} = xe(t);
|
|
4646
4646
|
let o = (r ? ft(e.width) : e.width) / i, a = (r ? ft(e.height) : e.height) / s;
|
|
4647
4647
|
return (!o || !Number.isFinite(o)) && (o = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
4648
4648
|
x: o,
|
|
@@ -4650,7 +4650,7 @@ function Z(n) {
|
|
|
4650
4650
|
};
|
|
4651
4651
|
}
|
|
4652
4652
|
const Li = /* @__PURE__ */ V(0);
|
|
4653
|
-
function
|
|
4653
|
+
function ge(n) {
|
|
4654
4654
|
const t = H(n);
|
|
4655
4655
|
return !Dt() || !t.visualViewport ? Li : {
|
|
4656
4656
|
x: t.visualViewport.offsetLeft,
|
|
@@ -4662,10 +4662,10 @@ function Mi(n, t, e) {
|
|
|
4662
4662
|
}
|
|
4663
4663
|
function ot(n, t, e, i) {
|
|
4664
4664
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
4665
|
-
const s = n.getBoundingClientRect(), r =
|
|
4665
|
+
const s = n.getBoundingClientRect(), r = ue(n);
|
|
4666
4666
|
let o = V(1);
|
|
4667
4667
|
t && (i ? X(i) && (o = Z(i)) : o = Z(n));
|
|
4668
|
-
const a = Mi(r, e, i) ?
|
|
4668
|
+
const a = Mi(r, e, i) ? ge(r) : V(0);
|
|
4669
4669
|
let h = (s.left + a.x) / o.x, l = (s.top + a.y) / o.y, f = s.width / o.x, d = s.height / o.y;
|
|
4670
4670
|
if (r) {
|
|
4671
4671
|
const x = H(r), u = i && X(i) ? H(i) : i;
|
|
@@ -4750,7 +4750,7 @@ function ki(n, t) {
|
|
|
4750
4750
|
y: l
|
|
4751
4751
|
};
|
|
4752
4752
|
}
|
|
4753
|
-
function
|
|
4753
|
+
function Ut(n, t, e) {
|
|
4754
4754
|
let i;
|
|
4755
4755
|
if (t === "viewport")
|
|
4756
4756
|
i = Fi(n, e);
|
|
@@ -4759,7 +4759,7 @@ function $t(n, t, e) {
|
|
|
4759
4759
|
else if (X(t))
|
|
4760
4760
|
i = ki(t, e);
|
|
4761
4761
|
else {
|
|
4762
|
-
const s =
|
|
4762
|
+
const s = ge(n);
|
|
4763
4763
|
i = {
|
|
4764
4764
|
...t,
|
|
4765
4765
|
x: t.x - s.x,
|
|
@@ -4768,9 +4768,9 @@ function $t(n, t, e) {
|
|
|
4768
4768
|
}
|
|
4769
4769
|
return ut(i);
|
|
4770
4770
|
}
|
|
4771
|
-
function
|
|
4771
|
+
function we(n, t) {
|
|
4772
4772
|
const e = z(n);
|
|
4773
|
-
return e === t || !X(e) || Q(e) ? !1 : F(e).position === "fixed" ||
|
|
4773
|
+
return e === t || !X(e) || Q(e) ? !1 : F(e).position === "fixed" || we(e, t);
|
|
4774
4774
|
}
|
|
4775
4775
|
function Ni(n, t) {
|
|
4776
4776
|
const e = t.get(n);
|
|
@@ -4781,7 +4781,7 @@ function Ni(n, t) {
|
|
|
4781
4781
|
let o = r ? z(n) : n;
|
|
4782
4782
|
for (; X(o) && !Q(o); ) {
|
|
4783
4783
|
const a = F(o), h = Ht(o);
|
|
4784
|
-
!h && a.position === "fixed" && (s = null), (r ? !h && !s : !h && a.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h &&
|
|
4784
|
+
!h && a.position === "fixed" && (s = null), (r ? !h && !s : !h && a.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && we(n, o)) ? i = i.filter((f) => f !== o) : s = a, o = z(o);
|
|
4785
4785
|
}
|
|
4786
4786
|
return t.set(n, i), i;
|
|
4787
4787
|
}
|
|
@@ -4793,9 +4793,9 @@ function Yi(n) {
|
|
|
4793
4793
|
strategy: s
|
|
4794
4794
|
} = n;
|
|
4795
4795
|
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0], h = o.reduce((l, f) => {
|
|
4796
|
-
const d =
|
|
4796
|
+
const d = Ut(t, f, s);
|
|
4797
4797
|
return l.top = U(d.top, l.top), l.right = rt(d.right, l.right), l.bottom = rt(d.bottom, l.bottom), l.left = U(d.left, l.left), l;
|
|
4798
|
-
},
|
|
4798
|
+
}, Ut(t, a, s));
|
|
4799
4799
|
return {
|
|
4800
4800
|
width: h.right - h.left,
|
|
4801
4801
|
height: h.bottom - h.top,
|
|
@@ -4807,7 +4807,7 @@ function Ki(n) {
|
|
|
4807
4807
|
const {
|
|
4808
4808
|
width: t,
|
|
4809
4809
|
height: e
|
|
4810
|
-
} =
|
|
4810
|
+
} = xe(n);
|
|
4811
4811
|
return {
|
|
4812
4812
|
width: t,
|
|
4813
4813
|
height: e
|
|
@@ -4842,7 +4842,7 @@ function Bi(n, t, e) {
|
|
|
4842
4842
|
function mt(n) {
|
|
4843
4843
|
return F(n).position === "static";
|
|
4844
4844
|
}
|
|
4845
|
-
function
|
|
4845
|
+
function Zt(n, t) {
|
|
4846
4846
|
if (!N(n) || F(n).position === "fixed")
|
|
4847
4847
|
return null;
|
|
4848
4848
|
if (t)
|
|
@@ -4850,7 +4850,7 @@ function qt(n, t) {
|
|
|
4850
4850
|
let e = n.offsetParent;
|
|
4851
4851
|
return K(n) === e && (e = e.ownerDocument.body), e;
|
|
4852
4852
|
}
|
|
4853
|
-
function
|
|
4853
|
+
function pe(n, t) {
|
|
4854
4854
|
const e = H(n);
|
|
4855
4855
|
if (wt(n))
|
|
4856
4856
|
return e;
|
|
@@ -4863,13 +4863,13 @@ function xe(n, t) {
|
|
|
4863
4863
|
}
|
|
4864
4864
|
return e;
|
|
4865
4865
|
}
|
|
4866
|
-
let i =
|
|
4866
|
+
let i = Zt(n, t);
|
|
4867
4867
|
for (; i && Si(i) && mt(i); )
|
|
4868
|
-
i =
|
|
4868
|
+
i = Zt(i, t);
|
|
4869
4869
|
return i && Q(i) && mt(i) && !Ht(i) ? e : i || Ai(n) || e;
|
|
4870
4870
|
}
|
|
4871
4871
|
const Wi = async function(n) {
|
|
4872
|
-
const t = this.getOffsetParent ||
|
|
4872
|
+
const t = this.getOffsetParent || pe, e = this.getDimensions, i = await e(n.floating);
|
|
4873
4873
|
return {
|
|
4874
4874
|
reference: Bi(n.reference, await t(n.floating), n.strategy),
|
|
4875
4875
|
floating: {
|
|
@@ -4887,14 +4887,14 @@ const Vi = {
|
|
|
4887
4887
|
convertOffsetParentRelativeRectToViewportRelativeRect: Hi,
|
|
4888
4888
|
getDocumentElement: K,
|
|
4889
4889
|
getClippingRect: Yi,
|
|
4890
|
-
getOffsetParent:
|
|
4890
|
+
getOffsetParent: pe,
|
|
4891
4891
|
getElementRects: Wi,
|
|
4892
4892
|
getClientRects: Di,
|
|
4893
4893
|
getDimensions: Ki,
|
|
4894
4894
|
getScale: Z,
|
|
4895
4895
|
isElement: X,
|
|
4896
4896
|
isRTL: Pi
|
|
4897
|
-
},
|
|
4897
|
+
}, Xt = Oi, Ft = Ti, kt = _i, zi = Ri, Nt = (n, t, e) => {
|
|
4898
4898
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
4899
4899
|
platform: Vi,
|
|
4900
4900
|
...e
|
|
@@ -4964,7 +4964,7 @@ let $i = class {
|
|
|
4964
4964
|
return;
|
|
4965
4965
|
this.enable = !0, this.contentEl.style.maxWidth = `${t.overflowTooltipMaxWidth || 500}px`, this.contentEl.style.width = "100%", this.contentEl.style.display = "inline-block", this.contentEl.style.wordBreak = "break-all", this.contentEl.style.lineHeight = "1.5", this.contentEl.innerText = e;
|
|
4966
4966
|
const s = t.drawX + i.x, r = t.drawY + i.y;
|
|
4967
|
-
|
|
4967
|
+
Nt({
|
|
4968
4968
|
getBoundingClientRect() {
|
|
4969
4969
|
return {
|
|
4970
4970
|
width: t.visibleWidth,
|
|
@@ -4979,7 +4979,7 @@ let $i = class {
|
|
|
4979
4979
|
}
|
|
4980
4980
|
}, this.floatingEl, {
|
|
4981
4981
|
placement: t.overflowTooltipPlacement,
|
|
4982
|
-
middleware: [
|
|
4982
|
+
middleware: [Ft(), kt(), Xt(6), zi({ element: this.arrowEl })]
|
|
4983
4983
|
}).then((a) => {
|
|
4984
4984
|
const { x: h, y: l, placement: f, middlewareData: d } = a;
|
|
4985
4985
|
if (Object.assign(this.floatingEl.style, {
|
|
@@ -5085,21 +5085,45 @@ class qi {
|
|
|
5085
5085
|
}
|
|
5086
5086
|
(t.code === "Escape" || t.code === "Enter") && (t.preventDefault(), this.inputEl.blur());
|
|
5087
5087
|
}
|
|
5088
|
-
}), this.inputEl.addEventListener("input",
|
|
5089
|
-
this.style.height = "auto", this.style.height = `${this.scrollHeight}px`;
|
|
5090
|
-
}), this.inputEl.addEventListener("blur", () => {
|
|
5088
|
+
}), this.inputEl.addEventListener("input", this.autoSize.bind(this)), this.inputEl.addEventListener("blur", () => {
|
|
5091
5089
|
this.doneEdit();
|
|
5092
5090
|
}), this.editorEl = document.createElement("div"), this.editorEl.className = "e-virt-table-editor", this.inputEl.className = "e-virt-table-editor-textarea", this.editorEl.appendChild(this.inputEl), this.ctx.containerElement.appendChild(this.editorEl);
|
|
5093
5091
|
}
|
|
5092
|
+
autoSize() {
|
|
5093
|
+
const t = this.inputEl.scrollHeight;
|
|
5094
|
+
this.inputEl.style.height = "auto", this.inputEl.style.height = `${t}px`;
|
|
5095
|
+
}
|
|
5094
5096
|
startEditByInput(t) {
|
|
5095
5097
|
if (t.editorType !== "text")
|
|
5096
5098
|
return;
|
|
5097
5099
|
const e = t.getValue(), { width: i } = t, s = t.getDrawX();
|
|
5098
5100
|
let r = t.getDrawY(), { height: o } = t;
|
|
5099
|
-
const {
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5101
|
+
const {
|
|
5102
|
+
config: { CELL_PADDING: a }
|
|
5103
|
+
} = this.ctx;
|
|
5104
|
+
let h = window.innerHeight / 2;
|
|
5105
|
+
h > this.ctx.body.visibleHeight && (h = this.ctx.body.visibleHeight), this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.maxHeight = `${h}px`, this.inputEl.style.width = `${i - 1}px`, this.inputEl.style.height = `${o - 1}px`, this.inputEl.style.padding = `${a}px`, e !== null && (this.inputEl.value = e), this.inputEl.focus();
|
|
5106
|
+
const l = this.inputEl.value.length;
|
|
5107
|
+
this.inputEl.setSelectionRange(l, l);
|
|
5108
|
+
const { left: f, top: d } = this.ctx.containerElement.getBoundingClientRect(), x = {
|
|
5109
|
+
getBoundingClientRect: () => ({
|
|
5110
|
+
width: 0,
|
|
5111
|
+
height: 0,
|
|
5112
|
+
top: d + r,
|
|
5113
|
+
left: f + s,
|
|
5114
|
+
right: f + s,
|
|
5115
|
+
bottom: d + r,
|
|
5116
|
+
x: s,
|
|
5117
|
+
y: r
|
|
5118
|
+
}),
|
|
5119
|
+
contextElement: document.body
|
|
5120
|
+
};
|
|
5121
|
+
Nt(x, this.editorEl, {
|
|
5122
|
+
placement: "right-start",
|
|
5123
|
+
middleware: [Xt(), Ft(), kt()]
|
|
5124
|
+
}).then(({ x: u, y: g }) => {
|
|
5125
|
+
this.editorEl.style.left = `${u}px`, this.editorEl.style.top = `${g}px`;
|
|
5126
|
+
}), this.inputEl.scrollHeight > o && this.autoSize();
|
|
5103
5127
|
}
|
|
5104
5128
|
doneEditByInput() {
|
|
5105
5129
|
if (!this.cellTarget || this.cellTarget.editorType !== "text")
|
|
@@ -5400,9 +5424,9 @@ class Ui {
|
|
|
5400
5424
|
}),
|
|
5401
5425
|
contextElement: document.body
|
|
5402
5426
|
};
|
|
5403
|
-
|
|
5427
|
+
Nt(x, this.contextMenuEl, {
|
|
5404
5428
|
placement: "right-start",
|
|
5405
|
-
middleware: [
|
|
5429
|
+
middleware: [Xt(), Ft(), kt()]
|
|
5406
5430
|
}).then(({ x: u, y: g }) => {
|
|
5407
5431
|
this.show(u, g);
|
|
5408
5432
|
});
|