e-virt-table 0.0.9 → 0.0.11
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 +5 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +980 -929
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Autofill.d.ts +1 -1
- package/dist/lib/Autofill.js +30 -18
- package/dist/lib/Autofill.js.map +1 -1
- package/dist/lib/Cell.d.ts +1 -0
- package/dist/lib/Cell.js +7 -0
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/CellHeader.d.ts +1 -0
- package/dist/lib/CellHeader.js +7 -0
- package/dist/lib/CellHeader.js.map +1 -1
- package/dist/lib/Config.d.ts +4 -0
- package/dist/lib/Config.js +24 -0
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Editor.js +1 -0
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/Header.js +0 -1
- package/dist/lib/Header.js.map +1 -1
- package/dist/lib/Selector.js +38 -27
- package/dist/lib/Selector.js.map +1 -1
- package/dist/lib/types.d.ts +1 -0
- package/dist/lib/util.d.ts +15 -1
- package/dist/lib/util.js +114 -1
- package/dist/lib/util.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(':root{--e-virt-table-color-white: #fff;--e-virt-table-color-black: #000000;--e-virt-table-color-primary: rgb(82, 146, 247);--e-virt-table-text-color-primary: "#333";--e-virt-table-text-color-regular: "#666";--e-virt-table-text-color-secondary: "#999";--e-virt-table-box-shadow: 0 2px 12px 0 #0000001a;--e-virt-table-editor-bg-color: #fff}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;line-height:0;z-index:100;overflow:hidden;background-color:var(--e-virt-table-editor-bg-color);border:2px solid var(--e-virt-table-color-primary);box-sizing:border-box;box-shadow:var(--e-virt-table-box-shadow);pointer-events:auto;display:flex;align-items:center}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--e-virt-table-text-color-regular);background-color:var(--e-virt-table-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--e-virt-table-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}.e-virt-table-context-menu-item:hover{color:var(--e-virt-table-color-primary);background-color:#f5f7fa}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var c = (a, t, e) =>
|
|
2
|
+
var me = Object.defineProperty;
|
|
3
|
+
var Ee = (a, t, e) => t in a ? me(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
4
|
+
var c = (a, t, e) => Ee(a, typeof t != "symbol" ? t + "" : t, e);
|
|
5
5
|
function $() {
|
|
6
6
|
return $ = Object.assign ? Object.assign.bind() : function(a) {
|
|
7
7
|
for (var t = 1; t < arguments.length; t++) {
|
|
@@ -12,7 +12,7 @@ function $() {
|
|
|
12
12
|
return a;
|
|
13
13
|
}, $.apply(this, arguments);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function be(a, t) {
|
|
16
16
|
a.prototype = Object.create(t.prototype), a.prototype.constructor = a, st(a, t);
|
|
17
17
|
}
|
|
18
18
|
function Et(a) {
|
|
@@ -25,7 +25,7 @@ function st(a, t) {
|
|
|
25
25
|
return i.__proto__ = s, i;
|
|
26
26
|
}, st(a, t);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Ce() {
|
|
29
29
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
30
30
|
if (typeof Proxy == "function") return !0;
|
|
31
31
|
try {
|
|
@@ -36,20 +36,20 @@ function Ee() {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
function dt(a, t, e) {
|
|
39
|
-
return
|
|
39
|
+
return Ce() ? dt = Reflect.construct.bind() : dt = function(s, o, r) {
|
|
40
40
|
var n = [null];
|
|
41
|
-
n.push.apply(n,
|
|
41
|
+
n.push.apply(n, o);
|
|
42
42
|
var l = Function.bind.apply(s, n), h = new l();
|
|
43
|
-
return
|
|
43
|
+
return r && st(h, r.prototype), h;
|
|
44
44
|
}, dt.apply(null, arguments);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function ve(a) {
|
|
47
47
|
return Function.toString.call(a).indexOf("[native code]") !== -1;
|
|
48
48
|
}
|
|
49
49
|
function bt(a) {
|
|
50
50
|
var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
51
51
|
return bt = function(i) {
|
|
52
|
-
if (i === null || !
|
|
52
|
+
if (i === null || !ve(i)) return i;
|
|
53
53
|
if (typeof i != "function")
|
|
54
54
|
throw new TypeError("Super expression must either be null or a function");
|
|
55
55
|
if (typeof t < "u") {
|
|
@@ -69,9 +69,9 @@ function bt(a) {
|
|
|
69
69
|
}), st(s, i);
|
|
70
70
|
}, bt(a);
|
|
71
71
|
}
|
|
72
|
-
var
|
|
72
|
+
var Re = /%[sdj%]/g, jt = function() {
|
|
73
73
|
};
|
|
74
|
-
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (
|
|
74
|
+
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (jt = function(t, e) {
|
|
75
75
|
typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && e.every(function(i) {
|
|
76
76
|
return typeof i == "string";
|
|
77
77
|
}) && console.warn(t, e);
|
|
@@ -84,17 +84,17 @@ function Ct(a) {
|
|
|
84
84
|
t[i] = t[i] || [], t[i].push(e);
|
|
85
85
|
}), t;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function M(a) {
|
|
88
88
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
|
|
89
89
|
e[i - 1] = arguments[i];
|
|
90
|
-
var s = 0,
|
|
90
|
+
var s = 0, o = e.length;
|
|
91
91
|
if (typeof a == "function")
|
|
92
92
|
return a.apply(null, e);
|
|
93
93
|
if (typeof a == "string") {
|
|
94
|
-
var
|
|
94
|
+
var r = a.replace(Re, function(n) {
|
|
95
95
|
if (n === "%%")
|
|
96
96
|
return "%";
|
|
97
|
-
if (s >=
|
|
97
|
+
if (s >= o)
|
|
98
98
|
return n;
|
|
99
99
|
switch (n) {
|
|
100
100
|
case "%s":
|
|
@@ -112,81 +112,81 @@ function H(a) {
|
|
|
112
112
|
return n;
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
|
-
return
|
|
115
|
+
return r;
|
|
116
116
|
}
|
|
117
117
|
return a;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function Ie(a) {
|
|
120
120
|
return a === "string" || a === "url" || a === "hex" || a === "email" || a === "date" || a === "pattern";
|
|
121
121
|
}
|
|
122
122
|
function I(a, t) {
|
|
123
|
-
return !!(a == null || t === "array" && Array.isArray(a) && !a.length ||
|
|
123
|
+
return !!(a == null || t === "array" && Array.isArray(a) && !a.length || Ie(t) && typeof a == "string" && !a);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
var i = [], s = 0,
|
|
127
|
-
function
|
|
128
|
-
i.push.apply(i, n || []), s++, s ===
|
|
125
|
+
function _e(a, t, e) {
|
|
126
|
+
var i = [], s = 0, o = a.length;
|
|
127
|
+
function r(n) {
|
|
128
|
+
i.push.apply(i, n || []), s++, s === o && e(i);
|
|
129
129
|
}
|
|
130
130
|
a.forEach(function(n) {
|
|
131
|
-
t(n,
|
|
131
|
+
t(n, r);
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function kt(a, t, e) {
|
|
135
135
|
var i = 0, s = a.length;
|
|
136
|
-
function r
|
|
137
|
-
if (
|
|
138
|
-
e(
|
|
136
|
+
function o(r) {
|
|
137
|
+
if (r && r.length) {
|
|
138
|
+
e(r);
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
141
|
var n = i;
|
|
142
|
-
i = i + 1, n < s ? t(a[n],
|
|
142
|
+
i = i + 1, n < s ? t(a[n], o) : e([]);
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
o([]);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Oe(a) {
|
|
147
147
|
var t = [];
|
|
148
148
|
return Object.keys(a).forEach(function(e) {
|
|
149
149
|
t.push.apply(t, a[e] || []);
|
|
150
150
|
}), t;
|
|
151
151
|
}
|
|
152
|
-
var
|
|
153
|
-
|
|
152
|
+
var Ft = /* @__PURE__ */ function(a) {
|
|
153
|
+
be(t, a);
|
|
154
154
|
function t(e, i) {
|
|
155
155
|
var s;
|
|
156
156
|
return s = a.call(this, "Async Validation Error") || this, s.errors = e, s.fields = i, s;
|
|
157
157
|
}
|
|
158
158
|
return t;
|
|
159
159
|
}(/* @__PURE__ */ bt(Error));
|
|
160
|
-
function
|
|
160
|
+
function Se(a, t, e, i, s) {
|
|
161
161
|
if (t.first) {
|
|
162
|
-
var
|
|
162
|
+
var o = new Promise(function(x, u) {
|
|
163
163
|
var y = function(p) {
|
|
164
|
-
return i(p), p.length ? u(new
|
|
165
|
-
}, g =
|
|
166
|
-
|
|
164
|
+
return i(p), p.length ? u(new Ft(p, Ct(p))) : x(s);
|
|
165
|
+
}, g = Oe(a);
|
|
166
|
+
kt(g, e, y);
|
|
167
167
|
});
|
|
168
|
-
return
|
|
168
|
+
return o.catch(function(x) {
|
|
169
169
|
return x;
|
|
170
|
-
}),
|
|
170
|
+
}), o;
|
|
171
171
|
}
|
|
172
|
-
var
|
|
172
|
+
var r = t.firstFields === !0 ? Object.keys(a) : t.firstFields || [], n = Object.keys(a), l = n.length, h = 0, f = [], d = new Promise(function(x, u) {
|
|
173
173
|
var y = function(w) {
|
|
174
174
|
if (f.push.apply(f, w), h++, h === l)
|
|
175
|
-
return i(f), f.length ? u(new
|
|
175
|
+
return i(f), f.length ? u(new Ft(f, Ct(f))) : x(s);
|
|
176
176
|
};
|
|
177
177
|
n.length || (i(f), x(s)), n.forEach(function(g) {
|
|
178
178
|
var w = a[g];
|
|
179
|
-
|
|
179
|
+
r.indexOf(g) !== -1 ? kt(w, e, y) : _e(w, e, y);
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
182
|
return d.catch(function(x) {
|
|
183
183
|
return x;
|
|
184
184
|
}), d;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function Te(a) {
|
|
187
187
|
return !!(a && a.message !== void 0);
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function Le(a, t) {
|
|
190
190
|
for (var e = a, i = 0; i < t.length; i++) {
|
|
191
191
|
if (e == null)
|
|
192
192
|
return e;
|
|
@@ -197,14 +197,14 @@ function Se(a, t) {
|
|
|
197
197
|
function Nt(a, t) {
|
|
198
198
|
return function(e) {
|
|
199
199
|
var i;
|
|
200
|
-
return a.fullFields ? i =
|
|
200
|
+
return a.fullFields ? i = Le(t, a.fullFields) : i = t[e.field || a.fullField], Te(e) ? (e.field = e.field || a.fullField, e.fieldValue = i, e) : {
|
|
201
201
|
message: typeof e == "function" ? e() : e,
|
|
202
202
|
fieldValue: i,
|
|
203
203
|
field: e.field || a.fullField
|
|
204
204
|
};
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Yt(a, t) {
|
|
208
208
|
if (t) {
|
|
209
209
|
for (var e in t)
|
|
210
210
|
if (t.hasOwnProperty(e)) {
|
|
@@ -214,11 +214,11 @@ function Kt(a, t) {
|
|
|
214
214
|
}
|
|
215
215
|
return a;
|
|
216
216
|
}
|
|
217
|
-
var
|
|
218
|
-
t.required && (!i.hasOwnProperty(t.field) || I(e,
|
|
219
|
-
},
|
|
220
|
-
(/^\s+$/.test(e) || e === "") && s.push(
|
|
221
|
-
}, ht,
|
|
217
|
+
var Ut = function(t, e, i, s, o, r) {
|
|
218
|
+
t.required && (!i.hasOwnProperty(t.field) || I(e, r || t.type)) && s.push(M(o.messages.required, t.fullField));
|
|
219
|
+
}, Ae = function(t, e, i, s, o) {
|
|
220
|
+
(/^\s+$/.test(e) || e === "") && s.push(M(o.messages.whitespace, t.fullField));
|
|
221
|
+
}, ht, Me = function() {
|
|
222
222
|
if (ht)
|
|
223
223
|
return ht;
|
|
224
224
|
var a = "[a-fA-F\\d:]", t = function(b) {
|
|
@@ -234,17 +234,17 @@ var Gt = function(t, e, i, s, r, o) {
|
|
|
234
234
|
(?:` + i + ":){1}(?:(?::" + i + "){0,4}:" + e + "|(?::" + i + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
235
235
|
(?::(?:(?::` + i + "){0,5}:" + e + "|(?::" + i + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
236
236
|
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
237
|
-
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(),
|
|
238
|
-
return b && b.exact ?
|
|
237
|
+
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), o = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), r = new RegExp("^" + e + "$"), n = new RegExp("^" + s + "$"), l = function(b) {
|
|
238
|
+
return b && b.exact ? o : new RegExp("(?:" + t(b) + e + t(b) + ")|(?:" + t(b) + s + t(b) + ")", "g");
|
|
239
239
|
};
|
|
240
240
|
l.v4 = function(m) {
|
|
241
|
-
return m && m.exact ?
|
|
241
|
+
return m && m.exact ? r : new RegExp("" + t(m) + e + t(m), "g");
|
|
242
242
|
}, l.v6 = function(m) {
|
|
243
243
|
return m && m.exact ? n : new RegExp("" + t(m) + s + t(m), "g");
|
|
244
244
|
};
|
|
245
245
|
var h = "(?:(?:[a-z]+:)?//)", f = "(?:\\S+(?::\\S*)?@)?", d = l.v4().source, x = l.v6().source, u = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", y = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", g = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", p = '(?:[/?#][^\\s"]*)?', E = "(?:" + h + "|www\\.)" + f + "(?:localhost|" + d + "|" + x + "|" + u + y + g + ")" + w + p;
|
|
246
246
|
return ht = new RegExp("(?:^" + E + "$)", "i"), ht;
|
|
247
|
-
},
|
|
247
|
+
}, Kt = {
|
|
248
248
|
// http://emailregex.com/
|
|
249
249
|
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
|
|
250
250
|
// url: new RegExp(
|
|
@@ -284,180 +284,180 @@ var Gt = function(t, e, i, s, r, o) {
|
|
|
284
284
|
return typeof t == "function";
|
|
285
285
|
},
|
|
286
286
|
email: function(t) {
|
|
287
|
-
return typeof t == "string" && t.length <= 320 && !!t.match(
|
|
287
|
+
return typeof t == "string" && t.length <= 320 && !!t.match(Kt.email);
|
|
288
288
|
},
|
|
289
289
|
url: function(t) {
|
|
290
|
-
return typeof t == "string" && t.length <= 2048 && !!t.match(
|
|
290
|
+
return typeof t == "string" && t.length <= 2048 && !!t.match(Me());
|
|
291
291
|
},
|
|
292
292
|
hex: function(t) {
|
|
293
|
-
return typeof t == "string" && !!t.match(
|
|
293
|
+
return typeof t == "string" && !!t.match(Kt.hex);
|
|
294
294
|
}
|
|
295
|
-
},
|
|
295
|
+
}, He = function(t, e, i, s, o) {
|
|
296
296
|
if (t.required && e === void 0) {
|
|
297
|
-
|
|
297
|
+
Ut(t, e, i, s, o);
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
|
-
var
|
|
301
|
-
|
|
302
|
-
},
|
|
303
|
-
var
|
|
300
|
+
var r = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], n = t.type;
|
|
301
|
+
r.indexOf(n) > -1 ? et[n](e) || s.push(M(o.messages.types[n], t.fullField, t.type)) : n && typeof e !== t.type && s.push(M(o.messages.types[n], t.fullField, t.type));
|
|
302
|
+
}, De = function(t, e, i, s, o) {
|
|
303
|
+
var r = typeof t.len == "number", n = typeof t.min == "number", l = typeof t.max == "number", h = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, f = e, d = null, x = typeof e == "number", u = typeof e == "string", y = Array.isArray(e);
|
|
304
304
|
if (x ? d = "number" : u ? d = "string" : y && (d = "array"), !d)
|
|
305
305
|
return !1;
|
|
306
|
-
y && (f = e.length), u && (f = e.replace(h, "_").length),
|
|
307
|
-
}, j = "enum",
|
|
308
|
-
t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(
|
|
309
|
-
},
|
|
306
|
+
y && (f = e.length), u && (f = e.replace(h, "_").length), r ? f !== t.len && s.push(M(o.messages[d].len, t.fullField, t.len)) : n && !l && f < t.min ? s.push(M(o.messages[d].min, t.fullField, t.min)) : l && !n && f > t.max ? s.push(M(o.messages[d].max, t.fullField, t.max)) : n && l && (f < t.min || f > t.max) && s.push(M(o.messages[d].range, t.fullField, t.min, t.max));
|
|
307
|
+
}, j = "enum", Xe = function(t, e, i, s, o) {
|
|
308
|
+
t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(M(o.messages[j], t.fullField, t[j].join(", ")));
|
|
309
|
+
}, ke = function(t, e, i, s, o) {
|
|
310
310
|
if (t.pattern) {
|
|
311
311
|
if (t.pattern instanceof RegExp)
|
|
312
|
-
t.pattern.lastIndex = 0, t.pattern.test(e) || s.push(
|
|
312
|
+
t.pattern.lastIndex = 0, t.pattern.test(e) || s.push(M(o.messages.pattern.mismatch, t.fullField, e, t.pattern));
|
|
313
313
|
else if (typeof t.pattern == "string") {
|
|
314
|
-
var
|
|
315
|
-
|
|
314
|
+
var r = new RegExp(t.pattern);
|
|
315
|
+
r.test(e) || s.push(M(o.messages.pattern.mismatch, t.fullField, e, t.pattern));
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}, v = {
|
|
319
|
-
required:
|
|
320
|
-
whitespace:
|
|
321
|
-
type:
|
|
322
|
-
range:
|
|
323
|
-
enum:
|
|
324
|
-
pattern:
|
|
325
|
-
},
|
|
326
|
-
var
|
|
319
|
+
required: Ut,
|
|
320
|
+
whitespace: Ae,
|
|
321
|
+
type: He,
|
|
322
|
+
range: De,
|
|
323
|
+
enum: Xe,
|
|
324
|
+
pattern: ke
|
|
325
|
+
}, Fe = function(t, e, i, s, o) {
|
|
326
|
+
var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
327
327
|
if (n) {
|
|
328
328
|
if (I(e, "string") && !t.required)
|
|
329
329
|
return i();
|
|
330
|
-
v.required(t, e, s,
|
|
330
|
+
v.required(t, e, s, r, o, "string"), I(e, "string") || (v.type(t, e, s, r, o), v.range(t, e, s, r, o), v.pattern(t, e, s, r, o), t.whitespace === !0 && v.whitespace(t, e, s, r, o));
|
|
331
331
|
}
|
|
332
|
-
i(
|
|
333
|
-
},
|
|
334
|
-
var
|
|
332
|
+
i(r);
|
|
333
|
+
}, Ne = function(t, e, i, s, o) {
|
|
334
|
+
var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
335
335
|
if (n) {
|
|
336
336
|
if (I(e) && !t.required)
|
|
337
337
|
return i();
|
|
338
|
-
v.required(t, e, s,
|
|
338
|
+
v.required(t, e, s, r, o), e !== void 0 && v.type(t, e, s, r, o);
|
|
339
339
|
}
|
|
340
|
-
i(
|
|
341
|
-
},
|
|
342
|
-
var
|
|
340
|
+
i(r);
|
|
341
|
+
}, Ye = function(t, e, i, s, o) {
|
|
342
|
+
var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
343
343
|
if (n) {
|
|
344
344
|
if (e === "" && (e = void 0), I(e) && !t.required)
|
|
345
345
|
return i();
|
|
346
|
-
v.required(t, e, s,
|
|
346
|
+
v.required(t, e, s, r, o), e !== void 0 && (v.type(t, e, s, r, o), v.range(t, e, s, r, o));
|
|
347
347
|
}
|
|
348
|
-
i(
|
|
349
|
-
},
|
|
350
|
-
var
|
|
348
|
+
i(r);
|
|
349
|
+
}, Ke = function(t, e, i, s, o) {
|
|
350
|
+
var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
351
351
|
if (n) {
|
|
352
352
|
if (I(e) && !t.required)
|
|
353
353
|
return i();
|
|
354
|
-
v.required(t, e, s,
|
|
354
|
+
v.required(t, e, s, r, o), e !== void 0 && v.type(t, e, s, r, o);
|
|
355
355
|
}
|
|
356
|
-
i(
|
|
357
|
-
},
|
|
358
|
-
var
|
|
356
|
+
i(r);
|
|
357
|
+
}, Be = function(t, e, i, s, o) {
|
|
358
|
+
var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
359
359
|
if (n) {
|
|
360
360
|
if (I(e) && !t.required)
|
|
361
361
|
return i();
|
|
362
|
-
v.required(t, e, s,
|
|
362
|
+
v.required(t, e, s, r, o), I(e) || v.type(t, e, s, r, o);
|
|
363
363
|
}
|
|
364
|
-
i(
|
|
365
|
-
},
|
|
366
|
-
var
|
|
364
|
+
i(r);
|
|
365
|
+
}, We = function(t, e, i, s, o) {
|
|
366
|
+
var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
367
367
|
if (n) {
|
|
368
368
|
if (I(e) && !t.required)
|
|
369
369
|
return i();
|
|
370
|
-
v.required(t, e, s,
|
|
370
|
+
v.required(t, e, s, r, o), e !== void 0 && (v.type(t, e, s, r, o), v.range(t, e, s, r, o));
|
|
371
371
|
}
|
|
372
|
-
i(
|
|
373
|
-
},
|
|
374
|
-
var
|
|
372
|
+
i(r);
|
|
373
|
+
}, Pe = function(t, e, i, s, o) {
|
|
374
|
+
var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
375
375
|
if (n) {
|
|
376
376
|
if (I(e) && !t.required)
|
|
377
377
|
return i();
|
|
378
|
-
v.required(t, e, s,
|
|
378
|
+
v.required(t, e, s, r, o), e !== void 0 && (v.type(t, e, s, r, o), v.range(t, e, s, r, o));
|
|
379
379
|
}
|
|
380
|
-
i(
|
|
381
|
-
},
|
|
382
|
-
var
|
|
380
|
+
i(r);
|
|
381
|
+
}, Ve = function(t, e, i, s, o) {
|
|
382
|
+
var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
383
383
|
if (n) {
|
|
384
384
|
if (e == null && !t.required)
|
|
385
385
|
return i();
|
|
386
|
-
v.required(t, e, s,
|
|
386
|
+
v.required(t, e, s, r, o, "array"), e != null && (v.type(t, e, s, r, o), v.range(t, e, s, r, o));
|
|
387
387
|
}
|
|
388
|
-
i(
|
|
389
|
-
},
|
|
390
|
-
var
|
|
388
|
+
i(r);
|
|
389
|
+
}, ze = function(t, e, i, s, o) {
|
|
390
|
+
var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
391
391
|
if (n) {
|
|
392
392
|
if (I(e) && !t.required)
|
|
393
393
|
return i();
|
|
394
|
-
v.required(t, e, s,
|
|
394
|
+
v.required(t, e, s, r, o), e !== void 0 && v.type(t, e, s, r, o);
|
|
395
395
|
}
|
|
396
|
-
i(
|
|
397
|
-
},
|
|
398
|
-
var
|
|
396
|
+
i(r);
|
|
397
|
+
}, $e = "enum", qe = function(t, e, i, s, o) {
|
|
398
|
+
var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
399
399
|
if (n) {
|
|
400
400
|
if (I(e) && !t.required)
|
|
401
401
|
return i();
|
|
402
|
-
v.required(t, e, s,
|
|
402
|
+
v.required(t, e, s, r, o), e !== void 0 && v[$e](t, e, s, r, o);
|
|
403
403
|
}
|
|
404
|
-
i(
|
|
405
|
-
},
|
|
406
|
-
var
|
|
404
|
+
i(r);
|
|
405
|
+
}, Ge = function(t, e, i, s, o) {
|
|
406
|
+
var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
407
407
|
if (n) {
|
|
408
408
|
if (I(e, "string") && !t.required)
|
|
409
409
|
return i();
|
|
410
|
-
v.required(t, e, s,
|
|
410
|
+
v.required(t, e, s, r, o), I(e, "string") || v.pattern(t, e, s, r, o);
|
|
411
411
|
}
|
|
412
|
-
i(
|
|
413
|
-
},
|
|
414
|
-
var
|
|
412
|
+
i(r);
|
|
413
|
+
}, je = function(t, e, i, s, o) {
|
|
414
|
+
var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
415
415
|
if (n) {
|
|
416
416
|
if (I(e, "date") && !t.required)
|
|
417
417
|
return i();
|
|
418
|
-
if (v.required(t, e, s,
|
|
418
|
+
if (v.required(t, e, s, r, o), !I(e, "date")) {
|
|
419
419
|
var l;
|
|
420
|
-
e instanceof Date ? l = e : l = new Date(e), v.type(t, l, s,
|
|
420
|
+
e instanceof Date ? l = e : l = new Date(e), v.type(t, l, s, r, o), l && v.range(t, l.getTime(), s, r, o);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
i(
|
|
424
|
-
},
|
|
425
|
-
var
|
|
426
|
-
v.required(t, e, s,
|
|
427
|
-
}, yt = function(t, e, i, s,
|
|
428
|
-
var
|
|
423
|
+
i(r);
|
|
424
|
+
}, Ue = function(t, e, i, s, o) {
|
|
425
|
+
var r = [], n = Array.isArray(e) ? "array" : typeof e;
|
|
426
|
+
v.required(t, e, s, r, o, n), i(r);
|
|
427
|
+
}, yt = function(t, e, i, s, o) {
|
|
428
|
+
var r = t.type, n = [], l = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
429
429
|
if (l) {
|
|
430
|
-
if (I(e,
|
|
430
|
+
if (I(e, r) && !t.required)
|
|
431
431
|
return i();
|
|
432
|
-
v.required(t, e, s, n,
|
|
432
|
+
v.required(t, e, s, n, o, r), I(e, r) || v.type(t, e, s, n, o);
|
|
433
433
|
}
|
|
434
434
|
i(n);
|
|
435
|
-
},
|
|
436
|
-
var
|
|
435
|
+
}, Ze = function(t, e, i, s, o) {
|
|
436
|
+
var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
437
437
|
if (n) {
|
|
438
438
|
if (I(e) && !t.required)
|
|
439
439
|
return i();
|
|
440
|
-
v.required(t, e, s,
|
|
440
|
+
v.required(t, e, s, r, o);
|
|
441
441
|
}
|
|
442
|
-
i(
|
|
442
|
+
i(r);
|
|
443
443
|
}, it = {
|
|
444
|
-
string:
|
|
445
|
-
method:
|
|
446
|
-
number:
|
|
447
|
-
boolean:
|
|
448
|
-
regexp:
|
|
449
|
-
integer:
|
|
450
|
-
float:
|
|
451
|
-
array:
|
|
452
|
-
object:
|
|
453
|
-
enum:
|
|
454
|
-
pattern:
|
|
455
|
-
date:
|
|
444
|
+
string: Fe,
|
|
445
|
+
method: Ne,
|
|
446
|
+
number: Ye,
|
|
447
|
+
boolean: Ke,
|
|
448
|
+
regexp: Be,
|
|
449
|
+
integer: We,
|
|
450
|
+
float: Pe,
|
|
451
|
+
array: Ve,
|
|
452
|
+
object: ze,
|
|
453
|
+
enum: qe,
|
|
454
|
+
pattern: Ge,
|
|
455
|
+
date: je,
|
|
456
456
|
url: yt,
|
|
457
457
|
hex: yt,
|
|
458
458
|
email: yt,
|
|
459
|
-
required:
|
|
460
|
-
any:
|
|
459
|
+
required: Ue,
|
|
460
|
+
any: Ze
|
|
461
461
|
};
|
|
462
462
|
function vt() {
|
|
463
463
|
return {
|
|
@@ -523,17 +523,17 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
523
523
|
throw new Error("Cannot configure a schema with no rules");
|
|
524
524
|
if (typeof i != "object" || Array.isArray(i))
|
|
525
525
|
throw new Error("Rules must be an object");
|
|
526
|
-
this.rules = {}, Object.keys(i).forEach(function(
|
|
527
|
-
var
|
|
528
|
-
s.rules[
|
|
526
|
+
this.rules = {}, Object.keys(i).forEach(function(o) {
|
|
527
|
+
var r = i[o];
|
|
528
|
+
s.rules[o] = Array.isArray(r) ? r : [r];
|
|
529
529
|
});
|
|
530
530
|
}, t.messages = function(i) {
|
|
531
|
-
return i && (this._messages =
|
|
532
|
-
}, t.validate = function(i, s,
|
|
533
|
-
var
|
|
534
|
-
s === void 0 && (s = {}),
|
|
531
|
+
return i && (this._messages = Yt(vt(), i)), this._messages;
|
|
532
|
+
}, t.validate = function(i, s, o) {
|
|
533
|
+
var r = this;
|
|
534
|
+
s === void 0 && (s = {}), o === void 0 && (o = function() {
|
|
535
535
|
});
|
|
536
|
-
var n = i, l = s, h =
|
|
536
|
+
var n = i, l = s, h = o;
|
|
537
537
|
if (typeof l == "function" && (h = l, l = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
538
538
|
return h && h(null, n), Promise.resolve(n);
|
|
539
539
|
function f(g) {
|
|
@@ -551,17 +551,17 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
551
551
|
}
|
|
552
552
|
if (l.messages) {
|
|
553
553
|
var d = this.messages();
|
|
554
|
-
d === Rt && (d = vt()),
|
|
554
|
+
d === Rt && (d = vt()), Yt(d, l.messages), l.messages = d;
|
|
555
555
|
} else
|
|
556
556
|
l.messages = this.messages();
|
|
557
557
|
var x = {}, u = l.keys || Object.keys(this.rules);
|
|
558
558
|
u.forEach(function(g) {
|
|
559
|
-
var w =
|
|
559
|
+
var w = r.rules[g], p = n[g];
|
|
560
560
|
w.forEach(function(E) {
|
|
561
561
|
var m = E;
|
|
562
562
|
typeof m.transform == "function" && (n === i && (n = $({}, n)), p = n[g] = m.transform(p)), typeof m == "function" ? m = {
|
|
563
563
|
validator: m
|
|
564
|
-
} : m = $({}, m), m.validator =
|
|
564
|
+
} : m = $({}, m), m.validator = r.getValidationMethod(m), m.validator && (m.field = g, m.fullField = m.fullField || g, m.type = r.getType(m), x[g] = x[g] || [], x[g].push({
|
|
565
565
|
rule: m,
|
|
566
566
|
value: p,
|
|
567
567
|
source: n,
|
|
@@ -570,7 +570,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
572
|
var y = {};
|
|
573
|
-
return
|
|
573
|
+
return Se(x, l, function(g, w) {
|
|
574
574
|
var p = g.rule, E = (p.type === "object" || p.type === "array") && (typeof p.fields == "object" || typeof p.defaultField == "object");
|
|
575
575
|
E = E && (p.required || !p.required && g.value), p.field = g.field;
|
|
576
576
|
function m(R, T) {
|
|
@@ -590,20 +590,20 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
590
590
|
w(L);
|
|
591
591
|
else {
|
|
592
592
|
if (p.required && !g.value)
|
|
593
|
-
return p.message !== void 0 ? L = [].concat(p.message).map(Nt(p, n)) : l.error && (L = [l.error(p,
|
|
593
|
+
return p.message !== void 0 ? L = [].concat(p.message).map(Nt(p, n)) : l.error && (L = [l.error(p, M(l.messages.required, p.field))]), w(L);
|
|
594
594
|
var A = {};
|
|
595
|
-
p.defaultField && Object.keys(g.value).map(function(
|
|
596
|
-
A[
|
|
595
|
+
p.defaultField && Object.keys(g.value).map(function(_) {
|
|
596
|
+
A[_] = p.defaultField;
|
|
597
597
|
}), A = $({}, A, g.rule.fields);
|
|
598
598
|
var D = {};
|
|
599
|
-
Object.keys(A).forEach(function(
|
|
600
|
-
var S = A[
|
|
601
|
-
D[
|
|
599
|
+
Object.keys(A).forEach(function(_) {
|
|
600
|
+
var S = A[_], O = Array.isArray(S) ? S : [S];
|
|
601
|
+
D[_] = O.map(m.bind(null, _));
|
|
602
602
|
});
|
|
603
603
|
var B = new a(D);
|
|
604
|
-
B.messages(l.messages), g.rule.options && (g.rule.options.messages = l.messages, g.rule.options.error = l.error), B.validate(g.value, g.rule.options || l, function(
|
|
604
|
+
B.messages(l.messages), g.rule.options && (g.rule.options.messages = l.messages, g.rule.options.error = l.error), B.validate(g.value, g.rule.options || l, function(_) {
|
|
605
605
|
var S = [];
|
|
606
|
-
L && L.length && S.push.apply(S, L),
|
|
606
|
+
L && L.length && S.push.apply(S, L), _ && _.length && S.push.apply(S, _), w(S.length ? S : null);
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
609
|
}
|
|
@@ -630,13 +630,13 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
630
630
|
}, n);
|
|
631
631
|
}, t.getType = function(i) {
|
|
632
632
|
if (i.type === void 0 && i.pattern instanceof RegExp && (i.type = "pattern"), typeof i.validator != "function" && i.type && !it.hasOwnProperty(i.type))
|
|
633
|
-
throw new Error(
|
|
633
|
+
throw new Error(M("Unknown rule type %s", i.type));
|
|
634
634
|
return i.type || "string";
|
|
635
635
|
}, t.getValidationMethod = function(i) {
|
|
636
636
|
if (typeof i.validator == "function")
|
|
637
637
|
return i.validator;
|
|
638
|
-
var s = Object.keys(i),
|
|
639
|
-
return
|
|
638
|
+
var s = Object.keys(i), o = s.indexOf("message");
|
|
639
|
+
return o !== -1 && s.splice(o, 1), s.length === 1 && s[0] === "required" ? it.required : it[this.getType(i)] || void 0;
|
|
640
640
|
}, a;
|
|
641
641
|
}();
|
|
642
642
|
nt.register = function(t, e) {
|
|
@@ -644,7 +644,7 @@ nt.register = function(t, e) {
|
|
|
644
644
|
throw new Error("Cannot register a validator by type, validator is not a function");
|
|
645
645
|
it[t] = e;
|
|
646
646
|
};
|
|
647
|
-
nt.warning =
|
|
647
|
+
nt.warning = jt;
|
|
648
648
|
nt.messages = Rt;
|
|
649
649
|
nt.validators = it;
|
|
650
650
|
function At() {
|
|
@@ -653,37 +653,37 @@ function At() {
|
|
|
653
653
|
return (a === "x" ? t : t & 3 | 8).toString(16);
|
|
654
654
|
});
|
|
655
655
|
}
|
|
656
|
-
function
|
|
656
|
+
function Zt(a, t) {
|
|
657
657
|
let e = 0, i;
|
|
658
658
|
return function(...s) {
|
|
659
|
-
const
|
|
660
|
-
!e ||
|
|
659
|
+
const o = (/* @__PURE__ */ new Date()).getTime(), r = o - e;
|
|
660
|
+
!e || r >= t ? (a.apply(this, s), e = o) : i || (i = setTimeout(() => {
|
|
661
661
|
a.apply(this, s), e = (/* @__PURE__ */ new Date()).getTime(), i = void 0;
|
|
662
|
-
}, t -
|
|
662
|
+
}, t - r));
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
|
-
function
|
|
666
|
-
return a ? a.map((t) =>
|
|
665
|
+
function Jt(a) {
|
|
666
|
+
return a ? a.map((t) => Jt(t.children) + 1).sort((t, e) => e - t)[0] : 0;
|
|
667
667
|
}
|
|
668
|
-
function
|
|
668
|
+
function Je(a = []) {
|
|
669
669
|
let t = [], e = [], i = [];
|
|
670
670
|
return a.forEach((s) => {
|
|
671
671
|
s.fixed === "left" ? t.push(s) : s.fixed === "right" ? i.push(s) : e.push(s);
|
|
672
672
|
}), [
|
|
673
|
-
...t.sort((s,
|
|
674
|
-
...e.sort((s,
|
|
675
|
-
...i.sort((s,
|
|
673
|
+
...t.sort((s, o) => s.sort - o.sort),
|
|
674
|
+
...e.sort((s, o) => s.sort - o.sort),
|
|
675
|
+
...i.sort((s, o) => s.sort - o.sort)
|
|
676
676
|
];
|
|
677
677
|
}
|
|
678
|
-
function
|
|
678
|
+
function Qt(a = [], t = 1, e = 0) {
|
|
679
679
|
return a.map((i) => {
|
|
680
680
|
if (i.children) {
|
|
681
|
-
let s = 0,
|
|
681
|
+
let s = 0, o = i.fixed;
|
|
682
682
|
i.children.forEach((n) => {
|
|
683
|
-
n.fixed =
|
|
683
|
+
n.fixed = o;
|
|
684
684
|
});
|
|
685
|
-
const
|
|
686
|
-
return
|
|
685
|
+
const r = Qt(i.children, t - 1, e + 1);
|
|
686
|
+
return r && r.forEach((n) => {
|
|
687
687
|
s += n.colspan;
|
|
688
688
|
}), {
|
|
689
689
|
...i,
|
|
@@ -691,7 +691,7 @@ function Zt(a = [], t = 1, e = 0) {
|
|
|
691
691
|
level: e,
|
|
692
692
|
rowspan: 1,
|
|
693
693
|
colspan: s,
|
|
694
|
-
children:
|
|
694
|
+
children: r
|
|
695
695
|
};
|
|
696
696
|
}
|
|
697
697
|
return {
|
|
@@ -708,7 +708,46 @@ function It(a = []) {
|
|
|
708
708
|
e.children ? t = t.concat(It(e.children)) : t.push(e);
|
|
709
709
|
}), t;
|
|
710
710
|
}
|
|
711
|
-
|
|
711
|
+
const Bt = /^(\r\n|\n\r|\r|\n)/, Qe = /^[^\t\r\n]+/, Wt = /^\t/;
|
|
712
|
+
function ti(a) {
|
|
713
|
+
let t = [[""]];
|
|
714
|
+
if (a.length === 0)
|
|
715
|
+
return t;
|
|
716
|
+
let e = 0, i = 0, s;
|
|
717
|
+
for (; a.length > 0 && s !== a.length; )
|
|
718
|
+
if (s = a.length, a.match(Wt))
|
|
719
|
+
a = a.replace(Wt, ""), e += 1, t[i][e] = "";
|
|
720
|
+
else if (a.match(Bt))
|
|
721
|
+
a = a.replace(Bt, ""), e = 0, i += 1, t[i] = [""];
|
|
722
|
+
else {
|
|
723
|
+
let o = "";
|
|
724
|
+
if (a.startsWith('"')) {
|
|
725
|
+
let r = 0, n = !0;
|
|
726
|
+
for (; n; ) {
|
|
727
|
+
const l = a.slice(0, 1);
|
|
728
|
+
l === '"' && (r += 1), o += l, a = a.slice(1), (a.length === 0 || a.match(/^[\t\r\n]/) && r % 2 === 0) && (n = !1);
|
|
729
|
+
}
|
|
730
|
+
o = o.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (l) => new Array(Math.floor(l.length / 2)).fill('"').join(""));
|
|
731
|
+
} else {
|
|
732
|
+
const r = a.match(Qe);
|
|
733
|
+
o = r ? r[0] : "", a = a.slice(o.length);
|
|
734
|
+
}
|
|
735
|
+
t[i][e] = o;
|
|
736
|
+
}
|
|
737
|
+
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;
|
|
738
|
+
}
|
|
739
|
+
function ei(a) {
|
|
740
|
+
let t, e, i, s, o = "", r;
|
|
741
|
+
for (t = 0, e = a.length; t < e; t += 1) {
|
|
742
|
+
for (s = a[t].length, i = 0; i < s; i += 1)
|
|
743
|
+
i > 0 && (o += " "), r = a[t][i], typeof r == "string" ? r.indexOf(`
|
|
744
|
+
`) > -1 ? o += `"${r.replace(/"/g, '""')}"` : o += r : r == null ? o += "" : o += r;
|
|
745
|
+
t !== e - 1 && (o += `
|
|
746
|
+
`);
|
|
747
|
+
}
|
|
748
|
+
return o;
|
|
749
|
+
}
|
|
750
|
+
class ii {
|
|
712
751
|
//虚拟滚动位置
|
|
713
752
|
constructor(t, e) {
|
|
714
753
|
c(this, "loading", !1);
|
|
@@ -730,8 +769,8 @@ class Ze {
|
|
|
730
769
|
c(this, "filterMethod");
|
|
731
770
|
c(this, "positions", []);
|
|
732
771
|
this.ctx = t;
|
|
733
|
-
const { data: i = [], columns: s = [], footerData:
|
|
734
|
-
this.data = i, this.footerData =
|
|
772
|
+
const { data: i = [], columns: s = [], footerData: o = [] } = e;
|
|
773
|
+
this.data = i, this.footerData = o, this.columns = s, this.setLoading(!0), this.init();
|
|
735
774
|
}
|
|
736
775
|
init() {
|
|
737
776
|
this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear(), this.itemRowKeyMap = /* @__PURE__ */ new WeakMap(), this.initData(this.data);
|
|
@@ -749,9 +788,9 @@ class Ze {
|
|
|
749
788
|
*/
|
|
750
789
|
initData(t, e = 0) {
|
|
751
790
|
t.forEach((i, s) => {
|
|
752
|
-
let
|
|
753
|
-
Array.isArray(i.children) && (
|
|
754
|
-
const { ROW_KEY:
|
|
791
|
+
let o = !1;
|
|
792
|
+
Array.isArray(i.children) && (o = !0, this.initData(i.children, e + 1));
|
|
793
|
+
const { ROW_KEY: r = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: l, SELECTABLE_METHOD: h, CHECKBOX_KEY: f } = this.ctx.config, d = i[r], x = d ?? At();
|
|
755
794
|
this.itemRowKeyMap.set(i, x);
|
|
756
795
|
const u = i._height || l, y = i._readonly;
|
|
757
796
|
let g = !0;
|
|
@@ -773,7 +812,7 @@ class Ze {
|
|
|
773
812
|
selectable: g,
|
|
774
813
|
expand: n,
|
|
775
814
|
expandLazy: !1,
|
|
776
|
-
hasChildren:
|
|
815
|
+
hasChildren: o,
|
|
777
816
|
expandLoading: !1,
|
|
778
817
|
item: i
|
|
779
818
|
});
|
|
@@ -804,8 +843,8 @@ class Ze {
|
|
|
804
843
|
filterColumns(t) {
|
|
805
844
|
return t.reduce((e, i) => {
|
|
806
845
|
if (!(typeof i.hide == "function" ? i.hide() : i.hide)) {
|
|
807
|
-
const
|
|
808
|
-
|
|
846
|
+
const o = { ...i };
|
|
847
|
+
o.children && Array.isArray(o.children) && (o.children = this.filterColumns(o.children)), e.push(o);
|
|
809
848
|
}
|
|
810
849
|
return e;
|
|
811
850
|
}, []);
|
|
@@ -832,15 +871,15 @@ class Ze {
|
|
|
832
871
|
};
|
|
833
872
|
let t = [], e = 0;
|
|
834
873
|
this.sumHeight = 0, this.positions = [];
|
|
835
|
-
const i = (
|
|
836
|
-
|
|
837
|
-
t.push(
|
|
838
|
-
const n = this.itemRowKeyMap.get(
|
|
874
|
+
const i = (o) => {
|
|
875
|
+
o.forEach((r) => {
|
|
876
|
+
t.push(r);
|
|
877
|
+
const n = this.itemRowKeyMap.get(r), { expand: l, hasChildren: h, height: f } = this.rowKeyMap.get(n), d = this.sumHeight;
|
|
839
878
|
this.sumHeight += f, this.rowIndexRowKeyMap.set(e, n), this.positions.push({
|
|
840
879
|
top: d,
|
|
841
880
|
height: f,
|
|
842
881
|
bottom: this.sumHeight
|
|
843
|
-
}), e += 1, l && h && i(
|
|
882
|
+
}), e += 1, l && h && i(r.children);
|
|
844
883
|
});
|
|
845
884
|
};
|
|
846
885
|
this.rowIndexRowKeyMap.clear();
|
|
@@ -936,11 +975,11 @@ class Ze {
|
|
|
936
975
|
getItemValueForRowIndexAndColIndex(t, e) {
|
|
937
976
|
if (!(this.rowIndexRowKeyMap.has(t) && this.colIndexKeyMap.get(e)))
|
|
938
977
|
return null;
|
|
939
|
-
const s = this.rowIndexRowKeyMap.get(t),
|
|
978
|
+
const s = this.rowIndexRowKeyMap.get(t), o = this.colIndexKeyMap.get(e);
|
|
940
979
|
return {
|
|
941
980
|
rowKey: s,
|
|
942
|
-
key:
|
|
943
|
-
value: this.getItemValue(s,
|
|
981
|
+
key: o,
|
|
982
|
+
value: this.getItemValue(s, o)
|
|
944
983
|
};
|
|
945
984
|
}
|
|
946
985
|
/**
|
|
@@ -971,8 +1010,8 @@ class Ze {
|
|
|
971
1010
|
newValue: x
|
|
972
1011
|
});
|
|
973
1012
|
});
|
|
974
|
-
let
|
|
975
|
-
const
|
|
1013
|
+
let o = [];
|
|
1014
|
+
const r = i.map((n) => {
|
|
976
1015
|
const l = this.ctx.database.getRowDataItemForRowKey(n.rowKey);
|
|
977
1016
|
return {
|
|
978
1017
|
rowKey: n.rowKey,
|
|
@@ -982,8 +1021,8 @@ class Ze {
|
|
|
982
1021
|
};
|
|
983
1022
|
});
|
|
984
1023
|
return s.forEach((n) => {
|
|
985
|
-
|
|
986
|
-
}), this.ctx.emit("change",
|
|
1024
|
+
o.push(this.ctx.database.getRowDataItemForRowKey(n));
|
|
1025
|
+
}), this.ctx.emit("change", r, o), e && this.ctx.history.pushState({
|
|
987
1026
|
changeList: i,
|
|
988
1027
|
scrollX: this.ctx.scrollX,
|
|
989
1028
|
scrollY: this.ctx.scrollY,
|
|
@@ -1000,7 +1039,7 @@ class Ze {
|
|
|
1000
1039
|
* @param isEditor 是否是编辑器
|
|
1001
1040
|
* @returns
|
|
1002
1041
|
*/
|
|
1003
|
-
setItemValue(t, e, i, s = !1,
|
|
1042
|
+
setItemValue(t, e, i, s = !1, o = !1, r = !1) {
|
|
1004
1043
|
if (!this.rowKeyMap.has(t))
|
|
1005
1044
|
return {};
|
|
1006
1045
|
const { item: n } = this.rowKeyMap.get(t);
|
|
@@ -1012,7 +1051,7 @@ class Ze {
|
|
|
1012
1051
|
};
|
|
1013
1052
|
n[e] !== null && typeof n[e] == "object" && (l = JSON.parse(JSON.stringify(n[e])));
|
|
1014
1053
|
const h = `${t}_${e}`;
|
|
1015
|
-
if (this.originalDataMap.has(h) || this.originalDataMap.set(h, l), this.changedDataMap.set(h, i), n[e] = i,
|
|
1054
|
+
if (this.originalDataMap.has(h) || this.originalDataMap.set(h, l), this.changedDataMap.set(h, i), n[e] = i, r) {
|
|
1016
1055
|
const f = this.ctx.database.getRowDataItemForRowKey(t), d = {
|
|
1017
1056
|
rowKey: t,
|
|
1018
1057
|
key: e,
|
|
@@ -1047,7 +1086,7 @@ class Ze {
|
|
|
1047
1086
|
newValue: i
|
|
1048
1087
|
}
|
|
1049
1088
|
]
|
|
1050
|
-
}),
|
|
1089
|
+
}), o && this.ctx.emit("draw"), {
|
|
1051
1090
|
oldValue: l,
|
|
1052
1091
|
newValue: i
|
|
1053
1092
|
};
|
|
@@ -1073,8 +1112,8 @@ class Ze {
|
|
|
1073
1112
|
if (i) {
|
|
1074
1113
|
if (!this.rowKeyMap.has(t))
|
|
1075
1114
|
return !1;
|
|
1076
|
-
const { item: s } = this.rowKeyMap.get(t),
|
|
1077
|
-
this.checkboxKeyMap.has(
|
|
1115
|
+
const { item: s } = this.rowKeyMap.get(t), o = s[i];
|
|
1116
|
+
this.checkboxKeyMap.has(o) && this.checkboxKeyMap.get(o).forEach((n) => {
|
|
1078
1117
|
const l = this.rowKeyMap.get(n);
|
|
1079
1118
|
l.check = e;
|
|
1080
1119
|
});
|
|
@@ -1161,12 +1200,12 @@ class Ze {
|
|
|
1161
1200
|
*/
|
|
1162
1201
|
getCheckedState() {
|
|
1163
1202
|
let t = 0, e = 0;
|
|
1164
|
-
this.rowKeyMap.forEach((
|
|
1165
|
-
|
|
1166
|
-
const n =
|
|
1203
|
+
this.rowKeyMap.forEach((r) => {
|
|
1204
|
+
r.check && (t += 1);
|
|
1205
|
+
const n = r.selectable;
|
|
1167
1206
|
typeof n == "function" ? n({
|
|
1168
|
-
row:
|
|
1169
|
-
rowIndex:
|
|
1207
|
+
row: r.item,
|
|
1208
|
+
rowIndex: r.rowIndex
|
|
1170
1209
|
}) && (e += 1) : n && (e += 1);
|
|
1171
1210
|
});
|
|
1172
1211
|
const i = e && e > t && t > 0;
|
|
@@ -1191,12 +1230,12 @@ class Ze {
|
|
|
1191
1230
|
getChangedData() {
|
|
1192
1231
|
let t = [];
|
|
1193
1232
|
return this.changedDataMap.forEach((e, i) => {
|
|
1194
|
-
const s = this.originalDataMap.get(i),
|
|
1233
|
+
const s = this.originalDataMap.get(i), o = i.split("_")[0], r = i.split("_")[1];
|
|
1195
1234
|
s !== e && t.push({
|
|
1196
|
-
rowKey:
|
|
1197
|
-
colKey:
|
|
1235
|
+
rowKey: o,
|
|
1236
|
+
colKey: r,
|
|
1198
1237
|
originalValue: s,
|
|
1199
|
-
row: this.rowKeyMap.get(
|
|
1238
|
+
row: this.rowKeyMap.get(o),
|
|
1200
1239
|
value: e
|
|
1201
1240
|
});
|
|
1202
1241
|
}), t;
|
|
@@ -1204,8 +1243,8 @@ class Ze {
|
|
|
1204
1243
|
getChangedRows() {
|
|
1205
1244
|
const t = /* @__PURE__ */ new Set();
|
|
1206
1245
|
this.changedDataMap.forEach((i, s) => {
|
|
1207
|
-
const
|
|
1208
|
-
|
|
1246
|
+
const o = this.originalDataMap.get(s), r = s.split("_")[0];
|
|
1247
|
+
o !== i && t.add(r);
|
|
1209
1248
|
});
|
|
1210
1249
|
let e = [];
|
|
1211
1250
|
return t.forEach((i) => {
|
|
@@ -1222,8 +1261,8 @@ class Ze {
|
|
|
1222
1261
|
const i = `${t}_${e}`;
|
|
1223
1262
|
if (!this.changedDataMap.has(i))
|
|
1224
1263
|
return !1;
|
|
1225
|
-
const s = this.originalDataMap.get(i),
|
|
1226
|
-
return s !==
|
|
1264
|
+
const s = this.originalDataMap.get(i), o = this.changedDataMap.get(i);
|
|
1265
|
+
return s !== o;
|
|
1227
1266
|
}
|
|
1228
1267
|
getPositionForRowIndex(t) {
|
|
1229
1268
|
return t < this.positions.length ? this.positions[t] : {
|
|
@@ -1236,7 +1275,7 @@ class Ze {
|
|
|
1236
1275
|
return t ? (this.headerMap.set(t, e), !0) : !1;
|
|
1237
1276
|
}
|
|
1238
1277
|
getReadonly(t, e) {
|
|
1239
|
-
const i = this.rowKeyMap.get(t), s = this.headerMap.get(e),
|
|
1278
|
+
const i = this.rowKeyMap.get(t), s = this.headerMap.get(e), o = i == null ? void 0 : i.readonly, r = s == null ? void 0 : s.readonly, { CELL_READONLY_METHOD: n } = this.ctx.config;
|
|
1240
1279
|
if (typeof n == "function") {
|
|
1241
1280
|
const h = n({
|
|
1242
1281
|
row: i.item,
|
|
@@ -1248,20 +1287,20 @@ class Ze {
|
|
|
1248
1287
|
if (h !== void 0)
|
|
1249
1288
|
return h;
|
|
1250
1289
|
}
|
|
1251
|
-
return
|
|
1290
|
+
return r || o;
|
|
1252
1291
|
}
|
|
1253
1292
|
clearValidate() {
|
|
1254
1293
|
this.validationErrorMap.clear();
|
|
1255
1294
|
}
|
|
1256
1295
|
getValidator(t, e) {
|
|
1257
1296
|
return new Promise((i) => {
|
|
1258
|
-
const s = this.rowKeyMap.get(t),
|
|
1297
|
+
const s = this.rowKeyMap.get(t), o = this.headerMap.get(e), { CELL_RULES_METHOD: r } = this.ctx.config, n = o.column;
|
|
1259
1298
|
let l = n.rules;
|
|
1260
|
-
if (typeof
|
|
1261
|
-
const f =
|
|
1299
|
+
if (typeof r == "function") {
|
|
1300
|
+
const f = r({
|
|
1262
1301
|
row: s.item,
|
|
1263
1302
|
rowIndex: s.rowIndex,
|
|
1264
|
-
colIndex:
|
|
1303
|
+
colIndex: o.colIndex,
|
|
1265
1304
|
column: n,
|
|
1266
1305
|
value: this.getItemValue(t, e)
|
|
1267
1306
|
});
|
|
@@ -1275,7 +1314,7 @@ class Ze {
|
|
|
1275
1314
|
row: s.item,
|
|
1276
1315
|
column: n,
|
|
1277
1316
|
rowIndex: s.rowIndex,
|
|
1278
|
-
colIndex:
|
|
1317
|
+
colIndex: o.colIndex
|
|
1279
1318
|
}));
|
|
1280
1319
|
h[e] = x;
|
|
1281
1320
|
} else
|
|
@@ -1284,7 +1323,7 @@ class Ze {
|
|
|
1284
1323
|
row: s.item,
|
|
1285
1324
|
column: n,
|
|
1286
1325
|
rowIndex: s.rowIndex,
|
|
1287
|
-
colIndex:
|
|
1326
|
+
colIndex: o.colIndex
|
|
1288
1327
|
};
|
|
1289
1328
|
new nt(h).validate(f).then(() => {
|
|
1290
1329
|
this.setValidationError(t, e, []), i([]);
|
|
@@ -1305,8 +1344,8 @@ class Ze {
|
|
|
1305
1344
|
getHeightByRowIndexRowSpan(t, e) {
|
|
1306
1345
|
let i = 0;
|
|
1307
1346
|
for (let s = 0; s < e; s++) {
|
|
1308
|
-
const
|
|
1309
|
-
|
|
1347
|
+
const o = this.positions[t + s];
|
|
1348
|
+
o && (i += o.height);
|
|
1310
1349
|
}
|
|
1311
1350
|
return i;
|
|
1312
1351
|
}
|
|
@@ -1317,12 +1356,12 @@ class Ze {
|
|
|
1317
1356
|
return this.loading;
|
|
1318
1357
|
}
|
|
1319
1358
|
setValidationErrorByRowIndex(t, e, i) {
|
|
1320
|
-
const
|
|
1359
|
+
const o = `${this.rowIndexRowKeyMap.get(t)}_${e}`, r = [
|
|
1321
1360
|
{
|
|
1322
1361
|
message: i
|
|
1323
1362
|
}
|
|
1324
1363
|
];
|
|
1325
|
-
this.validationErrorMap.set(
|
|
1364
|
+
this.validationErrorMap.set(o, r);
|
|
1326
1365
|
}
|
|
1327
1366
|
setValidationError(t, e, i) {
|
|
1328
1367
|
const s = `${t}_${e}`;
|
|
@@ -1333,7 +1372,7 @@ class Ze {
|
|
|
1333
1372
|
return this.validationErrorMap.get(i) || [];
|
|
1334
1373
|
}
|
|
1335
1374
|
}
|
|
1336
|
-
class
|
|
1375
|
+
class si {
|
|
1337
1376
|
constructor(t) {
|
|
1338
1377
|
c(this, "ctx");
|
|
1339
1378
|
c(this, "history", []);
|
|
@@ -1360,10 +1399,10 @@ class Je {
|
|
|
1360
1399
|
backState() {
|
|
1361
1400
|
if (this.historyIndex >= 0) {
|
|
1362
1401
|
const { changeList: t, scrollX: e, scrollY: i } = this.history[this.historyIndex], s = t.map(
|
|
1363
|
-
(
|
|
1364
|
-
rowKey:
|
|
1365
|
-
key:
|
|
1366
|
-
value:
|
|
1402
|
+
(o) => ({
|
|
1403
|
+
rowKey: o.rowKey,
|
|
1404
|
+
key: o.key,
|
|
1405
|
+
value: o.oldValue,
|
|
1367
1406
|
row: {}
|
|
1368
1407
|
})
|
|
1369
1408
|
);
|
|
@@ -1390,7 +1429,7 @@ class Je {
|
|
|
1390
1429
|
this.history = [], this.historyIndex = -1;
|
|
1391
1430
|
}
|
|
1392
1431
|
}
|
|
1393
|
-
class
|
|
1432
|
+
class ri {
|
|
1394
1433
|
constructor(t) {
|
|
1395
1434
|
c(this, "eventTasks", /* @__PURE__ */ new Map());
|
|
1396
1435
|
c(this, "ctx");
|
|
@@ -1436,7 +1475,7 @@ class Qe {
|
|
|
1436
1475
|
t.removeEventListener(e, i), this.eventTasks.delete(e);
|
|
1437
1476
|
}
|
|
1438
1477
|
}
|
|
1439
|
-
class
|
|
1478
|
+
class oi {
|
|
1440
1479
|
constructor() {
|
|
1441
1480
|
c(this, "events", /* @__PURE__ */ new Map());
|
|
1442
1481
|
}
|
|
@@ -1474,7 +1513,7 @@ class ti {
|
|
|
1474
1513
|
this.events.clear();
|
|
1475
1514
|
}
|
|
1476
1515
|
}
|
|
1477
|
-
class
|
|
1516
|
+
class ni {
|
|
1478
1517
|
constructor(t) {
|
|
1479
1518
|
c(this, "ctx");
|
|
1480
1519
|
const e = t.getContext("2d");
|
|
@@ -1511,9 +1550,9 @@ class ei {
|
|
|
1511
1550
|
* @param {number} shadowWidth - 阴影的宽度
|
|
1512
1551
|
* @param {string} color - 阴影的颜色
|
|
1513
1552
|
*/
|
|
1514
|
-
drawShadow(t, e, i, s,
|
|
1515
|
-
const { fillColor:
|
|
1516
|
-
this.ctx.save(),
|
|
1553
|
+
drawShadow(t, e, i, s, o) {
|
|
1554
|
+
const { fillColor: r, side: n, shadowWidth: l, colorStart: h, colorEnd: f } = o;
|
|
1555
|
+
this.ctx.save(), r && (this.ctx.fillStyle = r, this.ctx.fillRect(t, e, i, s));
|
|
1517
1556
|
let d;
|
|
1518
1557
|
switch (n) {
|
|
1519
1558
|
case "left":
|
|
@@ -1550,21 +1589,21 @@ class ei {
|
|
|
1550
1589
|
this.ctx.save();
|
|
1551
1590
|
const { borderColor: i = "black", borderWidth: s = 1 } = e;
|
|
1552
1591
|
this.ctx.beginPath(), this.ctx.moveTo(t[0] + 0.5, t[1] + 0.5);
|
|
1553
|
-
for (let
|
|
1554
|
-
this.ctx.lineTo(t[
|
|
1592
|
+
for (let o = 2; o < t.length; o += 2)
|
|
1593
|
+
this.ctx.lineTo(t[o] + 0.5, t[o + 1] + 0.5);
|
|
1555
1594
|
this.ctx.strokeStyle = i, this.ctx.lineWidth = s, e.lineDash && (this.ctx.lineDashOffset = 4, this.ctx.setLineDash(e.lineDash)), e.fillColor && (this.ctx.fillStyle = e.fillColor, this.ctx.fill()), e.borderColor && (this.ctx.strokeStyle = e.borderColor), this.ctx.stroke(), this.ctx.closePath(), this.ctx.restore();
|
|
1556
1595
|
}
|
|
1557
|
-
drawImage(t, e, i, s,
|
|
1558
|
-
this.ctx.save(), this.ctx.drawImage(t, e, i, s,
|
|
1596
|
+
drawImage(t, e, i, s, o) {
|
|
1597
|
+
this.ctx.save(), this.ctx.drawImage(t, e, i, s, o), this.ctx.restore();
|
|
1559
1598
|
}
|
|
1560
|
-
drawRect(t, e, i, s, { borderWidth:
|
|
1561
|
-
if (this.ctx.save(), this.ctx.beginPath(), n !== void 0 && (this.ctx.fillStyle = n),
|
|
1599
|
+
drawRect(t, e, i, s, { borderWidth: o = 1, borderColor: r, fillColor: n, radius: l = 0 } = {}) {
|
|
1600
|
+
if (this.ctx.save(), this.ctx.beginPath(), n !== void 0 && (this.ctx.fillStyle = n), r !== void 0 && (this.ctx.lineWidth = o, this.ctx.strokeStyle = r), l === 0)
|
|
1562
1601
|
this.ctx.rect(t + 0.5, e + 0.5, i, s);
|
|
1563
1602
|
else {
|
|
1564
1603
|
const [h, f, d, x] = typeof l == "number" ? [l, l, l, l] : l;
|
|
1565
1604
|
this.ctx.moveTo(t + h, e), this.ctx.arcTo(t + i, e, t + i, e + f, f), this.ctx.arcTo(t + i, e + s, t + i - d, e + s, d), this.ctx.arcTo(t, e + s, t, e + s - x, x), this.ctx.arcTo(t, e, t + h, e, h);
|
|
1566
1605
|
}
|
|
1567
|
-
n !== void 0 && this.ctx.fill(),
|
|
1606
|
+
n !== void 0 && this.ctx.fill(), r !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
1568
1607
|
}
|
|
1569
1608
|
/**
|
|
1570
1609
|
* 画文本
|
|
@@ -1576,7 +1615,7 @@ class ei {
|
|
|
1576
1615
|
* @param options
|
|
1577
1616
|
* @returns 是否溢出
|
|
1578
1617
|
*/
|
|
1579
|
-
drawText(t = "", e, i, s,
|
|
1618
|
+
drawText(t = "", e, i, s, o, r = {}) {
|
|
1580
1619
|
this.ctx.save();
|
|
1581
1620
|
const {
|
|
1582
1621
|
font: n = "12px Arial",
|
|
@@ -1584,39 +1623,39 @@ class ei {
|
|
|
1584
1623
|
color: h = "#495060",
|
|
1585
1624
|
padding: f = 0,
|
|
1586
1625
|
verticalAlign: d = "middle"
|
|
1587
|
-
} =
|
|
1626
|
+
} = r;
|
|
1588
1627
|
this.ctx.font = n, this.ctx.fillStyle = h, this.ctx.textBaseline = d, this.ctx.textAlign = l;
|
|
1589
1628
|
let x = 0;
|
|
1590
|
-
d === "top" ? x = i + f : d === "bottom" ? x = i +
|
|
1629
|
+
d === "top" ? x = i + f : d === "bottom" ? x = i + o - f : x = i + (o + f) / 2;
|
|
1591
1630
|
let u = 0;
|
|
1592
1631
|
l === "left" ? u = e + f : l === "right" ? u = e + s - f : u = e + s / 2;
|
|
1593
1632
|
const { _text: y, ellipsis: g } = this.handleEllipsis(t, s, f);
|
|
1594
1633
|
return this.ctx.fillText(y, u, x), this.ctx.restore(), g;
|
|
1595
1634
|
}
|
|
1596
1635
|
handleEllipsis(t, e, i = 0) {
|
|
1597
|
-
let s = !1,
|
|
1636
|
+
let s = !1, o = t;
|
|
1598
1637
|
if (t == null || t === "")
|
|
1599
1638
|
return {
|
|
1600
1639
|
_text: "",
|
|
1601
1640
|
ellipsis: s
|
|
1602
1641
|
};
|
|
1603
|
-
const
|
|
1604
|
-
if (n && n +
|
|
1642
|
+
const r = this.ctx.measureText("...").width, n = this.ctx.measureText(t).width;
|
|
1643
|
+
if (n && n + r >= e - i * 2) {
|
|
1605
1644
|
s = !0;
|
|
1606
1645
|
let l = 0;
|
|
1607
1646
|
for (let h = 0; h < t.length; h++)
|
|
1608
|
-
if (l += this.ctx.measureText(t[h]).width, l >= e - i * 2 -
|
|
1609
|
-
|
|
1647
|
+
if (l += this.ctx.measureText(t[h]).width, l >= e - i * 2 - r) {
|
|
1648
|
+
o = t.slice(0, h) + "...";
|
|
1610
1649
|
break;
|
|
1611
1650
|
}
|
|
1612
1651
|
}
|
|
1613
1652
|
return {
|
|
1614
|
-
_text:
|
|
1653
|
+
_text: o,
|
|
1615
1654
|
ellipsis: s
|
|
1616
1655
|
};
|
|
1617
1656
|
}
|
|
1618
1657
|
}
|
|
1619
|
-
class
|
|
1658
|
+
class Pt {
|
|
1620
1659
|
constructor(t) {
|
|
1621
1660
|
c(this, "PROCESSOR_NUM", 50);
|
|
1622
1661
|
c(this, "CSS_PREFIX", "e-virt-table");
|
|
@@ -1681,6 +1720,14 @@ class Bt {
|
|
|
1681
1720
|
// 启用单点击立马编辑
|
|
1682
1721
|
c(this, "ENABLE_EDIT_CLICK_SELECTOR", !0);
|
|
1683
1722
|
// 启用点击选择器编辑
|
|
1723
|
+
c(this, "SELECTOR_AREA_MIN_X", 0);
|
|
1724
|
+
// 选择器X最小范围
|
|
1725
|
+
c(this, "SELECTOR_AREA_MAX_X", 0);
|
|
1726
|
+
// 选择器X最大范围,0默认最大colMax
|
|
1727
|
+
c(this, "SELECTOR_AREA_MIN_Y", 0);
|
|
1728
|
+
// 选择器Y最小范围
|
|
1729
|
+
c(this, "SELECTOR_AREA_MAX_Y", 0);
|
|
1730
|
+
// 选择器Y最大范围,0默认rowMax
|
|
1684
1731
|
c(this, "ENABLE_SELECTOR_SINGLE", !1);
|
|
1685
1732
|
c(this, "ENABLE_SELECTOR_SPAN_COL", !0);
|
|
1686
1733
|
c(this, "ENABLE_SELECTOR_SPAN_ROW", !0);
|
|
@@ -1733,7 +1780,7 @@ class Bt {
|
|
|
1733
1780
|
Object.assign(this, t);
|
|
1734
1781
|
}
|
|
1735
1782
|
}
|
|
1736
|
-
class
|
|
1783
|
+
class ai {
|
|
1737
1784
|
constructor(t) {
|
|
1738
1785
|
c(this, "ctx");
|
|
1739
1786
|
c(this, "list", [
|
|
@@ -1807,35 +1854,35 @@ class ii {
|
|
|
1807
1854
|
const i = this.list[e];
|
|
1808
1855
|
let s = i.color;
|
|
1809
1856
|
if (i.configColorName) {
|
|
1810
|
-
const
|
|
1811
|
-
|
|
1857
|
+
const r = this.ctx.config[i.configColorName];
|
|
1858
|
+
r && (s = r);
|
|
1812
1859
|
}
|
|
1813
|
-
const
|
|
1814
|
-
this.icons.set(i.name,
|
|
1860
|
+
const o = this.createImageFromSVG(i.svg, s).then((r) => {
|
|
1861
|
+
this.icons.set(i.name, r);
|
|
1815
1862
|
});
|
|
1816
|
-
t.push(
|
|
1863
|
+
t.push(o);
|
|
1817
1864
|
}
|
|
1818
1865
|
for (let e = 0; e < this.ctx.config.ICONS.length; e++) {
|
|
1819
1866
|
const i = this.ctx.config.ICONS[e];
|
|
1820
1867
|
let s = i.color;
|
|
1821
|
-
const
|
|
1822
|
-
this.icons.set(i.name,
|
|
1868
|
+
const o = this.createImageFromSVG(i.svg, s).then((r) => {
|
|
1869
|
+
this.icons.set(i.name, r);
|
|
1823
1870
|
});
|
|
1824
|
-
t.push(
|
|
1871
|
+
t.push(o);
|
|
1825
1872
|
}
|
|
1826
1873
|
await Promise.all(t), this.ctx.emit("draw");
|
|
1827
1874
|
}
|
|
1828
1875
|
async createImageFromSVG(t, e) {
|
|
1829
|
-
const
|
|
1830
|
-
e &&
|
|
1876
|
+
const o = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
|
|
1877
|
+
e && o.querySelectorAll("*").forEach((h) => {
|
|
1831
1878
|
h.setAttribute("fill", e);
|
|
1832
1879
|
});
|
|
1833
|
-
const
|
|
1880
|
+
const r = new Image(), n = new Blob([new XMLSerializer().serializeToString(o)], {
|
|
1834
1881
|
type: "image/svg+xml"
|
|
1835
1882
|
}), l = URL.createObjectURL(n);
|
|
1836
|
-
return
|
|
1837
|
-
|
|
1838
|
-
h(
|
|
1883
|
+
return r.src = l, new Promise((h, f) => {
|
|
1884
|
+
r.onerror = () => f(new Error("Failed to load image")), r.onload = () => {
|
|
1885
|
+
h(r);
|
|
1839
1886
|
};
|
|
1840
1887
|
});
|
|
1841
1888
|
}
|
|
@@ -1843,8 +1890,8 @@ class ii {
|
|
|
1843
1890
|
return this.icons.get(t);
|
|
1844
1891
|
}
|
|
1845
1892
|
}
|
|
1846
|
-
class
|
|
1847
|
-
constructor(t, e, i, s,
|
|
1893
|
+
class te {
|
|
1894
|
+
constructor(t, e, i, s, o, r, n) {
|
|
1848
1895
|
c(this, "ctx");
|
|
1849
1896
|
c(this, "x", 0);
|
|
1850
1897
|
c(this, "y", 0);
|
|
@@ -1852,13 +1899,13 @@ class Jt {
|
|
|
1852
1899
|
c(this, "height", 0);
|
|
1853
1900
|
c(this, "fixed");
|
|
1854
1901
|
c(this, "cellType");
|
|
1855
|
-
this.ctx = t, this.x = e, this.y = i, this.width = s, this.height =
|
|
1902
|
+
this.ctx = t, this.x = e, this.y = i, this.width = s, this.height = o, this.fixed = r, this.cellType = n;
|
|
1856
1903
|
}
|
|
1857
1904
|
isHorizontalVisible() {
|
|
1858
1905
|
if (this.fixed)
|
|
1859
1906
|
return !0;
|
|
1860
|
-
const { target: t, fixedLeftWidth: e, scrollX: i, fixedRightWidth: s } = this.ctx,
|
|
1861
|
-
return !(this.x + this.width - e - i <= 0 || this.x - i >=
|
|
1907
|
+
const { target: t, fixedLeftWidth: e, scrollX: i, fixedRightWidth: s } = this.ctx, o = t.width;
|
|
1908
|
+
return !(this.x + this.width - e - i <= 0 || this.x - i >= o - s);
|
|
1862
1909
|
}
|
|
1863
1910
|
isVerticalVisible() {
|
|
1864
1911
|
const { target: t, scrollY: e } = this.ctx, i = t.height;
|
|
@@ -1880,11 +1927,12 @@ class Jt {
|
|
|
1880
1927
|
getRightFixedX() {
|
|
1881
1928
|
}
|
|
1882
1929
|
}
|
|
1883
|
-
class
|
|
1884
|
-
constructor(e, i, s,
|
|
1885
|
-
super(e,
|
|
1930
|
+
class ee extends te {
|
|
1931
|
+
constructor(e, i, s, o, r, n, l, h, f, d = "body") {
|
|
1932
|
+
super(e, o, r, n, l, h.fixed, d);
|
|
1886
1933
|
c(this, "formatter");
|
|
1887
1934
|
c(this, "hoverIconName", "");
|
|
1935
|
+
c(this, "operation", !1);
|
|
1888
1936
|
c(this, "align");
|
|
1889
1937
|
c(this, "verticalAlign");
|
|
1890
1938
|
c(this, "fixed");
|
|
@@ -1927,7 +1975,7 @@ class Qt extends Jt {
|
|
|
1927
1975
|
c(this, "overflowTooltipShow", !0);
|
|
1928
1976
|
c(this, "overflowTooltipMaxWidth", 500);
|
|
1929
1977
|
c(this, "overflowTooltipPlacement", "top");
|
|
1930
|
-
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = h.key, this.type = h.type || "text", this.editorType = h.editorType || "text", this.cellType = d, this.align = h.align || "center", this.verticalAlign = h.verticalAlign || "middle", this.fixed = h.fixed, this.level = h.level, this.column = h, this.rules = h.rules, this.row = f, this.rowKey = this.cellType === "body" ? this.ctx.database.getRowKeyForRowIndex(i) : `${this.cellType}_${this.rowIndex}`, this.value = this.getValue(), this.render = h.render, this.overflowTooltipShow = h.overflowTooltipShow !== !1, this.overflowTooltipMaxWidth = h.overflowTooltipMaxWidth || 500, this.overflowTooltipPlacement = h.overflowTooltipPlacement || "top", this.renderFooter = h.renderFooter, this.hoverIconName = h.hoverIconName, this.formatter = h.formatter, this.update();
|
|
1978
|
+
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = h.key, this.type = h.type || "text", this.editorType = h.editorType || "text", this.cellType = d, this.align = h.align || "center", this.verticalAlign = h.verticalAlign || "middle", this.fixed = h.fixed, this.level = h.level, this.operation = h.operation || !1, this.column = h, this.rules = h.rules, this.row = f, this.rowKey = this.cellType === "body" ? this.ctx.database.getRowKeyForRowIndex(i) : `${this.cellType}_${this.rowIndex}`, this.value = this.getValue(), this.render = h.render, this.overflowTooltipShow = h.overflowTooltipShow !== !1, this.overflowTooltipMaxWidth = h.overflowTooltipMaxWidth || 500, this.overflowTooltipPlacement = h.overflowTooltipPlacement || "top", this.renderFooter = h.renderFooter, this.hoverIconName = h.hoverIconName, this.formatter = h.formatter, this.update();
|
|
1931
1979
|
}
|
|
1932
1980
|
getValidationMessage() {
|
|
1933
1981
|
const e = this.ctx.database.getValidationError(this.rowKey, this.key);
|
|
@@ -1945,7 +1993,7 @@ class Qt extends Jt {
|
|
|
1945
1993
|
return;
|
|
1946
1994
|
const { SPAN_METHOD: e } = this.ctx.config;
|
|
1947
1995
|
if (typeof e == "function") {
|
|
1948
|
-
const i = e, { colspan: s = 1, rowspan:
|
|
1996
|
+
const i = e, { colspan: s = 1, rowspan: o = 1 } = i({
|
|
1949
1997
|
row: this.row,
|
|
1950
1998
|
rowIndex: this.rowIndex,
|
|
1951
1999
|
colIndex: this.colIndex,
|
|
@@ -1957,7 +2005,7 @@ class Qt extends Jt {
|
|
|
1957
2005
|
visibleLeafColumns: this.ctx.header.visibleLeafColumns,
|
|
1958
2006
|
rows: this.ctx.body.data
|
|
1959
2007
|
}) || {};
|
|
1960
|
-
this.colspan = s, this.rowspan =
|
|
2008
|
+
this.colspan = s, this.rowspan = o, this.visibleWidth = this.getWidthByColIndexColSpan(this.colIndex, this.colspan), this.visibleHeight = this.ctx.database.getHeightByRowIndexRowSpan(this.rowIndex, this.rowspan);
|
|
1961
2009
|
}
|
|
1962
2010
|
}
|
|
1963
2011
|
updateType() {
|
|
@@ -2019,20 +2067,20 @@ class Qt extends Jt {
|
|
|
2019
2067
|
}
|
|
2020
2068
|
updateTree() {
|
|
2021
2069
|
const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
|
|
2022
|
-
let
|
|
2070
|
+
let o, r = 0, n = "";
|
|
2023
2071
|
if (this.type === "tree" && s === "body") {
|
|
2024
2072
|
const l = this.ctx.database.getRowForRowKey(i), { expand: h = !1, hasChildren: f = !1, expandLoading: d = !1, level: x = 0 } = l || {};
|
|
2025
2073
|
if (d) {
|
|
2026
2074
|
const u = this.ctx.icons.get("loading");
|
|
2027
|
-
n = "loading",
|
|
2075
|
+
n = "loading", o = u, r = x * 8;
|
|
2028
2076
|
} else if (f) {
|
|
2029
2077
|
const u = this.ctx.icons.get("expand"), y = this.ctx.icons.get("shrink");
|
|
2030
|
-
|
|
2078
|
+
o = h ? y : u, n = h ? "shrink" : "expand", r = x * 8;
|
|
2031
2079
|
} else
|
|
2032
|
-
|
|
2033
|
-
if (
|
|
2034
|
-
let u = 20, y = 20, g = this.drawX +
|
|
2035
|
-
this.ctx.paint.drawImage(
|
|
2080
|
+
r = x * 8;
|
|
2081
|
+
if (o) {
|
|
2082
|
+
let u = 20, y = 20, g = this.drawX + r + e, w = this.drawY + (this.visibleHeight - y) / 2 + 2;
|
|
2083
|
+
this.ctx.paint.drawImage(o, g, w, u, y), this.drawImageX = g, this.drawImageY = w, this.drawImageWidth = u, this.drawImageHeight = y, this.drawImageName = n, this.drawImageSource = o, this.align = "left", this.drawTextX = r + this.drawX + u + 0.5;
|
|
2036
2084
|
}
|
|
2037
2085
|
}
|
|
2038
2086
|
}
|
|
@@ -2041,8 +2089,8 @@ class Qt extends Jt {
|
|
|
2041
2089
|
BODY_BG_COLOR: e,
|
|
2042
2090
|
EDIT_BG_COLOR: i,
|
|
2043
2091
|
BODY_CELL_STYLE_METHOD: s,
|
|
2044
|
-
FOOTER_CELL_STYLE_METHOD:
|
|
2045
|
-
READONLY_TEXT_COLOR:
|
|
2092
|
+
FOOTER_CELL_STYLE_METHOD: o,
|
|
2093
|
+
READONLY_TEXT_COLOR: r,
|
|
2046
2094
|
FOOTER_BG_COLOR: n,
|
|
2047
2095
|
HIGHLIGHT_SELECTED_ROW: l,
|
|
2048
2096
|
HIGHLIGHT_SELECTED_ROW_COLOR: h,
|
|
@@ -2050,9 +2098,9 @@ class Qt extends Jt {
|
|
|
2050
2098
|
HIGHLIGHT_HOVER_ROW_COLOR: d
|
|
2051
2099
|
} = this.ctx.config;
|
|
2052
2100
|
if (this.cellType === "footer") {
|
|
2053
|
-
let p = n, E =
|
|
2054
|
-
if (typeof
|
|
2055
|
-
const m =
|
|
2101
|
+
let p = n, E = r;
|
|
2102
|
+
if (typeof o == "function") {
|
|
2103
|
+
const m = o, { backgroundColor: b, color: C } = m({
|
|
2056
2104
|
row: this.row,
|
|
2057
2105
|
rowIndex: this.rowIndex,
|
|
2058
2106
|
colIndex: this.colIndex,
|
|
@@ -2067,12 +2115,12 @@ class Qt extends Jt {
|
|
|
2067
2115
|
let x = "transparent";
|
|
2068
2116
|
const u = this.ctx.focusCell, y = this.ctx.hoverCell;
|
|
2069
2117
|
f && (y == null ? void 0 : y.rowKey) === this.rowKey && (x = d), l && (u == null ? void 0 : u.rowKey) === this.rowKey && (x = h), this.drawCellSkyBgColor = x;
|
|
2070
|
-
let g = e, w =
|
|
2118
|
+
let g = e, w = r;
|
|
2071
2119
|
if (["index", "index-selection", "selection"].includes(this.type)) {
|
|
2072
|
-
this.drawCellBgColor = e, this.drawTextColor =
|
|
2120
|
+
this.drawCellBgColor = e, this.drawTextColor = r;
|
|
2073
2121
|
return;
|
|
2074
2122
|
}
|
|
2075
|
-
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (g = i, w =
|
|
2123
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (g = i, w = r), typeof s == "function") {
|
|
2076
2124
|
const p = s, { backgroundColor: E, color: m } = p({
|
|
2077
2125
|
row: this.row,
|
|
2078
2126
|
rowIndex: this.rowIndex,
|
|
@@ -2085,8 +2133,8 @@ class Qt extends Jt {
|
|
|
2085
2133
|
this.drawCellBgColor = g, this.drawTextColor = w;
|
|
2086
2134
|
}
|
|
2087
2135
|
updateSelection() {
|
|
2088
|
-
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan:
|
|
2089
|
-
if (!(s === 0 ||
|
|
2136
|
+
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: o, cellType: r, type: n, rowIndex: l, rowKey: h } = this;
|
|
2137
|
+
if (!(s === 0 || o === 0) && r !== "footer" && ["index-selection", "selection"].includes(n)) {
|
|
2090
2138
|
const f = this.ctx.database.getRowSelection(h), d = this.ctx.database.getRowSelectable(h), { CHECKBOX_SIZE: x = 0 } = this.ctx.config, u = this.drawX + (e - x) / 2, y = this.drawY + (i - x) / 2;
|
|
2091
2139
|
let g = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck";
|
|
2092
2140
|
f && d ? (g = this.ctx.icons.get("checkbox-check"), w = "checkbox-check") : f && d ? (g = this.ctx.icons.get("checkbox-check-disabled"), w = "checkbox-check-disabled") : !f && d ? (g = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), w = "checkbox-disabled"), g && n == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(w)) && (this.drawImageX = u, this.drawImageY = y, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = g) : g && n === "selection" && (this.drawImageX = u, this.drawImageY = y, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = g);
|
|
@@ -2104,10 +2152,10 @@ class Qt extends Jt {
|
|
|
2104
2152
|
});
|
|
2105
2153
|
l !== void 0 && (this.hoverIconName = l);
|
|
2106
2154
|
}
|
|
2107
|
-
const
|
|
2155
|
+
const o = this.drawX + this.width - i - s, r = this.drawY + (this.height - i) / 2;
|
|
2108
2156
|
if (this.hoverIconName && this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === this.rowIndex) {
|
|
2109
2157
|
const n = this.ctx.icons.get(this.hoverIconName);
|
|
2110
|
-
this.drawImageX =
|
|
2158
|
+
this.drawImageX = o, this.drawImageY = r, this.drawImageWidth = i, this.drawImageHeight = i, this.drawImageName = this.hoverIconName, this.drawImageSource = n;
|
|
2111
2159
|
}
|
|
2112
2160
|
}
|
|
2113
2161
|
/**
|
|
@@ -2163,11 +2211,11 @@ class Qt extends Jt {
|
|
|
2163
2211
|
const {
|
|
2164
2212
|
paint: e,
|
|
2165
2213
|
config: { BORDER_COLOR: i }
|
|
2166
|
-
} = this.ctx, { drawX: s, drawY:
|
|
2167
|
-
e.drawRect(s,
|
|
2214
|
+
} = this.ctx, { drawX: s, drawY: o } = this;
|
|
2215
|
+
e.drawRect(s, o, this.visibleWidth, this.visibleHeight, {
|
|
2168
2216
|
borderColor: i,
|
|
2169
2217
|
fillColor: this.drawCellBgColor
|
|
2170
|
-
}), e.drawRect(s,
|
|
2218
|
+
}), e.drawRect(s, o, this.width, this.height, {
|
|
2171
2219
|
borderColor: "transparent",
|
|
2172
2220
|
borderWidth: 1,
|
|
2173
2221
|
fillColor: this.drawCellSkyBgColor
|
|
@@ -2181,9 +2229,9 @@ class Qt extends Jt {
|
|
|
2181
2229
|
if (i === 0)
|
|
2182
2230
|
return 0;
|
|
2183
2231
|
let s = 0;
|
|
2184
|
-
for (let
|
|
2185
|
-
const
|
|
2186
|
-
s +=
|
|
2232
|
+
for (let o = e; o < e + i; o++) {
|
|
2233
|
+
const r = this.ctx.header.leafCellHeaders[o];
|
|
2234
|
+
s += r.width;
|
|
2187
2235
|
}
|
|
2188
2236
|
return s;
|
|
2189
2237
|
}
|
|
@@ -2219,7 +2267,7 @@ class Qt extends Jt {
|
|
|
2219
2267
|
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s } = this.ctx.config;
|
|
2220
2268
|
if (!s || !i)
|
|
2221
2269
|
return;
|
|
2222
|
-
const { xArr:
|
|
2270
|
+
const { xArr: o, yArr: r } = this.ctx.selector, n = o[1], l = r[1], { colIndex: h, rowIndex: f, drawX: d, drawY: x } = this;
|
|
2223
2271
|
h === n && f === l && this.ctx.paint.drawRect(d + this.width - 6, x + this.height - 6, 6, 6, {
|
|
2224
2272
|
borderColor: "#fff",
|
|
2225
2273
|
fillColor: e
|
|
@@ -2231,10 +2279,10 @@ class Qt extends Jt {
|
|
|
2231
2279
|
const { ENABLE_SELECTOR: e } = this.ctx.config;
|
|
2232
2280
|
if (!e)
|
|
2233
2281
|
return;
|
|
2234
|
-
const { xArr: i, yArr: s, xArrCopy:
|
|
2282
|
+
const { xArr: i, yArr: s, xArrCopy: o, yArrCopy: r } = this.ctx.selector;
|
|
2235
2283
|
this.drawBorder({
|
|
2236
|
-
xArr:
|
|
2237
|
-
yArr:
|
|
2284
|
+
xArr: o,
|
|
2285
|
+
yArr: r,
|
|
2238
2286
|
borderColor: this.ctx.config.SELECT_BORDER_COLOR || "rgb(82,146,247)",
|
|
2239
2287
|
fillColor: this.ctx.config.SELECT_AREA_COLOR || "rgba(82,146,247,0.1)",
|
|
2240
2288
|
borderWidth: 1,
|
|
@@ -2257,13 +2305,13 @@ class Qt extends Jt {
|
|
|
2257
2305
|
drawErrorTip() {
|
|
2258
2306
|
if (this.cellType === "footer" || !this.message)
|
|
2259
2307
|
return;
|
|
2260
|
-
const { ERROR_TIP_ICON_SIZE: e, ERROR_TIP_COLOR: i } = this.ctx.config, { width: s } = this,
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2308
|
+
const { ERROR_TIP_ICON_SIZE: e, ERROR_TIP_COLOR: i } = this.ctx.config, { width: s } = this, o = this.drawX, r = this.drawY, n = [
|
|
2309
|
+
o + s - e - 0.5,
|
|
2310
|
+
r,
|
|
2311
|
+
o + s - 0.5,
|
|
2312
|
+
r,
|
|
2313
|
+
o + s - 0.5,
|
|
2314
|
+
r + e
|
|
2267
2315
|
];
|
|
2268
2316
|
this.ctx.paint.drawLine(n, {
|
|
2269
2317
|
borderColor: i,
|
|
@@ -2274,32 +2322,32 @@ class Qt extends Jt {
|
|
|
2274
2322
|
});
|
|
2275
2323
|
}
|
|
2276
2324
|
drawBorder(e) {
|
|
2277
|
-
const { drawX: i, drawY: s, width:
|
|
2325
|
+
const { drawX: i, drawY: s, width: o, rowIndex: r, colIndex: n } = this, l = i + 0.5;
|
|
2278
2326
|
let h = s + 0.5, f = this.height;
|
|
2279
|
-
|
|
2327
|
+
r === 0 && (h = this.y + 1, f = f - 1);
|
|
2280
2328
|
const { xArr: d, yArr: x, lineDash: u = [], borderWidth: y = 1, borderColor: g, fillColor: w } = e, p = d[0], E = d[1], m = x[0], b = x[1];
|
|
2281
|
-
n >= p && n <= E &&
|
|
2329
|
+
n >= p && n <= E && r === m && this.ctx.paint.drawLine([l, h, l + o - 2, h], {
|
|
2282
2330
|
borderColor: g,
|
|
2283
2331
|
fillColor: w,
|
|
2284
2332
|
borderWidth: y,
|
|
2285
2333
|
lineCap: "round",
|
|
2286
2334
|
lineJoin: "round",
|
|
2287
2335
|
lineDash: u
|
|
2288
|
-
}), n >= p && n <= E &&
|
|
2336
|
+
}), n >= p && n <= E && r === b && this.ctx.paint.drawLine([l, h + f - 1.5, l + o, h + f - 1.5], {
|
|
2289
2337
|
borderColor: g,
|
|
2290
2338
|
fillColor: w,
|
|
2291
2339
|
borderWidth: y,
|
|
2292
2340
|
lineCap: "round",
|
|
2293
2341
|
lineJoin: "round",
|
|
2294
2342
|
lineDash: u
|
|
2295
|
-
}), n === p &&
|
|
2343
|
+
}), n === p && r >= m && r <= b && this.ctx.paint.drawLine([l, h, l, h + f - 1], {
|
|
2296
2344
|
borderColor: g,
|
|
2297
2345
|
fillColor: w,
|
|
2298
2346
|
borderWidth: y,
|
|
2299
2347
|
lineCap: "round",
|
|
2300
2348
|
lineJoin: "round",
|
|
2301
2349
|
lineDash: u
|
|
2302
|
-
}), n === E &&
|
|
2350
|
+
}), n === E && r >= m && r <= b && this.ctx.paint.drawLine([l + o - 1, h, l + o - 1, h + f - 1], {
|
|
2303
2351
|
borderColor: g,
|
|
2304
2352
|
fillColor: w,
|
|
2305
2353
|
borderWidth: y,
|
|
@@ -2309,14 +2357,15 @@ class Qt extends Jt {
|
|
|
2309
2357
|
});
|
|
2310
2358
|
}
|
|
2311
2359
|
}
|
|
2312
|
-
class
|
|
2313
|
-
constructor(e, i, s,
|
|
2314
|
-
super(e, s,
|
|
2360
|
+
class ie extends te {
|
|
2361
|
+
constructor(e, i, s, o, r, n, l) {
|
|
2362
|
+
super(e, s, o, r, n, l.fixed, "header");
|
|
2315
2363
|
c(this, "align");
|
|
2316
2364
|
c(this, "verticalAlign", "middle");
|
|
2317
2365
|
c(this, "fixed");
|
|
2318
2366
|
c(this, "widthFillDisable");
|
|
2319
2367
|
c(this, "type");
|
|
2368
|
+
c(this, "operation", !1);
|
|
2320
2369
|
c(this, "editorType");
|
|
2321
2370
|
c(this, "level");
|
|
2322
2371
|
c(this, "text");
|
|
@@ -2344,7 +2393,7 @@ class te extends Jt {
|
|
|
2344
2393
|
c(this, "drawImageHeight", 0);
|
|
2345
2394
|
c(this, "drawImageName", "");
|
|
2346
2395
|
c(this, "drawImageSource");
|
|
2347
|
-
this.ctx = e, this.x = s, this.y =
|
|
2396
|
+
this.ctx = e, this.x = s, this.y = o, this.width = r, this.height = n, this.colIndex = i, this.key = l.key, this.type = l.type, this.editorType = l.editorType || "text", this.align = l.align || "center", this.verticalAlign = l.verticalAlign || "middle", this.fixed = l.fixed, this.level = l.level, this.operation = l.operation || !1, this.text = l.title, this.column = l, this.colspan = l.colspan, this.widthFillDisable = l.widthFillDisable, this.rowspan = l.rowspan, this.rules = l.rules, this.readonly = l.readonly, this.required = l.required, this.rowKey = At(), this.hasChildren = l.children && l.children.length > 0 || !1, this.render = l.renderHeader;
|
|
2348
2397
|
}
|
|
2349
2398
|
/**
|
|
2350
2399
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -2362,15 +2411,15 @@ class te extends Jt {
|
|
|
2362
2411
|
}
|
|
2363
2412
|
updateContainer() {
|
|
2364
2413
|
const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
|
|
2365
|
-
let
|
|
2414
|
+
let o = i, r = s;
|
|
2366
2415
|
if (typeof e == "function") {
|
|
2367
2416
|
const n = e, { backgroundColor: l, color: h } = n({
|
|
2368
2417
|
colIndex: this.colIndex,
|
|
2369
2418
|
column: this.column
|
|
2370
2419
|
}) || {};
|
|
2371
|
-
l && (
|
|
2420
|
+
l && (o = l), h && (r = h);
|
|
2372
2421
|
}
|
|
2373
|
-
this.drawCellBgColor =
|
|
2422
|
+
this.drawCellBgColor = o, this.drawTextColor = r;
|
|
2374
2423
|
}
|
|
2375
2424
|
update() {
|
|
2376
2425
|
this.updateContainer(), this.displayText = this.getText(), this.drawX = this.getDrawX(), this.drawY = this.getDrawY(), this.updateStyle();
|
|
@@ -2378,13 +2427,13 @@ class te extends Jt {
|
|
|
2378
2427
|
draw() {
|
|
2379
2428
|
const {
|
|
2380
2429
|
paint: e,
|
|
2381
|
-
config: { BORDER_COLOR: i, CELL_PADDING: s, HEADER_FONT:
|
|
2382
|
-
} = this.ctx, { drawX:
|
|
2383
|
-
e.drawRect(
|
|
2430
|
+
config: { BORDER_COLOR: i, CELL_PADDING: s, HEADER_FONT: o }
|
|
2431
|
+
} = this.ctx, { drawX: r, drawY: n, displayText: l } = this;
|
|
2432
|
+
e.drawRect(r, n, this.width, this.height, {
|
|
2384
2433
|
borderColor: i,
|
|
2385
2434
|
fillColor: this.drawCellBgColor
|
|
2386
|
-
}), e.drawText(l,
|
|
2387
|
-
font:
|
|
2435
|
+
}), e.drawText(l, r, n, this.width, this.height, {
|
|
2436
|
+
font: o,
|
|
2388
2437
|
padding: s,
|
|
2389
2438
|
color: this.drawTextColor,
|
|
2390
2439
|
align: this.align,
|
|
@@ -2394,9 +2443,9 @@ class te extends Jt {
|
|
|
2394
2443
|
drawSelection() {
|
|
2395
2444
|
const { width: e, height: i, type: s } = this;
|
|
2396
2445
|
if (["index-selection", "selection"].includes(s)) {
|
|
2397
|
-
const { indeterminate:
|
|
2446
|
+
const { indeterminate: o, check: r, selectable: n } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: l = 0 } = this.ctx.config, h = this.drawX + (e - l) / 2, f = this.drawY + (i - l) / 2;
|
|
2398
2447
|
let d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck";
|
|
2399
|
-
|
|
2448
|
+
o ? (d = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : r && n ? (d = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : r && n ? (d = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !r && n ? (d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (d = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), d && (this.drawImageX = h, this.drawImageY = f, this.drawImageWidth = l, this.drawImageHeight = l, this.drawImageName = x, this.drawImageSource = d, this.ctx.paint.drawImage(
|
|
2400
2449
|
this.drawImageSource,
|
|
2401
2450
|
this.drawImageX,
|
|
2402
2451
|
this.drawImageY,
|
|
@@ -2424,7 +2473,7 @@ class te extends Jt {
|
|
|
2424
2473
|
};
|
|
2425
2474
|
}
|
|
2426
2475
|
}
|
|
2427
|
-
class
|
|
2476
|
+
class ci {
|
|
2428
2477
|
constructor(t) {
|
|
2429
2478
|
c(this, "ctx");
|
|
2430
2479
|
c(this, "visibleHoverCell");
|
|
@@ -2438,16 +2487,16 @@ class si {
|
|
|
2438
2487
|
if (t.button !== 0 || this.isBusy(t))
|
|
2439
2488
|
return;
|
|
2440
2489
|
const e = t.offsetY, i = t.offsetX, s = this.ctx.header.renderCellHeaders;
|
|
2441
|
-
for (const
|
|
2442
|
-
const n =
|
|
2443
|
-
if (i > n && i < n +
|
|
2444
|
-
this.ctx.focusCellHeader =
|
|
2490
|
+
for (const r of s) {
|
|
2491
|
+
const n = r.getDrawX(), l = r.getDrawY();
|
|
2492
|
+
if (i > n && i < n + r.width && e > l && e < l + r.height) {
|
|
2493
|
+
this.ctx.focusCellHeader = r, this.ctx.emit("cellHeaderMousedown", r, t);
|
|
2445
2494
|
return;
|
|
2446
2495
|
}
|
|
2447
2496
|
}
|
|
2448
|
-
const
|
|
2449
|
-
for (const
|
|
2450
|
-
const n =
|
|
2497
|
+
const o = this.ctx.body.renderRows;
|
|
2498
|
+
for (const r of o) {
|
|
2499
|
+
const n = r.fixedCells.concat(r.noFixedCells);
|
|
2451
2500
|
for (const l of n) {
|
|
2452
2501
|
const h = l.getDrawX(), f = l.getDrawY();
|
|
2453
2502
|
if (i > h && i < h + l.width && e > f && e < f + l.height) {
|
|
@@ -2460,16 +2509,16 @@ class si {
|
|
|
2460
2509
|
if (t.button !== 0 || this.isBusy(t))
|
|
2461
2510
|
return;
|
|
2462
2511
|
const e = t.offsetY, i = t.offsetX, s = this.ctx.header.renderCellHeaders;
|
|
2463
|
-
for (const
|
|
2464
|
-
const n =
|
|
2465
|
-
if (i > n && i < n +
|
|
2466
|
-
this.ctx.clickCellHeader =
|
|
2512
|
+
for (const r of s) {
|
|
2513
|
+
const n = r.getDrawX(), l = r.getDrawY();
|
|
2514
|
+
if (i > n && i < n + r.width && e > l && e < l + r.height) {
|
|
2515
|
+
this.ctx.clickCellHeader = r, this.ctx.emit("cellHeaderClick", r, t), this.selectionClick(r);
|
|
2467
2516
|
return;
|
|
2468
2517
|
}
|
|
2469
2518
|
}
|
|
2470
|
-
const
|
|
2471
|
-
for (const
|
|
2472
|
-
const n =
|
|
2519
|
+
const o = this.ctx.body.renderRows;
|
|
2520
|
+
for (const r of o) {
|
|
2521
|
+
const n = r.fixedCells.concat(r.noFixedCells);
|
|
2473
2522
|
for (const l of n) {
|
|
2474
2523
|
const h = l.getDrawX(), f = l.getDrawY();
|
|
2475
2524
|
if (i > h && i < h + l.width && e > f && e < f + l.height) {
|
|
@@ -2482,16 +2531,16 @@ class si {
|
|
|
2482
2531
|
if (this.isBusy(t))
|
|
2483
2532
|
return;
|
|
2484
2533
|
const e = t.offsetY, i = t.offsetX, s = this.ctx.header.renderCellHeaders;
|
|
2485
|
-
for (const
|
|
2486
|
-
const n =
|
|
2487
|
-
if (i > n && i < n +
|
|
2488
|
-
this.ctx.emit("cellHeaderContextMenuClick",
|
|
2534
|
+
for (const r of s) {
|
|
2535
|
+
const n = r.getDrawX(), l = r.getDrawY();
|
|
2536
|
+
if (i > n && i < n + r.width && e > l && e < l + r.height) {
|
|
2537
|
+
this.ctx.emit("cellHeaderContextMenuClick", r, t);
|
|
2489
2538
|
return;
|
|
2490
2539
|
}
|
|
2491
2540
|
}
|
|
2492
|
-
const
|
|
2493
|
-
for (const
|
|
2494
|
-
const n =
|
|
2541
|
+
const o = this.ctx.body.renderRows;
|
|
2542
|
+
for (const r of o) {
|
|
2543
|
+
const n = r.fixedCells.concat(r.noFixedCells);
|
|
2495
2544
|
for (const l of n) {
|
|
2496
2545
|
const h = l.getDrawX(), f = l.getDrawY();
|
|
2497
2546
|
if (i > h && i < h + l.width && e > f && e < f + l.height) {
|
|
@@ -2501,7 +2550,7 @@ class si {
|
|
|
2501
2550
|
}
|
|
2502
2551
|
}
|
|
2503
2552
|
}), this.ctx.on("mousemove", (t) => {
|
|
2504
|
-
var
|
|
2553
|
+
var r;
|
|
2505
2554
|
if (this.isBusy(t))
|
|
2506
2555
|
return;
|
|
2507
2556
|
const e = t.offsetY, i = t.offsetX, s = this.ctx.header.renderCellHeaders;
|
|
@@ -2514,14 +2563,14 @@ class si {
|
|
|
2514
2563
|
return;
|
|
2515
2564
|
}
|
|
2516
2565
|
}
|
|
2517
|
-
const
|
|
2518
|
-
for (const n of
|
|
2566
|
+
const o = this.ctx.body.renderRows;
|
|
2567
|
+
for (const n of o) {
|
|
2519
2568
|
const l = n.fixedCells.concat(n.noFixedCells);
|
|
2520
2569
|
for (const h of l) {
|
|
2521
2570
|
const f = h.getDrawX(), d = h.getDrawY();
|
|
2522
2571
|
if (i > f && i < f + h.visibleWidth && e > d && e < d + h.visibleHeight && (this.imageEnterAndLeave(h, t), this.visibleHoverCell !== h && (this.ctx.emit("visibleCellMouseleave", h, t), this.visibleHoverCell = h, this.ctx.emit("visibleCellHoverChange", h, t))), i > f && i < f + h.width && e > d && e < d + h.height) {
|
|
2523
2572
|
if (this.ctx.emit("cellMouseenter", h, t), this.ctx.hoverCell && this.ctx.hoverCell !== h && this.ctx.emit("cellMouseleave", this.ctx.hoverCell, t), this.ctx.hoverCell === h) return;
|
|
2524
|
-
((
|
|
2573
|
+
((r = this.ctx.hoverCell) == null ? void 0 : r.rowKey) !== h.rowKey && (this.ctx.hoverCell = h, this.ctx.hoverRow = this.ctx.body.renderRows.find((x) => x.rowKey === h.rowKey), this.ctx.emit("rowHoverChange", this.ctx.hoverRow, h, t), this.ctx.emit("draw")), this.ctx.hoverCell = h, this.ctx.emit("cellHoverChange", h, t);
|
|
2525
2574
|
return;
|
|
2526
2575
|
}
|
|
2527
2576
|
}
|
|
@@ -2534,7 +2583,7 @@ class si {
|
|
|
2534
2583
|
*/
|
|
2535
2584
|
selectionClick(t) {
|
|
2536
2585
|
if (["selection", "index-selection"].includes(t.type) && this.ctx.isPointer)
|
|
2537
|
-
if (t instanceof
|
|
2586
|
+
if (t instanceof ie)
|
|
2538
2587
|
t.drawImageName === "checkbox-uncheck" || t.drawImageName === "checkbox-indeterminate" ? this.ctx.database.toggleAllSelection() : t.drawImageName === "checkbox-check" && this.ctx.database.clearSelection();
|
|
2539
2588
|
else {
|
|
2540
2589
|
if (!this.ctx.database.getRowSelectable(t.rowKey))
|
|
@@ -2548,9 +2597,9 @@ class si {
|
|
|
2548
2597
|
*/
|
|
2549
2598
|
treeClick(t) {
|
|
2550
2599
|
if (t.type === "tree" && this.ctx.isPointer) {
|
|
2551
|
-
const e = this.ctx.database.getRowForRowKey(t.rowKey), { expand: i = !1, expandLazy: s = !1 } = e || {}, { EXPAND_LAZY:
|
|
2552
|
-
if (
|
|
2553
|
-
typeof
|
|
2600
|
+
const e = this.ctx.database.getRowForRowKey(t.rowKey), { expand: i = !1, expandLazy: s = !1 } = e || {}, { EXPAND_LAZY: o, EXPAND_LAZY_METHOD: r } = this.ctx.config;
|
|
2601
|
+
if (o && r && !i && !s)
|
|
2602
|
+
typeof r == "function" && (this.ctx.database.expandLoading(t.rowKey, !0), r({
|
|
2554
2603
|
row: t.row,
|
|
2555
2604
|
rowIndex: t.rowIndex,
|
|
2556
2605
|
colIndex: t.colIndex,
|
|
@@ -2574,7 +2623,7 @@ class si {
|
|
|
2574
2623
|
*/
|
|
2575
2624
|
imageEnterAndLeave(t, e) {
|
|
2576
2625
|
const i = e.offsetY, s = e.offsetX;
|
|
2577
|
-
s > t.drawImageX && s < t.drawImageX + t.drawImageWidth && i > t.drawImageY && i < t.drawImageY + t.drawImageHeight ? (this.ctx.target.style.cursor = "pointer", this.ctx.isPointer = !0, t instanceof
|
|
2626
|
+
s > t.drawImageX && s < t.drawImageX + t.drawImageWidth && i > t.drawImageY && i < t.drawImageY + t.drawImageHeight ? (this.ctx.target.style.cursor = "pointer", this.ctx.isPointer = !0, t instanceof ee && ["selection", "index-selection"].includes(t.type) && (this.ctx.database.getRowSelectable(t.rowKey) || (this.ctx.target.style.cursor = "not-allowed"))) : (this.ctx.isPointer = !1, this.ctx.target.style.cursor === "pointer" && (this.ctx.target.style.cursor = "default"));
|
|
2578
2627
|
}
|
|
2579
2628
|
isBusy(t) {
|
|
2580
2629
|
const e = t.offsetY, i = t.offsetX;
|
|
@@ -2587,7 +2636,7 @@ class si {
|
|
|
2587
2636
|
this.resizeObserver.unobserve(this.ctx.target);
|
|
2588
2637
|
}
|
|
2589
2638
|
}
|
|
2590
|
-
class
|
|
2639
|
+
class li {
|
|
2591
2640
|
constructor(t, e, i) {
|
|
2592
2641
|
c(this, "eventBus");
|
|
2593
2642
|
c(this, "eventBrowser");
|
|
@@ -2678,10 +2727,10 @@ class ri {
|
|
|
2678
2727
|
c(this, "database");
|
|
2679
2728
|
c(this, "history");
|
|
2680
2729
|
c(this, "config");
|
|
2681
|
-
this.target = e, this.targetContainer = t, this.target.setAttribute("uuid", this.uuid), this.config = new
|
|
2730
|
+
this.target = e, this.targetContainer = t, this.target.setAttribute("uuid", this.uuid), this.config = new Pt(i.config || {}), this.eventBus = new oi(), this.eventBrowser = new ri(this), this.eventTable = new ci(this), this.paint = new ni(e), this.database = new ii(this, i), this.history = new si(this), this.icons = new ai(this);
|
|
2682
2731
|
}
|
|
2683
2732
|
setConfig(t) {
|
|
2684
|
-
this.config = new
|
|
2733
|
+
this.config = new Pt(t);
|
|
2685
2734
|
}
|
|
2686
2735
|
setFocusCell(t) {
|
|
2687
2736
|
var e;
|
|
@@ -2710,13 +2759,13 @@ class ri {
|
|
|
2710
2759
|
getSelectedData() {
|
|
2711
2760
|
const t = [], e = this.selector.yArr, i = this.selector.xArr;
|
|
2712
2761
|
let s = "";
|
|
2713
|
-
for (let
|
|
2714
|
-
const
|
|
2762
|
+
for (let o = 0; o <= e[1] - e[0]; o++) {
|
|
2763
|
+
const r = [];
|
|
2715
2764
|
for (let n = 0; n <= i[1] - i[0]; n++) {
|
|
2716
|
-
const l =
|
|
2717
|
-
f &&
|
|
2765
|
+
const l = o + e[0], h = n + i[0], f = this.database.getItemValueForRowIndexAndColIndex(l, h);
|
|
2766
|
+
f && r.push(f.value);
|
|
2718
2767
|
}
|
|
2719
|
-
s += `${
|
|
2768
|
+
s += `${r.join(" ")}\r`, t.push(r);
|
|
2720
2769
|
}
|
|
2721
2770
|
return s = s ? s.replace(/\r$/, "") : " ", {
|
|
2722
2771
|
xArr: i,
|
|
@@ -2729,9 +2778,9 @@ class ri {
|
|
|
2729
2778
|
let i = Math.floor(t);
|
|
2730
2779
|
const s = this.body.width - this.body.visibleWidth;
|
|
2731
2780
|
i < 0 ? i = 0 : i > s && (i = s);
|
|
2732
|
-
let
|
|
2733
|
-
const
|
|
2734
|
-
|
|
2781
|
+
let o = Math.floor(e);
|
|
2782
|
+
const r = this.body.height - this.body.visibleHeight - this.footer.height;
|
|
2783
|
+
o < 0 ? o = 0 : o > r && (o = r), this.emit("setScroll", i, o);
|
|
2735
2784
|
}
|
|
2736
2785
|
setScrollX(t) {
|
|
2737
2786
|
let e = Math.floor(t);
|
|
@@ -2767,7 +2816,7 @@ class ri {
|
|
|
2767
2816
|
this.eventTable.destroy(), this.eventBrowser.destroy(), this.eventBus.destroy();
|
|
2768
2817
|
}
|
|
2769
2818
|
}
|
|
2770
|
-
class
|
|
2819
|
+
class Vt {
|
|
2771
2820
|
constructor(t, e) {
|
|
2772
2821
|
c(this, "ctx");
|
|
2773
2822
|
c(this, "type");
|
|
@@ -2798,13 +2847,13 @@ class Wt {
|
|
|
2798
2847
|
this.updateScroll(t);
|
|
2799
2848
|
}
|
|
2800
2849
|
onMouseDown(t) {
|
|
2801
|
-
const { offsetX: e, offsetY: i, clientX: s, clientY:
|
|
2802
|
-
if (!(s == this.clientX &&
|
|
2850
|
+
const { offsetX: e, offsetY: i, clientX: s, clientY: o } = t;
|
|
2851
|
+
if (!(s == this.clientX && o == this.clientY)) {
|
|
2803
2852
|
if (this.isOnScrollbar(e, i))
|
|
2804
|
-
this.clientX = s, this.clientY =
|
|
2853
|
+
this.clientX = s, this.clientY = o, this.isDragging = !0, this.ctx.scrollerMove = !0, this.isFocus = !0, this.dragStart = this.scroll;
|
|
2805
2854
|
else if (this.isOnTrack(e, i)) {
|
|
2806
|
-
let
|
|
2807
|
-
this.type === "vertical" ?
|
|
2855
|
+
let r = 0;
|
|
2856
|
+
this.type === "vertical" ? r = (i - this.ctx.header.height - this.barHeight / 2) / (this.visibleDistance - this.barHeight) * this.distance : r = (e - this.barWidth / 2) / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(r, this.distance));
|
|
2808
2857
|
}
|
|
2809
2858
|
}
|
|
2810
2859
|
}
|
|
@@ -2812,16 +2861,16 @@ class Wt {
|
|
|
2812
2861
|
this.isDragging = !1, this.isFocus = !1, this.clientX = 0, this.clientY = 0;
|
|
2813
2862
|
}
|
|
2814
2863
|
onMouseMove(t) {
|
|
2815
|
-
const { offsetX: e, offsetY: i, clientX: s, clientY:
|
|
2816
|
-
if (this.isOnScrollbar(e, i) && t.target === this.ctx.target ? this.isFocus = !0 : this.isFocus = !1, s == this.clientX &&
|
|
2817
|
-
let
|
|
2818
|
-
if (this.type === "horizontal" ?
|
|
2864
|
+
const { offsetX: e, offsetY: i, clientX: s, clientY: o } = t;
|
|
2865
|
+
if (this.isOnScrollbar(e, i) && t.target === this.ctx.target ? this.isFocus = !0 : this.isFocus = !1, s == this.clientX && o == this.clientY) return;
|
|
2866
|
+
let r = 0;
|
|
2867
|
+
if (this.type === "horizontal" ? r = s - this.clientX : r = o - this.clientY, this.isDragging && r !== 0) {
|
|
2819
2868
|
let n = 0;
|
|
2820
|
-
this.type === "vertical" ? n = this.dragStart +
|
|
2869
|
+
this.type === "vertical" ? n = this.dragStart + r / (this.visibleDistance - this.barHeight) * this.distance : n = this.dragStart + r / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(n, this.distance));
|
|
2821
2870
|
}
|
|
2822
2871
|
}
|
|
2823
|
-
isPointInElement(t, e, i, s,
|
|
2824
|
-
return t >= i && t <= i +
|
|
2872
|
+
isPointInElement(t, e, i, s, o, r) {
|
|
2873
|
+
return t >= i && t <= i + o && e >= s && e <= s + r;
|
|
2825
2874
|
}
|
|
2826
2875
|
isOnScrollbar(t, e) {
|
|
2827
2876
|
return this.isPointInElement(t, e, this.barX, this.barY, this.barWidth, this.barHeight);
|
|
@@ -2838,19 +2887,19 @@ class Wt {
|
|
|
2838
2887
|
body: t,
|
|
2839
2888
|
header: e,
|
|
2840
2889
|
config: { SCROLLER_TRACK_SIZE: i = 0, SCROLLER_SIZE: s = 0 }
|
|
2841
|
-
} = this.ctx,
|
|
2890
|
+
} = this.ctx, o = this.ctx.target.width + 1, r = this.ctx.target.height, n = e.height, l = e.width, h = t.height, f = this.ctx.footer.height;
|
|
2842
2891
|
if (this.type === "vertical") {
|
|
2843
|
-
this.visibleDistance =
|
|
2892
|
+
this.visibleDistance = r - i - n, this.distance = h - this.visibleDistance + f, this.trackX = o - i, this.trackY = 0, this.splitPoints = [this.trackX, n, this.trackX + i, n], this.trackWidth = i, this.trackHeight = r, this.barX = this.trackX + (i - s) / 2, this.barWidth = s;
|
|
2844
2893
|
const d = this.distance ? this.visibleDistance / h : 0;
|
|
2845
2894
|
let x = Math.floor(d * this.visibleDistance);
|
|
2846
2895
|
x < 30 ? x = 30 : x > this.visibleDistance && (x = 0), this.barHeight = x, this.barY = n + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
2847
2896
|
} else {
|
|
2848
|
-
this.visibleDistance =
|
|
2849
|
-
r - i,
|
|
2897
|
+
this.visibleDistance = o - i, this.distance = l - this.visibleDistance, this.splitPoints = [
|
|
2850
2898
|
o - i,
|
|
2851
2899
|
r - i,
|
|
2852
|
-
o
|
|
2853
|
-
|
|
2900
|
+
o - i,
|
|
2901
|
+
r
|
|
2902
|
+
], this.trackX = 0, this.trackY = r - i, this.trackWidth = o, this.trackHeight = i;
|
|
2854
2903
|
const d = this.distance ? this.visibleDistance / l : 0;
|
|
2855
2904
|
let x = Math.floor(d * this.visibleDistance);
|
|
2856
2905
|
this.barY = this.trackY + 0.5 + (i - s) / 2, x < 30 ? x = 30 : x >= this.visibleDistance && (x = 0), this.barWidth = x, this.barHeight = s, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
@@ -2872,12 +2921,12 @@ class Wt {
|
|
|
2872
2921
|
}), this.ctx.scrollerFocus = this.isFocus;
|
|
2873
2922
|
}
|
|
2874
2923
|
}
|
|
2875
|
-
class
|
|
2924
|
+
class hi {
|
|
2876
2925
|
constructor(t) {
|
|
2877
2926
|
c(this, "ctx");
|
|
2878
2927
|
c(this, "verticalScrollbar");
|
|
2879
2928
|
c(this, "horizontalScrollbar");
|
|
2880
|
-
this.ctx = t, this.verticalScrollbar = new
|
|
2929
|
+
this.ctx = t, this.verticalScrollbar = new Vt(t, "vertical"), this.horizontalScrollbar = new Vt(t, "horizontal"), this.ctx.on("wheel", (e) => this.onWheel(e)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("setScroll", (e, i) => {
|
|
2881
2930
|
this.setScroll(e, i);
|
|
2882
2931
|
}), this.ctx.on("setScrollX", (e) => {
|
|
2883
2932
|
this.setScrollX(e);
|
|
@@ -2924,11 +2973,11 @@ class oi {
|
|
|
2924
2973
|
s > e.visibleHeight && this.setScrollY(s - e.visibleHeight / 2);
|
|
2925
2974
|
}
|
|
2926
2975
|
scrollToRowKey(t) {
|
|
2927
|
-
const { body: e, database: i } = this.ctx, s = i.getRowIndexForRowKey(t), { top:
|
|
2928
|
-
this.setScrollY(
|
|
2976
|
+
const { body: e, database: i } = this.ctx, s = i.getRowIndexForRowKey(t), { top: o } = i.getPositionForRowIndex(s);
|
|
2977
|
+
this.setScrollY(o - e.visibleHeight / 2);
|
|
2929
2978
|
}
|
|
2930
2979
|
}
|
|
2931
|
-
class
|
|
2980
|
+
class di {
|
|
2932
2981
|
constructor(t) {
|
|
2933
2982
|
c(this, "ctx");
|
|
2934
2983
|
// 上下文
|
|
@@ -2967,7 +3016,7 @@ class ni {
|
|
|
2967
3016
|
c(this, "renderFixedCellHeaders", []);
|
|
2968
3017
|
this.ctx = t, this.ctx.on(
|
|
2969
3018
|
"resetHeader",
|
|
2970
|
-
|
|
3019
|
+
Zt(() => {
|
|
2971
3020
|
this.init(), this.ctx.emit("draw");
|
|
2972
3021
|
}, 100)
|
|
2973
3022
|
), this.init(), this.initResizeColumn();
|
|
@@ -2977,10 +3026,10 @@ class ni {
|
|
|
2977
3026
|
config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
|
|
2978
3027
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
2979
3028
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
2980
|
-
const s =
|
|
2981
|
-
this.height = t * s, this.width =
|
|
2982
|
-
const
|
|
2983
|
-
this.columnIndex = 0, this.resizeNum = 0, this.render(
|
|
3029
|
+
const s = Jt(i), o = It(i);
|
|
3030
|
+
this.height = t * s, this.width = o.reduce((d, x) => d + ((x == null ? void 0 : x.width) || 100), 0), this.visibleHeight = this.height;
|
|
3031
|
+
const r = Je(Qt(i, s));
|
|
3032
|
+
this.columnIndex = 0, this.resizeNum = 0, this.render(r, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
2984
3033
|
const n = this.ctx.targetContainer.getBoundingClientRect();
|
|
2985
3034
|
this.resizeNum > 0 ? this.ctx.target.width = n.width : this.ctx.target.width = this.width + e - 1, this.visibleWidth = this.ctx.target.width - e;
|
|
2986
3035
|
const l = this.visibleWidth - this.width;
|
|
@@ -3009,36 +3058,36 @@ class ni {
|
|
|
3009
3058
|
config: { RESIZE_COLUMN_MIN_WIDTH: s }
|
|
3010
3059
|
} = this.ctx;
|
|
3011
3060
|
if (this.isResizing && this.resizeTarget) {
|
|
3012
|
-
const
|
|
3013
|
-
let
|
|
3014
|
-
|
|
3061
|
+
const o = this.resizeTarget.width;
|
|
3062
|
+
let r = e.offsetX - this.offsetX;
|
|
3063
|
+
r + o < s && (r = -(o - s)), this.resizeDiff = r, this.ctx.emit("draw");
|
|
3015
3064
|
} else {
|
|
3016
3065
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
3017
3066
|
return;
|
|
3018
3067
|
this.ctx.target.style.cursor === "col-resize" && (this.ctx.target.style.cursor = "default");
|
|
3019
|
-
const
|
|
3020
|
-
for (const
|
|
3021
|
-
const n = e.layerX, l =
|
|
3022
|
-
n > l +
|
|
3023
|
-
|
|
3068
|
+
const o = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
3069
|
+
for (const r of o) {
|
|
3070
|
+
const n = e.layerX, l = r.getDrawX();
|
|
3071
|
+
n > l + r.width - 5 && n < l + r.width + 4 && n < i.width - 4 && // 视窗中最后一列不允许调整宽
|
|
3072
|
+
r.colspan <= 1 && e.target instanceof HTMLCanvasElement && this.ctx.isTarget(e.target) && e.layerY <= this.height && (this.ctx.target.style.cursor = "col-resize", this.resizeTarget = r);
|
|
3024
3073
|
}
|
|
3025
3074
|
}
|
|
3026
3075
|
}));
|
|
3027
3076
|
}
|
|
3028
3077
|
resizeColumn(t, e) {
|
|
3029
|
-
const i = (
|
|
3030
|
-
|
|
3031
|
-
if (
|
|
3032
|
-
const n =
|
|
3033
|
-
|
|
3078
|
+
const i = (o) => {
|
|
3079
|
+
o.forEach((r) => {
|
|
3080
|
+
if (r.children && r.children.length > 0 && i(r.children), r.key === t.key) {
|
|
3081
|
+
const n = r.width || 100;
|
|
3082
|
+
r.width = n + e;
|
|
3034
3083
|
}
|
|
3035
3084
|
});
|
|
3036
3085
|
};
|
|
3037
3086
|
i(this.columns), this.ctx.database.setColumns(this.columns), this.init(), this.ctx.emit("draw");
|
|
3038
3087
|
let s = 0;
|
|
3039
3088
|
if (this.width < this.visibleWidth) {
|
|
3040
|
-
const
|
|
3041
|
-
s = Math.floor(
|
|
3089
|
+
const o = this.visibleWidth - this.width;
|
|
3090
|
+
s = Math.floor(o / this.resizeNum * 100) / 100, this.resizeAllColumn(s), this.ctx.emit("draw");
|
|
3042
3091
|
}
|
|
3043
3092
|
this.ctx.emit("resizeColumnChange", {
|
|
3044
3093
|
colIndex: t.colIndex,
|
|
@@ -3053,18 +3102,18 @@ class ni {
|
|
|
3053
3102
|
if (t === 0) return;
|
|
3054
3103
|
const e = /* @__PURE__ */ new Map();
|
|
3055
3104
|
let i = !0;
|
|
3056
|
-
for (const
|
|
3057
|
-
if (
|
|
3058
|
-
e.set(
|
|
3105
|
+
for (const o of this.allCellHeaders)
|
|
3106
|
+
if (o.widthFillDisable)
|
|
3107
|
+
e.set(o.key, o.width);
|
|
3059
3108
|
else {
|
|
3060
|
-
const
|
|
3061
|
-
e.set(
|
|
3109
|
+
const r = o.width + t * o.colspan;
|
|
3110
|
+
e.set(o.key, r), r < this.ctx.config.RESIZE_COLUMN_MIN_WIDTH && (i = !1);
|
|
3062
3111
|
}
|
|
3063
3112
|
if (!i)
|
|
3064
3113
|
return;
|
|
3065
|
-
const s = (
|
|
3066
|
-
|
|
3067
|
-
e.has(
|
|
3114
|
+
const s = (o) => {
|
|
3115
|
+
o.forEach((r) => {
|
|
3116
|
+
e.has(r.key) && (r.width = e.get(r.key)), r.children && r.children.length > 0 && s(r.children);
|
|
3068
3117
|
});
|
|
3069
3118
|
};
|
|
3070
3119
|
s(this.columns), this.ctx.database.setColumns(this.columns), this.init();
|
|
@@ -3072,12 +3121,12 @@ class ni {
|
|
|
3072
3121
|
render(t, e) {
|
|
3073
3122
|
const i = t.length;
|
|
3074
3123
|
let s = e;
|
|
3075
|
-
const { HEADER_HEIGHT:
|
|
3076
|
-
for (let
|
|
3077
|
-
const n = t[
|
|
3124
|
+
const { HEADER_HEIGHT: o = 0 } = this.ctx.config;
|
|
3125
|
+
for (let r = 0; r < i; r++) {
|
|
3126
|
+
const n = t[r], l = o * (n.rowspan || 1), h = o * n.level;
|
|
3078
3127
|
let f = n.width || 100;
|
|
3079
3128
|
n.children && (f = It(n.children).reduce((u, y) => u + ((y == null ? void 0 : y.width) || 100), 0));
|
|
3080
|
-
const d = new
|
|
3129
|
+
const d = new ie(this.ctx, this.columnIndex, s, h, f, l, n);
|
|
3081
3130
|
this.ctx.database.setHeader(n.key, d), this.allCellHeaders.push(d), n.children || (this.leafCellHeaders.push(d), d.column.widthFillDisable || this.resizeNum++), n.fixed === "left" ? this.fixedLeftCellHeaders.push(d) : n.fixed === "right" ? this.fixedRightCellHeaders.push(d) : this.centerCellHeaders.push(d), !n.children && this.columnIndex++, n.children && this.render(n.children, s), s += f;
|
|
3082
3131
|
}
|
|
3083
3132
|
}
|
|
@@ -3086,8 +3135,8 @@ class ni {
|
|
|
3086
3135
|
const {
|
|
3087
3136
|
target: t,
|
|
3088
3137
|
config: { RESIZE_COLUMN_LINE_COLOR: e }
|
|
3089
|
-
} = this.ctx, i = this.resizeTarget.getDrawX(), s = this.resizeTarget.width,
|
|
3090
|
-
this.ctx.paint.drawLine(
|
|
3138
|
+
} = this.ctx, i = this.resizeTarget.getDrawX(), s = this.resizeTarget.width, o = i + s + this.resizeDiff - 0.5, r = [o + 0.5, 0, o + 0.5, t.height];
|
|
3139
|
+
this.ctx.paint.drawLine(r, {
|
|
3091
3140
|
borderColor: e,
|
|
3092
3141
|
borderWidth: 1
|
|
3093
3142
|
});
|
|
@@ -3099,19 +3148,19 @@ class ni {
|
|
|
3099
3148
|
fixedRightWidth: e,
|
|
3100
3149
|
scrollX: i,
|
|
3101
3150
|
header: s,
|
|
3102
|
-
target:
|
|
3103
|
-
config: { HEADER_BG_COLOR:
|
|
3151
|
+
target: o,
|
|
3152
|
+
config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE: n }
|
|
3104
3153
|
} = this.ctx;
|
|
3105
3154
|
if (i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, this.y, t, this.height, {
|
|
3106
|
-
fillColor:
|
|
3155
|
+
fillColor: r,
|
|
3107
3156
|
side: "right",
|
|
3108
3157
|
shadowWidth: 4,
|
|
3109
3158
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3110
3159
|
colorEnd: "rgba(0,0,0,0)"
|
|
3111
3160
|
}), i < Math.floor(s.width - s.visibleWidth - 1) && e !== n) {
|
|
3112
|
-
const l = s.width - (this.x + this.width) +
|
|
3161
|
+
const l = s.width - (this.x + this.width) + o.width - e;
|
|
3113
3162
|
this.ctx.paint.drawShadow(l + 1, this.y, e, this.height, {
|
|
3114
|
-
fillColor:
|
|
3163
|
+
fillColor: r,
|
|
3115
3164
|
side: "left",
|
|
3116
3165
|
shadowWidth: 4,
|
|
3117
3166
|
colorStart: "rgba(0,0,0,0)",
|
|
@@ -3127,7 +3176,7 @@ class ni {
|
|
|
3127
3176
|
i.push(s), s.hasChildren || t.push(s);
|
|
3128
3177
|
}), this.fixedRightCellHeaders.forEach((s) => {
|
|
3129
3178
|
i.push(s), s.hasChildren || t.push(s);
|
|
3130
|
-
}), this.renderCenterCellHeaders = e, this.renderFixedCellHeaders = i, this.renderLeafCellHeaders = t.sort((s,
|
|
3179
|
+
}), this.renderCenterCellHeaders = e, this.renderFixedCellHeaders = i, this.renderLeafCellHeaders = t.sort((s, o) => s.x - o.x), this.visibleLeafColumns = this.renderLeafCellHeaders.map((s) => s.column), this.ctx.header.visibleLeafColumns = this.visibleLeafColumns, this.ctx.header.leafCellHeaders = this.leafCellHeaders, this.ctx.header.renderLeafCellHeaders = this.renderLeafCellHeaders, this.ctx.header.renderCellHeaders = this.renderFixedCellHeaders.concat(this.renderCenterCellHeaders);
|
|
3131
3180
|
}
|
|
3132
3181
|
draw() {
|
|
3133
3182
|
this.renderCenterCellHeaders.forEach((t) => {
|
|
@@ -3137,8 +3186,8 @@ class ni {
|
|
|
3137
3186
|
}), this.drawTipLine();
|
|
3138
3187
|
}
|
|
3139
3188
|
}
|
|
3140
|
-
class
|
|
3141
|
-
constructor(t, e, i = 0, s = 0,
|
|
3189
|
+
class se {
|
|
3190
|
+
constructor(t, e, i = 0, s = 0, o = 0, r = 0, n, l = "body") {
|
|
3142
3191
|
c(this, "ctx");
|
|
3143
3192
|
c(this, "x", 0);
|
|
3144
3193
|
c(this, "y", 0);
|
|
@@ -3151,24 +3200,24 @@ class ee {
|
|
|
3151
3200
|
c(this, "rowKey", "");
|
|
3152
3201
|
c(this, "rowType", "body");
|
|
3153
3202
|
c(this, "data");
|
|
3154
|
-
this.ctx = t, this.x = i, this.y = s, this.width =
|
|
3203
|
+
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 = l, this.data = n, this.update();
|
|
3155
3204
|
}
|
|
3156
3205
|
update() {
|
|
3157
3206
|
const { header: t } = this.ctx, e = [], i = [], s = [];
|
|
3158
|
-
t.renderLeafCellHeaders.forEach((
|
|
3159
|
-
const
|
|
3207
|
+
t.renderLeafCellHeaders.forEach((o) => {
|
|
3208
|
+
const r = new ee(
|
|
3160
3209
|
this.ctx,
|
|
3161
3210
|
this.rowIndex,
|
|
3162
|
-
|
|
3163
|
-
|
|
3211
|
+
o.colIndex,
|
|
3212
|
+
o.x,
|
|
3164
3213
|
this.y,
|
|
3165
|
-
|
|
3214
|
+
o.width,
|
|
3166
3215
|
this.height,
|
|
3167
|
-
|
|
3216
|
+
o.column,
|
|
3168
3217
|
this.data,
|
|
3169
3218
|
this.rowType
|
|
3170
3219
|
);
|
|
3171
|
-
|
|
3220
|
+
r.fixed ? i.push(r) : s.push(r), e.push(r);
|
|
3172
3221
|
}), this.cells = e, this.fixedCells = i, this.noFixedCells = s;
|
|
3173
3222
|
}
|
|
3174
3223
|
drawCenter() {
|
|
@@ -3189,7 +3238,7 @@ class ee {
|
|
|
3189
3238
|
});
|
|
3190
3239
|
}
|
|
3191
3240
|
}
|
|
3192
|
-
class
|
|
3241
|
+
class fi {
|
|
3193
3242
|
constructor(t) {
|
|
3194
3243
|
c(this, "resizeTarget", null);
|
|
3195
3244
|
//调整行大小的目标
|
|
@@ -3222,8 +3271,8 @@ class ai {
|
|
|
3222
3271
|
database: i,
|
|
3223
3272
|
config: {
|
|
3224
3273
|
FOOTER_FIXED: s,
|
|
3225
|
-
SCROLLER_TRACK_SIZE:
|
|
3226
|
-
BORDER_COLOR:
|
|
3274
|
+
SCROLLER_TRACK_SIZE: o = 0,
|
|
3275
|
+
BORDER_COLOR: r,
|
|
3227
3276
|
BORDER_RADIUS: n,
|
|
3228
3277
|
HEIGHT: l,
|
|
3229
3278
|
EMPTY_BODY_HEIGHT: h = 0,
|
|
@@ -3238,7 +3287,7 @@ class ai {
|
|
|
3238
3287
|
const { data: u, sumHeight: y } = i.getData();
|
|
3239
3288
|
this.height = y, this.data = u;
|
|
3240
3289
|
const { top: g } = t.getBoundingClientRect();
|
|
3241
|
-
this.width = e.width, this.visibleWidth = t.width -
|
|
3290
|
+
this.width = e.width, this.visibleWidth = t.width - o;
|
|
3242
3291
|
const w = this.ctx.footer.height;
|
|
3243
3292
|
this.data.length || (this.height = h);
|
|
3244
3293
|
const p = this.data.length ? "not-empty" : "empty";
|
|
@@ -3251,16 +3300,16 @@ class ai {
|
|
|
3251
3300
|
width: this.width,
|
|
3252
3301
|
height: this.data.length ? 0 : h + w
|
|
3253
3302
|
});
|
|
3254
|
-
let E = this.height + e.height +
|
|
3303
|
+
let E = this.height + e.height + o;
|
|
3255
3304
|
E += w;
|
|
3256
3305
|
let m = 0;
|
|
3257
3306
|
this.data.length && d ? (m = window.innerHeight - g - x, m < 0 && (m = 32, console.error(
|
|
3258
3307
|
"There is an error in the height calculation ENABLE_OFFSET_HEIGHT and OFFSET_HEIGHT are invalid"
|
|
3259
3308
|
))) : this.data.length && l ? m = l : this.data.length && f && E > f ? m = f : m = E, m > 0 && (this.ctx.target.height = m);
|
|
3260
|
-
let b = t.height - e.height -
|
|
3309
|
+
let b = t.height - e.height - o;
|
|
3261
3310
|
s ? this.visibleHeight = b - w : this.visibleHeight = b, this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = u, this.ctx.target.setAttribute(
|
|
3262
3311
|
"style",
|
|
3263
|
-
`outline: none; position: relative; border-radius: ${n}px; border: 1px solid ${
|
|
3312
|
+
`outline: none; position: relative; border-radius: ${n}px; border: 1px solid ${r}; height:${this.ctx.target.height}px;width:${this.ctx.target.width - 1}px;`
|
|
3264
3313
|
);
|
|
3265
3314
|
}
|
|
3266
3315
|
// 调整行的高度
|
|
@@ -3277,8 +3326,8 @@ class ai {
|
|
|
3277
3326
|
}), this.ctx.on("mousemove", (e) => {
|
|
3278
3327
|
if (this.ctx.editing) return;
|
|
3279
3328
|
const i = e.offsetY, s = e.offsetX, {
|
|
3280
|
-
target:
|
|
3281
|
-
scrollY:
|
|
3329
|
+
target: o,
|
|
3330
|
+
scrollY: r,
|
|
3282
3331
|
config: { RESIZE_ROW_MIN_HEIGHT: n = 0 }
|
|
3283
3332
|
} = this.ctx;
|
|
3284
3333
|
if (this.isResizing && this.resizeTarget) {
|
|
@@ -3291,7 +3340,7 @@ class ai {
|
|
|
3291
3340
|
this.ctx.target.style.cursor === "row-resize" && (this.ctx.target.style.cursor = "default");
|
|
3292
3341
|
for (let l = 0; l < this.renderRows.length; l++) {
|
|
3293
3342
|
const h = this.renderRows[l];
|
|
3294
|
-
if (i > h.y -
|
|
3343
|
+
if (i > h.y - r + h.height - 1.5 && i < h.y - r + h.height + 1.5 && i < o.height - 4)
|
|
3295
3344
|
for (let d = 0; d < h.cells.length; d++) {
|
|
3296
3345
|
const x = h.cells[d];
|
|
3297
3346
|
s > x.drawX + 10 && s < x.drawX + x.width - 10 && x.rowspan === 1 && (this.ctx.target.style.cursor = "row-resize", this.resizeTarget = h);
|
|
@@ -3301,13 +3350,13 @@ class ai {
|
|
|
3301
3350
|
}));
|
|
3302
3351
|
}
|
|
3303
3352
|
resizeRow(t, e) {
|
|
3304
|
-
const { rowIndex: i, height: s, rowKey:
|
|
3353
|
+
const { rowIndex: i, height: s, rowKey: o, data: r } = t;
|
|
3305
3354
|
this.ctx.database.setRowHeight(i, s + e), this.init(), this.ctx.emit("draw"), this.ctx.emit("resizeRowChange", {
|
|
3306
3355
|
rowIndex: i,
|
|
3307
3356
|
oldHeight: s,
|
|
3308
3357
|
height: s + e,
|
|
3309
|
-
rowKey:
|
|
3310
|
-
row:
|
|
3358
|
+
rowKey: o,
|
|
3359
|
+
row: r,
|
|
3311
3360
|
data: this.data
|
|
3312
3361
|
});
|
|
3313
3362
|
}
|
|
@@ -3317,7 +3366,7 @@ class ai {
|
|
|
3317
3366
|
target: t,
|
|
3318
3367
|
scrollY: e,
|
|
3319
3368
|
config: { RESIZE_ROW_LINE_COLOR: i }
|
|
3320
|
-
} = this.ctx, s = this.resizeTarget.y - e,
|
|
3369
|
+
} = this.ctx, s = this.resizeTarget.y - e, o = this.resizeTarget.height, r = s + o + this.resizeDiff - 0.5, n = [0, r + 0.5, t.width, r + 0.5];
|
|
3321
3370
|
this.ctx.paint.drawLine(n, {
|
|
3322
3371
|
borderColor: i,
|
|
3323
3372
|
borderWidth: 1
|
|
@@ -3330,19 +3379,19 @@ class ai {
|
|
|
3330
3379
|
fixedRightWidth: e,
|
|
3331
3380
|
scrollX: i,
|
|
3332
3381
|
header: s,
|
|
3333
|
-
target:
|
|
3334
|
-
config: { HEADER_BG_COLOR:
|
|
3382
|
+
target: o,
|
|
3383
|
+
config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE: n }
|
|
3335
3384
|
} = this.ctx;
|
|
3336
3385
|
if (i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, this.y, t, this.height, {
|
|
3337
|
-
fillColor:
|
|
3386
|
+
fillColor: r,
|
|
3338
3387
|
side: "right",
|
|
3339
3388
|
shadowWidth: 4,
|
|
3340
3389
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3341
3390
|
colorEnd: "rgba(0,0,0,0)"
|
|
3342
3391
|
}), i < Math.floor(s.width - s.visibleWidth - 1) && e !== n) {
|
|
3343
|
-
const l = s.width - (this.x + this.width) +
|
|
3392
|
+
const l = s.width - (this.x + this.width) + o.width - e;
|
|
3344
3393
|
this.ctx.paint.drawShadow(l + 1, this.y, e, this.height, {
|
|
3345
|
-
fillColor:
|
|
3394
|
+
fillColor: r,
|
|
3346
3395
|
side: "left",
|
|
3347
3396
|
shadowWidth: 4,
|
|
3348
3397
|
colorStart: "rgba(0,0,0,0)",
|
|
@@ -3351,25 +3400,25 @@ class ai {
|
|
|
3351
3400
|
}
|
|
3352
3401
|
}
|
|
3353
3402
|
binarySearch(t, e) {
|
|
3354
|
-
let i = 0, s = t.length - 1,
|
|
3403
|
+
let i = 0, s = t.length - 1, o = -1;
|
|
3355
3404
|
for (; i <= s; ) {
|
|
3356
|
-
let
|
|
3405
|
+
let r = Math.floor((i + s) / 2), n = t[r].bottom;
|
|
3357
3406
|
if (n === e)
|
|
3358
|
-
return
|
|
3359
|
-
n < e ? i =
|
|
3407
|
+
return r;
|
|
3408
|
+
n < e ? i = r + 1 : (o = r, s = r - 1);
|
|
3360
3409
|
}
|
|
3361
|
-
return
|
|
3410
|
+
return o;
|
|
3362
3411
|
}
|
|
3363
3412
|
update() {
|
|
3364
3413
|
this.init();
|
|
3365
|
-
const { header: t, database: e, scrollY: i } = this.ctx, s = i, { data:
|
|
3366
|
-
this.ctx.maxRowIndex =
|
|
3367
|
-
const n = this.binarySearch(
|
|
3368
|
-
let l = this.binarySearch(
|
|
3369
|
-
l === -1 && (l =
|
|
3414
|
+
const { header: t, database: e, scrollY: i } = this.ctx, s = i, { data: o, positions: r } = e.getData();
|
|
3415
|
+
this.ctx.maxRowIndex = o.length - 1;
|
|
3416
|
+
const n = this.binarySearch(r, s);
|
|
3417
|
+
let l = this.binarySearch(r, s + this.visibleHeight);
|
|
3418
|
+
l === -1 && (l = o.length), this.headIndex = Math.max(0, n), this.tailIndex = Math.min(this.ctx.maxRowIndex, l + 1), this.visibleRows = o.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
|
|
3370
3419
|
const h = [];
|
|
3371
3420
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
3372
|
-
const d = this.headIndex + f, x = this.visibleRows[f], { height: u, top: y } = this.ctx.database.getPositionForRowIndex(d), g = new
|
|
3421
|
+
const d = this.headIndex + f, x = this.visibleRows[f], { height: u, top: y } = this.ctx.database.getPositionForRowIndex(d), g = new se(this.ctx, d, 0, y + this.y, t.width, u, x);
|
|
3373
3422
|
h.push(g);
|
|
3374
3423
|
}
|
|
3375
3424
|
this.renderRows = h, this.ctx.body.renderRows = h;
|
|
@@ -3382,7 +3431,7 @@ class ai {
|
|
|
3382
3431
|
}), this.drawTipLine();
|
|
3383
3432
|
}
|
|
3384
3433
|
}
|
|
3385
|
-
class
|
|
3434
|
+
class xi {
|
|
3386
3435
|
constructor(t) {
|
|
3387
3436
|
c(this, "ctx");
|
|
3388
3437
|
c(this, "renderRows", []);
|
|
@@ -3400,9 +3449,9 @@ class ci {
|
|
|
3400
3449
|
const {
|
|
3401
3450
|
header: t,
|
|
3402
3451
|
body: e,
|
|
3403
|
-
config: { CELL_FOOTER_HEIGHT: i, FOOTER_FIXED: s, SCROLLER_TRACK_SIZE:
|
|
3452
|
+
config: { CELL_FOOTER_HEIGHT: i, FOOTER_FIXED: s, SCROLLER_TRACK_SIZE: o }
|
|
3404
3453
|
} = this.ctx;
|
|
3405
|
-
this.width = t.width, this.visibleWidth = t.visibleWidth, this.height = this.data.reduce((
|
|
3454
|
+
this.width = t.width, this.visibleWidth = t.visibleWidth, this.height = this.data.reduce((r) => r + i, 0), this.visibleHeight = this.height, s ? this.y = this.ctx.target.height - this.height - o : this.y = e.y + e.height, this.ctx.footer.x = this.x, this.ctx.footer.y = this.y, this.ctx.footer.height = this.height, this.ctx.footer.width = this.width, this.ctx.footer.visibleWidth = this.visibleWidth, this.ctx.footer.visibleHeight = this.visibleHeight;
|
|
3406
3455
|
}
|
|
3407
3456
|
drawFiexShadow() {
|
|
3408
3457
|
const {
|
|
@@ -3410,20 +3459,20 @@ class ci {
|
|
|
3410
3459
|
fixedRightWidth: e,
|
|
3411
3460
|
scrollX: i,
|
|
3412
3461
|
header: s,
|
|
3413
|
-
target:
|
|
3414
|
-
config: { HEADER_BG_COLOR:
|
|
3462
|
+
target: o,
|
|
3463
|
+
config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE: n }
|
|
3415
3464
|
} = this.ctx;
|
|
3416
3465
|
let l = this.y;
|
|
3417
3466
|
if (this.ctx.config.FOOTER_FIXED || (l = this.y - this.ctx.scrollY), i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, l, t, this.height, {
|
|
3418
|
-
fillColor:
|
|
3467
|
+
fillColor: r,
|
|
3419
3468
|
side: "right",
|
|
3420
3469
|
shadowWidth: 4,
|
|
3421
3470
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3422
3471
|
colorEnd: "rgba(0,0,0,0)"
|
|
3423
3472
|
}), i < Math.floor(s.width - s.visibleWidth - 1) && e !== n) {
|
|
3424
|
-
const h = s.width - (this.x + this.width) +
|
|
3473
|
+
const h = s.width - (this.x + this.width) + o.width - e;
|
|
3425
3474
|
this.ctx.paint.drawShadow(h + 1, l, e, this.height, {
|
|
3426
|
-
fillColor:
|
|
3475
|
+
fillColor: r,
|
|
3427
3476
|
side: "left",
|
|
3428
3477
|
shadowWidth: 4,
|
|
3429
3478
|
colorStart: "rgba(0,0,0,0)",
|
|
@@ -3436,10 +3485,10 @@ class ci {
|
|
|
3436
3485
|
const { CELL_FOOTER_HEIGHT: t } = this.ctx.config;
|
|
3437
3486
|
let e = this.y;
|
|
3438
3487
|
const i = [];
|
|
3439
|
-
this.data.forEach((s,
|
|
3440
|
-
const
|
|
3488
|
+
this.data.forEach((s, o) => {
|
|
3489
|
+
const r = new se(
|
|
3441
3490
|
this.ctx,
|
|
3442
|
-
|
|
3491
|
+
o,
|
|
3443
3492
|
0,
|
|
3444
3493
|
e,
|
|
3445
3494
|
this.width,
|
|
@@ -3447,7 +3496,7 @@ class ci {
|
|
|
3447
3496
|
s,
|
|
3448
3497
|
"footer"
|
|
3449
3498
|
);
|
|
3450
|
-
e += t, i.push(
|
|
3499
|
+
e += t, i.push(r);
|
|
3451
3500
|
}), this.renderRows = i, this.ctx.footer.renderRows = this.renderRows;
|
|
3452
3501
|
}
|
|
3453
3502
|
draw() {
|
|
@@ -3458,7 +3507,7 @@ class ci {
|
|
|
3458
3507
|
});
|
|
3459
3508
|
}
|
|
3460
3509
|
}
|
|
3461
|
-
class
|
|
3510
|
+
class ui {
|
|
3462
3511
|
// 垂直滚动定时器
|
|
3463
3512
|
constructor(t) {
|
|
3464
3513
|
c(this, "isCut", !1);
|
|
@@ -3474,13 +3523,13 @@ class li {
|
|
|
3474
3523
|
init() {
|
|
3475
3524
|
this.ctx.on(
|
|
3476
3525
|
"mousemove",
|
|
3477
|
-
|
|
3526
|
+
Zt((t) => {
|
|
3478
3527
|
const { offsetX: e, offsetY: i } = t, s = this.ctx.isTarget(t.target) && e > 0 && e < this.ctx.body.visibleWidth && i > this.ctx.header.visibleHeight && i < this.ctx.header.visibleHeight + this.ctx.body.visibleHeight;
|
|
3479
3528
|
(this.ctx.selectorMove || this.ctx.autofillMove) && (s ? this.stopAdjustPosition() : this.startAdjustPosition(t));
|
|
3480
3529
|
}, 100)
|
|
3481
3530
|
), this.ctx.on("cellHoverChange", (t) => {
|
|
3482
3531
|
if (!this.ctx.autofillMove) {
|
|
3483
|
-
if (
|
|
3532
|
+
if (t.operation) {
|
|
3484
3533
|
this.selectRows(t, !1);
|
|
3485
3534
|
return;
|
|
3486
3535
|
}
|
|
@@ -3488,7 +3537,7 @@ class li {
|
|
|
3488
3537
|
}
|
|
3489
3538
|
}), this.ctx.on("cellMousedown", (t, e) => {
|
|
3490
3539
|
if (this.ctx.isTarget(e.target) && this.ctx.target.style.cursor !== "pointer" && !this.ctx.isPointer && this.ctx.target.style.cursor !== "crosshair") {
|
|
3491
|
-
if (
|
|
3540
|
+
if (t.operation) {
|
|
3492
3541
|
this.isMultipleRow = !0, this.selectRows(t);
|
|
3493
3542
|
return;
|
|
3494
3543
|
}
|
|
@@ -3550,37 +3599,44 @@ class li {
|
|
|
3550
3599
|
}
|
|
3551
3600
|
setSelector(t, e) {
|
|
3552
3601
|
const { ENABLE_SELECTOR_SPAN_COL: i, ENABLE_SELECTOR_SPAN_ROW: s } = this.ctx.config;
|
|
3553
|
-
let
|
|
3602
|
+
let o = t, r = e;
|
|
3554
3603
|
if (!s) {
|
|
3604
|
+
const [n] = r;
|
|
3605
|
+
r = [n, n];
|
|
3606
|
+
}
|
|
3607
|
+
if (!i) {
|
|
3555
3608
|
const [n] = o;
|
|
3556
3609
|
o = [n, n];
|
|
3557
3610
|
}
|
|
3558
|
-
if (
|
|
3559
|
-
|
|
3560
|
-
|
|
3611
|
+
if (JSON.stringify(this.ctx.selector.xArr) !== JSON.stringify(o) || JSON.stringify(this.ctx.selector.yArr) !== JSON.stringify(r)) {
|
|
3612
|
+
this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0;
|
|
3613
|
+
const { SELECTOR_AREA_MIN_X: n, SELECTOR_AREA_MAX_X: l, SELECTOR_AREA_MIN_Y: h, SELECTOR_AREA_MAX_Y: f } = this.ctx.config, d = n, x = l || this.ctx.maxColIndex, u = h, y = f || this.ctx.maxRowIndex;
|
|
3614
|
+
let [g, w] = o, [p, E] = r;
|
|
3615
|
+
if (g < d || p < u)
|
|
3616
|
+
return;
|
|
3617
|
+
this.ctx.selector.xArr = [Math.max(d, g), Math.min(x, w)], this.ctx.selector.yArr = [Math.max(u, p), Math.min(y, E)], this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("draw");
|
|
3561
3618
|
}
|
|
3562
|
-
(JSON.stringify(this.ctx.selector.xArr) !== JSON.stringify(r) || JSON.stringify(this.ctx.selector.yArr) !== JSON.stringify(o)) && (this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0, this.ctx.selector.xArr = r, this.ctx.selector.yArr = o, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("draw"));
|
|
3563
3619
|
}
|
|
3564
3620
|
selectCols(t) {
|
|
3565
3621
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE || !this.ctx.config.ENABLE_SELECTOR_ALL_ROWS || this.ctx.autofillMove || this.ctx.columnResizing)
|
|
3566
3622
|
return;
|
|
3567
|
-
if (
|
|
3623
|
+
if (t.operation) {
|
|
3568
3624
|
this.selectAll();
|
|
3569
3625
|
return;
|
|
3570
3626
|
}
|
|
3571
|
-
const e =
|
|
3627
|
+
const { SELECTOR_AREA_MIN_Y: e, SELECTOR_AREA_MAX_Y: i } = this.ctx.config, s = e, o = i || this.ctx.maxRowIndex;
|
|
3572
3628
|
if (this.ctx.mousedown && this.ctx.focusCellHeader) {
|
|
3573
|
-
const { colIndex:
|
|
3574
|
-
if (t.colIndex >=
|
|
3575
|
-
const
|
|
3576
|
-
this.setSelector(
|
|
3629
|
+
const { colIndex: r } = this.ctx.focusCellHeader;
|
|
3630
|
+
if (this.ctx.clearSelector(), t.colIndex >= r) {
|
|
3631
|
+
const n = [r, t.colIndex + t.colspan - 1], l = [s, o];
|
|
3632
|
+
this.setSelector(n, l);
|
|
3577
3633
|
} else {
|
|
3578
|
-
const
|
|
3579
|
-
this.setSelector(
|
|
3634
|
+
const n = [t.colIndex, r], l = [s, o];
|
|
3635
|
+
this.setSelector(n, l);
|
|
3580
3636
|
}
|
|
3581
3637
|
} else {
|
|
3582
|
-
const
|
|
3583
|
-
this.setSelector(
|
|
3638
|
+
const r = [t.colIndex, t.colIndex + t.colspan - 1], n = [s, o];
|
|
3639
|
+
this.setSelector(r, n);
|
|
3584
3640
|
}
|
|
3585
3641
|
}
|
|
3586
3642
|
selectAll() {
|
|
@@ -3588,27 +3644,27 @@ class li {
|
|
|
3588
3644
|
return;
|
|
3589
3645
|
const { ENABLE_SELECTOR_ALL_ROWS: t, ENABLE_SELECTOR_ALL_COLS: e } = this.ctx.config;
|
|
3590
3646
|
if (t && e) {
|
|
3591
|
-
const s = this.ctx.
|
|
3592
|
-
this.setSelector(
|
|
3647
|
+
const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MIN_Y: o, SELECTOR_AREA_MAX_Y: r } = this.ctx.config, n = i, l = s || this.ctx.maxColIndex, h = o, f = r || this.ctx.maxRowIndex, d = [n, l], x = [h, f];
|
|
3648
|
+
this.setSelector(d, x);
|
|
3593
3649
|
}
|
|
3594
3650
|
}
|
|
3595
3651
|
selectRows(t, e = !0) {
|
|
3596
3652
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE || !this.ctx.config.ENABLE_SELECTOR_ALL_COLS || this.ctx.autofillMove)
|
|
3597
3653
|
return;
|
|
3598
|
-
const i = this.ctx.
|
|
3654
|
+
const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s } = this.ctx.config, o = s || this.ctx.maxColIndex, r = i;
|
|
3599
3655
|
if (e) {
|
|
3600
3656
|
this.ctx.setFocusCell(t);
|
|
3601
|
-
const
|
|
3602
|
-
this.setSelector(
|
|
3657
|
+
const n = [r, o], l = [t.rowIndex, t.rowIndex];
|
|
3658
|
+
this.setSelector(n, l);
|
|
3603
3659
|
}
|
|
3604
3660
|
if (this.ctx.focusCell && this.ctx.mousedown) {
|
|
3605
|
-
const { rowIndex:
|
|
3606
|
-
if (t.rowIndex >=
|
|
3607
|
-
const
|
|
3608
|
-
this.setSelector(
|
|
3661
|
+
const { rowIndex: n } = this.ctx.focusCell;
|
|
3662
|
+
if (t.rowIndex >= n) {
|
|
3663
|
+
const l = [r, o], h = [n, t.rowIndex];
|
|
3664
|
+
this.setSelector(l, h);
|
|
3609
3665
|
} else {
|
|
3610
|
-
const
|
|
3611
|
-
this.setSelector(
|
|
3666
|
+
const l = [r, o], h = [t.rowIndex, n];
|
|
3667
|
+
this.setSelector(l, h);
|
|
3612
3668
|
}
|
|
3613
3669
|
}
|
|
3614
3670
|
}
|
|
@@ -3617,7 +3673,7 @@ class li {
|
|
|
3617
3673
|
return;
|
|
3618
3674
|
const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
|
|
3619
3675
|
if (t && e && i) {
|
|
3620
|
-
const { rowIndex: s, colIndex:
|
|
3676
|
+
const { rowIndex: s, colIndex: o } = e, r = Math.min(i.colIndex, o), n = Math.max(i.colIndex, o), l = Math.min(i.rowIndex, s), h = Math.max(i.rowIndex, s), f = [r, n], d = [l, h];
|
|
3621
3677
|
this.setSelector(f, d);
|
|
3622
3678
|
}
|
|
3623
3679
|
}
|
|
@@ -3625,12 +3681,12 @@ class li {
|
|
|
3625
3681
|
const { focusCell: e, clickCell: i } = this.ctx;
|
|
3626
3682
|
if (e)
|
|
3627
3683
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
3628
|
-
const { colIndex: s, rowIndex:
|
|
3684
|
+
const { colIndex: s, rowIndex: o } = i, { colIndex: r, rowIndex: n } = e, l = Math.min(r, s), h = Math.max(r, s), f = Math.min(n, o), d = Math.max(n, o), x = [l, h], u = [f, d];
|
|
3629
3685
|
this.setSelector(x, u);
|
|
3630
3686
|
} else {
|
|
3631
3687
|
this.ctx.emit("cellSelectedClick", e);
|
|
3632
|
-
const s = [e.colIndex, e.colIndex],
|
|
3633
|
-
this.setSelector(s,
|
|
3688
|
+
const s = [e.colIndex, e.colIndex], o = [e.rowIndex, e.rowIndex];
|
|
3689
|
+
this.setSelector(s, o), this.adjustBoundaryPosition();
|
|
3634
3690
|
}
|
|
3635
3691
|
}
|
|
3636
3692
|
clearCopyLine() {
|
|
@@ -3643,8 +3699,8 @@ class li {
|
|
|
3643
3699
|
* @returns
|
|
3644
3700
|
*/
|
|
3645
3701
|
getCell(t, e) {
|
|
3646
|
-
const i = this.ctx.body.renderRows.find((
|
|
3647
|
-
return i == null ? void 0 : i.cells.find((
|
|
3702
|
+
const i = this.ctx.body.renderRows.find((o) => o.rowIndex === t);
|
|
3703
|
+
return i == null ? void 0 : i.cells.find((o) => o.colIndex === e);
|
|
3648
3704
|
}
|
|
3649
3705
|
/**
|
|
3650
3706
|
* 复制
|
|
@@ -3653,20 +3709,20 @@ class li {
|
|
|
3653
3709
|
copy() {
|
|
3654
3710
|
if (!this.ctx.config.ENABLE_COPY)
|
|
3655
3711
|
return;
|
|
3656
|
-
const {
|
|
3657
|
-
navigator.clipboard ? navigator.clipboard.writeText(
|
|
3712
|
+
const { value: t } = this.ctx.getSelectedData(), e = ei(t);
|
|
3713
|
+
navigator.clipboard ? navigator.clipboard.writeText(e).then(() => {
|
|
3658
3714
|
this.ctx.selector.xArrCopy = this.ctx.selector.xArr.slice(), this.ctx.selector.yArrCopy = this.ctx.selector.yArr.slice(), this.ctx.emit("setCopy", this.ctx.selector), this.ctx.emit("draw");
|
|
3659
|
-
}).catch((
|
|
3715
|
+
}).catch((i) => console.error("复制失败:", i)) : console.error("当前浏览器不支持Clipboard API");
|
|
3660
3716
|
}
|
|
3661
3717
|
clearSelectedData(t, e, i = !1) {
|
|
3662
3718
|
let s = [];
|
|
3663
|
-
const
|
|
3719
|
+
const o = /* @__PURE__ */ new Set();
|
|
3664
3720
|
for (let n = 0; n <= e[1] - e[0]; n++)
|
|
3665
3721
|
for (let l = 0; l <= t[1] - t[0]; l++) {
|
|
3666
3722
|
const h = n + e[0], f = l + t[0], d = this.ctx.database.getItemValueForRowIndexAndColIndex(h, f);
|
|
3667
3723
|
if (d) {
|
|
3668
3724
|
const { rowKey: x, key: u } = d;
|
|
3669
|
-
this.ctx.database.getReadonly(x, u) || (
|
|
3725
|
+
this.ctx.database.getReadonly(x, u) || (o.add(x), s.push({
|
|
3670
3726
|
rowKey: x,
|
|
3671
3727
|
key: u,
|
|
3672
3728
|
value: null,
|
|
@@ -3680,10 +3736,10 @@ class li {
|
|
|
3680
3736
|
if (i)
|
|
3681
3737
|
return s;
|
|
3682
3738
|
this.ctx.database.batchSetItemValue(s, !0);
|
|
3683
|
-
let
|
|
3684
|
-
return
|
|
3685
|
-
|
|
3686
|
-
}), this.ctx.emit("clearSelectedDataChange", s,
|
|
3739
|
+
let r = [];
|
|
3740
|
+
return o.forEach((n) => {
|
|
3741
|
+
r.push(this.ctx.database.getRowDataItemForRowKey(n));
|
|
3742
|
+
}), this.ctx.emit("clearSelectedDataChange", s, r), this.ctx.emit("draw"), s;
|
|
3687
3743
|
}
|
|
3688
3744
|
paste() {
|
|
3689
3745
|
if (!navigator.clipboard) {
|
|
@@ -3693,25 +3749,21 @@ class li {
|
|
|
3693
3749
|
const { ENABLE_PASTER: t } = this.ctx.config;
|
|
3694
3750
|
if (this.ctx.selector.enable && t) {
|
|
3695
3751
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
3696
|
-
navigator.clipboard.readText().then((
|
|
3697
|
-
let o = [];
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
for (let x = 0; x <= d - 1; x++) {
|
|
3705
|
-
const u = f + e, y = x + i, g = o[f][x], w = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
3706
|
-
u,
|
|
3707
|
-
y
|
|
3752
|
+
navigator.clipboard.readText().then((o) => {
|
|
3753
|
+
let r = ti(o), n = [];
|
|
3754
|
+
for (let h = 0; h <= r.length - 1; h++) {
|
|
3755
|
+
const f = r[h].length;
|
|
3756
|
+
for (let d = 0; d <= f - 1; d++) {
|
|
3757
|
+
const x = h + e, u = d + i, y = r[h][d], g = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
3758
|
+
x,
|
|
3759
|
+
u
|
|
3708
3760
|
);
|
|
3709
|
-
if (
|
|
3710
|
-
const { rowKey:
|
|
3711
|
-
this.ctx.database.getReadonly(
|
|
3712
|
-
rowKey:
|
|
3713
|
-
key:
|
|
3714
|
-
value:
|
|
3761
|
+
if (g) {
|
|
3762
|
+
const { rowKey: w, key: p } = g;
|
|
3763
|
+
this.ctx.database.getReadonly(w, p) || (s.add(w), n.push({
|
|
3764
|
+
rowKey: w,
|
|
3765
|
+
key: p,
|
|
3766
|
+
value: y,
|
|
3715
3767
|
row: {}
|
|
3716
3768
|
//内部有设置
|
|
3717
3769
|
}));
|
|
@@ -3719,25 +3771,25 @@ class li {
|
|
|
3719
3771
|
}
|
|
3720
3772
|
}
|
|
3721
3773
|
if (this.isCut) {
|
|
3722
|
-
const
|
|
3774
|
+
const h = this.clearSelectedData(
|
|
3723
3775
|
this.ctx.selector.xArrCopy,
|
|
3724
3776
|
this.ctx.selector.yArrCopy,
|
|
3725
3777
|
!0
|
|
3726
3778
|
// 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
|
|
3727
|
-
),
|
|
3728
|
-
|
|
3729
|
-
|
|
3779
|
+
), f = n.map((d) => `${d.rowKey}-${d.key}`);
|
|
3780
|
+
h.forEach((d) => {
|
|
3781
|
+
f.includes(`${d.rowKey}-${d.key}`) || n.unshift(d);
|
|
3730
3782
|
}), this.isCut = !1;
|
|
3731
3783
|
}
|
|
3732
|
-
if (!
|
|
3784
|
+
if (!n.length)
|
|
3733
3785
|
return;
|
|
3734
|
-
this.ctx.database.batchSetItemValue(
|
|
3735
|
-
let
|
|
3736
|
-
s.forEach((
|
|
3737
|
-
|
|
3738
|
-
}), this.ctx.emit("pasteChange",
|
|
3739
|
-
}).catch((
|
|
3740
|
-
console.error("获取剪贴板内容失败:",
|
|
3786
|
+
this.ctx.database.batchSetItemValue(n, !0);
|
|
3787
|
+
let l = [];
|
|
3788
|
+
s.forEach((h) => {
|
|
3789
|
+
l.push(this.ctx.database.getRowDataItemForRowKey(h));
|
|
3790
|
+
}), this.ctx.emit("pasteChange", n, l), this.clearCopyLine(), this.ctx.emit("draw");
|
|
3791
|
+
}).catch((o) => {
|
|
3792
|
+
console.error("获取剪贴板内容失败:", o);
|
|
3741
3793
|
});
|
|
3742
3794
|
}
|
|
3743
3795
|
}
|
|
@@ -3751,13 +3803,13 @@ class li {
|
|
|
3751
3803
|
if (!e)
|
|
3752
3804
|
return;
|
|
3753
3805
|
let { colIndex: i = 0, rowIndex: s = 0 } = e;
|
|
3754
|
-
const
|
|
3806
|
+
const o = 0, r = 0, n = this.ctx.maxColIndex, l = this.ctx.maxRowIndex;
|
|
3755
3807
|
switch (t) {
|
|
3756
3808
|
case "LEFT":
|
|
3757
|
-
i >
|
|
3809
|
+
i > o && i--;
|
|
3758
3810
|
break;
|
|
3759
3811
|
case "TOP":
|
|
3760
|
-
s >
|
|
3812
|
+
s > r && s--;
|
|
3761
3813
|
break;
|
|
3762
3814
|
case "RIGHT":
|
|
3763
3815
|
i < n && i++;
|
|
@@ -3768,7 +3820,7 @@ class li {
|
|
|
3768
3820
|
}
|
|
3769
3821
|
const h = [i, i], f = [s, s], d = this.getCell(s, i);
|
|
3770
3822
|
if (d) {
|
|
3771
|
-
if (
|
|
3823
|
+
if (d.operation)
|
|
3772
3824
|
return;
|
|
3773
3825
|
this.ctx.setFocusCell(d);
|
|
3774
3826
|
}
|
|
@@ -3782,8 +3834,8 @@ class li {
|
|
|
3782
3834
|
*/
|
|
3783
3835
|
startAdjustPosition(t) {
|
|
3784
3836
|
const { offsetX: e, offsetY: i } = t;
|
|
3785
|
-
let s = "",
|
|
3786
|
-
if (e < 0 ? s = "left" : e > this.ctx.body.visibleWidth && (s = "right"), i < this.ctx.header.visibleHeight ?
|
|
3837
|
+
let s = "", o = "";
|
|
3838
|
+
if (e < 0 ? s = "left" : e > this.ctx.body.visibleWidth && (s = "right"), i < this.ctx.header.visibleHeight ? o = "top" : i > this.ctx.header.visibleHeight + this.ctx.body.visibleHeight && (o = "bottom"), s && this.adjustPositionX !== s) {
|
|
3787
3839
|
this.adjustPositionX = s;
|
|
3788
3840
|
let n = 10 * (s === "left" ? -1 : 1);
|
|
3789
3841
|
this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
|
|
@@ -3792,9 +3844,9 @@ class li {
|
|
|
3792
3844
|
(h < 0 || h > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(h);
|
|
3793
3845
|
}, 100);
|
|
3794
3846
|
}
|
|
3795
|
-
if (
|
|
3796
|
-
this.adjustPositionY =
|
|
3797
|
-
let n = 10 * (
|
|
3847
|
+
if (o && this.adjustPositionY !== o) {
|
|
3848
|
+
this.adjustPositionY = o;
|
|
3849
|
+
let n = 10 * (o === "top" ? -1 : 1);
|
|
3798
3850
|
this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
|
|
3799
3851
|
n *= 1.5;
|
|
3800
3852
|
const { scrollY: l } = this.ctx, h = l + n;
|
|
@@ -3806,20 +3858,20 @@ class li {
|
|
|
3806
3858
|
* 调整滚动条位置,让焦点单元格始终出现在可视区域内
|
|
3807
3859
|
*/
|
|
3808
3860
|
adjustBoundaryPosition() {
|
|
3809
|
-
const { target: t, focusCell: e, fixedRightWidth: i, fixedLeftWidth: s, header:
|
|
3861
|
+
const { target: t, focusCell: e, fixedRightWidth: i, fixedLeftWidth: s, header: o, footer: r, scrollX: n, scrollY: l } = this.ctx;
|
|
3810
3862
|
if (!e)
|
|
3811
3863
|
return;
|
|
3812
3864
|
const { SCROLLER_TRACK_SIZE: h = 0, FOOTER_FIXED: f } = this.ctx.config;
|
|
3813
3865
|
let d = 0;
|
|
3814
|
-
f && (d =
|
|
3815
|
-
const x = s - e.drawX + 1, u = e.drawX + e.width - (t.width - i) + 1, y =
|
|
3866
|
+
f && (d = r.visibleHeight);
|
|
3867
|
+
const x = s - e.drawX + 1, u = e.drawX + e.width - (t.width - i) + 1, y = o.height - e.drawY, g = e.drawY + e.height - (t.height - d - h);
|
|
3816
3868
|
u > 0 && !e.fixed ? this.ctx.setScrollX(n + u) : x > 0 && !e.fixed && this.ctx.setScrollX(n - x), y > 0 ? this.ctx.setScrollY(l - y) : g > 0 && this.ctx.setScrollY(l + g);
|
|
3817
3869
|
}
|
|
3818
3870
|
destroy() {
|
|
3819
3871
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
3820
3872
|
}
|
|
3821
3873
|
}
|
|
3822
|
-
class
|
|
3874
|
+
class gi {
|
|
3823
3875
|
constructor(t) {
|
|
3824
3876
|
c(this, "ctx");
|
|
3825
3877
|
this.ctx = t, this.init();
|
|
@@ -3827,8 +3879,8 @@ class hi {
|
|
|
3827
3879
|
init() {
|
|
3828
3880
|
this.ctx.on("cellMouseenter", (t, e) => {
|
|
3829
3881
|
this.ctx.target.style.cursor === "crosshair" && (this.ctx.target.style.cursor = "default");
|
|
3830
|
-
const { xArr: i, yArr: s } = this.ctx.selector,
|
|
3831
|
-
if (this.ctx.config.ENABLE_AUTOFILL && n ===
|
|
3882
|
+
const { xArr: i, yArr: s } = this.ctx.selector, o = i[1], r = s[1], { colIndex: n, rowIndex: l, drawX: h, drawY: f, width: d, height: x } = t;
|
|
3883
|
+
if (this.ctx.config.ENABLE_AUTOFILL && n === o && l === r) {
|
|
3832
3884
|
const y = h + d - 6, g = f + x - 6;
|
|
3833
3885
|
e.offsetX > y && e.offsetY > g && (this.ctx.target.style.cursor = "crosshair");
|
|
3834
3886
|
}
|
|
@@ -3856,23 +3908,25 @@ class hi {
|
|
|
3856
3908
|
this.isAutofillIng() && this.autofillData(), this.ctx.autofill.enable = !1, this.ctx.autofillMove = !1, this.ctx.autofill.xArr = [-1, -1], this.ctx.autofill.yArr = [-1, -1];
|
|
3857
3909
|
}
|
|
3858
3910
|
setAutofill(t, e) {
|
|
3859
|
-
const {
|
|
3860
|
-
ENABLE_AUTOFILL: i,
|
|
3861
|
-
ENABLE_SELECTOR_SPAN_COL: s,
|
|
3862
|
-
ENABLE_SELECTOR_SPAN_ROW: r
|
|
3863
|
-
} = this.ctx.config;
|
|
3911
|
+
const { ENABLE_AUTOFILL: i, ENABLE_SELECTOR_SPAN_COL: s, ENABLE_SELECTOR_SPAN_ROW: o } = this.ctx.config;
|
|
3864
3912
|
if (!i)
|
|
3865
3913
|
return;
|
|
3866
|
-
let
|
|
3867
|
-
if (!
|
|
3914
|
+
let r = t, n = e;
|
|
3915
|
+
if (!o) {
|
|
3868
3916
|
const [l] = n;
|
|
3869
3917
|
n = [l, l];
|
|
3870
3918
|
}
|
|
3871
3919
|
if (!s) {
|
|
3872
|
-
const [l] =
|
|
3873
|
-
|
|
3920
|
+
const [l] = r;
|
|
3921
|
+
r = [l, l];
|
|
3922
|
+
}
|
|
3923
|
+
if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(r) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(n)) {
|
|
3924
|
+
const { SELECTOR_AREA_MIN_X: l, SELECTOR_AREA_MAX_X: h, SELECTOR_AREA_MIN_Y: f, SELECTOR_AREA_MAX_Y: d } = this.ctx.config, x = l, u = h || this.ctx.maxColIndex, y = f, g = d || this.ctx.maxRowIndex;
|
|
3925
|
+
let [w, p] = r, [E, m] = n;
|
|
3926
|
+
if (w < x || E < y)
|
|
3927
|
+
return;
|
|
3928
|
+
this.ctx.autofill.xArr = [Math.max(x, w), Math.min(u, p)], this.ctx.autofill.yArr = [Math.max(y, E), Math.min(g, m)], this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
|
|
3874
3929
|
}
|
|
3875
|
-
(JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(o) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(n)) && (this.ctx.autofill.xArr = o, this.ctx.autofill.yArr = n, this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw"));
|
|
3876
3930
|
}
|
|
3877
3931
|
/**
|
|
3878
3932
|
* 填充数据
|
|
@@ -3884,14 +3938,11 @@ class hi {
|
|
|
3884
3938
|
const u = d + e.yArr[0], y = x + e.xArr[0];
|
|
3885
3939
|
i.set(`${u}-${y}`, !0);
|
|
3886
3940
|
}
|
|
3887
|
-
const { value: s } = e,
|
|
3941
|
+
const { value: s } = e, o = s[0].length, r = s.length, n = this.ctx.autofill.xArr, l = this.ctx.autofill.yArr;
|
|
3888
3942
|
let h = [];
|
|
3889
3943
|
for (let d = 0; d <= l[1] - l[0]; d++)
|
|
3890
3944
|
for (let x = 0; x <= n[1] - n[0]; x++) {
|
|
3891
|
-
const u = x + n[0], y = d + l[0], g = s[d %
|
|
3892
|
-
y,
|
|
3893
|
-
u
|
|
3894
|
-
), p = `${y}-${u}`;
|
|
3945
|
+
const u = x + n[0], y = d + l[0], g = s[d % r][x % o], w = this.ctx.database.getItemValueForRowIndexAndColIndex(y, u), p = `${y}-${u}`;
|
|
3895
3946
|
if (w && !i.has(p)) {
|
|
3896
3947
|
const { rowKey: E, key: m } = w;
|
|
3897
3948
|
this.ctx.database.getReadonly(E, m) || (t.add(E), h.push({
|
|
@@ -3915,8 +3966,8 @@ class hi {
|
|
|
3915
3966
|
return;
|
|
3916
3967
|
const { selector: e, autofill: i } = this.ctx;
|
|
3917
3968
|
if (this.ctx.mousedown && e.enable && i.enable) {
|
|
3918
|
-
const { rowIndex: s, colIndex:
|
|
3919
|
-
s >= e.yArr[0] && s <= e.yArr[1] ?
|
|
3969
|
+
const { rowIndex: s, colIndex: o } = t, r = e.xArr.slice(), n = e.yArr.slice();
|
|
3970
|
+
s >= e.yArr[0] && s <= e.yArr[1] ? o > e.xArr[1] ? r.splice(1, 1, o) : o < e.xArr[0] && r.splice(0, 1, o) : s > e.yArr[1] ? n.splice(1, 1, s) : s < e.yArr[0] && n.splice(0, 1, s), this.setAutofill(r, n);
|
|
3920
3971
|
}
|
|
3921
3972
|
}
|
|
3922
3973
|
destroy() {
|
|
@@ -3925,16 +3976,16 @@ class hi {
|
|
|
3925
3976
|
const rt = Math.min, U = Math.max, ft = Math.round, V = (a) => ({
|
|
3926
3977
|
x: a,
|
|
3927
3978
|
y: a
|
|
3928
|
-
}),
|
|
3979
|
+
}), wi = {
|
|
3929
3980
|
left: "right",
|
|
3930
3981
|
right: "left",
|
|
3931
3982
|
bottom: "top",
|
|
3932
3983
|
top: "bottom"
|
|
3933
|
-
},
|
|
3984
|
+
}, pi = {
|
|
3934
3985
|
start: "end",
|
|
3935
3986
|
end: "start"
|
|
3936
3987
|
};
|
|
3937
|
-
function
|
|
3988
|
+
function _t(a, t, e) {
|
|
3938
3989
|
return U(a, rt(t, e));
|
|
3939
3990
|
}
|
|
3940
3991
|
function at(a, t) {
|
|
@@ -3946,53 +3997,53 @@ function q(a) {
|
|
|
3946
3997
|
function ct(a) {
|
|
3947
3998
|
return a.split("-")[1];
|
|
3948
3999
|
}
|
|
3949
|
-
function
|
|
4000
|
+
function re(a) {
|
|
3950
4001
|
return a === "x" ? "y" : "x";
|
|
3951
4002
|
}
|
|
3952
|
-
function
|
|
4003
|
+
function Mt(a) {
|
|
3953
4004
|
return a === "y" ? "height" : "width";
|
|
3954
4005
|
}
|
|
3955
4006
|
function J(a) {
|
|
3956
4007
|
return ["top", "bottom"].includes(q(a)) ? "y" : "x";
|
|
3957
4008
|
}
|
|
3958
|
-
function
|
|
3959
|
-
return
|
|
4009
|
+
function Ht(a) {
|
|
4010
|
+
return re(J(a));
|
|
3960
4011
|
}
|
|
3961
|
-
function
|
|
4012
|
+
function yi(a, t, e) {
|
|
3962
4013
|
e === void 0 && (e = !1);
|
|
3963
|
-
const i = ct(a), s =
|
|
3964
|
-
let
|
|
3965
|
-
return t.reference[
|
|
4014
|
+
const i = ct(a), s = Ht(a), o = Mt(s);
|
|
4015
|
+
let r = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4016
|
+
return t.reference[o] > t.floating[o] && (r = xt(r)), [r, xt(r)];
|
|
3966
4017
|
}
|
|
3967
|
-
function
|
|
4018
|
+
function mi(a) {
|
|
3968
4019
|
const t = xt(a);
|
|
3969
|
-
return [
|
|
4020
|
+
return [Ot(a), t, Ot(t)];
|
|
3970
4021
|
}
|
|
3971
|
-
function
|
|
3972
|
-
return a.replace(/start|end/g, (t) =>
|
|
4022
|
+
function Ot(a) {
|
|
4023
|
+
return a.replace(/start|end/g, (t) => pi[t]);
|
|
3973
4024
|
}
|
|
3974
|
-
function
|
|
3975
|
-
const i = ["left", "right"], s = ["right", "left"],
|
|
4025
|
+
function Ei(a, t, e) {
|
|
4026
|
+
const i = ["left", "right"], s = ["right", "left"], o = ["top", "bottom"], r = ["bottom", "top"];
|
|
3976
4027
|
switch (a) {
|
|
3977
4028
|
case "top":
|
|
3978
4029
|
case "bottom":
|
|
3979
4030
|
return e ? t ? s : i : t ? i : s;
|
|
3980
4031
|
case "left":
|
|
3981
4032
|
case "right":
|
|
3982
|
-
return t ?
|
|
4033
|
+
return t ? o : r;
|
|
3983
4034
|
default:
|
|
3984
4035
|
return [];
|
|
3985
4036
|
}
|
|
3986
4037
|
}
|
|
3987
|
-
function
|
|
4038
|
+
function bi(a, t, e, i) {
|
|
3988
4039
|
const s = ct(a);
|
|
3989
|
-
let
|
|
3990
|
-
return s && (
|
|
4040
|
+
let o = Ei(q(a), e === "start", i);
|
|
4041
|
+
return s && (o = o.map((r) => r + "-" + s), t && (o = o.concat(o.map(Ot)))), o;
|
|
3991
4042
|
}
|
|
3992
4043
|
function xt(a) {
|
|
3993
|
-
return a.replace(/left|right|bottom|top/g, (t) =>
|
|
4044
|
+
return a.replace(/left|right|bottom|top/g, (t) => wi[t]);
|
|
3994
4045
|
}
|
|
3995
|
-
function
|
|
4046
|
+
function Ci(a) {
|
|
3996
4047
|
return {
|
|
3997
4048
|
top: 0,
|
|
3998
4049
|
right: 0,
|
|
@@ -4001,8 +4052,8 @@ function pi(a) {
|
|
|
4001
4052
|
...a
|
|
4002
4053
|
};
|
|
4003
4054
|
}
|
|
4004
|
-
function
|
|
4005
|
-
return typeof a != "number" ?
|
|
4055
|
+
function oe(a) {
|
|
4056
|
+
return typeof a != "number" ? Ci(a) : {
|
|
4006
4057
|
top: a,
|
|
4007
4058
|
right: a,
|
|
4008
4059
|
bottom: a,
|
|
@@ -4027,12 +4078,12 @@ function ut(a) {
|
|
|
4027
4078
|
y: e
|
|
4028
4079
|
};
|
|
4029
4080
|
}
|
|
4030
|
-
function
|
|
4081
|
+
function zt(a, t, e) {
|
|
4031
4082
|
let {
|
|
4032
4083
|
reference: i,
|
|
4033
4084
|
floating: s
|
|
4034
4085
|
} = a;
|
|
4035
|
-
const
|
|
4086
|
+
const o = J(t), r = Ht(t), n = Mt(r), l = q(t), h = o === "y", f = i.x + i.width / 2 - s.width / 2, d = i.y + i.height / 2 - s.height / 2, x = i[n] / 2 - s[n] / 2;
|
|
4036
4087
|
let u;
|
|
4037
4088
|
switch (l) {
|
|
4038
4089
|
case "top":
|
|
@@ -4067,29 +4118,29 @@ function Pt(a, t, e) {
|
|
|
4067
4118
|
}
|
|
4068
4119
|
switch (ct(t)) {
|
|
4069
4120
|
case "start":
|
|
4070
|
-
u[
|
|
4121
|
+
u[r] -= x * (e && h ? -1 : 1);
|
|
4071
4122
|
break;
|
|
4072
4123
|
case "end":
|
|
4073
|
-
u[
|
|
4124
|
+
u[r] += x * (e && h ? -1 : 1);
|
|
4074
4125
|
break;
|
|
4075
4126
|
}
|
|
4076
4127
|
return u;
|
|
4077
4128
|
}
|
|
4078
|
-
const
|
|
4129
|
+
const vi = async (a, t, e) => {
|
|
4079
4130
|
const {
|
|
4080
4131
|
placement: i = "bottom",
|
|
4081
4132
|
strategy: s = "absolute",
|
|
4082
|
-
middleware:
|
|
4083
|
-
platform:
|
|
4084
|
-
} = e, n =
|
|
4085
|
-
let h = await
|
|
4133
|
+
middleware: o = [],
|
|
4134
|
+
platform: r
|
|
4135
|
+
} = e, n = o.filter(Boolean), l = await (r.isRTL == null ? void 0 : r.isRTL(t));
|
|
4136
|
+
let h = await r.getElementRects({
|
|
4086
4137
|
reference: a,
|
|
4087
4138
|
floating: t,
|
|
4088
4139
|
strategy: s
|
|
4089
4140
|
}), {
|
|
4090
4141
|
x: f,
|
|
4091
4142
|
y: d
|
|
4092
|
-
} =
|
|
4143
|
+
} = zt(h, i, l), x = i, u = {}, y = 0;
|
|
4093
4144
|
for (let g = 0; g < n.length; g++) {
|
|
4094
4145
|
const {
|
|
4095
4146
|
name: w,
|
|
@@ -4107,7 +4158,7 @@ const yi = async (a, t, e) => {
|
|
|
4107
4158
|
strategy: s,
|
|
4108
4159
|
middlewareData: u,
|
|
4109
4160
|
rects: h,
|
|
4110
|
-
platform:
|
|
4161
|
+
platform: r,
|
|
4111
4162
|
elements: {
|
|
4112
4163
|
reference: a,
|
|
4113
4164
|
floating: t
|
|
@@ -4119,14 +4170,14 @@ const yi = async (a, t, e) => {
|
|
|
4119
4170
|
...u[w],
|
|
4120
4171
|
...b
|
|
4121
4172
|
}
|
|
4122
|
-
}, C && y <= 50 && (y++, typeof C == "object" && (C.placement && (x = C.placement), C.rects && (h = C.rects === !0 ? await
|
|
4173
|
+
}, C && y <= 50 && (y++, typeof C == "object" && (C.placement && (x = C.placement), C.rects && (h = C.rects === !0 ? await r.getElementRects({
|
|
4123
4174
|
reference: a,
|
|
4124
4175
|
floating: t,
|
|
4125
4176
|
strategy: s
|
|
4126
4177
|
}) : C.rects), {
|
|
4127
4178
|
x: f,
|
|
4128
4179
|
y: d
|
|
4129
|
-
} =
|
|
4180
|
+
} = zt(h, x, l)), g = -1);
|
|
4130
4181
|
}
|
|
4131
4182
|
return {
|
|
4132
4183
|
x: f,
|
|
@@ -4136,14 +4187,14 @@ const yi = async (a, t, e) => {
|
|
|
4136
4187
|
middlewareData: u
|
|
4137
4188
|
};
|
|
4138
4189
|
};
|
|
4139
|
-
async function
|
|
4190
|
+
async function ne(a, t) {
|
|
4140
4191
|
var e;
|
|
4141
4192
|
t === void 0 && (t = {});
|
|
4142
4193
|
const {
|
|
4143
4194
|
x: i,
|
|
4144
4195
|
y: s,
|
|
4145
|
-
platform:
|
|
4146
|
-
rects:
|
|
4196
|
+
platform: o,
|
|
4197
|
+
rects: r,
|
|
4147
4198
|
elements: n,
|
|
4148
4199
|
strategy: l
|
|
4149
4200
|
} = a, {
|
|
@@ -4152,23 +4203,23 @@ async function re(a, t) {
|
|
|
4152
4203
|
elementContext: d = "floating",
|
|
4153
4204
|
altBoundary: x = !1,
|
|
4154
4205
|
padding: u = 0
|
|
4155
|
-
} = at(t, a), y =
|
|
4156
|
-
element: (e = await (
|
|
4206
|
+
} = at(t, a), y = oe(u), w = n[x ? d === "floating" ? "reference" : "floating" : d], p = ut(await o.getClippingRect({
|
|
4207
|
+
element: (e = await (o.isElement == null ? void 0 : o.isElement(w))) == null || e ? w : w.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(n.floating)),
|
|
4157
4208
|
boundary: h,
|
|
4158
4209
|
rootBoundary: f,
|
|
4159
4210
|
strategy: l
|
|
4160
4211
|
})), E = d === "floating" ? {
|
|
4161
4212
|
x: i,
|
|
4162
4213
|
y: s,
|
|
4163
|
-
width:
|
|
4164
|
-
height:
|
|
4165
|
-
} :
|
|
4214
|
+
width: r.floating.width,
|
|
4215
|
+
height: r.floating.height
|
|
4216
|
+
} : r.reference, m = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(n.floating)), b = await (o.isElement == null ? void 0 : o.isElement(m)) ? await (o.getScale == null ? void 0 : o.getScale(m)) || {
|
|
4166
4217
|
x: 1,
|
|
4167
4218
|
y: 1
|
|
4168
4219
|
} : {
|
|
4169
4220
|
x: 1,
|
|
4170
4221
|
y: 1
|
|
4171
|
-
}, C = ut(
|
|
4222
|
+
}, C = ut(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
4172
4223
|
elements: n,
|
|
4173
4224
|
rect: E,
|
|
4174
4225
|
offsetParent: m,
|
|
@@ -4181,7 +4232,7 @@ async function re(a, t) {
|
|
|
4181
4232
|
right: (C.right - p.right + y.right) / b.x
|
|
4182
4233
|
};
|
|
4183
4234
|
}
|
|
4184
|
-
const
|
|
4235
|
+
const Ri = (a) => ({
|
|
4185
4236
|
name: "arrow",
|
|
4186
4237
|
options: a,
|
|
4187
4238
|
async fn(t) {
|
|
@@ -4189,8 +4240,8 @@ const mi = (a) => ({
|
|
|
4189
4240
|
x: e,
|
|
4190
4241
|
y: i,
|
|
4191
4242
|
placement: s,
|
|
4192
|
-
rects:
|
|
4193
|
-
platform:
|
|
4243
|
+
rects: o,
|
|
4244
|
+
platform: r,
|
|
4194
4245
|
elements: n,
|
|
4195
4246
|
middlewareData: l
|
|
4196
4247
|
} = t, {
|
|
@@ -4199,26 +4250,26 @@ const mi = (a) => ({
|
|
|
4199
4250
|
} = at(a, t) || {};
|
|
4200
4251
|
if (h == null)
|
|
4201
4252
|
return {};
|
|
4202
|
-
const d =
|
|
4253
|
+
const d = oe(f), x = {
|
|
4203
4254
|
x: e,
|
|
4204
4255
|
y: i
|
|
4205
|
-
}, u =
|
|
4256
|
+
}, u = Ht(s), y = Mt(u), g = await r.getDimensions(h), w = u === "y", p = w ? "top" : "left", E = w ? "bottom" : "right", m = w ? "clientHeight" : "clientWidth", b = o.reference[y] + o.reference[u] - x[u] - o.floating[y], C = x[u] - o.reference[u], R = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(h));
|
|
4206
4257
|
let T = R ? R[m] : 0;
|
|
4207
|
-
(!T || !await (
|
|
4208
|
-
const L = b / 2 - C / 2, A = T / 2 - g[y] / 2 - 1, D = rt(d[p], A), B = rt(d[E], A),
|
|
4258
|
+
(!T || !await (r.isElement == null ? void 0 : r.isElement(R))) && (T = n.floating[m] || o.floating[y]);
|
|
4259
|
+
const L = b / 2 - C / 2, A = T / 2 - g[y] / 2 - 1, D = rt(d[p], A), B = rt(d[E], A), _ = D, S = T - g[y] - B, O = T / 2 - g[y] / 2 + L, G = _t(_, O, S), Y = !l.arrow && ct(s) != null && O !== G && o.reference[y] / 2 - (O < _ ? D : B) - g[y] / 2 < 0, F = Y ? O < _ ? O - _ : O - S : 0;
|
|
4209
4260
|
return {
|
|
4210
|
-
[u]: x[u] +
|
|
4261
|
+
[u]: x[u] + F,
|
|
4211
4262
|
data: {
|
|
4212
4263
|
[u]: G,
|
|
4213
|
-
centerOffset:
|
|
4214
|
-
...
|
|
4215
|
-
alignmentOffset:
|
|
4264
|
+
centerOffset: O - G - F,
|
|
4265
|
+
...Y && {
|
|
4266
|
+
alignmentOffset: F
|
|
4216
4267
|
}
|
|
4217
4268
|
},
|
|
4218
|
-
reset:
|
|
4269
|
+
reset: Y
|
|
4219
4270
|
};
|
|
4220
4271
|
}
|
|
4221
|
-
}),
|
|
4272
|
+
}), Ii = function(a) {
|
|
4222
4273
|
return a === void 0 && (a = {}), {
|
|
4223
4274
|
name: "flip",
|
|
4224
4275
|
options: a,
|
|
@@ -4226,8 +4277,8 @@ const mi = (a) => ({
|
|
|
4226
4277
|
var e, i;
|
|
4227
4278
|
const {
|
|
4228
4279
|
placement: s,
|
|
4229
|
-
middlewareData:
|
|
4230
|
-
rects:
|
|
4280
|
+
middlewareData: o,
|
|
4281
|
+
rects: r,
|
|
4231
4282
|
initialPlacement: n,
|
|
4232
4283
|
platform: l,
|
|
4233
4284
|
elements: h
|
|
@@ -4240,38 +4291,38 @@ const mi = (a) => ({
|
|
|
4240
4291
|
flipAlignment: g = !0,
|
|
4241
4292
|
...w
|
|
4242
4293
|
} = at(a, t);
|
|
4243
|
-
if ((e =
|
|
4294
|
+
if ((e = o.arrow) != null && e.alignmentOffset)
|
|
4244
4295
|
return {};
|
|
4245
|
-
const p = q(s), E = J(n), m = q(n) === n, b = await (l.isRTL == null ? void 0 : l.isRTL(h.floating)), C = x || (m || !g ? [xt(n)] :
|
|
4246
|
-
!x && R && C.push(...
|
|
4247
|
-
const T = [n, ...C], L = await
|
|
4248
|
-
let D = ((i =
|
|
4296
|
+
const p = q(s), E = J(n), m = q(n) === n, b = await (l.isRTL == null ? void 0 : l.isRTL(h.floating)), C = x || (m || !g ? [xt(n)] : mi(n)), R = y !== "none";
|
|
4297
|
+
!x && R && C.push(...bi(n, g, y, b));
|
|
4298
|
+
const T = [n, ...C], L = await ne(t, w), A = [];
|
|
4299
|
+
let D = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
4249
4300
|
if (f && A.push(L[p]), d) {
|
|
4250
|
-
const
|
|
4251
|
-
A.push(L[
|
|
4301
|
+
const O = yi(s, r, b);
|
|
4302
|
+
A.push(L[O[0]], L[O[1]]);
|
|
4252
4303
|
}
|
|
4253
4304
|
if (D = [...D, {
|
|
4254
4305
|
placement: s,
|
|
4255
4306
|
overflows: A
|
|
4256
|
-
}], !A.every((
|
|
4257
|
-
var B,
|
|
4258
|
-
const
|
|
4307
|
+
}], !A.every((O) => O <= 0)) {
|
|
4308
|
+
var B, _;
|
|
4309
|
+
const O = (((B = o.flip) == null ? void 0 : B.index) || 0) + 1, G = T[O];
|
|
4259
4310
|
if (G)
|
|
4260
4311
|
return {
|
|
4261
4312
|
data: {
|
|
4262
|
-
index:
|
|
4313
|
+
index: O,
|
|
4263
4314
|
overflows: D
|
|
4264
4315
|
},
|
|
4265
4316
|
reset: {
|
|
4266
4317
|
placement: G
|
|
4267
4318
|
}
|
|
4268
4319
|
};
|
|
4269
|
-
let
|
|
4270
|
-
if (!
|
|
4320
|
+
let Y = (_ = D.filter((F) => F.overflows[0] <= 0).sort((F, W) => F.overflows[1] - W.overflows[1])[0]) == null ? void 0 : _.placement;
|
|
4321
|
+
if (!Y)
|
|
4271
4322
|
switch (u) {
|
|
4272
4323
|
case "bestFit": {
|
|
4273
4324
|
var S;
|
|
4274
|
-
const
|
|
4325
|
+
const F = (S = D.filter((W) => {
|
|
4275
4326
|
if (R) {
|
|
4276
4327
|
const P = J(W.placement);
|
|
4277
4328
|
return P === E || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -4279,18 +4330,18 @@ const mi = (a) => ({
|
|
|
4279
4330
|
P === "y";
|
|
4280
4331
|
}
|
|
4281
4332
|
return !0;
|
|
4282
|
-
}).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P,
|
|
4283
|
-
|
|
4333
|
+
}).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, ye) => P + ye, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 : S[0];
|
|
4334
|
+
F && (Y = F);
|
|
4284
4335
|
break;
|
|
4285
4336
|
}
|
|
4286
4337
|
case "initialPlacement":
|
|
4287
|
-
|
|
4338
|
+
Y = n;
|
|
4288
4339
|
break;
|
|
4289
4340
|
}
|
|
4290
|
-
if (s !==
|
|
4341
|
+
if (s !== Y)
|
|
4291
4342
|
return {
|
|
4292
4343
|
reset: {
|
|
4293
|
-
placement:
|
|
4344
|
+
placement: Y
|
|
4294
4345
|
}
|
|
4295
4346
|
};
|
|
4296
4347
|
}
|
|
@@ -4298,12 +4349,12 @@ const mi = (a) => ({
|
|
|
4298
4349
|
}
|
|
4299
4350
|
};
|
|
4300
4351
|
};
|
|
4301
|
-
async function
|
|
4352
|
+
async function _i(a, t) {
|
|
4302
4353
|
const {
|
|
4303
4354
|
placement: e,
|
|
4304
4355
|
platform: i,
|
|
4305
4356
|
elements: s
|
|
4306
|
-
} = a,
|
|
4357
|
+
} = a, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r = q(e), n = ct(e), l = J(e) === "y", h = ["left", "top"].includes(r) ? -1 : 1, f = o && l ? -1 : 1, d = at(t, a);
|
|
4307
4358
|
let {
|
|
4308
4359
|
mainAxis: x,
|
|
4309
4360
|
crossAxis: u,
|
|
@@ -4325,7 +4376,7 @@ async function bi(a, t) {
|
|
|
4325
4376
|
y: u * f
|
|
4326
4377
|
};
|
|
4327
4378
|
}
|
|
4328
|
-
const
|
|
4379
|
+
const Oi = function(a) {
|
|
4329
4380
|
return a === void 0 && (a = 0), {
|
|
4330
4381
|
name: "offset",
|
|
4331
4382
|
options: a,
|
|
@@ -4333,21 +4384,21 @@ const Ci = function(a) {
|
|
|
4333
4384
|
var e, i;
|
|
4334
4385
|
const {
|
|
4335
4386
|
x: s,
|
|
4336
|
-
y:
|
|
4337
|
-
placement:
|
|
4387
|
+
y: o,
|
|
4388
|
+
placement: r,
|
|
4338
4389
|
middlewareData: n
|
|
4339
|
-
} = t, l = await
|
|
4340
|
-
return
|
|
4390
|
+
} = t, l = await _i(t, a);
|
|
4391
|
+
return r === ((e = n.offset) == null ? void 0 : e.placement) && (i = n.arrow) != null && i.alignmentOffset ? {} : {
|
|
4341
4392
|
x: s + l.x,
|
|
4342
|
-
y:
|
|
4393
|
+
y: o + l.y,
|
|
4343
4394
|
data: {
|
|
4344
4395
|
...l,
|
|
4345
|
-
placement:
|
|
4396
|
+
placement: r
|
|
4346
4397
|
}
|
|
4347
4398
|
};
|
|
4348
4399
|
}
|
|
4349
4400
|
};
|
|
4350
|
-
},
|
|
4401
|
+
}, Si = function(a) {
|
|
4351
4402
|
return a === void 0 && (a = {}), {
|
|
4352
4403
|
name: "shift",
|
|
4353
4404
|
options: a,
|
|
@@ -4357,8 +4408,8 @@ const Ci = function(a) {
|
|
|
4357
4408
|
y: i,
|
|
4358
4409
|
placement: s
|
|
4359
4410
|
} = t, {
|
|
4360
|
-
mainAxis:
|
|
4361
|
-
crossAxis:
|
|
4411
|
+
mainAxis: o = !0,
|
|
4412
|
+
crossAxis: r = !1,
|
|
4362
4413
|
limiter: n = {
|
|
4363
4414
|
fn: (w) => {
|
|
4364
4415
|
let {
|
|
@@ -4375,15 +4426,15 @@ const Ci = function(a) {
|
|
|
4375
4426
|
} = at(a, t), h = {
|
|
4376
4427
|
x: e,
|
|
4377
4428
|
y: i
|
|
4378
|
-
}, f = await
|
|
4429
|
+
}, f = await ne(t, l), d = J(q(s)), x = re(d);
|
|
4379
4430
|
let u = h[x], y = h[d];
|
|
4380
|
-
if (
|
|
4431
|
+
if (o) {
|
|
4381
4432
|
const w = x === "y" ? "top" : "left", p = x === "y" ? "bottom" : "right", E = u + f[w], m = u - f[p];
|
|
4382
|
-
u =
|
|
4433
|
+
u = _t(E, u, m);
|
|
4383
4434
|
}
|
|
4384
|
-
if (
|
|
4435
|
+
if (r) {
|
|
4385
4436
|
const w = d === "y" ? "top" : "left", p = d === "y" ? "bottom" : "right", E = y + f[w], m = y - f[p];
|
|
4386
|
-
y =
|
|
4437
|
+
y = _t(E, y, m);
|
|
4387
4438
|
}
|
|
4388
4439
|
const g = n.fn({
|
|
4389
4440
|
...t,
|
|
@@ -4396,8 +4447,8 @@ const Ci = function(a) {
|
|
|
4396
4447
|
x: g.x - e,
|
|
4397
4448
|
y: g.y - i,
|
|
4398
4449
|
enabled: {
|
|
4399
|
-
[x]:
|
|
4400
|
-
[d]:
|
|
4450
|
+
[x]: o,
|
|
4451
|
+
[d]: r
|
|
4401
4452
|
}
|
|
4402
4453
|
}
|
|
4403
4454
|
};
|
|
@@ -4408,27 +4459,27 @@ function gt() {
|
|
|
4408
4459
|
return typeof window < "u";
|
|
4409
4460
|
}
|
|
4410
4461
|
function tt(a) {
|
|
4411
|
-
return
|
|
4462
|
+
return ae(a) ? (a.nodeName || "").toLowerCase() : "#document";
|
|
4412
4463
|
}
|
|
4413
|
-
function
|
|
4464
|
+
function H(a) {
|
|
4414
4465
|
var t;
|
|
4415
4466
|
return (a == null || (t = a.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
4416
4467
|
}
|
|
4417
|
-
function
|
|
4468
|
+
function K(a) {
|
|
4418
4469
|
var t;
|
|
4419
|
-
return (t = (
|
|
4470
|
+
return (t = (ae(a) ? a.ownerDocument : a.document) || window.document) == null ? void 0 : t.documentElement;
|
|
4420
4471
|
}
|
|
4421
|
-
function
|
|
4422
|
-
return gt() ? a instanceof Node || a instanceof
|
|
4472
|
+
function ae(a) {
|
|
4473
|
+
return gt() ? a instanceof Node || a instanceof H(a).Node : !1;
|
|
4423
4474
|
}
|
|
4424
|
-
function
|
|
4425
|
-
return gt() ? a instanceof Element || a instanceof
|
|
4475
|
+
function X(a) {
|
|
4476
|
+
return gt() ? a instanceof Element || a instanceof H(a).Element : !1;
|
|
4426
4477
|
}
|
|
4427
4478
|
function N(a) {
|
|
4428
|
-
return gt() ? a instanceof HTMLElement || a instanceof
|
|
4479
|
+
return gt() ? a instanceof HTMLElement || a instanceof H(a).HTMLElement : !1;
|
|
4429
4480
|
}
|
|
4430
|
-
function
|
|
4431
|
-
return !gt() || typeof ShadowRoot > "u" ? !1 : a instanceof ShadowRoot || a instanceof
|
|
4481
|
+
function $t(a) {
|
|
4482
|
+
return !gt() || typeof ShadowRoot > "u" ? !1 : a instanceof ShadowRoot || a instanceof H(a).ShadowRoot;
|
|
4432
4483
|
}
|
|
4433
4484
|
function lt(a) {
|
|
4434
4485
|
const {
|
|
@@ -4436,10 +4487,10 @@ function lt(a) {
|
|
|
4436
4487
|
overflowX: e,
|
|
4437
4488
|
overflowY: i,
|
|
4438
4489
|
display: s
|
|
4439
|
-
} =
|
|
4490
|
+
} = k(a);
|
|
4440
4491
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
|
|
4441
4492
|
}
|
|
4442
|
-
function
|
|
4493
|
+
function Ti(a) {
|
|
4443
4494
|
return ["table", "td", "th"].includes(tt(a));
|
|
4444
4495
|
}
|
|
4445
4496
|
function wt(a) {
|
|
@@ -4452,10 +4503,10 @@ function wt(a) {
|
|
|
4452
4503
|
});
|
|
4453
4504
|
}
|
|
4454
4505
|
function Dt(a) {
|
|
4455
|
-
const t =
|
|
4506
|
+
const t = Xt(), e = X(a) ? k(a) : a;
|
|
4456
4507
|
return e.transform !== "none" || e.perspective !== "none" || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (e.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (e.contain || "").includes(i));
|
|
4457
4508
|
}
|
|
4458
|
-
function
|
|
4509
|
+
function Li(a) {
|
|
4459
4510
|
let t = z(a);
|
|
4460
4511
|
for (; N(t) && !Q(t); ) {
|
|
4461
4512
|
if (Dt(t))
|
|
@@ -4466,17 +4517,17 @@ function Ii(a) {
|
|
|
4466
4517
|
}
|
|
4467
4518
|
return null;
|
|
4468
4519
|
}
|
|
4469
|
-
function
|
|
4520
|
+
function Xt() {
|
|
4470
4521
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
4471
4522
|
}
|
|
4472
4523
|
function Q(a) {
|
|
4473
4524
|
return ["html", "body", "#document"].includes(tt(a));
|
|
4474
4525
|
}
|
|
4475
|
-
function
|
|
4476
|
-
return
|
|
4526
|
+
function k(a) {
|
|
4527
|
+
return H(a).getComputedStyle(a);
|
|
4477
4528
|
}
|
|
4478
4529
|
function pt(a) {
|
|
4479
|
-
return
|
|
4530
|
+
return X(a) ? {
|
|
4480
4531
|
scrollLeft: a.scrollLeft,
|
|
4481
4532
|
scrollTop: a.scrollTop
|
|
4482
4533
|
} : {
|
|
@@ -4491,80 +4542,80 @@ function z(a) {
|
|
|
4491
4542
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
4492
4543
|
a.assignedSlot || // DOM Element detected.
|
|
4493
4544
|
a.parentNode || // ShadowRoot detected.
|
|
4494
|
-
|
|
4495
|
-
|
|
4545
|
+
$t(a) && a.host || // Fallback.
|
|
4546
|
+
K(a)
|
|
4496
4547
|
);
|
|
4497
|
-
return
|
|
4548
|
+
return $t(t) ? t.host : t;
|
|
4498
4549
|
}
|
|
4499
|
-
function
|
|
4550
|
+
function ce(a) {
|
|
4500
4551
|
const t = z(a);
|
|
4501
|
-
return Q(t) ? a.ownerDocument ? a.ownerDocument.body : a.body : N(t) && lt(t) ? t :
|
|
4552
|
+
return Q(t) ? a.ownerDocument ? a.ownerDocument.body : a.body : N(t) && lt(t) ? t : ce(t);
|
|
4502
4553
|
}
|
|
4503
4554
|
function St(a, t, e) {
|
|
4504
4555
|
var i;
|
|
4505
4556
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
4506
|
-
const s =
|
|
4507
|
-
if (
|
|
4508
|
-
const n = Tt(
|
|
4509
|
-
return t.concat(
|
|
4557
|
+
const s = ce(a), o = s === ((i = a.ownerDocument) == null ? void 0 : i.body), r = H(s);
|
|
4558
|
+
if (o) {
|
|
4559
|
+
const n = Tt(r);
|
|
4560
|
+
return t.concat(r, r.visualViewport || [], lt(s) ? s : [], n && e ? St(n) : []);
|
|
4510
4561
|
}
|
|
4511
4562
|
return t.concat(s, St(s, [], e));
|
|
4512
4563
|
}
|
|
4513
4564
|
function Tt(a) {
|
|
4514
4565
|
return a.parent && Object.getPrototypeOf(a.parent) ? a.frameElement : null;
|
|
4515
4566
|
}
|
|
4516
|
-
function
|
|
4517
|
-
const t =
|
|
4567
|
+
function le(a) {
|
|
4568
|
+
const t = k(a);
|
|
4518
4569
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
4519
|
-
const s = N(a),
|
|
4520
|
-
return n && (e =
|
|
4570
|
+
const s = N(a), o = s ? a.offsetWidth : e, r = s ? a.offsetHeight : i, n = ft(e) !== o || ft(i) !== r;
|
|
4571
|
+
return n && (e = o, i = r), {
|
|
4521
4572
|
width: e,
|
|
4522
4573
|
height: i,
|
|
4523
4574
|
$: n
|
|
4524
4575
|
};
|
|
4525
4576
|
}
|
|
4526
|
-
function
|
|
4527
|
-
return
|
|
4577
|
+
function he(a) {
|
|
4578
|
+
return X(a) ? a : a.contextElement;
|
|
4528
4579
|
}
|
|
4529
4580
|
function Z(a) {
|
|
4530
|
-
const t =
|
|
4581
|
+
const t = he(a);
|
|
4531
4582
|
if (!N(t))
|
|
4532
4583
|
return V(1);
|
|
4533
4584
|
const e = t.getBoundingClientRect(), {
|
|
4534
4585
|
width: i,
|
|
4535
4586
|
height: s,
|
|
4536
|
-
$:
|
|
4537
|
-
} =
|
|
4538
|
-
let
|
|
4539
|
-
return (!
|
|
4540
|
-
x:
|
|
4587
|
+
$: o
|
|
4588
|
+
} = le(t);
|
|
4589
|
+
let r = (o ? ft(e.width) : e.width) / i, n = (o ? ft(e.height) : e.height) / s;
|
|
4590
|
+
return (!r || !Number.isFinite(r)) && (r = 1), (!n || !Number.isFinite(n)) && (n = 1), {
|
|
4591
|
+
x: r,
|
|
4541
4592
|
y: n
|
|
4542
4593
|
};
|
|
4543
4594
|
}
|
|
4544
|
-
const
|
|
4545
|
-
function
|
|
4546
|
-
const t =
|
|
4547
|
-
return !
|
|
4595
|
+
const Ai = /* @__PURE__ */ V(0);
|
|
4596
|
+
function de(a) {
|
|
4597
|
+
const t = H(a);
|
|
4598
|
+
return !Xt() || !t.visualViewport ? Ai : {
|
|
4548
4599
|
x: t.visualViewport.offsetLeft,
|
|
4549
4600
|
y: t.visualViewport.offsetTop
|
|
4550
4601
|
};
|
|
4551
4602
|
}
|
|
4552
|
-
function
|
|
4553
|
-
return t === void 0 && (t = !1), !e || t && e !==
|
|
4603
|
+
function Mi(a, t, e) {
|
|
4604
|
+
return t === void 0 && (t = !1), !e || t && e !== H(a) ? !1 : t;
|
|
4554
4605
|
}
|
|
4555
4606
|
function ot(a, t, e, i) {
|
|
4556
4607
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
4557
|
-
const s = a.getBoundingClientRect(),
|
|
4558
|
-
let
|
|
4559
|
-
t && (i ?
|
|
4560
|
-
const n =
|
|
4561
|
-
let l = (s.left + n.x) /
|
|
4562
|
-
if (
|
|
4563
|
-
const x =
|
|
4608
|
+
const s = a.getBoundingClientRect(), o = he(a);
|
|
4609
|
+
let r = V(1);
|
|
4610
|
+
t && (i ? X(i) && (r = Z(i)) : r = Z(a));
|
|
4611
|
+
const n = Mi(o, e, i) ? de(o) : V(0);
|
|
4612
|
+
let l = (s.left + n.x) / r.x, h = (s.top + n.y) / r.y, f = s.width / r.x, d = s.height / r.y;
|
|
4613
|
+
if (o) {
|
|
4614
|
+
const x = H(o), u = i && X(i) ? H(i) : i;
|
|
4564
4615
|
let y = x, g = Tt(y);
|
|
4565
4616
|
for (; g && i && u !== y; ) {
|
|
4566
|
-
const w = Z(g), p = g.getBoundingClientRect(), E =
|
|
4567
|
-
l *= w.x, h *= w.y, f *= w.x, d *= w.y, l += m, h += b, y =
|
|
4617
|
+
const w = Z(g), p = g.getBoundingClientRect(), E = k(g), m = p.left + (g.clientLeft + parseFloat(E.paddingLeft)) * w.x, b = p.top + (g.clientTop + parseFloat(E.paddingTop)) * w.y;
|
|
4618
|
+
l *= w.x, h *= w.y, f *= w.x, d *= w.y, l += m, h += b, y = H(g), g = Tt(y);
|
|
4568
4619
|
}
|
|
4569
4620
|
}
|
|
4570
4621
|
return ut({
|
|
@@ -4574,22 +4625,22 @@ function ot(a, t, e, i) {
|
|
|
4574
4625
|
y: h
|
|
4575
4626
|
});
|
|
4576
4627
|
}
|
|
4577
|
-
function
|
|
4628
|
+
function Hi(a) {
|
|
4578
4629
|
let {
|
|
4579
4630
|
elements: t,
|
|
4580
4631
|
rect: e,
|
|
4581
4632
|
offsetParent: i,
|
|
4582
4633
|
strategy: s
|
|
4583
4634
|
} = a;
|
|
4584
|
-
const
|
|
4585
|
-
if (i ===
|
|
4635
|
+
const o = s === "fixed", r = K(i), n = t ? wt(t.floating) : !1;
|
|
4636
|
+
if (i === r || n && o)
|
|
4586
4637
|
return e;
|
|
4587
4638
|
let l = {
|
|
4588
4639
|
scrollLeft: 0,
|
|
4589
4640
|
scrollTop: 0
|
|
4590
4641
|
}, h = V(1);
|
|
4591
4642
|
const f = V(0), d = N(i);
|
|
4592
|
-
if ((d || !d && !
|
|
4643
|
+
if ((d || !d && !o) && ((tt(i) !== "body" || lt(r)) && (l = pt(i)), N(i))) {
|
|
4593
4644
|
const x = ot(i);
|
|
4594
4645
|
h = Z(i), f.x = x.x + i.clientLeft, f.y = x.y + i.clientTop;
|
|
4595
4646
|
}
|
|
@@ -4600,58 +4651,58 @@ function Si(a) {
|
|
|
4600
4651
|
y: e.y * h.y - l.scrollTop * h.y + f.y
|
|
4601
4652
|
};
|
|
4602
4653
|
}
|
|
4603
|
-
function
|
|
4654
|
+
function Di(a) {
|
|
4604
4655
|
return Array.from(a.getClientRects());
|
|
4605
4656
|
}
|
|
4606
4657
|
function Lt(a, t) {
|
|
4607
4658
|
const e = pt(a).scrollLeft;
|
|
4608
|
-
return t ? t.left + e : ot(
|
|
4659
|
+
return t ? t.left + e : ot(K(a)).left + e;
|
|
4609
4660
|
}
|
|
4610
|
-
function
|
|
4611
|
-
const t =
|
|
4612
|
-
let
|
|
4661
|
+
function Xi(a) {
|
|
4662
|
+
const t = K(a), e = pt(a), i = a.ownerDocument.body, s = U(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), o = U(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
|
|
4663
|
+
let r = -e.scrollLeft + Lt(a);
|
|
4613
4664
|
const n = -e.scrollTop;
|
|
4614
|
-
return
|
|
4665
|
+
return k(i).direction === "rtl" && (r += U(t.clientWidth, i.clientWidth) - s), {
|
|
4615
4666
|
width: s,
|
|
4616
|
-
height:
|
|
4617
|
-
x:
|
|
4667
|
+
height: o,
|
|
4668
|
+
x: r,
|
|
4618
4669
|
y: n
|
|
4619
4670
|
};
|
|
4620
4671
|
}
|
|
4621
|
-
function
|
|
4622
|
-
const e =
|
|
4623
|
-
let
|
|
4672
|
+
function ki(a, t) {
|
|
4673
|
+
const e = H(a), i = K(a), s = e.visualViewport;
|
|
4674
|
+
let o = i.clientWidth, r = i.clientHeight, n = 0, l = 0;
|
|
4624
4675
|
if (s) {
|
|
4625
|
-
|
|
4626
|
-
const h =
|
|
4676
|
+
o = s.width, r = s.height;
|
|
4677
|
+
const h = Xt();
|
|
4627
4678
|
(!h || h && t === "fixed") && (n = s.offsetLeft, l = s.offsetTop);
|
|
4628
4679
|
}
|
|
4629
4680
|
return {
|
|
4630
|
-
width:
|
|
4631
|
-
height:
|
|
4681
|
+
width: o,
|
|
4682
|
+
height: r,
|
|
4632
4683
|
x: n,
|
|
4633
4684
|
y: l
|
|
4634
4685
|
};
|
|
4635
4686
|
}
|
|
4636
|
-
function
|
|
4637
|
-
const e = ot(a, !0, t === "fixed"), i = e.top + a.clientTop, s = e.left + a.clientLeft,
|
|
4687
|
+
function Fi(a, t) {
|
|
4688
|
+
const e = ot(a, !0, t === "fixed"), i = e.top + a.clientTop, s = e.left + a.clientLeft, o = N(a) ? Z(a) : V(1), r = a.clientWidth * o.x, n = a.clientHeight * o.y, l = s * o.x, h = i * o.y;
|
|
4638
4689
|
return {
|
|
4639
|
-
width:
|
|
4690
|
+
width: r,
|
|
4640
4691
|
height: n,
|
|
4641
4692
|
x: l,
|
|
4642
4693
|
y: h
|
|
4643
4694
|
};
|
|
4644
4695
|
}
|
|
4645
|
-
function
|
|
4696
|
+
function qt(a, t, e) {
|
|
4646
4697
|
let i;
|
|
4647
4698
|
if (t === "viewport")
|
|
4648
|
-
i =
|
|
4699
|
+
i = ki(a, e);
|
|
4649
4700
|
else if (t === "document")
|
|
4650
|
-
i =
|
|
4651
|
-
else if (
|
|
4652
|
-
i =
|
|
4701
|
+
i = Xi(K(a));
|
|
4702
|
+
else if (X(t))
|
|
4703
|
+
i = Fi(t, e);
|
|
4653
4704
|
else {
|
|
4654
|
-
const s =
|
|
4705
|
+
const s = de(a);
|
|
4655
4706
|
i = {
|
|
4656
4707
|
...t,
|
|
4657
4708
|
x: t.x - s.x,
|
|
@@ -4660,34 +4711,34 @@ function zt(a, t, e) {
|
|
|
4660
4711
|
}
|
|
4661
4712
|
return ut(i);
|
|
4662
4713
|
}
|
|
4663
|
-
function
|
|
4714
|
+
function fe(a, t) {
|
|
4664
4715
|
const e = z(a);
|
|
4665
|
-
return e === t || !
|
|
4716
|
+
return e === t || !X(e) || Q(e) ? !1 : k(e).position === "fixed" || fe(e, t);
|
|
4666
4717
|
}
|
|
4667
|
-
function
|
|
4718
|
+
function Ni(a, t) {
|
|
4668
4719
|
const e = t.get(a);
|
|
4669
4720
|
if (e)
|
|
4670
4721
|
return e;
|
|
4671
|
-
let i = St(a, [], !1).filter((n) =>
|
|
4672
|
-
const
|
|
4673
|
-
let
|
|
4674
|
-
for (;
|
|
4675
|
-
const n =
|
|
4676
|
-
!l && n.position === "fixed" && (s = null), (
|
|
4722
|
+
let i = St(a, [], !1).filter((n) => X(n) && tt(n) !== "body"), s = null;
|
|
4723
|
+
const o = k(a).position === "fixed";
|
|
4724
|
+
let r = o ? z(a) : a;
|
|
4725
|
+
for (; X(r) && !Q(r); ) {
|
|
4726
|
+
const n = k(r), l = Dt(r);
|
|
4727
|
+
!l && n.position === "fixed" && (s = null), (o ? !l && !s : !l && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || lt(r) && !l && fe(a, r)) ? i = i.filter((f) => f !== r) : s = n, r = z(r);
|
|
4677
4728
|
}
|
|
4678
4729
|
return t.set(a, i), i;
|
|
4679
4730
|
}
|
|
4680
|
-
function
|
|
4731
|
+
function Yi(a) {
|
|
4681
4732
|
let {
|
|
4682
4733
|
element: t,
|
|
4683
4734
|
boundary: e,
|
|
4684
4735
|
rootBoundary: i,
|
|
4685
4736
|
strategy: s
|
|
4686
4737
|
} = a;
|
|
4687
|
-
const
|
|
4688
|
-
const d =
|
|
4738
|
+
const r = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], n = r[0], l = r.reduce((h, f) => {
|
|
4739
|
+
const d = qt(t, f, s);
|
|
4689
4740
|
return h.top = U(d.top, h.top), h.right = rt(d.right, h.right), h.bottom = rt(d.bottom, h.bottom), h.left = U(d.left, h.left), h;
|
|
4690
|
-
},
|
|
4741
|
+
}, qt(t, n, s));
|
|
4691
4742
|
return {
|
|
4692
4743
|
width: l.right - l.left,
|
|
4693
4744
|
height: l.bottom - l.top,
|
|
@@ -4695,75 +4746,75 @@ function Di(a) {
|
|
|
4695
4746
|
y: l.top
|
|
4696
4747
|
};
|
|
4697
4748
|
}
|
|
4698
|
-
function
|
|
4749
|
+
function Ki(a) {
|
|
4699
4750
|
const {
|
|
4700
4751
|
width: t,
|
|
4701
4752
|
height: e
|
|
4702
|
-
} =
|
|
4753
|
+
} = le(a);
|
|
4703
4754
|
return {
|
|
4704
4755
|
width: t,
|
|
4705
4756
|
height: e
|
|
4706
4757
|
};
|
|
4707
4758
|
}
|
|
4708
|
-
function
|
|
4709
|
-
const i = N(t), s =
|
|
4759
|
+
function Bi(a, t, e) {
|
|
4760
|
+
const i = N(t), s = K(t), o = e === "fixed", r = ot(a, !0, o, t);
|
|
4710
4761
|
let n = {
|
|
4711
4762
|
scrollLeft: 0,
|
|
4712
4763
|
scrollTop: 0
|
|
4713
4764
|
};
|
|
4714
4765
|
const l = V(0);
|
|
4715
|
-
if (i || !i && !
|
|
4766
|
+
if (i || !i && !o)
|
|
4716
4767
|
if ((tt(t) !== "body" || lt(s)) && (n = pt(t)), i) {
|
|
4717
|
-
const u = ot(t, !0,
|
|
4768
|
+
const u = ot(t, !0, o, t);
|
|
4718
4769
|
l.x = u.x + t.clientLeft, l.y = u.y + t.clientTop;
|
|
4719
4770
|
} else s && (l.x = Lt(s));
|
|
4720
4771
|
let h = 0, f = 0;
|
|
4721
|
-
if (s && !i && !
|
|
4772
|
+
if (s && !i && !o) {
|
|
4722
4773
|
const u = s.getBoundingClientRect();
|
|
4723
4774
|
f = u.top + n.scrollTop, h = u.left + n.scrollLeft - // RTL <body> scrollbar.
|
|
4724
4775
|
Lt(s, u);
|
|
4725
4776
|
}
|
|
4726
|
-
const d =
|
|
4777
|
+
const d = r.left + n.scrollLeft - l.x - h, x = r.top + n.scrollTop - l.y - f;
|
|
4727
4778
|
return {
|
|
4728
4779
|
x: d,
|
|
4729
4780
|
y: x,
|
|
4730
|
-
width:
|
|
4731
|
-
height:
|
|
4781
|
+
width: r.width,
|
|
4782
|
+
height: r.height
|
|
4732
4783
|
};
|
|
4733
4784
|
}
|
|
4734
4785
|
function mt(a) {
|
|
4735
|
-
return
|
|
4786
|
+
return k(a).position === "static";
|
|
4736
4787
|
}
|
|
4737
|
-
function
|
|
4738
|
-
if (!N(a) ||
|
|
4788
|
+
function Gt(a, t) {
|
|
4789
|
+
if (!N(a) || k(a).position === "fixed")
|
|
4739
4790
|
return null;
|
|
4740
4791
|
if (t)
|
|
4741
4792
|
return t(a);
|
|
4742
4793
|
let e = a.offsetParent;
|
|
4743
|
-
return
|
|
4794
|
+
return K(a) === e && (e = e.ownerDocument.body), e;
|
|
4744
4795
|
}
|
|
4745
|
-
function
|
|
4746
|
-
const e =
|
|
4796
|
+
function xe(a, t) {
|
|
4797
|
+
const e = H(a);
|
|
4747
4798
|
if (wt(a))
|
|
4748
4799
|
return e;
|
|
4749
4800
|
if (!N(a)) {
|
|
4750
4801
|
let s = z(a);
|
|
4751
4802
|
for (; s && !Q(s); ) {
|
|
4752
|
-
if (
|
|
4803
|
+
if (X(s) && !mt(s))
|
|
4753
4804
|
return s;
|
|
4754
4805
|
s = z(s);
|
|
4755
4806
|
}
|
|
4756
4807
|
return e;
|
|
4757
4808
|
}
|
|
4758
|
-
let i =
|
|
4759
|
-
for (; i &&
|
|
4760
|
-
i =
|
|
4761
|
-
return i && Q(i) && mt(i) && !Dt(i) ? e : i ||
|
|
4809
|
+
let i = Gt(a, t);
|
|
4810
|
+
for (; i && Ti(i) && mt(i); )
|
|
4811
|
+
i = Gt(i, t);
|
|
4812
|
+
return i && Q(i) && mt(i) && !Dt(i) ? e : i || Li(a) || e;
|
|
4762
4813
|
}
|
|
4763
|
-
const
|
|
4764
|
-
const t = this.getOffsetParent ||
|
|
4814
|
+
const Wi = async function(a) {
|
|
4815
|
+
const t = this.getOffsetParent || xe, e = this.getDimensions, i = await e(a.floating);
|
|
4765
4816
|
return {
|
|
4766
|
-
reference:
|
|
4817
|
+
reference: Bi(a.reference, await t(a.floating), a.strategy),
|
|
4767
4818
|
floating: {
|
|
4768
4819
|
x: 0,
|
|
4769
4820
|
y: 0,
|
|
@@ -4772,34 +4823,34 @@ const Xi = async function(a) {
|
|
|
4772
4823
|
}
|
|
4773
4824
|
};
|
|
4774
4825
|
};
|
|
4775
|
-
function
|
|
4776
|
-
return
|
|
4826
|
+
function Pi(a) {
|
|
4827
|
+
return k(a).direction === "rtl";
|
|
4777
4828
|
}
|
|
4778
|
-
const
|
|
4779
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
4780
|
-
getDocumentElement:
|
|
4781
|
-
getClippingRect:
|
|
4782
|
-
getOffsetParent:
|
|
4783
|
-
getElementRects:
|
|
4784
|
-
getClientRects:
|
|
4785
|
-
getDimensions:
|
|
4829
|
+
const Vi = {
|
|
4830
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Hi,
|
|
4831
|
+
getDocumentElement: K,
|
|
4832
|
+
getClippingRect: Yi,
|
|
4833
|
+
getOffsetParent: xe,
|
|
4834
|
+
getElementRects: Wi,
|
|
4835
|
+
getClientRects: Di,
|
|
4836
|
+
getDimensions: Ki,
|
|
4786
4837
|
getScale: Z,
|
|
4787
|
-
isElement:
|
|
4788
|
-
isRTL:
|
|
4789
|
-
},
|
|
4838
|
+
isElement: X,
|
|
4839
|
+
isRTL: Pi
|
|
4840
|
+
}, ue = Oi, ge = Si, we = Ii, zi = Ri, pe = (a, t, e) => {
|
|
4790
4841
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
4791
|
-
platform:
|
|
4842
|
+
platform: Vi,
|
|
4792
4843
|
...e
|
|
4793
|
-
},
|
|
4844
|
+
}, o = {
|
|
4794
4845
|
...s.platform,
|
|
4795
4846
|
_c: i
|
|
4796
4847
|
};
|
|
4797
|
-
return
|
|
4848
|
+
return vi(a, t, {
|
|
4798
4849
|
...s,
|
|
4799
|
-
platform:
|
|
4850
|
+
platform: o
|
|
4800
4851
|
});
|
|
4801
4852
|
};
|
|
4802
|
-
let
|
|
4853
|
+
let $i = class {
|
|
4803
4854
|
constructor(t) {
|
|
4804
4855
|
c(this, "ctx");
|
|
4805
4856
|
c(this, "enable", !1);
|
|
@@ -4807,8 +4858,8 @@ let Bi = class {
|
|
|
4807
4858
|
c(this, "floatingEl");
|
|
4808
4859
|
c(this, "arrowEl");
|
|
4809
4860
|
this.ctx = t;
|
|
4810
|
-
const { TOOLTIP_BG_COLOR: e, TOOLTIP_TEXT_COLOR: i, TOOLTIP_ZINDEX: s, TOOLTIP_CUSTOM_STYLE:
|
|
4811
|
-
this.contentEl = document.createElement("div"), this.arrowEl = document.createElement("div"), this.floatingEl = document.createElement("div"), this.floatingEl.className = `${
|
|
4861
|
+
const { TOOLTIP_BG_COLOR: e, TOOLTIP_TEXT_COLOR: i, TOOLTIP_ZINDEX: s, TOOLTIP_CUSTOM_STYLE: o, CSS_PREFIX: r } = this.ctx.config;
|
|
4862
|
+
this.contentEl = document.createElement("div"), this.arrowEl = document.createElement("div"), this.floatingEl = document.createElement("div"), this.floatingEl.className = `${r}-tooltip`, this.contentEl.className = `${r}-tooltip-content`, this.arrowEl.className = `${r}-tooltip-arrow`;
|
|
4812
4863
|
const n = {
|
|
4813
4864
|
display: "none",
|
|
4814
4865
|
position: "absolute",
|
|
@@ -4819,7 +4870,7 @@ let Bi = class {
|
|
|
4819
4870
|
padding: "8px",
|
|
4820
4871
|
borderRadius: "4px",
|
|
4821
4872
|
fontSize: "12px",
|
|
4822
|
-
...
|
|
4873
|
+
...o
|
|
4823
4874
|
}, l = {
|
|
4824
4875
|
position: "absolute",
|
|
4825
4876
|
width: "10px",
|
|
@@ -4853,23 +4904,23 @@ let Bi = class {
|
|
|
4853
4904
|
if (!i)
|
|
4854
4905
|
return;
|
|
4855
4906
|
this.enable = !0, this.contentEl.style.maxWidth = `${t.overflowTooltipMaxWidth || 500}px`, this.contentEl.style.width = "100%", this.contentEl.style.display = "inline-block", this.contentEl.style.wordBreak = "break-all", this.contentEl.style.lineHeight = "1.5", this.contentEl.innerText = e;
|
|
4856
|
-
const s = t.drawX + i.x,
|
|
4857
|
-
|
|
4907
|
+
const s = t.drawX + i.x, o = t.drawY + i.y;
|
|
4908
|
+
pe({
|
|
4858
4909
|
getBoundingClientRect() {
|
|
4859
4910
|
return {
|
|
4860
4911
|
width: t.visibleWidth,
|
|
4861
4912
|
height: t.visibleHeight,
|
|
4862
4913
|
x: s,
|
|
4863
|
-
y:
|
|
4914
|
+
y: o,
|
|
4864
4915
|
left: s,
|
|
4865
4916
|
right: s + t.visibleWidth,
|
|
4866
|
-
top:
|
|
4867
|
-
bottom:
|
|
4917
|
+
top: o,
|
|
4918
|
+
bottom: o + t.visibleHeight
|
|
4868
4919
|
};
|
|
4869
4920
|
}
|
|
4870
4921
|
}, this.floatingEl, {
|
|
4871
4922
|
placement: t.overflowTooltipPlacement,
|
|
4872
|
-
middleware: [
|
|
4923
|
+
middleware: [ge(), we(), ue(6), zi({ element: this.arrowEl })]
|
|
4873
4924
|
}).then((n) => {
|
|
4874
4925
|
const { x: l, y: h, placement: f, middlewareData: d } = n;
|
|
4875
4926
|
if (Object.assign(this.floatingEl.style, {
|
|
@@ -4908,7 +4959,7 @@ let Bi = class {
|
|
|
4908
4959
|
this.contentEl.remove(), this.arrowEl.remove(), this.floatingEl.remove();
|
|
4909
4960
|
}
|
|
4910
4961
|
};
|
|
4911
|
-
class
|
|
4962
|
+
class qi {
|
|
4912
4963
|
constructor(t) {
|
|
4913
4964
|
c(this, "editorEl");
|
|
4914
4965
|
c(this, "inputEl");
|
|
@@ -4921,10 +4972,10 @@ class Wi {
|
|
|
4921
4972
|
this.ctx.on("onScroll", () => {
|
|
4922
4973
|
this.enable && this.doneEdit();
|
|
4923
4974
|
}), this.ctx.on("cellHeaderMousedown", () => {
|
|
4924
|
-
this.enable && this.doneEdit();
|
|
4975
|
+
this.enable && this.doneEdit(), this.cellTarget = null;
|
|
4925
4976
|
}), this.ctx.on("keydown", (t) => {
|
|
4926
|
-
const e = t.key, i = t.ctrlKey, s = t.altKey,
|
|
4927
|
-
if (!(i || s ||
|
|
4977
|
+
const e = t.key, i = t.ctrlKey, s = t.altKey, o = t.shiftKey, r = t.metaKey;
|
|
4978
|
+
if (!(i || s || o || r || [
|
|
4928
4979
|
// "Enter",
|
|
4929
4980
|
"Escape",
|
|
4930
4981
|
"Tab",
|
|
@@ -4965,10 +5016,10 @@ class Wi {
|
|
|
4965
5016
|
}
|
|
4966
5017
|
initTextEditor() {
|
|
4967
5018
|
const { CSS_PREFIX: t, SELECT_BORDER_COLOR: e } = this.ctx.config;
|
|
4968
|
-
this.inputEl = document.createElement("div"), this.inputEl.addEventListener("keydown", (
|
|
5019
|
+
this.inputEl = document.createElement("div"), this.inputEl.addEventListener("keydown", (r) => {
|
|
4969
5020
|
if (this.enable) {
|
|
4970
|
-
if ((
|
|
4971
|
-
|
|
5021
|
+
if ((r.altKey || r.metaKey) && r.code === "Enter") {
|
|
5022
|
+
r.preventDefault();
|
|
4972
5023
|
const n = this.inputEl.textContent;
|
|
4973
5024
|
this.inputEl.textContent = `${n}
|
|
4974
5025
|
|
|
@@ -4977,7 +5028,7 @@ class Wi {
|
|
|
4977
5028
|
l == null || l.selectAllChildren(this.inputEl), l == null || l.collapseToEnd();
|
|
4978
5029
|
return;
|
|
4979
5030
|
}
|
|
4980
|
-
(
|
|
5031
|
+
(r.code === "Escape" || r.code === "Enter") && (r.preventDefault(), this.inputEl.blur());
|
|
4981
5032
|
}
|
|
4982
5033
|
}), this.inputEl.addEventListener("blur", () => {
|
|
4983
5034
|
this.doneEdit();
|
|
@@ -5016,14 +5067,14 @@ class Wi {
|
|
|
5016
5067
|
cursor: "text"
|
|
5017
5068
|
};
|
|
5018
5069
|
Object.assign(this.inputEl.style, s);
|
|
5019
|
-
const
|
|
5020
|
-
this.inputEl.contentEditable =
|
|
5070
|
+
const o = navigator.userAgent.toLowerCase().includes("firefox");
|
|
5071
|
+
this.inputEl.contentEditable = o ? "true" : "plaintext-only", this.editorEl.appendChild(this.inputEl), this.ctx.targetContainer.appendChild(this.editorEl);
|
|
5021
5072
|
}
|
|
5022
5073
|
startEditByInput(t) {
|
|
5023
5074
|
if (t.editorType !== "text")
|
|
5024
5075
|
return;
|
|
5025
|
-
const e = t.getValue(), { width: i, height: s } = t,
|
|
5026
|
-
this.editorEl.style.left = `${
|
|
5076
|
+
const e = t.getValue(), { width: i, height: s } = t, o = t.getDrawX(), r = t.getDrawY(), { CELL_PADDING: n } = this.ctx.config;
|
|
5077
|
+
this.editorEl.style.left = `${o}px`, this.editorEl.style.top = `${r}px`, this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${s - 1}px`, this.inputEl.style.padding = `${n}px`, e !== null && (this.inputEl.textContent = e), this.inputEl.focus();
|
|
5027
5078
|
const l = window.getSelection();
|
|
5028
5079
|
l == null || l.selectAllChildren(this.inputEl), l == null || l.collapseToEnd();
|
|
5029
5080
|
}
|
|
@@ -5040,8 +5091,8 @@ class Wi {
|
|
|
5040
5091
|
const e = this.ctx.focusCell;
|
|
5041
5092
|
if (!e || ["index", "index-selection", "selection"].includes(e.type) || this.enable)
|
|
5042
5093
|
return;
|
|
5043
|
-
const { rowKey: i, key: s } = e,
|
|
5044
|
-
e && !
|
|
5094
|
+
const { rowKey: i, key: s } = e, o = this.ctx.database.getReadonly(i, s);
|
|
5095
|
+
e && !o && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = e, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
5045
5096
|
}
|
|
5046
5097
|
editCell(t, e) {
|
|
5047
5098
|
const i = this.ctx.body.renderRows.find((h) => h.rowIndex === t);
|
|
@@ -5051,11 +5102,11 @@ class Wi {
|
|
|
5051
5102
|
if (!s)
|
|
5052
5103
|
return;
|
|
5053
5104
|
this.ctx.emit("setSelectorCell", s);
|
|
5054
|
-
const
|
|
5055
|
-
if (!
|
|
5105
|
+
const o = this.ctx.focusCell;
|
|
5106
|
+
if (!o || ["index", "index-selection", "selection"].includes(o.type) || this.enable)
|
|
5056
5107
|
return;
|
|
5057
|
-
const { rowKey:
|
|
5058
|
-
|
|
5108
|
+
const { rowKey: r, key: n } = o, l = this.ctx.database.getReadonly(r, n);
|
|
5109
|
+
o && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = o, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
5059
5110
|
}
|
|
5060
5111
|
doneEdit() {
|
|
5061
5112
|
this.enable && this.cellTarget && (this.ctx.emit("doneEdit", this.cellTarget), this.doneEditByInput(), this.enable = !1, this.ctx.target.focus(), this.ctx.editing = !1, this.cellTarget = null, this.ctx.emit("draw"));
|
|
@@ -5063,17 +5114,17 @@ class Wi {
|
|
|
5063
5114
|
destroy() {
|
|
5064
5115
|
}
|
|
5065
5116
|
}
|
|
5066
|
-
class
|
|
5117
|
+
class Gi {
|
|
5067
5118
|
constructor(t) {
|
|
5068
5119
|
c(this, "ctx");
|
|
5069
5120
|
c(this, "emptyEl");
|
|
5070
5121
|
this.ctx = t;
|
|
5071
|
-
const { EMPTY_TEXT: e, EMPTY_CUSTOM: i, EMPTY_CUSTOM_STYLE: s, CSS_PREFIX:
|
|
5072
|
-
this.emptyEl = document.createElement("div"), this.emptyEl.className = `${
|
|
5122
|
+
const { EMPTY_TEXT: e, EMPTY_CUSTOM: i, EMPTY_CUSTOM_STYLE: s, CSS_PREFIX: o } = this.ctx.config;
|
|
5123
|
+
this.emptyEl = document.createElement("div"), this.emptyEl.className = `${o}-empty`, this.emptyEl.style.display = "none", this.emptyEl.innerText = e, this.ctx.targetContainer.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: r, headerHeight: n, bodyHeight: l, footerHeight: h }) => {
|
|
5073
5124
|
if (i)
|
|
5074
5125
|
return;
|
|
5075
5126
|
const f = n + (l + h) / 2, d = {
|
|
5076
|
-
display:
|
|
5127
|
+
display: r === "empty" ? "block" : "none",
|
|
5077
5128
|
position: "absolute",
|
|
5078
5129
|
fontSize: "14px",
|
|
5079
5130
|
color: "#666",
|
|
@@ -5089,7 +5140,7 @@ class Pi {
|
|
|
5089
5140
|
this.emptyEl.remove();
|
|
5090
5141
|
}
|
|
5091
5142
|
}
|
|
5092
|
-
class
|
|
5143
|
+
class ji {
|
|
5093
5144
|
constructor(t) {
|
|
5094
5145
|
c(this, "ctx");
|
|
5095
5146
|
this.ctx = t;
|
|
@@ -5108,10 +5159,10 @@ class Vi {
|
|
|
5108
5159
|
const {
|
|
5109
5160
|
target: t,
|
|
5110
5161
|
config: { SCROLLER_TRACK_SIZE: e }
|
|
5111
|
-
} = this.ctx, i = t.width - e, s = t.height - e,
|
|
5112
|
-
let l = [
|
|
5162
|
+
} = this.ctx, i = t.width - e, s = t.height - e, o = this.getHeader(), r = this.getBody(), n = this.getFooter();
|
|
5163
|
+
let l = [o, r, n];
|
|
5113
5164
|
const { FOOTER_FIXED: h } = this.ctx.config;
|
|
5114
|
-
return h || (l = [
|
|
5165
|
+
return h || (l = [o, r]), {
|
|
5115
5166
|
style: {
|
|
5116
5167
|
position: "absolute",
|
|
5117
5168
|
left: "0px",
|
|
@@ -5129,7 +5180,7 @@ class Vi {
|
|
|
5129
5180
|
fixedLeftWidth: t,
|
|
5130
5181
|
fixedRightWidth: e,
|
|
5131
5182
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
5132
|
-
} = this.ctx, { visibleWidth:
|
|
5183
|
+
} = this.ctx, { visibleWidth: o, visibleHeight: r, renderCellHeaders: n } = this.ctx.header;
|
|
5133
5184
|
let l = [], h = [], f = [];
|
|
5134
5185
|
n.forEach((w) => {
|
|
5135
5186
|
w.render && (w.fixed === "left" ? h.push(w) : w.fixed === "right" ? f.push(w) : l.push(w));
|
|
@@ -5142,7 +5193,7 @@ class Vi {
|
|
|
5142
5193
|
left: `${0.5}px`,
|
|
5143
5194
|
overflow: "hidden",
|
|
5144
5195
|
width: `${t}px`,
|
|
5145
|
-
height: `${
|
|
5196
|
+
height: `${r}px`
|
|
5146
5197
|
},
|
|
5147
5198
|
cells: h
|
|
5148
5199
|
}, u = {
|
|
@@ -5152,8 +5203,8 @@ class Vi {
|
|
|
5152
5203
|
top: `${0.5}px`,
|
|
5153
5204
|
left: `${t}px`,
|
|
5154
5205
|
overflow: "hidden",
|
|
5155
|
-
width: `${
|
|
5156
|
-
height: `${
|
|
5206
|
+
width: `${o - t - d}px`,
|
|
5207
|
+
height: `${r}px`
|
|
5157
5208
|
},
|
|
5158
5209
|
cells: l
|
|
5159
5210
|
}, y = {
|
|
@@ -5164,7 +5215,7 @@ class Vi {
|
|
|
5164
5215
|
right: `${0.5}px`,
|
|
5165
5216
|
overflow: "hidden",
|
|
5166
5217
|
width: `${d}px`,
|
|
5167
|
-
height: `${
|
|
5218
|
+
height: `${r}px`
|
|
5168
5219
|
},
|
|
5169
5220
|
cells: f
|
|
5170
5221
|
};
|
|
@@ -5174,8 +5225,8 @@ class Vi {
|
|
|
5174
5225
|
style: {
|
|
5175
5226
|
position: "relative",
|
|
5176
5227
|
overflow: "hidden",
|
|
5177
|
-
width: `${
|
|
5178
|
-
height: `${
|
|
5228
|
+
width: `${o}px`,
|
|
5229
|
+
height: `${r}px`
|
|
5179
5230
|
},
|
|
5180
5231
|
views: [x, u, y]
|
|
5181
5232
|
};
|
|
@@ -5189,17 +5240,17 @@ class Vi {
|
|
|
5189
5240
|
});
|
|
5190
5241
|
});
|
|
5191
5242
|
const {
|
|
5192
|
-
fixedLeftWidth:
|
|
5193
|
-
fixedRightWidth:
|
|
5243
|
+
fixedLeftWidth: o,
|
|
5244
|
+
fixedRightWidth: r,
|
|
5194
5245
|
config: { SCROLLER_TRACK_SIZE: n, CSS_PREFIX: l }
|
|
5195
|
-
} = this.ctx, { visibleWidth: h, visibleHeight: f } = this.ctx.body, d =
|
|
5246
|
+
} = this.ctx, { visibleWidth: h, visibleHeight: f } = this.ctx.body, d = r - n, x = {
|
|
5196
5247
|
key: "left",
|
|
5197
5248
|
style: {
|
|
5198
5249
|
position: "absolute",
|
|
5199
5250
|
top: `${0.5}px`,
|
|
5200
5251
|
left: `${0.5}px`,
|
|
5201
5252
|
overflow: "hidden",
|
|
5202
|
-
width: `${
|
|
5253
|
+
width: `${o}px`,
|
|
5203
5254
|
height: `${f}px`
|
|
5204
5255
|
},
|
|
5205
5256
|
cells: e
|
|
@@ -5208,9 +5259,9 @@ class Vi {
|
|
|
5208
5259
|
style: {
|
|
5209
5260
|
position: "absolute",
|
|
5210
5261
|
top: `${0.5}px`,
|
|
5211
|
-
left: `${
|
|
5262
|
+
left: `${o + 0.5}px`,
|
|
5212
5263
|
overflow: "hidden",
|
|
5213
|
-
width: `${h -
|
|
5264
|
+
width: `${h - o - d}px`,
|
|
5214
5265
|
height: `${f}px`
|
|
5215
5266
|
},
|
|
5216
5267
|
cells: t
|
|
@@ -5247,9 +5298,9 @@ class Vi {
|
|
|
5247
5298
|
});
|
|
5248
5299
|
const {
|
|
5249
5300
|
fixedLeftWidth: s,
|
|
5250
|
-
fixedRightWidth:
|
|
5251
|
-
config: { SCROLLER_TRACK_SIZE:
|
|
5252
|
-
} = this.ctx, { visibleWidth: l, visibleHeight: h } = this.ctx.footer, f =
|
|
5301
|
+
fixedRightWidth: o,
|
|
5302
|
+
config: { SCROLLER_TRACK_SIZE: r, CSS_PREFIX: n }
|
|
5303
|
+
} = this.ctx, { visibleWidth: l, visibleHeight: h } = this.ctx.footer, f = o - r, d = {
|
|
5253
5304
|
key: "left",
|
|
5254
5305
|
style: {
|
|
5255
5306
|
position: "absolute",
|
|
@@ -5296,7 +5347,7 @@ class Vi {
|
|
|
5296
5347
|
};
|
|
5297
5348
|
}
|
|
5298
5349
|
}
|
|
5299
|
-
class
|
|
5350
|
+
class Ui {
|
|
5300
5351
|
constructor(t) {
|
|
5301
5352
|
c(this, "ctx");
|
|
5302
5353
|
c(this, "contextMenuEl");
|
|
@@ -5306,8 +5357,8 @@ class zi {
|
|
|
5306
5357
|
this.ctx.on("cellContextMenuClick", (t, e) => {
|
|
5307
5358
|
if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
|
|
5308
5359
|
e.preventDefault();
|
|
5309
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [
|
|
5310
|
-
h >= n && h <= l && f >=
|
|
5360
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [n, l] = s, { rowIndex: h, colIndex: f } = t;
|
|
5361
|
+
h >= n && h <= l && f >= o && f <= r || this.ctx.emit("setSelectorCell", t, e);
|
|
5311
5362
|
const x = {
|
|
5312
5363
|
getBoundingClientRect: () => ({
|
|
5313
5364
|
width: 0,
|
|
@@ -5321,9 +5372,9 @@ class zi {
|
|
|
5321
5372
|
}),
|
|
5322
5373
|
contextElement: document.body
|
|
5323
5374
|
};
|
|
5324
|
-
|
|
5375
|
+
pe(x, this.contextMenuEl, {
|
|
5325
5376
|
placement: "right-start",
|
|
5326
|
-
middleware: [
|
|
5377
|
+
middleware: [ue(), ge(), we()]
|
|
5327
5378
|
}).then(({ x: u, y }) => {
|
|
5328
5379
|
this.show(u, y);
|
|
5329
5380
|
});
|
|
@@ -5379,7 +5430,7 @@ class zi {
|
|
|
5379
5430
|
this.contextMenuEl.remove();
|
|
5380
5431
|
}
|
|
5381
5432
|
}
|
|
5382
|
-
class
|
|
5433
|
+
class Qi {
|
|
5383
5434
|
constructor(t, e) {
|
|
5384
5435
|
c(this, "targetContainer");
|
|
5385
5436
|
c(this, "target");
|
|
@@ -5396,7 +5447,7 @@ class Gi {
|
|
|
5396
5447
|
c(this, "overlayer");
|
|
5397
5448
|
c(this, "contextMenu");
|
|
5398
5449
|
c(this, "ctx");
|
|
5399
|
-
this.target = document.createElement("canvas"), this.targetContainer = t, this.targetContainer.style.position = "relative", this.targetContainer.appendChild(this.target), this.options = e, this.ctx = new
|
|
5450
|
+
this.target = document.createElement("canvas"), this.targetContainer = t, this.targetContainer.style.position = "relative", this.targetContainer.appendChild(this.target), this.options = e, this.ctx = new li(this.targetContainer, this.target, this.options), this.header = new di(this.ctx), this.body = new fi(this.ctx), this.footer = new xi(this.ctx), this.scroller = new hi(this.ctx), this.selector = new ui(this.ctx), this.autofill = new gi(this.ctx), this.tooltip = new $i(this.ctx), this.empty = new Gi(this.ctx), this.editor = new qi(this.ctx), this.overlayer = new ji(this.ctx), this.contextMenu = new Ui(this.ctx), this.ctx.on("draw", this.draw.bind(this)), this.draw();
|
|
5400
5451
|
}
|
|
5401
5452
|
draw() {
|
|
5402
5453
|
requestAnimationFrame(() => {
|
|
@@ -5430,14 +5481,14 @@ class Gi {
|
|
|
5430
5481
|
editCell(t, e) {
|
|
5431
5482
|
this.editor.editCell(t, e);
|
|
5432
5483
|
}
|
|
5433
|
-
setItemValue(t, e, i, s = !0,
|
|
5434
|
-
this.ctx.database.setItemValue(t, e, i, s,
|
|
5484
|
+
setItemValue(t, e, i, s = !0, o = !0, r = !1) {
|
|
5485
|
+
this.ctx.database.setItemValue(t, e, i, s, o, r);
|
|
5435
5486
|
}
|
|
5436
5487
|
batchSetItemValue(t, e = !0, i = !0) {
|
|
5437
5488
|
this.ctx.database.batchSetItemValue(t, e), i && this.ctx.emit("draw");
|
|
5438
5489
|
}
|
|
5439
|
-
setItemValueByEditor(t, e, i, s = !0,
|
|
5440
|
-
this.ctx.database.setItemValue(t, e, i, s,
|
|
5490
|
+
setItemValueByEditor(t, e, i, s = !0, o = !0) {
|
|
5491
|
+
this.ctx.database.setItemValue(t, e, i, s, o, !0), this.editor.doneEdit();
|
|
5441
5492
|
}
|
|
5442
5493
|
doLayout() {
|
|
5443
5494
|
this.ctx.emit("draw");
|
|
@@ -5458,9 +5509,9 @@ class Gi {
|
|
|
5458
5509
|
e(s);
|
|
5459
5510
|
} catch (s) {
|
|
5460
5511
|
if (t && Array.isArray(s) && s.length) {
|
|
5461
|
-
const [
|
|
5462
|
-
if (Array.isArray(
|
|
5463
|
-
const [
|
|
5512
|
+
const [o] = s;
|
|
5513
|
+
if (Array.isArray(o) && o.length) {
|
|
5514
|
+
const [r] = o, { rowKey: n, key: l } = r;
|
|
5464
5515
|
this.scrollToRowkey(n), this.scrollToColkey(l);
|
|
5465
5516
|
}
|
|
5466
5517
|
}
|
|
@@ -5470,8 +5521,8 @@ class Gi {
|
|
|
5470
5521
|
}
|
|
5471
5522
|
setValidations(t) {
|
|
5472
5523
|
if (t.forEach((e) => {
|
|
5473
|
-
const { rowIndex: i, key: s, message:
|
|
5474
|
-
this.ctx.database.setValidationErrorByRowIndex(i, s,
|
|
5524
|
+
const { rowIndex: i, key: s, message: o } = e;
|
|
5525
|
+
this.ctx.database.setValidationErrorByRowIndex(i, s, o);
|
|
5475
5526
|
}), t && Array.isArray(t) && t.length) {
|
|
5476
5527
|
const [e] = t;
|
|
5477
5528
|
if (e && e.rowIndex >= 0 && e.key) {
|
|
@@ -5483,13 +5534,13 @@ class Gi {
|
|
|
5483
5534
|
getValidations() {
|
|
5484
5535
|
return new Promise(async (t, e) => {
|
|
5485
5536
|
const i = this.ctx.database.getAllRowsData(), s = this.ctx.header.leafCellHeaders;
|
|
5486
|
-
let
|
|
5487
|
-
for (let
|
|
5537
|
+
let o = [];
|
|
5538
|
+
for (let r = 0; r < i.length; r++)
|
|
5488
5539
|
for (let n = 0; n < s.length; n++) {
|
|
5489
|
-
const l = this.ctx.database.getRowKeyByItem(i[
|
|
5490
|
-
Array.isArray(d) && d.length &&
|
|
5540
|
+
const l = this.ctx.database.getRowKeyByItem(i[r]), f = s[n].key, d = await this.ctx.database.getValidator(l, f);
|
|
5541
|
+
Array.isArray(d) && d.length && o.push(d);
|
|
5491
5542
|
}
|
|
5492
|
-
|
|
5543
|
+
o.length ? (e(o), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
|
|
5493
5544
|
});
|
|
5494
5545
|
}
|
|
5495
5546
|
scrollTo(t, e) {
|
|
@@ -5548,6 +5599,6 @@ class Gi {
|
|
|
5548
5599
|
}
|
|
5549
5600
|
}
|
|
5550
5601
|
export {
|
|
5551
|
-
|
|
5602
|
+
Qi as default
|
|
5552
5603
|
};
|
|
5553
5604
|
//# sourceMappingURL=index.es.js.map
|