e-virt-table 1.2.27 → 1.2.29
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 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1243 -1028
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Autofill.js +2 -0
- package/dist/lib/Autofill.js.map +1 -1
- package/dist/lib/Body.d.ts +1 -0
- package/dist/lib/Body.js +22 -2
- package/dist/lib/Body.js.map +1 -1
- package/dist/lib/Cell.d.ts +10 -1
- package/dist/lib/Cell.js +103 -6
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/CellHeader.d.ts +3 -2
- package/dist/lib/CellHeader.js +31 -64
- package/dist/lib/CellHeader.js.map +1 -1
- package/dist/lib/Config.d.ts +4 -0
- package/dist/lib/Config.js +14 -0
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Database.d.ts +12 -0
- package/dist/lib/Database.js +58 -3
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/EVirtTable.js +1 -0
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/Editor.js +5 -10
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/EventTable.js +22 -0
- package/dist/lib/EventTable.js.map +1 -1
- package/dist/lib/Overlayer.d.ts +2 -0
- package/dist/lib/Overlayer.js +55 -0
- package/dist/lib/Overlayer.js.map +1 -1
- package/dist/lib/Paint.d.ts +32 -2
- package/dist/lib/Paint.js +180 -22
- package/dist/lib/Paint.js.map +1 -1
- package/dist/lib/Row.d.ts +3 -0
- package/dist/lib/Row.js +23 -0
- package/dist/lib/Row.js.map +1 -1
- package/dist/lib/Selector.js +1 -0
- package/dist/lib/Selector.js.map +1 -1
- package/dist/lib/types.d.ts +4 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
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-body-text-color: #4e5969;--evt-footer-text-color: #4e5969;--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: var(--evt-body-text-color);--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;--evt-tree-line-color: #e1e6eb;--evt-sort-icon-color: rgb(82, 146, 247)}.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 se = Object.defineProperty;
|
|
3
|
-
var oe = (
|
|
4
|
-
var n = (
|
|
3
|
+
var oe = (c, t, e) => t in c ? se(c, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[t] = e;
|
|
4
|
+
var n = (c, t, e) => oe(c, typeof t != "symbol" ? t + "" : t, e);
|
|
5
5
|
class re {
|
|
6
6
|
constructor(t) {
|
|
7
7
|
n(this, "rules");
|
|
8
8
|
this.rules = t;
|
|
9
9
|
}
|
|
10
10
|
validate(t) {
|
|
11
|
-
const e = [], { column: i, row: s, key: o, rowKey: r, colIndex: a, rowIndex:
|
|
11
|
+
const e = [], { column: i, row: s, key: o, rowKey: r, colIndex: a, rowIndex: h, value: l, field: d, fieldValue: f } = t;
|
|
12
12
|
Array.isArray(this.rules) || (this.rules = [this.rules]);
|
|
13
13
|
for (const u of this.rules) {
|
|
14
14
|
if (u.validator) {
|
|
15
15
|
const x = {
|
|
16
16
|
field: d,
|
|
17
17
|
fieldValue: f,
|
|
18
|
-
value:
|
|
18
|
+
value: l,
|
|
19
19
|
column: i,
|
|
20
20
|
colIndex: a,
|
|
21
|
-
rowIndex:
|
|
21
|
+
rowIndex: h,
|
|
22
22
|
row: s,
|
|
23
23
|
key: o,
|
|
24
24
|
rowKey: r,
|
|
25
25
|
...u
|
|
26
26
|
};
|
|
27
|
-
u.validator(x,
|
|
27
|
+
u.validator(x, l, (w) => {
|
|
28
28
|
w && e.push({
|
|
29
29
|
...x,
|
|
30
30
|
message: w
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
if (!u.required && (
|
|
34
|
+
if (!u.required && (l == null || l === ""))
|
|
35
35
|
return e;
|
|
36
|
-
u.pattern && !u.pattern.test(
|
|
37
|
-
value:
|
|
36
|
+
u.pattern && !u.pattern.test(l) && e.push({
|
|
37
|
+
value: l,
|
|
38
38
|
column: i,
|
|
39
39
|
row: s,
|
|
40
40
|
key: o,
|
|
41
41
|
rowKey: r,
|
|
42
42
|
colIndex: a,
|
|
43
|
-
rowIndex:
|
|
43
|
+
rowIndex: h,
|
|
44
44
|
field: d,
|
|
45
45
|
fieldValue: f,
|
|
46
46
|
message: u.message || `${o} is pattern validation error`
|
|
47
|
-
}), u.required && (
|
|
48
|
-
value:
|
|
47
|
+
}), u.required && (l == null || l === "") && e.push({
|
|
48
|
+
value: l,
|
|
49
49
|
column: i,
|
|
50
50
|
row: s,
|
|
51
51
|
key: o,
|
|
52
52
|
rowKey: r,
|
|
53
53
|
colIndex: a,
|
|
54
|
-
rowIndex:
|
|
54
|
+
rowIndex: h,
|
|
55
55
|
field: d,
|
|
56
56
|
fieldValue: f,
|
|
57
57
|
message: u.message || `${o} is required`
|
|
@@ -60,27 +60,27 @@ class re {
|
|
|
60
60
|
return e;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(
|
|
63
|
+
function Ht() {
|
|
64
|
+
return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(c) {
|
|
65
65
|
const t = Math.random() * 16 | 0;
|
|
66
|
-
return (
|
|
66
|
+
return (c === "x" ? t : t & 3 | 8).toString(16);
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function xt(c, t) {
|
|
70
70
|
let e = 0, i;
|
|
71
71
|
return function(...s) {
|
|
72
72
|
const o = (/* @__PURE__ */ new Date()).getTime(), r = o - e;
|
|
73
|
-
!e || r >= t ? (
|
|
74
|
-
|
|
73
|
+
!e || r >= t ? (c.apply(this, s), e = o) : i || (i = setTimeout(() => {
|
|
74
|
+
c.apply(this, s), e = (/* @__PURE__ */ new Date()).getTime(), i = void 0;
|
|
75
75
|
}, t - r));
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function Dt(
|
|
79
|
-
return
|
|
78
|
+
function Dt(c = []) {
|
|
79
|
+
return c.length ? c.map((t) => Dt(t.children) + 1).sort((t, e) => e - t)[0] : 0;
|
|
80
80
|
}
|
|
81
|
-
function ne(
|
|
81
|
+
function ne(c = []) {
|
|
82
82
|
let t = [], e = [], i = [];
|
|
83
|
-
return
|
|
83
|
+
return c.forEach((s) => {
|
|
84
84
|
s.fixed === "left" ? t.push(s) : s.fixed === "right" ? i.push(s) : e.push(s);
|
|
85
85
|
}), [
|
|
86
86
|
...t.sort((s, o) => (s.sort ?? 0) - (o.sort ?? 0)),
|
|
@@ -88,8 +88,8 @@ function ne(l = []) {
|
|
|
88
88
|
...i.sort((s, o) => (s.sort ?? 0) - (o.sort ?? 0))
|
|
89
89
|
];
|
|
90
90
|
}
|
|
91
|
-
function Nt(
|
|
92
|
-
return
|
|
91
|
+
function Nt(c = [], t = 1, e = 0) {
|
|
92
|
+
return c.map((i) => {
|
|
93
93
|
if (i.children) {
|
|
94
94
|
let s = 0, o = i.fixed;
|
|
95
95
|
i.children.forEach((a) => {
|
|
@@ -115,72 +115,72 @@ function Nt(l = [], t = 1, e = 0) {
|
|
|
115
115
|
};
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
-
function et(
|
|
118
|
+
function et(c = []) {
|
|
119
119
|
let t = [];
|
|
120
|
-
return
|
|
120
|
+
return c.forEach((e) => {
|
|
121
121
|
e.children ? t = t.concat(et(e.children)) : t.push(e);
|
|
122
122
|
}), t;
|
|
123
123
|
}
|
|
124
|
-
const
|
|
125
|
-
function
|
|
124
|
+
const Ct = /^(\r\n|\n\r|\r|\n)/, ae = /^[^\t\r\n]+/, bt = /^\t/;
|
|
125
|
+
function he(c) {
|
|
126
126
|
let t = [[""]];
|
|
127
|
-
if (
|
|
127
|
+
if (c.length === 0)
|
|
128
128
|
return t;
|
|
129
129
|
let e = 0, i = 0, s;
|
|
130
|
-
for (;
|
|
131
|
-
if (s =
|
|
132
|
-
|
|
133
|
-
else if (
|
|
134
|
-
|
|
130
|
+
for (; c.length > 0 && s !== c.length; )
|
|
131
|
+
if (s = c.length, c.match(bt))
|
|
132
|
+
c = c.replace(bt, ""), e += 1, t[i][e] = "";
|
|
133
|
+
else if (c.match(Ct))
|
|
134
|
+
c = c.replace(Ct, ""), e = 0, i += 1, t[i] = [""];
|
|
135
135
|
else {
|
|
136
136
|
let o = "";
|
|
137
|
-
if (
|
|
137
|
+
if (c.startsWith('"')) {
|
|
138
138
|
let r = 0, a = !0;
|
|
139
139
|
for (; a; ) {
|
|
140
|
-
const
|
|
141
|
-
|
|
140
|
+
const h = c.slice(0, 1);
|
|
141
|
+
h === '"' && (r += 1), o += h, c = c.slice(1), (c.length === 0 || c.match(/^[\t\r\n]/) && r % 2 === 0) && (a = !1);
|
|
142
142
|
}
|
|
143
|
-
o = o.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (
|
|
143
|
+
o = o.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (h) => new Array(Math.floor(h.length / 2)).fill('"').join(""));
|
|
144
144
|
} else {
|
|
145
|
-
const r =
|
|
146
|
-
o = r ? r[0] : "",
|
|
145
|
+
const r = c.match(ae);
|
|
146
|
+
o = r ? r[0] : "", c = c.slice(o.length);
|
|
147
147
|
}
|
|
148
148
|
t[i][e] = o;
|
|
149
149
|
}
|
|
150
150
|
return Array.isArray(t) && t.length > 1 && t[t.length - 1].length === 1 && t[t.length - 1][0] === "" && (t = t.slice(0, t.length - 1)), t;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function le(c) {
|
|
153
153
|
let t, e, i, s, o = "", r;
|
|
154
|
-
for (t = 0, e =
|
|
155
|
-
for (s =
|
|
156
|
-
i > 0 && (o += " "), r =
|
|
154
|
+
for (t = 0, e = c.length; t < e; t += 1) {
|
|
155
|
+
for (s = c[t].length, i = 0; i < s; i += 1)
|
|
156
|
+
i > 0 && (o += " "), r = c[t][i], typeof r == "string" ? r.indexOf(`
|
|
157
157
|
`) > -1 ? o += `"${r.replace(/"/g, '""')}"` : o += r : r == null ? o += "" : o += r;
|
|
158
158
|
t !== e - 1 && (o += `
|
|
159
159
|
`);
|
|
160
160
|
}
|
|
161
161
|
return o;
|
|
162
162
|
}
|
|
163
|
-
function kt(
|
|
163
|
+
function kt(c, t, e = []) {
|
|
164
164
|
let i = 0;
|
|
165
165
|
const s = [];
|
|
166
|
-
return
|
|
166
|
+
return c.forEach((o, r) => {
|
|
167
167
|
if (r === 0)
|
|
168
168
|
s.push(1);
|
|
169
169
|
else {
|
|
170
|
-
const a = e.reduce((
|
|
171
|
-
a ===
|
|
170
|
+
const a = e.reduce((l, d) => `${l}${o[d] ?? ""}`, "") || o[t], h = e.reduce((l, d) => `${l}${c[r - 1][d] ?? ""}`, "") || c[r - 1][t];
|
|
171
|
+
a === h ? (s[i] += 1, s.push(0)) : (s.push(1), i = r);
|
|
172
172
|
}
|
|
173
173
|
}), s;
|
|
174
174
|
}
|
|
175
|
-
function Xt(
|
|
175
|
+
function Xt(c, t) {
|
|
176
176
|
let e = "", i = "";
|
|
177
177
|
const s = {};
|
|
178
178
|
return t.forEach((o, r) => {
|
|
179
|
-
r === 0 ? (e = o.key, i = o.key, s[o.key] = 1) :
|
|
179
|
+
r === 0 ? (e = o.key, i = o.key, s[o.key] = 1) : c[o.key] === c[e] ? (s[o.key] = 0, s[i] += 1) : (s[o.key] = 1, e = o.key, i = o.key);
|
|
180
180
|
}), s;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
const { visibleRows: i, rowIndex: s, headIndex: o } =
|
|
182
|
+
function ce(c, t, e = []) {
|
|
183
|
+
const { visibleRows: i, rowIndex: s, headIndex: o } = c, r = kt(i, t, e);
|
|
184
184
|
return r[s - o] === 0 ? {
|
|
185
185
|
rowspan: 0,
|
|
186
186
|
colspan: 0,
|
|
@@ -193,8 +193,8 @@ function le(l, t, e = []) {
|
|
|
193
193
|
mergeRow: !0
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
|
-
function de(
|
|
197
|
-
const { column: e, row: i, visibleLeafColumns: s } =
|
|
196
|
+
function de(c, t = []) {
|
|
197
|
+
const { column: e, row: i, visibleLeafColumns: s } = c, o = s.filter((r) => t.includes(r.key));
|
|
198
198
|
if (t.includes(e.key)) {
|
|
199
199
|
const r = Xt(i, o);
|
|
200
200
|
return r[e.key] === 0 ? {
|
|
@@ -210,15 +210,15 @@ function de(l, t = []) {
|
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
function fe(
|
|
214
|
-
const e =
|
|
213
|
+
function fe(c, t = document.documentElement) {
|
|
214
|
+
const e = c.startsWith("--") ? c : `--${c}`;
|
|
215
215
|
return getComputedStyle(t).getPropertyValue(e).trim();
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
if (!
|
|
219
|
-
if (typeof
|
|
220
|
-
return new Date(
|
|
221
|
-
const t = String(
|
|
217
|
+
function Rt(c) {
|
|
218
|
+
if (!c) return /* @__PURE__ */ new Date(0);
|
|
219
|
+
if (typeof c == "number")
|
|
220
|
+
return new Date(c);
|
|
221
|
+
const t = String(c).trim(), e = new Date(t);
|
|
222
222
|
if (!isNaN(e.getTime()))
|
|
223
223
|
return e;
|
|
224
224
|
const i = [
|
|
@@ -252,24 +252,24 @@ function bt(l) {
|
|
|
252
252
|
if (o) {
|
|
253
253
|
const r = o.slice(1).map(Number);
|
|
254
254
|
if (s.source.includes("YYYY-MM-DD") || s.source.includes("YYYY/MM/DD") || s.source.includes("YYYY.MM.DD")) {
|
|
255
|
-
const [a,
|
|
256
|
-
return new Date(a,
|
|
255
|
+
const [a, h, l, d = 0, f = 0, u = 0] = r;
|
|
256
|
+
return new Date(a, h - 1, l, d, f, u);
|
|
257
257
|
} else if (s.source.includes("DD-MM-YYYY") || s.source.includes("DD/MM/YYYY") || s.source.includes("DD.MM.YYYY")) {
|
|
258
|
-
const [a,
|
|
259
|
-
return new Date(
|
|
258
|
+
const [a, h, l, d = 0, f = 0, u = 0] = r;
|
|
259
|
+
return new Date(l, h - 1, a, d, f, u);
|
|
260
260
|
} else if (s.source.includes("MM-DD-YYYY") || s.source.includes("MM/DD/YYYY") || s.source.includes("MM.DD.YYYY")) {
|
|
261
|
-
const [a,
|
|
262
|
-
return new Date(
|
|
261
|
+
const [a, h, l, d = 0, f = 0, u = 0] = r;
|
|
262
|
+
return new Date(l, a - 1, h, d, f, u);
|
|
263
263
|
} else if (s.source.includes("YYYYMMDD")) {
|
|
264
|
-
const [a,
|
|
265
|
-
return new Date(a,
|
|
264
|
+
const [a, h, l] = r;
|
|
265
|
+
return new Date(a, h - 1, l);
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
return /* @__PURE__ */ new Date(NaN);
|
|
270
270
|
}
|
|
271
|
-
function xe(
|
|
272
|
-
const e =
|
|
271
|
+
function xe(c, t) {
|
|
272
|
+
const e = Rt(c), i = Rt(t);
|
|
273
273
|
return isNaN(e.getTime()) && isNaN(i.getTime()) ? 0 : isNaN(e.getTime()) ? -1 : isNaN(i.getTime()) ? 1 : e.getTime() - i.getTime();
|
|
274
274
|
}
|
|
275
275
|
class Yt {
|
|
@@ -318,9 +318,9 @@ class Yt {
|
|
|
318
318
|
getRightFixedX() {
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
-
class
|
|
322
|
-
constructor(e, i, s, o, r, a,
|
|
323
|
-
super(e, o, r, a,
|
|
321
|
+
class ut extends Yt {
|
|
322
|
+
constructor(e, i, s, o, r, a, h, l, d, f = "body") {
|
|
323
|
+
super(e, o, r, a, h, f, l.fixed);
|
|
324
324
|
n(this, "formatter");
|
|
325
325
|
n(this, "formatterFooter");
|
|
326
326
|
n(this, "hoverIconName", "");
|
|
@@ -351,6 +351,7 @@ class xt extends Yt {
|
|
|
351
351
|
n(this, "render");
|
|
352
352
|
n(this, "renderFooter");
|
|
353
353
|
n(this, "style", {});
|
|
354
|
+
n(this, "domDataset", {});
|
|
354
355
|
n(this, "rules", []);
|
|
355
356
|
n(this, "message", "");
|
|
356
357
|
n(this, "text", "");
|
|
@@ -388,6 +389,10 @@ class xt extends Yt {
|
|
|
388
389
|
n(this, "drawHoverImageHeight", 0);
|
|
389
390
|
n(this, "drawHoverImageName", "");
|
|
390
391
|
n(this, "drawHoverImageSource");
|
|
392
|
+
n(this, "autoRowHeight", !1);
|
|
393
|
+
// 是否启用行高自适应
|
|
394
|
+
n(this, "calculatedHeight", 0);
|
|
395
|
+
// 计算出的自适应高度
|
|
391
396
|
n(this, "ellipsis", !1);
|
|
392
397
|
n(this, "rowExpand", !1);
|
|
393
398
|
n(this, "rowHasChildren", !1);
|
|
@@ -395,7 +400,8 @@ class xt extends Yt {
|
|
|
395
400
|
n(this, "selectorCellValueType", "value");
|
|
396
401
|
n(this, "overflowTooltipMaxWidth", 500);
|
|
397
402
|
n(this, "overflowTooltipPlacement", "top");
|
|
398
|
-
this
|
|
403
|
+
n(this, "maxLineClamp", "auto");
|
|
404
|
+
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = l.key, this.type = l.type || "", this.editorType = l.editorType || "text", this.selectorCellValueType = l.selectorCellValueType || this.ctx.config.SELECTOR_CELL_VALUE_TYPE || "value", this.editorProps = l.editorProps || {}, this.cellType = f, this.align = l.align || this.ctx.config.COLUMNS_ALIGN, this.verticalAlign = l.verticalAlign || this.ctx.config.COLUMNS_VERTICAL_ALIGN, this.fixed = l.fixed, this.level = l.level || 0, this.operation = l.operation || !1, this.column = l, this.rules = l.rules || [], this.row = d, this.rowKey = this.cellType === "body" ? this.ctx.database.getRowKeyForRowIndex(i) : `${this.cellType}_${this.rowIndex}`, this.value = this.getValue(), this.render = l.render, this.overflowTooltipShow = l.overflowTooltipShow !== !1, this.autoRowHeight = l.autoRowHeight || this.ctx.config.AUTO_ROW_HEIGHT, this.overflowTooltipMaxWidth = l.overflowTooltipMaxWidth || 500, this.overflowTooltipPlacement = l.overflowTooltipPlacement || "top", this.renderFooter = l.renderFooter, this.hoverIconName = l.hoverIconName, this.formatter = l.formatter, this.formatterFooter = l.formatterFooter, this.maxLineClamp = l.maxLineClamp || "auto", this.update();
|
|
399
405
|
}
|
|
400
406
|
setWidthHeight(e, i) {
|
|
401
407
|
this.width = e, this.height = i;
|
|
@@ -421,8 +427,8 @@ class xt extends Yt {
|
|
|
421
427
|
rowspan: o = 1,
|
|
422
428
|
relationRowKeys: r,
|
|
423
429
|
relationColKeys: a,
|
|
424
|
-
mergeRow:
|
|
425
|
-
mergeCol:
|
|
430
|
+
mergeRow: h = !1,
|
|
431
|
+
mergeCol: l = !1
|
|
426
432
|
} = i({
|
|
427
433
|
row: this.row,
|
|
428
434
|
rowIndex: this.rowIndex,
|
|
@@ -435,7 +441,7 @@ class xt extends Yt {
|
|
|
435
441
|
visibleLeafColumns: this.ctx.header.visibleLeafColumns,
|
|
436
442
|
rows: this.ctx.body.data
|
|
437
443
|
}) || {};
|
|
438
|
-
Array.isArray(r) && r.length > 0 ? this.relationRowKeys = r : this.relationRowKeys = [this.key], Array.isArray(a) && a.length > 0 ? this.relationColKeys = a : this.relationColKeys = [this.key], this.mergeCol =
|
|
444
|
+
Array.isArray(r) && r.length > 0 ? this.relationRowKeys = r : this.relationRowKeys = [this.key], Array.isArray(a) && a.length > 0 ? this.relationColKeys = a : this.relationColKeys = [this.key], this.mergeCol = l, this.mergeRow = h, this.colspan = s, this.rowspan = o, this.visibleWidth = this.getWidthByColIndexColSpan(this.colIndex, this.colspan), this.visibleHeight = this.ctx.database.getHeightByRowIndexRowSpan(this.rowIndex, this.rowspan);
|
|
439
445
|
}
|
|
440
446
|
}
|
|
441
447
|
updateSpanInfo() {
|
|
@@ -502,47 +508,51 @@ class xt extends Yt {
|
|
|
502
508
|
* 更新样式
|
|
503
509
|
*/
|
|
504
510
|
updateStyle() {
|
|
505
|
-
this.
|
|
511
|
+
this.autoRowHeight && (this.domDataset = {
|
|
512
|
+
"data-auto-height": !0,
|
|
513
|
+
"data-row-index": this.rowIndex,
|
|
514
|
+
"data-col-index": this.colIndex
|
|
515
|
+
}), this.style = this.getOverlayerViewsStyle();
|
|
506
516
|
}
|
|
507
517
|
updateTree() {
|
|
508
518
|
const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
|
|
509
519
|
let o, r = 0, a = "";
|
|
510
520
|
if (!(["tree", "selection-tree", "tree-selection"].includes(this.type) && s === "body"))
|
|
511
521
|
return;
|
|
512
|
-
const
|
|
513
|
-
this.rowExpand =
|
|
522
|
+
const h = this.ctx.database.getRowForRowKey(i), { expand: l = !1, hasChildren: d = !1, expandLoading: f = !1, level: u = 0 } = h || {};
|
|
523
|
+
this.rowExpand = l, this.rowHasChildren = d;
|
|
514
524
|
const { TREE_INDENT: x = 16, CHECKBOX_SIZE: w, TREE_ICON_SIZE: m } = this.ctx.config;
|
|
515
525
|
if (r = u * x, f) {
|
|
516
|
-
const
|
|
517
|
-
a = "loading", o =
|
|
526
|
+
const I = this.ctx.icons.get("loading");
|
|
527
|
+
a = "loading", o = I;
|
|
518
528
|
} else if (d) {
|
|
519
|
-
const
|
|
520
|
-
o =
|
|
529
|
+
const I = this.ctx.icons.get("expand"), S = this.ctx.icons.get("shrink");
|
|
530
|
+
o = l ? S : I, a = l ? "shrink" : "expand";
|
|
521
531
|
}
|
|
522
|
-
let g = m,
|
|
532
|
+
let g = m, p = m, y = this.drawX;
|
|
523
533
|
(this.align === "center" || this.align === "right") && (y = this.drawX + (this.visibleWidth - g - 2 * e) / 2, this.align = "left");
|
|
524
|
-
let
|
|
525
|
-
this.type === "selection-tree" ? (
|
|
534
|
+
let E = y + r + e, R = this.drawY + (this.visibleHeight - p) / 2, C = r + this.drawX + g - 0.5;
|
|
535
|
+
this.type === "selection-tree" ? (E = r + this.drawSelectionImageX + this.drawSelectionImageWidth, C = E + g - e / 2) : this.type === "tree-selection" ? C = E + w + g - e / 2 : C = E + g - e / 2, this.drawTextX = C, this.drawTextWidth = this.drawX + this.visibleWidth - C, !(E + g + e > this.drawX + this.visibleWidth) && (R + p + e > this.drawY + this.visibleHeight || (this.drawTreeImageX = E, this.drawTreeImageY = R, this.drawTreeImageWidth = g, this.drawTreeImageHeight = p, o ? (this.drawTreeImageName = a, this.drawTreeImageSource = o) : (this.drawTreeImageName = "", this.drawTreeImageSource = void 0)));
|
|
526
536
|
}
|
|
527
537
|
drawTreeLine() {
|
|
528
538
|
const { TREE_LINE: e, TREE_INDENT: i = 16, TREE_ICON_SIZE: s = 16, TREE_LINE_COLOR: o = "#e1e6eb" } = this.ctx.config;
|
|
529
539
|
if (!e || this.cellType !== "body" || !["tree", "selection-tree", "tree-selection"].includes(this.type) || this.rowspan === 0 || this.colspan === 0) return;
|
|
530
|
-
const r = this.ctx.database.getRowForRowKey(this.rowKey) || {}, a = r.level ?? 0,
|
|
540
|
+
const r = this.ctx.database.getRowForRowKey(this.rowKey) || {}, a = r.level ?? 0, h = this.drawTreeImageX + this.drawTreeImageWidth / 2, l = this.drawTreeImageY + this.drawTreeImageHeight / 2;
|
|
531
541
|
let d = this.drawTreeImageX - a * i;
|
|
532
542
|
const f = Array.isArray(r.parentRowKeys) ? r.parentRowKeys : [];
|
|
533
543
|
if (a > 0) {
|
|
534
544
|
for (let g = 0; g < a - 1; g += 1) {
|
|
535
|
-
const
|
|
536
|
-
if (!!(
|
|
537
|
-
const
|
|
538
|
-
this.ctx.paint.drawLine([
|
|
545
|
+
const p = f[g + 1];
|
|
546
|
+
if (!!(p ? this.ctx.database.getRowForRowKey(p) || {} : {}).isLastChild) continue;
|
|
547
|
+
const R = Math.round(this.drawTreeImageX - (a - g) * i + s / 2);
|
|
548
|
+
this.ctx.paint.drawLine([R, this.drawY, R, this.drawY + this.visibleHeight], {
|
|
539
549
|
borderColor: o,
|
|
540
550
|
borderWidth: 1,
|
|
541
551
|
lineDash: [4, 4],
|
|
542
552
|
lineDashOffset: 0
|
|
543
553
|
});
|
|
544
554
|
}
|
|
545
|
-
const u = Math.round(this.drawTreeImageX - i + s / 2), w = !!r.isLastChild ?
|
|
555
|
+
const u = Math.round(this.drawTreeImageX - i + s / 2), w = !!r.isLastChild ? l : this.drawY + this.visibleHeight;
|
|
546
556
|
this.ctx.paint.drawLine([u, this.drawY, u, w], {
|
|
547
557
|
borderColor: o,
|
|
548
558
|
borderWidth: 1,
|
|
@@ -550,7 +560,7 @@ class xt extends Yt {
|
|
|
550
560
|
lineDashOffset: 0
|
|
551
561
|
});
|
|
552
562
|
const m = Math.round(d + (a - 1) * i + s / 2);
|
|
553
|
-
this.ctx.paint.drawLine([m,
|
|
563
|
+
this.ctx.paint.drawLine([m, l, h, l], {
|
|
554
564
|
borderColor: o,
|
|
555
565
|
borderWidth: 1,
|
|
556
566
|
lineDash: [4, 4],
|
|
@@ -558,8 +568,8 @@ class xt extends Yt {
|
|
|
558
568
|
});
|
|
559
569
|
}
|
|
560
570
|
if (r.hasChildren && r.expand) {
|
|
561
|
-
const u = this.drawTreeImageY + this.drawTreeImageHeight, x =
|
|
562
|
-
this.ctx.paint.drawLine([
|
|
571
|
+
const u = this.drawTreeImageY + this.drawTreeImageHeight, x = this.drawY + this.visibleHeight;
|
|
572
|
+
this.ctx.paint.drawLine([h, u, h, x], {
|
|
563
573
|
borderColor: o,
|
|
564
574
|
borderWidth: 1,
|
|
565
575
|
lineDash: [4, 4],
|
|
@@ -575,8 +585,8 @@ class xt extends Yt {
|
|
|
575
585
|
FOOTER_CELL_STYLE_METHOD: o,
|
|
576
586
|
READONLY_TEXT_COLOR: r,
|
|
577
587
|
BODY_TEXT_COLOR: a,
|
|
578
|
-
FOOTER_TEXT_COLOR:
|
|
579
|
-
FOOTER_BG_COLOR:
|
|
588
|
+
FOOTER_TEXT_COLOR: h,
|
|
589
|
+
FOOTER_BG_COLOR: l,
|
|
580
590
|
HIGHLIGHT_SELECTED_ROW: d,
|
|
581
591
|
HIGHLIGHT_SELECTED_ROW_COLOR: f,
|
|
582
592
|
HIGHLIGHT_HOVER_ROW: u,
|
|
@@ -585,31 +595,31 @@ class xt extends Yt {
|
|
|
585
595
|
STRIPE_COLOR: m
|
|
586
596
|
} = this.ctx.config;
|
|
587
597
|
if (this.cellType === "footer") {
|
|
588
|
-
let
|
|
598
|
+
let S = l, _ = h;
|
|
589
599
|
if (typeof o == "function") {
|
|
590
|
-
const
|
|
600
|
+
const v = o, { backgroundColor: b, color: O } = v({
|
|
591
601
|
row: this.row,
|
|
592
602
|
rowIndex: this.rowIndex,
|
|
593
603
|
colIndex: this.colIndex,
|
|
594
604
|
column: this.column,
|
|
595
605
|
value: this.getValue()
|
|
596
606
|
}) || {};
|
|
597
|
-
|
|
607
|
+
b && (S = b), O && (_ = O);
|
|
598
608
|
}
|
|
599
|
-
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor =
|
|
609
|
+
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = S, this.drawTextColor = _;
|
|
600
610
|
return;
|
|
601
611
|
}
|
|
602
612
|
let g = "transparent";
|
|
603
|
-
const
|
|
604
|
-
let
|
|
613
|
+
const p = this.ctx.hoverCell, y = this.ctx.currentCell;
|
|
614
|
+
let E = this.rowIndex, R = this.rowIndex;
|
|
605
615
|
if (this.rowspan !== 1 && (u || d)) {
|
|
606
|
-
const
|
|
607
|
-
|
|
616
|
+
const S = this.getSpanInfo(), { yArr: _ } = S;
|
|
617
|
+
E = _[0], R = _[1];
|
|
608
618
|
}
|
|
609
|
-
u &&
|
|
610
|
-
let C = e,
|
|
611
|
-
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (C = i,
|
|
612
|
-
const
|
|
619
|
+
u && p && (p.rowKey === this.rowKey && (g = x), p.rowIndex >= E && p.rowIndex <= R && (g = x)), d && y && (y.rowKey === this.rowKey && (g = f), y.rowIndex >= E && y.rowIndex <= R && (g = f)), this.drawCellSkyBgColor = g;
|
|
620
|
+
let C = e, I = a;
|
|
621
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (C = i, I = r), w && (this.rowIndex % 2 ? C = m : C = e), typeof s == "function") {
|
|
622
|
+
const S = s, { backgroundColor: _, color: v } = S({
|
|
613
623
|
row: this.row,
|
|
614
624
|
rowIndex: this.rowIndex,
|
|
615
625
|
colIndex: this.colIndex,
|
|
@@ -617,61 +627,86 @@ class xt extends Yt {
|
|
|
617
627
|
isHasChanged: this.isHasChanged,
|
|
618
628
|
value: this.getValue()
|
|
619
629
|
}) || {};
|
|
620
|
-
|
|
630
|
+
_ && (C = _), v && (I = v);
|
|
621
631
|
}
|
|
622
|
-
this.drawCellBgColor = C, this.drawTextColor =
|
|
632
|
+
this.drawCellBgColor = C, this.drawTextColor = I;
|
|
623
633
|
}
|
|
624
634
|
updateSelection() {
|
|
625
|
-
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: o, cellType: r, type: a, rowIndex:
|
|
635
|
+
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: o, cellType: r, type: a, rowIndex: h, rowKey: l } = this;
|
|
626
636
|
if (s === 0 || o === 0 || r === "footer" || !["index-selection", "selection", "selection-tree", "tree-selection"].includes(a))
|
|
627
637
|
return;
|
|
628
|
-
const d = this.ctx.database.getRowSelectable(
|
|
638
|
+
const d = this.ctx.database.getRowSelectable(l), { CHECKBOX_SIZE: f = 0, CELL_PADDING: u } = this.ctx.config;
|
|
629
639
|
let x = this.drawX + u;
|
|
630
640
|
(this.align === "center" || this.align === "right") && (x = this.drawX + (e - f) / 2);
|
|
631
641
|
let w = x, m = this.drawY + (i - f) / 2;
|
|
632
642
|
if (a !== "selection-tree") {
|
|
633
643
|
if (a === "tree-selection") {
|
|
634
|
-
const { TREE_INDENT: y = 16, TREE_ICON_SIZE:
|
|
635
|
-
w = x +
|
|
644
|
+
const { TREE_INDENT: y = 16, TREE_ICON_SIZE: E } = this.ctx.config, R = this.ctx.database.getRowForRowKey(l), { level: C = 0 } = R || {}, I = C * y;
|
|
645
|
+
w = x + E + I;
|
|
636
646
|
}
|
|
637
647
|
}
|
|
638
|
-
let g = this.ctx.icons.get("checkbox-uncheck"),
|
|
648
|
+
let g = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck";
|
|
639
649
|
if (a === "selection-tree" || a === "tree-selection") {
|
|
640
|
-
const y = this.ctx.database.getTreeSelectionState(
|
|
641
|
-
y.indeterminate && d ? (g = this.ctx.icons.get("checkbox-indeterminate"),
|
|
650
|
+
const y = this.ctx.database.getTreeSelectionState(l);
|
|
651
|
+
y.indeterminate && d ? (g = this.ctx.icons.get("checkbox-indeterminate"), p = "checkbox-indeterminate") : y.checked && d ? (g = this.ctx.icons.get("checkbox-check"), p = "checkbox-check") : !y.checked && d ? (g = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), p = "checkbox-disabled");
|
|
642
652
|
} else {
|
|
643
|
-
const y = this.ctx.database.getRowSelection(
|
|
644
|
-
y && d ? (g = this.ctx.icons.get("checkbox-check"),
|
|
653
|
+
const y = this.ctx.database.getRowSelection(l);
|
|
654
|
+
y && d ? (g = this.ctx.icons.get("checkbox-check"), p = "checkbox-check") : y && !d ? (g = this.ctx.icons.get("checkbox-check-disabled"), p = "checkbox-check-disabled") : !y && d ? (g = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), p = "checkbox-disabled");
|
|
645
655
|
}
|
|
646
|
-
w + f + u > this.drawX + this.visibleWidth || m + f + u > this.drawY + this.visibleHeight || (a === "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex ===
|
|
656
|
+
w + f + u > this.drawX + this.visibleWidth || m + f + u > this.drawY + this.visibleHeight || (a === "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === h || ["checkbox-disabled", "checkbox-check"].includes(p)) && (this.drawSelectionImageX = w, this.drawSelectionImageY = m, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = p, this.drawSelectionImageSource = g) : (this.drawSelectionImageX = w, this.drawSelectionImageY = m, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = p, this.drawSelectionImageSource = g));
|
|
647
657
|
}
|
|
648
658
|
updateHoverIcon() {
|
|
649
659
|
if (this.ctx.database.getReadonly(this.rowKey, this.key))
|
|
650
660
|
return;
|
|
651
661
|
const { BODY_CELL_HOVER_ICON_METHOD: i, CELL_HOVER_ICON_SIZE: s, CELL_PADDING: o, ENABLE_MERGE_CELL_LINK: r } = this.ctx.config;
|
|
652
662
|
if (typeof i == "function") {
|
|
653
|
-
const
|
|
663
|
+
const l = i({
|
|
654
664
|
row: this.row,
|
|
655
665
|
rowIndex: this.rowIndex,
|
|
656
666
|
colIndex: this.colIndex,
|
|
657
667
|
column: this.column,
|
|
658
668
|
value: this.getValue()
|
|
659
669
|
});
|
|
660
|
-
|
|
670
|
+
l !== void 0 && (this.hoverIconName = l);
|
|
661
671
|
}
|
|
662
672
|
const { hoverCell: a } = this.ctx;
|
|
663
673
|
if (this.hoverIconName && !this.ctx.editing && a) {
|
|
664
|
-
let
|
|
665
|
-
if (a.rowKey === this.rowKey && (
|
|
674
|
+
let h = 0, l = 0;
|
|
675
|
+
if (a.rowKey === this.rowKey && (h = this.drawX + this.width - s - o, l = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && r) {
|
|
666
676
|
const f = this.getSpanInfo(), { yArr: u } = f, x = u[0], w = u[1];
|
|
667
677
|
if (a.rowIndex >= x && a.rowIndex <= w) {
|
|
668
|
-
const { width: m, height: g, offsetTop:
|
|
669
|
-
|
|
678
|
+
const { width: m, height: g, offsetTop: p, offsetLeft: y } = f;
|
|
679
|
+
h = this.drawX - y + m - s - o, l = this.drawY - p + (g - s) / 2;
|
|
670
680
|
}
|
|
671
681
|
}
|
|
672
682
|
const d = this.ctx.icons.get(this.hoverIconName);
|
|
673
|
-
this.drawHoverImageX =
|
|
683
|
+
this.drawHoverImageX = h, this.drawHoverImageY = l, this.drawHoverImageWidth = s, this.drawHoverImageHeight = s, this.drawHoverImageName = this.hoverIconName, this.drawHoverImageSource = d;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* 获取自动高度
|
|
688
|
+
* @returns
|
|
689
|
+
*/
|
|
690
|
+
getAutoHeight() {
|
|
691
|
+
if (this.cellType !== "body" || !this.autoRowHeight || this.rowspan === 0)
|
|
692
|
+
return 0;
|
|
693
|
+
if (this.render) {
|
|
694
|
+
const r = this.ctx.database.getOverlayerAutoHeight(this.rowIndex, this.colIndex);
|
|
695
|
+
return this.rowspan > 1 ? r < this.visibleHeight ? 0 : Math.round(r - (this.visibleHeight - this.height)) : Math.round(r);
|
|
674
696
|
}
|
|
697
|
+
if (!(this.displayText && typeof this.displayText == "string"))
|
|
698
|
+
return 0;
|
|
699
|
+
const { BODY_FONT: e, CELL_PADDING: i, CELL_LINE_HEIGHT: s } = this.ctx.config, o = this.ctx.paint.calculateTextHeight(this.displayText, this.drawTextWidth, {
|
|
700
|
+
font: e,
|
|
701
|
+
padding: i,
|
|
702
|
+
align: this.align,
|
|
703
|
+
verticalAlign: this.verticalAlign,
|
|
704
|
+
color: this.drawTextColor,
|
|
705
|
+
autoRowHeight: this.autoRowHeight,
|
|
706
|
+
lineHeight: s,
|
|
707
|
+
maxLineClamp: this.maxLineClamp
|
|
708
|
+
});
|
|
709
|
+
return this.rowspan > 1 ? o < this.visibleHeight ? 0 : Math.round(o - (this.visibleHeight - this.height)) : Math.round(o);
|
|
675
710
|
}
|
|
676
711
|
// 过去跨度配置
|
|
677
712
|
getSpanInfo() {
|
|
@@ -726,13 +761,15 @@ class xt extends Yt {
|
|
|
726
761
|
*/
|
|
727
762
|
getOverlayerViewsStyle() {
|
|
728
763
|
let e = `${this.drawX - this.ctx.fixedLeftWidth}px`, i = `${this.drawY - this.ctx.body.y}px`;
|
|
729
|
-
return this.fixed === "left" ? e = `${this.drawX}px` : this.fixed === "right" && (e = `${this.drawX - (this.ctx.stageWidth - this.ctx.fixedRightWidth)}px`), this.cellType === "footer" && this.ctx.config.FOOTER_FIXED && (i = `${this.drawY - this.ctx.footer.y}px`), {
|
|
764
|
+
return this.fixed === "left" ? e = `${this.drawX}px` : this.fixed === "right" && (e = `${this.drawX - (this.ctx.stageWidth - this.ctx.fixedRightWidth)}px`), this.cellType === "footer" && this.ctx.config.FOOTER_FIXED && (i = `${this.drawY - this.ctx.footer.y}px`), this.autoRowHeight && this.ctx.database.getOverlayerAutoHeight(this.rowIndex, this.colIndex) === 0 && (e = "-99999px", i = "-99999px"), {
|
|
730
765
|
position: "absolute",
|
|
731
766
|
overflow: "hidden",
|
|
732
767
|
left: e,
|
|
733
768
|
top: i,
|
|
734
769
|
width: `${this.visibleWidth}px`,
|
|
735
|
-
height: `${this.visibleHeight}px`,
|
|
770
|
+
height: this.autoRowHeight ? "auto" : `${this.visibleHeight}px`,
|
|
771
|
+
// height: `${this.visibleHeight}px`,
|
|
772
|
+
// minHeight: `${this.visibleHeight}px`,
|
|
736
773
|
pointerEvents: "initial",
|
|
737
774
|
userSelect: "none"
|
|
738
775
|
};
|
|
@@ -765,8 +802,8 @@ class xt extends Yt {
|
|
|
765
802
|
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: o } = this.ctx.config;
|
|
766
803
|
if (!s || !i || this.ctx.editing)
|
|
767
804
|
return;
|
|
768
|
-
const { xArr: r, yArr: a } = this.ctx.selector,
|
|
769
|
-
if (d ===
|
|
805
|
+
const { xArr: r, yArr: a } = this.ctx.selector, h = r[1], l = a[1], { colIndex: d, rowIndex: f, drawX: u, drawY: x } = this;
|
|
806
|
+
if (d === h && f === l) {
|
|
770
807
|
const m = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
|
|
771
808
|
this.ctx.paint.drawRect(u + this.width - m, x + this.height - m, 6, 6, {
|
|
772
809
|
borderColor: o,
|
|
@@ -792,22 +829,25 @@ class xt extends Yt {
|
|
|
792
829
|
return s;
|
|
793
830
|
}
|
|
794
831
|
drawText() {
|
|
795
|
-
const { CELL_PADDING: e, BODY_FONT: i, PLACEHOLDER_COLOR: s } = this.ctx.config, {
|
|
796
|
-
|
|
832
|
+
const { CELL_PADDING: e, BODY_FONT: i, PLACEHOLDER_COLOR: s, CELL_LINE_HEIGHT: o } = this.ctx.config, { placeholder: r } = this.column;
|
|
833
|
+
let a = this.displayText, h = this.drawTextColor;
|
|
834
|
+
return !this.ctx.database.getReadonly(this.rowKey, this.key) && r && ["", null, void 0].includes(this.text) && this.cellType === "body" && !(this.rowspan === 0 || this.colspan === 0) && (a = r, h = s), a ? (this.ellipsis = this.ctx.paint.drawText(
|
|
835
|
+
a,
|
|
836
|
+
this.drawTextX,
|
|
837
|
+
this.drawTextY,
|
|
797
838
|
this.drawTextWidth,
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
});
|
|
839
|
+
this.drawTextHeight,
|
|
840
|
+
{
|
|
841
|
+
font: i,
|
|
842
|
+
padding: e,
|
|
843
|
+
align: this.align,
|
|
844
|
+
verticalAlign: this.verticalAlign,
|
|
845
|
+
color: h,
|
|
846
|
+
autoRowHeight: this.autoRowHeight,
|
|
847
|
+
lineHeight: o,
|
|
848
|
+
maxLineClamp: this.maxLineClamp
|
|
849
|
+
}
|
|
850
|
+
), this.ellipsis) : !1;
|
|
811
851
|
}
|
|
812
852
|
drawImage() {
|
|
813
853
|
if (this.drawSelectionImageSource && this.ctx.paint.drawImage(
|
|
@@ -872,11 +912,11 @@ class xt extends Yt {
|
|
|
872
912
|
fillColor: "transparent",
|
|
873
913
|
borderWidth: 1
|
|
874
914
|
});
|
|
875
|
-
const [a,
|
|
876
|
-
!(a ===
|
|
915
|
+
const [a, h] = i, [l, d] = s;
|
|
916
|
+
!(a === h && l === d) && this.colIndex >= a && this.colIndex <= h && this.rowIndex >= l && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.width, this.height, {
|
|
877
917
|
borderColor: "transparent",
|
|
878
918
|
fillColor: this.ctx.config.SELECT_AREA_COLOR || "rgba(82,146,247,0.1)"
|
|
879
|
-
}), this.operation && this.rowIndex >=
|
|
919
|
+
}), this.operation && this.rowIndex >= l && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.visibleWidth, this.visibleHeight, {
|
|
880
920
|
borderColor: "transparent",
|
|
881
921
|
fillColor: this.ctx.config.SELECT_ROW_COL_BG_COLOR || "transparent"
|
|
882
922
|
});
|
|
@@ -901,12 +941,12 @@ class xt extends Yt {
|
|
|
901
941
|
});
|
|
902
942
|
}
|
|
903
943
|
drawBorder(e) {
|
|
904
|
-
const { drawX: i, drawY: s, rowIndex: o, colIndex: r, height: a, width:
|
|
905
|
-
let
|
|
906
|
-
const { xArr: f, yArr: u, lineDash: x = [], borderWidth: w = 1, borderColor: m, fillColor: g } = e,
|
|
907
|
-
if (r >=
|
|
908
|
-
const C = r === y ? 1 : 0,
|
|
909
|
-
this.ctx.paint.drawLine([
|
|
944
|
+
const { drawX: i, drawY: s, rowIndex: o, colIndex: r, height: a, width: h } = this;
|
|
945
|
+
let l = i, d = s;
|
|
946
|
+
const { xArr: f, yArr: u, lineDash: x = [], borderWidth: w = 1, borderColor: m, fillColor: g } = e, p = f[0], y = f[1], E = u[0], R = u[1];
|
|
947
|
+
if (r >= p && r <= y && o === E) {
|
|
948
|
+
const C = r === y ? 1 : 0, I = r === p ? 1 : 0;
|
|
949
|
+
this.ctx.paint.drawLine([l + I, d + 1, l + h - C, d + 1], {
|
|
910
950
|
borderColor: m,
|
|
911
951
|
fillColor: g,
|
|
912
952
|
borderWidth: w,
|
|
@@ -915,9 +955,9 @@ class xt extends Yt {
|
|
|
915
955
|
lineDash: x
|
|
916
956
|
});
|
|
917
957
|
}
|
|
918
|
-
if (r === y && o >=
|
|
919
|
-
const C = o ===
|
|
920
|
-
this.ctx.paint.drawLine([
|
|
958
|
+
if (r === y && o >= E && o <= R) {
|
|
959
|
+
const C = o === E ? 1 : 0, I = o === R ? 1 : 0;
|
|
960
|
+
this.ctx.paint.drawLine([l + h - 1, d + C, l + h - 1, d + a - I], {
|
|
921
961
|
borderColor: m,
|
|
922
962
|
fillColor: g,
|
|
923
963
|
borderWidth: w,
|
|
@@ -926,9 +966,9 @@ class xt extends Yt {
|
|
|
926
966
|
lineDash: x
|
|
927
967
|
});
|
|
928
968
|
}
|
|
929
|
-
if (r >=
|
|
930
|
-
const C = r === y ? 1 : 0,
|
|
931
|
-
this.ctx.paint.drawLine([
|
|
969
|
+
if (r >= p && r <= y && o === R) {
|
|
970
|
+
const C = r === y ? 1 : 0, I = r === p ? 1 : 0;
|
|
971
|
+
this.ctx.paint.drawLine([l + I, d + a - 1, l + h - C, d + a - 1], {
|
|
932
972
|
borderColor: m,
|
|
933
973
|
fillColor: g,
|
|
934
974
|
borderWidth: w,
|
|
@@ -937,9 +977,9 @@ class xt extends Yt {
|
|
|
937
977
|
lineDash: x
|
|
938
978
|
});
|
|
939
979
|
}
|
|
940
|
-
if (r ===
|
|
941
|
-
const C = o ===
|
|
942
|
-
this.ctx.paint.drawLine([
|
|
980
|
+
if (r === p && o >= E && o <= R) {
|
|
981
|
+
const C = o === R ? 1 : 0, I = o === E ? 1 : 0;
|
|
982
|
+
this.ctx.paint.drawLine([l + 1, d + I, l + 1, d + a - C], {
|
|
943
983
|
borderColor: m,
|
|
944
984
|
fillColor: g,
|
|
945
985
|
borderWidth: w,
|
|
@@ -970,6 +1010,7 @@ class ue {
|
|
|
970
1010
|
n(this, "validationErrorMap", /* @__PURE__ */ new Map());
|
|
971
1011
|
n(this, "itemRowKeyMap", /* @__PURE__ */ new WeakMap());
|
|
972
1012
|
n(this, "bufferData", []);
|
|
1013
|
+
n(this, "overlayerAutoHeightMap", /* @__PURE__ */ new Map());
|
|
973
1014
|
n(this, "bufferCheckState", {
|
|
974
1015
|
buffer: !1,
|
|
975
1016
|
check: !1,
|
|
@@ -1011,33 +1052,34 @@ class ue {
|
|
|
1011
1052
|
const s = t.length;
|
|
1012
1053
|
t.forEach((o, r) => {
|
|
1013
1054
|
var y;
|
|
1014
|
-
const { ROW_KEY: a = "", DEFAULT_EXPAND_ALL:
|
|
1055
|
+
const { ROW_KEY: a = "", DEFAULT_EXPAND_ALL: h, CELL_HEIGHT: l, SELECTABLE_METHOD: d, CHECKBOX_KEY: f } = this.ctx.config, u = o[a], x = u != null ? `${u}` : Ht();
|
|
1015
1056
|
this.itemRowKeyMap.set(o, x);
|
|
1016
|
-
const w = o._height ||
|
|
1057
|
+
const w = o._height || l, m = o._readonly;
|
|
1017
1058
|
let g = !0;
|
|
1018
1059
|
if (typeof d == "function" && (g = d), f) {
|
|
1019
|
-
const
|
|
1020
|
-
if (this.checkboxKeyMap.has(
|
|
1021
|
-
const
|
|
1022
|
-
|
|
1060
|
+
const E = o[f];
|
|
1061
|
+
if (this.checkboxKeyMap.has(E)) {
|
|
1062
|
+
const R = this.checkboxKeyMap.get(E) || [];
|
|
1063
|
+
R.push(x), this.checkboxKeyMap.set(E, R);
|
|
1023
1064
|
} else
|
|
1024
|
-
this.checkboxKeyMap.set(
|
|
1065
|
+
this.checkboxKeyMap.set(E, [x]);
|
|
1025
1066
|
}
|
|
1026
1067
|
this.selectionMap.set(x, {
|
|
1027
1068
|
key: f ? o[f] : x,
|
|
1028
1069
|
row: o,
|
|
1029
1070
|
check: ((y = this.selectionMap.get(x)) == null ? void 0 : y.check) || !1
|
|
1030
1071
|
});
|
|
1031
|
-
const
|
|
1032
|
-
this.expandMap.set(x,
|
|
1072
|
+
const p = h || this.expandMap.get(x) || o._expand || !1;
|
|
1073
|
+
this.expandMap.set(x, p), this.rowKeyMap.set(x, {
|
|
1033
1074
|
readonly: m,
|
|
1034
1075
|
index: r,
|
|
1035
1076
|
rowIndex: r,
|
|
1036
1077
|
level: e,
|
|
1037
1078
|
height: w,
|
|
1079
|
+
calculatedHeight: -1,
|
|
1038
1080
|
check: !1,
|
|
1039
1081
|
selectable: g,
|
|
1040
|
-
expand:
|
|
1082
|
+
expand: p,
|
|
1041
1083
|
expandLazy: !1,
|
|
1042
1084
|
hasChildren: o._hasChildren || (Array.isArray(o.children) ? o.children.length > 0 : !1),
|
|
1043
1085
|
expandLoading: !1,
|
|
@@ -1060,6 +1102,26 @@ class ue {
|
|
|
1060
1102
|
const s = this.rowKeyMap.get(i);
|
|
1061
1103
|
s.height = e, s.item._height = e, this.clearBufferData();
|
|
1062
1104
|
}
|
|
1105
|
+
// 批量设置行高度
|
|
1106
|
+
setBatchRowHeight(t) {
|
|
1107
|
+
t.forEach(({ rowIndex: e, height: i }) => {
|
|
1108
|
+
const s = this.rowIndexRowKeyMap.get(e);
|
|
1109
|
+
if (s) {
|
|
1110
|
+
const o = this.rowKeyMap.get(s);
|
|
1111
|
+
o.height = i, o.item._height = i;
|
|
1112
|
+
}
|
|
1113
|
+
}), this.clearBufferData();
|
|
1114
|
+
}
|
|
1115
|
+
// 批量设置计算行高度
|
|
1116
|
+
setBatchCalculatedRowHeight(t) {
|
|
1117
|
+
t.every(({ height: i, rowIndex: s }) => this.getPositionForRowIndex(s).calculatedHeight === i) || (t.forEach(({ rowIndex: i, height: s }) => {
|
|
1118
|
+
const o = this.rowIndexRowKeyMap.get(i);
|
|
1119
|
+
if (o) {
|
|
1120
|
+
const r = this.rowKeyMap.get(o);
|
|
1121
|
+
r.calculatedHeight = s;
|
|
1122
|
+
}
|
|
1123
|
+
}), this.clearBufferData(), this.getData(), this.ctx.emit("draw"));
|
|
1124
|
+
}
|
|
1063
1125
|
/**
|
|
1064
1126
|
* 获取所有行数据(平铺)
|
|
1065
1127
|
* @returns 获取转化平铺数据
|
|
@@ -1107,12 +1169,13 @@ class ue {
|
|
|
1107
1169
|
const i = (o) => {
|
|
1108
1170
|
o.forEach((r) => {
|
|
1109
1171
|
t.push(r);
|
|
1110
|
-
const a = this.itemRowKeyMap.get(r), { expand:
|
|
1111
|
-
this.sumHeight +=
|
|
1112
|
-
top:
|
|
1113
|
-
height:
|
|
1114
|
-
bottom: this.sumHeight
|
|
1115
|
-
|
|
1172
|
+
const a = this.itemRowKeyMap.get(r), { expand: h, hasChildren: l, height: d, calculatedHeight: f } = this.rowKeyMap.get(a), u = this.sumHeight, x = Math.max(f, d);
|
|
1173
|
+
this.sumHeight += x, this.rowIndexRowKeyMap.set(e, a), this.rowKeyRowIndexMap.set(a, e), this.positions.push({
|
|
1174
|
+
top: u,
|
|
1175
|
+
height: x,
|
|
1176
|
+
bottom: this.sumHeight,
|
|
1177
|
+
calculatedHeight: f
|
|
1178
|
+
}), e += 1, h && l && i(r.children);
|
|
1116
1179
|
});
|
|
1117
1180
|
};
|
|
1118
1181
|
this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear();
|
|
@@ -1189,18 +1252,18 @@ class ue {
|
|
|
1189
1252
|
*/
|
|
1190
1253
|
applySingleColumnSort(t, e, i, s) {
|
|
1191
1254
|
return t.sort((o, r) => {
|
|
1192
|
-
const a = o[e],
|
|
1193
|
-
let
|
|
1255
|
+
const a = o[e], h = r[e];
|
|
1256
|
+
let l = 0;
|
|
1194
1257
|
if (typeof s == "function")
|
|
1195
|
-
|
|
1258
|
+
l = s(o, r);
|
|
1196
1259
|
else if (s === "number") {
|
|
1197
|
-
const d = Number(a) || 0, f = Number(
|
|
1198
|
-
|
|
1260
|
+
const d = Number(a) || 0, f = Number(h) || 0;
|
|
1261
|
+
l = d - f;
|
|
1199
1262
|
} else if (s === "string") {
|
|
1200
|
-
const d = String(a || ""), f = String(
|
|
1201
|
-
|
|
1202
|
-
} else s === "date" && (
|
|
1203
|
-
return i === "asc" ?
|
|
1263
|
+
const d = String(a || ""), f = String(h || "");
|
|
1264
|
+
l = d.localeCompare(f);
|
|
1265
|
+
} else s === "date" && (l = xe(a, h));
|
|
1266
|
+
return i === "asc" ? l : -l;
|
|
1204
1267
|
});
|
|
1205
1268
|
}
|
|
1206
1269
|
/**
|
|
@@ -1312,39 +1375,39 @@ class ue {
|
|
|
1312
1375
|
async batchSetItemValue(t, e = !1, i = !0, s = "none") {
|
|
1313
1376
|
let o = [], r = i;
|
|
1314
1377
|
const a = /* @__PURE__ */ new Set();
|
|
1315
|
-
let
|
|
1378
|
+
let h = [], l = t.map((x) => {
|
|
1316
1379
|
const { rowKey: w, key: m } = x;
|
|
1317
|
-
let g = x.value,
|
|
1318
|
-
const y = this.getRowDataItemForRowKey(w),
|
|
1319
|
-
return (
|
|
1380
|
+
let g = x.value, p = g;
|
|
1381
|
+
const y = this.getRowDataItemForRowKey(w), E = this.getItemValue(w, m), R = this.getVirtualBodyCellByKey(w, m);
|
|
1382
|
+
return (R == null ? void 0 : R.type) === "number" && (["", void 0, null].includes(g) ? p = null : /^-?\d+(\.\d+)?$/.test(`${g}`) ? p = Number(g) : (p = E, h.push({
|
|
1320
1383
|
...x,
|
|
1321
|
-
value:
|
|
1322
|
-
oldValue:
|
|
1384
|
+
value: p,
|
|
1385
|
+
oldValue: E,
|
|
1323
1386
|
row: y
|
|
1324
1387
|
}))), {
|
|
1325
1388
|
...x,
|
|
1326
|
-
value:
|
|
1327
|
-
oldValue:
|
|
1389
|
+
value: p,
|
|
1390
|
+
oldValue: E,
|
|
1328
1391
|
row: y
|
|
1329
1392
|
};
|
|
1330
1393
|
});
|
|
1331
|
-
if (
|
|
1394
|
+
if (l = l.filter((x) => !h.some((w) => x.rowKey === w.rowKey && x.key === w.key)), h.length) {
|
|
1332
1395
|
const x = {
|
|
1333
1396
|
code: "ERR_BATCH_SET_NUMBER_VALUE",
|
|
1334
1397
|
message: "Assignment failed, not a numeric type",
|
|
1335
|
-
data:
|
|
1398
|
+
data: h
|
|
1336
1399
|
};
|
|
1337
1400
|
this.ctx.emit("error", x);
|
|
1338
1401
|
}
|
|
1339
|
-
if (
|
|
1402
|
+
if (l = l.filter((x) => x.oldValue !== x.value), !l.length)
|
|
1340
1403
|
return;
|
|
1341
1404
|
const { BEFORE_VALUE_CHANGE_METHOD: d } = this.ctx.config;
|
|
1342
|
-
s === "none" && typeof d == "function" && (
|
|
1343
|
-
const { value: w, rowKey: m, key: g } = x,
|
|
1405
|
+
s === "none" && typeof d == "function" && (l = await d(l), r = !1), l.forEach((x) => {
|
|
1406
|
+
const { value: w, rowKey: m, key: g } = x, p = this.getItemValue(m, g);
|
|
1344
1407
|
a.add(m), this.setItemValue(m, g, w, !1, !1, !1, r), o.push({
|
|
1345
1408
|
rowKey: m,
|
|
1346
1409
|
key: g,
|
|
1347
|
-
oldValue:
|
|
1410
|
+
oldValue: p,
|
|
1348
1411
|
newValue: w
|
|
1349
1412
|
});
|
|
1350
1413
|
});
|
|
@@ -1352,10 +1415,10 @@ class ue {
|
|
|
1352
1415
|
a.forEach((x) => {
|
|
1353
1416
|
f.push(this.ctx.database.getRowDataItemForRowKey(x));
|
|
1354
1417
|
});
|
|
1355
|
-
const u =
|
|
1418
|
+
const u = l.map(({ rowKey: x, key: w }) => this.getValidator(x, w));
|
|
1356
1419
|
Promise.all(u).then(() => {
|
|
1357
1420
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1358
|
-
}), this.ctx.emit("change",
|
|
1421
|
+
}), this.ctx.emit("change", l, f), e && this.ctx.history.pushState({
|
|
1359
1422
|
changeList: o,
|
|
1360
1423
|
scrollX: this.ctx.scrollX,
|
|
1361
1424
|
scrollY: this.ctx.scrollY,
|
|
@@ -1376,16 +1439,16 @@ class ue {
|
|
|
1376
1439
|
async setItemValue(t, e, i, s = !1, o = !1, r = !1, a = !0) {
|
|
1377
1440
|
if (!this.rowKeyMap.has(t))
|
|
1378
1441
|
return {};
|
|
1379
|
-
const { item:
|
|
1380
|
-
let
|
|
1442
|
+
const { item: h } = this.rowKeyMap.get(t);
|
|
1443
|
+
let l = h[e], d = i;
|
|
1381
1444
|
if (a && this.ctx.database.getReadonly(t, e))
|
|
1382
1445
|
return {
|
|
1383
|
-
oldValue:
|
|
1384
|
-
newValue:
|
|
1446
|
+
oldValue: l,
|
|
1447
|
+
newValue: l
|
|
1385
1448
|
};
|
|
1386
|
-
|
|
1449
|
+
h[e] !== null && typeof h[e] == "object" && (l = JSON.parse(JSON.stringify(h[e])));
|
|
1387
1450
|
const f = `${t}_${e}`;
|
|
1388
|
-
this.originalDataMap.has(f) || this.originalDataMap.set(f,
|
|
1451
|
+
this.originalDataMap.has(f) || this.originalDataMap.set(f, l);
|
|
1389
1452
|
const u = this.originalDataMap.get(f), x = this.getRowDataItemForRowKey(t);
|
|
1390
1453
|
if (r) {
|
|
1391
1454
|
const w = this.getVirtualBodyCellByKey(t, e);
|
|
@@ -1395,7 +1458,7 @@ class ue {
|
|
|
1395
1458
|
else if (/^-?\d+(\.\d+)?$/.test(`${i}`))
|
|
1396
1459
|
d = Number(i);
|
|
1397
1460
|
else {
|
|
1398
|
-
d =
|
|
1461
|
+
d = l;
|
|
1399
1462
|
const g = {
|
|
1400
1463
|
code: "ERR_SET_NUMBER_VALUE",
|
|
1401
1464
|
message: "Assignment failed, not a numeric type",
|
|
@@ -1404,46 +1467,46 @@ class ue {
|
|
|
1404
1467
|
rowKey: t,
|
|
1405
1468
|
key: e,
|
|
1406
1469
|
value: d,
|
|
1407
|
-
oldValue:
|
|
1470
|
+
oldValue: l,
|
|
1408
1471
|
row: x
|
|
1409
1472
|
}
|
|
1410
1473
|
]
|
|
1411
1474
|
};
|
|
1412
1475
|
this.ctx.emit("error", g);
|
|
1413
1476
|
}
|
|
1414
|
-
if (d ===
|
|
1477
|
+
if (d === l)
|
|
1415
1478
|
return {
|
|
1416
|
-
oldValue:
|
|
1417
|
-
newValue:
|
|
1479
|
+
oldValue: l,
|
|
1480
|
+
newValue: l
|
|
1418
1481
|
};
|
|
1419
1482
|
let m = [
|
|
1420
1483
|
{
|
|
1421
1484
|
rowKey: t,
|
|
1422
1485
|
key: e,
|
|
1423
1486
|
value: d,
|
|
1424
|
-
oldValue:
|
|
1487
|
+
oldValue: l,
|
|
1425
1488
|
row: x
|
|
1426
1489
|
}
|
|
1427
1490
|
];
|
|
1428
1491
|
this.batchSetItemValue(m, s, !1), this.ctx.emit("editChange", {
|
|
1429
1492
|
rowKey: t,
|
|
1430
1493
|
key: e,
|
|
1431
|
-
oldValue:
|
|
1494
|
+
oldValue: l,
|
|
1432
1495
|
value: d,
|
|
1433
1496
|
originalValue: u,
|
|
1434
1497
|
row: x
|
|
1435
1498
|
});
|
|
1436
1499
|
} else
|
|
1437
|
-
this.changedDataMap.set(f, d),
|
|
1500
|
+
this.changedDataMap.set(f, d), h[e] = d;
|
|
1438
1501
|
return this.ctx.hasEvent("iterationChange") && this.ctx.emit("iterationChange", {
|
|
1439
1502
|
rowKey: t,
|
|
1440
1503
|
key: e,
|
|
1441
|
-
oldValue:
|
|
1504
|
+
oldValue: l,
|
|
1442
1505
|
value: d,
|
|
1443
1506
|
originalValue: this.originalDataMap.get(f),
|
|
1444
1507
|
row: x
|
|
1445
1508
|
}), o && this.ctx.emit("draw"), {
|
|
1446
|
-
oldValue:
|
|
1509
|
+
oldValue: l,
|
|
1447
1510
|
newValue: d
|
|
1448
1511
|
};
|
|
1449
1512
|
}
|
|
@@ -1470,8 +1533,8 @@ class ue {
|
|
|
1470
1533
|
return !1;
|
|
1471
1534
|
const { item: s } = this.rowKeyMap.get(t), o = s[i];
|
|
1472
1535
|
this.checkboxKeyMap.has(o) && (this.checkboxKeyMap.get(o) || []).forEach((a) => {
|
|
1473
|
-
const
|
|
1474
|
-
|
|
1536
|
+
const h = this.selectionMap.get(a);
|
|
1537
|
+
h && (h.check = e);
|
|
1475
1538
|
});
|
|
1476
1539
|
}
|
|
1477
1540
|
}
|
|
@@ -1517,11 +1580,11 @@ class ue {
|
|
|
1517
1580
|
const e = this.getTreeParent(t);
|
|
1518
1581
|
if (!e)
|
|
1519
1582
|
return;
|
|
1520
|
-
const s = this.getTreeChildren(e).map((
|
|
1583
|
+
const s = this.getTreeChildren(e).map((l) => this.selectionMap.get(l)), o = s.filter((l) => l == null ? void 0 : l.check).length, r = s.length;
|
|
1521
1584
|
let a = !1;
|
|
1522
1585
|
r > 0 && (o === 0 ? a = !1 : o === r || this.ctx.config.TREE_SELECT_MODE === "auto" ? a = !0 : this.ctx.config.TREE_SELECT_MODE === "cautious" && (a = !1));
|
|
1523
|
-
const
|
|
1524
|
-
|
|
1586
|
+
const h = this.selectionMap.get(e);
|
|
1587
|
+
h && h.check !== a && (h.check = a, this.setRowSelectionByCheckboxKey(e, a), this.updateParentTreeSelection(e));
|
|
1525
1588
|
}
|
|
1526
1589
|
/**
|
|
1527
1590
|
* 根据rowKey 设置选中状态
|
|
@@ -1554,22 +1617,22 @@ class ue {
|
|
|
1554
1617
|
return { checked: s, indeterminate: !1 };
|
|
1555
1618
|
let r = !1, a = s;
|
|
1556
1619
|
if (this.ctx.config.TREE_SELECT_MODE === "auto") {
|
|
1557
|
-
const
|
|
1558
|
-
const
|
|
1620
|
+
const l = (g) => {
|
|
1621
|
+
const p = this.getTreeChildren(g);
|
|
1559
1622
|
let y = [];
|
|
1560
|
-
for (const
|
|
1561
|
-
y.push(
|
|
1623
|
+
for (const E of p)
|
|
1624
|
+
y.push(E), y.push(...l(E));
|
|
1562
1625
|
return y;
|
|
1563
|
-
}, f =
|
|
1626
|
+
}, f = l(t).map((g) => this.selectionMap.get(g)), u = f.filter((g) => g == null ? void 0 : g.check).length, x = f.length, w = u > 0;
|
|
1564
1627
|
r = w && !(u === x), a = s || w, s && x > 0 && u === 0 && (a = !1, r = !1);
|
|
1565
1628
|
} else if (this.ctx.config.TREE_SELECT_MODE === "cautious") {
|
|
1566
|
-
const
|
|
1567
|
-
const
|
|
1629
|
+
const l = (g) => {
|
|
1630
|
+
const p = this.getTreeChildren(g);
|
|
1568
1631
|
let y = [];
|
|
1569
|
-
for (const
|
|
1570
|
-
y.push(
|
|
1632
|
+
for (const E of p)
|
|
1633
|
+
y.push(E), y.push(...l(E));
|
|
1571
1634
|
return y;
|
|
1572
|
-
}, f =
|
|
1635
|
+
}, f = l(t).map((g) => this.selectionMap.get(g)), u = f.filter((g) => g == null ? void 0 : g.check).length, x = f.length, w = u > 0, m = u === x;
|
|
1573
1636
|
r = w && !m, a = s || m, s && x > 0 && u === 0 && (a = !1, r = !1);
|
|
1574
1637
|
} else this.ctx.config.TREE_SELECT_MODE === "strictly" && (r = !1, a = s);
|
|
1575
1638
|
return { checked: a, indeterminate: r };
|
|
@@ -1596,9 +1659,9 @@ class ue {
|
|
|
1596
1659
|
for (const a of o.children) {
|
|
1597
1660
|
if (this.getRowKeyByItem(a) === s)
|
|
1598
1661
|
return r;
|
|
1599
|
-
const
|
|
1600
|
-
if (
|
|
1601
|
-
return
|
|
1662
|
+
const l = e(o.children, s);
|
|
1663
|
+
if (l)
|
|
1664
|
+
return l;
|
|
1602
1665
|
}
|
|
1603
1666
|
}
|
|
1604
1667
|
return null;
|
|
@@ -1681,15 +1744,15 @@ class ue {
|
|
|
1681
1744
|
rowIndex: u.rowIndex
|
|
1682
1745
|
})), w && (o += 1);
|
|
1683
1746
|
});
|
|
1684
|
-
const
|
|
1747
|
+
const h = r > i && s === 0 && a, l = o && o > s && s > 0 || h, d = o !== 0, f = !!o && o === s;
|
|
1685
1748
|
return this.bufferCheckState = {
|
|
1686
1749
|
buffer: !0,
|
|
1687
1750
|
check: f,
|
|
1688
|
-
indeterminate:
|
|
1751
|
+
indeterminate: l,
|
|
1689
1752
|
selectable: d
|
|
1690
1753
|
}, {
|
|
1691
1754
|
check: f,
|
|
1692
|
-
indeterminate:
|
|
1755
|
+
indeterminate: l,
|
|
1693
1756
|
selectable: d
|
|
1694
1757
|
};
|
|
1695
1758
|
}
|
|
@@ -1767,7 +1830,8 @@ class ue {
|
|
|
1767
1830
|
return t < this.positions.length ? this.positions[t] : {
|
|
1768
1831
|
height: 0,
|
|
1769
1832
|
top: 0,
|
|
1770
|
-
bottom: 0
|
|
1833
|
+
bottom: 0,
|
|
1834
|
+
calculatedHeight: 0
|
|
1771
1835
|
};
|
|
1772
1836
|
}
|
|
1773
1837
|
setHeader(t, e) {
|
|
@@ -1780,9 +1844,9 @@ class ue {
|
|
|
1780
1844
|
const s = this.rowKeyMap.get(t), o = this.headerMap.get(e);
|
|
1781
1845
|
if (!s || !o)
|
|
1782
1846
|
return !0;
|
|
1783
|
-
const r = s.readonly, a = o.readonly, { BODY_CELL_READONLY_METHOD:
|
|
1784
|
-
if (typeof
|
|
1785
|
-
const d =
|
|
1847
|
+
const r = s.readonly, a = o.readonly, { BODY_CELL_READONLY_METHOD: h } = this.ctx.config;
|
|
1848
|
+
if (typeof h == "function" && o) {
|
|
1849
|
+
const d = h({
|
|
1786
1850
|
row: s.item,
|
|
1787
1851
|
rowIndex: s.rowIndex,
|
|
1788
1852
|
colIndex: o.colIndex,
|
|
@@ -1806,7 +1870,7 @@ class ue {
|
|
|
1806
1870
|
if (o === void 0)
|
|
1807
1871
|
return i([]);
|
|
1808
1872
|
const a = o.column;
|
|
1809
|
-
let
|
|
1873
|
+
let h = a.rules;
|
|
1810
1874
|
if (typeof r == "function") {
|
|
1811
1875
|
const d = r({
|
|
1812
1876
|
row: s.item,
|
|
@@ -1815,10 +1879,10 @@ class ue {
|
|
|
1815
1879
|
column: a,
|
|
1816
1880
|
value: this.getItemValue(t, e)
|
|
1817
1881
|
});
|
|
1818
|
-
d && (
|
|
1882
|
+
d && (h = d);
|
|
1819
1883
|
}
|
|
1820
|
-
if (
|
|
1821
|
-
const
|
|
1884
|
+
if (h) {
|
|
1885
|
+
const l = {
|
|
1822
1886
|
row: s.item,
|
|
1823
1887
|
rowIndex: s.rowIndex,
|
|
1824
1888
|
colIndex: o.colIndex,
|
|
@@ -1828,7 +1892,7 @@ class ue {
|
|
|
1828
1892
|
value: this.getItemValue(t, e),
|
|
1829
1893
|
field: e,
|
|
1830
1894
|
fieldValue: this.getItemValue(t, e)
|
|
1831
|
-
}, f = new re(
|
|
1895
|
+
}, f = new re(h).validate(l);
|
|
1832
1896
|
this.setValidationError(t, e, f), i(f);
|
|
1833
1897
|
} else
|
|
1834
1898
|
this.clearValidationError(t, e), i([]);
|
|
@@ -1850,8 +1914,8 @@ class ue {
|
|
|
1850
1914
|
row: o,
|
|
1851
1915
|
value: r,
|
|
1852
1916
|
colIndex: a,
|
|
1853
|
-
relationRowKeys:
|
|
1854
|
-
relationColKeys:
|
|
1917
|
+
relationRowKeys: h,
|
|
1918
|
+
relationColKeys: l,
|
|
1855
1919
|
rowspan: d,
|
|
1856
1920
|
height: f,
|
|
1857
1921
|
width: u,
|
|
@@ -1878,43 +1942,43 @@ class ue {
|
|
|
1878
1942
|
}
|
|
1879
1943
|
]
|
|
1880
1944
|
};
|
|
1881
|
-
let g = e,
|
|
1945
|
+
let g = e, p = e, y = a, E = a, R = [], C = 0, I = 0, S = 0, _ = 0;
|
|
1882
1946
|
if (d !== 1 && w) {
|
|
1883
|
-
|
|
1884
|
-
const
|
|
1885
|
-
const
|
|
1886
|
-
return `${
|
|
1947
|
+
_ = u;
|
|
1948
|
+
const v = h.reduce((b, O) => {
|
|
1949
|
+
const T = this.getItemValue(s, O) ?? "";
|
|
1950
|
+
return `${b}${T}`;
|
|
1887
1951
|
}, "");
|
|
1888
|
-
for (let
|
|
1889
|
-
const
|
|
1890
|
-
const
|
|
1891
|
-
return `${M}${
|
|
1952
|
+
for (let b = e - 1; b >= 0; b--) {
|
|
1953
|
+
const O = this.rowIndexRowKeyMap.get(b) || "", T = h.reduce((M, L) => {
|
|
1954
|
+
const A = this.getItemValue(O, L) ?? "";
|
|
1955
|
+
return `${M}${A}`;
|
|
1892
1956
|
}, "");
|
|
1893
|
-
if (
|
|
1894
|
-
g =
|
|
1957
|
+
if (v === T)
|
|
1958
|
+
g = b;
|
|
1895
1959
|
else
|
|
1896
1960
|
break;
|
|
1897
1961
|
}
|
|
1898
|
-
for (let
|
|
1899
|
-
const
|
|
1900
|
-
const
|
|
1901
|
-
return `${M}${
|
|
1962
|
+
for (let b = e; b <= this.ctx.maxRowIndex; b++) {
|
|
1963
|
+
const O = this.rowIndexRowKeyMap.get(b) || "", T = h.reduce((M, L) => {
|
|
1964
|
+
const A = this.getItemValue(O, L) ?? "";
|
|
1965
|
+
return `${M}${A}`;
|
|
1902
1966
|
}, "");
|
|
1903
|
-
if (
|
|
1904
|
-
|
|
1967
|
+
if (v === T)
|
|
1968
|
+
p = b;
|
|
1905
1969
|
else
|
|
1906
1970
|
break;
|
|
1907
1971
|
}
|
|
1908
|
-
for (let
|
|
1909
|
-
const { height:
|
|
1910
|
-
C +=
|
|
1972
|
+
for (let b = g; b < e; b++) {
|
|
1973
|
+
const { height: O } = this.positions[b];
|
|
1974
|
+
C += O;
|
|
1911
1975
|
}
|
|
1912
|
-
for (let
|
|
1913
|
-
const { height:
|
|
1914
|
-
|
|
1915
|
-
const
|
|
1916
|
-
|
|
1917
|
-
rowKey:
|
|
1976
|
+
for (let b = g; b <= p; b++) {
|
|
1977
|
+
const { height: O } = this.positions[b];
|
|
1978
|
+
S += O;
|
|
1979
|
+
const T = this.rowIndexRowKeyMap.get(b) || "", { item: M } = this.rowKeyMap.get(T), L = this.getItemValue(T, i);
|
|
1980
|
+
R.push({
|
|
1981
|
+
rowKey: T,
|
|
1918
1982
|
key: i,
|
|
1919
1983
|
value: L,
|
|
1920
1984
|
row: M
|
|
@@ -1922,55 +1986,55 @@ class ue {
|
|
|
1922
1986
|
}
|
|
1923
1987
|
}
|
|
1924
1988
|
if (x !== 1 && m) {
|
|
1925
|
-
|
|
1926
|
-
for (let
|
|
1927
|
-
const
|
|
1928
|
-
if (!
|
|
1989
|
+
S = f;
|
|
1990
|
+
for (let v = a - 1; v >= 0; v--) {
|
|
1991
|
+
const b = this.getColumnByColIndex(v);
|
|
1992
|
+
if (!b)
|
|
1929
1993
|
break;
|
|
1930
|
-
const
|
|
1931
|
-
if (
|
|
1932
|
-
y =
|
|
1994
|
+
const O = this.getItemValue(s, i), T = this.getItemValue(s, b.key);
|
|
1995
|
+
if (O === T && l.includes(b.key))
|
|
1996
|
+
y = v;
|
|
1933
1997
|
else
|
|
1934
1998
|
break;
|
|
1935
1999
|
}
|
|
1936
|
-
for (let
|
|
1937
|
-
const
|
|
1938
|
-
if (!
|
|
2000
|
+
for (let v = a; v <= this.ctx.maxColIndex; v++) {
|
|
2001
|
+
const b = this.getColumnByColIndex(v);
|
|
2002
|
+
if (!b)
|
|
1939
2003
|
break;
|
|
1940
|
-
const
|
|
1941
|
-
if (
|
|
1942
|
-
|
|
2004
|
+
const O = this.getItemValue(s, i), T = this.getItemValue(s, b.key);
|
|
2005
|
+
if (O === T && l.includes(b.key))
|
|
2006
|
+
E = v;
|
|
1943
2007
|
else
|
|
1944
2008
|
break;
|
|
1945
2009
|
}
|
|
1946
|
-
for (let
|
|
1947
|
-
const
|
|
1948
|
-
if (!
|
|
2010
|
+
for (let v = y; v < a; v++) {
|
|
2011
|
+
const b = this.getColumnByColIndex(v);
|
|
2012
|
+
if (!b)
|
|
1949
2013
|
break;
|
|
1950
|
-
|
|
2014
|
+
I += b.width || 100;
|
|
1951
2015
|
}
|
|
1952
|
-
for (let
|
|
1953
|
-
const
|
|
1954
|
-
if (!
|
|
2016
|
+
for (let v = y; v <= E; v++) {
|
|
2017
|
+
const b = this.getColumnByColIndex(v);
|
|
2018
|
+
if (!b)
|
|
1955
2019
|
break;
|
|
1956
|
-
|
|
2020
|
+
_ += b.width || 100, R.push({
|
|
1957
2021
|
rowKey: s,
|
|
1958
|
-
key:
|
|
1959
|
-
value: this.getItemValue(s,
|
|
2022
|
+
key: b.key,
|
|
2023
|
+
value: this.getItemValue(s, b.key),
|
|
1960
2024
|
row: o
|
|
1961
2025
|
});
|
|
1962
2026
|
}
|
|
1963
2027
|
}
|
|
1964
2028
|
return {
|
|
1965
|
-
xArr: [y,
|
|
1966
|
-
yArr: [g,
|
|
2029
|
+
xArr: [y, E],
|
|
2030
|
+
yArr: [g, p],
|
|
1967
2031
|
rowspan: d,
|
|
1968
2032
|
colspan: x,
|
|
1969
|
-
height:
|
|
1970
|
-
width:
|
|
2033
|
+
height: S,
|
|
2034
|
+
width: _,
|
|
1971
2035
|
offsetTop: C,
|
|
1972
|
-
offsetLeft:
|
|
1973
|
-
dataList:
|
|
2036
|
+
offsetLeft: I,
|
|
2037
|
+
dataList: R
|
|
1974
2038
|
};
|
|
1975
2039
|
}
|
|
1976
2040
|
setLoading(t) {
|
|
@@ -1983,7 +2047,7 @@ class ue {
|
|
|
1983
2047
|
const s = this.rowIndexRowKeyMap.get(t), o = `${s}_${e}`, r = this.getRowForRowIndex(t), a = this.getColumnByKey(e);
|
|
1984
2048
|
if (!s || !a || !r)
|
|
1985
2049
|
return;
|
|
1986
|
-
const
|
|
2050
|
+
const h = this.getItemValue(s, e), l = [
|
|
1987
2051
|
{
|
|
1988
2052
|
key: e,
|
|
1989
2053
|
rowKey: s,
|
|
@@ -1991,13 +2055,13 @@ class ue {
|
|
|
1991
2055
|
colIndex: a.colIndex,
|
|
1992
2056
|
column: a.column,
|
|
1993
2057
|
row: r,
|
|
1994
|
-
value:
|
|
2058
|
+
value: h,
|
|
1995
2059
|
message: i,
|
|
1996
2060
|
field: e,
|
|
1997
|
-
fieldValue:
|
|
2061
|
+
fieldValue: h
|
|
1998
2062
|
}
|
|
1999
2063
|
];
|
|
2000
|
-
this.validationErrorMap.set(o,
|
|
2064
|
+
this.validationErrorMap.set(o, l);
|
|
2001
2065
|
}
|
|
2002
2066
|
setValidationError(t, e, i) {
|
|
2003
2067
|
const s = `${t}_${e}`;
|
|
@@ -2014,7 +2078,7 @@ class ue {
|
|
|
2014
2078
|
// 获取虚拟单元格,只针对可见的
|
|
2015
2079
|
getVirtualBodyCell(t, e) {
|
|
2016
2080
|
const i = this.getColumnByColIndex(e), s = this.getRowForRowIndex(t);
|
|
2017
|
-
return !i || !s ? void 0 : new
|
|
2081
|
+
return !i || !s ? void 0 : new ut(this.ctx, t, e, 0, 0, 0, 0, i, s.item, "body");
|
|
2018
2082
|
}
|
|
2019
2083
|
getVirtualBodyCellByKey(t, e) {
|
|
2020
2084
|
const i = this.getRowIndexForRowKey(t), s = this.getColIndexForKey(e);
|
|
@@ -2048,6 +2112,16 @@ class ue {
|
|
|
2048
2112
|
}
|
|
2049
2113
|
}), i;
|
|
2050
2114
|
}
|
|
2115
|
+
setOverlayerAutoHeightMap(t) {
|
|
2116
|
+
this.overlayerAutoHeightMap = t;
|
|
2117
|
+
}
|
|
2118
|
+
getOverlayerAutoHeightMap() {
|
|
2119
|
+
return this.overlayerAutoHeightMap;
|
|
2120
|
+
}
|
|
2121
|
+
getOverlayerAutoHeight(t, e) {
|
|
2122
|
+
const i = `${t}_${e}`;
|
|
2123
|
+
return this.overlayerAutoHeightMap.get(i) || 0;
|
|
2124
|
+
}
|
|
2051
2125
|
}
|
|
2052
2126
|
class ge {
|
|
2053
2127
|
constructor(t) {
|
|
@@ -2218,7 +2292,7 @@ class me {
|
|
|
2218
2292
|
this.events.clear();
|
|
2219
2293
|
}
|
|
2220
2294
|
}
|
|
2221
|
-
class
|
|
2295
|
+
class pe {
|
|
2222
2296
|
constructor(t) {
|
|
2223
2297
|
n(this, "ctx");
|
|
2224
2298
|
const e = t.getContext("2d");
|
|
@@ -2228,9 +2302,6 @@ class Ee {
|
|
|
2228
2302
|
scale(t) {
|
|
2229
2303
|
this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.scale(t, t);
|
|
2230
2304
|
}
|
|
2231
|
-
measureTextWidth(t, e) {
|
|
2232
|
-
return this.ctx.font = e, this.ctx.measureText(t).width;
|
|
2233
|
-
}
|
|
2234
2305
|
save() {
|
|
2235
2306
|
this.ctx.save();
|
|
2236
2307
|
}
|
|
@@ -2257,26 +2328,27 @@ class Ee {
|
|
|
2257
2328
|
* @param {string} color - 阴影的颜色
|
|
2258
2329
|
*/
|
|
2259
2330
|
drawShadow(t, e, i, s, o) {
|
|
2260
|
-
const { fillColor: r, side: a, shadowWidth:
|
|
2331
|
+
const { fillColor: r, side: a, shadowWidth: h, colorStart: l, colorEnd: d } = o;
|
|
2261
2332
|
this.ctx.save(), r && (this.ctx.fillStyle = r, this.ctx.fillRect(t, e, i, s));
|
|
2262
2333
|
let f;
|
|
2263
2334
|
switch (a) {
|
|
2264
2335
|
case "left":
|
|
2265
|
-
f = this.ctx.createLinearGradient(t -
|
|
2336
|
+
f = this.ctx.createLinearGradient(t - h, e, t, e), f.addColorStop(0, l), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t - h, e, h, s);
|
|
2266
2337
|
break;
|
|
2267
2338
|
case "right":
|
|
2268
|
-
f = this.ctx.createLinearGradient(t + i, e, t + i +
|
|
2339
|
+
f = this.ctx.createLinearGradient(t + i, e, t + i + h, e), f.addColorStop(0, l), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t + i, e, h, s);
|
|
2269
2340
|
break;
|
|
2270
2341
|
case "top":
|
|
2271
|
-
f = this.ctx.createLinearGradient(t, e -
|
|
2342
|
+
f = this.ctx.createLinearGradient(t, e - h, t, e), f.addColorStop(0, l), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e - h, i, h);
|
|
2272
2343
|
break;
|
|
2273
2344
|
case "bottom":
|
|
2274
|
-
f = this.ctx.createLinearGradient(t, e + s, t, e + s +
|
|
2345
|
+
f = this.ctx.createLinearGradient(t, e + s, t, e + s + h), f.addColorStop(0, l), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e + s, i, h);
|
|
2275
2346
|
break;
|
|
2276
2347
|
default:
|
|
2277
2348
|
console.error("Invalid side specified for shadow");
|
|
2278
2349
|
break;
|
|
2279
2350
|
}
|
|
2351
|
+
this.ctx.restore();
|
|
2280
2352
|
}
|
|
2281
2353
|
// 绘制线条
|
|
2282
2354
|
drawLine(t, e) {
|
|
@@ -2292,12 +2364,12 @@ class Ee {
|
|
|
2292
2364
|
drawImage(t, e, i, s, o) {
|
|
2293
2365
|
this.ctx.save(), this.ctx.drawImage(t, e, i, s, o), this.ctx.restore();
|
|
2294
2366
|
}
|
|
2295
|
-
drawRect(t, e, i, s, { borderWidth: o = 1, borderColor: r, fillColor: a, radius:
|
|
2296
|
-
if (this.ctx.save(), this.ctx.beginPath(), a !== void 0 && (this.ctx.fillStyle = a), r !== void 0 && (this.ctx.lineWidth = o, this.ctx.strokeStyle = r),
|
|
2367
|
+
drawRect(t, e, i, s, { borderWidth: o = 1, borderColor: r, fillColor: a, radius: h = 0 } = {}) {
|
|
2368
|
+
if (this.ctx.save(), this.ctx.beginPath(), a !== void 0 && (this.ctx.fillStyle = a), r !== void 0 && (this.ctx.lineWidth = o, this.ctx.strokeStyle = r), h === 0)
|
|
2297
2369
|
this.ctx.rect(t - 0.5, e - 0.5, i, s);
|
|
2298
2370
|
else {
|
|
2299
|
-
const [
|
|
2300
|
-
this.ctx.moveTo(t +
|
|
2371
|
+
const [l, d, f, u] = typeof h == "number" ? [h, h, h, h] : h;
|
|
2372
|
+
this.ctx.moveTo(t + l, e), this.ctx.arcTo(t + i, e, t + i, e + d, d), this.ctx.arcTo(t + i, e + s, t + i - f, e + s, f), this.ctx.arcTo(t, e + s, t, e + s - u, u), this.ctx.arcTo(t, e, t + l, e, l);
|
|
2301
2373
|
}
|
|
2302
2374
|
a !== void 0 && this.ctx.fill(), r !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
2303
2375
|
}
|
|
@@ -2312,46 +2384,131 @@ class Ee {
|
|
|
2312
2384
|
* @returns 是否溢出
|
|
2313
2385
|
*/
|
|
2314
2386
|
drawText(t = "", e, i, s, o, r = {}) {
|
|
2387
|
+
var O;
|
|
2315
2388
|
this.ctx.save();
|
|
2316
2389
|
const {
|
|
2317
2390
|
font: a = "12px Arial",
|
|
2318
|
-
align:
|
|
2319
|
-
color:
|
|
2391
|
+
align: h = "center",
|
|
2392
|
+
color: l = "#495060",
|
|
2320
2393
|
padding: d = 0,
|
|
2321
|
-
verticalAlign: f = "middle"
|
|
2394
|
+
verticalAlign: f = "middle",
|
|
2395
|
+
maxLineClamp: u = 1,
|
|
2396
|
+
autoRowHeight: x = !1,
|
|
2397
|
+
offsetLeft: w = 0,
|
|
2398
|
+
offsetRight: m = 0
|
|
2322
2399
|
} = r;
|
|
2323
|
-
this.ctx.font = a, this.ctx.fillStyle =
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
const
|
|
2329
|
-
|
|
2400
|
+
this.ctx.font = a, this.ctx.fillStyle = l, this.ctx.textAlign = h;
|
|
2401
|
+
const p = parseInt(((O = a.match(/\d+/)) == null ? void 0 : O[0]) || "12") * (r.lineHeight || 1.2), y = s - d * 2 - w - m, E = this.ctx.measureText("...").width;
|
|
2402
|
+
let R = !1;
|
|
2403
|
+
if (s <= E + d * 2 + w + m)
|
|
2404
|
+
return this.ctx.restore(), R = !0, R;
|
|
2405
|
+
const C = Math.round((o - 2 * d) / p);
|
|
2406
|
+
let I = this.wrapText(t, y), S = Math.min(I.length, Math.max(C, 1));
|
|
2407
|
+
u === "auto" && x ? S = I.length : typeof u == "number" && u < C ? S = u : (u === 1 && !x && (I = [t], S = 1), u === "auto" && C === 1 && (I = [t], S = 1));
|
|
2408
|
+
let _ = i + d;
|
|
2409
|
+
const v = Math.round(S * p);
|
|
2410
|
+
f === "middle" ? _ = i + (o - v) / 2 : f === "bottom" && (_ = i + o - v - d);
|
|
2411
|
+
let b = e + d + w;
|
|
2412
|
+
h === "center" ? b = e + s / 2 : h === "right" && (b = e + s - d - m);
|
|
2413
|
+
for (let T = 0; T < I.length; T++) {
|
|
2414
|
+
const M = I[T], L = _ + T * p;
|
|
2415
|
+
if (this.ctx.textBaseline = "top", T === S - 1) {
|
|
2416
|
+
const { _text: A, ellipsis: D } = this.handleEllipsis(M, s, d, a);
|
|
2417
|
+
this.ctx.fillText(A, b, L), R = D;
|
|
2418
|
+
break;
|
|
2419
|
+
}
|
|
2420
|
+
this.ctx.fillText(M, b, L);
|
|
2421
|
+
}
|
|
2422
|
+
if (r.textCallback && I.length) {
|
|
2423
|
+
const T = Math.round(this.ctx.measureText(I[0]).width);
|
|
2424
|
+
let M = b, L = b + T;
|
|
2425
|
+
h === "center" ? (M = b - T / 2, L = b + T / 2) : h === "right" && (M = b - T, L = b);
|
|
2426
|
+
const A = {
|
|
2427
|
+
x: b,
|
|
2428
|
+
y: _,
|
|
2429
|
+
width: T,
|
|
2430
|
+
height: v,
|
|
2431
|
+
left: M,
|
|
2432
|
+
right: L,
|
|
2433
|
+
top: _,
|
|
2434
|
+
bottom: _ + v
|
|
2435
|
+
};
|
|
2436
|
+
r.textCallback(A);
|
|
2437
|
+
}
|
|
2438
|
+
return this.ctx.restore(), R;
|
|
2439
|
+
}
|
|
2440
|
+
/**
|
|
2441
|
+
* 将文本按宽度换行
|
|
2442
|
+
* @param text
|
|
2443
|
+
* @param maxWidth
|
|
2444
|
+
* @returns
|
|
2445
|
+
*/
|
|
2446
|
+
wrapText(t, e) {
|
|
2447
|
+
if (!t) return [""];
|
|
2448
|
+
const i = [], s = t.split(`
|
|
2449
|
+
`);
|
|
2450
|
+
for (const o of s) {
|
|
2451
|
+
if (o === "") {
|
|
2452
|
+
i.push("");
|
|
2453
|
+
continue;
|
|
2454
|
+
}
|
|
2455
|
+
const r = o.split("");
|
|
2456
|
+
let a = "";
|
|
2457
|
+
for (const h of r) {
|
|
2458
|
+
const l = a + h;
|
|
2459
|
+
this.ctx.measureText(l).width <= e ? a = l : a ? (i.push(a), a = h) : (i.push(h), a = "");
|
|
2460
|
+
}
|
|
2461
|
+
a && i.push(a);
|
|
2462
|
+
}
|
|
2463
|
+
if (i.length >= 1) {
|
|
2464
|
+
const o = i[i.length - 1], { ellipsis: r } = this.handleEllipsis(o, e, 0, this.ctx.font);
|
|
2465
|
+
if (r) {
|
|
2466
|
+
const a = o.slice(0, -1);
|
|
2467
|
+
i[i.length - 1] = a, i.push(o.slice(-1));
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
return i.length > 0 ? i : [""];
|
|
2471
|
+
}
|
|
2472
|
+
/**
|
|
2473
|
+
* 计算文本自适应高度
|
|
2474
|
+
* @param text
|
|
2475
|
+
* @param width
|
|
2476
|
+
* @param options
|
|
2477
|
+
* @returns 计算出的高度
|
|
2478
|
+
*/
|
|
2479
|
+
calculateTextHeight(t = "", e, i = {}) {
|
|
2480
|
+
var w;
|
|
2481
|
+
const { font: s = "12px Arial", padding: o = 0, align: r = "center", color: a = "#495060", maxLineClamp: h = 1 } = i;
|
|
2482
|
+
this.ctx.save(), this.ctx.font = s, this.ctx.fillStyle = a, this.ctx.textAlign = r;
|
|
2483
|
+
const l = parseInt(((w = s.match(/\d+/)) == null ? void 0 : w[0]) || "12"), d = l * (i.lineHeight || 1.2), f = e - o * 2, u = this.wrapText(t, f);
|
|
2484
|
+
let x = 1;
|
|
2485
|
+
return h === "auto" ? x = u.length : u.length > h ? x = h : x = u.length, this.ctx.restore(), Math.max(Math.floor(x * d + o * 2), Math.floor(l + o * 2));
|
|
2330
2486
|
}
|
|
2331
2487
|
handleEllipsis(t, e, i = 0, s = "12px Arial") {
|
|
2488
|
+
this.ctx.save();
|
|
2332
2489
|
let o = !1, r = t;
|
|
2333
2490
|
if (this.ctx.font = s, t == null || t === "")
|
|
2334
|
-
return {
|
|
2491
|
+
return this.ctx.restore(), {
|
|
2335
2492
|
_text: "",
|
|
2336
2493
|
ellipsis: o
|
|
2337
2494
|
};
|
|
2338
2495
|
const a = this.ctx.measureText("...").width;
|
|
2339
2496
|
if (e <= a + i * 2)
|
|
2340
|
-
return {
|
|
2497
|
+
return this.ctx.restore(), {
|
|
2341
2498
|
_text: "",
|
|
2342
2499
|
ellipsis: !0
|
|
2343
2500
|
};
|
|
2344
|
-
const
|
|
2345
|
-
if (
|
|
2501
|
+
const h = this.ctx.measureText(t).width, l = e - i * 2;
|
|
2502
|
+
if (h && h + a >= l) {
|
|
2346
2503
|
o = !0;
|
|
2347
|
-
let
|
|
2348
|
-
for (let
|
|
2349
|
-
if (
|
|
2350
|
-
r = t.slice(0,
|
|
2504
|
+
let d = 0;
|
|
2505
|
+
for (let f = 0; f < t.length; f++)
|
|
2506
|
+
if (d += this.ctx.measureText(t[f]).width, d >= l - a) {
|
|
2507
|
+
r = t.slice(0, f) + "...", o = !0;
|
|
2351
2508
|
break;
|
|
2352
2509
|
}
|
|
2353
2510
|
}
|
|
2354
|
-
return {
|
|
2511
|
+
return this.ctx.restore(), {
|
|
2355
2512
|
_text: r,
|
|
2356
2513
|
ellipsis: o
|
|
2357
2514
|
};
|
|
@@ -2604,6 +2761,10 @@ class It {
|
|
|
2604
2761
|
{ label: "粘贴", value: "paste" },
|
|
2605
2762
|
{ label: "清空选中内容", value: "clearSelected" }
|
|
2606
2763
|
]);
|
|
2764
|
+
/** 格子多行文本行高,isAutoRowHeight才会生效 */
|
|
2765
|
+
n(this, "CELL_LINE_HEIGHT", 1.3);
|
|
2766
|
+
/** 全局自动行高 */
|
|
2767
|
+
n(this, "AUTO_ROW_HEIGHT", !1);
|
|
2607
2768
|
/** header 格子样式 */
|
|
2608
2769
|
n(this, "HEADER_CELL_STYLE_METHOD");
|
|
2609
2770
|
/** body 格子样式 */
|
|
@@ -2659,7 +2820,7 @@ class It {
|
|
|
2659
2820
|
}), Object.assign(this, t, this._config);
|
|
2660
2821
|
}
|
|
2661
2822
|
}
|
|
2662
|
-
const
|
|
2823
|
+
const vt = '<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>', gt = '<svg t="1755138507987" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5079" width="200" height="200"><path d="M512 938.688a42.688 42.688 0 0 1-35.072-18.432l-192-277.312A42.56 42.56 0 0 1 320 576h384a42.752 42.752 0 0 1 35.072 66.944l-192 277.312a42.688 42.688 0 0 1-35.072 18.432" fill="currentColor" p-id="2016"></path><path d="M704 448H320a42.752 42.752 0 0 1-35.072-66.944l192-277.312c16-23.04 54.208-23.04 70.144 0l192 277.312A42.56 42.56 0 0 1 704 448" fill="currentColor" p-id="2015"></path></svg>', Ee = gt.replace('fill="currentColor" p-id="2016"', 'fill="#bec4c7" p-id="2016"'), ye = gt.replace('fill="currentColor" p-id="2015"', 'fill="#bec4c7" p-id="2015"');
|
|
2663
2824
|
class Ce {
|
|
2664
2825
|
constructor(t) {
|
|
2665
2826
|
n(this, "ctx");
|
|
@@ -2682,7 +2843,7 @@ class Ce {
|
|
|
2682
2843
|
name: "shrink",
|
|
2683
2844
|
configName: "CHECKBOX_UNCHECK_SVG",
|
|
2684
2845
|
configColorName: "SHRINK_ICON_COLOR",
|
|
2685
|
-
svg:
|
|
2846
|
+
svg: vt,
|
|
2686
2847
|
color: "#4E5969"
|
|
2687
2848
|
},
|
|
2688
2849
|
{
|
|
@@ -2734,14 +2895,14 @@ class Ce {
|
|
|
2734
2895
|
name: "icon-select",
|
|
2735
2896
|
configName: "CHECKBOX_UNCHECK_SVG",
|
|
2736
2897
|
configColorName: "SHRINK_ICON_COLOR",
|
|
2737
|
-
svg:
|
|
2898
|
+
svg: vt,
|
|
2738
2899
|
color: "#4E5969"
|
|
2739
2900
|
},
|
|
2740
2901
|
{
|
|
2741
2902
|
name: "sort-asc",
|
|
2742
2903
|
configName: "SORT_ASC_ICON_SVG",
|
|
2743
2904
|
configColorName: "SORT_ICON_COLOR",
|
|
2744
|
-
svg:
|
|
2905
|
+
svg: Ee,
|
|
2745
2906
|
color: "rgb(82,146,247)"
|
|
2746
2907
|
},
|
|
2747
2908
|
{
|
|
@@ -2754,7 +2915,7 @@ class Ce {
|
|
|
2754
2915
|
{
|
|
2755
2916
|
name: "sort-default",
|
|
2756
2917
|
configName: "SORTABLE_ICON_SVG",
|
|
2757
|
-
svg:
|
|
2918
|
+
svg: gt,
|
|
2758
2919
|
color: "#bec4c7"
|
|
2759
2920
|
}
|
|
2760
2921
|
]);
|
|
@@ -2791,22 +2952,22 @@ class Ce {
|
|
|
2791
2952
|
}
|
|
2792
2953
|
async createImageFromSVG(t, e, i = !1) {
|
|
2793
2954
|
const r = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
|
|
2794
|
-
e && r.querySelectorAll("*").forEach((
|
|
2795
|
-
const d =
|
|
2796
|
-
(d === "currentColor" || d === null) &&
|
|
2955
|
+
e && r.querySelectorAll("*").forEach((l) => {
|
|
2956
|
+
const d = l.getAttribute("fill");
|
|
2957
|
+
(d === "currentColor" || d === null) && l.setAttribute("fill", e);
|
|
2797
2958
|
});
|
|
2798
2959
|
const a = new Image();
|
|
2799
|
-
let
|
|
2960
|
+
let h = "";
|
|
2800
2961
|
if (i) {
|
|
2801
|
-
const
|
|
2962
|
+
const l = new Blob([new XMLSerializer().serializeToString(r)], {
|
|
2802
2963
|
type: "image/svg+xml"
|
|
2803
2964
|
});
|
|
2804
|
-
|
|
2965
|
+
h = URL.createObjectURL(l);
|
|
2805
2966
|
} else
|
|
2806
|
-
|
|
2807
|
-
return a.src =
|
|
2967
|
+
h = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(r));
|
|
2968
|
+
return a.src = h, new Promise((l, d) => {
|
|
2808
2969
|
a.onerror = () => d(new Error("Failed to load image:" + t)), a.onload = () => {
|
|
2809
|
-
|
|
2970
|
+
l(a);
|
|
2810
2971
|
};
|
|
2811
2972
|
});
|
|
2812
2973
|
}
|
|
@@ -2814,9 +2975,9 @@ class Ce {
|
|
|
2814
2975
|
return this.icons.get(t);
|
|
2815
2976
|
}
|
|
2816
2977
|
}
|
|
2817
|
-
class
|
|
2818
|
-
constructor(e, i, s, o, r, a,
|
|
2819
|
-
super(e, s, o, r, a, "header",
|
|
2978
|
+
class lt extends Yt {
|
|
2979
|
+
constructor(e, i, s, o, r, a, h) {
|
|
2980
|
+
super(e, s, o, r, a, "header", h.fixed);
|
|
2820
2981
|
n(this, "align");
|
|
2821
2982
|
n(this, "hideHeaderSelection", !1);
|
|
2822
2983
|
n(this, "verticalAlign", "middle");
|
|
@@ -2853,6 +3014,8 @@ class ht extends Yt {
|
|
|
2853
3014
|
n(this, "sortDescIconName", "sort-desc");
|
|
2854
3015
|
n(this, "visibleWidth", 0);
|
|
2855
3016
|
n(this, "visibleHeight", 0);
|
|
3017
|
+
n(this, "maxLineClamp", "auto");
|
|
3018
|
+
n(this, "domDataset", {});
|
|
2856
3019
|
n(this, "drawTextX", 0);
|
|
2857
3020
|
n(this, "drawTextY", 0);
|
|
2858
3021
|
n(this, "drawTextWidth", 0);
|
|
@@ -2872,7 +3035,7 @@ class ht extends Yt {
|
|
|
2872
3035
|
n(this, "drawSortImageHeight", 0);
|
|
2873
3036
|
n(this, "drawSortImageName", "");
|
|
2874
3037
|
n(this, "drawSortImageSource");
|
|
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 =
|
|
3038
|
+
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 = h.key, this.minWidth = h.minWidth, this.maxWidth = h.maxWidth, this.type = h.type || "", this.editorType = h.editorType || "text", this.hideHeaderSelection = h.hideHeaderSelection || !1, this.align = h.headerAlign || h.align || this.ctx.config.COLUMNS_ALIGN, this.verticalAlign = h.headerVerticalAlign || h.verticalAlign || this.ctx.config.COLUMNS_VERTICAL_ALIGN, this.fixed = h.fixed, this.level = h.level || 0, this.operation = h.operation || !1, this.text = h.title, this.column = h, this.colspan = h.colspan || 1, this.widthFillDisable = h.widthFillDisable || !1, this.rowspan = h.rowspan || 1, this.rules = h.rules, this.readonly = h.readonly || !1, this.required = h.required || !1, this.sortIconName = h.sortIconName || "sort-default", this.sortAscIconName = h.sortAscIconName || "sort-asc", this.sortDescIconName = h.sortDescIconName || "sort-desc", this.rowKey = Ht(), this.overflowTooltipShow = h.overflowTooltipHeaderShow !== !1, this.hasChildren = h.children && h.children.length > 0 || !1, this.render = h.renderHeader;
|
|
2876
3039
|
}
|
|
2877
3040
|
/**
|
|
2878
3041
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -2892,11 +3055,11 @@ class ht extends Yt {
|
|
|
2892
3055
|
const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
|
|
2893
3056
|
let o = i, r = s;
|
|
2894
3057
|
if (typeof e == "function") {
|
|
2895
|
-
const a = e, { backgroundColor:
|
|
3058
|
+
const a = e, { backgroundColor: h, color: l } = a({
|
|
2896
3059
|
colIndex: this.colIndex,
|
|
2897
3060
|
column: this.column
|
|
2898
3061
|
}) || {};
|
|
2899
|
-
|
|
3062
|
+
h && (o = h), l && (r = l);
|
|
2900
3063
|
}
|
|
2901
3064
|
this.drawCellBgColor = o, this.drawTextColor = r;
|
|
2902
3065
|
}
|
|
@@ -2904,7 +3067,7 @@ class ht extends Yt {
|
|
|
2904
3067
|
this.updateContainer(), this.displayText = this.getText(), this.drawX = this.getDrawX(), this.drawY = this.getDrawY(), this.drawTextX = this.drawX, this.drawTextY = this.drawY, this.drawTextWidth = this.width, this.drawTextHeight = this.height, this.updateStyle();
|
|
2905
3068
|
}
|
|
2906
3069
|
draw() {
|
|
2907
|
-
this.drawEdge(), this.drawSelection(), this.
|
|
3070
|
+
this.drawEdge(), this.drawSelection(), this.drawText(), this.drawSelector(), this.drawSortIcon();
|
|
2908
3071
|
}
|
|
2909
3072
|
drawEdge() {
|
|
2910
3073
|
const {
|
|
@@ -2916,14 +3079,6 @@ class ht extends Yt {
|
|
|
2916
3079
|
fillColor: this.drawCellBgColor
|
|
2917
3080
|
});
|
|
2918
3081
|
}
|
|
2919
|
-
recalculateTextPosition() {
|
|
2920
|
-
let e = this.drawX, i = this.width;
|
|
2921
|
-
if (["selection", "index-selection", "selection-tree", "tree-selection"].includes(this.type)) {
|
|
2922
|
-
const { CHECKBOX_SIZE: s } = this.ctx.config;
|
|
2923
|
-
this.align === "left" || this.align === "right" ? (e = this.drawX + s + 4, i = this.width - e + this.drawX) : (e = this.drawX + (this.width - s) / 2 + s + 1, i = this.width - e + this.drawX);
|
|
2924
|
-
}
|
|
2925
|
-
this.column.sortBy && (this.align === "right" ? (i = this.width - this.ctx.config.CELL_PADDING - 16 - 4, e = this.drawX + this.ctx.config.CELL_PADDING) : this.align === "center" && this.ctx.paint.measureTextWidth(this.displayText, this.ctx.config.HEADER_FONT) + 16 + 4 > this.width - this.ctx.config.CELL_PADDING * 2 && (i = this.width - this.ctx.config.CELL_PADDING * 2 - 16 - 4)), this.drawTextX = e, this.drawTextWidth = i;
|
|
2926
|
-
}
|
|
2927
3082
|
drawText() {
|
|
2928
3083
|
const {
|
|
2929
3084
|
paint: e,
|
|
@@ -2940,7 +3095,28 @@ class ht extends Yt {
|
|
|
2940
3095
|
padding: s,
|
|
2941
3096
|
color: this.drawTextColor,
|
|
2942
3097
|
align: this.align,
|
|
2943
|
-
verticalAlign: this.verticalAlign
|
|
3098
|
+
verticalAlign: this.verticalAlign,
|
|
3099
|
+
maxLineClamp: this.maxLineClamp,
|
|
3100
|
+
offsetRight: this.column.sortBy ? 16 : 0,
|
|
3101
|
+
// 排序图标占位
|
|
3102
|
+
offsetLeft: this.required ? 12 : 0,
|
|
3103
|
+
// 必填星号占位
|
|
3104
|
+
textCallback: (o) => {
|
|
3105
|
+
this.column.sortBy && (this.drawSortImageX = o.right + 4, this.drawSortImageY = o.top + (o.height - 16) / 2), this.required && e.drawText(
|
|
3106
|
+
"*",
|
|
3107
|
+
o.left - 18,
|
|
3108
|
+
o.top + (o.height - 12) / 2,
|
|
3109
|
+
24,
|
|
3110
|
+
24,
|
|
3111
|
+
{
|
|
3112
|
+
color: "red",
|
|
3113
|
+
font: "18px Arial",
|
|
3114
|
+
align: "center",
|
|
3115
|
+
verticalAlign: "middle",
|
|
3116
|
+
padding: 0
|
|
3117
|
+
}
|
|
3118
|
+
);
|
|
3119
|
+
}
|
|
2944
3120
|
}
|
|
2945
3121
|
);
|
|
2946
3122
|
}
|
|
@@ -2957,10 +3133,10 @@ class ht extends Yt {
|
|
|
2957
3133
|
drawSelection() {
|
|
2958
3134
|
if (!this.hideHeaderSelection && ["index-selection", "selection", "selection-tree", "tree-selection"].includes(this.type)) {
|
|
2959
3135
|
const { indeterminate: e, check: i, selectable: s } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: o = 0, CELL_PADDING: r } = this.ctx.config;
|
|
2960
|
-
let a = this.drawX + (this.width - o) / 2,
|
|
2961
|
-
this.drawTextX = a + o - r / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX, (this.align === "left" || this.align === "right") && (a = this.drawX + r, this.drawTextX = a + o - r / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX), this.verticalAlign === "top" ?
|
|
2962
|
-
let
|
|
2963
|
-
e ? (
|
|
3136
|
+
let a = this.drawX + (this.width - o) / 2, h = this.drawY + (this.height - o) / 2;
|
|
3137
|
+
this.drawTextX = a + o - r / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX, (this.align === "left" || this.align === "right") && (a = this.drawX + r, this.drawTextX = a + o - r / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX), this.verticalAlign === "top" ? h = this.drawY + r / 2 : this.verticalAlign === "bottom" && (h = this.drawY + this.height - o - r / 2);
|
|
3138
|
+
let l = this.ctx.icons.get("checkbox-uncheck"), d = "checkbox-uncheck";
|
|
3139
|
+
e ? (l = this.ctx.icons.get("checkbox-indeterminate"), d = "checkbox-indeterminate") : i && s ? (l = this.ctx.icons.get("checkbox-check"), d = "checkbox-check") : i && !s ? (l = this.ctx.icons.get("checkbox-check-disabled"), d = "checkbox-check-disabled") : !i && s ? (l = this.ctx.icons.get("checkbox-uncheck"), d = "checkbox-uncheck") : (l = this.ctx.icons.get("checkbox-disabled"), d = "checkbox-disabled"), l && (this.drawSelectionImageX = a, this.drawSelectionImageY = h, this.drawSelectionImageWidth = o, this.drawSelectionImageHeight = o, this.drawSelectionImageName = d, this.drawSelectionImageSource = l, this.ctx.paint.drawImage(
|
|
2964
3140
|
this.drawSelectionImageSource,
|
|
2965
3141
|
this.drawSelectionImageX,
|
|
2966
3142
|
this.drawSelectionImageY,
|
|
@@ -2972,28 +3148,18 @@ class ht extends Yt {
|
|
|
2972
3148
|
drawSortIcon() {
|
|
2973
3149
|
if (!this.column.sortBy)
|
|
2974
3150
|
return;
|
|
2975
|
-
const
|
|
2976
|
-
let
|
|
2977
|
-
const
|
|
2978
|
-
|
|
2979
|
-
const
|
|
2980
|
-
|
|
2981
|
-
return;
|
|
2982
|
-
let c = 0, h = this.drawY + (this.height - i) / 2;
|
|
2983
|
-
if (this.align === "left") {
|
|
2984
|
-
const d = this.ctx.paint.measureTextWidth(this.displayText, this.ctx.config.HEADER_FONT);
|
|
2985
|
-
c = this.drawX + e + d + s;
|
|
2986
|
-
} else if (this.align === "center") {
|
|
2987
|
-
const d = this.ctx.paint.measureTextWidth(this.displayText, this.ctx.config.HEADER_FONT);
|
|
2988
|
-
c = this.drawX + this.width / 2 - d / 2 + d + s;
|
|
2989
|
-
} else this.align === "right" && (c = this.drawX + this.width - e - i);
|
|
2990
|
-
this.drawSortImageX = c, this.drawSortImageY = h, this.drawSortImageWidth = i, this.drawSortImageHeight = i, this.drawSortImageName = o, this.drawSortImageSource = a, this.ctx.paint.drawImage(
|
|
3151
|
+
const e = 16;
|
|
3152
|
+
let i = this.sortIconName;
|
|
3153
|
+
const s = this.ctx.database.getSortState(this.key);
|
|
3154
|
+
s.direction === "asc" ? i = this.sortAscIconName : s.direction === "desc" && (i = this.sortDescIconName);
|
|
3155
|
+
const o = this.ctx.icons.get(i);
|
|
3156
|
+
o && (this.drawSortImageWidth = e, this.drawSortImageHeight = e, this.drawSortImageName = i, this.drawSortImageSource = o, this.ctx.paint.drawImage(
|
|
2991
3157
|
this.drawSortImageSource,
|
|
2992
3158
|
this.drawSortImageX,
|
|
2993
3159
|
this.drawSortImageY,
|
|
2994
3160
|
this.drawSortImageWidth,
|
|
2995
3161
|
this.drawSortImageHeight
|
|
2996
|
-
);
|
|
3162
|
+
));
|
|
2997
3163
|
}
|
|
2998
3164
|
getText() {
|
|
2999
3165
|
return this.render ? "" : this.text;
|
|
@@ -3042,6 +3208,15 @@ class be {
|
|
|
3042
3208
|
}), this.handleBodyEvent(o, s, this.ctx.body.renderRows, (r) => {
|
|
3043
3209
|
this.ctx.setFocusCell(r), this.ctx.emit("cellMousedown", r, t);
|
|
3044
3210
|
});
|
|
3211
|
+
}), this.ctx.on("mouseup", (t) => {
|
|
3212
|
+
if (t.button !== 0 || this.isBusy(t))
|
|
3213
|
+
return;
|
|
3214
|
+
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, o = i;
|
|
3215
|
+
this.handleHeaderEvent(o, s, this.ctx.header.renderCellHeaders, (r) => {
|
|
3216
|
+
this.ctx.focusCellHeader = r, this.ctx.emit("cellHeaderMouseup", r, t);
|
|
3217
|
+
}), this.handleBodyEvent(o, s, this.ctx.body.renderRows, (r) => {
|
|
3218
|
+
this.ctx.setFocusCell(r), this.ctx.emit("cellMouseup", r, t);
|
|
3219
|
+
});
|
|
3045
3220
|
}), this.ctx.on("click", (t) => {
|
|
3046
3221
|
if (t.button !== 0 || this.isBusy(t))
|
|
3047
3222
|
return;
|
|
@@ -3125,7 +3300,7 @@ class be {
|
|
|
3125
3300
|
t.drawSelectionImageWidth,
|
|
3126
3301
|
t.drawSelectionImageHeight
|
|
3127
3302
|
))
|
|
3128
|
-
if (t instanceof
|
|
3303
|
+
if (t instanceof lt)
|
|
3129
3304
|
t.drawSelectionImageName === "checkbox-uncheck" || t.drawSelectionImageName === "checkbox-indeterminate" ? this.ctx.database.toggleAllSelection() : t.drawSelectionImageName === "checkbox-check" && this.ctx.database.clearSelection(!0);
|
|
3130
3305
|
else {
|
|
3131
3306
|
if (!this.ctx.database.getRowSelectable(t.rowKey))
|
|
@@ -3150,8 +3325,8 @@ class be {
|
|
|
3150
3325
|
t.drawTreeImageHeight
|
|
3151
3326
|
))
|
|
3152
3327
|
return;
|
|
3153
|
-
const
|
|
3154
|
-
if (f && u && !
|
|
3328
|
+
const h = this.ctx.database.getRowForRowKey(t.rowKey), { expand: l = !1, expandLazy: d = !1 } = h || {}, { EXPAND_LAZY: f, EXPAND_LAZY_METHOD: u } = this.ctx.config;
|
|
3329
|
+
if (f && u && !l && !d)
|
|
3155
3330
|
typeof u == "function" && (this.ctx.database.expandLoading(t.rowKey, !0), u({
|
|
3156
3331
|
row: t.row,
|
|
3157
3332
|
rowIndex: t.rowIndex,
|
|
@@ -3180,8 +3355,8 @@ class be {
|
|
|
3180
3355
|
))
|
|
3181
3356
|
return;
|
|
3182
3357
|
const a = this.ctx.database.getSortState(t.key);
|
|
3183
|
-
let
|
|
3184
|
-
a.direction === "none" ?
|
|
3358
|
+
let h;
|
|
3359
|
+
a.direction === "none" ? h = "asc" : a.direction === "asc" ? h = "desc" : h = "none", this.ctx.database.setSortState(t.key, h);
|
|
3185
3360
|
}
|
|
3186
3361
|
/**
|
|
3187
3362
|
* 图标进入和离开事件,包括选中,展开,提示图标等
|
|
@@ -3190,7 +3365,7 @@ class be {
|
|
|
3190
3365
|
*/
|
|
3191
3366
|
imageEnterAndLeave(t, e) {
|
|
3192
3367
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), o = i, r = s;
|
|
3193
|
-
if (t instanceof
|
|
3368
|
+
if (t instanceof lt) {
|
|
3194
3369
|
if (t.drawSelectionImageSource && this.isInsideElement(
|
|
3195
3370
|
r,
|
|
3196
3371
|
o,
|
|
@@ -3214,7 +3389,7 @@ class be {
|
|
|
3214
3389
|
return;
|
|
3215
3390
|
}
|
|
3216
3391
|
}
|
|
3217
|
-
if (t instanceof
|
|
3392
|
+
if (t instanceof ut) {
|
|
3218
3393
|
if (t.drawSelectionImageSource && this.isInsideElement(
|
|
3219
3394
|
r,
|
|
3220
3395
|
o,
|
|
@@ -3264,15 +3439,15 @@ class be {
|
|
|
3264
3439
|
if (this.isInsideBody(e))
|
|
3265
3440
|
for (const r of i) {
|
|
3266
3441
|
const a = r.fixedCells.concat(r.noFixedCells);
|
|
3267
|
-
for (const
|
|
3268
|
-
const
|
|
3442
|
+
for (const h of a) {
|
|
3443
|
+
const l = h.getDrawX(), d = h.getDrawY();
|
|
3269
3444
|
if (o) {
|
|
3270
|
-
if (t >
|
|
3271
|
-
s(
|
|
3445
|
+
if (t > l && t < l + h.visibleWidth && e > d && e < d + h.visibleHeight) {
|
|
3446
|
+
s(h);
|
|
3272
3447
|
return;
|
|
3273
3448
|
}
|
|
3274
|
-
} else if (t >
|
|
3275
|
-
s(
|
|
3449
|
+
} else if (t > l && t < l + h.width && e > d && e < d + h.height) {
|
|
3450
|
+
s(h);
|
|
3276
3451
|
return;
|
|
3277
3452
|
}
|
|
3278
3453
|
}
|
|
@@ -3294,7 +3469,7 @@ class be {
|
|
|
3294
3469
|
this.resizeObserver.unobserve(this.ctx.stageElement), this.mutationObserver.disconnect();
|
|
3295
3470
|
}
|
|
3296
3471
|
}
|
|
3297
|
-
class
|
|
3472
|
+
class Re {
|
|
3298
3473
|
constructor(t, e) {
|
|
3299
3474
|
n(this, "eventBus");
|
|
3300
3475
|
n(this, "eventBrowser");
|
|
@@ -3411,10 +3586,10 @@ class Ie {
|
|
|
3411
3586
|
canvasElement: o,
|
|
3412
3587
|
overlayerElement: r,
|
|
3413
3588
|
editorElement: a,
|
|
3414
|
-
emptyElement:
|
|
3415
|
-
contextMenuElement:
|
|
3589
|
+
emptyElement: h,
|
|
3590
|
+
contextMenuElement: l
|
|
3416
3591
|
} = t;
|
|
3417
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement =
|
|
3592
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = h, this.contextMenuElement = l, this.config = new It(e.config || {}), this.eventBus = new me(), this.eventBrowser = new we(this), this.eventTable = new be(this), this.paint = new pe(this.canvasElement), this.database = new ue(this, e), this.history = new ge(this), this.icons = new Ce(this);
|
|
3418
3593
|
}
|
|
3419
3594
|
setConfig(t) {
|
|
3420
3595
|
this.config = new It(t);
|
|
@@ -3423,8 +3598,8 @@ class Ie {
|
|
|
3423
3598
|
if (this.config.ENABLE_MERGE_CELL_LINK) {
|
|
3424
3599
|
const a = this.database.getVirtualBodyCellByKey(t, e);
|
|
3425
3600
|
if (a && (a.mergeRow || a.mergeCol)) {
|
|
3426
|
-
const { dataList:
|
|
3427
|
-
this.database.batchSetItemValue(
|
|
3601
|
+
const { dataList: h } = a.getSpanInfo(), l = h.map((d) => ({ ...d, value: i }));
|
|
3602
|
+
this.database.batchSetItemValue(l, s, r);
|
|
3428
3603
|
return;
|
|
3429
3604
|
}
|
|
3430
3605
|
}
|
|
@@ -3436,9 +3611,9 @@ class Ie {
|
|
|
3436
3611
|
t.forEach((o) => {
|
|
3437
3612
|
const r = this.database.getRowIndexForRowKey(o.rowKey), a = this.database.getColIndexForKey(o.key);
|
|
3438
3613
|
if (r === void 0 || a === void 0) return;
|
|
3439
|
-
const
|
|
3440
|
-
if (
|
|
3441
|
-
const { dataList:
|
|
3614
|
+
const h = this.database.getVirtualBodyCell(r, a);
|
|
3615
|
+
if (h) {
|
|
3616
|
+
const { dataList: l } = h.getSpanInfo(), d = l.map((f) => ({ ...f, value: o.value }));
|
|
3442
3617
|
s.push(...d);
|
|
3443
3618
|
}
|
|
3444
3619
|
}), this.database.batchSetItemValue(s, e, i);
|
|
@@ -3483,7 +3658,7 @@ class Ie {
|
|
|
3483
3658
|
for (let o = 0; o <= e[1] - e[0]; o++) {
|
|
3484
3659
|
const r = [];
|
|
3485
3660
|
for (let a = 0; a <= i[1] - i[0]; a++) {
|
|
3486
|
-
const
|
|
3661
|
+
const h = o + e[0], l = a + i[0], d = this.database.getVirtualBodyCell(h, l);
|
|
3487
3662
|
d && (d.selectorCellValueType === "displayText" ? r.push(d.displayText) : r.push(d.getValue()));
|
|
3488
3663
|
}
|
|
3489
3664
|
s += `${r.join(" ")}\r`, t.push(r);
|
|
@@ -3604,8 +3779,8 @@ class St {
|
|
|
3604
3779
|
if (this.isOnScrollbar(e, i) && t.target === this.ctx.canvasElement ? this.isFocus = !0 : this.isFocus = !1, r === 0 || s == this.clientX && o == this.clientY) return;
|
|
3605
3780
|
let a = 0;
|
|
3606
3781
|
if (this.type === "horizontal" ? a = s - this.clientX : a = o - this.clientY, this.isDragging && a !== 0) {
|
|
3607
|
-
let
|
|
3608
|
-
this.type === "vertical" ?
|
|
3782
|
+
let h = 0;
|
|
3783
|
+
this.type === "vertical" ? h = this.dragStart + a / (this.visibleDistance - this.barHeight) * this.distance : h = this.dragStart + a / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(h, this.distance));
|
|
3609
3784
|
}
|
|
3610
3785
|
}
|
|
3611
3786
|
isPointInElement(t, e, i, s, o, r) {
|
|
@@ -3631,21 +3806,21 @@ class St {
|
|
|
3631
3806
|
stageHeight: i,
|
|
3632
3807
|
stageWidth: s,
|
|
3633
3808
|
config: { SCROLLER_TRACK_SIZE: o = 0, SCROLLER_SIZE: r = 0, BORDER: a }
|
|
3634
|
-
} = this.ctx,
|
|
3809
|
+
} = this.ctx, h = s, l = i, d = e.height, f = e.width, u = t.height, x = this.ctx.footer.height;
|
|
3635
3810
|
if (this.type === "vertical") {
|
|
3636
|
-
this.visibleDistance =
|
|
3811
|
+
this.visibleDistance = l - o - d, this.distance = u - this.visibleDistance + x, this.trackX = h - o, this.trackY = 0, this.splitPoints = [this.trackX, d, this.trackX + o, d], this.trackWidth = o, this.trackHeight = l, this.barX = this.trackX - 1 + (o - r) / 2, this.barWidth = r;
|
|
3637
3812
|
const w = this.distance ? this.visibleDistance / (u + x) : 0;
|
|
3638
3813
|
let m = Math.floor(w * this.visibleDistance);
|
|
3639
3814
|
m < 30 ? m = 30 : m > this.visibleDistance && (m = 0), this.barHeight = m, this.barY = d + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3640
3815
|
} else {
|
|
3641
|
-
this.visibleDistance =
|
|
3642
|
-
c - o,
|
|
3816
|
+
this.visibleDistance = h - o, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
3643
3817
|
h - o,
|
|
3644
|
-
|
|
3645
|
-
h
|
|
3818
|
+
l - o,
|
|
3819
|
+
h - o,
|
|
3820
|
+
l
|
|
3646
3821
|
];
|
|
3647
3822
|
const w = a ? 0 : 0.5;
|
|
3648
|
-
this.trackX = 0, this.trackY =
|
|
3823
|
+
this.trackX = 0, this.trackY = l - o + w, this.trackWidth = h, this.trackHeight = o;
|
|
3649
3824
|
const m = this.distance ? this.visibleDistance / f : 0;
|
|
3650
3825
|
let g = Math.floor(m * this.visibleDistance);
|
|
3651
3826
|
this.barY = this.trackY - 1 + (o - r) / 2, g < 30 ? g = 30 : g >= this.visibleDistance && (g = 0), this.barWidth = g, this.barHeight = r, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
@@ -3669,7 +3844,7 @@ class St {
|
|
|
3669
3844
|
}), this.ctx.scrollerFocus = this.isFocus;
|
|
3670
3845
|
}
|
|
3671
3846
|
}
|
|
3672
|
-
class
|
|
3847
|
+
class Ie {
|
|
3673
3848
|
constructor(t) {
|
|
3674
3849
|
n(this, "ctx");
|
|
3675
3850
|
n(this, "verticalScrollbar");
|
|
@@ -3736,7 +3911,7 @@ class Re {
|
|
|
3736
3911
|
this.setScrollY(o - e.visibleHeight / 2);
|
|
3737
3912
|
}
|
|
3738
3913
|
}
|
|
3739
|
-
class
|
|
3914
|
+
class ve {
|
|
3740
3915
|
constructor(t) {
|
|
3741
3916
|
n(this, "ctx");
|
|
3742
3917
|
// 上下文
|
|
@@ -3775,7 +3950,7 @@ class Se {
|
|
|
3775
3950
|
n(this, "renderFixedCellHeaders", []);
|
|
3776
3951
|
this.ctx = t, this.ctx.on(
|
|
3777
3952
|
"resetHeader",
|
|
3778
|
-
|
|
3953
|
+
xt(() => {
|
|
3779
3954
|
this.init(), this.ctx.emit("draw");
|
|
3780
3955
|
}, 100)
|
|
3781
3956
|
), this.init(), this.initResizeColumn();
|
|
@@ -3794,13 +3969,13 @@ class Se {
|
|
|
3794
3969
|
this.columnIndex = 0, this.resizeNum = 0, this.render(r, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3795
3970
|
const a = this.ctx.containerElement.getBoundingClientRect();
|
|
3796
3971
|
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 + "px", this.visibleWidth = this.ctx.stageWidth - e;
|
|
3797
|
-
const
|
|
3798
|
-
if (this.resizeNum &&
|
|
3799
|
-
const f = Math.floor(
|
|
3972
|
+
const h = this.visibleWidth - this.width;
|
|
3973
|
+
if (this.resizeNum && h > 0) {
|
|
3974
|
+
const f = Math.floor(h / this.resizeNum * 100) / 100;
|
|
3800
3975
|
this.resizeAllColumn(f);
|
|
3801
3976
|
}
|
|
3802
|
-
const
|
|
3803
|
-
this.ctx.fixedLeftWidth =
|
|
3977
|
+
const l = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
3978
|
+
this.ctx.fixedLeftWidth = l.reduce((f, u) => f + u.width, 0);
|
|
3804
3979
|
const d = this.fixedRightCellHeaders.filter((f) => !f.hasChildren);
|
|
3805
3980
|
this.ctx.fixedRightWidth = d.reduce((f, u) => f + u.width, e), this.ctx.maxColIndex = this.leafCellHeaders.length - 1, this.ctx.header.x = this.x, this.ctx.header.y = this.y, this.ctx.header.width = this.width, this.ctx.header.height = this.height, this.ctx.header.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
|
|
3806
3981
|
}
|
|
@@ -3821,8 +3996,8 @@ class Se {
|
|
|
3821
3996
|
} = this.ctx;
|
|
3822
3997
|
if (this.isResizing && this.resizeTarget) {
|
|
3823
3998
|
const o = this.resizeTarget.width, r = this.resizeTarget.minWidth, a = this.resizeTarget.maxWidth;
|
|
3824
|
-
let
|
|
3825
|
-
|
|
3999
|
+
let h = e.clientX - this.clientX;
|
|
4000
|
+
h + o < s && (h = -(o - s)), r && h + o < r && (h = -(o - r)), a && h + o > a && (h = a - o), this.resizeDiff = h, this.ctx.emit("draw");
|
|
3826
4001
|
} else {
|
|
3827
4002
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
3828
4003
|
return;
|
|
@@ -3833,9 +4008,9 @@ class Se {
|
|
|
3833
4008
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3834
4009
|
const o = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
3835
4010
|
for (const r of o) {
|
|
3836
|
-
const { offsetX: a, offsetY:
|
|
3837
|
-
|
|
3838
|
-
r.colspan <= 1 && this.ctx.isTarget(e) &&
|
|
4011
|
+
const { offsetX: a, offsetY: h } = this.ctx.getOffset(e), l = a, d = r.getDrawX();
|
|
4012
|
+
l > d + r.width - 5 && l < d + r.width + 4 && l < i - 4 && // 视窗中最后一列不允许调整宽
|
|
4013
|
+
r.colspan <= 1 && this.ctx.isTarget(e) && h <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = r);
|
|
3839
4014
|
}
|
|
3840
4015
|
}
|
|
3841
4016
|
}));
|
|
@@ -3889,10 +4064,10 @@ class Se {
|
|
|
3889
4064
|
let s = e;
|
|
3890
4065
|
const { HEADER_HEIGHT: o = 0 } = this.ctx.config;
|
|
3891
4066
|
for (let r = 0; r < i; r++) {
|
|
3892
|
-
const a = t[r],
|
|
4067
|
+
const a = t[r], h = o * (a.rowspan || 0), l = o * (a.level || 0);
|
|
3893
4068
|
let { minWidth: d, maxWidth: f } = a, u = a.width || 100;
|
|
3894
4069
|
d && u < d && (u = d), f && u > f && (u = f), a.children && (u = et(a.children).reduce((m, g) => m + ((g == null ? void 0 : g.width) || 100), 0));
|
|
3895
|
-
const x = new
|
|
4070
|
+
const x = new lt(this.ctx, this.columnIndex, s, l, u, h, a);
|
|
3896
4071
|
this.ctx.database.setHeader(a.key, x), this.allCellHeaders.push(x), a.children || (this.leafCellHeaders.push(x), x.column.widthFillDisable || this.resizeNum++), a.fixed === "left" ? this.fixedLeftCellHeaders.push(x) : a.fixed === "right" ? this.fixedRightCellHeaders.push(x) : this.centerCellHeaders.push(x), !a.children && this.columnIndex++, a.children && this.render(a.children, s), s += u;
|
|
3897
4072
|
}
|
|
3898
4073
|
}
|
|
@@ -3924,8 +4099,8 @@ class Se {
|
|
|
3924
4099
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3925
4100
|
colorEnd: "rgba(0,0,0,0)"
|
|
3926
4101
|
}), i < Math.floor(s.width - o - 1) && e !== a) {
|
|
3927
|
-
const
|
|
3928
|
-
this.ctx.paint.drawShadow(
|
|
4102
|
+
const h = s.width - (this.x + this.width) + o - e;
|
|
4103
|
+
this.ctx.paint.drawShadow(h, this.y, e, this.height, {
|
|
3929
4104
|
fillColor: r,
|
|
3930
4105
|
side: "left",
|
|
3931
4106
|
shadowWidth: 4,
|
|
@@ -3967,7 +4142,7 @@ class Se {
|
|
|
3967
4142
|
}
|
|
3968
4143
|
}
|
|
3969
4144
|
class Bt {
|
|
3970
|
-
constructor(t, e, i = 0, s = 0, o = 0, r = 0, a,
|
|
4145
|
+
constructor(t, e, i = 0, s = 0, o = 0, r = 0, a, h = "body") {
|
|
3971
4146
|
n(this, "ctx");
|
|
3972
4147
|
n(this, "x", 0);
|
|
3973
4148
|
n(this, "y", 0);
|
|
@@ -3976,29 +4151,35 @@ class Bt {
|
|
|
3976
4151
|
n(this, "cells", []);
|
|
3977
4152
|
n(this, "fixedCells", []);
|
|
3978
4153
|
n(this, "noFixedCells", []);
|
|
4154
|
+
n(this, "calculatedHeightCells", []);
|
|
3979
4155
|
n(this, "rowIndex", 0);
|
|
3980
4156
|
n(this, "rowKey", "");
|
|
3981
4157
|
n(this, "rowType", "body");
|
|
3982
4158
|
n(this, "data");
|
|
3983
|
-
this
|
|
4159
|
+
n(this, "calculatedHeight", -1);
|
|
4160
|
+
this.ctx = t, this.x = i, this.y = s, this.width = o, this.height = r, this.rowIndex = e, this.rowKey = t.database.getRowKeyForRowIndex(e) || "", this.rowType = h, this.data = a, this.update();
|
|
3984
4161
|
}
|
|
3985
4162
|
update() {
|
|
3986
|
-
const { header: t } = this.ctx, e = [], i = [], s = [];
|
|
3987
|
-
t.renderLeafCellHeaders.forEach((
|
|
3988
|
-
const
|
|
4163
|
+
const { header: t } = this.ctx, e = [], i = [], s = [], o = [];
|
|
4164
|
+
t.renderLeafCellHeaders.forEach((r) => {
|
|
4165
|
+
const a = new ut(
|
|
3989
4166
|
this.ctx,
|
|
3990
4167
|
this.rowIndex,
|
|
3991
|
-
|
|
3992
|
-
|
|
4168
|
+
r.colIndex,
|
|
4169
|
+
r.x,
|
|
3993
4170
|
this.y,
|
|
3994
|
-
|
|
4171
|
+
r.width,
|
|
3995
4172
|
this.height,
|
|
3996
|
-
|
|
4173
|
+
r.column,
|
|
3997
4174
|
this.data,
|
|
3998
4175
|
this.rowType
|
|
3999
4176
|
);
|
|
4000
|
-
|
|
4001
|
-
}), this.cells = e, this.fixedCells = i, this.noFixedCells = s;
|
|
4177
|
+
a.fixed ? i.push(a) : s.push(a), e.push(a), a.autoRowHeight && o.push(a);
|
|
4178
|
+
}), this.cells = e, this.calculatedHeightCells = o, this.fixedCells = i, this.noFixedCells = s;
|
|
4179
|
+
}
|
|
4180
|
+
updateCalculatedHeight() {
|
|
4181
|
+
const t = this.calculatedHeightCells.map((e) => e.getAutoHeight());
|
|
4182
|
+
this.calculatedHeight = t.length ? Math.max(...t) : -1;
|
|
4002
4183
|
}
|
|
4003
4184
|
drawCenter() {
|
|
4004
4185
|
this.noFixedCells.forEach((t) => {
|
|
@@ -4021,7 +4202,7 @@ class Bt {
|
|
|
4021
4202
|
});
|
|
4022
4203
|
}
|
|
4023
4204
|
}
|
|
4024
|
-
class
|
|
4205
|
+
class Se {
|
|
4025
4206
|
constructor(t) {
|
|
4026
4207
|
n(this, "resizeTarget", null);
|
|
4027
4208
|
//调整行大小的目标
|
|
@@ -4058,8 +4239,8 @@ class ve {
|
|
|
4058
4239
|
FOOTER_FIXED: o,
|
|
4059
4240
|
SCROLLER_TRACK_SIZE: r = 0,
|
|
4060
4241
|
HEIGHT: a,
|
|
4061
|
-
EMPTY_BODY_HEIGHT:
|
|
4062
|
-
MAX_HEIGHT:
|
|
4242
|
+
EMPTY_BODY_HEIGHT: h = 0,
|
|
4243
|
+
MAX_HEIGHT: l = 0,
|
|
4063
4244
|
ENABLE_OFFSET_HEIGHT: d = 0,
|
|
4064
4245
|
OFFSET_HEIGHT: f = 0,
|
|
4065
4246
|
FOOTER_POSITION: u
|
|
@@ -4071,32 +4252,32 @@ class ve {
|
|
|
4071
4252
|
const { data: x, sumHeight: w } = s.getData();
|
|
4072
4253
|
this.height = w, this.data = x, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - r;
|
|
4073
4254
|
const m = this.ctx.footer.height;
|
|
4074
|
-
!this.data.length && !a ? this.height =
|
|
4255
|
+
!this.data.length && !a ? this.height = h : !this.data.length && a && (this.height = a - e.height - m - r);
|
|
4075
4256
|
let g = this.height + e.height + r;
|
|
4076
4257
|
g += m;
|
|
4077
|
-
let
|
|
4078
|
-
const y = window.innerHeight, { top:
|
|
4079
|
-
if (y >
|
|
4080
|
-
const
|
|
4081
|
-
|
|
4082
|
-
} else this.data.length && a ?
|
|
4083
|
-
|
|
4084
|
-
let
|
|
4085
|
-
o ? this.visibleHeight =
|
|
4086
|
-
const C = window.devicePixelRatio || 1,
|
|
4087
|
-
t.width = Math.round(
|
|
4088
|
-
const
|
|
4258
|
+
let p = g;
|
|
4259
|
+
const y = window.innerHeight, { top: E } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
4260
|
+
if (y > E && d && !a) {
|
|
4261
|
+
const T = y - E - f;
|
|
4262
|
+
T > e.height + r ? p = T : g > l && (p = l);
|
|
4263
|
+
} else this.data.length && a ? p = a : this.data.length && l && g > l && (p = l);
|
|
4264
|
+
p > 0 && (this.ctx.stageHeight = Math.floor(p), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
|
|
4265
|
+
let R = this.ctx.stageHeight - e.height - r;
|
|
4266
|
+
o ? this.visibleHeight = R - m : this.visibleHeight = R, 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 = x;
|
|
4267
|
+
const C = window.devicePixelRatio || 1, I = this.ctx.stageWidth * C, S = this.ctx.stageHeight * C;
|
|
4268
|
+
t.width = Math.round(I), t.height = Math.round(S);
|
|
4269
|
+
const _ = this.data.length ? "not-empty" : "empty";
|
|
4089
4270
|
this.ctx.emit("emptyChange", {
|
|
4090
|
-
isEmpty:
|
|
4091
|
-
type:
|
|
4271
|
+
isEmpty: _,
|
|
4272
|
+
type: _,
|
|
4092
4273
|
headerHeight: e.height,
|
|
4093
4274
|
bodyHeight: this.height,
|
|
4094
4275
|
footerHeight: m,
|
|
4095
4276
|
width: this.width,
|
|
4096
|
-
height: this.data.length ? 0 :
|
|
4277
|
+
height: this.data.length ? 0 : h + m
|
|
4097
4278
|
});
|
|
4098
|
-
const
|
|
4099
|
-
this.ctx.canvasElement.setAttribute("style", `height:${
|
|
4279
|
+
const v = Math.round(t.width / C * 1e4) / 1e4, b = Math.round(t.height / C * 1e4) / 1e4;
|
|
4280
|
+
this.ctx.canvasElement.setAttribute("style", `height:${b}px;width:${v}px;`), this.ctx.paint.scale(C);
|
|
4100
4281
|
}
|
|
4101
4282
|
// 调整行的高度
|
|
4102
4283
|
initResizeRow() {
|
|
@@ -4116,14 +4297,15 @@ class ve {
|
|
|
4116
4297
|
}), this.ctx.on("mousemove", (e) => {
|
|
4117
4298
|
if (this.ctx.editing) return;
|
|
4118
4299
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), o = i, r = s, a = e.clientY, {
|
|
4119
|
-
stageHeight:
|
|
4120
|
-
scrollY:
|
|
4300
|
+
stageHeight: h,
|
|
4301
|
+
scrollY: l,
|
|
4121
4302
|
config: { RESIZE_ROW_MIN_HEIGHT: d = 0 }
|
|
4122
4303
|
} = this.ctx;
|
|
4123
4304
|
if (this.isResizing && this.resizeTarget) {
|
|
4124
4305
|
const f = this.resizeTarget.height;
|
|
4125
4306
|
let u = a - this.clientY;
|
|
4126
|
-
|
|
4307
|
+
const { calculatedHeight: x } = this.resizeTarget, w = x === -1 ? d : x;
|
|
4308
|
+
u + f < w && (u = -(f - w)), this.resizeDiff = u, this.ctx.emit("draw");
|
|
4127
4309
|
} else {
|
|
4128
4310
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
4129
4311
|
return;
|
|
@@ -4136,7 +4318,7 @@ class ve {
|
|
|
4136
4318
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4137
4319
|
for (let f = 0; f < this.renderRows.length; f++) {
|
|
4138
4320
|
const u = this.renderRows[f];
|
|
4139
|
-
if (o > u.y -
|
|
4321
|
+
if (o > u.y - l + u.height - 1.5 && o < u.y - l + u.height + 1.5 && o < h - 4)
|
|
4140
4322
|
for (let w = 0; w < u.cells.length; w++) {
|
|
4141
4323
|
const m = u.cells[w];
|
|
4142
4324
|
r > m.drawX + 10 && r < m.drawX + m.width - 10 && m.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = u);
|
|
@@ -4185,8 +4367,8 @@ class ve {
|
|
|
4185
4367
|
colorStart: "rgba(0,0,0,0.1)",
|
|
4186
4368
|
colorEnd: "rgba(0,0,0,0)"
|
|
4187
4369
|
}), i < Math.floor(s.width - o - 1) && e !== a) {
|
|
4188
|
-
const
|
|
4189
|
-
this.ctx.paint.drawShadow(
|
|
4370
|
+
const h = s.width - (this.x + this.width) + o - e;
|
|
4371
|
+
this.ctx.paint.drawShadow(h, this.y, e, this.height, {
|
|
4190
4372
|
fillColor: r,
|
|
4191
4373
|
side: "left",
|
|
4192
4374
|
shadowWidth: 4,
|
|
@@ -4214,12 +4396,12 @@ class ve {
|
|
|
4214
4396
|
config: { CELL_HEIGHT: s }
|
|
4215
4397
|
} = this.ctx, o = i, { data: r, positions: a } = e.getData();
|
|
4216
4398
|
this.ctx.maxRowIndex = r.length - 1;
|
|
4217
|
-
let
|
|
4218
|
-
if (
|
|
4399
|
+
let h = this.binarySearch(a, o), l = this.binarySearch(a, o + this.visibleHeight);
|
|
4400
|
+
if (l === -1 && (l = this.ctx.maxRowIndex), h === -1 && l === this.ctx.maxRowIndex) {
|
|
4219
4401
|
const f = Math.floor(this.visibleHeight / s);
|
|
4220
|
-
|
|
4402
|
+
h = this.ctx.maxRowIndex - f;
|
|
4221
4403
|
}
|
|
4222
|
-
this.headIndex = Math.max(0,
|
|
4404
|
+
this.headIndex = Math.max(0, h), this.tailIndex = Math.min(this.ctx.maxRowIndex, l + 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;
|
|
4223
4405
|
const d = [];
|
|
4224
4406
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
4225
4407
|
const u = this.headIndex + f, x = this.visibleRows[f], { height: w, top: m } = this.ctx.database.getPositionForRowIndex(u), g = new Bt(this.ctx, u, 0, m + this.y, t.width, w, x);
|
|
@@ -4227,6 +4409,19 @@ class ve {
|
|
|
4227
4409
|
}
|
|
4228
4410
|
this.renderRows = d, this.ctx.body.renderRows = d;
|
|
4229
4411
|
}
|
|
4412
|
+
updateAutoHeight() {
|
|
4413
|
+
const t = this.ctx.body.renderRows;
|
|
4414
|
+
if (!t.some((s) => s.calculatedHeightCells.length > 0))
|
|
4415
|
+
return;
|
|
4416
|
+
t.forEach((s) => {
|
|
4417
|
+
s.updateCalculatedHeight();
|
|
4418
|
+
});
|
|
4419
|
+
const i = t.map((s) => ({
|
|
4420
|
+
height: s.calculatedHeight,
|
|
4421
|
+
rowIndex: s.rowIndex
|
|
4422
|
+
}));
|
|
4423
|
+
this.ctx.database.setBatchCalculatedRowHeight(i);
|
|
4424
|
+
}
|
|
4230
4425
|
draw() {
|
|
4231
4426
|
this.renderRows.forEach((t) => {
|
|
4232
4427
|
t.drawContainer();
|
|
@@ -4270,16 +4465,16 @@ class _e {
|
|
|
4270
4465
|
stageWidth: o,
|
|
4271
4466
|
config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE: a }
|
|
4272
4467
|
} = this.ctx;
|
|
4273
|
-
let
|
|
4274
|
-
if (this.ctx.config.FOOTER_FIXED || (
|
|
4468
|
+
let h = this.y;
|
|
4469
|
+
if (this.ctx.config.FOOTER_FIXED || (h = this.y - this.ctx.scrollY), i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, h, t, this.height, {
|
|
4275
4470
|
fillColor: r,
|
|
4276
4471
|
side: "right",
|
|
4277
4472
|
shadowWidth: 4,
|
|
4278
4473
|
colorStart: "rgba(0,0,0,0.1)",
|
|
4279
4474
|
colorEnd: "rgba(0,0,0,0)"
|
|
4280
4475
|
}), i < Math.floor(s.width - o - 1) && e !== a) {
|
|
4281
|
-
const
|
|
4282
|
-
this.ctx.paint.drawShadow(
|
|
4476
|
+
const l = s.width - (this.x + this.width) + o - e;
|
|
4477
|
+
this.ctx.paint.drawShadow(l, h, e, this.height, {
|
|
4283
4478
|
fillColor: r,
|
|
4284
4479
|
side: "left",
|
|
4285
4480
|
shadowWidth: 4,
|
|
@@ -4339,7 +4534,7 @@ class Te {
|
|
|
4339
4534
|
this.moveFocus(t);
|
|
4340
4535
|
}), this.ctx.on(
|
|
4341
4536
|
"mousemove",
|
|
4342
|
-
|
|
4537
|
+
xt((t) => {
|
|
4343
4538
|
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = this.ctx.isTarget(t) && i > 0 && i < this.ctx.body.visibleWidth && e > this.ctx.header.visibleHeight && e < this.ctx.header.visibleHeight + this.ctx.body.visibleHeight;
|
|
4344
4539
|
(this.ctx.selectorMove || this.ctx.autofillMove) && (!s && !this.mousedownHeader ? this.startAdjustPosition(t) : this.stopAdjustPosition());
|
|
4345
4540
|
}, 100)
|
|
@@ -4437,30 +4632,30 @@ class Te {
|
|
|
4437
4632
|
this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0;
|
|
4438
4633
|
const {
|
|
4439
4634
|
SELECTOR_AREA_MIN_X: a,
|
|
4440
|
-
SELECTOR_AREA_MAX_X:
|
|
4441
|
-
SELECTOR_AREA_MIN_Y:
|
|
4635
|
+
SELECTOR_AREA_MAX_X: h,
|
|
4636
|
+
SELECTOR_AREA_MIN_Y: l,
|
|
4442
4637
|
SELECTOR_AREA_MAX_Y: d,
|
|
4443
4638
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
4444
4639
|
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
4445
|
-
} = this.ctx.config, x = a, w =
|
|
4446
|
-
let [
|
|
4447
|
-
if (
|
|
4640
|
+
} = this.ctx.config, x = a, w = h || this.ctx.maxColIndex - f, m = l, g = d || this.ctx.maxRowIndex - u;
|
|
4641
|
+
let [p, y] = o, [E, R] = r;
|
|
4642
|
+
if (p < x || y > w || E < m || R > g)
|
|
4448
4643
|
return;
|
|
4449
4644
|
if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
4450
|
-
const
|
|
4451
|
-
|
|
4645
|
+
const I = this.adjustMergeCells(o, r);
|
|
4646
|
+
E = I.yArr[0], R = I.yArr[1], p = I.xArr[0], y = I.xArr[1], this.ctx.onlyMergeCell = I.onlyMergeCell;
|
|
4452
4647
|
}
|
|
4453
|
-
|
|
4648
|
+
p === y && E === R ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, o = [Math.max(x, p), Math.min(w, y)], r = [Math.max(m, E), Math.min(g, R)];
|
|
4454
4649
|
const { BEFORE_SET_SELECTOR_METHOD: C } = this.ctx.config;
|
|
4455
4650
|
if (typeof C == "function") {
|
|
4456
|
-
const
|
|
4651
|
+
const S = C({
|
|
4457
4652
|
focusCell: this.ctx.focusCell,
|
|
4458
4653
|
xArr: o,
|
|
4459
4654
|
yArr: r
|
|
4460
4655
|
});
|
|
4461
|
-
if (!
|
|
4656
|
+
if (!S)
|
|
4462
4657
|
return;
|
|
4463
|
-
o =
|
|
4658
|
+
o = S.xArr, r = S.yArr;
|
|
4464
4659
|
}
|
|
4465
4660
|
this.ctx.selector.xArr = o, this.ctx.selector.yArr = r, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
|
|
4466
4661
|
}
|
|
@@ -4468,33 +4663,33 @@ class Te {
|
|
|
4468
4663
|
adjustMergeCells(t, e) {
|
|
4469
4664
|
var w;
|
|
4470
4665
|
const [i, s] = e, [o, r] = t;
|
|
4471
|
-
let a = [],
|
|
4666
|
+
let a = [], h = [];
|
|
4472
4667
|
for (let m = 0; m <= e[1] - e[0]; m++)
|
|
4473
4668
|
for (let g = 0; g <= t[1] - t[0]; g++) {
|
|
4474
|
-
const
|
|
4475
|
-
|
|
4669
|
+
const p = m + e[0], y = g + t[0], E = this.ctx.database.getVirtualBodyCell(p, y);
|
|
4670
|
+
E && ((p === i || p === s) && a.push(E), (y === o || y === r) && h.push(E));
|
|
4476
4671
|
}
|
|
4477
|
-
const
|
|
4672
|
+
const l = a.reduce(
|
|
4478
4673
|
(m, g) => {
|
|
4479
|
-
const { yArr:
|
|
4480
|
-
return m.minY = Math.min(m.minY, y), m.maxY = Math.max(m.maxY,
|
|
4674
|
+
const { yArr: p } = g.getSpanInfo(), [y, E] = p;
|
|
4675
|
+
return m.minY = Math.min(m.minY, y), m.maxY = Math.max(m.maxY, E), m;
|
|
4481
4676
|
},
|
|
4482
4677
|
{
|
|
4483
4678
|
minY: i,
|
|
4484
4679
|
maxY: s
|
|
4485
4680
|
}
|
|
4486
|
-
), d =
|
|
4681
|
+
), d = h.reduce(
|
|
4487
4682
|
(m, g) => {
|
|
4488
|
-
const { xArr:
|
|
4489
|
-
return m.minX = Math.min(m.minX, y), m.maxX = Math.max(m.maxX,
|
|
4683
|
+
const { xArr: p } = g.getSpanInfo(), [y, E] = p;
|
|
4684
|
+
return m.minX = Math.min(m.minX, y), m.maxX = Math.max(m.maxX, E), m;
|
|
4490
4685
|
},
|
|
4491
4686
|
{
|
|
4492
4687
|
minX: o,
|
|
4493
4688
|
maxX: r
|
|
4494
4689
|
}
|
|
4495
|
-
), f = [d.minX, d.maxX], u = [
|
|
4690
|
+
), f = [d.minX, d.maxX], u = [l.minY, l.maxY];
|
|
4496
4691
|
let x = !1;
|
|
4497
|
-
if (d.minX !== d.maxX ||
|
|
4692
|
+
if (d.minX !== d.maxX || l.minY !== l.maxY) {
|
|
4498
4693
|
const m = JSON.stringify(f) + JSON.stringify(u), g = (w = this.ctx.focusCell) == null ? void 0 : w.getSpanInfo();
|
|
4499
4694
|
x = (g && JSON.stringify(g.xArr) + JSON.stringify(g.yArr)) === m;
|
|
4500
4695
|
}
|
|
@@ -4515,15 +4710,15 @@ class Te {
|
|
|
4515
4710
|
if (this.ctx.mousedown && this.ctx.focusCellHeader) {
|
|
4516
4711
|
const { colIndex: a } = this.ctx.focusCellHeader;
|
|
4517
4712
|
if (this.ctx.clearSelector(), t.colIndex >= a) {
|
|
4518
|
-
const
|
|
4519
|
-
this.setSelector(
|
|
4713
|
+
const h = [a, t.colIndex + t.colspan - 1], l = [o, r];
|
|
4714
|
+
this.setSelector(h, l);
|
|
4520
4715
|
} else {
|
|
4521
|
-
const
|
|
4522
|
-
this.setSelector(
|
|
4716
|
+
const h = [t.colIndex, a], l = [o, r];
|
|
4717
|
+
this.setSelector(h, l);
|
|
4523
4718
|
}
|
|
4524
4719
|
} else {
|
|
4525
|
-
const a = [t.colIndex, t.colIndex + t.colspan - 1],
|
|
4526
|
-
this.setSelector(a,
|
|
4720
|
+
const a = [t.colIndex, t.colIndex + t.colspan - 1], h = [o, r];
|
|
4721
|
+
this.setSelector(a, h);
|
|
4527
4722
|
}
|
|
4528
4723
|
}
|
|
4529
4724
|
selectAll() {
|
|
@@ -4537,8 +4732,8 @@ class Te {
|
|
|
4537
4732
|
SELECTOR_AREA_MIN_Y: o,
|
|
4538
4733
|
SELECTOR_AREA_MAX_Y: r,
|
|
4539
4734
|
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
4540
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4541
|
-
} = this.ctx.config,
|
|
4735
|
+
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4736
|
+
} = this.ctx.config, l = i, d = s || this.ctx.maxColIndex - a, f = o, u = r || this.ctx.maxRowIndex - h, x = [l, d], w = [f, u];
|
|
4542
4737
|
this.setSelector(x, w);
|
|
4543
4738
|
}
|
|
4544
4739
|
}
|
|
@@ -4548,17 +4743,17 @@ class Te {
|
|
|
4548
4743
|
const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MAX_X_OFFSET: o } = this.ctx.config, r = s || this.ctx.maxColIndex - o, a = i;
|
|
4549
4744
|
if (e) {
|
|
4550
4745
|
this.ctx.setFocusCell(t);
|
|
4551
|
-
const
|
|
4552
|
-
this.setSelector(
|
|
4746
|
+
const h = [a, r], l = [t.rowIndex, t.rowIndex];
|
|
4747
|
+
this.setSelector(h, l);
|
|
4553
4748
|
}
|
|
4554
4749
|
if (this.ctx.focusCell && this.ctx.mousedown) {
|
|
4555
|
-
const { rowIndex:
|
|
4556
|
-
if (t.rowIndex >=
|
|
4557
|
-
const
|
|
4558
|
-
this.setSelector(
|
|
4750
|
+
const { rowIndex: h } = this.ctx.focusCell;
|
|
4751
|
+
if (t.rowIndex >= h) {
|
|
4752
|
+
const l = [a, r], d = [h, t.rowIndex];
|
|
4753
|
+
this.setSelector(l, d);
|
|
4559
4754
|
} else {
|
|
4560
|
-
const
|
|
4561
|
-
this.setSelector(
|
|
4755
|
+
const l = [a, r], d = [t.rowIndex, h];
|
|
4756
|
+
this.setSelector(l, d);
|
|
4562
4757
|
}
|
|
4563
4758
|
}
|
|
4564
4759
|
}
|
|
@@ -4567,7 +4762,7 @@ class Te {
|
|
|
4567
4762
|
return;
|
|
4568
4763
|
const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
|
|
4569
4764
|
if (t && e && i) {
|
|
4570
|
-
const { rowIndex: s, colIndex: o } = e, r = Math.min(i.colIndex, o), a = Math.max(i.colIndex, o),
|
|
4765
|
+
const { rowIndex: s, colIndex: o } = e, r = Math.min(i.colIndex, o), a = Math.max(i.colIndex, o), h = Math.min(i.rowIndex, s), l = Math.max(i.rowIndex, s), d = [r, a], f = [h, l];
|
|
4571
4766
|
this.setSelector(d, f);
|
|
4572
4767
|
}
|
|
4573
4768
|
}
|
|
@@ -4577,7 +4772,7 @@ class Te {
|
|
|
4577
4772
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
4578
4773
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
|
|
4579
4774
|
return;
|
|
4580
|
-
const { colIndex: s, rowIndex: o } = i, { colIndex: r, rowIndex: a } = e,
|
|
4775
|
+
const { colIndex: s, rowIndex: o } = i, { colIndex: r, rowIndex: a } = e, h = Math.min(r, s), l = Math.max(r, s), d = Math.min(a, o), f = Math.max(a, o), u = [h, l], x = [d, f];
|
|
4581
4776
|
this.setSelector(u, x);
|
|
4582
4777
|
} else {
|
|
4583
4778
|
this.ctx.emit("cellSelectedClick", e);
|
|
@@ -4630,7 +4825,7 @@ class Te {
|
|
|
4630
4825
|
return;
|
|
4631
4826
|
t = a.data;
|
|
4632
4827
|
}
|
|
4633
|
-
const o =
|
|
4828
|
+
const o = le(t);
|
|
4634
4829
|
navigator.clipboard ? navigator.clipboard.writeText(o).then(() => {
|
|
4635
4830
|
this.ctx.selector.xArrCopy = this.ctx.selector.xArr.slice(), this.ctx.selector.yArrCopy = this.ctx.selector.yArr.slice(), this.ctx.emit("copyChange", {
|
|
4636
4831
|
xArr: this.ctx.selector.xArrCopy,
|
|
@@ -4642,9 +4837,9 @@ class Te {
|
|
|
4642
4837
|
clearSelectedData(t, e, i = !1, s = null) {
|
|
4643
4838
|
let o = [];
|
|
4644
4839
|
const r = /* @__PURE__ */ new Set();
|
|
4645
|
-
for (let
|
|
4646
|
-
for (let
|
|
4647
|
-
const d =
|
|
4840
|
+
for (let h = 0; h <= e[1] - e[0]; h++)
|
|
4841
|
+
for (let l = 0; l <= t[1] - t[0]; l++) {
|
|
4842
|
+
const d = h + e[0], f = l + t[0], u = this.ctx.database.getItemValueForRowIndexAndColIndex(d, f);
|
|
4648
4843
|
if (u) {
|
|
4649
4844
|
const { rowKey: x, key: w } = u;
|
|
4650
4845
|
this.ctx.database.getReadonly(x, w) || (r.add(x), o.push({
|
|
@@ -4662,8 +4857,8 @@ class Te {
|
|
|
4662
4857
|
return o;
|
|
4663
4858
|
this.ctx.database.batchSetItemValue(o, !0);
|
|
4664
4859
|
let a = [];
|
|
4665
|
-
return r.forEach((
|
|
4666
|
-
a.push(this.ctx.database.getRowDataItemForRowKey(
|
|
4860
|
+
return r.forEach((h) => {
|
|
4861
|
+
a.push(this.ctx.database.getRowDataItemForRowKey(h));
|
|
4667
4862
|
}), this.ctx.emit("clearSelectedDataChange", o, a), o;
|
|
4668
4863
|
}
|
|
4669
4864
|
paste() {
|
|
@@ -4675,40 +4870,40 @@ class Te {
|
|
|
4675
4870
|
if (this.ctx.selector.enable && t) {
|
|
4676
4871
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
4677
4872
|
navigator.clipboard.readText().then(async (o) => {
|
|
4678
|
-
let r =
|
|
4679
|
-
const a = [i, i + r[0].length - 1],
|
|
4873
|
+
let r = he(o);
|
|
4874
|
+
const a = [i, i + r[0].length - 1], h = [e, e + r.length - 1], [l, d] = h, [f, u] = a, x = d - this.ctx.maxRowIndex, w = u - this.ctx.maxColIndex;
|
|
4680
4875
|
(x > 0 || w > 0) && this.ctx.emit("onPastedDataOverflow", {
|
|
4681
4876
|
maxY: d,
|
|
4682
4877
|
maxX: u,
|
|
4683
|
-
minY:
|
|
4878
|
+
minY: l,
|
|
4684
4879
|
minX: f,
|
|
4685
4880
|
overflowRowCount: x,
|
|
4686
4881
|
overflowColCount: w,
|
|
4687
4882
|
textArr: r
|
|
4688
4883
|
});
|
|
4689
4884
|
const m = r.length === 1 && r[0].length === 1;
|
|
4690
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a,
|
|
4691
|
-
const
|
|
4885
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, h) && !m) {
|
|
4886
|
+
const E = {
|
|
4692
4887
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
4693
4888
|
message: "Merged cells cannot span paste data"
|
|
4694
4889
|
};
|
|
4695
|
-
this.ctx.hasEvent("error") ? this.ctx.emit("error",
|
|
4890
|
+
this.ctx.hasEvent("error") ? this.ctx.emit("error", E) : alert(E.message);
|
|
4696
4891
|
return;
|
|
4697
4892
|
}
|
|
4698
4893
|
let g = [];
|
|
4699
|
-
for (let
|
|
4700
|
-
const
|
|
4701
|
-
for (let C = 0; C <=
|
|
4702
|
-
const
|
|
4703
|
-
|
|
4704
|
-
|
|
4894
|
+
for (let E = 0; E <= r.length - 1; E++) {
|
|
4895
|
+
const R = r[E].length;
|
|
4896
|
+
for (let C = 0; C <= R - 1; C++) {
|
|
4897
|
+
const I = E + e, S = C + i, _ = r[E][C], v = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
4898
|
+
I,
|
|
4899
|
+
S
|
|
4705
4900
|
);
|
|
4706
|
-
if (
|
|
4707
|
-
const { rowKey:
|
|
4708
|
-
this.ctx.database.getReadonly(
|
|
4709
|
-
rowKey:
|
|
4710
|
-
key:
|
|
4711
|
-
value:
|
|
4901
|
+
if (v) {
|
|
4902
|
+
const { rowKey: b, key: O } = v;
|
|
4903
|
+
this.ctx.database.getReadonly(b, O) || (s.add(b), g.push({
|
|
4904
|
+
rowKey: b,
|
|
4905
|
+
key: O,
|
|
4906
|
+
value: _,
|
|
4712
4907
|
row: {}
|
|
4713
4908
|
//内部有设置
|
|
4714
4909
|
}));
|
|
@@ -4716,35 +4911,35 @@ class Te {
|
|
|
4716
4911
|
}
|
|
4717
4912
|
}
|
|
4718
4913
|
if (this.isCut) {
|
|
4719
|
-
const
|
|
4914
|
+
const E = this.clearSelectedData(
|
|
4720
4915
|
this.ctx.selector.xArrCopy,
|
|
4721
4916
|
this.ctx.selector.yArrCopy,
|
|
4722
4917
|
!0
|
|
4723
4918
|
// 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
|
|
4724
|
-
),
|
|
4725
|
-
|
|
4726
|
-
|
|
4919
|
+
), R = g.map((C) => `${C.rowKey}-${C.key}`);
|
|
4920
|
+
E.forEach((C) => {
|
|
4921
|
+
R.includes(`${C.rowKey}-${C.key}`) || g.unshift(C);
|
|
4727
4922
|
}), this.isCut = !1;
|
|
4728
4923
|
}
|
|
4729
4924
|
if (!g.length)
|
|
4730
4925
|
return;
|
|
4731
|
-
const { BEFORE_PASTE_DATA_METHOD:
|
|
4732
|
-
if (typeof
|
|
4733
|
-
const
|
|
4926
|
+
const { BEFORE_PASTE_DATA_METHOD: p } = this.ctx.config;
|
|
4927
|
+
if (typeof p == "function") {
|
|
4928
|
+
const E = p, R = g.map((C) => ({
|
|
4734
4929
|
rowKey: C.rowKey,
|
|
4735
4930
|
key: C.key,
|
|
4736
4931
|
value: C.value,
|
|
4737
4932
|
oldValue: this.ctx.database.getItemValue(C.rowKey, C.key),
|
|
4738
4933
|
row: this.ctx.database.getRowDataItemForRowKey(C.rowKey)
|
|
4739
4934
|
}));
|
|
4740
|
-
if (g = await
|
|
4935
|
+
if (g = await E(R, a, h, r), g && !g.length)
|
|
4741
4936
|
return;
|
|
4742
4937
|
}
|
|
4743
4938
|
this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(g, !0);
|
|
4744
4939
|
let y = [];
|
|
4745
|
-
s.forEach((
|
|
4746
|
-
y.push(this.ctx.database.getRowDataItemForRowKey(
|
|
4747
|
-
}), this.ctx.emit("pasteChange", g, y);
|
|
4940
|
+
s.forEach((E) => {
|
|
4941
|
+
y.push(this.ctx.database.getRowDataItemForRowKey(E));
|
|
4942
|
+
}), this.ctx.emit("pasteChange", g, y), this.ctx.emit("draw");
|
|
4748
4943
|
}).catch((o) => {
|
|
4749
4944
|
console.error("Failed to get the clipboard content:", o);
|
|
4750
4945
|
});
|
|
@@ -4760,7 +4955,7 @@ class Te {
|
|
|
4760
4955
|
if (!e)
|
|
4761
4956
|
return;
|
|
4762
4957
|
let { colIndex: i = 0, rowIndex: s = 0 } = e;
|
|
4763
|
-
const o = 0, r = 0, a = this.ctx.maxColIndex,
|
|
4958
|
+
const o = 0, r = 0, a = this.ctx.maxColIndex, h = this.ctx.maxRowIndex;
|
|
4764
4959
|
switch (t) {
|
|
4765
4960
|
case "LEFT":
|
|
4766
4961
|
i > o && i--;
|
|
@@ -4772,11 +4967,11 @@ class Te {
|
|
|
4772
4967
|
i < a && i++;
|
|
4773
4968
|
break;
|
|
4774
4969
|
case "BOTTOM":
|
|
4775
|
-
s <
|
|
4970
|
+
s < h && s++;
|
|
4776
4971
|
break;
|
|
4777
4972
|
}
|
|
4778
|
-
const
|
|
4779
|
-
f && (f.operation || this.isInSettingRange(f.rowIndex, f.colIndex) && (this.ctx.setFocusCell(f), this.setSelector(
|
|
4973
|
+
const l = [i, i], d = [s, s], f = this.getCell(s, i);
|
|
4974
|
+
f && (f.operation || this.isInSettingRange(f.rowIndex, f.colIndex) && (this.ctx.setFocusCell(f), this.setSelector(l, d), this.adjustBoundaryPosition(), this.ctx.emit("moveFocus", f), this.ctx.emit("draw")));
|
|
4780
4975
|
}
|
|
4781
4976
|
stopAdjustPosition() {
|
|
4782
4977
|
this.adjustPositionX = "", this.adjustPositionY = "", this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerY && (clearInterval(this.timerY), this.timerY = 0);
|
|
@@ -4789,9 +4984,9 @@ class Te {
|
|
|
4789
4984
|
SELECTOR_AREA_MIN_Y: o,
|
|
4790
4985
|
SELECTOR_AREA_MAX_Y: r,
|
|
4791
4986
|
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
4792
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4793
|
-
} = this.ctx.config,
|
|
4794
|
-
return !(e <
|
|
4987
|
+
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4988
|
+
} = this.ctx.config, l = i, d = s || this.ctx.maxColIndex - a, f = o, u = r || this.ctx.maxRowIndex - h;
|
|
4989
|
+
return !(e < l || e > d || t < f || t > u);
|
|
4795
4990
|
}
|
|
4796
4991
|
/**
|
|
4797
4992
|
* 调整滚动条位置,让到达边界时自动滚动
|
|
@@ -4804,8 +4999,8 @@ class Te {
|
|
|
4804
4999
|
let a = 10 * (s === "left" ? -1 : 1);
|
|
4805
5000
|
this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
|
|
4806
5001
|
a *= 1.5;
|
|
4807
|
-
const { scrollX:
|
|
4808
|
-
(
|
|
5002
|
+
const { scrollX: h } = this.ctx, l = h + a;
|
|
5003
|
+
(l < 0 || l > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(l);
|
|
4809
5004
|
}, 100);
|
|
4810
5005
|
}
|
|
4811
5006
|
if (o && this.adjustPositionY !== o) {
|
|
@@ -4813,8 +5008,8 @@ class Te {
|
|
|
4813
5008
|
let a = 10 * (o === "top" ? -1 : 1);
|
|
4814
5009
|
this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
|
|
4815
5010
|
a *= 1.5;
|
|
4816
|
-
const { scrollY:
|
|
4817
|
-
(
|
|
5011
|
+
const { scrollY: h } = this.ctx, l = h + a;
|
|
5012
|
+
(l < 0 || l > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(l);
|
|
4818
5013
|
}, 100);
|
|
4819
5014
|
}
|
|
4820
5015
|
}
|
|
@@ -4830,22 +5025,22 @@ class Te {
|
|
|
4830
5025
|
fixedLeftWidth: o,
|
|
4831
5026
|
header: r,
|
|
4832
5027
|
footer: a,
|
|
4833
|
-
body:
|
|
4834
|
-
scrollX:
|
|
5028
|
+
body: h,
|
|
5029
|
+
scrollX: l,
|
|
4835
5030
|
scrollY: d,
|
|
4836
5031
|
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: u, FOOTER_POSITION: x, ENABLE_MERGE_CELL_LINK: w }
|
|
4837
5032
|
} = this.ctx;
|
|
4838
5033
|
if (!i)
|
|
4839
5034
|
return;
|
|
4840
5035
|
w && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
4841
|
-
const { drawX: m, drawY: g, width:
|
|
4842
|
-
let
|
|
4843
|
-
|
|
4844
|
-
let
|
|
4845
|
-
u && (x === "top" ?
|
|
4846
|
-
const
|
|
4847
|
-
let
|
|
4848
|
-
C > 0 && !
|
|
5036
|
+
const { drawX: m, drawY: g, width: p, height: y, fixed: E } = i, R = o - m + 1, C = i.drawX + p - (e - s) + 1;
|
|
5037
|
+
let I = r.height - g, S = y;
|
|
5038
|
+
S > h.visibleHeight && (S = h.visibleHeight);
|
|
5039
|
+
let _ = 0;
|
|
5040
|
+
u && (x === "top" ? I = r.height + a.height - g : _ = a.visibleHeight);
|
|
5041
|
+
const v = g + S - (t - _ - f);
|
|
5042
|
+
let b = l, O = d;
|
|
5043
|
+
C > 0 && !E ? b = Math.floor(l + C) : R > 0 && !E && (b = Math.floor(l - R)), I > 0 ? O = Math.floor(d - I) : v > 0 && (O = Math.floor(d + v)), (Math.abs(l - b) > 2 || Math.abs(d - O) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(b, O), this.ctx.emit("adjustBoundaryPosition", i));
|
|
4849
5044
|
}
|
|
4850
5045
|
destroy() {
|
|
4851
5046
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
@@ -4861,7 +5056,7 @@ class Oe {
|
|
|
4861
5056
|
this.ctx.on("mousemove", (t) => {
|
|
4862
5057
|
if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
|
|
4863
5058
|
return;
|
|
4864
|
-
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: o, drawX: r, drawY: a, width:
|
|
5059
|
+
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: o, drawX: r, drawY: a, width: h, height: l } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || o === this.ctx.maxRowIndex ? 0 : 2, u = r + h - d + f, x = a + l - d + f;
|
|
4865
5060
|
e > u && i > x && e < u + d && i < x + d && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4866
5061
|
}), this.ctx.on("cellMouseenter", (t) => {
|
|
4867
5062
|
const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], o = i[1], { colIndex: r, rowIndex: a } = t;
|
|
@@ -4894,36 +5089,36 @@ class Oe {
|
|
|
4894
5089
|
return;
|
|
4895
5090
|
let r = t, a = e;
|
|
4896
5091
|
if (!o) {
|
|
4897
|
-
const [
|
|
4898
|
-
a = [
|
|
5092
|
+
const [h] = a;
|
|
5093
|
+
a = [h, h];
|
|
4899
5094
|
}
|
|
4900
5095
|
if (!s) {
|
|
4901
|
-
const [
|
|
4902
|
-
r = [
|
|
5096
|
+
const [h] = r;
|
|
5097
|
+
r = [h, h];
|
|
4903
5098
|
}
|
|
4904
5099
|
if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(r) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(a)) {
|
|
4905
5100
|
const {
|
|
4906
|
-
SELECTOR_AREA_MIN_X:
|
|
4907
|
-
SELECTOR_AREA_MAX_X:
|
|
5101
|
+
SELECTOR_AREA_MIN_X: h,
|
|
5102
|
+
SELECTOR_AREA_MAX_X: l,
|
|
4908
5103
|
SELECTOR_AREA_MIN_Y: d,
|
|
4909
5104
|
SELECTOR_AREA_MAX_Y: f,
|
|
4910
5105
|
SELECTOR_AREA_MAX_X_OFFSET: u,
|
|
4911
5106
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
4912
|
-
} = this.ctx.config, w =
|
|
4913
|
-
let [y,
|
|
4914
|
-
if (y < w ||
|
|
5107
|
+
} = this.ctx.config, w = h, m = l || this.ctx.maxColIndex - u, g = d, p = f || this.ctx.maxRowIndex - x;
|
|
5108
|
+
let [y, E] = r, [R, C] = a;
|
|
5109
|
+
if (y < w || R < g)
|
|
4915
5110
|
return;
|
|
4916
|
-
r = [Math.max(w, y), Math.min(m,
|
|
4917
|
-
const { BEFORE_SET_AUTOFILL_METHOD:
|
|
4918
|
-
if (typeof
|
|
4919
|
-
const
|
|
5111
|
+
r = [Math.max(w, y), Math.min(m, E)], a = [Math.max(g, R), Math.min(p, C)];
|
|
5112
|
+
const { BEFORE_SET_AUTOFILL_METHOD: I } = this.ctx.config;
|
|
5113
|
+
if (typeof I == "function") {
|
|
5114
|
+
const _ = I({
|
|
4920
5115
|
focusCell: this.ctx.focusCell,
|
|
4921
5116
|
xArr: r,
|
|
4922
5117
|
yArr: a
|
|
4923
5118
|
});
|
|
4924
|
-
if (!
|
|
5119
|
+
if (!_)
|
|
4925
5120
|
return;
|
|
4926
|
-
r =
|
|
5121
|
+
r = _.xArr, a = _.yArr;
|
|
4927
5122
|
}
|
|
4928
5123
|
this.ctx.autofill.xArr = r, this.ctx.autofill.yArr = a, this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
|
|
4929
5124
|
}
|
|
@@ -4938,8 +5133,8 @@ class Oe {
|
|
|
4938
5133
|
const m = x + e.yArr[0], g = w + e.xArr[0];
|
|
4939
5134
|
i.set(`${m}-${g}`, !0);
|
|
4940
5135
|
}
|
|
4941
|
-
const { value: s } = e, o = s[0].length, r = s.length, a = this.ctx.autofill.xArr,
|
|
4942
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a,
|
|
5136
|
+
const { value: s } = e, o = s[0].length, r = s.length, a = this.ctx.autofill.xArr, h = this.ctx.autofill.yArr, l = o === 1 && r === 1;
|
|
5137
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, h) && !l) {
|
|
4943
5138
|
const x = {
|
|
4944
5139
|
code: "ERR_MERGED_CELLS_AUTOFILL",
|
|
4945
5140
|
message: "Merged cells cannot span autofill data"
|
|
@@ -4948,15 +5143,15 @@ class Oe {
|
|
|
4948
5143
|
return;
|
|
4949
5144
|
}
|
|
4950
5145
|
let d = [];
|
|
4951
|
-
for (let x = 0; x <=
|
|
5146
|
+
for (let x = 0; x <= h[1] - h[0]; x++)
|
|
4952
5147
|
for (let w = 0; w <= a[1] - a[0]; w++) {
|
|
4953
|
-
const m = w + a[0], g = x +
|
|
4954
|
-
if (y && !i.has(
|
|
4955
|
-
const { rowKey:
|
|
4956
|
-
this.ctx.database.getReadonly(
|
|
4957
|
-
rowKey:
|
|
5148
|
+
const m = w + a[0], g = x + h[0], p = s[x % r][w % o], y = this.ctx.database.getItemValueForRowIndexAndColIndex(g, m), E = `${g}-${m}`;
|
|
5149
|
+
if (y && !i.has(E)) {
|
|
5150
|
+
const { rowKey: R, key: C } = y;
|
|
5151
|
+
this.ctx.database.getReadonly(R, C) || (t.add(R), d.push({
|
|
5152
|
+
rowKey: R,
|
|
4958
5153
|
key: C,
|
|
4959
|
-
value:
|
|
5154
|
+
value: p,
|
|
4960
5155
|
row: {}
|
|
4961
5156
|
}));
|
|
4962
5157
|
}
|
|
@@ -4973,14 +5168,14 @@ class Oe {
|
|
|
4973
5168
|
oldValue: this.ctx.database.getItemValue(m.rowKey, m.key),
|
|
4974
5169
|
row: this.ctx.database.getRowDataItemForRowKey(m.rowKey)
|
|
4975
5170
|
}));
|
|
4976
|
-
if (d = await x(w, a,
|
|
5171
|
+
if (d = await x(w, a, h), d && !d.length)
|
|
4977
5172
|
return;
|
|
4978
5173
|
}
|
|
4979
5174
|
this.ctx.batchSetItemValueByEditor(d, !0);
|
|
4980
5175
|
let u = [];
|
|
4981
5176
|
t.forEach((x) => {
|
|
4982
5177
|
u.push(this.ctx.database.getRowDataItemForRowKey(x));
|
|
4983
|
-
}), this.ctx.emit("autofillChange", d, u);
|
|
5178
|
+
}), this.ctx.emit("autofillChange", d, u), this.ctx.emit("draw");
|
|
4984
5179
|
}
|
|
4985
5180
|
mouseenter(t) {
|
|
4986
5181
|
if (["index", "selection", "index-selection"].includes(t.type))
|
|
@@ -4994,62 +5189,62 @@ class Oe {
|
|
|
4994
5189
|
destroy() {
|
|
4995
5190
|
}
|
|
4996
5191
|
}
|
|
4997
|
-
const j = Math.min, $ = Math.max, it = Math.round,
|
|
4998
|
-
x:
|
|
4999
|
-
y:
|
|
5192
|
+
const j = Math.min, $ = Math.max, it = Math.round, B = (c) => ({
|
|
5193
|
+
x: c,
|
|
5194
|
+
y: c
|
|
5000
5195
|
}), Le = {
|
|
5001
5196
|
left: "right",
|
|
5002
5197
|
right: "left",
|
|
5003
5198
|
bottom: "top",
|
|
5004
5199
|
top: "bottom"
|
|
5005
|
-
},
|
|
5200
|
+
}, Me = {
|
|
5006
5201
|
start: "end",
|
|
5007
5202
|
end: "start"
|
|
5008
5203
|
};
|
|
5009
|
-
function
|
|
5010
|
-
return $(
|
|
5204
|
+
function ct(c, t, e) {
|
|
5205
|
+
return $(c, j(t, e));
|
|
5011
5206
|
}
|
|
5012
|
-
function J(
|
|
5013
|
-
return typeof
|
|
5207
|
+
function J(c, t) {
|
|
5208
|
+
return typeof c == "function" ? c(t) : c;
|
|
5014
5209
|
}
|
|
5015
|
-
function z(
|
|
5016
|
-
return
|
|
5210
|
+
function z(c) {
|
|
5211
|
+
return c.split("-")[0];
|
|
5017
5212
|
}
|
|
5018
|
-
function Q(
|
|
5019
|
-
return
|
|
5213
|
+
function Q(c) {
|
|
5214
|
+
return c.split("-")[1];
|
|
5020
5215
|
}
|
|
5021
|
-
function Kt(
|
|
5022
|
-
return
|
|
5216
|
+
function Kt(c) {
|
|
5217
|
+
return c === "x" ? "y" : "x";
|
|
5023
5218
|
}
|
|
5024
|
-
function
|
|
5025
|
-
return
|
|
5219
|
+
function wt(c) {
|
|
5220
|
+
return c === "y" ? "height" : "width";
|
|
5026
5221
|
}
|
|
5027
|
-
const
|
|
5028
|
-
function V(
|
|
5029
|
-
return
|
|
5222
|
+
const Ae = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
5223
|
+
function V(c) {
|
|
5224
|
+
return Ae.has(z(c)) ? "y" : "x";
|
|
5030
5225
|
}
|
|
5031
|
-
function
|
|
5032
|
-
return Kt(V(
|
|
5226
|
+
function mt(c) {
|
|
5227
|
+
return Kt(V(c));
|
|
5033
5228
|
}
|
|
5034
|
-
function He(
|
|
5229
|
+
function He(c, t, e) {
|
|
5035
5230
|
e === void 0 && (e = !1);
|
|
5036
|
-
const i = Q(
|
|
5231
|
+
const i = Q(c), s = mt(c), o = wt(s);
|
|
5037
5232
|
let r = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
5038
5233
|
return t.reference[o] > t.floating[o] && (r = st(r)), [r, st(r)];
|
|
5039
5234
|
}
|
|
5040
|
-
function De(
|
|
5041
|
-
const t = st(
|
|
5042
|
-
return [dt(
|
|
5235
|
+
function De(c) {
|
|
5236
|
+
const t = st(c);
|
|
5237
|
+
return [dt(c), t, dt(t)];
|
|
5043
5238
|
}
|
|
5044
|
-
function dt(
|
|
5045
|
-
return
|
|
5239
|
+
function dt(c) {
|
|
5240
|
+
return c.replace(/start|end/g, (t) => Me[t]);
|
|
5046
5241
|
}
|
|
5047
|
-
const
|
|
5048
|
-
function Xe(
|
|
5049
|
-
switch (
|
|
5242
|
+
const _t = ["left", "right"], Tt = ["right", "left"], Ne = ["top", "bottom"], ke = ["bottom", "top"];
|
|
5243
|
+
function Xe(c, t, e) {
|
|
5244
|
+
switch (c) {
|
|
5050
5245
|
case "top":
|
|
5051
5246
|
case "bottom":
|
|
5052
|
-
return e ? t ?
|
|
5247
|
+
return e ? t ? Tt : _t : t ? _t : Tt;
|
|
5053
5248
|
case "left":
|
|
5054
5249
|
case "right":
|
|
5055
5250
|
return t ? Ne : ke;
|
|
@@ -5057,38 +5252,38 @@ function Xe(l, t, e) {
|
|
|
5057
5252
|
return [];
|
|
5058
5253
|
}
|
|
5059
5254
|
}
|
|
5060
|
-
function Ye(
|
|
5061
|
-
const s = Q(
|
|
5062
|
-
let o = Xe(z(
|
|
5255
|
+
function Ye(c, t, e, i) {
|
|
5256
|
+
const s = Q(c);
|
|
5257
|
+
let o = Xe(z(c), e === "start", i);
|
|
5063
5258
|
return s && (o = o.map((r) => r + "-" + s), t && (o = o.concat(o.map(dt)))), o;
|
|
5064
5259
|
}
|
|
5065
|
-
function st(
|
|
5066
|
-
return
|
|
5260
|
+
function st(c) {
|
|
5261
|
+
return c.replace(/left|right|bottom|top/g, (t) => Le[t]);
|
|
5067
5262
|
}
|
|
5068
|
-
function Be(
|
|
5263
|
+
function Be(c) {
|
|
5069
5264
|
return {
|
|
5070
5265
|
top: 0,
|
|
5071
5266
|
right: 0,
|
|
5072
5267
|
bottom: 0,
|
|
5073
5268
|
left: 0,
|
|
5074
|
-
...
|
|
5269
|
+
...c
|
|
5075
5270
|
};
|
|
5076
5271
|
}
|
|
5077
|
-
function Wt(
|
|
5078
|
-
return typeof
|
|
5079
|
-
top:
|
|
5080
|
-
right:
|
|
5081
|
-
bottom:
|
|
5082
|
-
left:
|
|
5272
|
+
function Wt(c) {
|
|
5273
|
+
return typeof c != "number" ? Be(c) : {
|
|
5274
|
+
top: c,
|
|
5275
|
+
right: c,
|
|
5276
|
+
bottom: c,
|
|
5277
|
+
left: c
|
|
5083
5278
|
};
|
|
5084
5279
|
}
|
|
5085
|
-
function ot(
|
|
5280
|
+
function ot(c) {
|
|
5086
5281
|
const {
|
|
5087
5282
|
x: t,
|
|
5088
5283
|
y: e,
|
|
5089
5284
|
width: i,
|
|
5090
5285
|
height: s
|
|
5091
|
-
} =
|
|
5286
|
+
} = c;
|
|
5092
5287
|
return {
|
|
5093
5288
|
width: i,
|
|
5094
5289
|
height: s,
|
|
@@ -5100,14 +5295,14 @@ function ot(l) {
|
|
|
5100
5295
|
y: e
|
|
5101
5296
|
};
|
|
5102
5297
|
}
|
|
5103
|
-
function
|
|
5298
|
+
function Ot(c, t, e) {
|
|
5104
5299
|
let {
|
|
5105
5300
|
reference: i,
|
|
5106
5301
|
floating: s
|
|
5107
|
-
} =
|
|
5108
|
-
const o = V(t), r =
|
|
5302
|
+
} = c;
|
|
5303
|
+
const o = V(t), r = mt(t), a = wt(r), h = z(t), l = o === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, u = i[a] / 2 - s[a] / 2;
|
|
5109
5304
|
let x;
|
|
5110
|
-
switch (
|
|
5305
|
+
switch (h) {
|
|
5111
5306
|
case "top":
|
|
5112
5307
|
x = {
|
|
5113
5308
|
x: d,
|
|
@@ -5140,66 +5335,66 @@ function Tt(l, t, e) {
|
|
|
5140
5335
|
}
|
|
5141
5336
|
switch (Q(t)) {
|
|
5142
5337
|
case "start":
|
|
5143
|
-
x[r] -= u * (e &&
|
|
5338
|
+
x[r] -= u * (e && l ? -1 : 1);
|
|
5144
5339
|
break;
|
|
5145
5340
|
case "end":
|
|
5146
|
-
x[r] += u * (e &&
|
|
5341
|
+
x[r] += u * (e && l ? -1 : 1);
|
|
5147
5342
|
break;
|
|
5148
5343
|
}
|
|
5149
5344
|
return x;
|
|
5150
5345
|
}
|
|
5151
|
-
const Ke = async (
|
|
5346
|
+
const Ke = async (c, t, e) => {
|
|
5152
5347
|
const {
|
|
5153
5348
|
placement: i = "bottom",
|
|
5154
5349
|
strategy: s = "absolute",
|
|
5155
5350
|
middleware: o = [],
|
|
5156
5351
|
platform: r
|
|
5157
|
-
} = e, a = o.filter(Boolean),
|
|
5158
|
-
let
|
|
5159
|
-
reference:
|
|
5352
|
+
} = e, a = o.filter(Boolean), h = await (r.isRTL == null ? void 0 : r.isRTL(t));
|
|
5353
|
+
let l = await r.getElementRects({
|
|
5354
|
+
reference: c,
|
|
5160
5355
|
floating: t,
|
|
5161
5356
|
strategy: s
|
|
5162
5357
|
}), {
|
|
5163
5358
|
x: d,
|
|
5164
5359
|
y: f
|
|
5165
|
-
} =
|
|
5360
|
+
} = Ot(l, i, h), u = i, x = {}, w = 0;
|
|
5166
5361
|
for (let m = 0; m < a.length; m++) {
|
|
5167
5362
|
const {
|
|
5168
5363
|
name: g,
|
|
5169
|
-
fn:
|
|
5364
|
+
fn: p
|
|
5170
5365
|
} = a[m], {
|
|
5171
5366
|
x: y,
|
|
5172
|
-
y:
|
|
5173
|
-
data:
|
|
5367
|
+
y: E,
|
|
5368
|
+
data: R,
|
|
5174
5369
|
reset: C
|
|
5175
|
-
} = await
|
|
5370
|
+
} = await p({
|
|
5176
5371
|
x: d,
|
|
5177
5372
|
y: f,
|
|
5178
5373
|
initialPlacement: i,
|
|
5179
5374
|
placement: u,
|
|
5180
5375
|
strategy: s,
|
|
5181
5376
|
middlewareData: x,
|
|
5182
|
-
rects:
|
|
5377
|
+
rects: l,
|
|
5183
5378
|
platform: r,
|
|
5184
5379
|
elements: {
|
|
5185
|
-
reference:
|
|
5380
|
+
reference: c,
|
|
5186
5381
|
floating: t
|
|
5187
5382
|
}
|
|
5188
5383
|
});
|
|
5189
|
-
d = y ?? d, f =
|
|
5384
|
+
d = y ?? d, f = E ?? f, x = {
|
|
5190
5385
|
...x,
|
|
5191
5386
|
[g]: {
|
|
5192
5387
|
...x[g],
|
|
5193
|
-
...
|
|
5388
|
+
...R
|
|
5194
5389
|
}
|
|
5195
|
-
}, C && w <= 50 && (w++, typeof C == "object" && (C.placement && (u = C.placement), C.rects && (
|
|
5196
|
-
reference:
|
|
5390
|
+
}, C && w <= 50 && (w++, typeof C == "object" && (C.placement && (u = C.placement), C.rects && (l = C.rects === !0 ? await r.getElementRects({
|
|
5391
|
+
reference: c,
|
|
5197
5392
|
floating: t,
|
|
5198
5393
|
strategy: s
|
|
5199
5394
|
}) : C.rects), {
|
|
5200
5395
|
x: d,
|
|
5201
5396
|
y: f
|
|
5202
|
-
} =
|
|
5397
|
+
} = Ot(l, u, h)), m = -1);
|
|
5203
5398
|
}
|
|
5204
5399
|
return {
|
|
5205
5400
|
x: d,
|
|
@@ -5209,7 +5404,7 @@ const Ke = async (l, t, e) => {
|
|
|
5209
5404
|
middlewareData: x
|
|
5210
5405
|
};
|
|
5211
5406
|
};
|
|
5212
|
-
async function Ft(
|
|
5407
|
+
async function Ft(c, t) {
|
|
5213
5408
|
var e;
|
|
5214
5409
|
t === void 0 && (t = {});
|
|
5215
5410
|
const {
|
|
@@ -5218,24 +5413,24 @@ async function Ft(l, t) {
|
|
|
5218
5413
|
platform: o,
|
|
5219
5414
|
rects: r,
|
|
5220
5415
|
elements: a,
|
|
5221
|
-
strategy:
|
|
5222
|
-
} =
|
|
5223
|
-
boundary:
|
|
5416
|
+
strategy: h
|
|
5417
|
+
} = c, {
|
|
5418
|
+
boundary: l = "clippingAncestors",
|
|
5224
5419
|
rootBoundary: d = "viewport",
|
|
5225
5420
|
elementContext: f = "floating",
|
|
5226
5421
|
altBoundary: u = !1,
|
|
5227
5422
|
padding: x = 0
|
|
5228
|
-
} = J(t,
|
|
5423
|
+
} = J(t, c), w = Wt(x), g = a[u ? f === "floating" ? "reference" : "floating" : f], p = ot(await o.getClippingRect({
|
|
5229
5424
|
element: (e = await (o.isElement == null ? void 0 : o.isElement(g))) == null || e ? g : g.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(a.floating)),
|
|
5230
|
-
boundary:
|
|
5425
|
+
boundary: l,
|
|
5231
5426
|
rootBoundary: d,
|
|
5232
|
-
strategy:
|
|
5427
|
+
strategy: h
|
|
5233
5428
|
})), y = f === "floating" ? {
|
|
5234
5429
|
x: i,
|
|
5235
5430
|
y: s,
|
|
5236
5431
|
width: r.floating.width,
|
|
5237
5432
|
height: r.floating.height
|
|
5238
|
-
} : r.reference,
|
|
5433
|
+
} : r.reference, E = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(a.floating)), R = await (o.isElement == null ? void 0 : o.isElement(E)) ? await (o.getScale == null ? void 0 : o.getScale(E)) || {
|
|
5239
5434
|
x: 1,
|
|
5240
5435
|
y: 1
|
|
5241
5436
|
} : {
|
|
@@ -5244,19 +5439,19 @@ async function Ft(l, t) {
|
|
|
5244
5439
|
}, C = ot(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
5245
5440
|
elements: a,
|
|
5246
5441
|
rect: y,
|
|
5247
|
-
offsetParent:
|
|
5248
|
-
strategy:
|
|
5442
|
+
offsetParent: E,
|
|
5443
|
+
strategy: h
|
|
5249
5444
|
}) : y);
|
|
5250
5445
|
return {
|
|
5251
|
-
top: (
|
|
5252
|
-
bottom: (C.bottom -
|
|
5253
|
-
left: (
|
|
5254
|
-
right: (C.right -
|
|
5446
|
+
top: (p.top - C.top + w.top) / R.y,
|
|
5447
|
+
bottom: (C.bottom - p.bottom + w.bottom) / R.y,
|
|
5448
|
+
left: (p.left - C.left + w.left) / R.x,
|
|
5449
|
+
right: (C.right - p.right + w.right) / R.x
|
|
5255
5450
|
};
|
|
5256
5451
|
}
|
|
5257
|
-
const We = (
|
|
5452
|
+
const We = (c) => ({
|
|
5258
5453
|
name: "arrow",
|
|
5259
|
-
options:
|
|
5454
|
+
options: c,
|
|
5260
5455
|
async fn(t) {
|
|
5261
5456
|
const {
|
|
5262
5457
|
x: e,
|
|
@@ -5265,36 +5460,36 @@ const We = (l) => ({
|
|
|
5265
5460
|
rects: o,
|
|
5266
5461
|
platform: r,
|
|
5267
5462
|
elements: a,
|
|
5268
|
-
middlewareData:
|
|
5463
|
+
middlewareData: h
|
|
5269
5464
|
} = t, {
|
|
5270
|
-
element:
|
|
5465
|
+
element: l,
|
|
5271
5466
|
padding: d = 0
|
|
5272
|
-
} = J(
|
|
5273
|
-
if (
|
|
5467
|
+
} = J(c, t) || {};
|
|
5468
|
+
if (l == null)
|
|
5274
5469
|
return {};
|
|
5275
5470
|
const f = Wt(d), u = {
|
|
5276
5471
|
x: e,
|
|
5277
5472
|
y: i
|
|
5278
|
-
}, x =
|
|
5279
|
-
let
|
|
5280
|
-
(!
|
|
5281
|
-
const
|
|
5473
|
+
}, x = mt(s), w = wt(x), m = await r.getDimensions(l), g = x === "y", p = g ? "top" : "left", y = g ? "bottom" : "right", E = g ? "clientHeight" : "clientWidth", R = o.reference[w] + o.reference[x] - u[x] - o.floating[w], C = u[x] - o.reference[x], I = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l));
|
|
5474
|
+
let S = I ? I[E] : 0;
|
|
5475
|
+
(!S || !await (r.isElement == null ? void 0 : r.isElement(I))) && (S = a.floating[E] || o.floating[w]);
|
|
5476
|
+
const _ = R / 2 - C / 2, v = S / 2 - m[w] / 2 - 1, b = j(f[p], v), O = j(f[y], v), T = b, M = S - m[w] - O, L = S / 2 - m[w] / 2 + _, A = ct(T, L, M), D = !h.arrow && Q(s) != null && L !== A && o.reference[w] / 2 - (L < T ? b : O) - m[w] / 2 < 0, N = D ? L < T ? L - T : L - M : 0;
|
|
5282
5477
|
return {
|
|
5283
|
-
[x]: u[x] +
|
|
5478
|
+
[x]: u[x] + N,
|
|
5284
5479
|
data: {
|
|
5285
|
-
[x]:
|
|
5286
|
-
centerOffset: L -
|
|
5287
|
-
...
|
|
5288
|
-
alignmentOffset:
|
|
5480
|
+
[x]: A,
|
|
5481
|
+
centerOffset: L - A - N,
|
|
5482
|
+
...D && {
|
|
5483
|
+
alignmentOffset: N
|
|
5289
5484
|
}
|
|
5290
5485
|
},
|
|
5291
|
-
reset:
|
|
5486
|
+
reset: D
|
|
5292
5487
|
};
|
|
5293
5488
|
}
|
|
5294
|
-
}), Fe = function(
|
|
5295
|
-
return
|
|
5489
|
+
}), Fe = function(c) {
|
|
5490
|
+
return c === void 0 && (c = {}), {
|
|
5296
5491
|
name: "flip",
|
|
5297
|
-
options:
|
|
5492
|
+
options: c,
|
|
5298
5493
|
async fn(t) {
|
|
5299
5494
|
var e, i;
|
|
5300
5495
|
const {
|
|
@@ -5302,8 +5497,8 @@ const We = (l) => ({
|
|
|
5302
5497
|
middlewareData: o,
|
|
5303
5498
|
rects: r,
|
|
5304
5499
|
initialPlacement: a,
|
|
5305
|
-
platform:
|
|
5306
|
-
elements:
|
|
5500
|
+
platform: h,
|
|
5501
|
+
elements: l
|
|
5307
5502
|
} = t, {
|
|
5308
5503
|
mainAxis: d = !0,
|
|
5309
5504
|
crossAxis: f = !0,
|
|
@@ -5312,60 +5507,60 @@ const We = (l) => ({
|
|
|
5312
5507
|
fallbackAxisSideDirection: w = "none",
|
|
5313
5508
|
flipAlignment: m = !0,
|
|
5314
5509
|
...g
|
|
5315
|
-
} = J(
|
|
5510
|
+
} = J(c, t);
|
|
5316
5511
|
if ((e = o.arrow) != null && e.alignmentOffset)
|
|
5317
5512
|
return {};
|
|
5318
|
-
const
|
|
5319
|
-
!u &&
|
|
5320
|
-
const
|
|
5321
|
-
let
|
|
5322
|
-
if (d &&
|
|
5323
|
-
const L = He(s, r,
|
|
5324
|
-
|
|
5513
|
+
const p = z(s), y = V(a), E = z(a) === a, R = await (h.isRTL == null ? void 0 : h.isRTL(l.floating)), C = u || (E || !m ? [st(a)] : De(a)), I = w !== "none";
|
|
5514
|
+
!u && I && C.push(...Ye(a, m, w, R));
|
|
5515
|
+
const S = [a, ...C], _ = await Ft(t, g), v = [];
|
|
5516
|
+
let b = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
5517
|
+
if (d && v.push(_[p]), f) {
|
|
5518
|
+
const L = He(s, r, R);
|
|
5519
|
+
v.push(_[L[0]], _[L[1]]);
|
|
5325
5520
|
}
|
|
5326
|
-
if (
|
|
5521
|
+
if (b = [...b, {
|
|
5327
5522
|
placement: s,
|
|
5328
|
-
overflows:
|
|
5329
|
-
}], !
|
|
5330
|
-
var
|
|
5331
|
-
const L = (((
|
|
5332
|
-
if (
|
|
5523
|
+
overflows: v
|
|
5524
|
+
}], !v.every((L) => L <= 0)) {
|
|
5525
|
+
var O, T;
|
|
5526
|
+
const L = (((O = o.flip) == null ? void 0 : O.index) || 0) + 1, A = S[L];
|
|
5527
|
+
if (A && (!(f === "alignment" ? y !== V(A) : !1) || // We leave the current main axis only if every placement on that axis
|
|
5333
5528
|
// overflows the main axis.
|
|
5334
|
-
|
|
5529
|
+
b.every((k) => V(k.placement) === y ? k.overflows[0] > 0 : !0)))
|
|
5335
5530
|
return {
|
|
5336
5531
|
data: {
|
|
5337
5532
|
index: L,
|
|
5338
|
-
overflows:
|
|
5533
|
+
overflows: b
|
|
5339
5534
|
},
|
|
5340
5535
|
reset: {
|
|
5341
|
-
placement:
|
|
5536
|
+
placement: A
|
|
5342
5537
|
}
|
|
5343
5538
|
};
|
|
5344
|
-
let
|
|
5345
|
-
if (!
|
|
5539
|
+
let D = (T = b.filter((N) => N.overflows[0] <= 0).sort((N, k) => N.overflows[1] - k.overflows[1])[0]) == null ? void 0 : T.placement;
|
|
5540
|
+
if (!D)
|
|
5346
5541
|
switch (x) {
|
|
5347
5542
|
case "bestFit": {
|
|
5348
5543
|
var M;
|
|
5349
|
-
const
|
|
5350
|
-
if (
|
|
5351
|
-
const F = V(
|
|
5544
|
+
const N = (M = b.filter((k) => {
|
|
5545
|
+
if (I) {
|
|
5546
|
+
const F = V(k.placement);
|
|
5352
5547
|
return F === y || // Create a bias to the `y` side axis due to horizontal
|
|
5353
5548
|
// reading directions favoring greater width.
|
|
5354
5549
|
F === "y";
|
|
5355
5550
|
}
|
|
5356
5551
|
return !0;
|
|
5357
|
-
}).map((
|
|
5358
|
-
|
|
5552
|
+
}).map((k) => [k.placement, k.overflows.filter((F) => F > 0).reduce((F, ie) => F + ie, 0)]).sort((k, F) => k[1] - F[1])[0]) == null ? void 0 : M[0];
|
|
5553
|
+
N && (D = N);
|
|
5359
5554
|
break;
|
|
5360
5555
|
}
|
|
5361
5556
|
case "initialPlacement":
|
|
5362
|
-
|
|
5557
|
+
D = a;
|
|
5363
5558
|
break;
|
|
5364
5559
|
}
|
|
5365
|
-
if (s !==
|
|
5560
|
+
if (s !== D)
|
|
5366
5561
|
return {
|
|
5367
5562
|
reset: {
|
|
5368
|
-
placement:
|
|
5563
|
+
placement: D
|
|
5369
5564
|
}
|
|
5370
5565
|
};
|
|
5371
5566
|
}
|
|
@@ -5373,12 +5568,12 @@ const We = (l) => ({
|
|
|
5373
5568
|
}
|
|
5374
5569
|
};
|
|
5375
5570
|
}, Ve = /* @__PURE__ */ new Set(["left", "top"]);
|
|
5376
|
-
async function Pe(
|
|
5571
|
+
async function Pe(c, t) {
|
|
5377
5572
|
const {
|
|
5378
5573
|
placement: e,
|
|
5379
5574
|
platform: i,
|
|
5380
5575
|
elements: s
|
|
5381
|
-
} =
|
|
5576
|
+
} = c, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r = z(e), a = Q(e), h = V(e) === "y", l = Ve.has(r) ? -1 : 1, d = o && h ? -1 : 1, f = J(t, c);
|
|
5382
5577
|
let {
|
|
5383
5578
|
mainAxis: u,
|
|
5384
5579
|
crossAxis: x,
|
|
@@ -5392,18 +5587,18 @@ async function Pe(l, t) {
|
|
|
5392
5587
|
crossAxis: f.crossAxis || 0,
|
|
5393
5588
|
alignmentAxis: f.alignmentAxis
|
|
5394
5589
|
};
|
|
5395
|
-
return a && typeof w == "number" && (x = a === "end" ? w * -1 : w),
|
|
5590
|
+
return a && typeof w == "number" && (x = a === "end" ? w * -1 : w), h ? {
|
|
5396
5591
|
x: x * d,
|
|
5397
|
-
y: u *
|
|
5592
|
+
y: u * l
|
|
5398
5593
|
} : {
|
|
5399
|
-
x: u *
|
|
5594
|
+
x: u * l,
|
|
5400
5595
|
y: x * d
|
|
5401
5596
|
};
|
|
5402
5597
|
}
|
|
5403
|
-
const ze = function(
|
|
5404
|
-
return
|
|
5598
|
+
const ze = function(c) {
|
|
5599
|
+
return c === void 0 && (c = 0), {
|
|
5405
5600
|
name: "offset",
|
|
5406
|
-
options:
|
|
5601
|
+
options: c,
|
|
5407
5602
|
async fn(t) {
|
|
5408
5603
|
var e, i;
|
|
5409
5604
|
const {
|
|
@@ -5411,21 +5606,21 @@ const ze = function(l) {
|
|
|
5411
5606
|
y: o,
|
|
5412
5607
|
placement: r,
|
|
5413
5608
|
middlewareData: a
|
|
5414
|
-
} = t,
|
|
5609
|
+
} = t, h = await Pe(t, c);
|
|
5415
5610
|
return r === ((e = a.offset) == null ? void 0 : e.placement) && (i = a.arrow) != null && i.alignmentOffset ? {} : {
|
|
5416
|
-
x: s +
|
|
5417
|
-
y: o +
|
|
5611
|
+
x: s + h.x,
|
|
5612
|
+
y: o + h.y,
|
|
5418
5613
|
data: {
|
|
5419
|
-
...
|
|
5614
|
+
...h,
|
|
5420
5615
|
placement: r
|
|
5421
5616
|
}
|
|
5422
5617
|
};
|
|
5423
5618
|
}
|
|
5424
5619
|
};
|
|
5425
|
-
}, $e = function(
|
|
5426
|
-
return
|
|
5620
|
+
}, $e = function(c) {
|
|
5621
|
+
return c === void 0 && (c = {}), {
|
|
5427
5622
|
name: "shift",
|
|
5428
|
-
options:
|
|
5623
|
+
options: c,
|
|
5429
5624
|
async fn(t) {
|
|
5430
5625
|
const {
|
|
5431
5626
|
x: e,
|
|
@@ -5437,28 +5632,28 @@ const ze = function(l) {
|
|
|
5437
5632
|
limiter: a = {
|
|
5438
5633
|
fn: (g) => {
|
|
5439
5634
|
let {
|
|
5440
|
-
x:
|
|
5635
|
+
x: p,
|
|
5441
5636
|
y
|
|
5442
5637
|
} = g;
|
|
5443
5638
|
return {
|
|
5444
|
-
x:
|
|
5639
|
+
x: p,
|
|
5445
5640
|
y
|
|
5446
5641
|
};
|
|
5447
5642
|
}
|
|
5448
5643
|
},
|
|
5449
|
-
...
|
|
5450
|
-
} = J(
|
|
5644
|
+
...h
|
|
5645
|
+
} = J(c, t), l = {
|
|
5451
5646
|
x: e,
|
|
5452
5647
|
y: i
|
|
5453
|
-
}, d = await Ft(t,
|
|
5454
|
-
let x =
|
|
5648
|
+
}, d = await Ft(t, h), f = V(z(s)), u = Kt(f);
|
|
5649
|
+
let x = l[u], w = l[f];
|
|
5455
5650
|
if (o) {
|
|
5456
|
-
const g = u === "y" ? "top" : "left",
|
|
5457
|
-
x =
|
|
5651
|
+
const g = u === "y" ? "top" : "left", p = u === "y" ? "bottom" : "right", y = x + d[g], E = x - d[p];
|
|
5652
|
+
x = ct(y, x, E);
|
|
5458
5653
|
}
|
|
5459
5654
|
if (r) {
|
|
5460
|
-
const g = f === "y" ? "top" : "left",
|
|
5461
|
-
w =
|
|
5655
|
+
const g = f === "y" ? "top" : "left", p = f === "y" ? "bottom" : "right", y = w + d[g], E = w - d[p];
|
|
5656
|
+
w = ct(y, w, E);
|
|
5462
5657
|
}
|
|
5463
5658
|
const m = a.fn({
|
|
5464
5659
|
...t,
|
|
@@ -5482,62 +5677,62 @@ const ze = function(l) {
|
|
|
5482
5677
|
function rt() {
|
|
5483
5678
|
return typeof window < "u";
|
|
5484
5679
|
}
|
|
5485
|
-
function Z(
|
|
5486
|
-
return Vt(
|
|
5680
|
+
function Z(c) {
|
|
5681
|
+
return Vt(c) ? (c.nodeName || "").toLowerCase() : "#document";
|
|
5487
5682
|
}
|
|
5488
|
-
function
|
|
5683
|
+
function H(c) {
|
|
5489
5684
|
var t;
|
|
5490
|
-
return (
|
|
5685
|
+
return (c == null || (t = c.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
5491
5686
|
}
|
|
5492
|
-
function W(
|
|
5687
|
+
function W(c) {
|
|
5493
5688
|
var t;
|
|
5494
|
-
return (t = (Vt(
|
|
5689
|
+
return (t = (Vt(c) ? c.ownerDocument : c.document) || window.document) == null ? void 0 : t.documentElement;
|
|
5495
5690
|
}
|
|
5496
|
-
function Vt(
|
|
5497
|
-
return rt() ?
|
|
5691
|
+
function Vt(c) {
|
|
5692
|
+
return rt() ? c instanceof Node || c instanceof H(c).Node : !1;
|
|
5498
5693
|
}
|
|
5499
|
-
function
|
|
5500
|
-
return rt() ?
|
|
5694
|
+
function X(c) {
|
|
5695
|
+
return rt() ? c instanceof Element || c instanceof H(c).Element : !1;
|
|
5501
5696
|
}
|
|
5502
|
-
function
|
|
5503
|
-
return rt() ?
|
|
5697
|
+
function K(c) {
|
|
5698
|
+
return rt() ? c instanceof HTMLElement || c instanceof H(c).HTMLElement : !1;
|
|
5504
5699
|
}
|
|
5505
|
-
function
|
|
5506
|
-
return !rt() || typeof ShadowRoot > "u" ? !1 :
|
|
5700
|
+
function Lt(c) {
|
|
5701
|
+
return !rt() || typeof ShadowRoot > "u" ? !1 : c instanceof ShadowRoot || c instanceof H(c).ShadowRoot;
|
|
5507
5702
|
}
|
|
5508
5703
|
const Ge = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
5509
|
-
function tt(
|
|
5704
|
+
function tt(c) {
|
|
5510
5705
|
const {
|
|
5511
5706
|
overflow: t,
|
|
5512
5707
|
overflowX: e,
|
|
5513
5708
|
overflowY: i,
|
|
5514
5709
|
display: s
|
|
5515
|
-
} =
|
|
5710
|
+
} = Y(c);
|
|
5516
5711
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !Ge.has(s);
|
|
5517
5712
|
}
|
|
5518
5713
|
const Ue = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
5519
|
-
function Ze(
|
|
5520
|
-
return Ue.has(Z(
|
|
5714
|
+
function Ze(c) {
|
|
5715
|
+
return Ue.has(Z(c));
|
|
5521
5716
|
}
|
|
5522
5717
|
const je = [":popover-open", ":modal"];
|
|
5523
|
-
function nt(
|
|
5718
|
+
function nt(c) {
|
|
5524
5719
|
return je.some((t) => {
|
|
5525
5720
|
try {
|
|
5526
|
-
return
|
|
5721
|
+
return c.matches(t);
|
|
5527
5722
|
} catch {
|
|
5528
5723
|
return !1;
|
|
5529
5724
|
}
|
|
5530
5725
|
});
|
|
5531
5726
|
}
|
|
5532
5727
|
const qe = ["transform", "translate", "scale", "rotate", "perspective"], Je = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Qe = ["paint", "layout", "strict", "content"];
|
|
5533
|
-
function
|
|
5534
|
-
const t = Et(), e =
|
|
5728
|
+
function pt(c) {
|
|
5729
|
+
const t = Et(), e = X(c) ? Y(c) : c;
|
|
5535
5730
|
return qe.some((i) => e[i] ? e[i] !== "none" : !1) || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || Je.some((i) => (e.willChange || "").includes(i)) || Qe.some((i) => (e.contain || "").includes(i));
|
|
5536
5731
|
}
|
|
5537
|
-
function ti(
|
|
5538
|
-
let t = P(
|
|
5539
|
-
for (;
|
|
5540
|
-
if (
|
|
5732
|
+
function ti(c) {
|
|
5733
|
+
let t = P(c);
|
|
5734
|
+
for (; K(t) && !U(t); ) {
|
|
5735
|
+
if (pt(t))
|
|
5541
5736
|
return t;
|
|
5542
5737
|
if (nt(t))
|
|
5543
5738
|
return null;
|
|
@@ -5549,63 +5744,63 @@ function Et() {
|
|
|
5549
5744
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
5550
5745
|
}
|
|
5551
5746
|
const ei = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
5552
|
-
function U(
|
|
5553
|
-
return ei.has(Z(
|
|
5747
|
+
function U(c) {
|
|
5748
|
+
return ei.has(Z(c));
|
|
5554
5749
|
}
|
|
5555
|
-
function
|
|
5556
|
-
return
|
|
5750
|
+
function Y(c) {
|
|
5751
|
+
return H(c).getComputedStyle(c);
|
|
5557
5752
|
}
|
|
5558
|
-
function at(
|
|
5559
|
-
return
|
|
5560
|
-
scrollLeft:
|
|
5561
|
-
scrollTop:
|
|
5753
|
+
function at(c) {
|
|
5754
|
+
return X(c) ? {
|
|
5755
|
+
scrollLeft: c.scrollLeft,
|
|
5756
|
+
scrollTop: c.scrollTop
|
|
5562
5757
|
} : {
|
|
5563
|
-
scrollLeft:
|
|
5564
|
-
scrollTop:
|
|
5758
|
+
scrollLeft: c.scrollX,
|
|
5759
|
+
scrollTop: c.scrollY
|
|
5565
5760
|
};
|
|
5566
5761
|
}
|
|
5567
|
-
function P(
|
|
5568
|
-
if (Z(
|
|
5569
|
-
return
|
|
5762
|
+
function P(c) {
|
|
5763
|
+
if (Z(c) === "html")
|
|
5764
|
+
return c;
|
|
5570
5765
|
const t = (
|
|
5571
5766
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
W(
|
|
5767
|
+
c.assignedSlot || // DOM Element detected.
|
|
5768
|
+
c.parentNode || // ShadowRoot detected.
|
|
5769
|
+
Lt(c) && c.host || // Fallback.
|
|
5770
|
+
W(c)
|
|
5576
5771
|
);
|
|
5577
|
-
return
|
|
5772
|
+
return Lt(t) ? t.host : t;
|
|
5578
5773
|
}
|
|
5579
|
-
function Pt(
|
|
5580
|
-
const t = P(
|
|
5581
|
-
return U(t) ?
|
|
5774
|
+
function Pt(c) {
|
|
5775
|
+
const t = P(c);
|
|
5776
|
+
return U(t) ? c.ownerDocument ? c.ownerDocument.body : c.body : K(t) && tt(t) ? t : Pt(t);
|
|
5582
5777
|
}
|
|
5583
|
-
function zt(
|
|
5778
|
+
function zt(c, t, e) {
|
|
5584
5779
|
var i;
|
|
5585
5780
|
t === void 0 && (t = []);
|
|
5586
|
-
const s = Pt(
|
|
5781
|
+
const s = Pt(c), o = s === ((i = c.ownerDocument) == null ? void 0 : i.body), r = H(s);
|
|
5587
5782
|
return o ? (ft(r), t.concat(r, r.visualViewport || [], tt(s) ? s : [], [])) : t.concat(s, zt(s, []));
|
|
5588
5783
|
}
|
|
5589
|
-
function ft(
|
|
5590
|
-
return
|
|
5784
|
+
function ft(c) {
|
|
5785
|
+
return c.parent && Object.getPrototypeOf(c.parent) ? c.frameElement : null;
|
|
5591
5786
|
}
|
|
5592
|
-
function $t(
|
|
5593
|
-
const t =
|
|
5787
|
+
function $t(c) {
|
|
5788
|
+
const t = Y(c);
|
|
5594
5789
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
5595
|
-
const s =
|
|
5790
|
+
const s = K(c), o = s ? c.offsetWidth : e, r = s ? c.offsetHeight : i, a = it(e) !== o || it(i) !== r;
|
|
5596
5791
|
return a && (e = o, i = r), {
|
|
5597
5792
|
width: e,
|
|
5598
5793
|
height: i,
|
|
5599
5794
|
$: a
|
|
5600
5795
|
};
|
|
5601
5796
|
}
|
|
5602
|
-
function Gt(
|
|
5603
|
-
return
|
|
5797
|
+
function Gt(c) {
|
|
5798
|
+
return X(c) ? c : c.contextElement;
|
|
5604
5799
|
}
|
|
5605
|
-
function G(
|
|
5606
|
-
const t = Gt(
|
|
5607
|
-
if (!
|
|
5608
|
-
return
|
|
5800
|
+
function G(c) {
|
|
5801
|
+
const t = Gt(c);
|
|
5802
|
+
if (!K(t))
|
|
5803
|
+
return B(1);
|
|
5609
5804
|
const e = t.getBoundingClientRect(), {
|
|
5610
5805
|
width: i,
|
|
5611
5806
|
height: s,
|
|
@@ -5617,130 +5812,130 @@ function G(l) {
|
|
|
5617
5812
|
y: a
|
|
5618
5813
|
};
|
|
5619
5814
|
}
|
|
5620
|
-
const ii = /* @__PURE__ */
|
|
5621
|
-
function Ut(
|
|
5622
|
-
const t =
|
|
5815
|
+
const ii = /* @__PURE__ */ B(0);
|
|
5816
|
+
function Ut(c) {
|
|
5817
|
+
const t = H(c);
|
|
5623
5818
|
return !Et() || !t.visualViewport ? ii : {
|
|
5624
5819
|
x: t.visualViewport.offsetLeft,
|
|
5625
5820
|
y: t.visualViewport.offsetTop
|
|
5626
5821
|
};
|
|
5627
5822
|
}
|
|
5628
|
-
function si(
|
|
5629
|
-
return t === void 0 && (t = !1), !e || t && e !==
|
|
5823
|
+
function si(c, t, e) {
|
|
5824
|
+
return t === void 0 && (t = !1), !e || t && e !== H(c) ? !1 : t;
|
|
5630
5825
|
}
|
|
5631
|
-
function q(
|
|
5826
|
+
function q(c, t, e, i) {
|
|
5632
5827
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
5633
|
-
const s =
|
|
5634
|
-
let r =
|
|
5635
|
-
t && (i ?
|
|
5636
|
-
const a = si(o, e, i) ? Ut(o) :
|
|
5637
|
-
let
|
|
5828
|
+
const s = c.getBoundingClientRect(), o = Gt(c);
|
|
5829
|
+
let r = B(1);
|
|
5830
|
+
t && (i ? X(i) && (r = G(i)) : r = G(c));
|
|
5831
|
+
const a = si(o, e, i) ? Ut(o) : B(0);
|
|
5832
|
+
let h = (s.left + a.x) / r.x, l = (s.top + a.y) / r.y, d = s.width / r.x, f = s.height / r.y;
|
|
5638
5833
|
if (o) {
|
|
5639
|
-
const u =
|
|
5834
|
+
const u = H(o), x = i && X(i) ? H(i) : i;
|
|
5640
5835
|
let w = u, m = ft(w);
|
|
5641
5836
|
for (; m && i && x !== w; ) {
|
|
5642
|
-
const g = G(m),
|
|
5643
|
-
|
|
5837
|
+
const g = G(m), p = m.getBoundingClientRect(), y = Y(m), E = p.left + (m.clientLeft + parseFloat(y.paddingLeft)) * g.x, R = p.top + (m.clientTop + parseFloat(y.paddingTop)) * g.y;
|
|
5838
|
+
h *= g.x, l *= g.y, d *= g.x, f *= g.y, h += E, l += R, w = H(m), m = ft(w);
|
|
5644
5839
|
}
|
|
5645
5840
|
}
|
|
5646
5841
|
return ot({
|
|
5647
5842
|
width: d,
|
|
5648
5843
|
height: f,
|
|
5649
|
-
x:
|
|
5650
|
-
y:
|
|
5844
|
+
x: h,
|
|
5845
|
+
y: l
|
|
5651
5846
|
});
|
|
5652
5847
|
}
|
|
5653
|
-
function
|
|
5654
|
-
const e = at(
|
|
5655
|
-
return t ? t.left + e : q(W(
|
|
5848
|
+
function yt(c, t) {
|
|
5849
|
+
const e = at(c).scrollLeft;
|
|
5850
|
+
return t ? t.left + e : q(W(c)).left + e;
|
|
5656
5851
|
}
|
|
5657
|
-
function Zt(
|
|
5852
|
+
function Zt(c, t, e) {
|
|
5658
5853
|
e === void 0 && (e = !1);
|
|
5659
|
-
const i =
|
|
5854
|
+
const i = c.getBoundingClientRect(), s = i.left + t.scrollLeft - (e ? 0 : (
|
|
5660
5855
|
// RTL <body> scrollbar.
|
|
5661
|
-
|
|
5856
|
+
yt(c, i)
|
|
5662
5857
|
)), o = i.top + t.scrollTop;
|
|
5663
5858
|
return {
|
|
5664
5859
|
x: s,
|
|
5665
5860
|
y: o
|
|
5666
5861
|
};
|
|
5667
5862
|
}
|
|
5668
|
-
function oi(
|
|
5863
|
+
function oi(c) {
|
|
5669
5864
|
let {
|
|
5670
5865
|
elements: t,
|
|
5671
5866
|
rect: e,
|
|
5672
5867
|
offsetParent: i,
|
|
5673
5868
|
strategy: s
|
|
5674
|
-
} =
|
|
5869
|
+
} = c;
|
|
5675
5870
|
const o = s === "fixed", r = W(i), a = t ? nt(t.floating) : !1;
|
|
5676
5871
|
if (i === r || a && o)
|
|
5677
5872
|
return e;
|
|
5678
|
-
let
|
|
5873
|
+
let h = {
|
|
5679
5874
|
scrollLeft: 0,
|
|
5680
5875
|
scrollTop: 0
|
|
5681
|
-
},
|
|
5682
|
-
const d =
|
|
5683
|
-
if ((f || !f && !o) && ((Z(i) !== "body" || tt(r)) && (
|
|
5876
|
+
}, l = B(1);
|
|
5877
|
+
const d = B(0), f = K(i);
|
|
5878
|
+
if ((f || !f && !o) && ((Z(i) !== "body" || tt(r)) && (h = at(i)), K(i))) {
|
|
5684
5879
|
const x = q(i);
|
|
5685
|
-
|
|
5880
|
+
l = G(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
|
|
5686
5881
|
}
|
|
5687
|
-
const u = r && !f && !o ? Zt(r,
|
|
5882
|
+
const u = r && !f && !o ? Zt(r, h, !0) : B(0);
|
|
5688
5883
|
return {
|
|
5689
|
-
width: e.width *
|
|
5690
|
-
height: e.height *
|
|
5691
|
-
x: e.x *
|
|
5692
|
-
y: e.y *
|
|
5884
|
+
width: e.width * l.x,
|
|
5885
|
+
height: e.height * l.y,
|
|
5886
|
+
x: e.x * l.x - h.scrollLeft * l.x + d.x + u.x,
|
|
5887
|
+
y: e.y * l.y - h.scrollTop * l.y + d.y + u.y
|
|
5693
5888
|
};
|
|
5694
5889
|
}
|
|
5695
|
-
function ri(
|
|
5696
|
-
return Array.from(
|
|
5890
|
+
function ri(c) {
|
|
5891
|
+
return Array.from(c.getClientRects());
|
|
5697
5892
|
}
|
|
5698
|
-
function ni(
|
|
5699
|
-
const t = W(
|
|
5700
|
-
let r = -e.scrollLeft +
|
|
5893
|
+
function ni(c) {
|
|
5894
|
+
const t = W(c), e = at(c), i = c.ownerDocument.body, s = $(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), o = $(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
|
|
5895
|
+
let r = -e.scrollLeft + yt(c);
|
|
5701
5896
|
const a = -e.scrollTop;
|
|
5702
|
-
return
|
|
5897
|
+
return Y(i).direction === "rtl" && (r += $(t.clientWidth, i.clientWidth) - s), {
|
|
5703
5898
|
width: s,
|
|
5704
5899
|
height: o,
|
|
5705
5900
|
x: r,
|
|
5706
5901
|
y: a
|
|
5707
5902
|
};
|
|
5708
5903
|
}
|
|
5709
|
-
function ai(
|
|
5710
|
-
const e =
|
|
5711
|
-
let o = i.clientWidth, r = i.clientHeight, a = 0,
|
|
5904
|
+
function ai(c, t) {
|
|
5905
|
+
const e = H(c), i = W(c), s = e.visualViewport;
|
|
5906
|
+
let o = i.clientWidth, r = i.clientHeight, a = 0, h = 0;
|
|
5712
5907
|
if (s) {
|
|
5713
5908
|
o = s.width, r = s.height;
|
|
5714
|
-
const
|
|
5715
|
-
(!
|
|
5909
|
+
const l = Et();
|
|
5910
|
+
(!l || l && t === "fixed") && (a = s.offsetLeft, h = s.offsetTop);
|
|
5716
5911
|
}
|
|
5717
5912
|
return {
|
|
5718
5913
|
width: o,
|
|
5719
5914
|
height: r,
|
|
5720
5915
|
x: a,
|
|
5721
|
-
y:
|
|
5916
|
+
y: h
|
|
5722
5917
|
};
|
|
5723
5918
|
}
|
|
5724
|
-
const
|
|
5725
|
-
function
|
|
5726
|
-
const e = q(
|
|
5919
|
+
const hi = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
5920
|
+
function li(c, t) {
|
|
5921
|
+
const e = q(c, !0, t === "fixed"), i = e.top + c.clientTop, s = e.left + c.clientLeft, o = K(c) ? G(c) : B(1), r = c.clientWidth * o.x, a = c.clientHeight * o.y, h = s * o.x, l = i * o.y;
|
|
5727
5922
|
return {
|
|
5728
5923
|
width: r,
|
|
5729
5924
|
height: a,
|
|
5730
|
-
x:
|
|
5731
|
-
y:
|
|
5925
|
+
x: h,
|
|
5926
|
+
y: l
|
|
5732
5927
|
};
|
|
5733
5928
|
}
|
|
5734
|
-
function
|
|
5929
|
+
function Mt(c, t, e) {
|
|
5735
5930
|
let i;
|
|
5736
5931
|
if (t === "viewport")
|
|
5737
|
-
i = ai(
|
|
5932
|
+
i = ai(c, e);
|
|
5738
5933
|
else if (t === "document")
|
|
5739
|
-
i = ni(W(
|
|
5740
|
-
else if (
|
|
5741
|
-
i =
|
|
5934
|
+
i = ni(W(c));
|
|
5935
|
+
else if (X(t))
|
|
5936
|
+
i = li(t, e);
|
|
5742
5937
|
else {
|
|
5743
|
-
const s = Ut(
|
|
5938
|
+
const s = Ut(c);
|
|
5744
5939
|
i = {
|
|
5745
5940
|
x: t.x - s.x,
|
|
5746
5941
|
y: t.y - s.y,
|
|
@@ -5750,68 +5945,68 @@ function Lt(l, t, e) {
|
|
|
5750
5945
|
}
|
|
5751
5946
|
return ot(i);
|
|
5752
5947
|
}
|
|
5753
|
-
function jt(
|
|
5754
|
-
const e = P(
|
|
5755
|
-
return e === t || !
|
|
5948
|
+
function jt(c, t) {
|
|
5949
|
+
const e = P(c);
|
|
5950
|
+
return e === t || !X(e) || U(e) ? !1 : Y(e).position === "fixed" || jt(e, t);
|
|
5756
5951
|
}
|
|
5757
|
-
function
|
|
5758
|
-
const e = t.get(
|
|
5952
|
+
function ci(c, t) {
|
|
5953
|
+
const e = t.get(c);
|
|
5759
5954
|
if (e)
|
|
5760
5955
|
return e;
|
|
5761
|
-
let i = zt(
|
|
5762
|
-
const o =
|
|
5763
|
-
let r = o ? P(
|
|
5764
|
-
for (;
|
|
5765
|
-
const a =
|
|
5766
|
-
!
|
|
5767
|
-
}
|
|
5768
|
-
return t.set(
|
|
5956
|
+
let i = zt(c, []).filter((a) => X(a) && Z(a) !== "body"), s = null;
|
|
5957
|
+
const o = Y(c).position === "fixed";
|
|
5958
|
+
let r = o ? P(c) : c;
|
|
5959
|
+
for (; X(r) && !U(r); ) {
|
|
5960
|
+
const a = Y(r), h = pt(r);
|
|
5961
|
+
!h && a.position === "fixed" && (s = null), (o ? !h && !s : !h && a.position === "static" && !!s && hi.has(s.position) || tt(r) && !h && jt(c, r)) ? i = i.filter((d) => d !== r) : s = a, r = P(r);
|
|
5962
|
+
}
|
|
5963
|
+
return t.set(c, i), i;
|
|
5769
5964
|
}
|
|
5770
|
-
function di(
|
|
5965
|
+
function di(c) {
|
|
5771
5966
|
let {
|
|
5772
5967
|
element: t,
|
|
5773
5968
|
boundary: e,
|
|
5774
5969
|
rootBoundary: i,
|
|
5775
5970
|
strategy: s
|
|
5776
|
-
} =
|
|
5777
|
-
const r = [...e === "clippingAncestors" ? nt(t) ? [] :
|
|
5778
|
-
const f =
|
|
5779
|
-
return
|
|
5780
|
-
},
|
|
5971
|
+
} = c;
|
|
5972
|
+
const r = [...e === "clippingAncestors" ? nt(t) ? [] : ci(t, this._c) : [].concat(e), i], a = r[0], h = r.reduce((l, d) => {
|
|
5973
|
+
const f = Mt(t, d, s);
|
|
5974
|
+
return l.top = $(f.top, l.top), l.right = j(f.right, l.right), l.bottom = j(f.bottom, l.bottom), l.left = $(f.left, l.left), l;
|
|
5975
|
+
}, Mt(t, a, s));
|
|
5781
5976
|
return {
|
|
5782
|
-
width:
|
|
5783
|
-
height:
|
|
5784
|
-
x:
|
|
5785
|
-
y:
|
|
5977
|
+
width: h.right - h.left,
|
|
5978
|
+
height: h.bottom - h.top,
|
|
5979
|
+
x: h.left,
|
|
5980
|
+
y: h.top
|
|
5786
5981
|
};
|
|
5787
5982
|
}
|
|
5788
|
-
function fi(
|
|
5983
|
+
function fi(c) {
|
|
5789
5984
|
const {
|
|
5790
5985
|
width: t,
|
|
5791
5986
|
height: e
|
|
5792
|
-
} = $t(
|
|
5987
|
+
} = $t(c);
|
|
5793
5988
|
return {
|
|
5794
5989
|
width: t,
|
|
5795
5990
|
height: e
|
|
5796
5991
|
};
|
|
5797
5992
|
}
|
|
5798
|
-
function xi(
|
|
5799
|
-
const i =
|
|
5993
|
+
function xi(c, t, e) {
|
|
5994
|
+
const i = K(t), s = W(t), o = e === "fixed", r = q(c, !0, o, t);
|
|
5800
5995
|
let a = {
|
|
5801
5996
|
scrollLeft: 0,
|
|
5802
5997
|
scrollTop: 0
|
|
5803
5998
|
};
|
|
5804
|
-
const
|
|
5805
|
-
function
|
|
5806
|
-
|
|
5999
|
+
const h = B(0);
|
|
6000
|
+
function l() {
|
|
6001
|
+
h.x = yt(s);
|
|
5807
6002
|
}
|
|
5808
6003
|
if (i || !i && !o)
|
|
5809
6004
|
if ((Z(t) !== "body" || tt(s)) && (a = at(t)), i) {
|
|
5810
6005
|
const x = q(t, !0, o, t);
|
|
5811
|
-
|
|
5812
|
-
} else s &&
|
|
5813
|
-
o && !i && s &&
|
|
5814
|
-
const d = s && !i && !o ? Zt(s, a) :
|
|
6006
|
+
h.x = x.x + t.clientLeft, h.y = x.y + t.clientTop;
|
|
6007
|
+
} else s && l();
|
|
6008
|
+
o && !i && s && l();
|
|
6009
|
+
const d = s && !i && !o ? Zt(s, a) : B(0), f = r.left + a.scrollLeft - h.x - d.x, u = r.top + a.scrollTop - h.y - d.y;
|
|
5815
6010
|
return {
|
|
5816
6011
|
x: f,
|
|
5817
6012
|
y: u,
|
|
@@ -5819,39 +6014,39 @@ function xi(l, t, e) {
|
|
|
5819
6014
|
height: r.height
|
|
5820
6015
|
};
|
|
5821
6016
|
}
|
|
5822
|
-
function
|
|
5823
|
-
return
|
|
6017
|
+
function ht(c) {
|
|
6018
|
+
return Y(c).position === "static";
|
|
5824
6019
|
}
|
|
5825
|
-
function At(
|
|
5826
|
-
if (!
|
|
6020
|
+
function At(c, t) {
|
|
6021
|
+
if (!K(c) || Y(c).position === "fixed")
|
|
5827
6022
|
return null;
|
|
5828
6023
|
if (t)
|
|
5829
|
-
return t(
|
|
5830
|
-
let e =
|
|
5831
|
-
return W(
|
|
6024
|
+
return t(c);
|
|
6025
|
+
let e = c.offsetParent;
|
|
6026
|
+
return W(c) === e && (e = e.ownerDocument.body), e;
|
|
5832
6027
|
}
|
|
5833
|
-
function qt(
|
|
5834
|
-
const e =
|
|
5835
|
-
if (nt(
|
|
6028
|
+
function qt(c, t) {
|
|
6029
|
+
const e = H(c);
|
|
6030
|
+
if (nt(c))
|
|
5836
6031
|
return e;
|
|
5837
|
-
if (!
|
|
5838
|
-
let s = P(
|
|
6032
|
+
if (!K(c)) {
|
|
6033
|
+
let s = P(c);
|
|
5839
6034
|
for (; s && !U(s); ) {
|
|
5840
|
-
if (
|
|
6035
|
+
if (X(s) && !ht(s))
|
|
5841
6036
|
return s;
|
|
5842
6037
|
s = P(s);
|
|
5843
6038
|
}
|
|
5844
6039
|
return e;
|
|
5845
6040
|
}
|
|
5846
|
-
let i = At(
|
|
5847
|
-
for (; i && Ze(i) &&
|
|
6041
|
+
let i = At(c, t);
|
|
6042
|
+
for (; i && Ze(i) && ht(i); )
|
|
5848
6043
|
i = At(i, t);
|
|
5849
|
-
return i && U(i) &&
|
|
6044
|
+
return i && U(i) && ht(i) && !pt(i) ? e : i || ti(c) || e;
|
|
5850
6045
|
}
|
|
5851
|
-
const ui = async function(
|
|
5852
|
-
const t = this.getOffsetParent || qt, e = this.getDimensions, i = await e(
|
|
6046
|
+
const ui = async function(c) {
|
|
6047
|
+
const t = this.getOffsetParent || qt, e = this.getDimensions, i = await e(c.floating);
|
|
5853
6048
|
return {
|
|
5854
|
-
reference: xi(
|
|
6049
|
+
reference: xi(c.reference, await t(c.floating), c.strategy),
|
|
5855
6050
|
floating: {
|
|
5856
6051
|
x: 0,
|
|
5857
6052
|
y: 0,
|
|
@@ -5860,8 +6055,8 @@ const ui = async function(l) {
|
|
|
5860
6055
|
}
|
|
5861
6056
|
};
|
|
5862
6057
|
};
|
|
5863
|
-
function gi(
|
|
5864
|
-
return
|
|
6058
|
+
function gi(c) {
|
|
6059
|
+
return Y(c).direction === "rtl";
|
|
5865
6060
|
}
|
|
5866
6061
|
const wi = {
|
|
5867
6062
|
convertOffsetParentRelativeRectToViewportRelativeRect: oi,
|
|
@@ -5872,9 +6067,9 @@ const wi = {
|
|
|
5872
6067
|
getClientRects: ri,
|
|
5873
6068
|
getDimensions: fi,
|
|
5874
6069
|
getScale: G,
|
|
5875
|
-
isElement:
|
|
6070
|
+
isElement: X,
|
|
5876
6071
|
isRTL: gi
|
|
5877
|
-
}, Jt = ze, Qt = $e, te = Fe, mi = We, ee = (
|
|
6072
|
+
}, Jt = ze, Qt = $e, te = Fe, mi = We, ee = (c, t, e) => {
|
|
5878
6073
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
5879
6074
|
platform: wi,
|
|
5880
6075
|
...e
|
|
@@ -5882,12 +6077,12 @@ const wi = {
|
|
|
5882
6077
|
...s.platform,
|
|
5883
6078
|
_c: i
|
|
5884
6079
|
};
|
|
5885
|
-
return Ke(
|
|
6080
|
+
return Ke(c, t, {
|
|
5886
6081
|
...s,
|
|
5887
6082
|
platform: o
|
|
5888
6083
|
});
|
|
5889
6084
|
};
|
|
5890
|
-
let
|
|
6085
|
+
let pi = class {
|
|
5891
6086
|
constructor(t) {
|
|
5892
6087
|
n(this, "ctx");
|
|
5893
6088
|
n(this, "enable", !1);
|
|
@@ -5908,7 +6103,7 @@ let Ei = class {
|
|
|
5908
6103
|
borderRadius: "4px",
|
|
5909
6104
|
fontSize: "12px",
|
|
5910
6105
|
...o
|
|
5911
|
-
},
|
|
6106
|
+
}, h = {
|
|
5912
6107
|
position: "absolute",
|
|
5913
6108
|
width: "10px",
|
|
5914
6109
|
height: "10px",
|
|
@@ -5917,7 +6112,7 @@ let Ei = class {
|
|
|
5917
6112
|
transform: "rotate(45deg)",
|
|
5918
6113
|
zIndex: a.zIndex
|
|
5919
6114
|
};
|
|
5920
|
-
Object.assign(this.arrowEl.style,
|
|
6115
|
+
Object.assign(this.arrowEl.style, h), Object.assign(this.floatingEl.style, a), this.floatingEl.appendChild(this.contentEl), this.floatingEl.appendChild(this.arrowEl), this.ctx.containerElement.appendChild(this.floatingEl), this.init();
|
|
5921
6116
|
}
|
|
5922
6117
|
init() {
|
|
5923
6118
|
this.floatingEl.addEventListener("mouseleave", () => {
|
|
@@ -5966,10 +6161,10 @@ let Ei = class {
|
|
|
5966
6161
|
placement: t.overflowTooltipPlacement,
|
|
5967
6162
|
middleware: [Qt(), te(), Jt(6), mi({ element: this.arrowEl })]
|
|
5968
6163
|
}).then((a) => {
|
|
5969
|
-
const { x:
|
|
6164
|
+
const { x: h, y: l, placement: d, middlewareData: f } = a;
|
|
5970
6165
|
if (Object.assign(this.floatingEl.style, {
|
|
5971
|
-
top: `${
|
|
5972
|
-
left: `${
|
|
6166
|
+
top: `${l}px`,
|
|
6167
|
+
left: `${h}px`
|
|
5973
6168
|
}), f.arrow) {
|
|
5974
6169
|
const u = f.arrow;
|
|
5975
6170
|
["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
@@ -6003,7 +6198,7 @@ let Ei = class {
|
|
|
6003
6198
|
this.contentEl.remove(), this.arrowEl.remove(), this.floatingEl.remove();
|
|
6004
6199
|
}
|
|
6005
6200
|
};
|
|
6006
|
-
class
|
|
6201
|
+
class Ei {
|
|
6007
6202
|
constructor(t) {
|
|
6008
6203
|
n(this, "editorEl");
|
|
6009
6204
|
n(this, "inputEl");
|
|
@@ -6034,15 +6229,15 @@ class pi {
|
|
|
6034
6229
|
return;
|
|
6035
6230
|
if (t.code === "Escape" && this.ctx.editing) {
|
|
6036
6231
|
this.cancel = !0;
|
|
6037
|
-
const { focusCell:
|
|
6038
|
-
|
|
6232
|
+
const { focusCell: h } = this.ctx;
|
|
6233
|
+
h && (this.ctx.emit("setSelectorCell", h), this.cellTarget = h), this.doneEdit();
|
|
6039
6234
|
return;
|
|
6040
6235
|
}
|
|
6041
6236
|
if ((t.altKey || t.metaKey) && t.code === "Enter" && this.ctx.editing && this.inputEl) {
|
|
6042
6237
|
t.preventDefault();
|
|
6043
|
-
const
|
|
6044
|
-
this.inputEl.value =
|
|
6045
|
-
` + d, this.inputEl.selectionStart = this.inputEl.selectionEnd =
|
|
6238
|
+
const h = this.inputEl.selectionStart, l = this.inputEl.value.substring(0, h), d = this.inputEl.value.substring(h);
|
|
6239
|
+
this.inputEl.value = l + `
|
|
6240
|
+
` + d, this.inputEl.selectionStart = this.inputEl.selectionEnd = h + 1, this.autoSize();
|
|
6046
6241
|
return;
|
|
6047
6242
|
}
|
|
6048
6243
|
if (t.code === "Tab" && this.ctx.editing) {
|
|
@@ -6094,11 +6289,7 @@ class pi {
|
|
|
6094
6289
|
"F11",
|
|
6095
6290
|
"F12"
|
|
6096
6291
|
].includes(e) || this.startEdit(!0);
|
|
6097
|
-
}), this.ctx.on("
|
|
6098
|
-
this.cellTarget = t;
|
|
6099
|
-
const { xArr: e, yArr: i } = this.ctx.selector;
|
|
6100
|
-
this.selectorArrStr = JSON.stringify(e) + JSON.stringify(i);
|
|
6101
|
-
}), this.ctx.on("cellClick", (t) => {
|
|
6292
|
+
}), this.ctx.on("cellMouseup", (t) => {
|
|
6102
6293
|
if (this.ctx.adjustPositioning || this.ctx.isPointer || !this.isInSelectorRange(t.rowIndex, t.colIndex))
|
|
6103
6294
|
return;
|
|
6104
6295
|
const { xArr: e, yArr: i } = this.ctx.selector, s = JSON.stringify(e) + JSON.stringify(i);
|
|
@@ -6122,8 +6313,8 @@ class pi {
|
|
|
6122
6313
|
});
|
|
6123
6314
|
}
|
|
6124
6315
|
isInSelectorRange(t, e) {
|
|
6125
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [a,
|
|
6126
|
-
return !(e < o || e > r || t < a || t >
|
|
6316
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [a, h] = s;
|
|
6317
|
+
return !(e < o || e > r || t < a || t > h);
|
|
6127
6318
|
}
|
|
6128
6319
|
initTextEditor() {
|
|
6129
6320
|
this.inputEl = document.createElement("textarea"), this.inputEl.setAttribute("rows", "1"), this.inputEl.addEventListener("input", this.autoSize.bind(this)), this.inputEl.addEventListener("blur", () => {
|
|
@@ -6145,15 +6336,15 @@ class pi {
|
|
|
6145
6336
|
startEditByInput(t, e = !1) {
|
|
6146
6337
|
const i = e ? null : t.getValue(), { editorType: s } = t;
|
|
6147
6338
|
t.update(), this.ctx.config.ENABLE_MERGE_CELL_LINK && t.updateSpanInfo();
|
|
6148
|
-
let { height: o, width: r, drawY: a, drawX:
|
|
6149
|
-
this.drawX =
|
|
6339
|
+
let { height: o, width: r, drawY: a, drawX: h } = t;
|
|
6340
|
+
this.drawX = h, this.drawY = a;
|
|
6150
6341
|
const {
|
|
6151
|
-
config: { CELL_PADDING:
|
|
6342
|
+
config: { CELL_PADDING: l },
|
|
6152
6343
|
header: d
|
|
6153
6344
|
} = this.ctx;
|
|
6154
6345
|
let f = this.ctx.body.visibleHeight;
|
|
6155
6346
|
if (o > f && (o = f), this.editorEl.style.display = "inline-block", this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = `${this.drawY - 1}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text") {
|
|
6156
|
-
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${r - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${r - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${
|
|
6347
|
+
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${r - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${r - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${l}px`, i !== null && (this.inputEl.value = i), this.inputEl.focus({ preventScroll: !0 });
|
|
6157
6348
|
const u = this.inputEl.value.length;
|
|
6158
6349
|
this.inputEl.setSelectionRange(u, u);
|
|
6159
6350
|
} else
|
|
@@ -6172,33 +6363,33 @@ class pi {
|
|
|
6172
6363
|
if (!e)
|
|
6173
6364
|
return;
|
|
6174
6365
|
const i = this.ctx.focusCell;
|
|
6175
|
-
if (!i || ["index", "index-selection", "selection"].includes(i.type) || this.enable ||
|
|
6366
|
+
if (!i || ["index", "index-selection", "selection"].includes(i.type) || this.enable || !(i.isVerticalVisible() && i.isHorizontalVisible()))
|
|
6176
6367
|
return;
|
|
6177
6368
|
const { rowKey: o, key: r, editorType: a } = i;
|
|
6178
6369
|
if (a === "none")
|
|
6179
6370
|
return;
|
|
6180
|
-
const
|
|
6181
|
-
i && !
|
|
6371
|
+
const h = this.ctx.database.getReadonly(o, r);
|
|
6372
|
+
i && !h && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = i, this.startEditByInput(this.cellTarget, t), this.ctx.emit("startEdit", this.cellTarget));
|
|
6182
6373
|
}
|
|
6183
6374
|
editCell(t, e) {
|
|
6184
|
-
const i = this.ctx.body.renderRows.find((
|
|
6375
|
+
const i = this.ctx.body.renderRows.find((l) => l.rowIndex === t);
|
|
6185
6376
|
if (!i)
|
|
6186
6377
|
return;
|
|
6187
|
-
const s = i.cells.find((
|
|
6378
|
+
const s = i.cells.find((l) => l.colIndex === e);
|
|
6188
6379
|
if (!s)
|
|
6189
6380
|
return;
|
|
6190
6381
|
this.ctx.emit("setSelectorCell", s);
|
|
6191
6382
|
const o = this.ctx.focusCell;
|
|
6192
6383
|
if (!o || ["index", "index-selection", "selection"].includes(o.type) || this.enable)
|
|
6193
6384
|
return;
|
|
6194
|
-
const { rowKey: r, key: a } = o,
|
|
6195
|
-
o && !
|
|
6385
|
+
const { rowKey: r, key: a } = o, h = this.ctx.database.getReadonly(r, a);
|
|
6386
|
+
o && !h && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = o, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
6196
6387
|
}
|
|
6197
6388
|
doneEdit() {
|
|
6198
|
-
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.ctx.containerElement.focus({ preventScroll: !0 }), this.editorEl.style.display = "none", this.ctx.emit("
|
|
6389
|
+
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.ctx.containerElement.focus({ preventScroll: !0 }), this.editorEl.style.display = "none", this.ctx.emit("draw"));
|
|
6199
6390
|
}
|
|
6200
6391
|
clearEditor() {
|
|
6201
|
-
this.doneEdit(), this.cellTarget = null, this.selectorArrStr = "", this.ctx.clearSelector(), this.ctx.focusCell = void 0, this.ctx.emit("
|
|
6392
|
+
this.doneEdit(), this.cellTarget = null, this.selectorArrStr = "", this.ctx.clearSelector(), this.ctx.focusCell = void 0, this.ctx.emit("draw");
|
|
6202
6393
|
}
|
|
6203
6394
|
destroy() {
|
|
6204
6395
|
var t;
|
|
@@ -6212,17 +6403,17 @@ class yi {
|
|
|
6212
6403
|
this.ctx = t;
|
|
6213
6404
|
const { EMPTY_TEXT: e, EMPTY_CUSTOM_STYLE: i } = this.ctx.config;
|
|
6214
6405
|
this.ctx.emptyElement ? this.emptyEl = this.ctx.emptyElement : (this.emptyEl = document.createElement("div"), this.emptyEl.innerText = e), this.emptyEl.className = "e-virt-table-empty", this.emptyEl.style.display = "none", this.ctx.containerElement.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: s, headerHeight: o, bodyHeight: r, footerHeight: a }) => {
|
|
6215
|
-
const
|
|
6406
|
+
const h = o + (r + a) / 2, l = {
|
|
6216
6407
|
display: s === "empty" ? "block" : "none",
|
|
6217
6408
|
position: "absolute",
|
|
6218
6409
|
fontSize: "14px",
|
|
6219
6410
|
color: "#666",
|
|
6220
6411
|
left: "50%",
|
|
6221
|
-
top: `${
|
|
6412
|
+
top: `${h}px`,
|
|
6222
6413
|
transform: "translate(-50%, -50%)",
|
|
6223
6414
|
...i
|
|
6224
6415
|
};
|
|
6225
|
-
Object.assign(this.emptyEl.style,
|
|
6416
|
+
Object.assign(this.emptyEl.style, l);
|
|
6226
6417
|
});
|
|
6227
6418
|
}
|
|
6228
6419
|
destroy() {
|
|
@@ -6232,14 +6423,38 @@ class yi {
|
|
|
6232
6423
|
class Ci {
|
|
6233
6424
|
constructor(t) {
|
|
6234
6425
|
n(this, "ctx");
|
|
6235
|
-
this
|
|
6426
|
+
n(this, "observer");
|
|
6427
|
+
this.ctx = t, this.observer = new MutationObserver(
|
|
6428
|
+
xt(() => {
|
|
6429
|
+
const e = this.ctx.overlayerElement.querySelectorAll('[data-auto-height="true"]'), i = /* @__PURE__ */ new Map();
|
|
6430
|
+
e.forEach((r) => {
|
|
6431
|
+
const a = Number(r.getAttribute("data-row-index")), h = Number(r.getAttribute("data-col-index"));
|
|
6432
|
+
if (isNaN(a) || isNaN(h) || !(r instanceof HTMLElement) || r.offsetWidth === 0)
|
|
6433
|
+
return;
|
|
6434
|
+
const l = `${a}_${h}`;
|
|
6435
|
+
i.set(l, Math.round(r.offsetHeight));
|
|
6436
|
+
});
|
|
6437
|
+
const s = this.ctx.database.getOverlayerAutoHeightMap();
|
|
6438
|
+
if (!this.arerMapsEqual(s, i)) {
|
|
6439
|
+
if (this.ctx.database.setOverlayerAutoHeightMap(i), s.size === 0 && i.size === 0)
|
|
6440
|
+
return;
|
|
6441
|
+
this.ctx.emit("draw");
|
|
6442
|
+
}
|
|
6443
|
+
}, 16.67)
|
|
6444
|
+
), this.observer.observe(this.ctx.overlayerElement, { childList: !0, subtree: !0, attributes: !0 });
|
|
6445
|
+
}
|
|
6446
|
+
arerMapsEqual(t, e) {
|
|
6447
|
+
if (t.size !== e.size) return !1;
|
|
6448
|
+
for (let [i, s] of t)
|
|
6449
|
+
if (!e.has(i) || e.get(i) !== s) return !1;
|
|
6450
|
+
return !0;
|
|
6236
6451
|
}
|
|
6237
6452
|
draw() {
|
|
6238
6453
|
const t = this.getContainer();
|
|
6239
6454
|
this.ctx.emit("overlayerChange", t);
|
|
6240
6455
|
}
|
|
6241
6456
|
destroy() {
|
|
6242
|
-
this.ctx.emit("overlayerChange", {
|
|
6457
|
+
this.observer && this.observer.disconnect(), this.ctx.emit("overlayerChange", {
|
|
6243
6458
|
style: {},
|
|
6244
6459
|
views: []
|
|
6245
6460
|
});
|
|
@@ -6258,9 +6473,9 @@ class Ci {
|
|
|
6258
6473
|
fixedRightWidth: e,
|
|
6259
6474
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
6260
6475
|
} = this.ctx, { visibleWidth: o, visibleHeight: r, renderCellHeaders: a } = this.ctx.header;
|
|
6261
|
-
let
|
|
6476
|
+
let h = [], l = [], d = [];
|
|
6262
6477
|
a.forEach((g) => {
|
|
6263
|
-
g.render && (g.fixed === "left" ?
|
|
6478
|
+
g.render && (g.fixed === "left" ? l.push(g) : g.fixed === "right" ? d.push(g) : h.push(g));
|
|
6264
6479
|
});
|
|
6265
6480
|
const f = e - i, u = {
|
|
6266
6481
|
key: "left",
|
|
@@ -6272,7 +6487,7 @@ class Ci {
|
|
|
6272
6487
|
width: `${t}px`,
|
|
6273
6488
|
height: `${r}px`
|
|
6274
6489
|
},
|
|
6275
|
-
cells:
|
|
6490
|
+
cells: l
|
|
6276
6491
|
}, x = {
|
|
6277
6492
|
key: "center",
|
|
6278
6493
|
style: {
|
|
@@ -6283,7 +6498,7 @@ class Ci {
|
|
|
6283
6498
|
width: `${o - t - f + 1}px`,
|
|
6284
6499
|
height: `${r}px`
|
|
6285
6500
|
},
|
|
6286
|
-
cells:
|
|
6501
|
+
cells: h
|
|
6287
6502
|
}, w = {
|
|
6288
6503
|
key: "right",
|
|
6289
6504
|
style: {
|
|
@@ -6312,15 +6527,15 @@ class Ci {
|
|
|
6312
6527
|
const t = [], e = [], i = [];
|
|
6313
6528
|
let s = this.ctx.body.renderRows;
|
|
6314
6529
|
this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((g) => {
|
|
6315
|
-
g.cells.forEach((
|
|
6316
|
-
|
|
6530
|
+
g.cells.forEach((p) => {
|
|
6531
|
+
p.cellType === "footer" && (p.render = p.renderFooter), p.render && (p.fixed === "left" ? e.push(p) : p.fixed === "right" ? i.push(p) : t.push(p));
|
|
6317
6532
|
});
|
|
6318
6533
|
});
|
|
6319
6534
|
const {
|
|
6320
6535
|
fixedLeftWidth: o,
|
|
6321
6536
|
fixedRightWidth: r,
|
|
6322
|
-
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX:
|
|
6323
|
-
} = this.ctx, { visibleWidth:
|
|
6537
|
+
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX: h }
|
|
6538
|
+
} = this.ctx, { visibleWidth: l, visibleHeight: d } = this.ctx.body, f = r - a, u = {
|
|
6324
6539
|
key: "left",
|
|
6325
6540
|
style: {
|
|
6326
6541
|
position: "absolute",
|
|
@@ -6338,7 +6553,7 @@ class Ci {
|
|
|
6338
6553
|
top: `${0.5}px`,
|
|
6339
6554
|
left: `${o - 0.5}px`,
|
|
6340
6555
|
overflow: "hidden",
|
|
6341
|
-
width: `${
|
|
6556
|
+
width: `${l - o - f}px`,
|
|
6342
6557
|
height: `${d}px`
|
|
6343
6558
|
},
|
|
6344
6559
|
cells: t
|
|
@@ -6356,11 +6571,11 @@ class Ci {
|
|
|
6356
6571
|
};
|
|
6357
6572
|
return {
|
|
6358
6573
|
type: "body",
|
|
6359
|
-
class: `${
|
|
6574
|
+
class: `${h}-overlayer-body`,
|
|
6360
6575
|
style: {
|
|
6361
6576
|
position: "relative",
|
|
6362
6577
|
overflow: "hidden",
|
|
6363
|
-
width: `${
|
|
6578
|
+
width: `${l}px`,
|
|
6364
6579
|
height: `${d}px`
|
|
6365
6580
|
},
|
|
6366
6581
|
views: [u, x, w]
|
|
@@ -6377,7 +6592,7 @@ class Ci {
|
|
|
6377
6592
|
fixedLeftWidth: s,
|
|
6378
6593
|
fixedRightWidth: o,
|
|
6379
6594
|
config: { SCROLLER_TRACK_SIZE: r, CSS_PREFIX: a }
|
|
6380
|
-
} = this.ctx, { visibleWidth:
|
|
6595
|
+
} = this.ctx, { visibleWidth: h, visibleHeight: l } = this.ctx.footer, d = o - r, f = {
|
|
6381
6596
|
key: "left",
|
|
6382
6597
|
style: {
|
|
6383
6598
|
position: "absolute",
|
|
@@ -6385,7 +6600,7 @@ class Ci {
|
|
|
6385
6600
|
left: `${0.5}px`,
|
|
6386
6601
|
overflow: "hidden",
|
|
6387
6602
|
width: `${s}px`,
|
|
6388
|
-
height: `${
|
|
6603
|
+
height: `${l}px`
|
|
6389
6604
|
},
|
|
6390
6605
|
cells: e
|
|
6391
6606
|
}, u = {
|
|
@@ -6395,8 +6610,8 @@ class Ci {
|
|
|
6395
6610
|
top: `${0.5}px`,
|
|
6396
6611
|
left: `${s - 0.5}px`,
|
|
6397
6612
|
overflow: "hidden",
|
|
6398
|
-
width: `${
|
|
6399
|
-
height: `${
|
|
6613
|
+
width: `${h - s - d}px`,
|
|
6614
|
+
height: `${l}px`
|
|
6400
6615
|
},
|
|
6401
6616
|
cells: t
|
|
6402
6617
|
}, x = {
|
|
@@ -6407,7 +6622,7 @@ class Ci {
|
|
|
6407
6622
|
right: `${0.5}px`,
|
|
6408
6623
|
overflow: "hidden",
|
|
6409
6624
|
width: `${d}px`,
|
|
6410
|
-
height: `${
|
|
6625
|
+
height: `${l}px`
|
|
6411
6626
|
},
|
|
6412
6627
|
cells: i
|
|
6413
6628
|
};
|
|
@@ -6417,8 +6632,8 @@ class Ci {
|
|
|
6417
6632
|
style: {
|
|
6418
6633
|
position: "relative",
|
|
6419
6634
|
overflow: "hidden",
|
|
6420
|
-
width: `${
|
|
6421
|
-
height: `${
|
|
6635
|
+
width: `${h}px`,
|
|
6636
|
+
height: `${l}px`
|
|
6422
6637
|
},
|
|
6423
6638
|
views: [f, u, x]
|
|
6424
6639
|
};
|
|
@@ -6435,8 +6650,8 @@ class bi {
|
|
|
6435
6650
|
this.ctx.on("cellContextMenuClick", (t, e) => {
|
|
6436
6651
|
if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
|
|
6437
6652
|
e.preventDefault();
|
|
6438
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [a,
|
|
6439
|
-
|
|
6653
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [a, h] = s, { rowIndex: l, colIndex: d } = t;
|
|
6654
|
+
l >= a && l <= h && d >= o && d <= r || this.ctx.emit("setSelectorCell", t, e);
|
|
6440
6655
|
const u = {
|
|
6441
6656
|
getBoundingClientRect: () => ({
|
|
6442
6657
|
width: 0,
|
|
@@ -6510,7 +6725,7 @@ class bi {
|
|
|
6510
6725
|
this.contextMenuEl.remove();
|
|
6511
6726
|
}
|
|
6512
6727
|
}
|
|
6513
|
-
class
|
|
6728
|
+
class vi {
|
|
6514
6729
|
constructor(t, e) {
|
|
6515
6730
|
n(this, "options");
|
|
6516
6731
|
n(this, "scroller");
|
|
@@ -6533,7 +6748,7 @@ class Si {
|
|
|
6533
6748
|
o,
|
|
6534
6749
|
r
|
|
6535
6750
|
);
|
|
6536
|
-
this.ctx = new
|
|
6751
|
+
this.ctx = new Re(a, this.options), this.header = new ve(this.ctx), this.footer = new _e(this.ctx), this.body = new Se(this.ctx), this.scroller = new Ie(this.ctx), this.selector = new Te(this.ctx), this.autofill = new Oe(this.ctx), this.tooltip = new pi(this.ctx), this.empty = new yi(this.ctx), this.editor = new Ei(this.ctx), this.overlayer = new Ci(this.ctx), this.contextMenu = new bi(this.ctx), this.ctx.on("draw", () => {
|
|
6537
6752
|
this.draw();
|
|
6538
6753
|
}), this.ctx.on("drawView", () => {
|
|
6539
6754
|
this.draw(!0);
|
|
@@ -6541,24 +6756,24 @@ class Si {
|
|
|
6541
6756
|
}
|
|
6542
6757
|
createContainer(t, e, i, s, o) {
|
|
6543
6758
|
t.className = "e-virt-table-container";
|
|
6544
|
-
const r = document.createElement("div"), a = document.createElement("canvas"),
|
|
6545
|
-
r.className = "e-virt-table-stage", t.tabIndex = 0, a.className = "e-virt-table-canvas",
|
|
6546
|
-
const
|
|
6547
|
-
|
|
6759
|
+
const r = document.createElement("div"), a = document.createElement("canvas"), h = e || document.createElement("div");
|
|
6760
|
+
r.className = "e-virt-table-stage", t.tabIndex = 0, a.className = "e-virt-table-canvas", h.className = "e-virt-table-overlayer";
|
|
6761
|
+
const l = i || document.createElement("div");
|
|
6762
|
+
l.className = "e-virt-table-editor";
|
|
6548
6763
|
const d = s, f = o;
|
|
6549
|
-
return r.appendChild(a), r.appendChild(
|
|
6764
|
+
return r.appendChild(a), r.appendChild(h), t.appendChild(r), {
|
|
6550
6765
|
containerElement: t,
|
|
6551
6766
|
stageElement: r,
|
|
6552
6767
|
canvasElement: a,
|
|
6553
|
-
overlayerElement:
|
|
6554
|
-
editorElement:
|
|
6768
|
+
overlayerElement: h,
|
|
6769
|
+
editorElement: l,
|
|
6555
6770
|
emptyElement: d,
|
|
6556
6771
|
contextMenuElement: f
|
|
6557
6772
|
};
|
|
6558
6773
|
}
|
|
6559
6774
|
draw(t = !1) {
|
|
6560
6775
|
requestAnimationFrame(() => {
|
|
6561
|
-
this.header.update(), this.footer.update(), this.body.update(), this.ctx.paint.clear(), this.body.draw(), this.footer.draw(), this.header.draw(), this.scroller.draw(), t || this.overlayer.draw();
|
|
6776
|
+
this.header.update(), this.footer.update(), this.body.update(), this.ctx.paint.clear(), this.body.draw(), this.footer.draw(), this.header.draw(), this.scroller.draw(), t || this.overlayer.draw(), this.body.updateAutoHeight();
|
|
6562
6777
|
});
|
|
6563
6778
|
}
|
|
6564
6779
|
loadConfig(t) {
|
|
@@ -6638,15 +6853,15 @@ class Si {
|
|
|
6638
6853
|
return new Promise(async (i, s) => {
|
|
6639
6854
|
let o = [];
|
|
6640
6855
|
for (let r = 0; r < t.length; r++) {
|
|
6641
|
-
const { rowKey: a, key:
|
|
6642
|
-
Array.isArray(
|
|
6856
|
+
const { rowKey: a, key: h } = t[r], l = await this.ctx.database.getValidator(a, h);
|
|
6857
|
+
Array.isArray(l) && l.length && o.push(l);
|
|
6643
6858
|
}
|
|
6644
6859
|
if (o.length) {
|
|
6645
6860
|
if (s(o), e) {
|
|
6646
6861
|
const [r] = o;
|
|
6647
6862
|
if (Array.isArray(r) && r.length) {
|
|
6648
|
-
const [a] = r, { rowKey:
|
|
6649
|
-
this.scrollToRowkey(
|
|
6863
|
+
const [a] = r, { rowKey: h, key: l } = a;
|
|
6864
|
+
this.scrollToRowkey(h), this.scrollToColkey(l);
|
|
6650
6865
|
}
|
|
6651
6866
|
}
|
|
6652
6867
|
this.ctx.emit("draw");
|
|
@@ -6663,12 +6878,12 @@ class Si {
|
|
|
6663
6878
|
if (t && Array.isArray(s) && s.length) {
|
|
6664
6879
|
const [o] = s;
|
|
6665
6880
|
if (Array.isArray(o) && o.length) {
|
|
6666
|
-
const [r] = o, { rowKey: a, key:
|
|
6667
|
-
if (
|
|
6668
|
-
const { parentRowKeys: d = [] } =
|
|
6881
|
+
const [r] = o, { rowKey: a, key: h } = r, l = this.ctx.database.getRowForRowKey(a);
|
|
6882
|
+
if (l) {
|
|
6883
|
+
const { parentRowKeys: d = [] } = l;
|
|
6669
6884
|
d && d.length && this.setExpandRowKeys(d, !0);
|
|
6670
6885
|
}
|
|
6671
|
-
this.scrollToRowkey(a), this.scrollToColkey(
|
|
6886
|
+
this.scrollToRowkey(a), this.scrollToColkey(h);
|
|
6672
6887
|
}
|
|
6673
6888
|
}
|
|
6674
6889
|
i(s);
|
|
@@ -6693,7 +6908,7 @@ class Si {
|
|
|
6693
6908
|
let o = [];
|
|
6694
6909
|
for (let r = 0; r < i.length; r++)
|
|
6695
6910
|
for (let a = 0; a < s.length; a++) {
|
|
6696
|
-
const
|
|
6911
|
+
const h = this.ctx.database.getRowKeyByItem(i[r]), d = s[a].key, f = await this.ctx.database.getValidator(h, d);
|
|
6697
6912
|
Array.isArray(f) && f.length && o.push(f);
|
|
6698
6913
|
}
|
|
6699
6914
|
o.length ? (e(o), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
|
|
@@ -6777,7 +6992,7 @@ class Si {
|
|
|
6777
6992
|
getUtils() {
|
|
6778
6993
|
return {
|
|
6779
6994
|
mergeColCell: de,
|
|
6780
|
-
mergeRowCell:
|
|
6995
|
+
mergeRowCell: ce,
|
|
6781
6996
|
getSpanArrByRow: kt,
|
|
6782
6997
|
getSpanObjByColumn: Xt
|
|
6783
6998
|
};
|
|
@@ -6794,6 +7009,6 @@ class Si {
|
|
|
6794
7009
|
}
|
|
6795
7010
|
}
|
|
6796
7011
|
export {
|
|
6797
|
-
|
|
7012
|
+
vi as default
|
|
6798
7013
|
};
|
|
6799
7014
|
//# sourceMappingURL=index.es.js.map
|