e-virt-table 1.2.4 → 1.2.5
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 +73 -72
- 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/Config.d.ts +1 -0
- package/dist/lib/Config.js +9 -2
- package/dist/lib/Config.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(':root{--evt-header-font: "12px normal Arial";--evt-body-font: "12px normal Arial";--evt-color-white: #fff;--evt-color-black: #000000;--evt-color-primary: rgb(82, 146, 247);--evt-text-color-primary: #333;--evt-text-color-regular: #666;--evt-text-color-secondary: #999;--evt-box-shadow: 0 2px 12px 0 #0000001a;--evt-editor-bg-color: #fff;--evt-editor-text-color: #333;--evt-border-color: #e1e6eb;--evt-stripe-color: #fafafa;--evt-placeholder-color: #cdd0dc;--evt-header-bg-color: #f8faff;--evt-body-bg-color: #fff;--evt-header-text-color: #1d2129;--evt-loading-icon-color: #4e5969;--evt-expand-icon-color: #4e5969;--evt-shrink-icon-color: #4e5969;--evt-error-tip-icon-color: red;--evt-cell-hover-icon-bg-color: #fff;--evt-cell-hover-icon-border-color: #dde0ea;--evt-scroller-color: #dee0e3;--evt-scroller-track-color: #fff;--evt-scroller-focus-color: #bbbec4;--evt-select-border-color: var(--evt-color-primary);--evt-select-area-color: rgba(82, 146, 247, .1);--evt-select-row-col-bg-color: transparent;--evt-autofill-point-border-color: #fff;--evt-edit-bg-color: #fcf6ed;--evt-checkbox-color: var(--evt-color-primary);--evt-readonly-color: #fff;--evt-readonly-text-color: #4e5969;--evt-error-tip-color: #ed3f14;--evt-footer-bg-color: #fafafa;--evt-highlight-hover-row-color: rgba(186, 203, 231, .1);--evt-highlight-selected-row-color: rgba(82, 146, 247, .1);--evt-tooltip-bg-color: #303133;--evt-tooltip-text-color: #fff;--evt-resize-row-line-color: #e1e6eb;--evt-resize-column-line-color: #e1e6eb}.dark{--evt-border-color: #363637;--evt-header-bg-color: #141414;--evt-body-bg-color: #141414;--evt-header-text-color: #a3a6ad;--evt-scroller-color: #414243;--evt-scroller-track-color: #141414;--evt-scroller-focus-color: #a3a6ad;--evt-edit-bg-color: #141414;--evt-readonly-text-color: #cfd3dc;--evt-footer-bg-color: #262727;--evt-autofill-point-border-color: #fff;--evt-editor-bg-color: #434343;--evt-editor-text-color: #cfd3dc}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;box-sizing:border-box;z-index:10;border-radius:8px;border:1px solid var(--evt-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;border:none;outline:none;z-index:10}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;height:auto;line-height:0;z-index:100;overflow:hidden;background-color:var(--evt-editor-bg-color);border:2px solid var(--evt-color-primary);box-sizing:border-box;box-shadow:var(--evt-box-shadow);display:flex;align-items:center}.e-virt-table-overlayer{position:absolute;left:0;top:0;overflow:hidden;z-index:100;pointer-events:none}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;outline:none;font-weight:400;padding:8px;font-size:12px;color:inherit;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;line-height:1.5;margin:0;border:none;vertical-align:middle;background:var(--evt-editor-bg-color);color:var(--evt-editor-text-color);overflow-y:auto;resize:none}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--evt-text-color-regular);background-color:var(--evt-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--evt-box-shadow);width:fit-content;padding:6px 0;z-index:9999;left:-99999px;top:-99999px}.e-virt-table-context-menu-item{cursor:pointer;padding:8px 24px;color:var(--evt-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--evt-color-primary);background-color:#f5f7fa}')),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
2
|
var be = Object.defineProperty;
|
|
3
3
|
var ve = (a, t, e) => t in a ? be(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
4
4
|
var l = (a, t, e) => ve(a, typeof t != "symbol" ? t + "" : t, e);
|
|
@@ -25,7 +25,7 @@ function st(a, t) {
|
|
|
25
25
|
return i.__proto__ = s, i;
|
|
26
26
|
}, st(a, t);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function _e() {
|
|
29
29
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
30
30
|
if (typeof Proxy == "function") return !0;
|
|
31
31
|
try {
|
|
@@ -36,20 +36,20 @@ function Ie() {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
function dt(a, t, e) {
|
|
39
|
-
return
|
|
39
|
+
return _e() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
|
|
40
40
|
var n = [null];
|
|
41
41
|
n.push.apply(n, r);
|
|
42
42
|
var h = Function.bind.apply(s, n), c = new h();
|
|
43
43
|
return o && st(c, o.prototype), c;
|
|
44
44
|
}, dt.apply(null, arguments);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Ie(a) {
|
|
47
47
|
return Function.toString.call(a).indexOf("[native code]") !== -1;
|
|
48
48
|
}
|
|
49
49
|
function Ct(a) {
|
|
50
50
|
var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
51
51
|
return Ct = function(i) {
|
|
52
|
-
if (i === null || !
|
|
52
|
+
if (i === null || !Ie(i)) return i;
|
|
53
53
|
if (typeof i != "function")
|
|
54
54
|
throw new TypeError("Super expression must either be null or a function");
|
|
55
55
|
if (typeof t < "u") {
|
|
@@ -573,17 +573,17 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
573
573
|
return Te(u, h, function(x, w) {
|
|
574
574
|
var m = x.rule, C = (m.type === "object" || m.type === "array") && (typeof m.fields == "object" || typeof m.defaultField == "object");
|
|
575
575
|
C = C && (m.required || !m.required && x.value), m.field = x.field;
|
|
576
|
-
function y(v,
|
|
577
|
-
return q({},
|
|
576
|
+
function y(v, I) {
|
|
577
|
+
return q({}, I, {
|
|
578
578
|
fullField: m.fullField + "." + v,
|
|
579
579
|
fullFields: m.fullFields ? [].concat(m.fullFields, [v]) : [v]
|
|
580
580
|
});
|
|
581
581
|
}
|
|
582
582
|
function b(v) {
|
|
583
583
|
v === void 0 && (v = []);
|
|
584
|
-
var
|
|
585
|
-
!h.suppressWarning &&
|
|
586
|
-
var L =
|
|
584
|
+
var I = Array.isArray(v) ? v : [v];
|
|
585
|
+
!h.suppressWarning && I.length && a.warning("async-validator:", I), I.length && m.message !== void 0 && (I = [].concat(m.message));
|
|
586
|
+
var L = I.map(Bt(m, n));
|
|
587
587
|
if (h.first && L.length)
|
|
588
588
|
return p[m.field] = 1, w(L);
|
|
589
589
|
if (!C)
|
|
@@ -591,13 +591,13 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
591
591
|
else {
|
|
592
592
|
if (m.required && !x.value)
|
|
593
593
|
return m.message !== void 0 ? L = [].concat(m.message).map(Bt(m, n)) : h.error && (L = [h.error(m, D(h.messages.required, m.field))]), w(L);
|
|
594
|
-
var
|
|
594
|
+
var _ = {};
|
|
595
595
|
m.defaultField && Object.keys(x.value).map(function(S) {
|
|
596
|
-
|
|
597
|
-
}),
|
|
596
|
+
_[S] = m.defaultField;
|
|
597
|
+
}), _ = q({}, _, x.rule.fields);
|
|
598
598
|
var R = {};
|
|
599
|
-
Object.keys(
|
|
600
|
-
var M =
|
|
599
|
+
Object.keys(_).forEach(function(S) {
|
|
600
|
+
var M = _[S], T = Array.isArray(M) ? M : [M];
|
|
601
601
|
R[S] = T.map(y.bind(null, S));
|
|
602
602
|
});
|
|
603
603
|
var A = new a(R);
|
|
@@ -702,10 +702,10 @@ function ee(a = [], t = 1, e = 0) {
|
|
|
702
702
|
};
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function _t(a = []) {
|
|
706
706
|
let t = [];
|
|
707
707
|
return a.forEach((e) => {
|
|
708
|
-
e.children ? t = t.concat(
|
|
708
|
+
e.children ? t = t.concat(_t(e.children)) : t.push(e);
|
|
709
709
|
}), t;
|
|
710
710
|
}
|
|
711
711
|
const Yt = /^(\r\n|\n\r|\r|\n)/, ii = /^[^\t\r\n]+/, Vt = /^\t/;
|
|
@@ -1054,14 +1054,14 @@ class Tt extends re {
|
|
|
1054
1054
|
if (this.cellType === "footer") {
|
|
1055
1055
|
let E = n, v = o;
|
|
1056
1056
|
if (typeof r == "function") {
|
|
1057
|
-
const
|
|
1057
|
+
const I = r, { backgroundColor: L, color: _ } = I({
|
|
1058
1058
|
row: this.row,
|
|
1059
1059
|
rowIndex: this.rowIndex,
|
|
1060
1060
|
colIndex: this.colIndex,
|
|
1061
1061
|
column: this.column,
|
|
1062
1062
|
value: this.getValue()
|
|
1063
1063
|
}) || {};
|
|
1064
|
-
L && (E = L),
|
|
1064
|
+
L && (E = L), _ && (v = _);
|
|
1065
1065
|
}
|
|
1066
1066
|
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = E, this.drawTextColor = v;
|
|
1067
1067
|
return;
|
|
@@ -1076,7 +1076,7 @@ class Tt extends re {
|
|
|
1076
1076
|
d && w && (w.rowKey === this.rowKey && (p = f), w.rowIndex >= m && w.rowIndex <= C && (p = f)), h && x && (x.rowKey === this.rowKey && (p = c), x.rowIndex >= m && x.rowIndex <= C && (p = c)), this.drawCellSkyBgColor = p;
|
|
1077
1077
|
let y = e, b = o;
|
|
1078
1078
|
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (y = i, b = o), u && (this.rowIndex % 2 ? y = g : y = e), typeof s == "function") {
|
|
1079
|
-
const E = s, { backgroundColor: v, color:
|
|
1079
|
+
const E = s, { backgroundColor: v, color: I } = E({
|
|
1080
1080
|
row: this.row,
|
|
1081
1081
|
rowIndex: this.rowIndex,
|
|
1082
1082
|
colIndex: this.colIndex,
|
|
@@ -1084,7 +1084,7 @@ class Tt extends re {
|
|
|
1084
1084
|
isHasChanged: this.isHasChanged,
|
|
1085
1085
|
value: this.getValue()
|
|
1086
1086
|
}) || {};
|
|
1087
|
-
v && (y = v),
|
|
1087
|
+
v && (y = v), I && (b = I);
|
|
1088
1088
|
}
|
|
1089
1089
|
this.drawCellBgColor = y, this.drawTextColor = b;
|
|
1090
1090
|
}
|
|
@@ -2170,10 +2170,10 @@ class li {
|
|
|
2170
2170
|
}
|
|
2171
2171
|
]
|
|
2172
2172
|
};
|
|
2173
|
-
let w = e, m = e, C = n, y = n, b = [], E = 0, v = 0,
|
|
2173
|
+
let w = e, m = e, C = n, y = n, b = [], E = 0, v = 0, I = 0, L = 0;
|
|
2174
2174
|
if (d !== 1 && p) {
|
|
2175
2175
|
L = u;
|
|
2176
|
-
const
|
|
2176
|
+
const _ = h.reduce((R, A) => {
|
|
2177
2177
|
const S = this.getItemValue(s, A) ?? "";
|
|
2178
2178
|
return `${R}${S}`;
|
|
2179
2179
|
}, "");
|
|
@@ -2182,7 +2182,7 @@ class li {
|
|
|
2182
2182
|
const B = this.getItemValue(A, T) ?? "";
|
|
2183
2183
|
return `${M}${B}`;
|
|
2184
2184
|
}, "");
|
|
2185
|
-
if (
|
|
2185
|
+
if (_ === S)
|
|
2186
2186
|
w = R;
|
|
2187
2187
|
else
|
|
2188
2188
|
break;
|
|
@@ -2192,7 +2192,7 @@ class li {
|
|
|
2192
2192
|
const B = this.getItemValue(A, T) ?? "";
|
|
2193
2193
|
return `${M}${B}`;
|
|
2194
2194
|
}, "");
|
|
2195
|
-
if (
|
|
2195
|
+
if (_ === S)
|
|
2196
2196
|
m = R;
|
|
2197
2197
|
else
|
|
2198
2198
|
break;
|
|
@@ -2203,7 +2203,7 @@ class li {
|
|
|
2203
2203
|
}
|
|
2204
2204
|
for (let R = w; R <= m; R++) {
|
|
2205
2205
|
const { height: A } = this.positions[R];
|
|
2206
|
-
|
|
2206
|
+
I += A;
|
|
2207
2207
|
const S = this.rowIndexRowKeyMap.get(R) || "", { item: M } = this.rowKeyMap.get(S), T = this.getItemValue(S, i);
|
|
2208
2208
|
b.push({
|
|
2209
2209
|
rowKey: S,
|
|
@@ -2214,35 +2214,35 @@ class li {
|
|
|
2214
2214
|
}
|
|
2215
2215
|
}
|
|
2216
2216
|
if (g !== 1 && x) {
|
|
2217
|
-
|
|
2218
|
-
for (let
|
|
2219
|
-
const R = this.getColumnByColIndex(
|
|
2217
|
+
I = f;
|
|
2218
|
+
for (let _ = n - 1; _ >= 0; _--) {
|
|
2219
|
+
const R = this.getColumnByColIndex(_);
|
|
2220
2220
|
if (!R)
|
|
2221
2221
|
break;
|
|
2222
2222
|
const A = this.getItemValue(s, i), S = this.getItemValue(s, R.key);
|
|
2223
2223
|
if (A === S && c.includes(R.key))
|
|
2224
|
-
C =
|
|
2224
|
+
C = _;
|
|
2225
2225
|
else
|
|
2226
2226
|
break;
|
|
2227
2227
|
}
|
|
2228
|
-
for (let
|
|
2229
|
-
const R = this.getColumnByColIndex(
|
|
2228
|
+
for (let _ = n; _ <= this.ctx.maxColIndex; _++) {
|
|
2229
|
+
const R = this.getColumnByColIndex(_);
|
|
2230
2230
|
if (!R)
|
|
2231
2231
|
break;
|
|
2232
2232
|
const A = this.getItemValue(s, i), S = this.getItemValue(s, R.key);
|
|
2233
2233
|
if (A === S && c.includes(R.key))
|
|
2234
|
-
y =
|
|
2234
|
+
y = _;
|
|
2235
2235
|
else
|
|
2236
2236
|
break;
|
|
2237
2237
|
}
|
|
2238
|
-
for (let
|
|
2239
|
-
const R = this.getColumnByColIndex(
|
|
2238
|
+
for (let _ = C; _ < n; _++) {
|
|
2239
|
+
const R = this.getColumnByColIndex(_);
|
|
2240
2240
|
if (!R)
|
|
2241
2241
|
break;
|
|
2242
2242
|
v += R.width || 100;
|
|
2243
2243
|
}
|
|
2244
|
-
for (let
|
|
2245
|
-
const R = this.getColumnByColIndex(
|
|
2244
|
+
for (let _ = C; _ <= y; _++) {
|
|
2245
|
+
const R = this.getColumnByColIndex(_);
|
|
2246
2246
|
if (!R)
|
|
2247
2247
|
break;
|
|
2248
2248
|
L += R.width || 100, b.push({
|
|
@@ -2258,7 +2258,7 @@ class li {
|
|
|
2258
2258
|
yArr: [w, m],
|
|
2259
2259
|
rowspan: d,
|
|
2260
2260
|
colspan: g,
|
|
2261
|
-
height:
|
|
2261
|
+
height: I,
|
|
2262
2262
|
width: L,
|
|
2263
2263
|
offsetTop: E,
|
|
2264
2264
|
offsetLeft: v,
|
|
@@ -2606,6 +2606,7 @@ class fi {
|
|
|
2606
2606
|
}
|
|
2607
2607
|
class Wt {
|
|
2608
2608
|
constructor(t) {
|
|
2609
|
+
l(this, "_config", {});
|
|
2609
2610
|
l(this, "CSS_PREFIX", "e-virt-table");
|
|
2610
2611
|
l(this, "ICONS", []);
|
|
2611
2612
|
l(this, "ROW_KEY", "");
|
|
@@ -2750,10 +2751,10 @@ class Wt {
|
|
|
2750
2751
|
l(this, "BEFORE_SET_SELECTOR_METHOD");
|
|
2751
2752
|
l(this, "BEFORE_SET_AUTOFILL_METHOD");
|
|
2752
2753
|
l(this, "BEFORE_COPY_METHOD");
|
|
2753
|
-
this.
|
|
2754
|
+
this._config = t, this.updateCssVar();
|
|
2754
2755
|
}
|
|
2755
2756
|
init(t) {
|
|
2756
|
-
this.
|
|
2757
|
+
this._config = t, this.updateCssVar();
|
|
2757
2758
|
}
|
|
2758
2759
|
// 同步css 样式变量
|
|
2759
2760
|
updateCssVar() {
|
|
@@ -2762,7 +2763,7 @@ class Wt {
|
|
|
2762
2763
|
const e = `--evt-${t.toLocaleLowerCase().replace(/_/g, "-")}`, i = ai(e);
|
|
2763
2764
|
this[t] = i;
|
|
2764
2765
|
}
|
|
2765
|
-
});
|
|
2766
|
+
}), Object.assign(this, this._config);
|
|
2766
2767
|
}
|
|
2767
2768
|
}
|
|
2768
2769
|
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>';
|
|
@@ -3671,7 +3672,7 @@ class pi {
|
|
|
3671
3672
|
config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
|
|
3672
3673
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3673
3674
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3674
|
-
const s = te(i), r =
|
|
3675
|
+
const s = te(i), r = _t(i);
|
|
3675
3676
|
this.height = t * s, this.width = r.reduce((f, u) => f + ((u == null ? void 0 : u.width) || 100), 0), this.visibleHeight = this.height;
|
|
3676
3677
|
const o = ei(ee(i, s));
|
|
3677
3678
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
@@ -3774,7 +3775,7 @@ class pi {
|
|
|
3774
3775
|
for (let o = 0; o < i; o++) {
|
|
3775
3776
|
const n = t[o], h = r * (n.rowspan || 0), c = r * (n.level || 0);
|
|
3776
3777
|
let d = n.width || 100;
|
|
3777
|
-
n.children && (d =
|
|
3778
|
+
n.children && (d = _t(n.children).reduce((g, p) => g + ((p == null ? void 0 : p.width) || 100), 0));
|
|
3778
3779
|
const f = new oe(this.ctx, this.columnIndex, s, c, d, h, n);
|
|
3779
3780
|
this.ctx.database.setHeader(n.key, f), this.allCellHeaders.push(f), n.children || (this.leafCellHeaders.push(f), f.column.widthFillDisable || this.resizeNum++), n.fixed === "left" ? this.fixedLeftCellHeaders.push(f) : n.fixed === "right" ? this.fixedRightCellHeaders.push(f) : this.centerCellHeaders.push(f), !n.children && this.columnIndex++, n.children && this.render(n.children, s), s += d;
|
|
3780
3781
|
}
|
|
@@ -3966,8 +3967,8 @@ class mi {
|
|
|
3966
3967
|
m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
|
|
3967
3968
|
let b = this.ctx.stageHeight - e.height - o;
|
|
3968
3969
|
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;
|
|
3969
|
-
const E = window.devicePixelRatio || 1, v = this.ctx.stageWidth * E,
|
|
3970
|
-
t.width = Math.floor(v), t.height = Math.floor(
|
|
3970
|
+
const E = window.devicePixelRatio || 1, v = this.ctx.stageWidth * E, I = this.ctx.stageHeight * E;
|
|
3971
|
+
t.width = Math.floor(v), t.height = Math.floor(I);
|
|
3971
3972
|
const L = this.data.length ? "not-empty" : "empty";
|
|
3972
3973
|
this.ctx.emit("emptyChange", {
|
|
3973
3974
|
isEmpty: L,
|
|
@@ -4335,14 +4336,14 @@ class Ei {
|
|
|
4335
4336
|
m === C && y === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(g, m), Math.min(p, C)], o = [Math.max(x, y), Math.min(w, b)];
|
|
4336
4337
|
const { BEFORE_SET_SELECTOR_METHOD: E } = this.ctx.config;
|
|
4337
4338
|
if (typeof E == "function") {
|
|
4338
|
-
const
|
|
4339
|
+
const I = E({
|
|
4339
4340
|
focusCell: this.ctx.focusCell,
|
|
4340
4341
|
xArr: r,
|
|
4341
4342
|
yArr: o
|
|
4342
4343
|
});
|
|
4343
|
-
if (!
|
|
4344
|
+
if (!I)
|
|
4344
4345
|
return;
|
|
4345
|
-
r =
|
|
4346
|
+
r = I.xArr, o = I.yArr;
|
|
4346
4347
|
}
|
|
4347
4348
|
this.ctx.selector.xArr = r, this.ctx.selector.yArr = o, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
|
|
4348
4349
|
}
|
|
@@ -4581,12 +4582,12 @@ class Ei {
|
|
|
4581
4582
|
for (let y = 0; y <= o.length - 1; y++) {
|
|
4582
4583
|
const b = o[y].length;
|
|
4583
4584
|
for (let E = 0; E <= b - 1; E++) {
|
|
4584
|
-
const v = y + e,
|
|
4585
|
+
const v = y + e, I = E + i, L = o[y][E], _ = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
4585
4586
|
v,
|
|
4586
|
-
|
|
4587
|
+
I
|
|
4587
4588
|
);
|
|
4588
|
-
if (
|
|
4589
|
-
const { rowKey: R, key: A } =
|
|
4589
|
+
if (_) {
|
|
4590
|
+
const { rowKey: R, key: A } = _;
|
|
4590
4591
|
this.ctx.database.getReadonly(R, A) || (s.add(R), w.push({
|
|
4591
4592
|
rowKey: R,
|
|
4592
4593
|
key: A,
|
|
@@ -4721,13 +4722,13 @@ class Ei {
|
|
|
4721
4722
|
return;
|
|
4722
4723
|
p && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
4723
4724
|
const { drawX: x, drawY: w, width: m, height: C, fixed: y } = i, b = r - x + 1, E = i.drawX + m - (e - s) + 1;
|
|
4724
|
-
let v = o.height - w,
|
|
4725
|
-
|
|
4725
|
+
let v = o.height - w, I = C;
|
|
4726
|
+
I > h.visibleHeight && (I = h.visibleHeight);
|
|
4726
4727
|
let L = 0;
|
|
4727
4728
|
u && (g === "top" ? v = o.height + n.height - w : L = n.visibleHeight);
|
|
4728
|
-
const
|
|
4729
|
+
const _ = w + I - (t - L - f);
|
|
4729
4730
|
let R = c, A = d;
|
|
4730
|
-
E > 0 && !y ? R = Math.floor(c + E) : b > 0 && !y && (R = Math.floor(c - b)), v > 0 ? A = Math.floor(d - v) :
|
|
4731
|
+
E > 0 && !y ? R = Math.floor(c + E) : b > 0 && !y && (R = Math.floor(c - b)), v > 0 ? A = Math.floor(d - v) : _ > 0 && (A = Math.floor(d + _)), (Math.abs(c - R) > 2 || Math.abs(d - A) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(R, A), this.ctx.emit("adjustBoundaryPosition", i));
|
|
4731
4732
|
}
|
|
4732
4733
|
destroy() {
|
|
4733
4734
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
@@ -4888,7 +4889,7 @@ const rt = Math.min, U = Math.max, ft = Math.round, z = (a) => ({
|
|
|
4888
4889
|
start: "end",
|
|
4889
4890
|
end: "start"
|
|
4890
4891
|
};
|
|
4891
|
-
function
|
|
4892
|
+
function It(a, t, e) {
|
|
4892
4893
|
return U(a, rt(t, e));
|
|
4893
4894
|
}
|
|
4894
4895
|
function at(a, t) {
|
|
@@ -4918,14 +4919,14 @@ function Ri(a, t, e) {
|
|
|
4918
4919
|
let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4919
4920
|
return t.reference[r] > t.floating[r] && (o = ut(o)), [o, ut(o)];
|
|
4920
4921
|
}
|
|
4921
|
-
function
|
|
4922
|
+
function _i(a) {
|
|
4922
4923
|
const t = ut(a);
|
|
4923
4924
|
return [Ot(a), t, Ot(t)];
|
|
4924
4925
|
}
|
|
4925
4926
|
function Ot(a) {
|
|
4926
4927
|
return a.replace(/start|end/g, (t) => vi[t]);
|
|
4927
4928
|
}
|
|
4928
|
-
function
|
|
4929
|
+
function Ii(a, t, e) {
|
|
4929
4930
|
const i = ["left", "right"], s = ["right", "left"], r = ["top", "bottom"], o = ["bottom", "top"];
|
|
4930
4931
|
switch (a) {
|
|
4931
4932
|
case "top":
|
|
@@ -4940,7 +4941,7 @@ function _i(a, t, e) {
|
|
|
4940
4941
|
}
|
|
4941
4942
|
function Oi(a, t, e, i) {
|
|
4942
4943
|
const s = lt(a);
|
|
4943
|
-
let r =
|
|
4944
|
+
let r = Ii(G(a), e === "start", i);
|
|
4944
4945
|
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
|
|
4945
4946
|
}
|
|
4946
4947
|
function ut(a) {
|
|
@@ -5157,9 +5158,9 @@ const Ai = (a) => ({
|
|
|
5157
5158
|
x: e,
|
|
5158
5159
|
y: i
|
|
5159
5160
|
}, g = Ht(s), p = Mt(g), x = await o.getDimensions(c), w = g === "y", m = w ? "top" : "left", C = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = r.reference[p] + r.reference[g] - u[g] - r.floating[p], E = u[g] - r.reference[g], v = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
|
|
5160
|
-
let
|
|
5161
|
-
(!
|
|
5162
|
-
const L = b / 2 - E / 2,
|
|
5161
|
+
let I = v ? v[y] : 0;
|
|
5162
|
+
(!I || !await (o.isElement == null ? void 0 : o.isElement(v))) && (I = n.floating[y] || r.floating[p]);
|
|
5163
|
+
const L = b / 2 - E / 2, _ = I / 2 - x[p] / 2 - 1, R = rt(f[m], _), A = rt(f[C], _), S = R, M = I - x[p] - A, T = I / 2 - x[p] / 2 + L, B = It(S, T, M), Y = !h.arrow && lt(s) != null && T !== B && r.reference[p] / 2 - (T < S ? R : A) - x[p] / 2 < 0, k = Y ? T < S ? T - S : T - M : 0;
|
|
5163
5164
|
return {
|
|
5164
5165
|
[g]: u[g] + k,
|
|
5165
5166
|
data: {
|
|
@@ -5196,20 +5197,20 @@ const Ai = (a) => ({
|
|
|
5196
5197
|
} = at(a, t);
|
|
5197
5198
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
5198
5199
|
return {};
|
|
5199
|
-
const m = G(s), C = J(n), y = G(n) === n, b = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), E = u || (y || !x ? [ut(n)] :
|
|
5200
|
+
const m = G(s), C = J(n), y = G(n) === n, b = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), E = u || (y || !x ? [ut(n)] : _i(n)), v = p !== "none";
|
|
5200
5201
|
!u && v && E.push(...Oi(n, x, p, b));
|
|
5201
|
-
const
|
|
5202
|
+
const I = [n, ...E], L = await he(t, w), _ = [];
|
|
5202
5203
|
let R = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
5203
|
-
if (d &&
|
|
5204
|
+
if (d && _.push(L[m]), f) {
|
|
5204
5205
|
const T = Ri(s, o, b);
|
|
5205
|
-
|
|
5206
|
+
_.push(L[T[0]], L[T[1]]);
|
|
5206
5207
|
}
|
|
5207
5208
|
if (R = [...R, {
|
|
5208
5209
|
placement: s,
|
|
5209
|
-
overflows:
|
|
5210
|
-
}], !
|
|
5210
|
+
overflows: _
|
|
5211
|
+
}], !_.every((T) => T <= 0)) {
|
|
5211
5212
|
var A, S;
|
|
5212
|
-
const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, B =
|
|
5213
|
+
const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, B = I[T];
|
|
5213
5214
|
if (B)
|
|
5214
5215
|
return {
|
|
5215
5216
|
data: {
|
|
@@ -5333,11 +5334,11 @@ const Hi = function(a) {
|
|
|
5333
5334
|
let g = c[u], p = c[f];
|
|
5334
5335
|
if (r) {
|
|
5335
5336
|
const w = u === "y" ? "top" : "left", m = u === "y" ? "bottom" : "right", C = g + d[w], y = g - d[m];
|
|
5336
|
-
g =
|
|
5337
|
+
g = It(C, g, y);
|
|
5337
5338
|
}
|
|
5338
5339
|
if (o) {
|
|
5339
5340
|
const w = f === "y" ? "top" : "left", m = f === "y" ? "bottom" : "right", C = p + d[w], y = p - d[m];
|
|
5340
|
-
p =
|
|
5341
|
+
p = It(C, p, y);
|
|
5341
5342
|
}
|
|
5342
5343
|
const x = n.fn({
|
|
5343
5344
|
...t,
|