e-virt-table 1.2.25 → 1.2.26
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 +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +40 -34
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Database.js +1 -0
- package/dist/lib/Database.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -60,7 +60,7 @@ class re {
|
|
|
60
60
|
return e;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Mt() {
|
|
64
64
|
return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(h) {
|
|
65
65
|
const t = Math.random() * 16 | 0;
|
|
66
66
|
return (h === "x" ? t : t & 3 | 8).toString(16);
|
|
@@ -1011,7 +1011,7 @@ class ue {
|
|
|
1011
1011
|
const s = t.length;
|
|
1012
1012
|
t.forEach((o, r) => {
|
|
1013
1013
|
var y;
|
|
1014
|
-
const { ROW_KEY: a = "", DEFAULT_EXPAND_ALL: c, CELL_HEIGHT: l, SELECTABLE_METHOD: d, CHECKBOX_KEY: f } = this.ctx.config, u = o[a], x = u != null ? `${u}` :
|
|
1014
|
+
const { ROW_KEY: a = "", DEFAULT_EXPAND_ALL: c, CELL_HEIGHT: l, SELECTABLE_METHOD: d, CHECKBOX_KEY: f } = this.ctx.config, u = o[a], x = u != null ? `${u}` : Mt();
|
|
1015
1015
|
this.itemRowKeyMap.set(o, x);
|
|
1016
1016
|
const w = o._height || l, m = o._readonly;
|
|
1017
1017
|
let g = !0;
|
|
@@ -1065,7 +1065,13 @@ class ue {
|
|
|
1065
1065
|
* @returns 获取转化平铺数据
|
|
1066
1066
|
*/
|
|
1067
1067
|
getAllRowsData() {
|
|
1068
|
-
|
|
1068
|
+
let t = [];
|
|
1069
|
+
const e = (i) => {
|
|
1070
|
+
i.forEach((s) => {
|
|
1071
|
+
t.push(s), Array.isArray(s.children) && e(s.children);
|
|
1072
|
+
});
|
|
1073
|
+
};
|
|
1074
|
+
return e(this.data), t;
|
|
1069
1075
|
}
|
|
1070
1076
|
filterColumns(t) {
|
|
1071
1077
|
return t.reduce((e, i) => {
|
|
@@ -1880,9 +1886,9 @@ class ue {
|
|
|
1880
1886
|
return `${I}${O}`;
|
|
1881
1887
|
}, "");
|
|
1882
1888
|
for (let I = e - 1; I >= 0; I--) {
|
|
1883
|
-
const _ = this.rowIndexRowKeyMap.get(I) || "", O = c.reduce((
|
|
1889
|
+
const _ = this.rowIndexRowKeyMap.get(I) || "", O = c.reduce((M, L) => {
|
|
1884
1890
|
const H = this.getItemValue(_, L) ?? "";
|
|
1885
|
-
return `${
|
|
1891
|
+
return `${M}${H}`;
|
|
1886
1892
|
}, "");
|
|
1887
1893
|
if (S === O)
|
|
1888
1894
|
g = I;
|
|
@@ -1890,9 +1896,9 @@ class ue {
|
|
|
1890
1896
|
break;
|
|
1891
1897
|
}
|
|
1892
1898
|
for (let I = e; I <= this.ctx.maxRowIndex; I++) {
|
|
1893
|
-
const _ = this.rowIndexRowKeyMap.get(I) || "", O = c.reduce((
|
|
1899
|
+
const _ = this.rowIndexRowKeyMap.get(I) || "", O = c.reduce((M, L) => {
|
|
1894
1900
|
const H = this.getItemValue(_, L) ?? "";
|
|
1895
|
-
return `${
|
|
1901
|
+
return `${M}${H}`;
|
|
1896
1902
|
}, "");
|
|
1897
1903
|
if (S === O)
|
|
1898
1904
|
E = I;
|
|
@@ -1906,12 +1912,12 @@ class ue {
|
|
|
1906
1912
|
for (let I = g; I <= E; I++) {
|
|
1907
1913
|
const { height: _ } = this.positions[I];
|
|
1908
1914
|
v += _;
|
|
1909
|
-
const O = this.rowIndexRowKeyMap.get(I) || "", { item:
|
|
1915
|
+
const O = this.rowIndexRowKeyMap.get(I) || "", { item: M } = this.rowKeyMap.get(O), L = this.getItemValue(O, i);
|
|
1910
1916
|
b.push({
|
|
1911
1917
|
rowKey: O,
|
|
1912
1918
|
key: i,
|
|
1913
1919
|
value: L,
|
|
1914
|
-
row:
|
|
1920
|
+
row: M
|
|
1915
1921
|
});
|
|
1916
1922
|
}
|
|
1917
1923
|
}
|
|
@@ -2866,7 +2872,7 @@ class lt extends Yt {
|
|
|
2866
2872
|
n(this, "drawSortImageHeight", 0);
|
|
2867
2873
|
n(this, "drawSortImageName", "");
|
|
2868
2874
|
n(this, "drawSortImageSource");
|
|
2869
|
-
this.ctx = e, this.x = s, this.y = o, this.width = r, this.height = a, this.visibleWidth = r, this.visibleHeight = a, this.colIndex = i, this.key = c.key, this.minWidth = c.minWidth, this.maxWidth = c.maxWidth, this.type = c.type || "", this.editorType = c.editorType || "text", this.hideHeaderSelection = c.hideHeaderSelection || !1, this.align = c.headerAlign || c.align || this.ctx.config.COLUMNS_ALIGN, this.verticalAlign = c.headerVerticalAlign || c.verticalAlign || this.ctx.config.COLUMNS_VERTICAL_ALIGN, this.fixed = c.fixed, this.level = c.level || 0, this.operation = c.operation || !1, this.text = c.title, this.column = c, this.colspan = c.colspan || 1, this.widthFillDisable = c.widthFillDisable || !1, this.rowspan = c.rowspan || 1, this.rules = c.rules, this.readonly = c.readonly || !1, this.required = c.required || !1, this.sortIconName = c.sortIconName || "sort-default", this.sortAscIconName = c.sortAscIconName || "sort-asc", this.sortDescIconName = c.sortDescIconName || "sort-desc", this.rowKey =
|
|
2875
|
+
this.ctx = e, this.x = s, this.y = o, this.width = r, this.height = a, this.visibleWidth = r, this.visibleHeight = a, this.colIndex = i, this.key = c.key, this.minWidth = c.minWidth, this.maxWidth = c.maxWidth, this.type = c.type || "", this.editorType = c.editorType || "text", this.hideHeaderSelection = c.hideHeaderSelection || !1, this.align = c.headerAlign || c.align || this.ctx.config.COLUMNS_ALIGN, this.verticalAlign = c.headerVerticalAlign || c.verticalAlign || this.ctx.config.COLUMNS_VERTICAL_ALIGN, this.fixed = c.fixed, this.level = c.level || 0, this.operation = c.operation || !1, this.text = c.title, this.column = c, this.colspan = c.colspan || 1, this.widthFillDisable = c.widthFillDisable || !1, this.rowspan = c.rowspan || 1, this.rules = c.rules, this.readonly = c.readonly || !1, this.required = c.required || !1, this.sortIconName = c.sortIconName || "sort-default", this.sortAscIconName = c.sortAscIconName || "sort-asc", this.sortDescIconName = c.sortDescIconName || "sort-desc", this.rowKey = Mt(), this.overflowTooltipShow = c.overflowTooltipHeaderShow !== !1, this.hasChildren = c.children && c.children.length > 0 || !1, this.render = c.renderHeader;
|
|
2870
2876
|
}
|
|
2871
2877
|
/**
|
|
2872
2878
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -4982,7 +4988,7 @@ const j = Math.min, $ = Math.max, it = Math.round, Y = (h) => ({
|
|
|
4982
4988
|
right: "left",
|
|
4983
4989
|
bottom: "top",
|
|
4984
4990
|
top: "bottom"
|
|
4985
|
-
},
|
|
4991
|
+
}, Ae = {
|
|
4986
4992
|
start: "end",
|
|
4987
4993
|
end: "start"
|
|
4988
4994
|
};
|
|
@@ -5004,9 +5010,9 @@ function Kt(h) {
|
|
|
5004
5010
|
function gt(h) {
|
|
5005
5011
|
return h === "y" ? "height" : "width";
|
|
5006
5012
|
}
|
|
5007
|
-
const
|
|
5013
|
+
const Me = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
5008
5014
|
function V(h) {
|
|
5009
|
-
return
|
|
5015
|
+
return Me.has(z(h)) ? "y" : "x";
|
|
5010
5016
|
}
|
|
5011
5017
|
function wt(h) {
|
|
5012
5018
|
return Kt(V(h));
|
|
@@ -5022,7 +5028,7 @@ function De(h) {
|
|
|
5022
5028
|
return [dt(h), t, dt(t)];
|
|
5023
5029
|
}
|
|
5024
5030
|
function dt(h) {
|
|
5025
|
-
return h.replace(/start|end/g, (t) =>
|
|
5031
|
+
return h.replace(/start|end/g, (t) => Ae[t]);
|
|
5026
5032
|
}
|
|
5027
5033
|
const vt = ["left", "right"], _t = ["right", "left"], Ne = ["top", "bottom"], ke = ["bottom", "top"];
|
|
5028
5034
|
function Xe(h, t, e) {
|
|
@@ -5258,7 +5264,7 @@ const We = (h) => ({
|
|
|
5258
5264
|
}, x = wt(s), w = gt(x), m = await r.getDimensions(l), g = x === "y", E = g ? "top" : "left", y = g ? "bottom" : "right", p = g ? "clientHeight" : "clientWidth", b = o.reference[w] + o.reference[x] - u[x] - o.floating[w], C = u[x] - o.reference[x], R = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l));
|
|
5259
5265
|
let v = R ? R[p] : 0;
|
|
5260
5266
|
(!v || !await (r.isElement == null ? void 0 : r.isElement(R))) && (v = a.floating[p] || o.floating[w]);
|
|
5261
|
-
const T = b / 2 - C / 2, S = v / 2 - m[w] / 2 - 1, I = j(f[E], S), _ = j(f[y], S), O = I,
|
|
5267
|
+
const T = b / 2 - C / 2, S = v / 2 - m[w] / 2 - 1, I = j(f[E], S), _ = j(f[y], S), O = I, M = v - m[w] - _, L = v / 2 - m[w] / 2 + T, H = ht(O, L, M), K = !c.arrow && Q(s) != null && L !== H && o.reference[w] / 2 - (L < O ? I : _) - m[w] / 2 < 0, D = K ? L < O ? L - O : L - M : 0;
|
|
5262
5268
|
return {
|
|
5263
5269
|
[x]: u[x] + D,
|
|
5264
5270
|
data: {
|
|
@@ -5325,8 +5331,8 @@ const We = (h) => ({
|
|
|
5325
5331
|
if (!K)
|
|
5326
5332
|
switch (x) {
|
|
5327
5333
|
case "bestFit": {
|
|
5328
|
-
var
|
|
5329
|
-
const D = (
|
|
5334
|
+
var M;
|
|
5335
|
+
const D = (M = I.filter((N) => {
|
|
5330
5336
|
if (R) {
|
|
5331
5337
|
const F = V(N.placement);
|
|
5332
5338
|
return F === y || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -5334,7 +5340,7 @@ const We = (h) => ({
|
|
|
5334
5340
|
F === "y";
|
|
5335
5341
|
}
|
|
5336
5342
|
return !0;
|
|
5337
|
-
}).map((N) => [N.placement, N.overflows.filter((F) => F > 0).reduce((F, ie) => F + ie, 0)]).sort((N, F) => N[1] - F[1])[0]) == null ? void 0 :
|
|
5343
|
+
}).map((N) => [N.placement, N.overflows.filter((F) => F > 0).reduce((F, ie) => F + ie, 0)]).sort((N, F) => N[1] - F[1])[0]) == null ? void 0 : M[0];
|
|
5338
5344
|
D && (K = D);
|
|
5339
5345
|
break;
|
|
5340
5346
|
}
|
|
@@ -5465,7 +5471,7 @@ function rt() {
|
|
|
5465
5471
|
function Z(h) {
|
|
5466
5472
|
return Vt(h) ? (h.nodeName || "").toLowerCase() : "#document";
|
|
5467
5473
|
}
|
|
5468
|
-
function
|
|
5474
|
+
function A(h) {
|
|
5469
5475
|
var t;
|
|
5470
5476
|
return (h == null || (t = h.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
5471
5477
|
}
|
|
@@ -5474,16 +5480,16 @@ function W(h) {
|
|
|
5474
5480
|
return (t = (Vt(h) ? h.ownerDocument : h.document) || window.document) == null ? void 0 : t.documentElement;
|
|
5475
5481
|
}
|
|
5476
5482
|
function Vt(h) {
|
|
5477
|
-
return rt() ? h instanceof Node || h instanceof
|
|
5483
|
+
return rt() ? h instanceof Node || h instanceof A(h).Node : !1;
|
|
5478
5484
|
}
|
|
5479
5485
|
function k(h) {
|
|
5480
|
-
return rt() ? h instanceof Element || h instanceof
|
|
5486
|
+
return rt() ? h instanceof Element || h instanceof A(h).Element : !1;
|
|
5481
5487
|
}
|
|
5482
5488
|
function B(h) {
|
|
5483
|
-
return rt() ? h instanceof HTMLElement || h instanceof
|
|
5489
|
+
return rt() ? h instanceof HTMLElement || h instanceof A(h).HTMLElement : !1;
|
|
5484
5490
|
}
|
|
5485
5491
|
function Ot(h) {
|
|
5486
|
-
return !rt() || typeof ShadowRoot > "u" ? !1 : h instanceof ShadowRoot || h instanceof
|
|
5492
|
+
return !rt() || typeof ShadowRoot > "u" ? !1 : h instanceof ShadowRoot || h instanceof A(h).ShadowRoot;
|
|
5487
5493
|
}
|
|
5488
5494
|
const Ge = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
5489
5495
|
function tt(h) {
|
|
@@ -5533,7 +5539,7 @@ function U(h) {
|
|
|
5533
5539
|
return ei.has(Z(h));
|
|
5534
5540
|
}
|
|
5535
5541
|
function X(h) {
|
|
5536
|
-
return
|
|
5542
|
+
return A(h).getComputedStyle(h);
|
|
5537
5543
|
}
|
|
5538
5544
|
function at(h) {
|
|
5539
5545
|
return k(h) ? {
|
|
@@ -5563,7 +5569,7 @@ function Pt(h) {
|
|
|
5563
5569
|
function zt(h, t, e) {
|
|
5564
5570
|
var i;
|
|
5565
5571
|
t === void 0 && (t = []);
|
|
5566
|
-
const s = Pt(h), o = s === ((i = h.ownerDocument) == null ? void 0 : i.body), r =
|
|
5572
|
+
const s = Pt(h), o = s === ((i = h.ownerDocument) == null ? void 0 : i.body), r = A(s);
|
|
5567
5573
|
return o ? (ft(r), t.concat(r, r.visualViewport || [], tt(s) ? s : [], [])) : t.concat(s, zt(s, []));
|
|
5568
5574
|
}
|
|
5569
5575
|
function ft(h) {
|
|
@@ -5599,14 +5605,14 @@ function G(h) {
|
|
|
5599
5605
|
}
|
|
5600
5606
|
const ii = /* @__PURE__ */ Y(0);
|
|
5601
5607
|
function Ut(h) {
|
|
5602
|
-
const t =
|
|
5608
|
+
const t = A(h);
|
|
5603
5609
|
return !Et() || !t.visualViewport ? ii : {
|
|
5604
5610
|
x: t.visualViewport.offsetLeft,
|
|
5605
5611
|
y: t.visualViewport.offsetTop
|
|
5606
5612
|
};
|
|
5607
5613
|
}
|
|
5608
5614
|
function si(h, t, e) {
|
|
5609
|
-
return t === void 0 && (t = !1), !e || t && e !==
|
|
5615
|
+
return t === void 0 && (t = !1), !e || t && e !== A(h) ? !1 : t;
|
|
5610
5616
|
}
|
|
5611
5617
|
function q(h, t, e, i) {
|
|
5612
5618
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
@@ -5616,11 +5622,11 @@ function q(h, t, e, i) {
|
|
|
5616
5622
|
const a = si(o, e, i) ? Ut(o) : Y(0);
|
|
5617
5623
|
let c = (s.left + a.x) / r.x, l = (s.top + a.y) / r.y, d = s.width / r.x, f = s.height / r.y;
|
|
5618
5624
|
if (o) {
|
|
5619
|
-
const u =
|
|
5625
|
+
const u = A(o), x = i && k(i) ? A(i) : i;
|
|
5620
5626
|
let w = u, m = ft(w);
|
|
5621
5627
|
for (; m && i && x !== w; ) {
|
|
5622
5628
|
const g = G(m), E = m.getBoundingClientRect(), y = X(m), p = E.left + (m.clientLeft + parseFloat(y.paddingLeft)) * g.x, b = E.top + (m.clientTop + parseFloat(y.paddingTop)) * g.y;
|
|
5623
|
-
c *= g.x, l *= g.y, d *= g.x, f *= g.y, c += p, l += b, w =
|
|
5629
|
+
c *= g.x, l *= g.y, d *= g.x, f *= g.y, c += p, l += b, w = A(m), m = ft(w);
|
|
5624
5630
|
}
|
|
5625
5631
|
}
|
|
5626
5632
|
return ot({
|
|
@@ -5687,7 +5693,7 @@ function ni(h) {
|
|
|
5687
5693
|
};
|
|
5688
5694
|
}
|
|
5689
5695
|
function ai(h, t) {
|
|
5690
|
-
const e =
|
|
5696
|
+
const e = A(h), i = W(h), s = e.visualViewport;
|
|
5691
5697
|
let o = i.clientWidth, r = i.clientHeight, a = 0, c = 0;
|
|
5692
5698
|
if (s) {
|
|
5693
5699
|
o = s.width, r = s.height;
|
|
@@ -5802,7 +5808,7 @@ function xi(h, t, e) {
|
|
|
5802
5808
|
function ct(h) {
|
|
5803
5809
|
return X(h).position === "static";
|
|
5804
5810
|
}
|
|
5805
|
-
function
|
|
5811
|
+
function At(h, t) {
|
|
5806
5812
|
if (!B(h) || X(h).position === "fixed")
|
|
5807
5813
|
return null;
|
|
5808
5814
|
if (t)
|
|
@@ -5811,7 +5817,7 @@ function Mt(h, t) {
|
|
|
5811
5817
|
return W(h) === e && (e = e.ownerDocument.body), e;
|
|
5812
5818
|
}
|
|
5813
5819
|
function qt(h, t) {
|
|
5814
|
-
const e =
|
|
5820
|
+
const e = A(h);
|
|
5815
5821
|
if (nt(h))
|
|
5816
5822
|
return e;
|
|
5817
5823
|
if (!B(h)) {
|
|
@@ -5823,9 +5829,9 @@ function qt(h, t) {
|
|
|
5823
5829
|
}
|
|
5824
5830
|
return e;
|
|
5825
5831
|
}
|
|
5826
|
-
let i =
|
|
5832
|
+
let i = At(h, t);
|
|
5827
5833
|
for (; i && Ze(i) && ct(i); )
|
|
5828
|
-
i =
|
|
5834
|
+
i = At(i, t);
|
|
5829
5835
|
return i && U(i) && ct(i) && !mt(i) ? e : i || ti(h) || e;
|
|
5830
5836
|
}
|
|
5831
5837
|
const ui = async function(h) {
|