e-virt-table 0.1.3 → 0.1.4
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 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +474 -496
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Database.js +2 -0
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/Editor.d.ts +2 -0
- package/dist/lib/Editor.js +66 -61
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/Overlayer.js +1 -16
- package/dist/lib/Overlayer.js.map +1 -1
- package/dist/lib/Selector.js +4 -0
- package/dist/lib/Selector.js.map +1 -1
- package/dist/lib/types.d.ts +0 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var 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-border-color: #e1e6eb}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;z-index:10;border-radius:8px;border:1px solid var(--e-virt-table-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;border:none;outline:none}.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);display:flex;align-items:center}.e-virt-table-overlayer{position:"absolute";left:0;top:0;overflow:hidden;z-index:10}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;outline:none;font-weight:400;padding:8px;font-size:12px;color:inherit;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;line-height:1.5;margin:0;border:none;vertical-align:middle;background:var(--e-virt-table-color-white);overflow-y:auto;resize:none}.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;color:var(--e-virt-table-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--e-virt-table-color-primary);background-color:#f5f7fa}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
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-border-color: #e1e6eb}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;z-index:10;border-radius:8px;border:1px solid var(--e-virt-table-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;border:none;outline:none;z-index:10px}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;height:auto;line-height:0;z-index:100;overflow:hidden;background-color:var(--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);display:flex;align-items:center}.e-virt-table-overlayer{position:"absolute";left:0;top:0;overflow:hidden;z-index:10}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;outline:none;font-weight:400;padding:8px;font-size:12px;color:inherit;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;line-height:1.5;margin:0;border:none;vertical-align:middle;background:var(--e-virt-table-color-white);overflow-y:auto;resize:none}.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;color:var(--e-virt-table-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--e-virt-table-color-primary);background-color:#f5f7fa}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
2
|
var me = Object.defineProperty;
|
|
3
3
|
var Ee = (n, t, e) => t in n ? me(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
4
4
|
var l = (n, t, e) => Ee(n, typeof t != "symbol" ? t + "" : t, e);
|
|
@@ -39,8 +39,8 @@ function dt(n, t, e) {
|
|
|
39
39
|
return Ce() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
|
|
40
40
|
var a = [null];
|
|
41
41
|
a.push.apply(a, r);
|
|
42
|
-
var
|
|
43
|
-
return o && st(
|
|
42
|
+
var h = Function.bind.apply(s, a), c = new h();
|
|
43
|
+
return o && st(c, o.prototype), c;
|
|
44
44
|
}, dt.apply(null, arguments);
|
|
45
45
|
}
|
|
46
46
|
function ve(n) {
|
|
@@ -69,9 +69,9 @@ function bt(n) {
|
|
|
69
69
|
}), st(s, i);
|
|
70
70
|
}, bt(n);
|
|
71
71
|
}
|
|
72
|
-
var Re = /%[sdj%]/g,
|
|
72
|
+
var Re = /%[sdj%]/g, Gt = 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" && (Gt = function(t, e) {
|
|
75
75
|
typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && e.every(function(i) {
|
|
76
76
|
return typeof i == "string";
|
|
77
77
|
}) && console.warn(t, e);
|
|
@@ -131,7 +131,7 @@ function Ie(n, t, e) {
|
|
|
131
131
|
t(a, o);
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function Xt(n, t, e) {
|
|
135
135
|
var i = 0, s = n.length;
|
|
136
136
|
function r(o) {
|
|
137
137
|
if (o && o.length) {
|
|
@@ -149,7 +149,7 @@ function Oe(n) {
|
|
|
149
149
|
t.push.apply(t, n[e] || []);
|
|
150
150
|
}), t;
|
|
151
151
|
}
|
|
152
|
-
var
|
|
152
|
+
var Ft = /* @__PURE__ */ function(n) {
|
|
153
153
|
be(t, n);
|
|
154
154
|
function t(e, i) {
|
|
155
155
|
var s;
|
|
@@ -161,22 +161,22 @@ function Te(n, t, e, i, s) {
|
|
|
161
161
|
if (t.first) {
|
|
162
162
|
var r = new Promise(function(x, u) {
|
|
163
163
|
var g = function(y) {
|
|
164
|
-
return i(y), y.length ? u(new
|
|
164
|
+
return i(y), y.length ? u(new Ft(y, Ct(y))) : x(s);
|
|
165
165
|
}, w = Oe(n);
|
|
166
|
-
|
|
166
|
+
Xt(w, e, g);
|
|
167
167
|
});
|
|
168
168
|
return r.catch(function(x) {
|
|
169
169
|
return x;
|
|
170
170
|
}), r;
|
|
171
171
|
}
|
|
172
|
-
var o = t.firstFields === !0 ? Object.keys(n) : t.firstFields || [], a = Object.keys(n),
|
|
172
|
+
var o = t.firstFields === !0 ? Object.keys(n) : t.firstFields || [], a = Object.keys(n), h = a.length, c = 0, f = [], d = new Promise(function(x, u) {
|
|
173
173
|
var g = function(p) {
|
|
174
|
-
if (f.push.apply(f, p),
|
|
175
|
-
return i(f), f.length ? u(new
|
|
174
|
+
if (f.push.apply(f, p), c++, c === h)
|
|
175
|
+
return i(f), f.length ? u(new Ft(f, Ct(f))) : x(s);
|
|
176
176
|
};
|
|
177
177
|
a.length || (i(f), x(s)), a.forEach(function(w) {
|
|
178
178
|
var p = n[w];
|
|
179
|
-
o.indexOf(w) !== -1 ?
|
|
179
|
+
o.indexOf(w) !== -1 ? Xt(p, e, g) : Ie(p, e, g);
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
182
|
return d.catch(function(x) {
|
|
@@ -194,7 +194,7 @@ function Ae(n, t) {
|
|
|
194
194
|
}
|
|
195
195
|
return e;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function kt(n, t) {
|
|
198
198
|
return function(e) {
|
|
199
199
|
var i;
|
|
200
200
|
return n.fullFields ? i = Ae(t, n.fullFields) : i = t[e.field || n.fullField], Se(e) ? (e.field = e.field || n.fullField, e.fieldValue = i, e) : {
|
|
@@ -204,7 +204,7 @@ function Bt(n, t) {
|
|
|
204
204
|
};
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Nt(n, t) {
|
|
208
208
|
if (t) {
|
|
209
209
|
for (var e in t)
|
|
210
210
|
if (t.hasOwnProperty(e)) {
|
|
@@ -214,13 +214,13 @@ function Wt(n, t) {
|
|
|
214
214
|
}
|
|
215
215
|
return n;
|
|
216
216
|
}
|
|
217
|
-
var
|
|
217
|
+
var jt = function(t, e, i, s, r, o) {
|
|
218
218
|
t.required && (!i.hasOwnProperty(t.field) || _(e, o || t.type)) && s.push(M(r.messages.required, t.fullField));
|
|
219
219
|
}, Le = function(t, e, i, s, r) {
|
|
220
220
|
(/^\s+$/.test(e) || e === "") && s.push(M(r.messages.whitespace, t.fullField));
|
|
221
|
-
},
|
|
222
|
-
if (
|
|
223
|
-
return
|
|
221
|
+
}, ct, Me = function() {
|
|
222
|
+
if (ct)
|
|
223
|
+
return ct;
|
|
224
224
|
var n = "[a-fA-F\\d:]", t = function(E) {
|
|
225
225
|
return E && E.includeBoundaries ? "(?:(?<=\\s|^)(?=" + n + ")|(?<=" + n + ")(?=\\s|$))" : "";
|
|
226
226
|
}, e = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}", i = "[a-fA-F\\d]{1,4}", s = (`
|
|
@@ -234,17 +234,17 @@ var Qt = 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(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), a = new RegExp("^" + s + "$"),
|
|
237
|
+
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), a = new RegExp("^" + s + "$"), h = function(E) {
|
|
238
238
|
return E && E.exact ? r : new RegExp("(?:" + t(E) + e + t(E) + ")|(?:" + t(E) + s + t(E) + ")", "g");
|
|
239
239
|
};
|
|
240
|
-
|
|
240
|
+
h.v4 = function(m) {
|
|
241
241
|
return m && m.exact ? o : new RegExp("" + t(m) + e + t(m), "g");
|
|
242
|
-
},
|
|
242
|
+
}, h.v6 = function(m) {
|
|
243
243
|
return m && m.exact ? a : new RegExp("" + t(m) + s + t(m), "g");
|
|
244
244
|
};
|
|
245
|
-
var
|
|
246
|
-
return
|
|
247
|
-
},
|
|
245
|
+
var c = "(?:(?:[a-z]+:)?//)", f = "(?:\\S+(?::\\S*)?@)?", d = h.v4().source, x = h.v6().source, u = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", g = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", w = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", p = "(?::\\d{2,5})?", y = '(?:[/?#][^\\s"]*)?', b = "(?:" + c + "|www\\.)" + f + "(?:localhost|" + d + "|" + x + "|" + u + g + w + ")" + p + y;
|
|
246
|
+
return ct = new RegExp("(?:^" + b + "$)", "i"), ct;
|
|
247
|
+
}, Yt = {
|
|
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,26 +284,26 @@ var Qt = 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(Yt.email);
|
|
288
288
|
},
|
|
289
289
|
url: function(t) {
|
|
290
290
|
return typeof t == "string" && t.length <= 2048 && !!t.match(Me());
|
|
291
291
|
},
|
|
292
292
|
hex: function(t) {
|
|
293
|
-
return typeof t == "string" && !!t.match(
|
|
293
|
+
return typeof t == "string" && !!t.match(Yt.hex);
|
|
294
294
|
}
|
|
295
295
|
}, He = function(t, e, i, s, r) {
|
|
296
296
|
if (t.required && e === void 0) {
|
|
297
|
-
|
|
297
|
+
jt(t, e, i, s, r);
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
300
|
var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], a = t.type;
|
|
301
301
|
o.indexOf(a) > -1 ? et[a](e) || s.push(M(r.messages.types[a], t.fullField, t.type)) : a && typeof e !== t.type && s.push(M(r.messages.types[a], t.fullField, t.type));
|
|
302
302
|
}, De = function(t, e, i, s, r) {
|
|
303
|
-
var o = typeof t.len == "number", a = typeof t.min == "number",
|
|
303
|
+
var o = typeof t.len == "number", a = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, f = e, d = null, x = typeof e == "number", u = typeof e == "string", g = Array.isArray(e);
|
|
304
304
|
if (x ? d = "number" : u ? d = "string" : g && (d = "array"), !d)
|
|
305
305
|
return !1;
|
|
306
|
-
g && (f = e.length), u && (f = e.replace(
|
|
306
|
+
g && (f = e.length), u && (f = e.replace(c, "_").length), o ? f !== t.len && s.push(M(r.messages[d].len, t.fullField, t.len)) : a && !h && f < t.min ? s.push(M(r.messages[d].min, t.fullField, t.min)) : h && !a && f > t.max ? s.push(M(r.messages[d].max, t.fullField, t.max)) : a && h && (f < t.min || f > t.max) && s.push(M(r.messages[d].range, t.fullField, t.min, t.max));
|
|
307
307
|
}, j = "enum", Xe = function(t, e, i, s, r) {
|
|
308
308
|
t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(M(r.messages[j], t.fullField, t[j].join(", ")));
|
|
309
309
|
}, Fe = function(t, e, i, s, r) {
|
|
@@ -316,7 +316,7 @@ var Qt = function(t, e, i, s, r, o) {
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}, v = {
|
|
319
|
-
required:
|
|
319
|
+
required: jt,
|
|
320
320
|
whitespace: Le,
|
|
321
321
|
type: He,
|
|
322
322
|
range: De,
|
|
@@ -416,8 +416,8 @@ var Qt = function(t, e, i, s, r, o) {
|
|
|
416
416
|
if (_(e, "date") && !t.required)
|
|
417
417
|
return i();
|
|
418
418
|
if (v.required(t, e, s, o, r), !_(e, "date")) {
|
|
419
|
-
var
|
|
420
|
-
e instanceof Date ?
|
|
419
|
+
var h;
|
|
420
|
+
e instanceof Date ? h = e : h = new Date(e), v.type(t, h, s, o, r), h && v.range(t, h.getTime(), s, o, r);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
i(o);
|
|
@@ -425,8 +425,8 @@ var Qt = function(t, e, i, s, r, o) {
|
|
|
425
425
|
var o = [], a = Array.isArray(e) ? "array" : typeof e;
|
|
426
426
|
v.required(t, e, s, o, r, a), i(o);
|
|
427
427
|
}, yt = function(t, e, i, s, r) {
|
|
428
|
-
var o = t.type, a = [],
|
|
429
|
-
if (
|
|
428
|
+
var o = t.type, a = [], h = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
429
|
+
if (h) {
|
|
430
430
|
if (_(e, o) && !t.required)
|
|
431
431
|
return i();
|
|
432
432
|
v.required(t, e, s, a, r, o), _(e, o) || v.type(t, e, s, a, r);
|
|
@@ -528,14 +528,14 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
528
528
|
s.rules[r] = Array.isArray(o) ? o : [o];
|
|
529
529
|
});
|
|
530
530
|
}, t.messages = function(i) {
|
|
531
|
-
return i && (this._messages =
|
|
531
|
+
return i && (this._messages = Nt(vt(), i)), this._messages;
|
|
532
532
|
}, t.validate = function(i, s, r) {
|
|
533
533
|
var o = this;
|
|
534
534
|
s === void 0 && (s = {}), r === void 0 && (r = function() {
|
|
535
535
|
});
|
|
536
|
-
var a = i,
|
|
537
|
-
if (typeof
|
|
538
|
-
return
|
|
536
|
+
var a = i, h = s, c = r;
|
|
537
|
+
if (typeof h == "function" && (c = h, h = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
538
|
+
return c && c(null, a), Promise.resolve(a);
|
|
539
539
|
function f(w) {
|
|
540
540
|
var p = [], y = {};
|
|
541
541
|
function b(E) {
|
|
@@ -547,14 +547,14 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
547
547
|
}
|
|
548
548
|
for (var m = 0; m < w.length; m++)
|
|
549
549
|
b(w[m]);
|
|
550
|
-
p.length ? (y = Ct(p),
|
|
550
|
+
p.length ? (y = Ct(p), c(p, y)) : c(null, a);
|
|
551
551
|
}
|
|
552
|
-
if (
|
|
552
|
+
if (h.messages) {
|
|
553
553
|
var d = this.messages();
|
|
554
|
-
d === Rt && (d = vt()),
|
|
554
|
+
d === Rt && (d = vt()), Nt(d, h.messages), h.messages = d;
|
|
555
555
|
} else
|
|
556
|
-
|
|
557
|
-
var x = {}, u =
|
|
556
|
+
h.messages = this.messages();
|
|
557
|
+
var x = {}, u = h.keys || Object.keys(this.rules);
|
|
558
558
|
u.forEach(function(w) {
|
|
559
559
|
var p = o.rules[w], y = a[w];
|
|
560
560
|
p.forEach(function(b) {
|
|
@@ -570,7 +570,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
572
|
var g = {};
|
|
573
|
-
return Te(x,
|
|
573
|
+
return Te(x, h, function(w, p) {
|
|
574
574
|
var y = w.rule, b = (y.type === "object" || y.type === "array") && (typeof y.fields == "object" || typeof y.defaultField == "object");
|
|
575
575
|
b = b && (y.required || !y.required && w.value), y.field = w.field;
|
|
576
576
|
function m(R, T) {
|
|
@@ -582,15 +582,15 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
582
582
|
function E(R) {
|
|
583
583
|
R === void 0 && (R = []);
|
|
584
584
|
var T = Array.isArray(R) ? R : [R];
|
|
585
|
-
!
|
|
586
|
-
var A = T.map(
|
|
587
|
-
if (
|
|
585
|
+
!h.suppressWarning && T.length && n.warning("async-validator:", T), T.length && y.message !== void 0 && (T = [].concat(y.message));
|
|
586
|
+
var A = T.map(kt(y, a));
|
|
587
|
+
if (h.first && A.length)
|
|
588
588
|
return g[y.field] = 1, p(A);
|
|
589
589
|
if (!b)
|
|
590
590
|
p(A);
|
|
591
591
|
else {
|
|
592
592
|
if (y.required && !w.value)
|
|
593
|
-
return y.message !== void 0 ? A = [].concat(y.message).map(
|
|
593
|
+
return y.message !== void 0 ? A = [].concat(y.message).map(kt(y, a)) : h.error && (A = [h.error(y, M(h.messages.required, y.field))]), p(A);
|
|
594
594
|
var L = {};
|
|
595
595
|
y.defaultField && Object.keys(w.value).map(function(I) {
|
|
596
596
|
L[I] = y.defaultField;
|
|
@@ -601,7 +601,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
601
601
|
D[I] = O.map(m.bind(null, I));
|
|
602
602
|
});
|
|
603
603
|
var B = new n(D);
|
|
604
|
-
B.messages(
|
|
604
|
+
B.messages(h.messages), w.rule.options && (w.rule.options.messages = h.messages, w.rule.options.error = h.error), B.validate(w.value, w.rule.options || h, function(I) {
|
|
605
605
|
var S = [];
|
|
606
606
|
A && A.length && S.push.apply(S, A), I && I.length && S.push.apply(S, I), p(S.length ? S : null);
|
|
607
607
|
});
|
|
@@ -609,12 +609,12 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
609
609
|
}
|
|
610
610
|
var C;
|
|
611
611
|
if (y.asyncValidator)
|
|
612
|
-
C = y.asyncValidator(y, w.value, E, w.source,
|
|
612
|
+
C = y.asyncValidator(y, w.value, E, w.source, h);
|
|
613
613
|
else if (y.validator) {
|
|
614
614
|
try {
|
|
615
|
-
C = y.validator(y, w.value, E, w.source,
|
|
615
|
+
C = y.validator(y, w.value, E, w.source, h);
|
|
616
616
|
} catch (R) {
|
|
617
|
-
console.error == null || console.error(R),
|
|
617
|
+
console.error == null || console.error(R), h.suppressValidatorError || setTimeout(function() {
|
|
618
618
|
throw R;
|
|
619
619
|
}, 0), E(R.message);
|
|
620
620
|
}
|
|
@@ -644,16 +644,16 @@ nt.register = function(t, e) {
|
|
|
644
644
|
throw new Error("Cannot register a validator by type, validator is not a function");
|
|
645
645
|
it[t] = e;
|
|
646
646
|
};
|
|
647
|
-
nt.warning =
|
|
647
|
+
nt.warning = Gt;
|
|
648
648
|
nt.messages = Rt;
|
|
649
649
|
nt.validators = it;
|
|
650
|
-
function
|
|
650
|
+
function Ut() {
|
|
651
651
|
return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(n) {
|
|
652
652
|
const t = Math.random() * 16 | 0;
|
|
653
653
|
return (n === "x" ? t : t & 3 | 8).toString(16);
|
|
654
654
|
});
|
|
655
655
|
}
|
|
656
|
-
function
|
|
656
|
+
function Zt(n, t) {
|
|
657
657
|
let e = 0, i;
|
|
658
658
|
return function(...s) {
|
|
659
659
|
const r = (/* @__PURE__ */ new Date()).getTime(), o = r - e;
|
|
@@ -662,8 +662,8 @@ function ee(n, t) {
|
|
|
662
662
|
}, t - o));
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
|
-
function
|
|
666
|
-
return n ? n.map((t) =>
|
|
665
|
+
function Jt(n) {
|
|
666
|
+
return n ? n.map((t) => Jt(t.children) + 1).sort((t, e) => e - t)[0] : 0;
|
|
667
667
|
}
|
|
668
668
|
function Je(n = []) {
|
|
669
669
|
let t = [], e = [], i = [];
|
|
@@ -675,14 +675,14 @@ function Je(n = []) {
|
|
|
675
675
|
...i.sort((s, r) => s.sort - r.sort)
|
|
676
676
|
];
|
|
677
677
|
}
|
|
678
|
-
function
|
|
678
|
+
function Qt(n = [], t = 1, e = 0) {
|
|
679
679
|
return n.map((i) => {
|
|
680
680
|
if (i.children) {
|
|
681
681
|
let s = 0, r = i.fixed;
|
|
682
682
|
i.children.forEach((a) => {
|
|
683
683
|
a.fixed = r;
|
|
684
684
|
});
|
|
685
|
-
const o =
|
|
685
|
+
const o = Qt(i.children, t - 1, e + 1);
|
|
686
686
|
return o && o.forEach((a) => {
|
|
687
687
|
s += a.colspan;
|
|
688
688
|
}), {
|
|
@@ -708,26 +708,26 @@ function _t(n = []) {
|
|
|
708
708
|
e.children ? t = t.concat(_t(e.children)) : t.push(e);
|
|
709
709
|
}), t;
|
|
710
710
|
}
|
|
711
|
-
const
|
|
711
|
+
const Kt = /^(\r\n|\n\r|\r|\n)/, Qe = /^[^\t\r\n]+/, Bt = /^\t/;
|
|
712
712
|
function ti(n) {
|
|
713
713
|
let t = [[""]];
|
|
714
714
|
if (n.length === 0)
|
|
715
715
|
return t;
|
|
716
716
|
let e = 0, i = 0, s;
|
|
717
717
|
for (; n.length > 0 && s !== n.length; )
|
|
718
|
-
if (s = n.length, n.match(
|
|
719
|
-
n = n.replace(
|
|
720
|
-
else if (n.match(
|
|
721
|
-
n = n.replace(
|
|
718
|
+
if (s = n.length, n.match(Bt))
|
|
719
|
+
n = n.replace(Bt, ""), e += 1, t[i][e] = "";
|
|
720
|
+
else if (n.match(Kt))
|
|
721
|
+
n = n.replace(Kt, ""), e = 0, i += 1, t[i] = [""];
|
|
722
722
|
else {
|
|
723
723
|
let r = "";
|
|
724
724
|
if (n.startsWith('"')) {
|
|
725
725
|
let o = 0, a = !0;
|
|
726
726
|
for (; a; ) {
|
|
727
|
-
const
|
|
728
|
-
|
|
727
|
+
const h = n.slice(0, 1);
|
|
728
|
+
h === '"' && (o += 1), r += h, n = n.slice(1), (n.length === 0 || n.match(/^[\t\r\n]/) && o % 2 === 0) && (a = !1);
|
|
729
729
|
}
|
|
730
|
-
r = r.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (
|
|
730
|
+
r = r.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (h) => new Array(Math.floor(h.length / 2)).fill('"').join(""));
|
|
731
731
|
} else {
|
|
732
732
|
const o = n.match(Qe);
|
|
733
733
|
r = o ? o[0] : "", n = n.slice(r.length);
|
|
@@ -790,11 +790,11 @@ class ii {
|
|
|
790
790
|
t.forEach((i, s) => {
|
|
791
791
|
let r = !1;
|
|
792
792
|
Array.isArray(i.children) && (r = !0, this.initData(i.children, e + 1));
|
|
793
|
-
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: a, CELL_HEIGHT:
|
|
793
|
+
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: a, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: f } = this.ctx.config, d = i[o], x = d ?? Ut();
|
|
794
794
|
this.itemRowKeyMap.set(i, x);
|
|
795
|
-
const u = i._height ||
|
|
795
|
+
const u = i._height || h, g = i._readonly;
|
|
796
796
|
let w = !0;
|
|
797
|
-
if (typeof
|
|
797
|
+
if (typeof c == "function" && (w = c), f) {
|
|
798
798
|
const p = i[f];
|
|
799
799
|
if (this.checkboxKeyMap.has(p)) {
|
|
800
800
|
const y = this.checkboxKeyMap.get(p);
|
|
@@ -874,12 +874,12 @@ class ii {
|
|
|
874
874
|
const i = (r) => {
|
|
875
875
|
r.forEach((o) => {
|
|
876
876
|
t.push(o);
|
|
877
|
-
const a = this.itemRowKeyMap.get(o), { expand:
|
|
877
|
+
const a = this.itemRowKeyMap.get(o), { expand: h, hasChildren: c, height: f } = this.rowKeyMap.get(a), d = this.sumHeight;
|
|
878
878
|
this.sumHeight += f, this.rowIndexRowKeyMap.set(e, a), this.positions.push({
|
|
879
879
|
top: d,
|
|
880
880
|
height: f,
|
|
881
881
|
bottom: this.sumHeight
|
|
882
|
-
}), e += 1,
|
|
882
|
+
}), e += 1, h && c && i(o.children);
|
|
883
883
|
});
|
|
884
884
|
};
|
|
885
885
|
this.rowIndexRowKeyMap.clear();
|
|
@@ -1002,9 +1002,9 @@ class ii {
|
|
|
1002
1002
|
let i = [];
|
|
1003
1003
|
const s = /* @__PURE__ */ new Set();
|
|
1004
1004
|
t.forEach((a) => {
|
|
1005
|
-
const { value:
|
|
1006
|
-
s.add(
|
|
1007
|
-
rowKey:
|
|
1005
|
+
const { value: h, rowKey: c, key: f } = a, { oldValue: d, newValue: x } = this.setItemValue(c, f, h);
|
|
1006
|
+
s.add(c), i.push({
|
|
1007
|
+
rowKey: c,
|
|
1008
1008
|
key: f,
|
|
1009
1009
|
oldValue: d,
|
|
1010
1010
|
newValue: x
|
|
@@ -1012,12 +1012,12 @@ class ii {
|
|
|
1012
1012
|
});
|
|
1013
1013
|
let r = [];
|
|
1014
1014
|
const o = i.map((a) => {
|
|
1015
|
-
const
|
|
1015
|
+
const h = this.ctx.database.getRowDataItemForRowKey(a.rowKey);
|
|
1016
1016
|
return {
|
|
1017
1017
|
rowKey: a.rowKey,
|
|
1018
1018
|
key: a.key,
|
|
1019
1019
|
value: a.newValue,
|
|
1020
|
-
row:
|
|
1020
|
+
row: h
|
|
1021
1021
|
};
|
|
1022
1022
|
});
|
|
1023
1023
|
return s.forEach((a) => {
|
|
@@ -1043,15 +1043,15 @@ class ii {
|
|
|
1043
1043
|
if (!this.rowKeyMap.has(t))
|
|
1044
1044
|
return {};
|
|
1045
1045
|
const { item: a } = this.rowKeyMap.get(t);
|
|
1046
|
-
let
|
|
1046
|
+
let h = a[e];
|
|
1047
1047
|
if (this.ctx.database.getReadonly(t, e))
|
|
1048
1048
|
return {
|
|
1049
|
-
oldValue:
|
|
1050
|
-
newValue:
|
|
1049
|
+
oldValue: h,
|
|
1050
|
+
newValue: h
|
|
1051
1051
|
};
|
|
1052
|
-
a[e] !== null && typeof a[e] == "object" && (
|
|
1053
|
-
const
|
|
1054
|
-
if (this.originalDataMap.has(
|
|
1052
|
+
a[e] !== null && typeof a[e] == "object" && (h = JSON.parse(JSON.stringify(a[e])));
|
|
1053
|
+
const c = `${t}_${e}`;
|
|
1054
|
+
if (this.originalDataMap.has(c) || this.originalDataMap.set(c, h), this.changedDataMap.set(c, i), a[e] = i, o) {
|
|
1055
1055
|
const f = this.ctx.database.getRowDataItemForRowKey(t), d = {
|
|
1056
1056
|
rowKey: t,
|
|
1057
1057
|
key: e,
|
|
@@ -1061,18 +1061,18 @@ class ii {
|
|
|
1061
1061
|
this.ctx.emit("change", [d], [f]), this.ctx.emit("editChange", {
|
|
1062
1062
|
rowKey: t,
|
|
1063
1063
|
key: e,
|
|
1064
|
-
oldValue:
|
|
1064
|
+
oldValue: h,
|
|
1065
1065
|
value: i,
|
|
1066
|
-
originalValue: this.originalDataMap.get(
|
|
1066
|
+
originalValue: this.originalDataMap.get(c),
|
|
1067
1067
|
row: f
|
|
1068
1068
|
});
|
|
1069
1069
|
}
|
|
1070
1070
|
return this.ctx.hasEvent("iterationChange") && this.ctx.emit("iterationChange", {
|
|
1071
1071
|
rowKey: t,
|
|
1072
1072
|
key: e,
|
|
1073
|
-
oldValue:
|
|
1073
|
+
oldValue: h,
|
|
1074
1074
|
value: i,
|
|
1075
|
-
originalValue: this.originalDataMap.get(
|
|
1075
|
+
originalValue: this.originalDataMap.get(c),
|
|
1076
1076
|
row: this.ctx.database.getRowDataItemForRowKey(t)
|
|
1077
1077
|
}), s && this.ctx.history.pushState({
|
|
1078
1078
|
type: "single",
|
|
@@ -1082,12 +1082,12 @@ class ii {
|
|
|
1082
1082
|
{
|
|
1083
1083
|
rowKey: t,
|
|
1084
1084
|
key: e,
|
|
1085
|
-
oldValue:
|
|
1085
|
+
oldValue: h,
|
|
1086
1086
|
newValue: i
|
|
1087
1087
|
}
|
|
1088
1088
|
]
|
|
1089
|
-
}), r && this.ctx.emit("draw"), {
|
|
1090
|
-
oldValue:
|
|
1089
|
+
}), this.getValidator(t, e), r && this.ctx.emit("draw"), {
|
|
1090
|
+
oldValue: h,
|
|
1091
1091
|
newValue: i
|
|
1092
1092
|
};
|
|
1093
1093
|
}
|
|
@@ -1114,8 +1114,8 @@ class ii {
|
|
|
1114
1114
|
return !1;
|
|
1115
1115
|
const { item: s } = this.rowKeyMap.get(t), r = s[i];
|
|
1116
1116
|
this.checkboxKeyMap.has(r) && this.checkboxKeyMap.get(r).forEach((a) => {
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1117
|
+
const h = this.rowKeyMap.get(a);
|
|
1118
|
+
h.check = e;
|
|
1119
1119
|
});
|
|
1120
1120
|
}
|
|
1121
1121
|
}
|
|
@@ -1277,15 +1277,15 @@ class ii {
|
|
|
1277
1277
|
getReadonly(t, e) {
|
|
1278
1278
|
const i = this.rowKeyMap.get(t), s = this.headerMap.get(e), r = i == null ? void 0 : i.readonly, o = s == null ? void 0 : s.readonly, { CELL_READONLY_METHOD: a } = this.ctx.config;
|
|
1279
1279
|
if (typeof a == "function") {
|
|
1280
|
-
const
|
|
1280
|
+
const c = a({
|
|
1281
1281
|
row: i.item,
|
|
1282
1282
|
rowIndex: i.rowIndex,
|
|
1283
1283
|
colIndex: s.colIndex,
|
|
1284
1284
|
column: s.column,
|
|
1285
1285
|
value: this.getItemValue(t, e)
|
|
1286
1286
|
});
|
|
1287
|
-
if (
|
|
1288
|
-
return
|
|
1287
|
+
if (c !== void 0)
|
|
1288
|
+
return c;
|
|
1289
1289
|
}
|
|
1290
1290
|
return o || r;
|
|
1291
1291
|
}
|
|
@@ -1295,7 +1295,7 @@ class ii {
|
|
|
1295
1295
|
getValidator(t, e) {
|
|
1296
1296
|
return new Promise((i) => {
|
|
1297
1297
|
const s = this.rowKeyMap.get(t), r = this.headerMap.get(e), { CELL_RULES_METHOD: o } = this.ctx.config, a = r.column;
|
|
1298
|
-
let
|
|
1298
|
+
let h = a.rules;
|
|
1299
1299
|
if (typeof o == "function") {
|
|
1300
1300
|
const f = o({
|
|
1301
1301
|
row: s.item,
|
|
@@ -1304,28 +1304,28 @@ class ii {
|
|
|
1304
1304
|
column: a,
|
|
1305
1305
|
value: this.getItemValue(t, e)
|
|
1306
1306
|
});
|
|
1307
|
-
f && (
|
|
1307
|
+
f && (h = f);
|
|
1308
1308
|
}
|
|
1309
|
-
if (
|
|
1310
|
-
let
|
|
1311
|
-
if (f[e] = this.getItemValue(t, e), Array.isArray(
|
|
1312
|
-
const x =
|
|
1309
|
+
if (h) {
|
|
1310
|
+
let c = {}, f = {};
|
|
1311
|
+
if (f[e] = this.getItemValue(t, e), Array.isArray(h) && h.length) {
|
|
1312
|
+
const x = h.map((u) => ({
|
|
1313
1313
|
...u,
|
|
1314
1314
|
row: s.item,
|
|
1315
1315
|
column: a,
|
|
1316
1316
|
rowIndex: s.rowIndex,
|
|
1317
1317
|
colIndex: r.colIndex
|
|
1318
1318
|
}));
|
|
1319
|
-
|
|
1319
|
+
c[e] = x;
|
|
1320
1320
|
} else
|
|
1321
|
-
|
|
1322
|
-
...
|
|
1321
|
+
c[e] = {
|
|
1322
|
+
...h,
|
|
1323
1323
|
row: s.item,
|
|
1324
1324
|
column: a,
|
|
1325
1325
|
rowIndex: s.rowIndex,
|
|
1326
1326
|
colIndex: r.colIndex
|
|
1327
1327
|
};
|
|
1328
|
-
new nt(
|
|
1328
|
+
new nt(c).validate(f).then(() => {
|
|
1329
1329
|
this.setValidationError(t, e, []), i([]);
|
|
1330
1330
|
}).catch(({ errors: x }) => {
|
|
1331
1331
|
const u = x.map((g) => ({
|
|
@@ -1558,21 +1558,21 @@ class ni {
|
|
|
1558
1558
|
* @param {string} color - 阴影的颜色
|
|
1559
1559
|
*/
|
|
1560
1560
|
drawShadow(t, e, i, s, r) {
|
|
1561
|
-
const { fillColor: o, side: a, shadowWidth:
|
|
1561
|
+
const { fillColor: o, side: a, shadowWidth: h, colorStart: c, colorEnd: f } = r;
|
|
1562
1562
|
this.ctx.save(), o && (this.ctx.fillStyle = o, this.ctx.fillRect(t, e, i, s));
|
|
1563
1563
|
let d;
|
|
1564
1564
|
switch (a) {
|
|
1565
1565
|
case "left":
|
|
1566
|
-
d = this.ctx.createLinearGradient(t -
|
|
1566
|
+
d = this.ctx.createLinearGradient(t - h, e, t, e), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t - h, e, h, s);
|
|
1567
1567
|
break;
|
|
1568
1568
|
case "right":
|
|
1569
|
-
d = this.ctx.createLinearGradient(t + i, e, t + i +
|
|
1569
|
+
d = this.ctx.createLinearGradient(t + i, e, t + i + h, e), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t + i, e, h, s);
|
|
1570
1570
|
break;
|
|
1571
1571
|
case "top":
|
|
1572
|
-
d = this.ctx.createLinearGradient(t, e -
|
|
1572
|
+
d = this.ctx.createLinearGradient(t, e - h, t, e), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t, e - h, i, h);
|
|
1573
1573
|
break;
|
|
1574
1574
|
case "bottom":
|
|
1575
|
-
d = this.ctx.createLinearGradient(t, e + s, t, e + s +
|
|
1575
|
+
d = this.ctx.createLinearGradient(t, e + s, t, e + s + h), d.addColorStop(0, c), d.addColorStop(1, f), this.ctx.fillStyle = d, this.ctx.fillRect(t, e + s, i, h);
|
|
1576
1576
|
break;
|
|
1577
1577
|
default:
|
|
1578
1578
|
console.error("Invalid side specified for shadow");
|
|
@@ -1593,12 +1593,12 @@ class ni {
|
|
|
1593
1593
|
drawImage(t, e, i, s, r) {
|
|
1594
1594
|
this.ctx.save(), this.ctx.drawImage(t, e, i, s, r), this.ctx.restore();
|
|
1595
1595
|
}
|
|
1596
|
-
drawRect(t, e, i, s, { borderWidth: r = 1, borderColor: o, fillColor: a, radius:
|
|
1597
|
-
if (this.ctx.save(), this.ctx.beginPath(), a !== void 0 && (this.ctx.fillStyle = a), o !== void 0 && (this.ctx.lineWidth = r, this.ctx.strokeStyle = o),
|
|
1596
|
+
drawRect(t, e, i, s, { borderWidth: r = 1, borderColor: o, fillColor: a, radius: h = 0 } = {}) {
|
|
1597
|
+
if (this.ctx.save(), this.ctx.beginPath(), a !== void 0 && (this.ctx.fillStyle = a), o !== void 0 && (this.ctx.lineWidth = r, this.ctx.strokeStyle = o), h === 0)
|
|
1598
1598
|
this.ctx.rect(t - 0.5, e - 0.5, i, s);
|
|
1599
1599
|
else {
|
|
1600
|
-
const [
|
|
1601
|
-
this.ctx.moveTo(t +
|
|
1600
|
+
const [c, f, d, x] = typeof h == "number" ? [h, h, h, h] : h;
|
|
1601
|
+
this.ctx.moveTo(t + c, 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 + c, e, c);
|
|
1602
1602
|
}
|
|
1603
1603
|
a !== void 0 && this.ctx.fill(), o !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
1604
1604
|
}
|
|
@@ -1616,16 +1616,16 @@ class ni {
|
|
|
1616
1616
|
this.ctx.save();
|
|
1617
1617
|
const {
|
|
1618
1618
|
font: a = "12px Arial",
|
|
1619
|
-
align:
|
|
1620
|
-
color:
|
|
1619
|
+
align: h = "center",
|
|
1620
|
+
color: c = "#495060",
|
|
1621
1621
|
padding: f = 0,
|
|
1622
1622
|
verticalAlign: d = "middle"
|
|
1623
1623
|
} = o;
|
|
1624
|
-
this.ctx.font = a, this.ctx.fillStyle =
|
|
1624
|
+
this.ctx.font = a, this.ctx.fillStyle = c, this.ctx.textBaseline = d, this.ctx.textAlign = h;
|
|
1625
1625
|
let x = 0;
|
|
1626
1626
|
d === "top" ? x = i + f : d === "bottom" ? x = i + r - f : x = i + (r + 1) / 2;
|
|
1627
1627
|
let u = 0;
|
|
1628
|
-
|
|
1628
|
+
h === "left" ? u = e + f : h === "right" ? u = e + s - f : u = e + s / 2;
|
|
1629
1629
|
const { _text: g, ellipsis: w } = this.handleEllipsis(t, s, f, a);
|
|
1630
1630
|
return this.ctx.fillText(g, u, x), this.ctx.restore(), w;
|
|
1631
1631
|
}
|
|
@@ -1636,12 +1636,12 @@ class ni {
|
|
|
1636
1636
|
_text: "",
|
|
1637
1637
|
ellipsis: r
|
|
1638
1638
|
};
|
|
1639
|
-
const a = this.ctx.measureText("...").width,
|
|
1640
|
-
if (
|
|
1639
|
+
const a = this.ctx.measureText("...").width, h = this.ctx.measureText(t).width;
|
|
1640
|
+
if (h && h + a >= e - i * 2) {
|
|
1641
1641
|
r = !0;
|
|
1642
|
-
let
|
|
1642
|
+
let c = 0;
|
|
1643
1643
|
for (let f = 0; f < t.length; f++)
|
|
1644
|
-
if (
|
|
1644
|
+
if (c += this.ctx.measureText(t[f]).width, c >= e - i * 2 - a) {
|
|
1645
1645
|
o = t.slice(0, f) + "...";
|
|
1646
1646
|
break;
|
|
1647
1647
|
}
|
|
@@ -1652,7 +1652,7 @@ class ni {
|
|
|
1652
1652
|
};
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
|
-
class
|
|
1655
|
+
class Wt {
|
|
1656
1656
|
constructor(t) {
|
|
1657
1657
|
l(this, "PROCESSOR_NUM", 50);
|
|
1658
1658
|
l(this, "CSS_PREFIX", "e-virt-table");
|
|
@@ -1877,15 +1877,15 @@ class ai {
|
|
|
1877
1877
|
}
|
|
1878
1878
|
async createImageFromSVG(t, e) {
|
|
1879
1879
|
const r = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
|
|
1880
|
-
e && r.querySelectorAll("*").forEach((
|
|
1881
|
-
|
|
1880
|
+
e && r.querySelectorAll("*").forEach((c) => {
|
|
1881
|
+
c.setAttribute("fill", e);
|
|
1882
1882
|
});
|
|
1883
1883
|
const o = new Image(), a = new Blob([new XMLSerializer().serializeToString(r)], {
|
|
1884
1884
|
type: "image/svg+xml"
|
|
1885
|
-
}),
|
|
1886
|
-
return o.src =
|
|
1885
|
+
}), h = URL.createObjectURL(a);
|
|
1886
|
+
return o.src = h, new Promise((c, f) => {
|
|
1887
1887
|
o.onerror = () => f(new Error("Failed to load image")), o.onload = () => {
|
|
1888
|
-
|
|
1888
|
+
c(o);
|
|
1889
1889
|
};
|
|
1890
1890
|
});
|
|
1891
1891
|
}
|
|
@@ -1893,7 +1893,7 @@ class ai {
|
|
|
1893
1893
|
return this.icons.get(t);
|
|
1894
1894
|
}
|
|
1895
1895
|
}
|
|
1896
|
-
class
|
|
1896
|
+
class te {
|
|
1897
1897
|
constructor(t, e, i, s, r, o, a) {
|
|
1898
1898
|
l(this, "ctx");
|
|
1899
1899
|
l(this, "x", 0);
|
|
@@ -1939,9 +1939,9 @@ class re {
|
|
|
1939
1939
|
getRightFixedX() {
|
|
1940
1940
|
}
|
|
1941
1941
|
}
|
|
1942
|
-
class
|
|
1943
|
-
constructor(e, i, s, r, o, a,
|
|
1944
|
-
super(e, r, o, a,
|
|
1942
|
+
class ee extends te {
|
|
1943
|
+
constructor(e, i, s, r, o, a, h, c, f, d = "body") {
|
|
1944
|
+
super(e, r, o, a, h, c.fixed, d);
|
|
1945
1945
|
l(this, "formatter");
|
|
1946
1946
|
l(this, "hoverIconName", "");
|
|
1947
1947
|
l(this, "operation", !1);
|
|
@@ -1989,7 +1989,7 @@ class oe extends re {
|
|
|
1989
1989
|
l(this, "overflowTooltipShow", !0);
|
|
1990
1990
|
l(this, "overflowTooltipMaxWidth", 500);
|
|
1991
1991
|
l(this, "overflowTooltipPlacement", "top");
|
|
1992
|
-
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key =
|
|
1992
|
+
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = c.key, this.type = c.type || "text", this.editorType = c.editorType || "text", this.cellType = d, this.align = c.align || "center", this.verticalAlign = c.verticalAlign || "middle", this.fixed = c.fixed, this.level = c.level, this.operation = c.operation || !1, this.column = c, this.rules = c.rules, this.row = f, this.rowKey = this.cellType === "body" ? this.ctx.database.getRowKeyForRowIndex(i) : `${this.cellType}_${this.rowIndex}`, this.value = this.getValue(), this.render = c.render, this.overflowTooltipShow = c.overflowTooltipShow !== !1, this.overflowTooltipMaxWidth = c.overflowTooltipMaxWidth || 500, this.overflowTooltipPlacement = c.overflowTooltipPlacement || "top", this.renderFooter = c.renderFooter, this.hoverIconName = c.hoverIconName, this.formatter = c.formatter, this.update();
|
|
1993
1993
|
}
|
|
1994
1994
|
getValidationMessage() {
|
|
1995
1995
|
const e = this.ctx.database.getValidationError(this.rowKey, this.key);
|
|
@@ -2083,13 +2083,13 @@ class oe extends re {
|
|
|
2083
2083
|
const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
|
|
2084
2084
|
let r, o = 0, a = "";
|
|
2085
2085
|
if (this.type === "tree" && s === "body") {
|
|
2086
|
-
const
|
|
2087
|
-
if (this.rowExpand =
|
|
2086
|
+
const h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: f = !1, expandLoading: d = !1, level: x = 0 } = h || {};
|
|
2087
|
+
if (this.rowExpand = c, this.rowHasChildren = f, d) {
|
|
2088
2088
|
const u = this.ctx.icons.get("loading");
|
|
2089
2089
|
a = "loading", r = u, o = x * 8;
|
|
2090
2090
|
} else if (f) {
|
|
2091
2091
|
const u = this.ctx.icons.get("expand"), g = this.ctx.icons.get("shrink");
|
|
2092
|
-
r =
|
|
2092
|
+
r = c ? g : u, a = c ? "shrink" : "expand", o = x * 8;
|
|
2093
2093
|
} else
|
|
2094
2094
|
o = x * 8;
|
|
2095
2095
|
if (r) {
|
|
@@ -2106,8 +2106,8 @@ class oe extends re {
|
|
|
2106
2106
|
FOOTER_CELL_STYLE_METHOD: r,
|
|
2107
2107
|
READONLY_TEXT_COLOR: o,
|
|
2108
2108
|
FOOTER_BG_COLOR: a,
|
|
2109
|
-
HIGHLIGHT_SELECTED_ROW:
|
|
2110
|
-
HIGHLIGHT_SELECTED_ROW_COLOR:
|
|
2109
|
+
HIGHLIGHT_SELECTED_ROW: h,
|
|
2110
|
+
HIGHLIGHT_SELECTED_ROW_COLOR: c,
|
|
2111
2111
|
HIGHLIGHT_HOVER_ROW: f,
|
|
2112
2112
|
HIGHLIGHT_HOVER_ROW_COLOR: d
|
|
2113
2113
|
} = this.ctx.config;
|
|
@@ -2128,7 +2128,7 @@ class oe extends re {
|
|
|
2128
2128
|
}
|
|
2129
2129
|
let x = "transparent";
|
|
2130
2130
|
const u = this.ctx.focusCell, g = this.ctx.hoverCell;
|
|
2131
|
-
f && (g == null ? void 0 : g.rowKey) === this.rowKey && (x = d),
|
|
2131
|
+
f && (g == null ? void 0 : g.rowKey) === this.rowKey && (x = d), h && (u == null ? void 0 : u.rowKey) === this.rowKey && (x = c), this.drawCellSkyBgColor = x;
|
|
2132
2132
|
let w = e, p = o;
|
|
2133
2133
|
if (["index", "index-selection", "selection"].includes(this.type)) {
|
|
2134
2134
|
this.drawCellBgColor = e, this.drawTextColor = o;
|
|
@@ -2147,24 +2147,24 @@ class oe extends re {
|
|
|
2147
2147
|
this.drawCellBgColor = w, this.drawTextColor = p;
|
|
2148
2148
|
}
|
|
2149
2149
|
updateSelection() {
|
|
2150
|
-
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: a, rowIndex:
|
|
2150
|
+
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: a, rowIndex: h, rowKey: c } = this;
|
|
2151
2151
|
if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(a)) {
|
|
2152
|
-
const f = this.ctx.database.getRowSelection(
|
|
2152
|
+
const f = this.ctx.database.getRowSelection(c), d = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: x = 0 } = this.ctx.config, u = this.drawX + (e - x) / 2, g = this.drawY + (i - x) / 2;
|
|
2153
2153
|
let w = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck";
|
|
2154
|
-
f && d ? (w = this.ctx.icons.get("checkbox-check"), p = "checkbox-check") : f && d ? (w = this.ctx.icons.get("checkbox-check-disabled"), p = "checkbox-check-disabled") : !f && d ? (w = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), p = "checkbox-disabled"), w && a == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex ===
|
|
2154
|
+
f && d ? (w = this.ctx.icons.get("checkbox-check"), p = "checkbox-check") : f && d ? (w = this.ctx.icons.get("checkbox-check-disabled"), p = "checkbox-check-disabled") : !f && d ? (w = this.ctx.icons.get("checkbox-uncheck"), p = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), p = "checkbox-disabled"), w && a == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === h || ["checkbox-disabled", "checkbox-check"].includes(p)) && (this.drawImageX = u, this.drawImageY = g, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = p, this.drawImageSource = w) : w && a === "selection" && (this.drawImageX = u, this.drawImageY = g, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = p, this.drawImageSource = w);
|
|
2155
2155
|
}
|
|
2156
2156
|
}
|
|
2157
2157
|
updateHoverIcon() {
|
|
2158
2158
|
const { CELL_HOVER_ICON_METHOD: e, CELL_HOVER_ICON_SIZE: i, CELL_PADDING: s } = this.ctx.config;
|
|
2159
2159
|
if (typeof e == "function") {
|
|
2160
|
-
const
|
|
2160
|
+
const h = e({
|
|
2161
2161
|
row: this.row,
|
|
2162
2162
|
rowIndex: this.rowIndex,
|
|
2163
2163
|
colIndex: this.colIndex,
|
|
2164
2164
|
column: this.column,
|
|
2165
2165
|
value: this.getValue()
|
|
2166
2166
|
});
|
|
2167
|
-
|
|
2167
|
+
h !== void 0 && (this.hoverIconName = h);
|
|
2168
2168
|
}
|
|
2169
2169
|
const r = this.drawX + this.width - i - s, o = this.drawY + (this.height - i) / 2;
|
|
2170
2170
|
if (this.hoverIconName && this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === this.rowIndex) {
|
|
@@ -2280,8 +2280,8 @@ class oe extends re {
|
|
|
2280
2280
|
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s } = this.ctx.config;
|
|
2281
2281
|
if (!s || !i)
|
|
2282
2282
|
return;
|
|
2283
|
-
const { xArr: r, yArr: o } = this.ctx.selector, a = r[1],
|
|
2284
|
-
|
|
2283
|
+
const { xArr: r, yArr: o } = this.ctx.selector, a = r[1], h = o[1], { colIndex: c, rowIndex: f, drawX: d, drawY: x } = this;
|
|
2284
|
+
c === a && f === h && this.ctx.paint.drawRect(d + this.width - 6, x + this.height - 6, 6, 6, {
|
|
2285
2285
|
borderColor: "#fff",
|
|
2286
2286
|
fillColor: e
|
|
2287
2287
|
});
|
|
@@ -2336,31 +2336,31 @@ class oe extends re {
|
|
|
2336
2336
|
}
|
|
2337
2337
|
drawBorder(e) {
|
|
2338
2338
|
const { drawX: i, drawY: s, width: r, rowIndex: o, colIndex: a } = this;
|
|
2339
|
-
let
|
|
2340
|
-
o === 0 && (
|
|
2339
|
+
let h = i + 0.5, c = s + 0.5, f = this.height;
|
|
2340
|
+
o === 0 && (c = this.y + 1, f = f - 1), a === this.ctx.maxColIndex && (h = h - 1);
|
|
2341
2341
|
const { xArr: d, yArr: x, lineDash: u = [], borderWidth: g = 1, borderColor: w, fillColor: p } = e, y = d[0], b = d[1], m = x[0], E = x[1];
|
|
2342
|
-
a >= y && a <= b && o === m && this.ctx.paint.drawLine([c, h
|
|
2342
|
+
a >= y && a <= b && o === m && this.ctx.paint.drawLine([h, c, h + r - 2, c], {
|
|
2343
2343
|
borderColor: w,
|
|
2344
2344
|
fillColor: p,
|
|
2345
2345
|
borderWidth: g,
|
|
2346
2346
|
lineCap: "round",
|
|
2347
2347
|
lineJoin: "round",
|
|
2348
2348
|
lineDash: u
|
|
2349
|
-
}), a >= y && a <= b && o === E && this.ctx.paint.drawLine([
|
|
2349
|
+
}), a >= y && a <= b && o === E && this.ctx.paint.drawLine([h, c + f - 1.5, h + r, c + f - 1.5], {
|
|
2350
2350
|
borderColor: w,
|
|
2351
2351
|
fillColor: p,
|
|
2352
2352
|
borderWidth: g,
|
|
2353
2353
|
lineCap: "round",
|
|
2354
2354
|
lineJoin: "round",
|
|
2355
2355
|
lineDash: u
|
|
2356
|
-
}), a === y && o >= m && o <= E && this.ctx.paint.drawLine([c, h, c
|
|
2356
|
+
}), a === y && o >= m && o <= E && this.ctx.paint.drawLine([h, c, h, c + f - 1], {
|
|
2357
2357
|
borderColor: w,
|
|
2358
2358
|
fillColor: p,
|
|
2359
2359
|
borderWidth: g,
|
|
2360
2360
|
lineCap: "round",
|
|
2361
2361
|
lineJoin: "round",
|
|
2362
2362
|
lineDash: u
|
|
2363
|
-
}), a === b && o >= m && o <= E && this.ctx.paint.drawLine([
|
|
2363
|
+
}), a === b && o >= m && o <= E && this.ctx.paint.drawLine([h + r - 1.5, c, h + r - 1.5, c + f - 1.5], {
|
|
2364
2364
|
borderColor: w,
|
|
2365
2365
|
fillColor: p,
|
|
2366
2366
|
borderWidth: g,
|
|
@@ -2370,9 +2370,9 @@ class oe extends re {
|
|
|
2370
2370
|
});
|
|
2371
2371
|
}
|
|
2372
2372
|
}
|
|
2373
|
-
class
|
|
2374
|
-
constructor(e, i, s, r, o, a,
|
|
2375
|
-
super(e, s, r, o, a,
|
|
2373
|
+
class ie extends te {
|
|
2374
|
+
constructor(e, i, s, r, o, a, h) {
|
|
2375
|
+
super(e, s, r, o, a, h.fixed, "header");
|
|
2376
2376
|
l(this, "align");
|
|
2377
2377
|
l(this, "verticalAlign", "middle");
|
|
2378
2378
|
l(this, "fixed");
|
|
@@ -2406,7 +2406,7 @@ class ne extends re {
|
|
|
2406
2406
|
l(this, "drawImageHeight", 0);
|
|
2407
2407
|
l(this, "drawImageName", "");
|
|
2408
2408
|
l(this, "drawImageSource");
|
|
2409
|
-
this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = a, this.colIndex = i, this.key =
|
|
2409
|
+
this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = a, this.colIndex = i, this.key = h.key, this.type = h.type, this.editorType = h.editorType || "text", this.align = h.align || "center", this.verticalAlign = h.verticalAlign || "middle", this.fixed = h.fixed, this.level = h.level, this.operation = h.operation || !1, this.text = h.title, this.column = h, this.colspan = h.colspan, this.widthFillDisable = h.widthFillDisable, this.rowspan = h.rowspan, this.rules = h.rules, this.readonly = h.readonly, this.required = h.required, this.rowKey = Ut(), this.hasChildren = h.children && h.children.length > 0 || !1, this.render = h.renderHeader;
|
|
2410
2410
|
}
|
|
2411
2411
|
/**
|
|
2412
2412
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -2426,11 +2426,11 @@ class ne extends re {
|
|
|
2426
2426
|
const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
|
|
2427
2427
|
let r = i, o = s;
|
|
2428
2428
|
if (typeof e == "function") {
|
|
2429
|
-
const a = e, { backgroundColor:
|
|
2429
|
+
const a = e, { backgroundColor: h, color: c } = a({
|
|
2430
2430
|
colIndex: this.colIndex,
|
|
2431
2431
|
column: this.column
|
|
2432
2432
|
}) || {};
|
|
2433
|
-
|
|
2433
|
+
h && (r = h), c && (o = c);
|
|
2434
2434
|
}
|
|
2435
2435
|
this.drawCellBgColor = r, this.drawTextColor = o;
|
|
2436
2436
|
}
|
|
@@ -2441,11 +2441,11 @@ class ne extends re {
|
|
|
2441
2441
|
const {
|
|
2442
2442
|
paint: e,
|
|
2443
2443
|
config: { BORDER_COLOR: i, CELL_PADDING: s, HEADER_FONT: r }
|
|
2444
|
-
} = this.ctx, { drawX: o, drawY: a, displayText:
|
|
2444
|
+
} = this.ctx, { drawX: o, drawY: a, displayText: h } = this;
|
|
2445
2445
|
e.drawRect(o, a, this.width, this.height, {
|
|
2446
2446
|
borderColor: i,
|
|
2447
2447
|
fillColor: this.drawCellBgColor
|
|
2448
|
-
}), e.drawText(
|
|
2448
|
+
}), e.drawText(h, o, a, this.width, this.height, {
|
|
2449
2449
|
font: r,
|
|
2450
2450
|
padding: s,
|
|
2451
2451
|
color: this.drawTextColor,
|
|
@@ -2456,9 +2456,9 @@ class ne extends re {
|
|
|
2456
2456
|
drawSelection() {
|
|
2457
2457
|
const { width: e, height: i, type: s } = this;
|
|
2458
2458
|
if (["index-selection", "selection"].includes(s)) {
|
|
2459
|
-
const { indeterminate: r, check: o, selectable: a } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE:
|
|
2459
|
+
const { indeterminate: r, check: o, selectable: a } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: h = 0 } = this.ctx.config, c = this.drawX + (e - h) / 2, f = this.drawY + (i - h) / 2;
|
|
2460
2460
|
let d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck";
|
|
2461
|
-
r ? (d = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : o && a ? (d = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : o && a ? (d = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !o && a ? (d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (d = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), d && (this.drawImageX =
|
|
2461
|
+
r ? (d = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : o && a ? (d = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : o && a ? (d = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !o && a ? (d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (d = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), d && (this.drawImageX = c, this.drawImageY = f, this.drawImageWidth = h, this.drawImageHeight = h, this.drawImageName = x, this.drawImageSource = d, this.ctx.paint.drawImage(
|
|
2462
2462
|
this.drawImageSource,
|
|
2463
2463
|
this.drawImageX,
|
|
2464
2464
|
this.drawImageY,
|
|
@@ -2557,7 +2557,7 @@ class li {
|
|
|
2557
2557
|
*/
|
|
2558
2558
|
selectionClick(t) {
|
|
2559
2559
|
if (["selection", "index-selection"].includes(t.type) && this.ctx.isPointer)
|
|
2560
|
-
if (t instanceof
|
|
2560
|
+
if (t instanceof ie)
|
|
2561
2561
|
t.drawImageName === "checkbox-uncheck" || t.drawImageName === "checkbox-indeterminate" ? this.ctx.database.toggleAllSelection() : t.drawImageName === "checkbox-check" && this.ctx.database.clearSelection();
|
|
2562
2562
|
else {
|
|
2563
2563
|
if (!this.ctx.database.getRowSelectable(t.rowKey))
|
|
@@ -2579,10 +2579,10 @@ class li {
|
|
|
2579
2579
|
colIndex: t.colIndex,
|
|
2580
2580
|
column: t.column,
|
|
2581
2581
|
value: t.getValue()
|
|
2582
|
-
}).then((
|
|
2583
|
-
this.ctx.database.setExpandChildren(t.rowKey,
|
|
2584
|
-
}).catch((
|
|
2585
|
-
this.ctx.database.expandLoading(t.rowKey, !1), console.error(
|
|
2582
|
+
}).then((h) => {
|
|
2583
|
+
this.ctx.database.setExpandChildren(t.rowKey, h), this.ctx.database.expandLoading(t.rowKey, !1);
|
|
2584
|
+
}).catch((h) => {
|
|
2585
|
+
this.ctx.database.expandLoading(t.rowKey, !1), console.error(h);
|
|
2586
2586
|
}));
|
|
2587
2587
|
else {
|
|
2588
2588
|
const a = this.ctx.database.getIsExpand(t.rowKey);
|
|
@@ -2597,7 +2597,7 @@ class li {
|
|
|
2597
2597
|
*/
|
|
2598
2598
|
imageEnterAndLeave(t, e) {
|
|
2599
2599
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s;
|
|
2600
|
-
o > t.drawImageX && o < t.drawImageX + t.drawImageWidth && r > t.drawImageY && r < t.drawImageY + t.drawImageHeight ? (this.ctx.stageElement.style.cursor = "pointer", this.ctx.isPointer = !0, t instanceof
|
|
2600
|
+
o > t.drawImageX && o < t.drawImageX + t.drawImageWidth && r > t.drawImageY && r < t.drawImageY + t.drawImageHeight ? (this.ctx.stageElement.style.cursor = "pointer", this.ctx.isPointer = !0, t instanceof ee && ["selection", "index-selection"].includes(t.type) && (this.ctx.database.getRowSelectable(t.rowKey) || (this.ctx.stageElement.style.cursor = "not-allowed"))) : (this.ctx.isPointer = !1, this.ctx.stageElement.style.cursor === "pointer" && (this.ctx.stageElement.style.cursor = "default"));
|
|
2601
2601
|
}
|
|
2602
2602
|
isBusy(t) {
|
|
2603
2603
|
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, r = i;
|
|
@@ -2609,15 +2609,15 @@ class li {
|
|
|
2609
2609
|
handleBodyEvent(t, e, i, s, r = !1) {
|
|
2610
2610
|
for (const o of i) {
|
|
2611
2611
|
const a = o.fixedCells.concat(o.noFixedCells);
|
|
2612
|
-
for (const
|
|
2613
|
-
const
|
|
2612
|
+
for (const h of a) {
|
|
2613
|
+
const c = h.getDrawX(), f = h.getDrawY();
|
|
2614
2614
|
if (r) {
|
|
2615
|
-
if (t >
|
|
2616
|
-
s(
|
|
2615
|
+
if (t > c && t < c + h.visibleWidth && e > f && e < f + h.visibleHeight) {
|
|
2616
|
+
s(h);
|
|
2617
2617
|
return;
|
|
2618
2618
|
}
|
|
2619
|
-
} else if (t >
|
|
2620
|
-
s(
|
|
2619
|
+
} else if (t > c && t < c + h.width && e > f && e < f + h.height) {
|
|
2620
|
+
s(h);
|
|
2621
2621
|
return;
|
|
2622
2622
|
}
|
|
2623
2623
|
}
|
|
@@ -2636,7 +2636,7 @@ class li {
|
|
|
2636
2636
|
this.resizeObserver.unobserve(this.ctx.stageElement);
|
|
2637
2637
|
}
|
|
2638
2638
|
}
|
|
2639
|
-
class
|
|
2639
|
+
class hi {
|
|
2640
2640
|
constructor(t, e) {
|
|
2641
2641
|
l(this, "eventBus");
|
|
2642
2642
|
l(this, "eventBrowser");
|
|
@@ -2733,10 +2733,10 @@ class ci {
|
|
|
2733
2733
|
l(this, "history");
|
|
2734
2734
|
l(this, "config");
|
|
2735
2735
|
const { containerElement: i, stageElement: s, canvasElement: r, overlayerElement: o, editorElement: a } = t;
|
|
2736
|
-
this.containerElement = i, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = a, this.config = new
|
|
2736
|
+
this.containerElement = i, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = a, this.config = new Wt(e.config || {}), this.eventBus = new oi(), this.eventBrowser = new ri(this), this.eventTable = new li(this), this.paint = new ni(this.canvasElement), this.database = new ii(this, e), this.history = new si(this), this.icons = new ai(this);
|
|
2737
2737
|
}
|
|
2738
2738
|
setConfig(t) {
|
|
2739
|
-
this.config = new
|
|
2739
|
+
this.config = new Wt(t);
|
|
2740
2740
|
}
|
|
2741
2741
|
setFocusCell(t) {
|
|
2742
2742
|
var e;
|
|
@@ -2768,7 +2768,7 @@ class ci {
|
|
|
2768
2768
|
for (let r = 0; r <= e[1] - e[0]; r++) {
|
|
2769
2769
|
const o = [];
|
|
2770
2770
|
for (let a = 0; a <= i[1] - i[0]; a++) {
|
|
2771
|
-
const
|
|
2771
|
+
const h = r + e[0], c = a + i[0], f = this.database.getItemValueForRowIndexAndColIndex(h, c);
|
|
2772
2772
|
f && o.push(f.value);
|
|
2773
2773
|
}
|
|
2774
2774
|
s += `${o.join(" ")}\r`, t.push(o);
|
|
@@ -2827,7 +2827,7 @@ class ci {
|
|
|
2827
2827
|
this.eventTable.destroy(), this.eventBrowser.destroy(), this.eventBus.destroy();
|
|
2828
2828
|
}
|
|
2829
2829
|
}
|
|
2830
|
-
class
|
|
2830
|
+
class Pt {
|
|
2831
2831
|
constructor(t, e) {
|
|
2832
2832
|
l(this, "ctx");
|
|
2833
2833
|
l(this, "type");
|
|
@@ -2904,19 +2904,19 @@ class qt {
|
|
|
2904
2904
|
stageHeight: i,
|
|
2905
2905
|
stageWidth: s,
|
|
2906
2906
|
config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0 }
|
|
2907
|
-
} = this.ctx, a = s,
|
|
2907
|
+
} = this.ctx, a = s, h = i, c = e.height, f = e.width, d = t.height, x = this.ctx.footer.height;
|
|
2908
2908
|
if (this.type === "vertical") {
|
|
2909
|
-
this.visibleDistance =
|
|
2909
|
+
this.visibleDistance = h - r - c, this.distance = d - this.visibleDistance + x, this.trackX = a - r, this.trackY = 0, this.splitPoints = [this.trackX, c, this.trackX + r, c], this.trackWidth = r, this.trackHeight = h, this.barX = this.trackX - 0.5 + (r - o) / 2, this.barWidth = o;
|
|
2910
2910
|
const u = this.distance ? this.visibleDistance / d : 0;
|
|
2911
2911
|
let g = Math.floor(u * this.visibleDistance);
|
|
2912
|
-
g < 30 ? g = 30 : g > this.visibleDistance && (g = 0), this.barHeight = g, this.barY =
|
|
2912
|
+
g < 30 ? g = 30 : g > this.visibleDistance && (g = 0), this.barHeight = g, this.barY = c + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
2913
2913
|
} else {
|
|
2914
2914
|
this.visibleDistance = a - r, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
2915
2915
|
a - r,
|
|
2916
|
-
|
|
2916
|
+
h - r,
|
|
2917
2917
|
a - r,
|
|
2918
|
-
|
|
2919
|
-
], this.trackX = 0, this.trackY =
|
|
2918
|
+
h
|
|
2919
|
+
], this.trackX = 0, this.trackY = h - r, this.trackWidth = a, this.trackHeight = r;
|
|
2920
2920
|
const u = this.distance ? this.visibleDistance / f : 0;
|
|
2921
2921
|
let g = Math.floor(u * this.visibleDistance);
|
|
2922
2922
|
this.barY = this.trackY - 0.5 + (r - o) / 2, g < 30 ? g = 30 : g >= this.visibleDistance && (g = 0), this.barWidth = g, this.barHeight = o, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
@@ -2938,12 +2938,12 @@ class qt {
|
|
|
2938
2938
|
}), this.ctx.scrollerFocus = this.isFocus;
|
|
2939
2939
|
}
|
|
2940
2940
|
}
|
|
2941
|
-
class
|
|
2941
|
+
class ci {
|
|
2942
2942
|
constructor(t) {
|
|
2943
2943
|
l(this, "ctx");
|
|
2944
2944
|
l(this, "verticalScrollbar");
|
|
2945
2945
|
l(this, "horizontalScrollbar");
|
|
2946
|
-
this.ctx = t, this.verticalScrollbar = new
|
|
2946
|
+
this.ctx = t, this.verticalScrollbar = new Pt(t, "vertical"), this.horizontalScrollbar = new Pt(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) => {
|
|
2947
2947
|
this.setScroll(e, i);
|
|
2948
2948
|
}), this.ctx.on("setScrollX", (e) => {
|
|
2949
2949
|
this.setScrollX(e);
|
|
@@ -3033,7 +3033,7 @@ class di {
|
|
|
3033
3033
|
l(this, "renderFixedCellHeaders", []);
|
|
3034
3034
|
this.ctx = t, this.ctx.on(
|
|
3035
3035
|
"resetHeader",
|
|
3036
|
-
|
|
3036
|
+
Zt(() => {
|
|
3037
3037
|
this.init(), this.ctx.emit("draw");
|
|
3038
3038
|
}, 100)
|
|
3039
3039
|
), this.init(), this.initResizeColumn();
|
|
@@ -3043,19 +3043,19 @@ class di {
|
|
|
3043
3043
|
config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
|
|
3044
3044
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3045
3045
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3046
|
-
const s =
|
|
3046
|
+
const s = Jt(i), r = _t(i);
|
|
3047
3047
|
this.height = t * s, this.width = r.reduce((d, x) => d + ((x == null ? void 0 : x.width) || 100), 0), this.visibleHeight = this.height;
|
|
3048
|
-
const o = Je(
|
|
3048
|
+
const o = Je(Qt(i, s));
|
|
3049
3049
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3050
3050
|
const a = this.ctx.containerElement.getBoundingClientRect();
|
|
3051
3051
|
this.resizeNum > 0 ? this.ctx.stageWidth = Math.floor(a.width) : this.ctx.stageWidth = Math.floor(this.width + e), this.ctx.stageElement.style.width = this.ctx.stageWidth - 0.5 + "px", this.visibleWidth = this.ctx.stageWidth - e;
|
|
3052
|
-
const
|
|
3053
|
-
if (this.resizeNum &&
|
|
3054
|
-
const d = Math.floor(
|
|
3052
|
+
const h = this.visibleWidth - this.width;
|
|
3053
|
+
if (this.resizeNum && h > 0) {
|
|
3054
|
+
const d = Math.floor(h / this.resizeNum * 100) / 100;
|
|
3055
3055
|
this.resizeAllColumn(d);
|
|
3056
3056
|
}
|
|
3057
|
-
const
|
|
3058
|
-
this.ctx.fixedLeftWidth =
|
|
3057
|
+
const c = this.fixedLeftCellHeaders.filter((d) => !d.hasChildren);
|
|
3058
|
+
this.ctx.fixedLeftWidth = c.reduce((d, x) => d + x.width, 0);
|
|
3059
3059
|
const f = this.fixedRightCellHeaders.filter((d) => !d.hasChildren);
|
|
3060
3060
|
this.ctx.fixedRightWidth = f.reduce((d, x) => d + x.width, e), this.ctx.maxColIndex = this.leafCellHeaders.length - 1, this.ctx.header.x = this.x, this.ctx.header.y = this.y, this.ctx.header.width = this.width, this.ctx.header.height = this.height, this.ctx.header.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
|
|
3061
3061
|
}
|
|
@@ -3084,9 +3084,9 @@ class di {
|
|
|
3084
3084
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3085
3085
|
const r = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
3086
3086
|
for (const o of r) {
|
|
3087
|
-
const { offsetX: a, offsetY:
|
|
3088
|
-
|
|
3089
|
-
o.colspan <= 1 && this.ctx.isTarget() &&
|
|
3087
|
+
const { offsetX: a, offsetY: h } = this.ctx.getOffset(e), c = a, f = o.getDrawX();
|
|
3088
|
+
c > f + o.width - 5 && c < f + o.width + 4 && c < i - 4 && // 视窗中最后一列不允许调整宽
|
|
3089
|
+
o.colspan <= 1 && this.ctx.isTarget() && h <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = o);
|
|
3090
3090
|
}
|
|
3091
3091
|
}
|
|
3092
3092
|
}));
|
|
@@ -3140,10 +3140,10 @@ class di {
|
|
|
3140
3140
|
let s = e;
|
|
3141
3141
|
const { HEADER_HEIGHT: r = 0 } = this.ctx.config;
|
|
3142
3142
|
for (let o = 0; o < i; o++) {
|
|
3143
|
-
const a = t[o],
|
|
3143
|
+
const a = t[o], h = r * (a.rowspan || 1), c = r * a.level;
|
|
3144
3144
|
let f = a.width || 100;
|
|
3145
3145
|
a.children && (f = _t(a.children).reduce((u, g) => u + ((g == null ? void 0 : g.width) || 100), 0));
|
|
3146
|
-
const d = new
|
|
3146
|
+
const d = new ie(this.ctx, this.columnIndex, s, c, f, h, a);
|
|
3147
3147
|
this.ctx.database.setHeader(a.key, d), this.allCellHeaders.push(d), a.children || (this.leafCellHeaders.push(d), d.column.widthFillDisable || this.resizeNum++), a.fixed === "left" ? this.fixedLeftCellHeaders.push(d) : a.fixed === "right" ? this.fixedRightCellHeaders.push(d) : this.centerCellHeaders.push(d), !a.children && this.columnIndex++, a.children && this.render(a.children, s), s += f;
|
|
3148
3148
|
}
|
|
3149
3149
|
}
|
|
@@ -3175,8 +3175,8 @@ class di {
|
|
|
3175
3175
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3176
3176
|
colorEnd: "rgba(0,0,0,0)"
|
|
3177
3177
|
}), i < Math.floor(s.width - r - 1) && e !== a) {
|
|
3178
|
-
const
|
|
3179
|
-
this.ctx.paint.drawShadow(
|
|
3178
|
+
const h = s.width - (this.x + this.width) + r - e;
|
|
3179
|
+
this.ctx.paint.drawShadow(h + 1, this.y, e, this.height, {
|
|
3180
3180
|
fillColor: o,
|
|
3181
3181
|
side: "left",
|
|
3182
3182
|
shadowWidth: 4,
|
|
@@ -3203,8 +3203,8 @@ class di {
|
|
|
3203
3203
|
}), this.drawTipLine();
|
|
3204
3204
|
}
|
|
3205
3205
|
}
|
|
3206
|
-
class
|
|
3207
|
-
constructor(t, e, i = 0, s = 0, r = 0, o = 0, a,
|
|
3206
|
+
class se {
|
|
3207
|
+
constructor(t, e, i = 0, s = 0, r = 0, o = 0, a, h = "body") {
|
|
3208
3208
|
l(this, "ctx");
|
|
3209
3209
|
l(this, "x", 0);
|
|
3210
3210
|
l(this, "y", 0);
|
|
@@ -3217,12 +3217,12 @@ class ae {
|
|
|
3217
3217
|
l(this, "rowKey", "");
|
|
3218
3218
|
l(this, "rowType", "body");
|
|
3219
3219
|
l(this, "data");
|
|
3220
|
-
this.ctx = t, this.x = i, this.y = s, this.width = r, this.height = o, this.rowIndex = e, this.rowKey = t.database.getRowKeyForRowIndex(e), this.rowType =
|
|
3220
|
+
this.ctx = t, this.x = i, this.y = s, this.width = r, this.height = o, this.rowIndex = e, this.rowKey = t.database.getRowKeyForRowIndex(e), this.rowType = h, this.data = a, this.update();
|
|
3221
3221
|
}
|
|
3222
3222
|
update() {
|
|
3223
3223
|
const { header: t } = this.ctx, e = [], i = [], s = [];
|
|
3224
3224
|
t.renderLeafCellHeaders.forEach((r) => {
|
|
3225
|
-
const o = new
|
|
3225
|
+
const o = new ee(
|
|
3226
3226
|
this.ctx,
|
|
3227
3227
|
this.rowIndex,
|
|
3228
3228
|
r.colIndex,
|
|
@@ -3291,8 +3291,8 @@ class fi {
|
|
|
3291
3291
|
SCROLLER_TRACK_SIZE: r = 0,
|
|
3292
3292
|
HEIGHT: o,
|
|
3293
3293
|
EMPTY_BODY_HEIGHT: a = 0,
|
|
3294
|
-
MAX_HEIGHT:
|
|
3295
|
-
ENABLE_OFFSET_HEIGHT:
|
|
3294
|
+
MAX_HEIGHT: h = 0,
|
|
3295
|
+
ENABLE_OFFSET_HEIGHT: c = 0,
|
|
3296
3296
|
OFFSET_HEIGHT: f = 0
|
|
3297
3297
|
}
|
|
3298
3298
|
} = this.ctx;
|
|
@@ -3318,9 +3318,9 @@ class fi {
|
|
|
3318
3318
|
let p = this.height + e.height + r;
|
|
3319
3319
|
p += g;
|
|
3320
3320
|
let y = 0;
|
|
3321
|
-
this.data.length &&
|
|
3321
|
+
this.data.length && c ? (y = window.innerHeight - u - f, y < 0 && (y = 32, console.error(
|
|
3322
3322
|
"There is an error in the height calculation ENABLE_OFFSET_HEIGHT and OFFSET_HEIGHT are invalid"
|
|
3323
|
-
))) : this.data.length && o ? y = o : this.data.length &&
|
|
3323
|
+
))) : this.data.length && o ? y = o : this.data.length && h && p > h ? y = h : y = p, y > 0 && (this.ctx.stageHeight = Math.floor(y), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
|
|
3324
3324
|
let b = this.ctx.stageHeight - e.height - r;
|
|
3325
3325
|
s ? this.visibleHeight = b - g : 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 = d;
|
|
3326
3326
|
const m = window.devicePixelRatio || 1, E = this.ctx.stageWidth * m, C = this.ctx.stageHeight * m;
|
|
@@ -3343,8 +3343,8 @@ class fi {
|
|
|
3343
3343
|
}), this.ctx.on("mousemove", (e) => {
|
|
3344
3344
|
if (this.ctx.editing) return;
|
|
3345
3345
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s, a = e.clientY, {
|
|
3346
|
-
stageHeight:
|
|
3347
|
-
scrollY:
|
|
3346
|
+
stageHeight: h,
|
|
3347
|
+
scrollY: c,
|
|
3348
3348
|
config: { RESIZE_ROW_MIN_HEIGHT: f = 0 }
|
|
3349
3349
|
} = this.ctx;
|
|
3350
3350
|
if (this.isResizing && this.resizeTarget) {
|
|
@@ -3357,7 +3357,7 @@ class fi {
|
|
|
3357
3357
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3358
3358
|
for (let d = 0; d < this.renderRows.length; d++) {
|
|
3359
3359
|
const x = this.renderRows[d];
|
|
3360
|
-
if (r > x.y -
|
|
3360
|
+
if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r < h - 4)
|
|
3361
3361
|
for (let g = 0; g < x.cells.length; g++) {
|
|
3362
3362
|
const w = x.cells[g];
|
|
3363
3363
|
o > w.drawX + 10 && o < w.drawX + w.width - 10 && w.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = x);
|
|
@@ -3406,8 +3406,8 @@ class fi {
|
|
|
3406
3406
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3407
3407
|
colorEnd: "rgba(0,0,0,0)"
|
|
3408
3408
|
}), i < Math.floor(s.width - r - 1) && e !== a) {
|
|
3409
|
-
const
|
|
3410
|
-
this.ctx.paint.drawShadow(
|
|
3409
|
+
const h = s.width - (this.x + this.width) + r - e;
|
|
3410
|
+
this.ctx.paint.drawShadow(h + 1, this.y, e, this.height, {
|
|
3411
3411
|
fillColor: o,
|
|
3412
3412
|
side: "left",
|
|
3413
3413
|
shadowWidth: 4,
|
|
@@ -3431,14 +3431,14 @@ class fi {
|
|
|
3431
3431
|
const { header: t, database: e, scrollY: i } = this.ctx, s = i, { data: r, positions: o } = e.getData();
|
|
3432
3432
|
this.ctx.maxRowIndex = r.length - 1;
|
|
3433
3433
|
const a = this.binarySearch(o, s);
|
|
3434
|
-
let
|
|
3435
|
-
|
|
3436
|
-
const
|
|
3434
|
+
let h = this.binarySearch(o, s + this.visibleHeight);
|
|
3435
|
+
h === -1 && (h = r.length), this.headIndex = Math.max(0, a), this.tailIndex = Math.min(this.ctx.maxRowIndex, h + 1), this.visibleRows = r.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
|
|
3436
|
+
const c = [];
|
|
3437
3437
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
3438
|
-
const d = this.headIndex + f, x = this.visibleRows[f], { height: u, top: g } = this.ctx.database.getPositionForRowIndex(d), w = new
|
|
3439
|
-
|
|
3438
|
+
const d = this.headIndex + f, x = this.visibleRows[f], { height: u, top: g } = this.ctx.database.getPositionForRowIndex(d), w = new se(this.ctx, d, 0, g + this.y, t.width, u, x);
|
|
3439
|
+
c.push(w);
|
|
3440
3440
|
}
|
|
3441
|
-
this.renderRows =
|
|
3441
|
+
this.renderRows = c, this.ctx.body.renderRows = c;
|
|
3442
3442
|
}
|
|
3443
3443
|
draw() {
|
|
3444
3444
|
this.renderRows.forEach((t) => {
|
|
@@ -3479,16 +3479,16 @@ class xi {
|
|
|
3479
3479
|
stageWidth: r,
|
|
3480
3480
|
config: { HEADER_BG_COLOR: o, SCROLLER_TRACK_SIZE: a }
|
|
3481
3481
|
} = this.ctx;
|
|
3482
|
-
let
|
|
3483
|
-
if (this.ctx.config.FOOTER_FIXED || (
|
|
3482
|
+
let h = this.y;
|
|
3483
|
+
if (this.ctx.config.FOOTER_FIXED || (h = this.y - this.ctx.scrollY), i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, h, t, this.height, {
|
|
3484
3484
|
fillColor: o,
|
|
3485
3485
|
side: "right",
|
|
3486
3486
|
shadowWidth: 4,
|
|
3487
3487
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3488
3488
|
colorEnd: "rgba(0,0,0,0)"
|
|
3489
3489
|
}), i < Math.floor(s.width - r - 1) && e !== a) {
|
|
3490
|
-
const
|
|
3491
|
-
this.ctx.paint.drawShadow(
|
|
3490
|
+
const c = s.width - (this.x + this.width) + r - e;
|
|
3491
|
+
this.ctx.paint.drawShadow(c + 1, h, e, this.height, {
|
|
3492
3492
|
fillColor: o,
|
|
3493
3493
|
side: "left",
|
|
3494
3494
|
shadowWidth: 4,
|
|
@@ -3503,7 +3503,7 @@ class xi {
|
|
|
3503
3503
|
let e = this.y;
|
|
3504
3504
|
const i = [];
|
|
3505
3505
|
this.data.forEach((s, r) => {
|
|
3506
|
-
const o = new
|
|
3506
|
+
const o = new se(
|
|
3507
3507
|
this.ctx,
|
|
3508
3508
|
r,
|
|
3509
3509
|
0,
|
|
@@ -3541,7 +3541,7 @@ class ui {
|
|
|
3541
3541
|
init() {
|
|
3542
3542
|
this.ctx.on(
|
|
3543
3543
|
"mousemove",
|
|
3544
|
-
|
|
3544
|
+
Zt((t) => {
|
|
3545
3545
|
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = this.ctx.isTarget() && i > 0 && i < this.ctx.body.visibleWidth && e > this.ctx.header.visibleHeight && e < this.ctx.header.visibleHeight + this.ctx.body.visibleHeight;
|
|
3546
3546
|
(this.ctx.selectorMove || this.ctx.autofillMove) && (s ? this.stopAdjustPosition() : this.startAdjustPosition(t));
|
|
3547
3547
|
}, 100)
|
|
@@ -3630,12 +3630,12 @@ class ui {
|
|
|
3630
3630
|
this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0;
|
|
3631
3631
|
const {
|
|
3632
3632
|
SELECTOR_AREA_MIN_X: a,
|
|
3633
|
-
SELECTOR_AREA_MAX_X:
|
|
3634
|
-
SELECTOR_AREA_MIN_Y:
|
|
3633
|
+
SELECTOR_AREA_MAX_X: h,
|
|
3634
|
+
SELECTOR_AREA_MIN_Y: c,
|
|
3635
3635
|
SELECTOR_AREA_MAX_Y: f,
|
|
3636
3636
|
SELECTOR_AREA_MAX_X_OFFSET: d,
|
|
3637
3637
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
3638
|
-
} = this.ctx.config, u = a, g =
|
|
3638
|
+
} = this.ctx.config, u = a, g = h || this.ctx.maxColIndex - d, w = c, p = f || this.ctx.maxRowIndex - x;
|
|
3639
3639
|
let [y, b] = r, [m, E] = o;
|
|
3640
3640
|
if (y < u || b > g || m < w || E > p)
|
|
3641
3641
|
return;
|
|
@@ -3653,15 +3653,15 @@ class ui {
|
|
|
3653
3653
|
if (this.ctx.mousedown && this.ctx.focusCellHeader) {
|
|
3654
3654
|
const { colIndex: a } = this.ctx.focusCellHeader;
|
|
3655
3655
|
if (this.ctx.clearSelector(), t.colIndex >= a) {
|
|
3656
|
-
const
|
|
3657
|
-
this.setSelector(
|
|
3656
|
+
const h = [a, t.colIndex + t.colspan - 1], c = [r, o];
|
|
3657
|
+
this.setSelector(h, c);
|
|
3658
3658
|
} else {
|
|
3659
|
-
const
|
|
3660
|
-
this.setSelector(
|
|
3659
|
+
const h = [t.colIndex, a], c = [r, o];
|
|
3660
|
+
this.setSelector(h, c);
|
|
3661
3661
|
}
|
|
3662
3662
|
} else {
|
|
3663
|
-
const a = [t.colIndex, t.colIndex + t.colspan - 1],
|
|
3664
|
-
this.setSelector(a,
|
|
3663
|
+
const a = [t.colIndex, t.colIndex + t.colspan - 1], h = [r, o];
|
|
3664
|
+
this.setSelector(a, h);
|
|
3665
3665
|
}
|
|
3666
3666
|
}
|
|
3667
3667
|
selectAll() {
|
|
@@ -3675,8 +3675,8 @@ class ui {
|
|
|
3675
3675
|
SELECTOR_AREA_MIN_Y: r,
|
|
3676
3676
|
SELECTOR_AREA_MAX_Y: o,
|
|
3677
3677
|
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
3678
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
3679
|
-
} = this.ctx.config,
|
|
3678
|
+
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
3679
|
+
} = this.ctx.config, c = i, f = s || this.ctx.maxColIndex - a, d = r, x = o || this.ctx.maxRowIndex - h, u = [c, f], g = [d, x];
|
|
3680
3680
|
this.setSelector(u, g);
|
|
3681
3681
|
}
|
|
3682
3682
|
}
|
|
@@ -3686,17 +3686,17 @@ class ui {
|
|
|
3686
3686
|
const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MAX_X_OFFSET: r } = this.ctx.config, o = s || this.ctx.maxColIndex - r, a = i;
|
|
3687
3687
|
if (e) {
|
|
3688
3688
|
this.ctx.setFocusCell(t);
|
|
3689
|
-
const
|
|
3690
|
-
this.setSelector(
|
|
3689
|
+
const h = [a, o], c = [t.rowIndex, t.rowIndex];
|
|
3690
|
+
this.setSelector(h, c);
|
|
3691
3691
|
}
|
|
3692
3692
|
if (this.ctx.focusCell && this.ctx.mousedown) {
|
|
3693
|
-
const { rowIndex:
|
|
3694
|
-
if (t.rowIndex >=
|
|
3695
|
-
const
|
|
3696
|
-
this.setSelector(
|
|
3693
|
+
const { rowIndex: h } = this.ctx.focusCell;
|
|
3694
|
+
if (t.rowIndex >= h) {
|
|
3695
|
+
const c = [a, o], f = [h, t.rowIndex];
|
|
3696
|
+
this.setSelector(c, f);
|
|
3697
3697
|
} else {
|
|
3698
|
-
const
|
|
3699
|
-
this.setSelector(
|
|
3698
|
+
const c = [a, o], f = [t.rowIndex, h];
|
|
3699
|
+
this.setSelector(c, f);
|
|
3700
3700
|
}
|
|
3701
3701
|
}
|
|
3702
3702
|
}
|
|
@@ -3705,7 +3705,7 @@ class ui {
|
|
|
3705
3705
|
return;
|
|
3706
3706
|
const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
|
|
3707
3707
|
if (t && e && i) {
|
|
3708
|
-
const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), a = Math.max(i.colIndex, r),
|
|
3708
|
+
const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), a = Math.max(i.colIndex, r), h = Math.min(i.rowIndex, s), c = Math.max(i.rowIndex, s), f = [o, a], d = [h, c];
|
|
3709
3709
|
this.setSelector(f, d);
|
|
3710
3710
|
}
|
|
3711
3711
|
}
|
|
@@ -3713,7 +3713,7 @@ class ui {
|
|
|
3713
3713
|
const { focusCell: e, clickCell: i } = this.ctx;
|
|
3714
3714
|
if (e && this.isInSettingRange(e.rowIndex, e.colIndex))
|
|
3715
3715
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
3716
|
-
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: a } = e,
|
|
3716
|
+
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: a } = e, h = Math.min(o, s), c = Math.max(o, s), f = Math.min(a, r), d = Math.max(a, r), x = [h, c], u = [f, d];
|
|
3717
3717
|
this.setSelector(x, u);
|
|
3718
3718
|
} else {
|
|
3719
3719
|
this.ctx.emit("cellSelectedClick", e);
|
|
@@ -3750,8 +3750,8 @@ class ui {
|
|
|
3750
3750
|
let s = [];
|
|
3751
3751
|
const r = /* @__PURE__ */ new Set();
|
|
3752
3752
|
for (let a = 0; a <= e[1] - e[0]; a++)
|
|
3753
|
-
for (let
|
|
3754
|
-
const
|
|
3753
|
+
for (let h = 0; h <= t[1] - t[0]; h++) {
|
|
3754
|
+
const c = a + e[0], f = h + t[0], d = this.ctx.database.getItemValueForRowIndexAndColIndex(c, f);
|
|
3755
3755
|
if (d) {
|
|
3756
3756
|
const { rowKey: x, key: u } = d;
|
|
3757
3757
|
this.ctx.database.getReadonly(x, u) || (r.add(x), s.push({
|
|
@@ -3783,10 +3783,10 @@ class ui {
|
|
|
3783
3783
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
3784
3784
|
navigator.clipboard.readText().then((r) => {
|
|
3785
3785
|
let o = ti(r), a = [];
|
|
3786
|
-
for (let
|
|
3787
|
-
const f = o[
|
|
3786
|
+
for (let c = 0; c <= o.length - 1; c++) {
|
|
3787
|
+
const f = o[c].length;
|
|
3788
3788
|
for (let d = 0; d <= f - 1; d++) {
|
|
3789
|
-
const x =
|
|
3789
|
+
const x = c + e, u = d + i, g = o[c][d], w = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
3790
3790
|
x,
|
|
3791
3791
|
u
|
|
3792
3792
|
);
|
|
@@ -3803,23 +3803,23 @@ class ui {
|
|
|
3803
3803
|
}
|
|
3804
3804
|
}
|
|
3805
3805
|
if (this.isCut) {
|
|
3806
|
-
const
|
|
3806
|
+
const c = this.clearSelectedData(
|
|
3807
3807
|
this.ctx.selector.xArrCopy,
|
|
3808
3808
|
this.ctx.selector.yArrCopy,
|
|
3809
3809
|
!0
|
|
3810
3810
|
// 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
|
|
3811
3811
|
), f = a.map((d) => `${d.rowKey}-${d.key}`);
|
|
3812
|
-
|
|
3812
|
+
c.forEach((d) => {
|
|
3813
3813
|
f.includes(`${d.rowKey}-${d.key}`) || a.unshift(d);
|
|
3814
3814
|
}), this.isCut = !1;
|
|
3815
3815
|
}
|
|
3816
3816
|
if (!a.length)
|
|
3817
3817
|
return;
|
|
3818
3818
|
this.ctx.database.batchSetItemValue(a, !0);
|
|
3819
|
-
let
|
|
3820
|
-
s.forEach((
|
|
3821
|
-
|
|
3822
|
-
}), this.ctx.emit("pasteChange", a,
|
|
3819
|
+
let h = [];
|
|
3820
|
+
s.forEach((c) => {
|
|
3821
|
+
h.push(this.ctx.database.getRowDataItemForRowKey(c));
|
|
3822
|
+
}), this.ctx.emit("pasteChange", a, h), this.clearCopyLine(), this.ctx.emit("drawView");
|
|
3823
3823
|
}).catch((r) => {
|
|
3824
3824
|
console.error("获取剪贴板内容失败:", r);
|
|
3825
3825
|
});
|
|
@@ -3835,7 +3835,7 @@ class ui {
|
|
|
3835
3835
|
if (!e)
|
|
3836
3836
|
return;
|
|
3837
3837
|
let { colIndex: i = 0, rowIndex: s = 0 } = e;
|
|
3838
|
-
const r = 0, o = 0, a = this.ctx.maxColIndex,
|
|
3838
|
+
const r = 0, o = 0, a = this.ctx.maxColIndex, h = this.ctx.maxRowIndex;
|
|
3839
3839
|
switch (t) {
|
|
3840
3840
|
case "LEFT":
|
|
3841
3841
|
i > r && i--;
|
|
@@ -3847,11 +3847,11 @@ class ui {
|
|
|
3847
3847
|
i < a && i++;
|
|
3848
3848
|
break;
|
|
3849
3849
|
case "BOTTOM":
|
|
3850
|
-
s <
|
|
3850
|
+
s < h && s++;
|
|
3851
3851
|
break;
|
|
3852
3852
|
}
|
|
3853
|
-
const
|
|
3854
|
-
d && (d.operation || this.isInSettingRange(d.rowIndex, d.colIndex) && (this.ctx.setFocusCell(d), this.setSelector(
|
|
3853
|
+
const c = [i, i], f = [s, s], d = this.getCell(s, i);
|
|
3854
|
+
d && (d.operation || this.isInSettingRange(d.rowIndex, d.colIndex) && (this.ctx.setFocusCell(d), this.setSelector(c, f), this.adjustBoundaryPosition(), this.ctx.emit("drawView")));
|
|
3855
3855
|
}
|
|
3856
3856
|
stopAdjustPosition() {
|
|
3857
3857
|
this.adjustPositionX = "", this.adjustPositionY = "", this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerY && (clearInterval(this.timerY), this.timerY = 0);
|
|
@@ -3864,9 +3864,9 @@ class ui {
|
|
|
3864
3864
|
SELECTOR_AREA_MIN_Y: r,
|
|
3865
3865
|
SELECTOR_AREA_MAX_Y: o,
|
|
3866
3866
|
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
3867
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
3868
|
-
} = this.ctx.config,
|
|
3869
|
-
return !(e <
|
|
3867
|
+
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
3868
|
+
} = this.ctx.config, c = i, f = s || this.ctx.maxColIndex - a, d = r, x = o || this.ctx.maxRowIndex - h;
|
|
3869
|
+
return !(e < c || e > f || t < d || t > x);
|
|
3870
3870
|
}
|
|
3871
3871
|
/**
|
|
3872
3872
|
* 调整滚动条位置,让到达边界时自动滚动
|
|
@@ -3879,8 +3879,8 @@ class ui {
|
|
|
3879
3879
|
let a = 10 * (s === "left" ? -1 : 1);
|
|
3880
3880
|
this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
|
|
3881
3881
|
a *= 1.5;
|
|
3882
|
-
const { scrollX:
|
|
3883
|
-
(
|
|
3882
|
+
const { scrollX: h } = this.ctx, c = h + a;
|
|
3883
|
+
(c < 0 || c > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(c);
|
|
3884
3884
|
}, 100);
|
|
3885
3885
|
}
|
|
3886
3886
|
if (r && this.adjustPositionY !== r) {
|
|
@@ -3888,8 +3888,8 @@ class ui {
|
|
|
3888
3888
|
let a = 10 * (r === "top" ? -1 : 1);
|
|
3889
3889
|
this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
|
|
3890
3890
|
a *= 1.5;
|
|
3891
|
-
const { scrollY:
|
|
3892
|
-
(
|
|
3891
|
+
const { scrollY: h } = this.ctx, c = h + a;
|
|
3892
|
+
(c < 0 || c > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(c);
|
|
3893
3893
|
}, 100);
|
|
3894
3894
|
}
|
|
3895
3895
|
}
|
|
@@ -3905,17 +3905,17 @@ class ui {
|
|
|
3905
3905
|
fixedLeftWidth: r,
|
|
3906
3906
|
header: o,
|
|
3907
3907
|
footer: a,
|
|
3908
|
-
scrollX:
|
|
3909
|
-
scrollY:
|
|
3908
|
+
scrollX: h,
|
|
3909
|
+
scrollY: c
|
|
3910
3910
|
} = this.ctx;
|
|
3911
|
-
if (!i)
|
|
3911
|
+
if (!i || i.height > t)
|
|
3912
3912
|
return;
|
|
3913
3913
|
const { SCROLLER_TRACK_SIZE: f = 0, FOOTER_FIXED: d } = this.ctx.config;
|
|
3914
3914
|
let x = 0;
|
|
3915
3915
|
d && (x = a.visibleHeight);
|
|
3916
3916
|
const u = r - i.drawX + 1, g = i.drawX + i.width - (e - s) + 1, w = o.height - i.drawY, p = i.drawY + i.height - (t - x - f);
|
|
3917
3917
|
this.adjustTimer && (clearTimeout(this.adjustTimer), this.adjustTimer = 0), this.adjustTimer = setTimeout(() => {
|
|
3918
|
-
this.ctx.editing || (g > 0 && !i.fixed ? this.ctx.setScrollX(
|
|
3918
|
+
this.ctx.editing || (g > 0 && !i.fixed ? this.ctx.setScrollX(h + g) : u > 0 && !i.fixed && this.ctx.setScrollX(h - u), w > 0 ? this.ctx.setScrollY(c - w) : p > 0 && this.ctx.setScrollY(c + p));
|
|
3919
3919
|
}, 167);
|
|
3920
3920
|
}
|
|
3921
3921
|
destroy() {
|
|
@@ -3930,8 +3930,8 @@ class gi {
|
|
|
3930
3930
|
init() {
|
|
3931
3931
|
this.ctx.on("cellMouseenter", (t, e) => {
|
|
3932
3932
|
this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default");
|
|
3933
|
-
const { offsetX: i, offsetY: s } = this.ctx.getOffset(e), { xArr: r, yArr: o } = this.ctx.selector, a = r[1],
|
|
3934
|
-
if (this.ctx.config.ENABLE_AUTOFILL &&
|
|
3933
|
+
const { offsetX: i, offsetY: s } = this.ctx.getOffset(e), { xArr: r, yArr: o } = this.ctx.selector, a = r[1], h = o[1], { colIndex: c, rowIndex: f, drawX: d, drawY: x, width: u, height: g } = t;
|
|
3934
|
+
if (this.ctx.config.ENABLE_AUTOFILL && c === a && f === h) {
|
|
3935
3935
|
const p = d + u - 6, y = x + g - 6;
|
|
3936
3936
|
i > p && s > y && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
3937
3937
|
}
|
|
@@ -3964,22 +3964,22 @@ class gi {
|
|
|
3964
3964
|
return;
|
|
3965
3965
|
let o = t, a = e;
|
|
3966
3966
|
if (!r) {
|
|
3967
|
-
const [
|
|
3968
|
-
a = [
|
|
3967
|
+
const [h] = a;
|
|
3968
|
+
a = [h, h];
|
|
3969
3969
|
}
|
|
3970
3970
|
if (!s) {
|
|
3971
|
-
const [
|
|
3972
|
-
o = [
|
|
3971
|
+
const [h] = o;
|
|
3972
|
+
o = [h, h];
|
|
3973
3973
|
}
|
|
3974
3974
|
if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(o) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(a)) {
|
|
3975
3975
|
const {
|
|
3976
|
-
SELECTOR_AREA_MIN_X:
|
|
3977
|
-
SELECTOR_AREA_MAX_X:
|
|
3976
|
+
SELECTOR_AREA_MIN_X: h,
|
|
3977
|
+
SELECTOR_AREA_MAX_X: c,
|
|
3978
3978
|
SELECTOR_AREA_MIN_Y: f,
|
|
3979
3979
|
SELECTOR_AREA_MAX_Y: d,
|
|
3980
3980
|
SELECTOR_AREA_MAX_X_OFFSET: x,
|
|
3981
3981
|
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
3982
|
-
} = this.ctx.config, g =
|
|
3982
|
+
} = this.ctx.config, g = h, w = c || this.ctx.maxColIndex - x, p = f, y = d || this.ctx.maxRowIndex - u;
|
|
3983
3983
|
let [b, m] = o, [E, C] = a;
|
|
3984
3984
|
if (b < g || E < p)
|
|
3985
3985
|
return;
|
|
@@ -3996,14 +3996,14 @@ class gi {
|
|
|
3996
3996
|
const u = d + e.yArr[0], g = x + e.xArr[0];
|
|
3997
3997
|
i.set(`${u}-${g}`, !0);
|
|
3998
3998
|
}
|
|
3999
|
-
const { value: s } = e, r = s[0].length, o = s.length, a = this.ctx.autofill.xArr,
|
|
4000
|
-
let
|
|
4001
|
-
for (let d = 0; d <=
|
|
3999
|
+
const { value: s } = e, r = s[0].length, o = s.length, a = this.ctx.autofill.xArr, h = this.ctx.autofill.yArr;
|
|
4000
|
+
let c = [];
|
|
4001
|
+
for (let d = 0; d <= h[1] - h[0]; d++)
|
|
4002
4002
|
for (let x = 0; x <= a[1] - a[0]; x++) {
|
|
4003
|
-
const u = x + a[0], g = d +
|
|
4003
|
+
const u = x + a[0], g = d + h[0], w = s[d % o][x % r], p = this.ctx.database.getItemValueForRowIndexAndColIndex(g, u), y = `${g}-${u}`;
|
|
4004
4004
|
if (p && !i.has(y)) {
|
|
4005
4005
|
const { rowKey: b, key: m } = p;
|
|
4006
|
-
this.ctx.database.getReadonly(b, m) || (t.add(b),
|
|
4006
|
+
this.ctx.database.getReadonly(b, m) || (t.add(b), c.push({
|
|
4007
4007
|
rowKey: b,
|
|
4008
4008
|
key: m,
|
|
4009
4009
|
value: w,
|
|
@@ -4011,13 +4011,13 @@ class gi {
|
|
|
4011
4011
|
}));
|
|
4012
4012
|
}
|
|
4013
4013
|
}
|
|
4014
|
-
if (!
|
|
4014
|
+
if (!c.length)
|
|
4015
4015
|
return;
|
|
4016
|
-
this.ctx.database.batchSetItemValue(
|
|
4016
|
+
this.ctx.database.batchSetItemValue(c, !0);
|
|
4017
4017
|
let f = [];
|
|
4018
4018
|
t.forEach((d) => {
|
|
4019
4019
|
f.push(this.ctx.database.getRowDataItemForRowKey(d));
|
|
4020
|
-
}), this.ctx.emit("autofillChange",
|
|
4020
|
+
}), this.ctx.emit("autofillChange", c, f), this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr, this.ctx.emit("draw");
|
|
4021
4021
|
}
|
|
4022
4022
|
mouseenter(t) {
|
|
4023
4023
|
if (["index", "selection", "index-selection"].includes(t.type))
|
|
@@ -4055,7 +4055,7 @@ function q(n) {
|
|
|
4055
4055
|
function lt(n) {
|
|
4056
4056
|
return n.split("-")[1];
|
|
4057
4057
|
}
|
|
4058
|
-
function
|
|
4058
|
+
function re(n) {
|
|
4059
4059
|
return n === "x" ? "y" : "x";
|
|
4060
4060
|
}
|
|
4061
4061
|
function Lt(n) {
|
|
@@ -4065,7 +4065,7 @@ function J(n) {
|
|
|
4065
4065
|
return ["top", "bottom"].includes(q(n)) ? "y" : "x";
|
|
4066
4066
|
}
|
|
4067
4067
|
function Mt(n) {
|
|
4068
|
-
return
|
|
4068
|
+
return re(J(n));
|
|
4069
4069
|
}
|
|
4070
4070
|
function yi(n, t, e) {
|
|
4071
4071
|
e === void 0 && (e = !1);
|
|
@@ -4110,7 +4110,7 @@ function Ci(n) {
|
|
|
4110
4110
|
...n
|
|
4111
4111
|
};
|
|
4112
4112
|
}
|
|
4113
|
-
function
|
|
4113
|
+
function oe(n) {
|
|
4114
4114
|
return typeof n != "number" ? Ci(n) : {
|
|
4115
4115
|
top: n,
|
|
4116
4116
|
right: n,
|
|
@@ -4136,14 +4136,14 @@ function ut(n) {
|
|
|
4136
4136
|
y: e
|
|
4137
4137
|
};
|
|
4138
4138
|
}
|
|
4139
|
-
function
|
|
4139
|
+
function Vt(n, t, e) {
|
|
4140
4140
|
let {
|
|
4141
4141
|
reference: i,
|
|
4142
4142
|
floating: s
|
|
4143
4143
|
} = n;
|
|
4144
|
-
const r = J(t), o = Mt(t), a = Lt(o),
|
|
4144
|
+
const r = J(t), o = Mt(t), a = Lt(o), h = q(t), c = r === "y", f = i.x + i.width / 2 - s.width / 2, d = i.y + i.height / 2 - s.height / 2, x = i[a] / 2 - s[a] / 2;
|
|
4145
4145
|
let u;
|
|
4146
|
-
switch (
|
|
4146
|
+
switch (h) {
|
|
4147
4147
|
case "top":
|
|
4148
4148
|
u = {
|
|
4149
4149
|
x: f,
|
|
@@ -4176,10 +4176,10 @@ function Gt(n, t, e) {
|
|
|
4176
4176
|
}
|
|
4177
4177
|
switch (lt(t)) {
|
|
4178
4178
|
case "start":
|
|
4179
|
-
u[o] -= x * (e &&
|
|
4179
|
+
u[o] -= x * (e && c ? -1 : 1);
|
|
4180
4180
|
break;
|
|
4181
4181
|
case "end":
|
|
4182
|
-
u[o] += x * (e &&
|
|
4182
|
+
u[o] += x * (e && c ? -1 : 1);
|
|
4183
4183
|
break;
|
|
4184
4184
|
}
|
|
4185
4185
|
return u;
|
|
@@ -4190,15 +4190,15 @@ const vi = async (n, t, e) => {
|
|
|
4190
4190
|
strategy: s = "absolute",
|
|
4191
4191
|
middleware: r = [],
|
|
4192
4192
|
platform: o
|
|
4193
|
-
} = e, a = r.filter(Boolean),
|
|
4194
|
-
let
|
|
4193
|
+
} = e, a = r.filter(Boolean), h = await (o.isRTL == null ? void 0 : o.isRTL(t));
|
|
4194
|
+
let c = await o.getElementRects({
|
|
4195
4195
|
reference: n,
|
|
4196
4196
|
floating: t,
|
|
4197
4197
|
strategy: s
|
|
4198
4198
|
}), {
|
|
4199
4199
|
x: f,
|
|
4200
4200
|
y: d
|
|
4201
|
-
} =
|
|
4201
|
+
} = Vt(c, i, h), x = i, u = {}, g = 0;
|
|
4202
4202
|
for (let w = 0; w < a.length; w++) {
|
|
4203
4203
|
const {
|
|
4204
4204
|
name: p,
|
|
@@ -4215,7 +4215,7 @@ const vi = async (n, t, e) => {
|
|
|
4215
4215
|
placement: x,
|
|
4216
4216
|
strategy: s,
|
|
4217
4217
|
middlewareData: u,
|
|
4218
|
-
rects:
|
|
4218
|
+
rects: c,
|
|
4219
4219
|
platform: o,
|
|
4220
4220
|
elements: {
|
|
4221
4221
|
reference: n,
|
|
@@ -4228,14 +4228,14 @@ const vi = async (n, t, e) => {
|
|
|
4228
4228
|
...u[p],
|
|
4229
4229
|
...E
|
|
4230
4230
|
}
|
|
4231
|
-
}, C && g <= 50 && (g++, typeof C == "object" && (C.placement && (x = C.placement), C.rects && (
|
|
4231
|
+
}, C && g <= 50 && (g++, typeof C == "object" && (C.placement && (x = C.placement), C.rects && (c = C.rects === !0 ? await o.getElementRects({
|
|
4232
4232
|
reference: n,
|
|
4233
4233
|
floating: t,
|
|
4234
4234
|
strategy: s
|
|
4235
4235
|
}) : C.rects), {
|
|
4236
4236
|
x: f,
|
|
4237
4237
|
y: d
|
|
4238
|
-
} =
|
|
4238
|
+
} = Vt(c, x, h)), w = -1);
|
|
4239
4239
|
}
|
|
4240
4240
|
return {
|
|
4241
4241
|
x: f,
|
|
@@ -4245,7 +4245,7 @@ const vi = async (n, t, e) => {
|
|
|
4245
4245
|
middlewareData: u
|
|
4246
4246
|
};
|
|
4247
4247
|
};
|
|
4248
|
-
async function
|
|
4248
|
+
async function ne(n, t) {
|
|
4249
4249
|
var e;
|
|
4250
4250
|
t === void 0 && (t = {});
|
|
4251
4251
|
const {
|
|
@@ -4254,18 +4254,18 @@ async function he(n, t) {
|
|
|
4254
4254
|
platform: r,
|
|
4255
4255
|
rects: o,
|
|
4256
4256
|
elements: a,
|
|
4257
|
-
strategy:
|
|
4257
|
+
strategy: h
|
|
4258
4258
|
} = n, {
|
|
4259
|
-
boundary:
|
|
4259
|
+
boundary: c = "clippingAncestors",
|
|
4260
4260
|
rootBoundary: f = "viewport",
|
|
4261
4261
|
elementContext: d = "floating",
|
|
4262
4262
|
altBoundary: x = !1,
|
|
4263
4263
|
padding: u = 0
|
|
4264
|
-
} = at(t, n), g =
|
|
4264
|
+
} = at(t, n), g = oe(u), p = a[x ? d === "floating" ? "reference" : "floating" : d], y = ut(await r.getClippingRect({
|
|
4265
4265
|
element: (e = await (r.isElement == null ? void 0 : r.isElement(p))) == null || e ? p : p.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(a.floating)),
|
|
4266
|
-
boundary:
|
|
4266
|
+
boundary: c,
|
|
4267
4267
|
rootBoundary: f,
|
|
4268
|
-
strategy:
|
|
4268
|
+
strategy: h
|
|
4269
4269
|
})), b = d === "floating" ? {
|
|
4270
4270
|
x: i,
|
|
4271
4271
|
y: s,
|
|
@@ -4281,7 +4281,7 @@ async function he(n, t) {
|
|
|
4281
4281
|
elements: a,
|
|
4282
4282
|
rect: b,
|
|
4283
4283
|
offsetParent: m,
|
|
4284
|
-
strategy:
|
|
4284
|
+
strategy: h
|
|
4285
4285
|
}) : b);
|
|
4286
4286
|
return {
|
|
4287
4287
|
top: (y.top - C.top + g.top) / E.y,
|
|
@@ -4301,20 +4301,20 @@ const Ri = (n) => ({
|
|
|
4301
4301
|
rects: r,
|
|
4302
4302
|
platform: o,
|
|
4303
4303
|
elements: a,
|
|
4304
|
-
middlewareData:
|
|
4304
|
+
middlewareData: h
|
|
4305
4305
|
} = t, {
|
|
4306
|
-
element:
|
|
4306
|
+
element: c,
|
|
4307
4307
|
padding: f = 0
|
|
4308
4308
|
} = at(n, t) || {};
|
|
4309
|
-
if (
|
|
4309
|
+
if (c == null)
|
|
4310
4310
|
return {};
|
|
4311
|
-
const d =
|
|
4311
|
+
const d = oe(f), x = {
|
|
4312
4312
|
x: e,
|
|
4313
4313
|
y: i
|
|
4314
|
-
}, u = Mt(s), g = Lt(u), w = await o.getDimensions(
|
|
4314
|
+
}, u = Mt(s), g = Lt(u), w = await o.getDimensions(c), p = u === "y", y = p ? "top" : "left", b = p ? "bottom" : "right", m = p ? "clientHeight" : "clientWidth", E = r.reference[g] + r.reference[u] - x[u] - r.floating[g], C = x[u] - r.reference[u], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
|
|
4315
4315
|
let T = R ? R[m] : 0;
|
|
4316
4316
|
(!T || !await (o.isElement == null ? void 0 : o.isElement(R))) && (T = a.floating[m] || r.floating[g]);
|
|
4317
|
-
const A = E / 2 - C / 2, L = T / 2 - w[g] / 2 - 1, D = rt(d[y], L), B = rt(d[b], L), I = D, S = T - w[g] - B, O = T / 2 - w[g] / 2 + A, G = It(I, O, S), Y = !
|
|
4317
|
+
const A = E / 2 - C / 2, L = T / 2 - w[g] / 2 - 1, D = rt(d[y], L), B = rt(d[b], L), I = D, S = T - w[g] - B, O = T / 2 - w[g] / 2 + A, G = It(I, O, S), Y = !h.arrow && lt(s) != null && O !== G && r.reference[g] / 2 - (O < I ? D : B) - w[g] / 2 < 0, k = Y ? O < I ? O - I : O - S : 0;
|
|
4318
4318
|
return {
|
|
4319
4319
|
[u]: x[u] + k,
|
|
4320
4320
|
data: {
|
|
@@ -4338,8 +4338,8 @@ const Ri = (n) => ({
|
|
|
4338
4338
|
middlewareData: r,
|
|
4339
4339
|
rects: o,
|
|
4340
4340
|
initialPlacement: a,
|
|
4341
|
-
platform:
|
|
4342
|
-
elements:
|
|
4341
|
+
platform: h,
|
|
4342
|
+
elements: c
|
|
4343
4343
|
} = t, {
|
|
4344
4344
|
mainAxis: f = !0,
|
|
4345
4345
|
crossAxis: d = !0,
|
|
@@ -4351,9 +4351,9 @@ const Ri = (n) => ({
|
|
|
4351
4351
|
} = at(n, t);
|
|
4352
4352
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
4353
4353
|
return {};
|
|
4354
|
-
const y = q(s), b = J(a), m = q(a) === a, E = await (
|
|
4354
|
+
const y = q(s), b = J(a), m = q(a) === a, E = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), C = x || (m || !w ? [xt(a)] : mi(a)), R = g !== "none";
|
|
4355
4355
|
!x && R && C.push(...bi(a, w, g, E));
|
|
4356
|
-
const T = [a, ...C], A = await
|
|
4356
|
+
const T = [a, ...C], A = await ne(t, p), L = [];
|
|
4357
4357
|
let D = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
4358
4358
|
if (f && L.push(A[y]), d) {
|
|
4359
4359
|
const O = yi(s, o, E);
|
|
@@ -4412,7 +4412,7 @@ async function Ii(n, t) {
|
|
|
4412
4412
|
placement: e,
|
|
4413
4413
|
platform: i,
|
|
4414
4414
|
elements: s
|
|
4415
|
-
} = n, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), a = lt(e),
|
|
4415
|
+
} = n, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), a = lt(e), h = J(e) === "y", c = ["left", "top"].includes(o) ? -1 : 1, f = r && h ? -1 : 1, d = at(t, n);
|
|
4416
4416
|
let {
|
|
4417
4417
|
mainAxis: x,
|
|
4418
4418
|
crossAxis: u,
|
|
@@ -4426,11 +4426,11 @@ async function Ii(n, t) {
|
|
|
4426
4426
|
crossAxis: d.crossAxis || 0,
|
|
4427
4427
|
alignmentAxis: d.alignmentAxis
|
|
4428
4428
|
};
|
|
4429
|
-
return a && typeof g == "number" && (u = a === "end" ? g * -1 : g),
|
|
4429
|
+
return a && typeof g == "number" && (u = a === "end" ? g * -1 : g), h ? {
|
|
4430
4430
|
x: u * f,
|
|
4431
|
-
y: x *
|
|
4431
|
+
y: x * c
|
|
4432
4432
|
} : {
|
|
4433
|
-
x: x *
|
|
4433
|
+
x: x * c,
|
|
4434
4434
|
y: u * f
|
|
4435
4435
|
};
|
|
4436
4436
|
}
|
|
@@ -4445,12 +4445,12 @@ const Oi = function(n) {
|
|
|
4445
4445
|
y: r,
|
|
4446
4446
|
placement: o,
|
|
4447
4447
|
middlewareData: a
|
|
4448
|
-
} = t,
|
|
4448
|
+
} = t, h = await Ii(t, n);
|
|
4449
4449
|
return o === ((e = a.offset) == null ? void 0 : e.placement) && (i = a.arrow) != null && i.alignmentOffset ? {} : {
|
|
4450
|
-
x: s +
|
|
4451
|
-
y: r +
|
|
4450
|
+
x: s + h.x,
|
|
4451
|
+
y: r + h.y,
|
|
4452
4452
|
data: {
|
|
4453
|
-
...
|
|
4453
|
+
...h,
|
|
4454
4454
|
placement: o
|
|
4455
4455
|
}
|
|
4456
4456
|
};
|
|
@@ -4480,12 +4480,12 @@ const Oi = function(n) {
|
|
|
4480
4480
|
};
|
|
4481
4481
|
}
|
|
4482
4482
|
},
|
|
4483
|
-
...
|
|
4484
|
-
} = at(n, t),
|
|
4483
|
+
...h
|
|
4484
|
+
} = at(n, t), c = {
|
|
4485
4485
|
x: e,
|
|
4486
4486
|
y: i
|
|
4487
|
-
}, f = await
|
|
4488
|
-
let u =
|
|
4487
|
+
}, f = await ne(t, h), d = J(q(s)), x = re(d);
|
|
4488
|
+
let u = c[x], g = c[d];
|
|
4489
4489
|
if (r) {
|
|
4490
4490
|
const p = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", b = u + f[p], m = u - f[y];
|
|
4491
4491
|
u = It(b, u, m);
|
|
@@ -4517,7 +4517,7 @@ function gt() {
|
|
|
4517
4517
|
return typeof window < "u";
|
|
4518
4518
|
}
|
|
4519
4519
|
function tt(n) {
|
|
4520
|
-
return
|
|
4520
|
+
return ae(n) ? (n.nodeName || "").toLowerCase() : "#document";
|
|
4521
4521
|
}
|
|
4522
4522
|
function H(n) {
|
|
4523
4523
|
var t;
|
|
@@ -4525,9 +4525,9 @@ function H(n) {
|
|
|
4525
4525
|
}
|
|
4526
4526
|
function K(n) {
|
|
4527
4527
|
var t;
|
|
4528
|
-
return (t = (
|
|
4528
|
+
return (t = (ae(n) ? n.ownerDocument : n.document) || window.document) == null ? void 0 : t.documentElement;
|
|
4529
4529
|
}
|
|
4530
|
-
function
|
|
4530
|
+
function ae(n) {
|
|
4531
4531
|
return gt() ? n instanceof Node || n instanceof H(n).Node : !1;
|
|
4532
4532
|
}
|
|
4533
4533
|
function X(n) {
|
|
@@ -4536,10 +4536,10 @@ function X(n) {
|
|
|
4536
4536
|
function N(n) {
|
|
4537
4537
|
return gt() ? n instanceof HTMLElement || n instanceof H(n).HTMLElement : !1;
|
|
4538
4538
|
}
|
|
4539
|
-
function
|
|
4539
|
+
function zt(n) {
|
|
4540
4540
|
return !gt() || typeof ShadowRoot > "u" ? !1 : n instanceof ShadowRoot || n instanceof H(n).ShadowRoot;
|
|
4541
4541
|
}
|
|
4542
|
-
function
|
|
4542
|
+
function ht(n) {
|
|
4543
4543
|
const {
|
|
4544
4544
|
overflow: t,
|
|
4545
4545
|
overflowX: e,
|
|
@@ -4600,29 +4600,29 @@ function z(n) {
|
|
|
4600
4600
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
4601
4601
|
n.assignedSlot || // DOM Element detected.
|
|
4602
4602
|
n.parentNode || // ShadowRoot detected.
|
|
4603
|
-
|
|
4603
|
+
zt(n) && n.host || // Fallback.
|
|
4604
4604
|
K(n)
|
|
4605
4605
|
);
|
|
4606
|
-
return
|
|
4606
|
+
return zt(t) ? t.host : t;
|
|
4607
4607
|
}
|
|
4608
|
-
function
|
|
4608
|
+
function le(n) {
|
|
4609
4609
|
const t = z(n);
|
|
4610
|
-
return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) &&
|
|
4610
|
+
return Q(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : N(t) && ht(t) ? t : le(t);
|
|
4611
4611
|
}
|
|
4612
4612
|
function Tt(n, t, e) {
|
|
4613
4613
|
var i;
|
|
4614
4614
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
4615
|
-
const s =
|
|
4615
|
+
const s = le(n), r = s === ((i = n.ownerDocument) == null ? void 0 : i.body), o = H(s);
|
|
4616
4616
|
if (r) {
|
|
4617
4617
|
const a = St(o);
|
|
4618
|
-
return t.concat(o, o.visualViewport || [],
|
|
4618
|
+
return t.concat(o, o.visualViewport || [], ht(s) ? s : [], a && e ? Tt(a) : []);
|
|
4619
4619
|
}
|
|
4620
4620
|
return t.concat(s, Tt(s, [], e));
|
|
4621
4621
|
}
|
|
4622
4622
|
function St(n) {
|
|
4623
4623
|
return n.parent && Object.getPrototypeOf(n.parent) ? n.frameElement : null;
|
|
4624
4624
|
}
|
|
4625
|
-
function
|
|
4625
|
+
function he(n) {
|
|
4626
4626
|
const t = F(n);
|
|
4627
4627
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
4628
4628
|
const s = N(n), r = s ? n.offsetWidth : e, o = s ? n.offsetHeight : i, a = ft(e) !== r || ft(i) !== o;
|
|
@@ -4632,18 +4632,18 @@ function xe(n) {
|
|
|
4632
4632
|
$: a
|
|
4633
4633
|
};
|
|
4634
4634
|
}
|
|
4635
|
-
function
|
|
4635
|
+
function ce(n) {
|
|
4636
4636
|
return X(n) ? n : n.contextElement;
|
|
4637
4637
|
}
|
|
4638
4638
|
function Z(n) {
|
|
4639
|
-
const t =
|
|
4639
|
+
const t = ce(n);
|
|
4640
4640
|
if (!N(t))
|
|
4641
4641
|
return V(1);
|
|
4642
4642
|
const e = t.getBoundingClientRect(), {
|
|
4643
4643
|
width: i,
|
|
4644
4644
|
height: s,
|
|
4645
4645
|
$: r
|
|
4646
|
-
} =
|
|
4646
|
+
} = he(t);
|
|
4647
4647
|
let o = (r ? ft(e.width) : e.width) / i, a = (r ? ft(e.height) : e.height) / s;
|
|
4648
4648
|
return (!o || !Number.isFinite(o)) && (o = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
4649
4649
|
x: o,
|
|
@@ -4651,7 +4651,7 @@ function Z(n) {
|
|
|
4651
4651
|
};
|
|
4652
4652
|
}
|
|
4653
4653
|
const Li = /* @__PURE__ */ V(0);
|
|
4654
|
-
function
|
|
4654
|
+
function de(n) {
|
|
4655
4655
|
const t = H(n);
|
|
4656
4656
|
return !Dt() || !t.visualViewport ? Li : {
|
|
4657
4657
|
x: t.visualViewport.offsetLeft,
|
|
@@ -4663,24 +4663,24 @@ function Mi(n, t, e) {
|
|
|
4663
4663
|
}
|
|
4664
4664
|
function ot(n, t, e, i) {
|
|
4665
4665
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
4666
|
-
const s = n.getBoundingClientRect(), r =
|
|
4666
|
+
const s = n.getBoundingClientRect(), r = ce(n);
|
|
4667
4667
|
let o = V(1);
|
|
4668
4668
|
t && (i ? X(i) && (o = Z(i)) : o = Z(n));
|
|
4669
|
-
const a = Mi(r, e, i) ?
|
|
4670
|
-
let
|
|
4669
|
+
const a = Mi(r, e, i) ? de(r) : V(0);
|
|
4670
|
+
let h = (s.left + a.x) / o.x, c = (s.top + a.y) / o.y, f = s.width / o.x, d = s.height / o.y;
|
|
4671
4671
|
if (r) {
|
|
4672
4672
|
const x = H(r), u = i && X(i) ? H(i) : i;
|
|
4673
4673
|
let g = x, w = St(g);
|
|
4674
4674
|
for (; w && i && u !== g; ) {
|
|
4675
4675
|
const p = Z(w), y = w.getBoundingClientRect(), b = F(w), m = y.left + (w.clientLeft + parseFloat(b.paddingLeft)) * p.x, E = y.top + (w.clientTop + parseFloat(b.paddingTop)) * p.y;
|
|
4676
|
-
|
|
4676
|
+
h *= p.x, c *= p.y, f *= p.x, d *= p.y, h += m, c += E, g = H(w), w = St(g);
|
|
4677
4677
|
}
|
|
4678
4678
|
}
|
|
4679
4679
|
return ut({
|
|
4680
4680
|
width: f,
|
|
4681
4681
|
height: d,
|
|
4682
|
-
x:
|
|
4683
|
-
y:
|
|
4682
|
+
x: h,
|
|
4683
|
+
y: c
|
|
4684
4684
|
});
|
|
4685
4685
|
}
|
|
4686
4686
|
function Hi(n) {
|
|
@@ -4693,20 +4693,20 @@ function Hi(n) {
|
|
|
4693
4693
|
const r = s === "fixed", o = K(i), a = t ? wt(t.floating) : !1;
|
|
4694
4694
|
if (i === o || a && r)
|
|
4695
4695
|
return e;
|
|
4696
|
-
let
|
|
4696
|
+
let h = {
|
|
4697
4697
|
scrollLeft: 0,
|
|
4698
4698
|
scrollTop: 0
|
|
4699
|
-
},
|
|
4699
|
+
}, c = V(1);
|
|
4700
4700
|
const f = V(0), d = N(i);
|
|
4701
|
-
if ((d || !d && !r) && ((tt(i) !== "body" ||
|
|
4701
|
+
if ((d || !d && !r) && ((tt(i) !== "body" || ht(o)) && (h = pt(i)), N(i))) {
|
|
4702
4702
|
const x = ot(i);
|
|
4703
|
-
|
|
4703
|
+
c = Z(i), f.x = x.x + i.clientLeft, f.y = x.y + i.clientTop;
|
|
4704
4704
|
}
|
|
4705
4705
|
return {
|
|
4706
|
-
width: e.width *
|
|
4707
|
-
height: e.height *
|
|
4708
|
-
x: e.x *
|
|
4709
|
-
y: e.y *
|
|
4706
|
+
width: e.width * c.x,
|
|
4707
|
+
height: e.height * c.y,
|
|
4708
|
+
x: e.x * c.x - h.scrollLeft * c.x + f.x,
|
|
4709
|
+
y: e.y * c.y - h.scrollTop * c.y + f.y
|
|
4710
4710
|
};
|
|
4711
4711
|
}
|
|
4712
4712
|
function Di(n) {
|
|
@@ -4729,29 +4729,29 @@ function Xi(n) {
|
|
|
4729
4729
|
}
|
|
4730
4730
|
function Fi(n, t) {
|
|
4731
4731
|
const e = H(n), i = K(n), s = e.visualViewport;
|
|
4732
|
-
let r = i.clientWidth, o = i.clientHeight, a = 0,
|
|
4732
|
+
let r = i.clientWidth, o = i.clientHeight, a = 0, h = 0;
|
|
4733
4733
|
if (s) {
|
|
4734
4734
|
r = s.width, o = s.height;
|
|
4735
|
-
const
|
|
4736
|
-
(!
|
|
4735
|
+
const c = Dt();
|
|
4736
|
+
(!c || c && t === "fixed") && (a = s.offsetLeft, h = s.offsetTop);
|
|
4737
4737
|
}
|
|
4738
4738
|
return {
|
|
4739
4739
|
width: r,
|
|
4740
4740
|
height: o,
|
|
4741
4741
|
x: a,
|
|
4742
|
-
y:
|
|
4742
|
+
y: h
|
|
4743
4743
|
};
|
|
4744
4744
|
}
|
|
4745
4745
|
function ki(n, t) {
|
|
4746
|
-
const e = ot(n, !0, t === "fixed"), i = e.top + n.clientTop, s = e.left + n.clientLeft, r = N(n) ? Z(n) : V(1), o = n.clientWidth * r.x, a = n.clientHeight * r.y,
|
|
4746
|
+
const e = ot(n, !0, t === "fixed"), i = e.top + n.clientTop, s = e.left + n.clientLeft, r = N(n) ? Z(n) : V(1), o = n.clientWidth * r.x, a = n.clientHeight * r.y, h = s * r.x, c = i * r.y;
|
|
4747
4747
|
return {
|
|
4748
4748
|
width: o,
|
|
4749
4749
|
height: a,
|
|
4750
|
-
x:
|
|
4751
|
-
y:
|
|
4750
|
+
x: h,
|
|
4751
|
+
y: c
|
|
4752
4752
|
};
|
|
4753
4753
|
}
|
|
4754
|
-
function
|
|
4754
|
+
function $t(n, t, e) {
|
|
4755
4755
|
let i;
|
|
4756
4756
|
if (t === "viewport")
|
|
4757
4757
|
i = Fi(n, e);
|
|
@@ -4760,7 +4760,7 @@ function Ut(n, t, e) {
|
|
|
4760
4760
|
else if (X(t))
|
|
4761
4761
|
i = ki(t, e);
|
|
4762
4762
|
else {
|
|
4763
|
-
const s =
|
|
4763
|
+
const s = de(n);
|
|
4764
4764
|
i = {
|
|
4765
4765
|
...t,
|
|
4766
4766
|
x: t.x - s.x,
|
|
@@ -4769,9 +4769,9 @@ function Ut(n, t, e) {
|
|
|
4769
4769
|
}
|
|
4770
4770
|
return ut(i);
|
|
4771
4771
|
}
|
|
4772
|
-
function
|
|
4772
|
+
function fe(n, t) {
|
|
4773
4773
|
const e = z(n);
|
|
4774
|
-
return e === t || !X(e) || Q(e) ? !1 : F(e).position === "fixed" ||
|
|
4774
|
+
return e === t || !X(e) || Q(e) ? !1 : F(e).position === "fixed" || fe(e, t);
|
|
4775
4775
|
}
|
|
4776
4776
|
function Ni(n, t) {
|
|
4777
4777
|
const e = t.get(n);
|
|
@@ -4781,8 +4781,8 @@ function Ni(n, t) {
|
|
|
4781
4781
|
const r = F(n).position === "fixed";
|
|
4782
4782
|
let o = r ? z(n) : n;
|
|
4783
4783
|
for (; X(o) && !Q(o); ) {
|
|
4784
|
-
const a = F(o),
|
|
4785
|
-
!
|
|
4784
|
+
const a = F(o), h = Ht(o);
|
|
4785
|
+
!h && a.position === "fixed" && (s = null), (r ? !h && !s : !h && a.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && fe(n, o)) ? i = i.filter((f) => f !== o) : s = a, o = z(o);
|
|
4786
4786
|
}
|
|
4787
4787
|
return t.set(n, i), i;
|
|
4788
4788
|
}
|
|
@@ -4793,22 +4793,22 @@ function Yi(n) {
|
|
|
4793
4793
|
rootBoundary: i,
|
|
4794
4794
|
strategy: s
|
|
4795
4795
|
} = n;
|
|
4796
|
-
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0],
|
|
4797
|
-
const d =
|
|
4798
|
-
return
|
|
4799
|
-
},
|
|
4796
|
+
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], a = o[0], h = o.reduce((c, f) => {
|
|
4797
|
+
const d = $t(t, f, s);
|
|
4798
|
+
return c.top = U(d.top, c.top), c.right = rt(d.right, c.right), c.bottom = rt(d.bottom, c.bottom), c.left = U(d.left, c.left), c;
|
|
4799
|
+
}, $t(t, a, s));
|
|
4800
4800
|
return {
|
|
4801
|
-
width:
|
|
4802
|
-
height:
|
|
4803
|
-
x:
|
|
4804
|
-
y:
|
|
4801
|
+
width: h.right - h.left,
|
|
4802
|
+
height: h.bottom - h.top,
|
|
4803
|
+
x: h.left,
|
|
4804
|
+
y: h.top
|
|
4805
4805
|
};
|
|
4806
4806
|
}
|
|
4807
4807
|
function Ki(n) {
|
|
4808
4808
|
const {
|
|
4809
4809
|
width: t,
|
|
4810
4810
|
height: e
|
|
4811
|
-
} =
|
|
4811
|
+
} = he(n);
|
|
4812
4812
|
return {
|
|
4813
4813
|
width: t,
|
|
4814
4814
|
height: e
|
|
@@ -4820,19 +4820,19 @@ function Bi(n, t, e) {
|
|
|
4820
4820
|
scrollLeft: 0,
|
|
4821
4821
|
scrollTop: 0
|
|
4822
4822
|
};
|
|
4823
|
-
const
|
|
4823
|
+
const h = V(0);
|
|
4824
4824
|
if (i || !i && !r)
|
|
4825
|
-
if ((tt(t) !== "body" ||
|
|
4825
|
+
if ((tt(t) !== "body" || ht(s)) && (a = pt(t)), i) {
|
|
4826
4826
|
const u = ot(t, !0, r, t);
|
|
4827
|
-
|
|
4828
|
-
} else s && (
|
|
4829
|
-
let
|
|
4827
|
+
h.x = u.x + t.clientLeft, h.y = u.y + t.clientTop;
|
|
4828
|
+
} else s && (h.x = At(s));
|
|
4829
|
+
let c = 0, f = 0;
|
|
4830
4830
|
if (s && !i && !r) {
|
|
4831
4831
|
const u = s.getBoundingClientRect();
|
|
4832
|
-
f = u.top + a.scrollTop,
|
|
4832
|
+
f = u.top + a.scrollTop, c = u.left + a.scrollLeft - // RTL <body> scrollbar.
|
|
4833
4833
|
At(s, u);
|
|
4834
4834
|
}
|
|
4835
|
-
const d = o.left + a.scrollLeft -
|
|
4835
|
+
const d = o.left + a.scrollLeft - h.x - c, x = o.top + a.scrollTop - h.y - f;
|
|
4836
4836
|
return {
|
|
4837
4837
|
x: d,
|
|
4838
4838
|
y: x,
|
|
@@ -4843,7 +4843,7 @@ function Bi(n, t, e) {
|
|
|
4843
4843
|
function mt(n) {
|
|
4844
4844
|
return F(n).position === "static";
|
|
4845
4845
|
}
|
|
4846
|
-
function
|
|
4846
|
+
function qt(n, t) {
|
|
4847
4847
|
if (!N(n) || F(n).position === "fixed")
|
|
4848
4848
|
return null;
|
|
4849
4849
|
if (t)
|
|
@@ -4851,7 +4851,7 @@ function Zt(n, t) {
|
|
|
4851
4851
|
let e = n.offsetParent;
|
|
4852
4852
|
return K(n) === e && (e = e.ownerDocument.body), e;
|
|
4853
4853
|
}
|
|
4854
|
-
function
|
|
4854
|
+
function xe(n, t) {
|
|
4855
4855
|
const e = H(n);
|
|
4856
4856
|
if (wt(n))
|
|
4857
4857
|
return e;
|
|
@@ -4864,13 +4864,13 @@ function pe(n, t) {
|
|
|
4864
4864
|
}
|
|
4865
4865
|
return e;
|
|
4866
4866
|
}
|
|
4867
|
-
let i =
|
|
4867
|
+
let i = qt(n, t);
|
|
4868
4868
|
for (; i && Si(i) && mt(i); )
|
|
4869
|
-
i =
|
|
4869
|
+
i = qt(i, t);
|
|
4870
4870
|
return i && Q(i) && mt(i) && !Ht(i) ? e : i || Ai(n) || e;
|
|
4871
4871
|
}
|
|
4872
4872
|
const Wi = async function(n) {
|
|
4873
|
-
const t = this.getOffsetParent ||
|
|
4873
|
+
const t = this.getOffsetParent || xe, e = this.getDimensions, i = await e(n.floating);
|
|
4874
4874
|
return {
|
|
4875
4875
|
reference: Bi(n.reference, await t(n.floating), n.strategy),
|
|
4876
4876
|
floating: {
|
|
@@ -4888,14 +4888,14 @@ const Vi = {
|
|
|
4888
4888
|
convertOffsetParentRelativeRectToViewportRelativeRect: Hi,
|
|
4889
4889
|
getDocumentElement: K,
|
|
4890
4890
|
getClippingRect: Yi,
|
|
4891
|
-
getOffsetParent:
|
|
4891
|
+
getOffsetParent: xe,
|
|
4892
4892
|
getElementRects: Wi,
|
|
4893
4893
|
getClientRects: Di,
|
|
4894
4894
|
getDimensions: Ki,
|
|
4895
4895
|
getScale: Z,
|
|
4896
4896
|
isElement: X,
|
|
4897
4897
|
isRTL: Pi
|
|
4898
|
-
},
|
|
4898
|
+
}, ue = Oi, ge = Ti, we = _i, zi = Ri, pe = (n, t, e) => {
|
|
4899
4899
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
4900
4900
|
platform: Vi,
|
|
4901
4901
|
...e
|
|
@@ -4929,7 +4929,7 @@ let $i = class {
|
|
|
4929
4929
|
borderRadius: "4px",
|
|
4930
4930
|
fontSize: "12px",
|
|
4931
4931
|
...r
|
|
4932
|
-
},
|
|
4932
|
+
}, h = {
|
|
4933
4933
|
position: "absolute",
|
|
4934
4934
|
width: "10px",
|
|
4935
4935
|
height: "10px",
|
|
@@ -4938,7 +4938,7 @@ let $i = class {
|
|
|
4938
4938
|
transform: "rotate(45deg)",
|
|
4939
4939
|
zIndex: a.zIndex
|
|
4940
4940
|
};
|
|
4941
|
-
Object.assign(this.arrowEl.style,
|
|
4941
|
+
Object.assign(this.arrowEl.style, h), Object.assign(this.floatingEl.style, a), this.floatingEl.appendChild(this.contentEl), this.floatingEl.appendChild(this.arrowEl), this.ctx.containerElement.appendChild(this.floatingEl), this.init();
|
|
4942
4942
|
}
|
|
4943
4943
|
init() {
|
|
4944
4944
|
this.ctx.on("mousemove", (t) => {
|
|
@@ -4965,7 +4965,7 @@ let $i = class {
|
|
|
4965
4965
|
return;
|
|
4966
4966
|
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;
|
|
4967
4967
|
const s = t.drawX + i.x, r = t.drawY + i.y;
|
|
4968
|
-
|
|
4968
|
+
pe({
|
|
4969
4969
|
getBoundingClientRect() {
|
|
4970
4970
|
return {
|
|
4971
4971
|
width: t.visibleWidth,
|
|
@@ -4980,12 +4980,12 @@ let $i = class {
|
|
|
4980
4980
|
}
|
|
4981
4981
|
}, this.floatingEl, {
|
|
4982
4982
|
placement: t.overflowTooltipPlacement,
|
|
4983
|
-
middleware: [
|
|
4983
|
+
middleware: [ge(), we(), ue(6), zi({ element: this.arrowEl })]
|
|
4984
4984
|
}).then((a) => {
|
|
4985
|
-
const { x:
|
|
4985
|
+
const { x: h, y: c, placement: f, middlewareData: d } = a;
|
|
4986
4986
|
if (Object.assign(this.floatingEl.style, {
|
|
4987
|
-
top: `${
|
|
4988
|
-
left: `${
|
|
4987
|
+
top: `${c}px`,
|
|
4988
|
+
left: `${h}px`
|
|
4989
4989
|
}), d.arrow) {
|
|
4990
4990
|
const x = d.arrow;
|
|
4991
4991
|
["left", "left-start", "left-end"].includes(f) ? Object.assign(this.arrowEl.style, {
|
|
@@ -5026,6 +5026,8 @@ class qi {
|
|
|
5026
5026
|
l(this, "enable", !1);
|
|
5027
5027
|
l(this, "cellTarget", null);
|
|
5028
5028
|
l(this, "ctx");
|
|
5029
|
+
l(this, "drawY", 0);
|
|
5030
|
+
l(this, "drawX", 0);
|
|
5029
5031
|
this.ctx = t, this.initTextEditor(), this.init();
|
|
5030
5032
|
}
|
|
5031
5033
|
init() {
|
|
@@ -5091,50 +5093,41 @@ class qi {
|
|
|
5091
5093
|
}), this.editorEl = this.ctx.editorElement, this.inputEl.className = "e-virt-table-editor-textarea", this.editorEl.appendChild(this.inputEl), this.ctx.containerElement.appendChild(this.editorEl);
|
|
5092
5094
|
}
|
|
5093
5095
|
autoSize() {
|
|
5094
|
-
|
|
5095
|
-
this.inputEl.style.height = "auto"
|
|
5096
|
+
let t = this.inputEl.scrollHeight;
|
|
5097
|
+
this.inputEl.style.height = "auto";
|
|
5098
|
+
let e = this.ctx.body.visibleHeight;
|
|
5099
|
+
t > e && (t = e);
|
|
5100
|
+
const {
|
|
5101
|
+
stageHeight: i,
|
|
5102
|
+
footer: s,
|
|
5103
|
+
header: r,
|
|
5104
|
+
config: { SCROLLER_TRACK_SIZE: o }
|
|
5105
|
+
} = this.ctx, a = i - s.height - o;
|
|
5106
|
+
this.editorEl.style.bottom = "auto", (this.drawY + t > a || this.drawY < r.height) && (this.editorEl.style.left = `${this.drawX}px`, this.editorEl.style.top = "auto", this.editorEl.style.bottom = `${i - a}px`), this.inputEl.style.height = `${t}px`;
|
|
5096
5107
|
}
|
|
5097
5108
|
startEditByInput(t) {
|
|
5098
|
-
const e = t.getValue(), { width: i } = t,
|
|
5099
|
-
let
|
|
5109
|
+
const e = t.getValue(), { width: i, editorType: s } = t, r = t.getDrawX();
|
|
5110
|
+
let o = t.getDrawY();
|
|
5111
|
+
this.drawX = r, this.drawY = o;
|
|
5112
|
+
let { height: a } = t;
|
|
5100
5113
|
const {
|
|
5101
|
-
config: { CELL_PADDING:
|
|
5114
|
+
config: { CELL_PADDING: h },
|
|
5115
|
+
header: c
|
|
5102
5116
|
} = this.ctx;
|
|
5103
|
-
let
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
width: 0,
|
|
5110
|
-
height: 0,
|
|
5111
|
-
top: d,
|
|
5112
|
-
left: x,
|
|
5113
|
-
right: 0,
|
|
5114
|
-
bottom: 0
|
|
5115
|
-
}),
|
|
5116
|
-
contextElement: document.body
|
|
5117
|
-
};
|
|
5118
|
-
if (Nt(u, this.editorEl, {
|
|
5119
|
-
placement: "right-start",
|
|
5120
|
-
middleware: [Xt(), Ft(), kt()]
|
|
5121
|
-
}).then(({ x: g, y: w }) => {
|
|
5122
|
-
this.editorEl.style.left = `${g}px`, this.editorEl.style.top = `${w}px`;
|
|
5123
|
-
}), t.editorType !== "text") {
|
|
5117
|
+
let f = this.ctx.body.visibleHeight;
|
|
5118
|
+
if (a > f && (a = f), this.editorEl.style.left = `${r}px`, this.editorEl.style.top = `${o}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text") {
|
|
5119
|
+
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${a - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${i - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${h}px`, e !== null && (this.inputEl.value = e), this.inputEl.focus();
|
|
5120
|
+
const d = this.inputEl.value.length;
|
|
5121
|
+
this.inputEl.setSelectionRange(d, d);
|
|
5122
|
+
} else
|
|
5124
5123
|
this.inputEl.style.display = "none";
|
|
5125
|
-
|
|
5126
|
-
}
|
|
5127
|
-
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.maxHeight = `${c}px`, this.inputEl.style.width = `${i - 1}px`, this.inputEl.style.height = `${o - 1}px`, this.inputEl.style.padding = `${a}px`, e !== null && (this.inputEl.value = e), requestAnimationFrame(() => {
|
|
5128
|
-
this.inputEl.focus();
|
|
5129
|
-
const g = this.inputEl.value.length;
|
|
5130
|
-
this.inputEl.setSelectionRange(g, g), this.inputEl.scrollHeight > o && this.autoSize();
|
|
5131
|
-
});
|
|
5124
|
+
(this.inputEl.scrollHeight > a || o < c.height) && this.autoSize();
|
|
5132
5125
|
}
|
|
5133
5126
|
doneEditByInput() {
|
|
5134
|
-
if (
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5127
|
+
if (this.cellTarget && (this.editorEl.style.left = "-10000px", this.editorEl.style.top = "-10000px", this.editorEl.style.bottom = "atuo", this.cellTarget.editorType === "text")) {
|
|
5128
|
+
const { rowKey: t, key: e } = this.cellTarget, i = this.cellTarget.getValue(), s = this.inputEl.value;
|
|
5129
|
+
s !== i && !(s === "" && i === null) && this.ctx.database.setItemValue(t, e, s, !0, !0, !0), this.inputEl.value = "";
|
|
5130
|
+
}
|
|
5138
5131
|
}
|
|
5139
5132
|
startEdit() {
|
|
5140
5133
|
const { ENABLE_EDIT_CLICK_SELECTOR: t } = this.ctx.config;
|
|
@@ -5147,21 +5140,21 @@ class qi {
|
|
|
5147
5140
|
e && !r && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = e, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
5148
5141
|
}
|
|
5149
5142
|
editCell(t, e) {
|
|
5150
|
-
const i = this.ctx.body.renderRows.find((
|
|
5143
|
+
const i = this.ctx.body.renderRows.find((c) => c.rowIndex === t);
|
|
5151
5144
|
if (!i)
|
|
5152
5145
|
return;
|
|
5153
|
-
const s = i.cells.find((
|
|
5146
|
+
const s = i.cells.find((c) => c.colIndex === e);
|
|
5154
5147
|
if (!s)
|
|
5155
5148
|
return;
|
|
5156
5149
|
this.ctx.emit("setSelectorCell", s);
|
|
5157
5150
|
const r = this.ctx.focusCell;
|
|
5158
5151
|
if (!r || ["index", "index-selection", "selection"].includes(r.type) || this.enable)
|
|
5159
5152
|
return;
|
|
5160
|
-
const { rowKey: o, key: a } = r,
|
|
5161
|
-
r && !
|
|
5153
|
+
const { rowKey: o, key: a } = r, h = this.ctx.database.getReadonly(o, a);
|
|
5154
|
+
r && !h && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = r, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
5162
5155
|
}
|
|
5163
5156
|
doneEdit() {
|
|
5164
|
-
this.enable && this.cellTarget && (this.ctx.emit("doneEdit", this.cellTarget), this.
|
|
5157
|
+
this.enable && this.cellTarget && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.stageElement.focus(), this.ctx.editing = !1, this.cellTarget = null, this.ctx.emit("draw"));
|
|
5165
5158
|
}
|
|
5166
5159
|
destroy() {
|
|
5167
5160
|
var t;
|
|
@@ -5174,10 +5167,10 @@ class Gi {
|
|
|
5174
5167
|
l(this, "emptyEl");
|
|
5175
5168
|
this.ctx = t;
|
|
5176
5169
|
const { EMPTY_TEXT: e, EMPTY_CUSTOM: i, EMPTY_CUSTOM_STYLE: s, CSS_PREFIX: r } = this.ctx.config;
|
|
5177
|
-
this.emptyEl = document.createElement("div"), this.emptyEl.className = `${r}-empty`, this.emptyEl.style.display = "none", this.emptyEl.innerText = e, this.ctx.containerElement.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: o, headerHeight: a, bodyHeight:
|
|
5170
|
+
this.emptyEl = document.createElement("div"), this.emptyEl.className = `${r}-empty`, this.emptyEl.style.display = "none", this.emptyEl.innerText = e, this.ctx.containerElement.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: o, headerHeight: a, bodyHeight: h, footerHeight: c }) => {
|
|
5178
5171
|
if (i)
|
|
5179
5172
|
return;
|
|
5180
|
-
const f = a + (
|
|
5173
|
+
const f = a + (h + c) / 2, d = {
|
|
5181
5174
|
display: o === "empty" ? "block" : "none",
|
|
5182
5175
|
position: "absolute",
|
|
5183
5176
|
fontSize: "14px",
|
|
@@ -5210,26 +5203,11 @@ class ji {
|
|
|
5210
5203
|
});
|
|
5211
5204
|
}
|
|
5212
5205
|
getContainer() {
|
|
5213
|
-
const
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
let h = [o, a, c];
|
|
5219
|
-
const { FOOTER_FIXED: f } = this.ctx.config;
|
|
5220
|
-
return f || (h = [o, a]), {
|
|
5221
|
-
style: {
|
|
5222
|
-
position: "absolute",
|
|
5223
|
-
left: "0px",
|
|
5224
|
-
top: "0px",
|
|
5225
|
-
userSelect: "none",
|
|
5226
|
-
overflow: "hidden",
|
|
5227
|
-
width: `${s}px`,
|
|
5228
|
-
height: `${r}px`,
|
|
5229
|
-
zIndex: 10
|
|
5230
|
-
},
|
|
5231
|
-
class: "e-virt-table-overlayer",
|
|
5232
|
-
views: h
|
|
5206
|
+
const t = this.getHeader(), e = this.getBody(), i = this.getFooter();
|
|
5207
|
+
let s = [t, e, i];
|
|
5208
|
+
const { FOOTER_FIXED: r } = this.ctx.config;
|
|
5209
|
+
return r || (s = [t, e]), {
|
|
5210
|
+
views: s
|
|
5233
5211
|
};
|
|
5234
5212
|
}
|
|
5235
5213
|
getHeader() {
|
|
@@ -5238,9 +5216,9 @@ class ji {
|
|
|
5238
5216
|
fixedRightWidth: e,
|
|
5239
5217
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
5240
5218
|
} = this.ctx, { visibleWidth: r, visibleHeight: o, renderCellHeaders: a } = this.ctx.header;
|
|
5241
|
-
let
|
|
5219
|
+
let h = [], c = [], f = [];
|
|
5242
5220
|
a.forEach((p) => {
|
|
5243
|
-
p.render && (p.fixed === "left" ?
|
|
5221
|
+
p.render && (p.fixed === "left" ? c.push(p) : p.fixed === "right" ? f.push(p) : h.push(p));
|
|
5244
5222
|
});
|
|
5245
5223
|
const d = e - i, x = {
|
|
5246
5224
|
key: "left",
|
|
@@ -5252,7 +5230,7 @@ class ji {
|
|
|
5252
5230
|
width: `${t}px`,
|
|
5253
5231
|
height: `${o}px`
|
|
5254
5232
|
},
|
|
5255
|
-
cells:
|
|
5233
|
+
cells: c
|
|
5256
5234
|
}, u = {
|
|
5257
5235
|
key: "center",
|
|
5258
5236
|
style: {
|
|
@@ -5263,7 +5241,7 @@ class ji {
|
|
|
5263
5241
|
width: `${r - t - d + 1}px`,
|
|
5264
5242
|
height: `${o}px`
|
|
5265
5243
|
},
|
|
5266
|
-
cells:
|
|
5244
|
+
cells: h
|
|
5267
5245
|
}, g = {
|
|
5268
5246
|
key: "right",
|
|
5269
5247
|
style: {
|
|
@@ -5299,8 +5277,8 @@ class ji {
|
|
|
5299
5277
|
const {
|
|
5300
5278
|
fixedLeftWidth: r,
|
|
5301
5279
|
fixedRightWidth: o,
|
|
5302
|
-
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX:
|
|
5303
|
-
} = this.ctx, { visibleWidth:
|
|
5280
|
+
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX: h }
|
|
5281
|
+
} = this.ctx, { visibleWidth: c, visibleHeight: f } = this.ctx.body, d = o - a, x = {
|
|
5304
5282
|
key: "left",
|
|
5305
5283
|
style: {
|
|
5306
5284
|
position: "absolute",
|
|
@@ -5318,7 +5296,7 @@ class ji {
|
|
|
5318
5296
|
top: `${0.5}px`,
|
|
5319
5297
|
left: `${r - 0.5}px`,
|
|
5320
5298
|
overflow: "hidden",
|
|
5321
|
-
width: `${
|
|
5299
|
+
width: `${c - r - d}px`,
|
|
5322
5300
|
height: `${f}px`
|
|
5323
5301
|
},
|
|
5324
5302
|
cells: t
|
|
@@ -5336,11 +5314,11 @@ class ji {
|
|
|
5336
5314
|
};
|
|
5337
5315
|
return {
|
|
5338
5316
|
type: "body",
|
|
5339
|
-
class: `${
|
|
5317
|
+
class: `${h}-overlayer-body`,
|
|
5340
5318
|
style: {
|
|
5341
5319
|
position: "relative",
|
|
5342
5320
|
overflow: "hidden",
|
|
5343
|
-
width: `${
|
|
5321
|
+
width: `${c}px`,
|
|
5344
5322
|
height: `${f}px`
|
|
5345
5323
|
},
|
|
5346
5324
|
views: [x, u, g]
|
|
@@ -5357,7 +5335,7 @@ class ji {
|
|
|
5357
5335
|
fixedLeftWidth: s,
|
|
5358
5336
|
fixedRightWidth: r,
|
|
5359
5337
|
config: { SCROLLER_TRACK_SIZE: o, CSS_PREFIX: a }
|
|
5360
|
-
} = this.ctx, { visibleWidth:
|
|
5338
|
+
} = this.ctx, { visibleWidth: h, visibleHeight: c } = this.ctx.footer, f = r - o, d = {
|
|
5361
5339
|
key: "left",
|
|
5362
5340
|
style: {
|
|
5363
5341
|
position: "absolute",
|
|
@@ -5365,7 +5343,7 @@ class ji {
|
|
|
5365
5343
|
left: `${0.5}px`,
|
|
5366
5344
|
overflow: "hidden",
|
|
5367
5345
|
width: `${s}px`,
|
|
5368
|
-
height: `${
|
|
5346
|
+
height: `${c}px`
|
|
5369
5347
|
},
|
|
5370
5348
|
cells: e
|
|
5371
5349
|
}, x = {
|
|
@@ -5375,8 +5353,8 @@ class ji {
|
|
|
5375
5353
|
top: `${0.5}px`,
|
|
5376
5354
|
left: `${s - 0.5}px`,
|
|
5377
5355
|
overflow: "hidden",
|
|
5378
|
-
width: `${
|
|
5379
|
-
height: `${
|
|
5356
|
+
width: `${h - s - f}px`,
|
|
5357
|
+
height: `${c}px`
|
|
5380
5358
|
},
|
|
5381
5359
|
cells: t
|
|
5382
5360
|
}, u = {
|
|
@@ -5387,7 +5365,7 @@ class ji {
|
|
|
5387
5365
|
right: `${0.5}px`,
|
|
5388
5366
|
overflow: "hidden",
|
|
5389
5367
|
width: `${f}px`,
|
|
5390
|
-
height: `${
|
|
5368
|
+
height: `${c}px`
|
|
5391
5369
|
},
|
|
5392
5370
|
cells: i
|
|
5393
5371
|
};
|
|
@@ -5397,8 +5375,8 @@ class ji {
|
|
|
5397
5375
|
style: {
|
|
5398
5376
|
position: "relative",
|
|
5399
5377
|
overflow: "hidden",
|
|
5400
|
-
width: `${
|
|
5401
|
-
height: `${
|
|
5378
|
+
width: `${h}px`,
|
|
5379
|
+
height: `${c}px`
|
|
5402
5380
|
},
|
|
5403
5381
|
views: [d, x, u]
|
|
5404
5382
|
};
|
|
@@ -5414,8 +5392,8 @@ class Ui {
|
|
|
5414
5392
|
this.ctx.on("cellContextMenuClick", (t, e) => {
|
|
5415
5393
|
if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
|
|
5416
5394
|
e.preventDefault();
|
|
5417
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a,
|
|
5418
|
-
|
|
5395
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [a, h] = s, { rowIndex: c, colIndex: f } = t;
|
|
5396
|
+
c >= a && c <= h && f >= r && f <= o || this.ctx.emit("setSelectorCell", t, e);
|
|
5419
5397
|
const x = {
|
|
5420
5398
|
getBoundingClientRect: () => ({
|
|
5421
5399
|
width: 0,
|
|
@@ -5429,9 +5407,9 @@ class Ui {
|
|
|
5429
5407
|
}),
|
|
5430
5408
|
contextElement: document.body
|
|
5431
5409
|
};
|
|
5432
|
-
|
|
5410
|
+
pe(x, this.contextMenuEl, {
|
|
5433
5411
|
placement: "right-start",
|
|
5434
|
-
middleware: [
|
|
5412
|
+
middleware: [ue(), ge(), we()]
|
|
5435
5413
|
}).then(({ x: u, y: g }) => {
|
|
5436
5414
|
this.show(u, g);
|
|
5437
5415
|
});
|
|
@@ -5504,7 +5482,7 @@ class Qi {
|
|
|
5504
5482
|
l(this, "ctx");
|
|
5505
5483
|
this.options = e;
|
|
5506
5484
|
const { overlayerElement: i, editorElement: s } = e, r = this.createContainer(t, i, s);
|
|
5507
|
-
this.ctx = new
|
|
5485
|
+
this.ctx = new hi(r, this.options), this.header = new di(this.ctx), this.body = new fi(this.ctx), this.footer = new xi(this.ctx), this.scroller = new ci(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", () => {
|
|
5508
5486
|
this.draw();
|
|
5509
5487
|
}), this.ctx.on("drawView", () => {
|
|
5510
5488
|
this.draw(!0);
|
|
@@ -5585,8 +5563,8 @@ class Qi {
|
|
|
5585
5563
|
if (t && Array.isArray(s) && s.length) {
|
|
5586
5564
|
const [r] = s;
|
|
5587
5565
|
if (Array.isArray(r) && r.length) {
|
|
5588
|
-
const [o] = r, { rowKey: a, key:
|
|
5589
|
-
this.scrollToRowkey(a), this.scrollToColkey(
|
|
5566
|
+
const [o] = r, { rowKey: a, key: h } = o;
|
|
5567
|
+
this.scrollToRowkey(a), this.scrollToColkey(h);
|
|
5590
5568
|
}
|
|
5591
5569
|
}
|
|
5592
5570
|
i(s);
|
|
@@ -5611,7 +5589,7 @@ class Qi {
|
|
|
5611
5589
|
let r = [];
|
|
5612
5590
|
for (let o = 0; o < i.length; o++)
|
|
5613
5591
|
for (let a = 0; a < s.length; a++) {
|
|
5614
|
-
const
|
|
5592
|
+
const h = this.ctx.database.getRowKeyByItem(i[o]), f = s[a].key, d = await this.ctx.database.getValidator(h, f);
|
|
5615
5593
|
Array.isArray(d) && d.length && r.push(d);
|
|
5616
5594
|
}
|
|
5617
5595
|
r.length ? (e(r), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
|