e-virt-table 1.1.2 → 1.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 +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +823 -674
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Autofill.d.ts +1 -0
- package/dist/lib/Autofill.js +30 -11
- package/dist/lib/Autofill.js.map +1 -1
- package/dist/lib/BaseCell.js +1 -1
- package/dist/lib/BaseCell.js.map +1 -1
- package/dist/lib/Body.d.ts +1 -1
- package/dist/lib/Body.js +21 -3
- package/dist/lib/Body.js.map +1 -1
- package/dist/lib/Cell.d.ts +2 -1
- package/dist/lib/Cell.js +77 -57
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/CellHeader.js +3 -2
- package/dist/lib/CellHeader.js.map +1 -1
- package/dist/lib/Config.d.ts +4 -0
- package/dist/lib/Config.js +24 -0
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Context.d.ts +1 -0
- package/dist/lib/Context.js +10 -9
- package/dist/lib/Context.js.map +1 -1
- package/dist/lib/Database.d.ts +7 -4
- package/dist/lib/Database.js +184 -90
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/EVirtTable.d.ts +1 -0
- package/dist/lib/EVirtTable.js +5 -2
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/Editor.js +10 -4
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/EventBrowser.d.ts +1 -0
- package/dist/lib/EventBrowser.js +8 -6
- package/dist/lib/EventBrowser.js.map +1 -1
- package/dist/lib/EventTable.js +1 -1
- package/dist/lib/EventTable.js.map +1 -1
- package/dist/lib/Footer.d.ts +2 -1
- package/dist/lib/Footer.js +18 -3
- package/dist/lib/Footer.js.map +1 -1
- package/dist/lib/Header.d.ts +2 -1
- package/dist/lib/Header.js +24 -3
- package/dist/lib/Header.js.map +1 -1
- package/dist/lib/Row.d.ts +2 -1
- package/dist/lib/Row.js +5 -3
- package/dist/lib/Row.js.map +1 -1
- package/dist/lib/Scroller.js +13 -9
- package/dist/lib/Scroller.js.map +1 -1
- package/dist/lib/Selector.js +6 -2
- package/dist/lib/Selector.js.map +1 -1
- package/dist/lib/Tooltip.js +12 -2
- package/dist/lib/Tooltip.js.map +1 -1
- package/dist/lib/types.d.ts +7 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -43,13 +43,13 @@ function dt(a, t, e) {
|
|
|
43
43
|
return o && st(c, o.prototype), c;
|
|
44
44
|
}, dt.apply(null, arguments);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function _e(a) {
|
|
47
47
|
return Function.toString.call(a).indexOf("[native code]") !== -1;
|
|
48
48
|
}
|
|
49
49
|
function Ct(a) {
|
|
50
50
|
var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
51
51
|
return Ct = function(i) {
|
|
52
|
-
if (i === null || !
|
|
52
|
+
if (i === null || !_e(i)) return i;
|
|
53
53
|
if (typeof i != "function")
|
|
54
54
|
throw new TypeError("Super expression must either be null or a function");
|
|
55
55
|
if (typeof t < "u") {
|
|
@@ -69,7 +69,7 @@ function Ct(a) {
|
|
|
69
69
|
}), st(s, i);
|
|
70
70
|
}, Ct(a);
|
|
71
71
|
}
|
|
72
|
-
var
|
|
72
|
+
var Ie = /%[sdj%]/g, jt = function() {
|
|
73
73
|
};
|
|
74
74
|
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (jt = function(t, e) {
|
|
75
75
|
typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && e.every(function(i) {
|
|
@@ -91,7 +91,7 @@ function D(a) {
|
|
|
91
91
|
if (typeof a == "function")
|
|
92
92
|
return a.apply(null, e);
|
|
93
93
|
if (typeof a == "string") {
|
|
94
|
-
var o = a.replace(
|
|
94
|
+
var o = a.replace(Ie, function(n) {
|
|
95
95
|
if (n === "%%")
|
|
96
96
|
return "%";
|
|
97
97
|
if (s >= r)
|
|
@@ -143,13 +143,13 @@ function Xt(a, t, e) {
|
|
|
143
143
|
}
|
|
144
144
|
r([]);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Le(a) {
|
|
147
147
|
var t = [];
|
|
148
148
|
return Object.keys(a).forEach(function(e) {
|
|
149
149
|
t.push.apply(t, a[e] || []);
|
|
150
150
|
}), t;
|
|
151
151
|
}
|
|
152
|
-
var
|
|
152
|
+
var Nt = /* @__PURE__ */ function(a) {
|
|
153
153
|
ve(t, a);
|
|
154
154
|
function t(e, i) {
|
|
155
155
|
var s;
|
|
@@ -157,33 +157,33 @@ var kt = /* @__PURE__ */ function(a) {
|
|
|
157
157
|
}
|
|
158
158
|
return t;
|
|
159
159
|
}(/* @__PURE__ */ Ct(Error));
|
|
160
|
-
function
|
|
160
|
+
function Ae(a, t, e, i, s) {
|
|
161
161
|
if (t.first) {
|
|
162
|
-
var r = new Promise(function(x,
|
|
162
|
+
var r = new Promise(function(x, g) {
|
|
163
163
|
var p = function(y) {
|
|
164
|
-
return i(y), y.length ?
|
|
165
|
-
},
|
|
166
|
-
Xt(
|
|
164
|
+
return i(y), y.length ? g(new Nt(y, bt(y))) : x(s);
|
|
165
|
+
}, u = Le(a);
|
|
166
|
+
Xt(u, e, p);
|
|
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(a) : t.firstFields || [], n = Object.keys(a), h = n.length, c = 0, d = [], f = new Promise(function(x,
|
|
172
|
+
var o = t.firstFields === !0 ? Object.keys(a) : t.firstFields || [], n = Object.keys(a), h = n.length, c = 0, d = [], f = new Promise(function(x, g) {
|
|
173
173
|
var p = function(w) {
|
|
174
174
|
if (d.push.apply(d, w), c++, c === h)
|
|
175
|
-
return i(d), d.length ?
|
|
175
|
+
return i(d), d.length ? g(new Nt(d, bt(d))) : x(s);
|
|
176
176
|
};
|
|
177
|
-
n.length || (i(d), x(s)), n.forEach(function(
|
|
178
|
-
var w = a[
|
|
179
|
-
o.indexOf(
|
|
177
|
+
n.length || (i(d), x(s)), n.forEach(function(u) {
|
|
178
|
+
var w = a[u];
|
|
179
|
+
o.indexOf(u) !== -1 ? Xt(w, e, p) : Se(w, e, p);
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
182
|
return f.catch(function(x) {
|
|
183
183
|
return x;
|
|
184
184
|
}), f;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function Te(a) {
|
|
187
187
|
return !!(a && a.message !== void 0);
|
|
188
188
|
}
|
|
189
189
|
function Me(a, t) {
|
|
@@ -194,17 +194,17 @@ function Me(a, t) {
|
|
|
194
194
|
}
|
|
195
195
|
return e;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function Bt(a, t) {
|
|
198
198
|
return function(e) {
|
|
199
199
|
var i;
|
|
200
|
-
return a.fullFields ? i = Me(t, a.fullFields) : i = t[e.field || a.fullField],
|
|
200
|
+
return a.fullFields ? i = Me(t, a.fullFields) : i = t[e.field || a.fullField], Te(e) ? (e.field = e.field || a.fullField, e.fieldValue = i, e) : {
|
|
201
201
|
message: typeof e == "function" ? e() : e,
|
|
202
202
|
fieldValue: i,
|
|
203
203
|
field: e.field || a.fullField
|
|
204
204
|
};
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function kt(a, t) {
|
|
208
208
|
if (t) {
|
|
209
209
|
for (var e in t)
|
|
210
210
|
if (t.hasOwnProperty(e)) {
|
|
@@ -221,8 +221,8 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
221
221
|
}, ct, De = function() {
|
|
222
222
|
if (ct)
|
|
223
223
|
return ct;
|
|
224
|
-
var a = "[a-fA-F\\d:]", t = function(
|
|
225
|
-
return
|
|
224
|
+
var a = "[a-fA-F\\d:]", t = function(E) {
|
|
225
|
+
return E && E.includeBoundaries ? "(?:(?<=\\s|^)(?=" + a + ")|(?<=" + a + ")(?=\\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 = (`
|
|
227
227
|
(?:
|
|
228
228
|
(?:` + i + ":){7}(?:" + i + `|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
@@ -234,17 +234,17 @@ var Ut = 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 + "$"), n = new RegExp("^" + s + "$"), h = function(
|
|
238
|
-
return
|
|
237
|
+
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), n = new RegExp("^" + s + "$"), h = function(E) {
|
|
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 ? n : new RegExp("" + t(m) + s + t(m), "g");
|
|
244
244
|
};
|
|
245
|
-
var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source, x = h.v6().source,
|
|
246
|
-
return ct = new RegExp("(?:^" +
|
|
247
|
-
},
|
|
245
|
+
var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source, x = h.v6().source, g = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", p = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", u = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", y = '(?:[/?#][^\\s"]*)?', C = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + x + "|" + g + p + u + ")" + w + y;
|
|
246
|
+
return ct = new RegExp("(?:^" + C + "$)", "i"), ct;
|
|
247
|
+
}, Kt = {
|
|
248
248
|
// http://emailregex.com/
|
|
249
249
|
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
|
|
250
250
|
// url: new RegExp(
|
|
@@ -284,13 +284,13 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
284
284
|
return typeof t == "function";
|
|
285
285
|
},
|
|
286
286
|
email: function(t) {
|
|
287
|
-
return typeof t == "string" && t.length <= 320 && !!t.match(
|
|
287
|
+
return typeof t == "string" && t.length <= 320 && !!t.match(Kt.email);
|
|
288
288
|
},
|
|
289
289
|
url: function(t) {
|
|
290
290
|
return typeof t == "string" && t.length <= 2048 && !!t.match(De());
|
|
291
291
|
},
|
|
292
292
|
hex: function(t) {
|
|
293
|
-
return typeof t == "string" && !!t.match(
|
|
293
|
+
return typeof t == "string" && !!t.match(Kt.hex);
|
|
294
294
|
}
|
|
295
295
|
}, Fe = function(t, e, i, s, r) {
|
|
296
296
|
if (t.required && e === void 0) {
|
|
@@ -300,13 +300,13 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
300
300
|
var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], n = t.type;
|
|
301
301
|
o.indexOf(n) > -1 ? et[n](e) || s.push(D(r.messages.types[n], t.fullField, t.type)) : n && typeof e !== t.type && s.push(D(r.messages.types[n], t.fullField, t.type));
|
|
302
302
|
}, Xe = function(t, e, i, s, r) {
|
|
303
|
-
var o = typeof t.len == "number", n = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null, x = typeof e == "number",
|
|
304
|
-
if (x ? f = "number" :
|
|
303
|
+
var o = typeof t.len == "number", n = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null, x = typeof e == "number", g = typeof e == "string", p = Array.isArray(e);
|
|
304
|
+
if (x ? f = "number" : g ? f = "string" : p && (f = "array"), !f)
|
|
305
305
|
return !1;
|
|
306
|
-
p && (d = e.length),
|
|
307
|
-
}, j = "enum",
|
|
306
|
+
p && (d = e.length), g && (d = e.replace(c, "_").length), o ? d !== t.len && s.push(D(r.messages[f].len, t.fullField, t.len)) : n && !h && d < t.min ? s.push(D(r.messages[f].min, t.fullField, t.min)) : h && !n && d > t.max ? s.push(D(r.messages[f].max, t.fullField, t.max)) : n && h && (d < t.min || d > t.max) && s.push(D(r.messages[f].range, t.fullField, t.min, t.max));
|
|
307
|
+
}, j = "enum", Ne = function(t, e, i, s, r) {
|
|
308
308
|
t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(D(r.messages[j], t.fullField, t[j].join(", ")));
|
|
309
|
-
},
|
|
309
|
+
}, Be = function(t, e, i, s, r) {
|
|
310
310
|
if (t.pattern) {
|
|
311
311
|
if (t.pattern instanceof RegExp)
|
|
312
312
|
t.pattern.lastIndex = 0, t.pattern.test(e) || s.push(D(r.messages.pattern.mismatch, t.fullField, e, t.pattern));
|
|
@@ -315,27 +315,27 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
315
315
|
o.test(e) || s.push(D(r.messages.pattern.mismatch, t.fullField, e, t.pattern));
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
},
|
|
318
|
+
}, I = {
|
|
319
319
|
required: Ut,
|
|
320
320
|
whitespace: He,
|
|
321
321
|
type: Fe,
|
|
322
322
|
range: Xe,
|
|
323
|
-
enum:
|
|
324
|
-
pattern:
|
|
325
|
-
},
|
|
323
|
+
enum: Ne,
|
|
324
|
+
pattern: Be
|
|
325
|
+
}, ke = function(t, e, i, s, r) {
|
|
326
326
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
327
327
|
if (n) {
|
|
328
328
|
if (H(e, "string") && !t.required)
|
|
329
329
|
return i();
|
|
330
|
-
|
|
330
|
+
I.required(t, e, s, o, r, "string"), H(e, "string") || (I.type(t, e, s, o, r), I.range(t, e, s, o, r), I.pattern(t, e, s, o, r), t.whitespace === !0 && I.whitespace(t, e, s, o, r));
|
|
331
331
|
}
|
|
332
332
|
i(o);
|
|
333
|
-
},
|
|
333
|
+
}, Ke = function(t, e, i, s, r) {
|
|
334
334
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
335
335
|
if (n) {
|
|
336
336
|
if (H(e) && !t.required)
|
|
337
337
|
return i();
|
|
338
|
-
|
|
338
|
+
I.required(t, e, s, o, r), e !== void 0 && I.type(t, e, s, o, r);
|
|
339
339
|
}
|
|
340
340
|
i(o);
|
|
341
341
|
}, Ye = function(t, e, i, s, r) {
|
|
@@ -343,7 +343,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
343
343
|
if (n) {
|
|
344
344
|
if (e === "" && (e = void 0), H(e) && !t.required)
|
|
345
345
|
return i();
|
|
346
|
-
|
|
346
|
+
I.required(t, e, s, o, r), e !== void 0 && (I.type(t, e, s, o, r), I.range(t, e, s, o, r));
|
|
347
347
|
}
|
|
348
348
|
i(o);
|
|
349
349
|
}, Ve = function(t, e, i, s, r) {
|
|
@@ -351,7 +351,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
351
351
|
if (n) {
|
|
352
352
|
if (H(e) && !t.required)
|
|
353
353
|
return i();
|
|
354
|
-
|
|
354
|
+
I.required(t, e, s, o, r), e !== void 0 && I.type(t, e, s, o, r);
|
|
355
355
|
}
|
|
356
356
|
i(o);
|
|
357
357
|
}, We = function(t, e, i, s, r) {
|
|
@@ -359,7 +359,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
359
359
|
if (n) {
|
|
360
360
|
if (H(e) && !t.required)
|
|
361
361
|
return i();
|
|
362
|
-
|
|
362
|
+
I.required(t, e, s, o, r), H(e) || I.type(t, e, s, o, r);
|
|
363
363
|
}
|
|
364
364
|
i(o);
|
|
365
365
|
}, Pe = function(t, e, i, s, r) {
|
|
@@ -367,7 +367,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
367
367
|
if (n) {
|
|
368
368
|
if (H(e) && !t.required)
|
|
369
369
|
return i();
|
|
370
|
-
|
|
370
|
+
I.required(t, e, s, o, r), e !== void 0 && (I.type(t, e, s, o, r), I.range(t, e, s, o, r));
|
|
371
371
|
}
|
|
372
372
|
i(o);
|
|
373
373
|
}, ze = function(t, e, i, s, r) {
|
|
@@ -375,7 +375,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
375
375
|
if (n) {
|
|
376
376
|
if (H(e) && !t.required)
|
|
377
377
|
return i();
|
|
378
|
-
|
|
378
|
+
I.required(t, e, s, o, r), e !== void 0 && (I.type(t, e, s, o, r), I.range(t, e, s, o, r));
|
|
379
379
|
}
|
|
380
380
|
i(o);
|
|
381
381
|
}, $e = function(t, e, i, s, r) {
|
|
@@ -383,7 +383,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
383
383
|
if (n) {
|
|
384
384
|
if (e == null && !t.required)
|
|
385
385
|
return i();
|
|
386
|
-
|
|
386
|
+
I.required(t, e, s, o, r, "array"), e != null && (I.type(t, e, s, o, r), I.range(t, e, s, o, r));
|
|
387
387
|
}
|
|
388
388
|
i(o);
|
|
389
389
|
}, Ge = function(t, e, i, s, r) {
|
|
@@ -391,7 +391,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
391
391
|
if (n) {
|
|
392
392
|
if (H(e) && !t.required)
|
|
393
393
|
return i();
|
|
394
|
-
|
|
394
|
+
I.required(t, e, s, o, r), e !== void 0 && I.type(t, e, s, o, r);
|
|
395
395
|
}
|
|
396
396
|
i(o);
|
|
397
397
|
}, qe = "enum", je = function(t, e, i, s, r) {
|
|
@@ -399,7 +399,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
399
399
|
if (n) {
|
|
400
400
|
if (H(e) && !t.required)
|
|
401
401
|
return i();
|
|
402
|
-
|
|
402
|
+
I.required(t, e, s, o, r), e !== void 0 && I[qe](t, e, s, o, r);
|
|
403
403
|
}
|
|
404
404
|
i(o);
|
|
405
405
|
}, Ue = function(t, e, i, s, r) {
|
|
@@ -407,7 +407,7 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
407
407
|
if (n) {
|
|
408
408
|
if (H(e, "string") && !t.required)
|
|
409
409
|
return i();
|
|
410
|
-
|
|
410
|
+
I.required(t, e, s, o, r), H(e, "string") || I.pattern(t, e, s, o, r);
|
|
411
411
|
}
|
|
412
412
|
i(o);
|
|
413
413
|
}, Ze = function(t, e, i, s, r) {
|
|
@@ -415,21 +415,21 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
415
415
|
if (n) {
|
|
416
416
|
if (H(e, "date") && !t.required)
|
|
417
417
|
return i();
|
|
418
|
-
if (
|
|
418
|
+
if (I.required(t, e, s, o, r), !H(e, "date")) {
|
|
419
419
|
var h;
|
|
420
|
-
e instanceof Date ? h = e : h = new Date(e),
|
|
420
|
+
e instanceof Date ? h = e : h = new Date(e), I.type(t, h, s, o, r), h && I.range(t, h.getTime(), s, o, r);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
i(o);
|
|
424
424
|
}, Je = function(t, e, i, s, r) {
|
|
425
425
|
var o = [], n = Array.isArray(e) ? "array" : typeof e;
|
|
426
|
-
|
|
426
|
+
I.required(t, e, s, o, r, n), i(o);
|
|
427
427
|
}, yt = function(t, e, i, s, r) {
|
|
428
428
|
var o = t.type, n = [], h = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
429
429
|
if (h) {
|
|
430
430
|
if (H(e, o) && !t.required)
|
|
431
431
|
return i();
|
|
432
|
-
|
|
432
|
+
I.required(t, e, s, n, r, o), H(e, o) || I.type(t, e, s, n, r);
|
|
433
433
|
}
|
|
434
434
|
i(n);
|
|
435
435
|
}, Qe = function(t, e, i, s, r) {
|
|
@@ -437,12 +437,12 @@ var Ut = function(t, e, i, s, r, o) {
|
|
|
437
437
|
if (n) {
|
|
438
438
|
if (H(e) && !t.required)
|
|
439
439
|
return i();
|
|
440
|
-
|
|
440
|
+
I.required(t, e, s, o, r);
|
|
441
441
|
}
|
|
442
442
|
i(o);
|
|
443
443
|
}, it = {
|
|
444
|
-
string:
|
|
445
|
-
method:
|
|
444
|
+
string: ke,
|
|
445
|
+
method: Ke,
|
|
446
446
|
number: Ye,
|
|
447
447
|
boolean: Ve,
|
|
448
448
|
regexp: We,
|
|
@@ -528,7 +528,7 @@ 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 = kt(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() {
|
|
@@ -536,97 +536,97 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
536
536
|
var n = i, h = s, c = r;
|
|
537
537
|
if (typeof h == "function" && (c = h, h = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
538
538
|
return c && c(null, n), Promise.resolve(n);
|
|
539
|
-
function d(
|
|
539
|
+
function d(u) {
|
|
540
540
|
var w = [], y = {};
|
|
541
|
-
function E
|
|
542
|
-
if (Array.isArray(
|
|
541
|
+
function C(E) {
|
|
542
|
+
if (Array.isArray(E)) {
|
|
543
543
|
var b;
|
|
544
|
-
w = (b = w).concat.apply(b,
|
|
544
|
+
w = (b = w).concat.apply(b, E);
|
|
545
545
|
} else
|
|
546
|
-
w.push(
|
|
546
|
+
w.push(E);
|
|
547
547
|
}
|
|
548
|
-
for (var m = 0; m <
|
|
549
|
-
|
|
548
|
+
for (var m = 0; m < u.length; m++)
|
|
549
|
+
C(u[m]);
|
|
550
550
|
w.length ? (y = bt(w), c(w, y)) : c(null, n);
|
|
551
551
|
}
|
|
552
552
|
if (h.messages) {
|
|
553
553
|
var f = this.messages();
|
|
554
|
-
f === Rt && (f = vt()),
|
|
554
|
+
f === Rt && (f = vt()), kt(f, h.messages), h.messages = f;
|
|
555
555
|
} else
|
|
556
556
|
h.messages = this.messages();
|
|
557
|
-
var x = {},
|
|
558
|
-
|
|
559
|
-
var w = o.rules[
|
|
560
|
-
w.forEach(function(
|
|
561
|
-
var m =
|
|
562
|
-
typeof m.transform == "function" && (n === i && (n = G({}, n)), y = n[
|
|
557
|
+
var x = {}, g = h.keys || Object.keys(this.rules);
|
|
558
|
+
g.forEach(function(u) {
|
|
559
|
+
var w = o.rules[u], y = n[u];
|
|
560
|
+
w.forEach(function(C) {
|
|
561
|
+
var m = C;
|
|
562
|
+
typeof m.transform == "function" && (n === i && (n = G({}, n)), y = n[u] = m.transform(y)), typeof m == "function" ? m = {
|
|
563
563
|
validator: m
|
|
564
|
-
} : m = G({}, m), m.validator = o.getValidationMethod(m), m.validator && (m.field =
|
|
564
|
+
} : m = G({}, m), m.validator = o.getValidationMethod(m), m.validator && (m.field = u, m.fullField = m.fullField || u, m.type = o.getType(m), x[u] = x[u] || [], x[u].push({
|
|
565
565
|
rule: m,
|
|
566
566
|
value: y,
|
|
567
567
|
source: n,
|
|
568
|
-
field:
|
|
568
|
+
field: u
|
|
569
569
|
}));
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
572
|
var p = {};
|
|
573
|
-
return
|
|
574
|
-
var y =
|
|
575
|
-
|
|
576
|
-
function m(R,
|
|
577
|
-
return G({},
|
|
573
|
+
return Ae(x, h, function(u, w) {
|
|
574
|
+
var y = u.rule, C = (y.type === "object" || y.type === "array") && (typeof y.fields == "object" || typeof y.defaultField == "object");
|
|
575
|
+
C = C && (y.required || !y.required && u.value), y.field = u.field;
|
|
576
|
+
function m(R, O) {
|
|
577
|
+
return G({}, O, {
|
|
578
578
|
fullField: y.fullField + "." + R,
|
|
579
579
|
fullFields: y.fullFields ? [].concat(y.fullFields, [R]) : [R]
|
|
580
580
|
});
|
|
581
581
|
}
|
|
582
|
-
function
|
|
582
|
+
function E(R) {
|
|
583
583
|
R === void 0 && (R = []);
|
|
584
|
-
var
|
|
585
|
-
!h.suppressWarning &&
|
|
586
|
-
var
|
|
587
|
-
if (h.first &&
|
|
588
|
-
return p[y.field] = 1, w(
|
|
589
|
-
if (!
|
|
590
|
-
w(
|
|
584
|
+
var O = Array.isArray(R) ? R : [R];
|
|
585
|
+
!h.suppressWarning && O.length && a.warning("async-validator:", O), O.length && y.message !== void 0 && (O = [].concat(y.message));
|
|
586
|
+
var L = O.map(Bt(y, n));
|
|
587
|
+
if (h.first && L.length)
|
|
588
|
+
return p[y.field] = 1, w(L);
|
|
589
|
+
if (!C)
|
|
590
|
+
w(L);
|
|
591
591
|
else {
|
|
592
|
-
if (y.required && !
|
|
593
|
-
return y.message !== void 0 ?
|
|
594
|
-
var
|
|
595
|
-
y.defaultField && Object.keys(
|
|
596
|
-
|
|
597
|
-
}),
|
|
592
|
+
if (y.required && !u.value)
|
|
593
|
+
return y.message !== void 0 ? L = [].concat(y.message).map(Bt(y, n)) : h.error && (L = [h.error(y, D(h.messages.required, y.field))]), w(L);
|
|
594
|
+
var _ = {};
|
|
595
|
+
y.defaultField && Object.keys(u.value).map(function(S) {
|
|
596
|
+
_[S] = y.defaultField;
|
|
597
|
+
}), _ = G({}, _, u.rule.fields);
|
|
598
598
|
var v = {};
|
|
599
|
-
Object.keys(
|
|
600
|
-
var M =
|
|
601
|
-
v[
|
|
599
|
+
Object.keys(_).forEach(function(S) {
|
|
600
|
+
var M = _[S], T = Array.isArray(M) ? M : [M];
|
|
601
|
+
v[S] = T.map(m.bind(null, S));
|
|
602
602
|
});
|
|
603
|
-
var
|
|
604
|
-
|
|
603
|
+
var A = new a(v);
|
|
604
|
+
A.messages(h.messages), u.rule.options && (u.rule.options.messages = h.messages, u.rule.options.error = h.error), A.validate(u.value, u.rule.options || h, function(S) {
|
|
605
605
|
var M = [];
|
|
606
|
-
|
|
606
|
+
L && L.length && M.push.apply(M, L), S && S.length && M.push.apply(M, S), w(M.length ? M : null);
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
610
|
var b;
|
|
611
611
|
if (y.asyncValidator)
|
|
612
|
-
b = y.asyncValidator(y,
|
|
612
|
+
b = y.asyncValidator(y, u.value, E, u.source, h);
|
|
613
613
|
else if (y.validator) {
|
|
614
614
|
try {
|
|
615
|
-
b = y.validator(y,
|
|
615
|
+
b = y.validator(y, u.value, E, u.source, h);
|
|
616
616
|
} catch (R) {
|
|
617
617
|
console.error == null || console.error(R), h.suppressValidatorError || setTimeout(function() {
|
|
618
618
|
throw R;
|
|
619
|
-
}, 0),
|
|
619
|
+
}, 0), E(R.message);
|
|
620
620
|
}
|
|
621
|
-
b === !0 ?
|
|
621
|
+
b === !0 ? E() : b === !1 ? E(typeof y.message == "function" ? y.message(y.fullField || y.field) : y.message || (y.fullField || y.field) + " fails") : b instanceof Array ? E(b) : b instanceof Error && E(b.message);
|
|
622
622
|
}
|
|
623
623
|
b && b.then && b.then(function() {
|
|
624
|
-
return
|
|
624
|
+
return E();
|
|
625
625
|
}, function(R) {
|
|
626
|
-
return
|
|
626
|
+
return E(R);
|
|
627
627
|
});
|
|
628
|
-
}, function(
|
|
629
|
-
d(
|
|
628
|
+
}, function(u) {
|
|
629
|
+
d(u);
|
|
630
630
|
}, n);
|
|
631
631
|
}, t.getType = function(i) {
|
|
632
632
|
if (i.type === void 0 && i.pattern instanceof RegExp && (i.type = "pattern"), typeof i.validator != "function" && i.type && !it.hasOwnProperty(i.type))
|
|
@@ -702,10 +702,10 @@ function te(a = [], t = 1, e = 0) {
|
|
|
702
702
|
};
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function _t(a = []) {
|
|
706
706
|
let t = [];
|
|
707
707
|
return a.forEach((e) => {
|
|
708
|
-
e.children ? t = t.concat(
|
|
708
|
+
e.children ? t = t.concat(_t(e.children)) : t.push(e);
|
|
709
709
|
}), t;
|
|
710
710
|
}
|
|
711
711
|
const Yt = /^(\r\n|\n\r|\r|\n)/, ei = /^[^\t\r\n]+/, Vt = /^\t/;
|
|
@@ -826,7 +826,7 @@ class se {
|
|
|
826
826
|
stageWidth: t,
|
|
827
827
|
config: { SCROLLER_TRACK_SIZE: e }
|
|
828
828
|
} = this.ctx;
|
|
829
|
-
return t - (this.ctx.header.width - this.x) - e
|
|
829
|
+
return t - (this.ctx.header.width - this.x) - e;
|
|
830
830
|
}
|
|
831
831
|
return this.x - this.ctx.scrollX;
|
|
832
832
|
}
|
|
@@ -843,7 +843,7 @@ class se {
|
|
|
843
843
|
getRightFixedX() {
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
|
-
class
|
|
846
|
+
class Tt extends se {
|
|
847
847
|
constructor(e, i, s, r, o, n, h, c, d, f = "body") {
|
|
848
848
|
super(e, r, o, n, h, f, c.fixed);
|
|
849
849
|
l(this, "formatter");
|
|
@@ -1017,19 +1017,19 @@ class Lt extends se {
|
|
|
1017
1017
|
if (this.type === "tree" && s === "body") {
|
|
1018
1018
|
const h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: d = !1, expandLoading: f = !1, level: x = 0 } = h || {};
|
|
1019
1019
|
if (this.rowExpand = c, this.rowHasChildren = d, f) {
|
|
1020
|
-
const
|
|
1021
|
-
n = "loading", r =
|
|
1020
|
+
const u = this.ctx.icons.get("loading");
|
|
1021
|
+
n = "loading", r = u, o = x * 8;
|
|
1022
1022
|
} else if (d) {
|
|
1023
|
-
const
|
|
1024
|
-
r = c ? w :
|
|
1023
|
+
const u = this.ctx.icons.get("expand"), w = this.ctx.icons.get("shrink");
|
|
1024
|
+
r = c ? w : u, n = c ? "shrink" : "expand", o = x * 8;
|
|
1025
1025
|
} else
|
|
1026
1026
|
o = x * 8;
|
|
1027
|
-
let
|
|
1027
|
+
let g = 20, p = 20;
|
|
1028
1028
|
if (r) {
|
|
1029
|
-
let
|
|
1030
|
-
this.ctx.paint.drawImage(r,
|
|
1029
|
+
let u = this.drawX + o + e, w = this.drawY + (this.visibleHeight - p) / 2;
|
|
1030
|
+
this.ctx.paint.drawImage(r, u, w, g, p), this.drawImageX = u, this.drawImageY = w, this.drawImageWidth = g, this.drawImageHeight = p, this.drawImageName = n, this.drawImageSource = r;
|
|
1031
1031
|
}
|
|
1032
|
-
this.align = "left", this.drawTextX = o + this.drawX +
|
|
1032
|
+
this.align = "left", this.drawTextX = o + this.drawX + g - 0.5;
|
|
1033
1033
|
}
|
|
1034
1034
|
}
|
|
1035
1035
|
updateContainer() {
|
|
@@ -1043,33 +1043,35 @@ class Lt extends se {
|
|
|
1043
1043
|
HIGHLIGHT_SELECTED_ROW: h,
|
|
1044
1044
|
HIGHLIGHT_SELECTED_ROW_COLOR: c,
|
|
1045
1045
|
HIGHLIGHT_HOVER_ROW: d,
|
|
1046
|
-
HIGHLIGHT_HOVER_ROW_COLOR: f
|
|
1046
|
+
HIGHLIGHT_HOVER_ROW_COLOR: f,
|
|
1047
|
+
STRIPE: x,
|
|
1048
|
+
STRIPE_COLOR: g
|
|
1047
1049
|
} = this.ctx.config;
|
|
1048
1050
|
if (this.cellType === "footer") {
|
|
1049
|
-
let
|
|
1051
|
+
let m = n, E = o;
|
|
1050
1052
|
if (typeof r == "function") {
|
|
1051
|
-
const
|
|
1053
|
+
const b = r, { backgroundColor: R, color: O } = b({
|
|
1052
1054
|
row: this.row,
|
|
1053
1055
|
rowIndex: this.rowIndex,
|
|
1054
1056
|
colIndex: this.colIndex,
|
|
1055
1057
|
column: this.column,
|
|
1056
1058
|
value: this.getValue()
|
|
1057
1059
|
}) || {};
|
|
1058
|
-
|
|
1060
|
+
R && (m = R), O && (E = O);
|
|
1059
1061
|
}
|
|
1060
|
-
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor =
|
|
1062
|
+
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = m, this.drawTextColor = E;
|
|
1061
1063
|
return;
|
|
1062
1064
|
}
|
|
1063
|
-
let
|
|
1064
|
-
const u = this.ctx.focusCell,
|
|
1065
|
-
d && (
|
|
1066
|
-
let
|
|
1065
|
+
let p = "transparent";
|
|
1066
|
+
const u = this.ctx.focusCell, w = this.ctx.hoverCell;
|
|
1067
|
+
d && (w == null ? void 0 : w.rowKey) === this.rowKey && (p = f), h && (u == null ? void 0 : u.rowKey) === this.rowKey && (p = c), this.drawCellSkyBgColor = p;
|
|
1068
|
+
let y = e, C = o;
|
|
1067
1069
|
if (["index", "index-selection", "selection"].includes(this.type)) {
|
|
1068
1070
|
this.drawCellBgColor = e, this.drawTextColor = o;
|
|
1069
1071
|
return;
|
|
1070
1072
|
}
|
|
1071
|
-
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (
|
|
1072
|
-
const
|
|
1073
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (y = i, C = o), x && (this.rowIndex % 2 ? y = g : y = e), typeof s == "function") {
|
|
1074
|
+
const m = s, { backgroundColor: E, color: b } = m({
|
|
1073
1075
|
row: this.row,
|
|
1074
1076
|
rowIndex: this.rowIndex,
|
|
1075
1077
|
colIndex: this.colIndex,
|
|
@@ -1077,16 +1079,16 @@ class Lt extends se {
|
|
|
1077
1079
|
isHasChanged: this.isHasChanged,
|
|
1078
1080
|
value: this.getValue()
|
|
1079
1081
|
}) || {};
|
|
1080
|
-
E && (
|
|
1082
|
+
E && (y = E), b && (C = b);
|
|
1081
1083
|
}
|
|
1082
|
-
this.drawCellBgColor =
|
|
1084
|
+
this.drawCellBgColor = y, this.drawTextColor = C;
|
|
1083
1085
|
}
|
|
1084
1086
|
updateSelection() {
|
|
1085
1087
|
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: n, rowIndex: h, rowKey: c } = this;
|
|
1086
1088
|
if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(n)) {
|
|
1087
|
-
const d = this.ctx.database.getRowSelection(c), f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: x = 0 } = this.ctx.config,
|
|
1088
|
-
let
|
|
1089
|
-
d && f ? (
|
|
1089
|
+
const d = this.ctx.database.getRowSelection(c), f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: x = 0 } = this.ctx.config, g = this.drawX + (e - x) / 2, p = this.drawY + (i - x) / 2;
|
|
1090
|
+
let u = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck";
|
|
1091
|
+
d && f ? (u = this.ctx.icons.get("checkbox-check"), w = "checkbox-check") : d && f ? (u = this.ctx.icons.get("checkbox-check-disabled"), w = "checkbox-check-disabled") : !d && f ? (u = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck") : (u = this.ctx.icons.get("checkbox-disabled"), w = "checkbox-disabled"), u && n == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === h || ["checkbox-disabled", "checkbox-check"].includes(w)) && (this.drawImageX = g, this.drawImageY = p, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = u) : u && n === "selection" && (this.drawImageX = g, this.drawImageY = p, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = u);
|
|
1090
1092
|
}
|
|
1091
1093
|
}
|
|
1092
1094
|
updateHoverIcon() {
|
|
@@ -1171,19 +1173,45 @@ class Lt extends se {
|
|
|
1171
1173
|
userSelect: "none"
|
|
1172
1174
|
};
|
|
1173
1175
|
}
|
|
1174
|
-
|
|
1176
|
+
drawContainer() {
|
|
1175
1177
|
const {
|
|
1176
1178
|
paint: e,
|
|
1177
|
-
config: { BORDER_COLOR: i }
|
|
1178
|
-
} = this.ctx, { drawX:
|
|
1179
|
-
e.drawRect(
|
|
1180
|
-
borderColor: i,
|
|
1179
|
+
config: { BORDER_COLOR: i, BORDER: s }
|
|
1180
|
+
} = this.ctx, { drawX: r, drawY: o } = this;
|
|
1181
|
+
e.drawRect(r, o, this.visibleWidth, this.visibleHeight, {
|
|
1182
|
+
borderColor: s ? i : "transparent",
|
|
1181
1183
|
fillColor: this.drawCellBgColor
|
|
1182
|
-
}), e.drawRect(
|
|
1184
|
+
}), e.drawRect(r, o, this.width, this.height, {
|
|
1183
1185
|
borderColor: "transparent",
|
|
1184
|
-
borderWidth: 1,
|
|
1185
1186
|
fillColor: this.drawCellSkyBgColor
|
|
1186
|
-
}),
|
|
1187
|
+
}), s || this.ctx.paint.drawLine(
|
|
1188
|
+
[r, o + this.visibleHeight, r + this.visibleWidth, o + this.visibleHeight],
|
|
1189
|
+
{
|
|
1190
|
+
borderColor: i,
|
|
1191
|
+
fillColor: i,
|
|
1192
|
+
borderWidth: 1,
|
|
1193
|
+
lineCap: "round",
|
|
1194
|
+
lineJoin: "round"
|
|
1195
|
+
}
|
|
1196
|
+
);
|
|
1197
|
+
}
|
|
1198
|
+
drawAutofillPiont() {
|
|
1199
|
+
if (this.cellType === "footer")
|
|
1200
|
+
return;
|
|
1201
|
+
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: r } = this.ctx.config;
|
|
1202
|
+
if (!s || !i || this.ctx.editing)
|
|
1203
|
+
return;
|
|
1204
|
+
const { xArr: o, yArr: n } = this.ctx.selector, h = o[1], c = n[1], { colIndex: d, rowIndex: f, drawX: x, drawY: g } = this;
|
|
1205
|
+
if (d === h && f === c) {
|
|
1206
|
+
const u = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
|
|
1207
|
+
this.ctx.paint.drawRect(x + this.width - u, g + this.height - u, 6, 6, {
|
|
1208
|
+
borderColor: r,
|
|
1209
|
+
fillColor: e
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
draw() {
|
|
1214
|
+
this.drawText(), this.drawImage(), this.drawSelector(), this.drawAutofillPiont(), this.drawErrorTip();
|
|
1187
1215
|
}
|
|
1188
1216
|
/**
|
|
1189
1217
|
* 根据列的索引获取列的宽度
|
|
@@ -1225,18 +1253,6 @@ class Lt extends se {
|
|
|
1225
1253
|
this.drawImageHeight
|
|
1226
1254
|
);
|
|
1227
1255
|
}
|
|
1228
|
-
drawAutofillPiont() {
|
|
1229
|
-
if (this.cellType === "footer")
|
|
1230
|
-
return;
|
|
1231
|
-
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: r } = this.ctx.config;
|
|
1232
|
-
if (!s || !i)
|
|
1233
|
-
return;
|
|
1234
|
-
const { xArr: o, yArr: n } = this.ctx.selector, h = o[1], c = n[1], { colIndex: d, rowIndex: f, drawX: x, drawY: u } = this;
|
|
1235
|
-
d === h && f === c && this.ctx.paint.drawRect(x + this.width - 6, u + this.height - 6, 6, 6, {
|
|
1236
|
-
borderColor: r,
|
|
1237
|
-
fillColor: e
|
|
1238
|
-
});
|
|
1239
|
-
}
|
|
1240
1256
|
drawSelector() {
|
|
1241
1257
|
if (this.cellType === "footer")
|
|
1242
1258
|
return;
|
|
@@ -1294,39 +1310,53 @@ class Lt extends se {
|
|
|
1294
1310
|
});
|
|
1295
1311
|
}
|
|
1296
1312
|
drawBorder(e) {
|
|
1297
|
-
const { drawX: i, drawY: s,
|
|
1298
|
-
let
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1313
|
+
const { drawX: i, drawY: s, rowIndex: r, colIndex: o, height: n, width: h } = this;
|
|
1314
|
+
let c = i, d = s;
|
|
1315
|
+
const { xArr: f, yArr: x, lineDash: g = [], borderWidth: p = 1, borderColor: u, fillColor: w } = e, y = f[0], C = f[1], m = x[0], E = x[1];
|
|
1316
|
+
if (o >= y && o <= C && r === m) {
|
|
1317
|
+
const b = o === C ? 1 : 0, R = o === y ? 1 : 0;
|
|
1318
|
+
this.ctx.paint.drawLine([c + R, d + 1, c + h - b, d + 1], {
|
|
1319
|
+
borderColor: u,
|
|
1320
|
+
fillColor: w,
|
|
1321
|
+
borderWidth: p,
|
|
1322
|
+
lineCap: "round",
|
|
1323
|
+
lineJoin: "round",
|
|
1324
|
+
lineDash: g
|
|
1325
|
+
});
|
|
1326
|
+
}
|
|
1327
|
+
if (o === C && r >= m && r <= E) {
|
|
1328
|
+
const b = r === m ? 1 : 0, R = r === E ? 1 : 0;
|
|
1329
|
+
this.ctx.paint.drawLine([c + h - 1, d + b, c + h - 1, d + n - R], {
|
|
1330
|
+
borderColor: u,
|
|
1331
|
+
fillColor: w,
|
|
1332
|
+
borderWidth: p,
|
|
1333
|
+
lineCap: "round",
|
|
1334
|
+
lineJoin: "round",
|
|
1335
|
+
lineDash: g
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
if (o >= y && o <= C && r === E) {
|
|
1339
|
+
const b = o === C ? 1 : 0, R = o === y ? 1 : 0;
|
|
1340
|
+
this.ctx.paint.drawLine([c + R, d + n - 1, c + h - b, d + n - 1], {
|
|
1341
|
+
borderColor: u,
|
|
1342
|
+
fillColor: w,
|
|
1343
|
+
borderWidth: p,
|
|
1344
|
+
lineCap: "round",
|
|
1345
|
+
lineJoin: "round",
|
|
1346
|
+
lineDash: g
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1349
|
+
if (o === y && r >= m && r <= E) {
|
|
1350
|
+
const b = r === E ? 1 : 0, R = r === m ? 1 : 0;
|
|
1351
|
+
this.ctx.paint.drawLine([c + 1, d + R, c + 1, d + n - b], {
|
|
1352
|
+
borderColor: u,
|
|
1353
|
+
fillColor: w,
|
|
1354
|
+
borderWidth: p,
|
|
1355
|
+
lineCap: "round",
|
|
1356
|
+
lineJoin: "round",
|
|
1357
|
+
lineDash: g
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1330
1360
|
}
|
|
1331
1361
|
}
|
|
1332
1362
|
class ni {
|
|
@@ -1342,6 +1372,7 @@ class ni {
|
|
|
1342
1372
|
l(this, "headerMap", /* @__PURE__ */ new Map());
|
|
1343
1373
|
l(this, "rowIndexRowKeyMap", /* @__PURE__ */ new Map());
|
|
1344
1374
|
l(this, "checkboxKeyMap", /* @__PURE__ */ new Map());
|
|
1375
|
+
l(this, "selectionMap", /* @__PURE__ */ new Map());
|
|
1345
1376
|
l(this, "originalDataMap", /* @__PURE__ */ new Map());
|
|
1346
1377
|
l(this, "changedDataMap", /* @__PURE__ */ new Map());
|
|
1347
1378
|
l(this, "validationErrorMap", /* @__PURE__ */ new Map());
|
|
@@ -1355,7 +1386,9 @@ class ni {
|
|
|
1355
1386
|
this.data = i, this.footerData = r, this.columns = s, this.setLoading(!0), this.init();
|
|
1356
1387
|
}
|
|
1357
1388
|
init() {
|
|
1358
|
-
this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear(), this.itemRowKeyMap = /* @__PURE__ */ new WeakMap()
|
|
1389
|
+
this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear(), this.itemRowKeyMap = /* @__PURE__ */ new WeakMap();
|
|
1390
|
+
const { ROW_KEY: t, ENABLE_RESERVE_SELECTION: e } = this.ctx.config;
|
|
1391
|
+
e && t || this.selectionMap.clear(), this.initData(this.data), this.getData();
|
|
1359
1392
|
}
|
|
1360
1393
|
/**
|
|
1361
1394
|
* 清除缓存数据
|
|
@@ -1370,28 +1403,33 @@ class ni {
|
|
|
1370
1403
|
*/
|
|
1371
1404
|
initData(t, e = 0) {
|
|
1372
1405
|
t.forEach((i, s) => {
|
|
1406
|
+
var w;
|
|
1373
1407
|
let r = i._hasChildren || !1;
|
|
1374
1408
|
Array.isArray(i.children) && i.children.length && (r = !0, this.initData(i.children, e + 1));
|
|
1375
1409
|
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: d } = this.ctx.config, f = i[o], x = f != null ? `${f}` : Zt();
|
|
1376
1410
|
this.itemRowKeyMap.set(i, x);
|
|
1377
|
-
const
|
|
1378
|
-
let
|
|
1379
|
-
if (typeof c == "function" && (
|
|
1380
|
-
const
|
|
1381
|
-
if (this.checkboxKeyMap.has(
|
|
1382
|
-
const
|
|
1383
|
-
|
|
1411
|
+
const g = i._height || h, p = i._readonly;
|
|
1412
|
+
let u = !0;
|
|
1413
|
+
if (typeof c == "function" && (u = c), d) {
|
|
1414
|
+
const y = i[d];
|
|
1415
|
+
if (this.checkboxKeyMap.has(y)) {
|
|
1416
|
+
const C = this.checkboxKeyMap.get(y) || [];
|
|
1417
|
+
C.push(x), this.checkboxKeyMap.set(y, C);
|
|
1384
1418
|
} else
|
|
1385
|
-
this.checkboxKeyMap.set(
|
|
1419
|
+
this.checkboxKeyMap.set(y, [x]);
|
|
1386
1420
|
}
|
|
1387
|
-
this.
|
|
1421
|
+
this.selectionMap.set(x, {
|
|
1422
|
+
key: d ? i[d] : x,
|
|
1423
|
+
row: i,
|
|
1424
|
+
check: ((w = this.selectionMap.get(x)) == null ? void 0 : w.check) || !1
|
|
1425
|
+
}), this.rowKeyMap.set(x, {
|
|
1388
1426
|
readonly: p,
|
|
1389
1427
|
index: s,
|
|
1390
1428
|
rowIndex: s,
|
|
1391
1429
|
level: e,
|
|
1392
|
-
height:
|
|
1430
|
+
height: g,
|
|
1393
1431
|
check: !1,
|
|
1394
|
-
selectable:
|
|
1432
|
+
selectable: u,
|
|
1395
1433
|
expand: n,
|
|
1396
1434
|
expandLazy: !1,
|
|
1397
1435
|
hasChildren: r,
|
|
@@ -1602,45 +1640,50 @@ class ni {
|
|
|
1602
1640
|
async batchSetItemValue(t, e = !1) {
|
|
1603
1641
|
let i = [];
|
|
1604
1642
|
const s = /* @__PURE__ */ new Set();
|
|
1605
|
-
let r = t
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
const
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
value:
|
|
1612
|
-
oldValue:
|
|
1613
|
-
row:
|
|
1614
|
-
}))
|
|
1615
|
-
|
|
1643
|
+
let r = [], o = t.map((d) => {
|
|
1644
|
+
const { rowKey: f, key: x } = d;
|
|
1645
|
+
let g = d.value, p = g;
|
|
1646
|
+
const u = this.getRowDataItemForRowKey(f), w = this.getItemValue(f, x), y = this.getVirtualBodyCellByKey(f, x);
|
|
1647
|
+
return (y == null ? void 0 : y.type) === "number" && (["", void 0, null].includes(g) ? p = null : /^-?\d+(\.\d+)?$/.test(`${g}`) ? p = Number(g) : (p = w, r.push({
|
|
1648
|
+
...d,
|
|
1649
|
+
value: p,
|
|
1650
|
+
oldValue: w,
|
|
1651
|
+
row: u
|
|
1652
|
+
}))), {
|
|
1653
|
+
...d,
|
|
1654
|
+
value: p,
|
|
1655
|
+
oldValue: w,
|
|
1656
|
+
row: u
|
|
1657
|
+
};
|
|
1658
|
+
});
|
|
1659
|
+
if (o = o.filter((d) => !r.some((f) => d.rowKey === f.rowKey && d.key === f.key)), r.length) {
|
|
1660
|
+
const d = {
|
|
1661
|
+
code: "ERR_BATCH_SET_NUMBER_VALUE",
|
|
1662
|
+
message: "Assignment failed, not a numeric type",
|
|
1663
|
+
data: r
|
|
1664
|
+
};
|
|
1665
|
+
this.ctx.emit("error", d);
|
|
1616
1666
|
}
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1667
|
+
if (!o.length)
|
|
1668
|
+
return;
|
|
1669
|
+
const { BEFORE_VALUE_CHANGE_METHOD: n } = this.ctx.config;
|
|
1670
|
+
typeof n == "function" && (o = await n(o)), o.forEach((d) => {
|
|
1671
|
+
const { value: f, rowKey: x, key: g, oldValue: p } = d;
|
|
1672
|
+
s.add(x), this.setItemValue(x, g, f), i.push({
|
|
1620
1673
|
rowKey: x,
|
|
1621
|
-
key:
|
|
1674
|
+
key: g,
|
|
1622
1675
|
oldValue: p,
|
|
1623
1676
|
newValue: f
|
|
1624
1677
|
});
|
|
1625
1678
|
});
|
|
1626
|
-
let
|
|
1627
|
-
const h = i.map((d) => {
|
|
1628
|
-
const f = this.ctx.database.getRowDataItemForRowKey(d.rowKey);
|
|
1629
|
-
return {
|
|
1630
|
-
rowKey: d.rowKey,
|
|
1631
|
-
key: d.key,
|
|
1632
|
-
value: d.newValue,
|
|
1633
|
-
oldValue: d.oldValue,
|
|
1634
|
-
row: f
|
|
1635
|
-
};
|
|
1636
|
-
});
|
|
1679
|
+
let h = [];
|
|
1637
1680
|
s.forEach((d) => {
|
|
1638
|
-
|
|
1681
|
+
h.push(this.ctx.database.getRowDataItemForRowKey(d));
|
|
1639
1682
|
});
|
|
1640
|
-
const c =
|
|
1683
|
+
const c = o.map(({ rowKey: d, key: f }) => this.getValidator(d, f));
|
|
1641
1684
|
Promise.all(c).then(() => {
|
|
1642
1685
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1643
|
-
}), this.ctx.emit("change",
|
|
1686
|
+
}), this.ctx.emit("change", o, h), e && this.ctx.history.pushState({
|
|
1644
1687
|
changeList: i,
|
|
1645
1688
|
scrollX: this.ctx.scrollX,
|
|
1646
1689
|
scrollY: this.ctx.scrollY,
|
|
@@ -1661,58 +1704,85 @@ class ni {
|
|
|
1661
1704
|
if (!this.rowKeyMap.has(t))
|
|
1662
1705
|
return {};
|
|
1663
1706
|
const { item: n } = this.rowKeyMap.get(t);
|
|
1664
|
-
let h = n[e];
|
|
1707
|
+
let h = n[e], c = i;
|
|
1665
1708
|
if (this.ctx.database.getReadonly(t, e))
|
|
1666
1709
|
return {
|
|
1667
1710
|
oldValue: h,
|
|
1668
1711
|
newValue: h
|
|
1669
1712
|
};
|
|
1670
1713
|
n[e] !== null && typeof n[e] == "object" && (h = JSON.parse(JSON.stringify(n[e])));
|
|
1671
|
-
const
|
|
1672
|
-
this.originalDataMap.has(
|
|
1673
|
-
const
|
|
1674
|
-
let f = i;
|
|
1714
|
+
const d = `${t}_${e}`;
|
|
1715
|
+
this.originalDataMap.has(d) || this.originalDataMap.set(d, h);
|
|
1716
|
+
const f = this.originalDataMap.get(d), x = this.getRowDataItemForRowKey(t);
|
|
1675
1717
|
if (o) {
|
|
1676
|
-
const
|
|
1677
|
-
if (
|
|
1678
|
-
|
|
1718
|
+
const g = this.getVirtualBodyCellByKey(t, e);
|
|
1719
|
+
if ((g == null ? void 0 : g.type) === "number")
|
|
1720
|
+
if (["", void 0, null].includes(i))
|
|
1721
|
+
c = null;
|
|
1722
|
+
else if (/^-?\d+(\.\d+)?$/.test(`${i}`))
|
|
1723
|
+
c = Number(i);
|
|
1724
|
+
else {
|
|
1725
|
+
c = h;
|
|
1726
|
+
const w = {
|
|
1727
|
+
code: "ERR_SET_NUMBER_VALUE",
|
|
1728
|
+
message: "Assignment failed, not a numeric type",
|
|
1729
|
+
data: [
|
|
1730
|
+
{
|
|
1731
|
+
rowKey: t,
|
|
1732
|
+
key: e,
|
|
1733
|
+
value: c,
|
|
1734
|
+
oldValue: h,
|
|
1735
|
+
row: x
|
|
1736
|
+
}
|
|
1737
|
+
]
|
|
1738
|
+
};
|
|
1739
|
+
this.ctx.emit("error", w);
|
|
1740
|
+
}
|
|
1741
|
+
if (c === h)
|
|
1742
|
+
return {
|
|
1743
|
+
oldValue: h,
|
|
1744
|
+
newValue: h
|
|
1745
|
+
};
|
|
1746
|
+
const { BEFORE_VALUE_CHANGE_METHOD: p } = this.ctx.config;
|
|
1747
|
+
if (typeof p == "function") {
|
|
1748
|
+
const y = await p([
|
|
1679
1749
|
{
|
|
1680
1750
|
rowKey: t,
|
|
1681
1751
|
key: e,
|
|
1682
|
-
value:
|
|
1752
|
+
value: c,
|
|
1683
1753
|
oldValue: n[e],
|
|
1684
|
-
row:
|
|
1754
|
+
row: x
|
|
1685
1755
|
}
|
|
1686
1756
|
]);
|
|
1687
|
-
|
|
1757
|
+
y && y.length && (c = y[0].value);
|
|
1688
1758
|
}
|
|
1689
|
-
this.changedDataMap.set(
|
|
1690
|
-
const u =
|
|
1759
|
+
this.changedDataMap.set(d, c), n[e] = c;
|
|
1760
|
+
const u = {
|
|
1691
1761
|
rowKey: t,
|
|
1692
1762
|
key: e,
|
|
1693
1763
|
oldValue: h,
|
|
1694
|
-
value:
|
|
1695
|
-
row:
|
|
1764
|
+
value: c,
|
|
1765
|
+
row: x
|
|
1696
1766
|
};
|
|
1697
1767
|
this.getValidator(t, e).then(() => {
|
|
1698
1768
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1699
|
-
}), this.ctx.emit("change", [
|
|
1769
|
+
}), this.ctx.emit("change", [u], [x]), this.ctx.emit("editChange", {
|
|
1700
1770
|
rowKey: t,
|
|
1701
1771
|
key: e,
|
|
1702
1772
|
oldValue: h,
|
|
1703
|
-
value:
|
|
1704
|
-
originalValue:
|
|
1705
|
-
row:
|
|
1773
|
+
value: c,
|
|
1774
|
+
originalValue: f,
|
|
1775
|
+
row: x
|
|
1706
1776
|
});
|
|
1707
1777
|
} else
|
|
1708
|
-
this.changedDataMap.set(
|
|
1778
|
+
this.changedDataMap.set(d, c), n[e] = c;
|
|
1709
1779
|
return this.ctx.hasEvent("iterationChange") && this.ctx.emit("iterationChange", {
|
|
1710
1780
|
rowKey: t,
|
|
1711
1781
|
key: e,
|
|
1712
1782
|
oldValue: h,
|
|
1713
|
-
value:
|
|
1714
|
-
originalValue: this.originalDataMap.get(
|
|
1715
|
-
row:
|
|
1783
|
+
value: c,
|
|
1784
|
+
originalValue: this.originalDataMap.get(d),
|
|
1785
|
+
row: x
|
|
1716
1786
|
}), s && this.ctx.history.pushState({
|
|
1717
1787
|
type: "single",
|
|
1718
1788
|
scrollX: this.ctx.scrollX,
|
|
@@ -1722,12 +1792,12 @@ class ni {
|
|
|
1722
1792
|
rowKey: t,
|
|
1723
1793
|
key: e,
|
|
1724
1794
|
oldValue: h,
|
|
1725
|
-
newValue:
|
|
1795
|
+
newValue: c
|
|
1726
1796
|
}
|
|
1727
1797
|
]
|
|
1728
1798
|
}), r && this.ctx.emit("draw"), {
|
|
1729
1799
|
oldValue: h,
|
|
1730
|
-
newValue:
|
|
1800
|
+
newValue: c
|
|
1731
1801
|
};
|
|
1732
1802
|
}
|
|
1733
1803
|
/**
|
|
@@ -1753,8 +1823,8 @@ class ni {
|
|
|
1753
1823
|
return !1;
|
|
1754
1824
|
const { item: s } = this.rowKeyMap.get(t), r = s[i];
|
|
1755
1825
|
this.checkboxKeyMap.has(r) && (this.checkboxKeyMap.get(r) || []).forEach((n) => {
|
|
1756
|
-
const h = this.
|
|
1757
|
-
h.check = e;
|
|
1826
|
+
const h = this.selectionMap.get(n);
|
|
1827
|
+
h && (h.check = e);
|
|
1758
1828
|
});
|
|
1759
1829
|
}
|
|
1760
1830
|
}
|
|
@@ -1763,25 +1833,29 @@ class ni {
|
|
|
1763
1833
|
* @param rowKey
|
|
1764
1834
|
*/
|
|
1765
1835
|
toggleRowSelection(t) {
|
|
1766
|
-
const e = this.rowKeyMap.get(t);
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
this.
|
|
1836
|
+
const e = this.rowKeyMap.get(t), i = this.selectionMap.get(t);
|
|
1837
|
+
if (!i)
|
|
1838
|
+
return;
|
|
1839
|
+
i.check = !i.check, this.setRowSelectionByCheckboxKey(t, i.check), this.ctx.emit("toggleRowSelection", e);
|
|
1840
|
+
const s = this.getSelectionRows();
|
|
1841
|
+
this.ctx.emit("selectionChange", s), this.ctx.emit("draw");
|
|
1770
1842
|
}
|
|
1771
1843
|
/**
|
|
1772
1844
|
* 根据rowKey 设置选中状态
|
|
1773
1845
|
* @param rowKey
|
|
1774
1846
|
*/
|
|
1775
|
-
setRowSelection(t, e) {
|
|
1776
|
-
const
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
this.
|
|
1847
|
+
setRowSelection(t, e, i = !0) {
|
|
1848
|
+
const s = this.selectionMap.get(t);
|
|
1849
|
+
if (!s)
|
|
1850
|
+
return;
|
|
1851
|
+
s.check = e, this.setRowSelectionByCheckboxKey(t, s.check);
|
|
1852
|
+
const r = this.getSelectionRows();
|
|
1853
|
+
this.ctx.emit("setRowSelection", r), i && this.ctx.emit("draw");
|
|
1780
1854
|
}
|
|
1781
1855
|
getSelectionRows() {
|
|
1782
1856
|
let t = [];
|
|
1783
|
-
return this.
|
|
1784
|
-
e.check && t.push(e.
|
|
1857
|
+
return this.selectionMap.forEach((e) => {
|
|
1858
|
+
e.check && t.push(e.row);
|
|
1785
1859
|
}), t;
|
|
1786
1860
|
}
|
|
1787
1861
|
/**
|
|
@@ -1789,8 +1863,8 @@ class ni {
|
|
|
1789
1863
|
* @param rowKey
|
|
1790
1864
|
*/
|
|
1791
1865
|
getRowSelection(t) {
|
|
1792
|
-
const
|
|
1793
|
-
return e;
|
|
1866
|
+
const e = this.selectionMap.get(t);
|
|
1867
|
+
return e ? e.check : !1;
|
|
1794
1868
|
}
|
|
1795
1869
|
/**
|
|
1796
1870
|
* 根据rowKey 获取选中状态
|
|
@@ -1808,12 +1882,12 @@ class ni {
|
|
|
1808
1882
|
* @param rowKey
|
|
1809
1883
|
*/
|
|
1810
1884
|
toggleAllSelection() {
|
|
1811
|
-
this.rowKeyMap.forEach((e) => {
|
|
1812
|
-
|
|
1813
|
-
typeof
|
|
1885
|
+
this.rowKeyMap.forEach((e, i) => {
|
|
1886
|
+
let s = e.selectable;
|
|
1887
|
+
typeof s == "function" && (s = s({
|
|
1814
1888
|
row: e.item,
|
|
1815
1889
|
rowIndex: e.rowIndex
|
|
1816
|
-
}) && (
|
|
1890
|
+
})), s && this.setRowSelection(i, !0, !1);
|
|
1817
1891
|
});
|
|
1818
1892
|
const t = this.getSelectionRows();
|
|
1819
1893
|
this.ctx.emit("toggleAllSelection", t), this.ctx.emit("selectionChange", t), this.ctx.emit("draw");
|
|
@@ -1822,36 +1896,37 @@ class ni {
|
|
|
1822
1896
|
* 清除选中
|
|
1823
1897
|
* @param rowKey
|
|
1824
1898
|
*/
|
|
1825
|
-
clearSelection() {
|
|
1826
|
-
this.rowKeyMap.forEach((
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
rowIndex: e.rowIndex
|
|
1831
|
-
}) && (e.check = !1) : i && (e.check = !1);
|
|
1899
|
+
clearSelection(t = !1) {
|
|
1900
|
+
t ? this.rowKeyMap.forEach((i, s) => {
|
|
1901
|
+
this.setRowSelection(s, !1, !1);
|
|
1902
|
+
}) : this.selectionMap.forEach((i, s) => {
|
|
1903
|
+
this.setRowSelection(s, !1, !1);
|
|
1832
1904
|
});
|
|
1833
|
-
const
|
|
1834
|
-
this.ctx.emit("clearSelection"), this.ctx.emit("selectionChange",
|
|
1905
|
+
const e = this.getSelectionRows();
|
|
1906
|
+
this.ctx.emit("clearSelection"), this.ctx.emit("selectionChange", e), this.ctx.emit("draw");
|
|
1835
1907
|
}
|
|
1836
1908
|
/**
|
|
1837
1909
|
* 获取选中状态,表头用
|
|
1838
1910
|
* @param rowKey
|
|
1839
1911
|
*/
|
|
1840
1912
|
getCheckedState() {
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1913
|
+
const t = this.rowKeyMap.size;
|
|
1914
|
+
let e = 0, i = 0;
|
|
1915
|
+
const s = this.selectionMap.size, r = Array.from(this.selectionMap.values()).some((d) => d.check);
|
|
1916
|
+
this.rowKeyMap.forEach((d, f) => {
|
|
1917
|
+
var g;
|
|
1918
|
+
(g = this.selectionMap.get(f)) != null && g.check && (e += 1);
|
|
1919
|
+
let x = d.selectable;
|
|
1920
|
+
typeof x == "function" && (x = x({
|
|
1921
|
+
row: d.item,
|
|
1922
|
+
rowIndex: d.rowIndex
|
|
1923
|
+
})), x && (i += 1);
|
|
1849
1924
|
});
|
|
1850
|
-
const
|
|
1925
|
+
const o = s > t && e === 0 && r, n = i && i > e && e > 0 || o;
|
|
1851
1926
|
return {
|
|
1852
|
-
check:
|
|
1853
|
-
indeterminate:
|
|
1854
|
-
selectable:
|
|
1927
|
+
check: i && i === e,
|
|
1928
|
+
indeterminate: n,
|
|
1929
|
+
selectable: i !== 0
|
|
1855
1930
|
};
|
|
1856
1931
|
}
|
|
1857
1932
|
/**
|
|
@@ -1869,6 +1944,11 @@ class ni {
|
|
|
1869
1944
|
if (e && this.headerMap.has(e))
|
|
1870
1945
|
return (i = this.headerMap.get(e)) == null ? void 0 : i.column;
|
|
1871
1946
|
}
|
|
1947
|
+
getColumnByKey(t) {
|
|
1948
|
+
const e = this.headerMap.get(t);
|
|
1949
|
+
if (e)
|
|
1950
|
+
return e;
|
|
1951
|
+
}
|
|
1872
1952
|
getColIndexForKey(t) {
|
|
1873
1953
|
var e;
|
|
1874
1954
|
if (t && this.headerMap.has(t))
|
|
@@ -1973,8 +2053,8 @@ class ni {
|
|
|
1973
2053
|
if (h) {
|
|
1974
2054
|
let c = {}, d = {};
|
|
1975
2055
|
if (d[e] = this.getItemValue(t, e), Array.isArray(h)) {
|
|
1976
|
-
const x = h.map((
|
|
1977
|
-
...
|
|
2056
|
+
const x = h.map((g) => ({
|
|
2057
|
+
...g,
|
|
1978
2058
|
row: s.item,
|
|
1979
2059
|
column: n,
|
|
1980
2060
|
rowIndex: s.rowIndex,
|
|
@@ -1992,14 +2072,14 @@ class ni {
|
|
|
1992
2072
|
new nt(c).validate(d).then(() => {
|
|
1993
2073
|
this.clearValidationError(t, e), i([]);
|
|
1994
2074
|
}).catch(({ errors: x }) => {
|
|
1995
|
-
const
|
|
2075
|
+
const g = x.map((p) => ({
|
|
1996
2076
|
...p,
|
|
1997
2077
|
column: n,
|
|
1998
2078
|
key: e,
|
|
1999
2079
|
row: s.item,
|
|
2000
2080
|
rowKey: t
|
|
2001
2081
|
}));
|
|
2002
|
-
this.setValidationError(t, e,
|
|
2082
|
+
this.setValidationError(t, e, g), i(g);
|
|
2003
2083
|
});
|
|
2004
2084
|
} else
|
|
2005
2085
|
i([]);
|
|
@@ -2026,16 +2106,16 @@ class ni {
|
|
|
2026
2106
|
rowspan: d,
|
|
2027
2107
|
height: f,
|
|
2028
2108
|
width: x,
|
|
2029
|
-
colspan:
|
|
2109
|
+
colspan: g,
|
|
2030
2110
|
mergeRow: p,
|
|
2031
|
-
mergeCol:
|
|
2111
|
+
mergeCol: u
|
|
2032
2112
|
} = t;
|
|
2033
|
-
if (d === 1 &&
|
|
2113
|
+
if (d === 1 && g === 1)
|
|
2034
2114
|
return {
|
|
2035
2115
|
xArr: [n, n],
|
|
2036
2116
|
yArr: [e, e],
|
|
2037
2117
|
rowspan: d,
|
|
2038
|
-
colspan:
|
|
2118
|
+
colspan: g,
|
|
2039
2119
|
height: f,
|
|
2040
2120
|
width: x,
|
|
2041
2121
|
offsetTop: 0,
|
|
@@ -2049,82 +2129,82 @@ class ni {
|
|
|
2049
2129
|
}
|
|
2050
2130
|
]
|
|
2051
2131
|
};
|
|
2052
|
-
let w = e, y = e,
|
|
2132
|
+
let w = e, y = e, C = n, m = n, E = [], b = 0, R = 0, O = 0, L = 0;
|
|
2053
2133
|
if (d !== 1 && p) {
|
|
2054
|
-
|
|
2055
|
-
const
|
|
2056
|
-
const
|
|
2057
|
-
return `${v}${
|
|
2134
|
+
L = x;
|
|
2135
|
+
const _ = h.reduce((v, A) => {
|
|
2136
|
+
const S = this.getItemValue(s, A) ?? "";
|
|
2137
|
+
return `${v}${S}`;
|
|
2058
2138
|
}, "");
|
|
2059
2139
|
for (let v = e - 1; v >= 0; v--) {
|
|
2060
|
-
const
|
|
2061
|
-
const
|
|
2062
|
-
return `${M}${
|
|
2140
|
+
const A = this.rowIndexRowKeyMap.get(v) || "", S = h.reduce((M, T) => {
|
|
2141
|
+
const B = this.getItemValue(A, T) ?? "";
|
|
2142
|
+
return `${M}${B}`;
|
|
2063
2143
|
}, "");
|
|
2064
|
-
if (
|
|
2144
|
+
if (_ === S)
|
|
2065
2145
|
w = v;
|
|
2066
2146
|
else
|
|
2067
2147
|
break;
|
|
2068
2148
|
}
|
|
2069
2149
|
for (let v = e; v <= this.ctx.maxRowIndex; v++) {
|
|
2070
|
-
const
|
|
2071
|
-
const
|
|
2072
|
-
return `${M}${
|
|
2150
|
+
const A = this.rowIndexRowKeyMap.get(v) || "", S = h.reduce((M, T) => {
|
|
2151
|
+
const B = this.getItemValue(A, T) ?? "";
|
|
2152
|
+
return `${M}${B}`;
|
|
2073
2153
|
}, "");
|
|
2074
|
-
if (
|
|
2154
|
+
if (_ === S)
|
|
2075
2155
|
y = v;
|
|
2076
2156
|
else
|
|
2077
2157
|
break;
|
|
2078
2158
|
}
|
|
2079
2159
|
for (let v = w; v < e; v++) {
|
|
2080
|
-
const { height:
|
|
2081
|
-
b +=
|
|
2160
|
+
const { height: A } = this.positions[v];
|
|
2161
|
+
b += A;
|
|
2082
2162
|
}
|
|
2083
2163
|
for (let v = w; v <= y; v++) {
|
|
2084
|
-
const { height:
|
|
2085
|
-
|
|
2086
|
-
const
|
|
2087
|
-
|
|
2088
|
-
rowKey:
|
|
2164
|
+
const { height: A } = this.positions[v];
|
|
2165
|
+
O += A;
|
|
2166
|
+
const S = this.rowIndexRowKeyMap.get(v) || "", { item: M } = this.rowKeyMap.get(S), T = this.getItemValue(S, i);
|
|
2167
|
+
E.push({
|
|
2168
|
+
rowKey: S,
|
|
2089
2169
|
key: i,
|
|
2090
|
-
value:
|
|
2170
|
+
value: T,
|
|
2091
2171
|
row: M
|
|
2092
2172
|
});
|
|
2093
2173
|
}
|
|
2094
2174
|
}
|
|
2095
|
-
if (
|
|
2096
|
-
|
|
2097
|
-
for (let
|
|
2098
|
-
const v = this.getColumnByColIndex(
|
|
2175
|
+
if (g !== 1 && u) {
|
|
2176
|
+
O = f;
|
|
2177
|
+
for (let _ = n - 1; _ >= 0; _--) {
|
|
2178
|
+
const v = this.getColumnByColIndex(_);
|
|
2099
2179
|
if (!v)
|
|
2100
2180
|
break;
|
|
2101
|
-
const
|
|
2102
|
-
if (
|
|
2103
|
-
|
|
2181
|
+
const A = this.getItemValue(s, i), S = this.getItemValue(s, v.key);
|
|
2182
|
+
if (A === S && c.includes(v.key))
|
|
2183
|
+
C = _;
|
|
2104
2184
|
else
|
|
2105
2185
|
break;
|
|
2106
2186
|
}
|
|
2107
|
-
for (let
|
|
2108
|
-
const v = this.getColumnByColIndex(
|
|
2187
|
+
for (let _ = n; _ <= this.ctx.maxColIndex; _++) {
|
|
2188
|
+
const v = this.getColumnByColIndex(_);
|
|
2109
2189
|
if (!v)
|
|
2110
2190
|
break;
|
|
2111
|
-
const
|
|
2112
|
-
if (
|
|
2113
|
-
m =
|
|
2191
|
+
const A = this.getItemValue(s, i), S = this.getItemValue(s, v.key);
|
|
2192
|
+
if (A === S && c.includes(v.key))
|
|
2193
|
+
m = _;
|
|
2114
2194
|
else
|
|
2115
2195
|
break;
|
|
2116
2196
|
}
|
|
2117
|
-
for (let
|
|
2118
|
-
const v = this.getColumnByColIndex(
|
|
2197
|
+
for (let _ = C; _ < n; _++) {
|
|
2198
|
+
const v = this.getColumnByColIndex(_);
|
|
2119
2199
|
if (!v)
|
|
2120
2200
|
break;
|
|
2121
2201
|
R += v.width || 100;
|
|
2122
2202
|
}
|
|
2123
|
-
for (let
|
|
2124
|
-
const v = this.getColumnByColIndex(
|
|
2203
|
+
for (let _ = C; _ <= m; _++) {
|
|
2204
|
+
const v = this.getColumnByColIndex(_);
|
|
2125
2205
|
if (!v)
|
|
2126
2206
|
break;
|
|
2127
|
-
|
|
2207
|
+
L += v.width || 100, E.push({
|
|
2128
2208
|
rowKey: s,
|
|
2129
2209
|
key: v.key,
|
|
2130
2210
|
value: this.getItemValue(s, v.key),
|
|
@@ -2133,15 +2213,15 @@ class ni {
|
|
|
2133
2213
|
}
|
|
2134
2214
|
}
|
|
2135
2215
|
return {
|
|
2136
|
-
xArr: [
|
|
2216
|
+
xArr: [C, m],
|
|
2137
2217
|
yArr: [w, y],
|
|
2138
2218
|
rowspan: d,
|
|
2139
|
-
colspan:
|
|
2140
|
-
height:
|
|
2141
|
-
width:
|
|
2219
|
+
colspan: g,
|
|
2220
|
+
height: O,
|
|
2221
|
+
width: L,
|
|
2142
2222
|
offsetTop: b,
|
|
2143
2223
|
offsetLeft: R,
|
|
2144
|
-
dataList:
|
|
2224
|
+
dataList: E
|
|
2145
2225
|
};
|
|
2146
2226
|
}
|
|
2147
2227
|
setLoading(t) {
|
|
@@ -2173,7 +2253,12 @@ class ni {
|
|
|
2173
2253
|
// 获取虚拟单元格
|
|
2174
2254
|
getVirtualBodyCell(t, e) {
|
|
2175
2255
|
const i = this.getColumnByColIndex(e), s = this.getRowForRowIndex(t);
|
|
2176
|
-
return !i || !s ? void 0 : new
|
|
2256
|
+
return !i || !s ? void 0 : new Tt(this.ctx, t, e, 0, 0, 0, 0, i, s, "body");
|
|
2257
|
+
}
|
|
2258
|
+
getVirtualBodyCellByKey(t, e) {
|
|
2259
|
+
const i = this.getRowIndexForRowKey(t), s = this.getColIndexForKey(e);
|
|
2260
|
+
if (!(i === void 0 || s === void 0))
|
|
2261
|
+
return this.getVirtualBodyCell(i, s);
|
|
2177
2262
|
}
|
|
2178
2263
|
hasMergeCell(t, e) {
|
|
2179
2264
|
let i = !1;
|
|
@@ -2250,9 +2335,7 @@ class li {
|
|
|
2250
2335
|
this.ctx = t, this.init();
|
|
2251
2336
|
}
|
|
2252
2337
|
init() {
|
|
2253
|
-
this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(window, "mousedown", (
|
|
2254
|
-
!this.ctx.containerElement.contains(t.target) && this.ctx.selector.enable && this.ctx.emit("outsideMousedown", t);
|
|
2255
|
-
}), this.bind(this.ctx.stageElement, "click", this.handleClick.bind(this)), this.bind(window, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.stageElement, "wheel", this.handleWheel.bind(this)), this.bind(this.ctx.stageElement, "touchstart", this.handleTouchstart.bind(this)), this.bind(this.ctx.stageElement, "touchend", this.handleTouchend.bind(this)), this.bind(this.ctx.stageElement, "touchmove", this.handleTouchmove.bind(this)), this.bind(this.ctx.stageElement, "contextmenu", this.handleContextMenu.bind(this)), this.bind(this.ctx.stageElement, "mousedown", this.handleMouseDown.bind(this)), this.bind(this.ctx.stageElement, "dblclick", this.handleDblclick.bind(this)), this.bind(this.ctx.stageElement, "mouseover", this.handleMouseover.bind(this)), this.bind(this.ctx.stageElement, "mouseout", this.handleMouseout.bind(this));
|
|
2338
|
+
this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(window, "blur", this.handleOutsideMousedown.bind(this)), this.bind(window, "mousedown", this.handleOutsideMousedown.bind(this)), this.bind(this.ctx.stageElement, "click", this.handleClick.bind(this)), this.bind(window, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.stageElement, "wheel", this.handleWheel.bind(this)), this.bind(this.ctx.stageElement, "touchstart", this.handleTouchstart.bind(this)), this.bind(this.ctx.stageElement, "touchend", this.handleTouchend.bind(this)), this.bind(this.ctx.stageElement, "touchmove", this.handleTouchmove.bind(this)), this.bind(this.ctx.stageElement, "contextmenu", this.handleContextMenu.bind(this)), this.bind(this.ctx.stageElement, "mousedown", this.handleMouseDown.bind(this)), this.bind(this.ctx.stageElement, "dblclick", this.handleDblclick.bind(this)), this.bind(this.ctx.stageElement, "mouseover", this.handleMouseover.bind(this)), this.bind(this.ctx.stageElement, "mouseout", this.handleMouseout.bind(this));
|
|
2256
2339
|
}
|
|
2257
2340
|
destroy() {
|
|
2258
2341
|
this.eventTasks.forEach((t, e) => {
|
|
@@ -2302,6 +2385,9 @@ class li {
|
|
|
2302
2385
|
handleDblclick(t) {
|
|
2303
2386
|
this.ctx.emit("dblclick", t);
|
|
2304
2387
|
}
|
|
2388
|
+
handleOutsideMousedown(t) {
|
|
2389
|
+
this.ctx.selector.enable && (t.target instanceof Window || t.target instanceof Node && !this.ctx.containerElement.contains(t.target)) && this.ctx.emit("outsideMousedown", t);
|
|
2390
|
+
}
|
|
2305
2391
|
bind(t, e, i, s) {
|
|
2306
2392
|
t.addEventListener(e, i, s), this.eventTasks.set(e, i);
|
|
2307
2393
|
}
|
|
@@ -2449,10 +2535,10 @@ class ci {
|
|
|
2449
2535
|
this.ctx.font = n, this.ctx.fillStyle = c, this.ctx.textBaseline = f, this.ctx.textAlign = h;
|
|
2450
2536
|
let x = 0;
|
|
2451
2537
|
f === "top" ? x = i + d : f === "bottom" ? x = i + r - d : x = i + (r + 1) / 2;
|
|
2452
|
-
let
|
|
2453
|
-
h === "left" ?
|
|
2454
|
-
const { _text: p, ellipsis:
|
|
2455
|
-
return this.ctx.fillText(p,
|
|
2538
|
+
let g = 0;
|
|
2539
|
+
h === "left" ? g = e + d : h === "right" ? g = e + s - d : g = e + s / 2;
|
|
2540
|
+
const { _text: p, ellipsis: u } = this.handleEllipsis(t, s, d, n);
|
|
2541
|
+
return this.ctx.fillText(p, g, x), this.ctx.restore(), u;
|
|
2456
2542
|
}
|
|
2457
2543
|
handleEllipsis(t, e, i = 0, s = "12px Arial") {
|
|
2458
2544
|
let r = !1, o = t;
|
|
@@ -2486,6 +2572,11 @@ class Wt {
|
|
|
2486
2572
|
//禁用编辑,优先等级最高
|
|
2487
2573
|
l(this, "HEADER_FONT", "12px normal Arial");
|
|
2488
2574
|
l(this, "BODY_FONT", "12px normal Arial");
|
|
2575
|
+
l(this, "BORDER", !0);
|
|
2576
|
+
l(this, "STRIPE", !1);
|
|
2577
|
+
//斑马纹
|
|
2578
|
+
l(this, "STRIPE_COLOR", "#fafafa");
|
|
2579
|
+
//斑马纹颜色
|
|
2489
2580
|
l(this, "BORDER_COLOR", "#e1e6eb");
|
|
2490
2581
|
l(this, "WIDTH", 0);
|
|
2491
2582
|
l(this, "RESIZE_MIN_WIDTH", 40);
|
|
@@ -2498,6 +2589,8 @@ class Wt {
|
|
|
2498
2589
|
l(this, "ENABLE_OFFSET_HEIGHT", !1);
|
|
2499
2590
|
l(this, "OFFSET_HEIGHT", 0);
|
|
2500
2591
|
l(this, "HEADER_HEIGHT", 36);
|
|
2592
|
+
l(this, "ENABLE_RESERVE_SELECTION", !1);
|
|
2593
|
+
// 启用保留选中行
|
|
2501
2594
|
l(this, "ENABLE_HEADER_STICKY", !1);
|
|
2502
2595
|
// 启用头部固定,需要外面实现覆盖层,或者所有表头都要是元素
|
|
2503
2596
|
l(this, "HEADER_BG_COLOR", "#F8FAFF");
|
|
@@ -2803,12 +2896,12 @@ class re extends se {
|
|
|
2803
2896
|
draw() {
|
|
2804
2897
|
const {
|
|
2805
2898
|
paint: e,
|
|
2806
|
-
config: { BORDER_COLOR: i, CELL_PADDING: s, HEADER_FONT: r }
|
|
2807
|
-
} = this.ctx, { drawX:
|
|
2808
|
-
e.drawRect(
|
|
2809
|
-
borderColor: i,
|
|
2899
|
+
config: { BORDER_COLOR: i, CELL_PADDING: s, HEADER_FONT: r, BORDER: o }
|
|
2900
|
+
} = this.ctx, { drawX: n, drawY: h, displayText: c } = this;
|
|
2901
|
+
e.drawRect(n, h, this.width, this.height, {
|
|
2902
|
+
borderColor: o ? i : "transparent",
|
|
2810
2903
|
fillColor: this.drawCellBgColor
|
|
2811
|
-
}), e.drawText(
|
|
2904
|
+
}), e.drawText(c, n, h, this.width, this.height, {
|
|
2812
2905
|
font: r,
|
|
2813
2906
|
padding: s,
|
|
2814
2907
|
color: this.drawTextColor,
|
|
@@ -2933,7 +3026,7 @@ class fi {
|
|
|
2933
3026
|
selectionClick(t) {
|
|
2934
3027
|
if (["selection", "index-selection"].includes(t.type) && this.ctx.isPointer)
|
|
2935
3028
|
if (t instanceof re)
|
|
2936
|
-
t.drawImageName === "checkbox-uncheck" || t.drawImageName === "checkbox-indeterminate" ? this.ctx.database.toggleAllSelection() : t.drawImageName === "checkbox-check" && this.ctx.database.clearSelection();
|
|
3029
|
+
t.drawImageName === "checkbox-uncheck" || t.drawImageName === "checkbox-indeterminate" ? this.ctx.database.toggleAllSelection() : t.drawImageName === "checkbox-check" && this.ctx.database.clearSelection(!0);
|
|
2937
3030
|
else {
|
|
2938
3031
|
if (!this.ctx.database.getRowSelectable(t.rowKey))
|
|
2939
3032
|
return;
|
|
@@ -2972,7 +3065,7 @@ class fi {
|
|
|
2972
3065
|
*/
|
|
2973
3066
|
imageEnterAndLeave(t, e) {
|
|
2974
3067
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s;
|
|
2975
|
-
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
|
|
3068
|
+
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 Tt && ["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"));
|
|
2976
3069
|
}
|
|
2977
3070
|
isBusy(t) {
|
|
2978
3071
|
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, r = i;
|
|
@@ -3058,6 +3151,7 @@ class xi {
|
|
|
3058
3151
|
l(this, "scrollX", 0);
|
|
3059
3152
|
l(this, "fixedLeftWidth", 0);
|
|
3060
3153
|
l(this, "fixedRightWidth", 0);
|
|
3154
|
+
l(this, "lastCenterColIndex", 0);
|
|
3061
3155
|
l(this, "maxColIndex", 0);
|
|
3062
3156
|
l(this, "maxRowIndex", 0);
|
|
3063
3157
|
l(this, "hoverRow");
|
|
@@ -3135,15 +3229,14 @@ class xi {
|
|
|
3135
3229
|
}
|
|
3136
3230
|
setItemValueByEditor(t, e, i, s = !0, r = !0) {
|
|
3137
3231
|
if (this.config.ENABLE_MERGE_CELL_LINK) {
|
|
3138
|
-
const o = this.database.
|
|
3139
|
-
if (o
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
this.database.batchSetItemValue(d, s);
|
|
3232
|
+
const o = this.database.getVirtualBodyCellByKey(t, e);
|
|
3233
|
+
if (o && (o.mergeRow || o.mergeCol)) {
|
|
3234
|
+
const { dataList: n } = o.getSpanInfo(), h = n.map((c) => ({ ...c, value: i }));
|
|
3235
|
+
this.database.batchSetItemValue(h, s);
|
|
3236
|
+
return;
|
|
3144
3237
|
}
|
|
3145
|
-
}
|
|
3146
|
-
|
|
3238
|
+
}
|
|
3239
|
+
this.database.setItemValue(t, e, i, s, r, !0);
|
|
3147
3240
|
}
|
|
3148
3241
|
batchSetItemValueByEditor(t, e = !0) {
|
|
3149
3242
|
if (this.config.ENABLE_MERGE_CELL_LINK) {
|
|
@@ -3305,11 +3398,7 @@ class Pt {
|
|
|
3305
3398
|
}
|
|
3306
3399
|
onMouseMove(t) {
|
|
3307
3400
|
const { offsetX: e, offsetY: i, clientX: s, clientY: r, buttons: o } = t;
|
|
3308
|
-
if (o === 0)
|
|
3309
|
-
this.onMouseUp();
|
|
3310
|
-
return;
|
|
3311
|
-
}
|
|
3312
|
-
if (this.isOnScrollbar(e, i) && t.target === this.ctx.canvasElement ? this.isFocus = !0 : this.isFocus = !1, s == this.clientX && r == this.clientY) return;
|
|
3401
|
+
if (this.isOnScrollbar(e, i) && t.target === this.ctx.canvasElement ? this.isFocus = !0 : this.isFocus = !1, o === 0 || s == this.clientX && r == this.clientY) return;
|
|
3313
3402
|
let n = 0;
|
|
3314
3403
|
if (this.type === "horizontal" ? n = s - this.clientX : n = r - this.clientY, this.isDragging && n !== 0) {
|
|
3315
3404
|
let h = 0;
|
|
@@ -3338,37 +3427,41 @@ class Pt {
|
|
|
3338
3427
|
header: e,
|
|
3339
3428
|
stageHeight: i,
|
|
3340
3429
|
stageWidth: s,
|
|
3341
|
-
config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0 }
|
|
3342
|
-
} = this.ctx,
|
|
3430
|
+
config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0, BORDER: n }
|
|
3431
|
+
} = this.ctx, h = s, c = i, d = e.height, f = e.width, x = t.height, g = this.ctx.footer.height;
|
|
3343
3432
|
if (this.type === "vertical") {
|
|
3344
|
-
this.visibleDistance =
|
|
3345
|
-
const
|
|
3346
|
-
let
|
|
3347
|
-
|
|
3433
|
+
this.visibleDistance = c - r - d, this.distance = x - this.visibleDistance + g, this.trackX = h - r, this.trackY = 0, this.splitPoints = [this.trackX, d, this.trackX + r, d], this.trackWidth = r, this.trackHeight = c, this.barX = this.trackX - 1 + (r - o) / 2, this.barWidth = o;
|
|
3434
|
+
const p = this.distance ? this.visibleDistance / (x + g) : 0;
|
|
3435
|
+
let u = Math.floor(p * this.visibleDistance);
|
|
3436
|
+
u < 30 ? u = 30 : u > this.visibleDistance && (u = 0), this.barHeight = u, this.barY = d + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3348
3437
|
} else {
|
|
3349
|
-
this.visibleDistance =
|
|
3350
|
-
|
|
3438
|
+
this.visibleDistance = h - r, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
3439
|
+
h - r,
|
|
3440
|
+
c - r,
|
|
3351
3441
|
h - r,
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3442
|
+
c
|
|
3443
|
+
];
|
|
3444
|
+
const p = n ? 0 : 0.5;
|
|
3445
|
+
this.trackX = 0, this.trackY = c - r + p, this.trackWidth = h, this.trackHeight = r;
|
|
3446
|
+
const u = this.distance ? this.visibleDistance / f : 0;
|
|
3447
|
+
let w = Math.floor(u * this.visibleDistance);
|
|
3448
|
+
this.barY = this.trackY - 1 + (r - o) / 2, w < 30 ? w = 30 : w >= this.visibleDistance && (w = 0), this.barWidth = w, this.barHeight = o, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3358
3449
|
}
|
|
3359
3450
|
}
|
|
3360
3451
|
draw() {
|
|
3361
3452
|
const {
|
|
3362
|
-
config: { SCROLLER_FOCUS_COLOR: t, SCROLLER_COLOR: e, BORDER_COLOR: i,
|
|
3453
|
+
config: { SCROLLER_FOCUS_COLOR: t, SCROLLER_COLOR: e, BORDER_COLOR: i, BORDER: s, SCROLLER_TRACK_COLOR: r }
|
|
3363
3454
|
} = this.ctx;
|
|
3364
|
-
this.updatedSize()
|
|
3365
|
-
|
|
3366
|
-
|
|
3455
|
+
this.updatedSize();
|
|
3456
|
+
let o = i;
|
|
3457
|
+
s || (o = "transparent"), this.ctx.paint.drawRect(this.trackX, this.trackY, this.trackWidth, this.trackHeight, {
|
|
3458
|
+
borderColor: o,
|
|
3459
|
+
fillColor: r
|
|
3367
3460
|
}), this.ctx.paint.drawRect(this.barX, this.barY, this.barWidth, this.barHeight, {
|
|
3368
3461
|
fillColor: this.isFocus || this.isDragging ? t : e,
|
|
3369
3462
|
radius: 4
|
|
3370
3463
|
}), this.splitPoints.length > 0 && this.ctx.paint.drawLine(this.splitPoints, {
|
|
3371
|
-
borderColor:
|
|
3464
|
+
borderColor: o,
|
|
3372
3465
|
borderWidth: 1
|
|
3373
3466
|
}), this.ctx.scrollerFocus = this.isFocus;
|
|
3374
3467
|
}
|
|
@@ -3486,7 +3579,7 @@ class gi {
|
|
|
3486
3579
|
config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
|
|
3487
3580
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3488
3581
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3489
|
-
const s = Qt(i), r =
|
|
3582
|
+
const s = Qt(i), r = _t(i);
|
|
3490
3583
|
this.height = t * s, this.width = r.reduce((f, x) => f + ((x == null ? void 0 : x.width) || 100), 0), this.visibleHeight = this.height;
|
|
3491
3584
|
const o = ti(te(i, s));
|
|
3492
3585
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
@@ -3524,6 +3617,10 @@ class gi {
|
|
|
3524
3617
|
} else {
|
|
3525
3618
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
3526
3619
|
return;
|
|
3620
|
+
if (e.offsetX < 0 || e.offsetX > this.visibleWidth) {
|
|
3621
|
+
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3622
|
+
return;
|
|
3623
|
+
}
|
|
3527
3624
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3528
3625
|
const r = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
3529
3626
|
for (const o of r) {
|
|
@@ -3585,7 +3682,7 @@ class gi {
|
|
|
3585
3682
|
for (let o = 0; o < i; o++) {
|
|
3586
3683
|
const n = t[o], h = r * (n.rowspan || 0), c = r * (n.level || 0);
|
|
3587
3684
|
let d = n.width || 100;
|
|
3588
|
-
n.children && (d =
|
|
3685
|
+
n.children && (d = _t(n.children).reduce((g, p) => g + ((p == null ? void 0 : p.width) || 100), 0));
|
|
3589
3686
|
const f = new re(this.ctx, this.columnIndex, s, c, d, h, n);
|
|
3590
3687
|
this.ctx.database.setHeader(n.key, f), this.allCellHeaders.push(f), n.children || (this.leafCellHeaders.push(f), f.column.widthFillDisable || this.resizeNum++), n.fixed === "left" ? this.fixedLeftCellHeaders.push(f) : n.fixed === "right" ? this.fixedRightCellHeaders.push(f) : this.centerCellHeaders.push(f), !n.children && this.columnIndex++, n.children && this.render(n.children, s), s += d;
|
|
3591
3688
|
}
|
|
@@ -3602,7 +3699,7 @@ class gi {
|
|
|
3602
3699
|
});
|
|
3603
3700
|
}
|
|
3604
3701
|
}
|
|
3605
|
-
|
|
3702
|
+
drawFixedShadow() {
|
|
3606
3703
|
const {
|
|
3607
3704
|
fixedLeftWidth: t,
|
|
3608
3705
|
fixedRightWidth: e,
|
|
@@ -3619,7 +3716,7 @@ class gi {
|
|
|
3619
3716
|
colorEnd: "rgba(0,0,0,0)"
|
|
3620
3717
|
}), i < Math.floor(s.width - r - 1) && e !== n) {
|
|
3621
3718
|
const h = s.width - (this.x + this.width) + r - e;
|
|
3622
|
-
this.ctx.paint.drawShadow(h
|
|
3719
|
+
this.ctx.paint.drawShadow(h, this.y, e, this.height, {
|
|
3623
3720
|
fillColor: o,
|
|
3624
3721
|
side: "left",
|
|
3625
3722
|
shadowWidth: 4,
|
|
@@ -3630,6 +3727,10 @@ class gi {
|
|
|
3630
3727
|
}
|
|
3631
3728
|
update() {
|
|
3632
3729
|
const t = [], e = [], i = [];
|
|
3730
|
+
if (this.centerCellHeaders.length) {
|
|
3731
|
+
const s = this.centerCellHeaders[this.centerCellHeaders.length - 1];
|
|
3732
|
+
this.ctx.lastCenterColIndex = s.colIndex;
|
|
3733
|
+
}
|
|
3633
3734
|
this.centerCellHeaders.forEach((s) => {
|
|
3634
3735
|
s.isHorizontalVisible() && s.isVerticalVisible() && (e.push(s), s.hasChildren || t.push(s));
|
|
3635
3736
|
}), this.fixedLeftCellHeaders.forEach((s) => {
|
|
@@ -3638,12 +3739,22 @@ class gi {
|
|
|
3638
3739
|
i.push(s), s.hasChildren || t.push(s);
|
|
3639
3740
|
}), this.renderCenterCellHeaders = e, this.renderFixedCellHeaders = i, this.renderLeafCellHeaders = t.sort((s, r) => s.x - r.x), this.visibleLeafColumns = this.renderLeafCellHeaders.map((s) => s.column), this.ctx.header.visibleLeafColumns = this.visibleLeafColumns, this.ctx.header.leafCellHeaders = this.leafCellHeaders, this.ctx.header.renderLeafCellHeaders = this.renderLeafCellHeaders, this.ctx.header.renderCellHeaders = this.renderFixedCellHeaders.concat(this.renderCenterCellHeaders);
|
|
3640
3741
|
}
|
|
3742
|
+
drawBottomLine() {
|
|
3743
|
+
const {
|
|
3744
|
+
stageWidth: t,
|
|
3745
|
+
config: { BORDER_COLOR: e }
|
|
3746
|
+
} = this.ctx, i = [0, this.height, t, this.height];
|
|
3747
|
+
this.ctx.paint.drawLine(i, {
|
|
3748
|
+
borderColor: e,
|
|
3749
|
+
borderWidth: 1
|
|
3750
|
+
});
|
|
3751
|
+
}
|
|
3641
3752
|
draw() {
|
|
3642
3753
|
this.renderCenterCellHeaders.forEach((t) => {
|
|
3643
3754
|
t.update(), t.draw();
|
|
3644
|
-
}), this.
|
|
3755
|
+
}), this.drawFixedShadow(), this.renderFixedCellHeaders.forEach((t) => {
|
|
3645
3756
|
t.update(), t.draw();
|
|
3646
|
-
}), this.drawTipLine();
|
|
3757
|
+
}), this.drawTipLine(), this.drawBottomLine();
|
|
3647
3758
|
}
|
|
3648
3759
|
}
|
|
3649
3760
|
class oe {
|
|
@@ -3665,7 +3776,7 @@ class oe {
|
|
|
3665
3776
|
update() {
|
|
3666
3777
|
const { header: t } = this.ctx, e = [], i = [], s = [];
|
|
3667
3778
|
t.renderLeafCellHeaders.forEach((r) => {
|
|
3668
|
-
const o = new
|
|
3779
|
+
const o = new Tt(
|
|
3669
3780
|
this.ctx,
|
|
3670
3781
|
this.rowIndex,
|
|
3671
3782
|
r.colIndex,
|
|
@@ -3690,11 +3801,14 @@ class oe {
|
|
|
3690
3801
|
t.draw();
|
|
3691
3802
|
});
|
|
3692
3803
|
}
|
|
3693
|
-
|
|
3804
|
+
drawContainer() {
|
|
3694
3805
|
this.noFixedCells.forEach((t) => {
|
|
3695
|
-
t.
|
|
3696
|
-
})
|
|
3697
|
-
|
|
3806
|
+
t.drawContainer();
|
|
3807
|
+
});
|
|
3808
|
+
}
|
|
3809
|
+
drawFixedContainer() {
|
|
3810
|
+
this.fixedCells.forEach((t) => {
|
|
3811
|
+
t.drawContainer();
|
|
3698
3812
|
});
|
|
3699
3813
|
}
|
|
3700
3814
|
}
|
|
@@ -3744,9 +3858,9 @@ class wi {
|
|
|
3744
3858
|
if (!e.width)
|
|
3745
3859
|
return;
|
|
3746
3860
|
this.x = 0, x === "top" && r ? this.y = e.height + i.height : this.y = e.height;
|
|
3747
|
-
const { data:
|
|
3748
|
-
this.height = p, this.data =
|
|
3749
|
-
const { top:
|
|
3861
|
+
const { data: g, sumHeight: p } = s.getData();
|
|
3862
|
+
this.height = p, this.data = g;
|
|
3863
|
+
const { top: u } = t.getBoundingClientRect();
|
|
3750
3864
|
this.width = e.width, this.visibleWidth = this.ctx.stageWidth - o;
|
|
3751
3865
|
const w = this.ctx.footer.height;
|
|
3752
3866
|
!this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height - w - o);
|
|
@@ -3760,16 +3874,16 @@ class wi {
|
|
|
3760
3874
|
width: this.width,
|
|
3761
3875
|
height: this.data.length ? 0 : h + w
|
|
3762
3876
|
});
|
|
3763
|
-
let
|
|
3764
|
-
|
|
3877
|
+
let C = this.height + e.height + o;
|
|
3878
|
+
C += w;
|
|
3765
3879
|
let m = 0;
|
|
3766
|
-
this.data.length && d ? (m = window.innerHeight -
|
|
3880
|
+
this.data.length && d ? (m = window.innerHeight - u - f, m < 0 && (m = 32, console.error(
|
|
3767
3881
|
"There is an error in the height calculation ENABLE_OFFSET_HEIGHT and OFFSET_HEIGHT are invalid"
|
|
3768
|
-
))) : this.data.length && n ? m = n : this.data.length && c &&
|
|
3769
|
-
let
|
|
3770
|
-
r ? this.visibleHeight =
|
|
3771
|
-
const b = window.devicePixelRatio || 1, R = this.ctx.stageWidth * b,
|
|
3772
|
-
t.width = Math.floor(R), t.height = Math.floor(
|
|
3882
|
+
))) : this.data.length && n ? m = n : this.data.length && c && C > c ? m = c : m = C, m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
|
|
3883
|
+
let E = this.ctx.stageHeight - e.height - o;
|
|
3884
|
+
r ? this.visibleHeight = E - w : this.visibleHeight = E, this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = g;
|
|
3885
|
+
const b = window.devicePixelRatio || 1, R = this.ctx.stageWidth * b, O = this.ctx.stageHeight * b;
|
|
3886
|
+
t.width = Math.floor(R), t.height = Math.floor(O), this.ctx.canvasElement.setAttribute(
|
|
3773
3887
|
"style",
|
|
3774
3888
|
` height:${this.ctx.stageHeight}px;width:${this.ctx.stageWidth}px;`
|
|
3775
3889
|
), this.ctx.paint.scale(b);
|
|
@@ -3797,15 +3911,21 @@ class wi {
|
|
|
3797
3911
|
let x = n - this.clientY;
|
|
3798
3912
|
x + f < d && (x = -(f - d)), this.resizeDiff = x, this.ctx.emit("draw");
|
|
3799
3913
|
} else {
|
|
3800
|
-
if (this.resizeTarget = null, this.isMouseDown
|
|
3914
|
+
if (this.resizeTarget = null, this.isMouseDown)
|
|
3915
|
+
return;
|
|
3916
|
+
if (o < 0 || o > this.ctx.body.visibleWidth || r < 0 || r > this.ctx.header.visibleHeight + this.ctx.body.visibleHeight) {
|
|
3917
|
+
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3918
|
+
return;
|
|
3919
|
+
}
|
|
3920
|
+
if (this.ctx.stageElement.style.cursor === "crosshair")
|
|
3801
3921
|
return;
|
|
3802
3922
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3803
3923
|
for (let f = 0; f < this.renderRows.length; f++) {
|
|
3804
3924
|
const x = this.renderRows[f];
|
|
3805
3925
|
if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r < h - 4)
|
|
3806
3926
|
for (let p = 0; p < x.cells.length; p++) {
|
|
3807
|
-
const
|
|
3808
|
-
o >
|
|
3927
|
+
const u = x.cells[p];
|
|
3928
|
+
o > u.drawX + 10 && o < u.drawX + u.width - 10 && u.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = x);
|
|
3809
3929
|
}
|
|
3810
3930
|
}
|
|
3811
3931
|
}
|
|
@@ -3835,7 +3955,7 @@ class wi {
|
|
|
3835
3955
|
});
|
|
3836
3956
|
}
|
|
3837
3957
|
}
|
|
3838
|
-
|
|
3958
|
+
drawFixedShadow() {
|
|
3839
3959
|
const {
|
|
3840
3960
|
fixedLeftWidth: t,
|
|
3841
3961
|
fixedRightWidth: e,
|
|
@@ -3852,7 +3972,7 @@ class wi {
|
|
|
3852
3972
|
colorEnd: "rgba(0,0,0,0)"
|
|
3853
3973
|
}), i < Math.floor(s.width - r - 1) && e !== n) {
|
|
3854
3974
|
const h = s.width - (this.x + this.width) + r - e;
|
|
3855
|
-
this.ctx.paint.drawShadow(h
|
|
3975
|
+
this.ctx.paint.drawShadow(h, this.y, e, this.height, {
|
|
3856
3976
|
fillColor: o,
|
|
3857
3977
|
side: "left",
|
|
3858
3978
|
shadowWidth: 4,
|
|
@@ -3888,15 +4008,19 @@ class wi {
|
|
|
3888
4008
|
this.headIndex = Math.max(0, h), this.tailIndex = Math.min(this.ctx.maxRowIndex, c + 1), this.visibleRows = o.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
|
|
3889
4009
|
const d = [];
|
|
3890
4010
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
3891
|
-
const x = this.headIndex + f,
|
|
4011
|
+
const x = this.headIndex + f, g = this.visibleRows[f], { height: p, top: u } = this.ctx.database.getPositionForRowIndex(x), w = new oe(this.ctx, x, 0, u + this.y, t.width, p, g);
|
|
3892
4012
|
d.push(w);
|
|
3893
4013
|
}
|
|
3894
4014
|
this.renderRows = d, this.ctx.body.renderRows = d;
|
|
3895
4015
|
}
|
|
3896
4016
|
draw() {
|
|
3897
4017
|
this.renderRows.forEach((t) => {
|
|
4018
|
+
t.drawContainer();
|
|
4019
|
+
}), this.renderRows.forEach((t) => {
|
|
3898
4020
|
t.drawCenter();
|
|
3899
|
-
}), this.
|
|
4021
|
+
}), this.drawFixedShadow(), this.renderRows.forEach((t) => {
|
|
4022
|
+
t.drawFixedContainer();
|
|
4023
|
+
}), this.renderRows.forEach((t) => {
|
|
3900
4024
|
t.drawFixed();
|
|
3901
4025
|
}), this.drawTipLine();
|
|
3902
4026
|
}
|
|
@@ -3923,7 +4047,7 @@ class pi {
|
|
|
3923
4047
|
} = this.ctx;
|
|
3924
4048
|
this.width = t.width, this.visibleWidth = t.visibleWidth, this.height = this.data.reduce((n) => n + i, 0), this.visibleHeight = this.height, s ? o === "top" ? this.y = this.ctx.header.height : this.y = this.ctx.stageHeight - this.height - r : this.y = e.y + e.height, this.ctx.footer.x = this.x, this.ctx.footer.y = this.y, this.ctx.footer.height = this.height, this.ctx.footer.width = this.width, this.ctx.footer.visibleWidth = this.visibleWidth, this.ctx.footer.visibleHeight = this.visibleHeight;
|
|
3925
4049
|
}
|
|
3926
|
-
|
|
4050
|
+
drawFixedShadow() {
|
|
3927
4051
|
const {
|
|
3928
4052
|
fixedLeftWidth: t,
|
|
3929
4053
|
fixedRightWidth: e,
|
|
@@ -3941,7 +4065,7 @@ class pi {
|
|
|
3941
4065
|
colorEnd: "rgba(0,0,0,0)"
|
|
3942
4066
|
}), i < Math.floor(s.width - r - 1) && e !== n) {
|
|
3943
4067
|
const c = s.width - (this.x + this.width) + r - e;
|
|
3944
|
-
this.ctx.paint.drawShadow(c
|
|
4068
|
+
this.ctx.paint.drawShadow(c, h, e, this.height, {
|
|
3945
4069
|
fillColor: o,
|
|
3946
4070
|
side: "left",
|
|
3947
4071
|
shadowWidth: 4,
|
|
@@ -3960,12 +4084,26 @@ class pi {
|
|
|
3960
4084
|
e += t, i.push(o);
|
|
3961
4085
|
}), this.renderRows = i, this.ctx.footer.renderRows = this.renderRows;
|
|
3962
4086
|
}
|
|
4087
|
+
drawTopLine() {
|
|
4088
|
+
const {
|
|
4089
|
+
stageWidth: t,
|
|
4090
|
+
config: { BORDER_COLOR: e }
|
|
4091
|
+
} = this.ctx, i = [0, this.y, t, this.y];
|
|
4092
|
+
this.ctx.paint.drawLine(i, {
|
|
4093
|
+
borderColor: e,
|
|
4094
|
+
borderWidth: 1
|
|
4095
|
+
});
|
|
4096
|
+
}
|
|
3963
4097
|
draw() {
|
|
3964
4098
|
this.renderRows.forEach((t) => {
|
|
4099
|
+
t.drawContainer();
|
|
4100
|
+
}), this.renderRows.forEach((t) => {
|
|
3965
4101
|
t.drawCenter();
|
|
3966
|
-
}), this.
|
|
4102
|
+
}), this.drawFixedShadow(), this.renderRows.forEach((t) => {
|
|
4103
|
+
t.drawFixedContainer();
|
|
4104
|
+
}), this.renderRows.forEach((t) => {
|
|
3967
4105
|
t.drawFixed();
|
|
3968
|
-
});
|
|
4106
|
+
}), this.drawTopLine();
|
|
3969
4107
|
}
|
|
3970
4108
|
}
|
|
3971
4109
|
class yi {
|
|
@@ -4034,7 +4172,7 @@ class yi {
|
|
|
4034
4172
|
t.preventDefault(), this.moveFocus("LEFT");
|
|
4035
4173
|
return;
|
|
4036
4174
|
}
|
|
4037
|
-
if (t.code === "ArrowUp"
|
|
4175
|
+
if (t.code === "ArrowUp") {
|
|
4038
4176
|
t.preventDefault(), this.moveFocus("TOP");
|
|
4039
4177
|
return;
|
|
4040
4178
|
}
|
|
@@ -4042,7 +4180,7 @@ class yi {
|
|
|
4042
4180
|
t.preventDefault(), this.moveFocus("RIGHT");
|
|
4043
4181
|
return;
|
|
4044
4182
|
}
|
|
4045
|
-
if (t.code === "ArrowDown"
|
|
4183
|
+
if (t.code === "ArrowDown") {
|
|
4046
4184
|
t.preventDefault(), this.moveFocus("BOTTOM");
|
|
4047
4185
|
return;
|
|
4048
4186
|
}
|
|
@@ -4088,25 +4226,25 @@ class yi {
|
|
|
4088
4226
|
SELECTOR_AREA_MAX_Y: d,
|
|
4089
4227
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
4090
4228
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
4091
|
-
} = this.ctx.config,
|
|
4092
|
-
let [y,
|
|
4093
|
-
if (y <
|
|
4229
|
+
} = this.ctx.config, g = n, p = h || this.ctx.maxColIndex - f, u = c, w = d || this.ctx.maxRowIndex - x;
|
|
4230
|
+
let [y, C] = r, [m, E] = o;
|
|
4231
|
+
if (y < g || C > p || m < u || E > w)
|
|
4094
4232
|
return;
|
|
4095
4233
|
if (this.ctx.stageElement.focus(), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
4096
4234
|
const R = this.adjustMergeCells(r, o);
|
|
4097
|
-
m = R.yArr[0],
|
|
4235
|
+
m = R.yArr[0], E = R.yArr[1], y = R.xArr[0], C = R.xArr[1], this.ctx.onlyMergeCell = R.onlyMergeCell;
|
|
4098
4236
|
}
|
|
4099
|
-
y ===
|
|
4237
|
+
y === C && m === E ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(g, y), Math.min(p, C)], o = [Math.max(u, m), Math.min(w, E)];
|
|
4100
4238
|
const { BEFORE_SET_SELECTOR_METHOD: b } = this.ctx.config;
|
|
4101
4239
|
if (typeof b == "function") {
|
|
4102
|
-
const
|
|
4240
|
+
const O = b({
|
|
4103
4241
|
focusCell: this.ctx.focusCell,
|
|
4104
4242
|
xArr: r,
|
|
4105
4243
|
yArr: o
|
|
4106
4244
|
});
|
|
4107
|
-
if (!
|
|
4245
|
+
if (!O)
|
|
4108
4246
|
return;
|
|
4109
|
-
r =
|
|
4247
|
+
r = O.xArr, o = O.yArr;
|
|
4110
4248
|
}
|
|
4111
4249
|
this.ctx.selector.xArr = r, this.ctx.selector.yArr = o, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
|
|
4112
4250
|
}
|
|
@@ -4115,39 +4253,39 @@ class yi {
|
|
|
4115
4253
|
var p;
|
|
4116
4254
|
const [i, s] = e, [r, o] = t;
|
|
4117
4255
|
let n = [], h = [];
|
|
4118
|
-
for (let
|
|
4256
|
+
for (let u = 0; u <= e[1] - e[0]; u++)
|
|
4119
4257
|
for (let w = 0; w <= t[1] - t[0]; w++) {
|
|
4120
|
-
const y =
|
|
4121
|
-
m && ((y === i || y === s) && n.push(m), (
|
|
4258
|
+
const y = u + e[0], C = w + t[0], m = this.ctx.database.getVirtualBodyCell(y, C);
|
|
4259
|
+
m && ((y === i || y === s) && n.push(m), (C === r || C === o) && h.push(m));
|
|
4122
4260
|
}
|
|
4123
4261
|
const c = n.reduce(
|
|
4124
|
-
(
|
|
4125
|
-
const { yArr: y } = w.getSpanInfo(), [
|
|
4126
|
-
return
|
|
4262
|
+
(u, w) => {
|
|
4263
|
+
const { yArr: y } = w.getSpanInfo(), [C, m] = y;
|
|
4264
|
+
return u.minY = Math.min(u.minY, C), u.maxY = Math.max(u.maxY, m), u;
|
|
4127
4265
|
},
|
|
4128
4266
|
{
|
|
4129
4267
|
minY: i,
|
|
4130
4268
|
maxY: s
|
|
4131
4269
|
}
|
|
4132
4270
|
), d = h.reduce(
|
|
4133
|
-
(
|
|
4134
|
-
const { xArr: y } = w.getSpanInfo(), [
|
|
4135
|
-
return
|
|
4271
|
+
(u, w) => {
|
|
4272
|
+
const { xArr: y } = w.getSpanInfo(), [C, m] = y;
|
|
4273
|
+
return u.minX = Math.min(u.minX, C), u.maxX = Math.max(u.maxX, m), u;
|
|
4136
4274
|
},
|
|
4137
4275
|
{
|
|
4138
4276
|
minX: r,
|
|
4139
4277
|
maxX: o
|
|
4140
4278
|
}
|
|
4141
4279
|
), f = [d.minX, d.maxX], x = [c.minY, c.maxY];
|
|
4142
|
-
let
|
|
4280
|
+
let g = !1;
|
|
4143
4281
|
if (d.minX !== d.maxX || c.minY !== c.maxY) {
|
|
4144
|
-
const
|
|
4145
|
-
|
|
4282
|
+
const u = JSON.stringify(f) + JSON.stringify(x), w = (p = this.ctx.focusCell) == null ? void 0 : p.getSpanInfo();
|
|
4283
|
+
g = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) === u;
|
|
4146
4284
|
}
|
|
4147
4285
|
return {
|
|
4148
4286
|
xArr: f,
|
|
4149
4287
|
yArr: x,
|
|
4150
|
-
onlyMergeCell:
|
|
4288
|
+
onlyMergeCell: g
|
|
4151
4289
|
};
|
|
4152
4290
|
}
|
|
4153
4291
|
selectCols(t) {
|
|
@@ -4184,8 +4322,8 @@ class yi {
|
|
|
4184
4322
|
SELECTOR_AREA_MAX_Y: o,
|
|
4185
4323
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
4186
4324
|
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4187
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, x = o || this.ctx.maxRowIndex - h,
|
|
4188
|
-
this.setSelector(
|
|
4325
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, x = o || this.ctx.maxRowIndex - h, g = [c, d], p = [f, x];
|
|
4326
|
+
this.setSelector(g, p);
|
|
4189
4327
|
}
|
|
4190
4328
|
}
|
|
4191
4329
|
selectRows(t, e = !0) {
|
|
@@ -4221,8 +4359,10 @@ class yi {
|
|
|
4221
4359
|
const { focusCell: e, clickCell: i } = this.ctx;
|
|
4222
4360
|
if (e && this.isInSettingRange(e.rowIndex, e.colIndex))
|
|
4223
4361
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
4224
|
-
|
|
4225
|
-
|
|
4362
|
+
if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
|
|
4363
|
+
return;
|
|
4364
|
+
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: n } = e, h = Math.min(o, s), c = Math.max(o, s), d = Math.min(n, r), f = Math.max(n, r), x = [h, c], g = [d, f];
|
|
4365
|
+
this.setSelector(x, g);
|
|
4226
4366
|
} else {
|
|
4227
4367
|
this.ctx.emit("cellSelectedClick", e);
|
|
4228
4368
|
const s = [e.colIndex, e.colIndex], r = [e.rowIndex, e.rowIndex];
|
|
@@ -4290,10 +4430,10 @@ class yi {
|
|
|
4290
4430
|
for (let h = 0; h <= t[1] - t[0]; h++) {
|
|
4291
4431
|
const c = n + e[0], d = h + t[0], f = this.ctx.database.getItemValueForRowIndexAndColIndex(c, d);
|
|
4292
4432
|
if (f) {
|
|
4293
|
-
const { rowKey: x, key:
|
|
4294
|
-
this.ctx.database.getReadonly(x,
|
|
4433
|
+
const { rowKey: x, key: g } = f;
|
|
4434
|
+
this.ctx.database.getReadonly(x, g) || (r.add(x), s.push({
|
|
4295
4435
|
rowKey: x,
|
|
4296
|
-
key:
|
|
4436
|
+
key: g,
|
|
4297
4437
|
value: null,
|
|
4298
4438
|
row: {}
|
|
4299
4439
|
//内部有设置
|
|
@@ -4322,27 +4462,27 @@ class yi {
|
|
|
4322
4462
|
let o = ii(r);
|
|
4323
4463
|
const n = [i, i + o[0].length - 1], h = [e, e + o.length - 1], c = o.length === 1 && o[0].length === 1;
|
|
4324
4464
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !c) {
|
|
4325
|
-
const
|
|
4465
|
+
const g = {
|
|
4326
4466
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
4327
4467
|
message: "Merged cells cannot span paste data"
|
|
4328
4468
|
};
|
|
4329
|
-
this.ctx.hasEvent("error") ? this.ctx.emit("error",
|
|
4469
|
+
this.ctx.hasEvent("error") ? this.ctx.emit("error", g) : alert(g.message);
|
|
4330
4470
|
return;
|
|
4331
4471
|
}
|
|
4332
4472
|
let d = [];
|
|
4333
|
-
for (let
|
|
4334
|
-
const p = o[
|
|
4335
|
-
for (let
|
|
4336
|
-
const w =
|
|
4473
|
+
for (let g = 0; g <= o.length - 1; g++) {
|
|
4474
|
+
const p = o[g].length;
|
|
4475
|
+
for (let u = 0; u <= p - 1; u++) {
|
|
4476
|
+
const w = g + e, y = u + i, C = o[g][u], m = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
4337
4477
|
w,
|
|
4338
4478
|
y
|
|
4339
4479
|
);
|
|
4340
4480
|
if (m) {
|
|
4341
|
-
const { rowKey:
|
|
4342
|
-
this.ctx.database.getReadonly(
|
|
4343
|
-
rowKey:
|
|
4481
|
+
const { rowKey: E, key: b } = m;
|
|
4482
|
+
this.ctx.database.getReadonly(E, b) || (s.add(E), d.push({
|
|
4483
|
+
rowKey: E,
|
|
4344
4484
|
key: b,
|
|
4345
|
-
value:
|
|
4485
|
+
value: C,
|
|
4346
4486
|
row: {}
|
|
4347
4487
|
//内部有设置
|
|
4348
4488
|
}));
|
|
@@ -4350,34 +4490,34 @@ class yi {
|
|
|
4350
4490
|
}
|
|
4351
4491
|
}
|
|
4352
4492
|
if (this.isCut) {
|
|
4353
|
-
const
|
|
4493
|
+
const g = this.clearSelectedData(
|
|
4354
4494
|
this.ctx.selector.xArrCopy,
|
|
4355
4495
|
this.ctx.selector.yArrCopy,
|
|
4356
4496
|
!0
|
|
4357
4497
|
// 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
|
|
4358
|
-
), p = d.map((
|
|
4359
|
-
|
|
4360
|
-
p.includes(`${
|
|
4498
|
+
), p = d.map((u) => `${u.rowKey}-${u.key}`);
|
|
4499
|
+
g.forEach((u) => {
|
|
4500
|
+
p.includes(`${u.rowKey}-${u.key}`) || d.unshift(u);
|
|
4361
4501
|
}), this.isCut = !1;
|
|
4362
4502
|
}
|
|
4363
4503
|
if (!d.length)
|
|
4364
4504
|
return;
|
|
4365
4505
|
const { BEFORE_PASTE_DATA_METHOD: f } = this.ctx.config;
|
|
4366
4506
|
if (typeof f == "function") {
|
|
4367
|
-
const
|
|
4368
|
-
rowKey:
|
|
4369
|
-
key:
|
|
4370
|
-
value:
|
|
4371
|
-
oldValue: this.ctx.database.getItemValue(
|
|
4372
|
-
row: this.ctx.database.getRowDataItemForRowKey(
|
|
4507
|
+
const g = f, p = d.map((u) => ({
|
|
4508
|
+
rowKey: u.rowKey,
|
|
4509
|
+
key: u.key,
|
|
4510
|
+
value: u.value,
|
|
4511
|
+
oldValue: this.ctx.database.getItemValue(u.rowKey, u.key),
|
|
4512
|
+
row: this.ctx.database.getRowDataItemForRowKey(u.rowKey)
|
|
4373
4513
|
}));
|
|
4374
|
-
if (d = await
|
|
4514
|
+
if (d = await g(p, n, h), d && !d.length)
|
|
4375
4515
|
return;
|
|
4376
4516
|
}
|
|
4377
4517
|
this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(d, !0);
|
|
4378
4518
|
let x = [];
|
|
4379
|
-
s.forEach((
|
|
4380
|
-
x.push(this.ctx.database.getRowDataItemForRowKey(
|
|
4519
|
+
s.forEach((g) => {
|
|
4520
|
+
x.push(this.ctx.database.getRowDataItemForRowKey(g));
|
|
4381
4521
|
}), this.ctx.emit("pasteChange", d, x);
|
|
4382
4522
|
}).catch((r) => {
|
|
4383
4523
|
console.error("Failed to get the clipboard content:", r);
|
|
@@ -4467,19 +4607,19 @@ class yi {
|
|
|
4467
4607
|
body: h,
|
|
4468
4608
|
scrollX: c,
|
|
4469
4609
|
scrollY: d,
|
|
4470
|
-
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: x, FOOTER_POSITION:
|
|
4610
|
+
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: x, FOOTER_POSITION: g, ENABLE_MERGE_CELL_LINK: p }
|
|
4471
4611
|
} = this.ctx;
|
|
4472
4612
|
if (!i)
|
|
4473
4613
|
return;
|
|
4474
4614
|
p && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
4475
|
-
const { drawX:
|
|
4476
|
-
let R = o.height - w,
|
|
4477
|
-
|
|
4478
|
-
let
|
|
4479
|
-
x && (
|
|
4480
|
-
const
|
|
4481
|
-
let v = c,
|
|
4482
|
-
b > 0 && !m ? v = Math.floor(c + b) :
|
|
4615
|
+
const { drawX: u, drawY: w, width: y, height: C, fixed: m } = i, E = r - u + 1, b = i.drawX + y - (e - s) + 1;
|
|
4616
|
+
let R = o.height - w, O = C;
|
|
4617
|
+
O > h.visibleHeight && (O = h.visibleHeight);
|
|
4618
|
+
let L = 0;
|
|
4619
|
+
x && (g === "top" ? R = o.height + n.height - w : L = n.visibleHeight);
|
|
4620
|
+
const _ = w + O - (t - L - f);
|
|
4621
|
+
let v = c, A = d;
|
|
4622
|
+
b > 0 && !m ? v = Math.floor(c + b) : E > 0 && !m && (v = Math.floor(c - E)), R > 0 ? A = Math.floor(d - R) : _ > 0 && (A = Math.floor(d + _)), (Math.abs(c - v) > 2 || Math.abs(d - A) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(v, A), this.ctx.emit("adjustBoundaryPosition", i));
|
|
4483
4623
|
}
|
|
4484
4624
|
destroy() {
|
|
4485
4625
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
@@ -4488,18 +4628,19 @@ class yi {
|
|
|
4488
4628
|
class mi {
|
|
4489
4629
|
constructor(t) {
|
|
4490
4630
|
l(this, "ctx");
|
|
4631
|
+
l(this, "maxColRowCell");
|
|
4491
4632
|
this.ctx = t, this.init();
|
|
4492
4633
|
}
|
|
4493
4634
|
init() {
|
|
4494
|
-
this.ctx.on("
|
|
4495
|
-
this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default")
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
}
|
|
4501
|
-
this.mouseenter(t);
|
|
4502
|
-
}), this.ctx.on("
|
|
4635
|
+
this.ctx.on("mousemove", (t) => {
|
|
4636
|
+
if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
|
|
4637
|
+
return;
|
|
4638
|
+
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: r, drawX: o, drawY: n, width: h, height: c } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || r === this.ctx.maxRowIndex ? 0 : 2, x = o + h - d + f, g = n + c - d + f;
|
|
4639
|
+
e > x && i > g && e < x + d && i < g + d && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4640
|
+
}), this.ctx.on("cellMouseenter", (t) => {
|
|
4641
|
+
const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], r = i[1], { colIndex: o, rowIndex: n } = t;
|
|
4642
|
+
this.ctx.config.ENABLE_AUTOFILL && o === s && n === r && (this.maxColRowCell = t), this.mouseenter(t);
|
|
4643
|
+
}), this.ctx.on("mousedown", () => {
|
|
4503
4644
|
this.ctx.stageElement.style.cursor === "crosshair" && this.setMousedown();
|
|
4504
4645
|
}), this.ctx.on("mouseup", () => {
|
|
4505
4646
|
this.setMouseUp();
|
|
@@ -4541,22 +4682,22 @@ class mi {
|
|
|
4541
4682
|
SELECTOR_AREA_MIN_Y: d,
|
|
4542
4683
|
SELECTOR_AREA_MAX_Y: f,
|
|
4543
4684
|
SELECTOR_AREA_MAX_X_OFFSET: x,
|
|
4544
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4545
|
-
} = this.ctx.config, p = h,
|
|
4546
|
-
let [
|
|
4547
|
-
if (
|
|
4685
|
+
SELECTOR_AREA_MAX_Y_OFFSET: g
|
|
4686
|
+
} = this.ctx.config, p = h, u = c || this.ctx.maxColIndex - x, w = d, y = f || this.ctx.maxRowIndex - g;
|
|
4687
|
+
let [C, m] = o, [E, b] = n;
|
|
4688
|
+
if (C < p || E < w)
|
|
4548
4689
|
return;
|
|
4549
|
-
o = [Math.max(p,
|
|
4690
|
+
o = [Math.max(p, C), Math.min(u, m)], n = [Math.max(w, E), Math.min(y, b)];
|
|
4550
4691
|
const { BEFORE_SET_AUTOFILL_METHOD: R } = this.ctx.config;
|
|
4551
4692
|
if (typeof R == "function") {
|
|
4552
|
-
const
|
|
4693
|
+
const L = R({
|
|
4553
4694
|
focusCell: this.ctx.focusCell,
|
|
4554
4695
|
xArr: o,
|
|
4555
4696
|
yArr: n
|
|
4556
4697
|
});
|
|
4557
|
-
if (!
|
|
4698
|
+
if (!L)
|
|
4558
4699
|
return;
|
|
4559
|
-
o =
|
|
4700
|
+
o = L.xArr, n = L.yArr;
|
|
4560
4701
|
}
|
|
4561
4702
|
this.ctx.autofill.xArr = o, this.ctx.autofill.yArr = n, this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
|
|
4562
4703
|
}
|
|
@@ -4566,28 +4707,28 @@ class mi {
|
|
|
4566
4707
|
*/
|
|
4567
4708
|
async autofillData() {
|
|
4568
4709
|
const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
|
|
4569
|
-
for (let
|
|
4710
|
+
for (let g = 0; g <= e.yArr[1] - e.yArr[0]; g++)
|
|
4570
4711
|
for (let p = 0; p <= e.xArr[1] - e.xArr[0]; p++) {
|
|
4571
|
-
const
|
|
4572
|
-
i.set(`${
|
|
4712
|
+
const u = g + e.yArr[0], w = p + e.xArr[0];
|
|
4713
|
+
i.set(`${u}-${w}`, !0);
|
|
4573
4714
|
}
|
|
4574
4715
|
const { value: s } = e, r = s[0].length, o = s.length, n = this.ctx.autofill.xArr, h = this.ctx.autofill.yArr, c = r === 1 && o === 1;
|
|
4575
4716
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !c) {
|
|
4576
|
-
const
|
|
4717
|
+
const g = {
|
|
4577
4718
|
code: "ERR_MERGED_CELLS_AUTOFILL",
|
|
4578
4719
|
message: "Merged cells cannot span autofill data"
|
|
4579
4720
|
};
|
|
4580
|
-
this.ctx.hasEvent("error") ? this.ctx.emit("error",
|
|
4721
|
+
this.ctx.hasEvent("error") ? this.ctx.emit("error", g) : alert(g.message);
|
|
4581
4722
|
return;
|
|
4582
4723
|
}
|
|
4583
4724
|
let d = [];
|
|
4584
|
-
for (let
|
|
4725
|
+
for (let g = 0; g <= h[1] - h[0]; g++)
|
|
4585
4726
|
for (let p = 0; p <= n[1] - n[0]; p++) {
|
|
4586
|
-
const
|
|
4587
|
-
if (
|
|
4588
|
-
const { rowKey:
|
|
4589
|
-
this.ctx.database.getReadonly(
|
|
4590
|
-
rowKey:
|
|
4727
|
+
const u = p + n[0], w = g + h[0], y = s[g % o][p % r], C = this.ctx.database.getItemValueForRowIndexAndColIndex(w, u), m = `${w}-${u}`;
|
|
4728
|
+
if (C && !i.has(m)) {
|
|
4729
|
+
const { rowKey: E, key: b } = C;
|
|
4730
|
+
this.ctx.database.getReadonly(E, b) || (t.add(E), d.push({
|
|
4731
|
+
rowKey: E,
|
|
4591
4732
|
key: b,
|
|
4592
4733
|
value: y,
|
|
4593
4734
|
row: {}
|
|
@@ -4599,20 +4740,20 @@ class mi {
|
|
|
4599
4740
|
this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr;
|
|
4600
4741
|
const { BEFORE_AUTOFILL_DATA_METHOD: f } = this.ctx.config;
|
|
4601
4742
|
if (typeof f == "function") {
|
|
4602
|
-
const
|
|
4603
|
-
rowKey:
|
|
4604
|
-
key:
|
|
4605
|
-
value:
|
|
4606
|
-
oldValue: this.ctx.database.getItemValue(
|
|
4607
|
-
row: this.ctx.database.getRowDataItemForRowKey(
|
|
4743
|
+
const g = f, p = d.map((u) => ({
|
|
4744
|
+
rowKey: u.rowKey,
|
|
4745
|
+
key: u.key,
|
|
4746
|
+
value: u.value,
|
|
4747
|
+
oldValue: this.ctx.database.getItemValue(u.rowKey, u.key),
|
|
4748
|
+
row: this.ctx.database.getRowDataItemForRowKey(u.rowKey)
|
|
4608
4749
|
}));
|
|
4609
|
-
if (d = await
|
|
4750
|
+
if (d = await g(p, n, h), d && !d.length)
|
|
4610
4751
|
return;
|
|
4611
4752
|
}
|
|
4612
4753
|
this.ctx.batchSetItemValueByEditor(d, !0);
|
|
4613
4754
|
let x = [];
|
|
4614
|
-
t.forEach((
|
|
4615
|
-
x.push(this.ctx.database.getRowDataItemForRowKey(
|
|
4755
|
+
t.forEach((g) => {
|
|
4756
|
+
x.push(this.ctx.database.getRowDataItemForRowKey(g));
|
|
4616
4757
|
}), this.ctx.emit("autofillChange", d, x);
|
|
4617
4758
|
}
|
|
4618
4759
|
mouseenter(t) {
|
|
@@ -4639,7 +4780,7 @@ const rt = Math.min, U = Math.max, ft = Math.round, z = (a) => ({
|
|
|
4639
4780
|
start: "end",
|
|
4640
4781
|
end: "start"
|
|
4641
4782
|
};
|
|
4642
|
-
function
|
|
4783
|
+
function It(a, t, e) {
|
|
4643
4784
|
return U(a, rt(t, e));
|
|
4644
4785
|
}
|
|
4645
4786
|
function at(a, t) {
|
|
@@ -4689,7 +4830,7 @@ function Ri(a, t, e) {
|
|
|
4689
4830
|
return [];
|
|
4690
4831
|
}
|
|
4691
4832
|
}
|
|
4692
|
-
function
|
|
4833
|
+
function _i(a, t, e, i) {
|
|
4693
4834
|
const s = lt(a);
|
|
4694
4835
|
let r = Ri(q(a), e === "start", i);
|
|
4695
4836
|
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
|
|
@@ -4697,7 +4838,7 @@ function Ii(a, t, e, i) {
|
|
|
4697
4838
|
function xt(a) {
|
|
4698
4839
|
return a.replace(/left|right|bottom|top/g, (t) => Ei[t]);
|
|
4699
4840
|
}
|
|
4700
|
-
function
|
|
4841
|
+
function Ii(a) {
|
|
4701
4842
|
return {
|
|
4702
4843
|
top: 0,
|
|
4703
4844
|
right: 0,
|
|
@@ -4707,7 +4848,7 @@ function _i(a) {
|
|
|
4707
4848
|
};
|
|
4708
4849
|
}
|
|
4709
4850
|
function ae(a) {
|
|
4710
|
-
return typeof a != "number" ?
|
|
4851
|
+
return typeof a != "number" ? Ii(a) : {
|
|
4711
4852
|
top: a,
|
|
4712
4853
|
right: a,
|
|
4713
4854
|
bottom: a,
|
|
@@ -4738,47 +4879,47 @@ function zt(a, t, e) {
|
|
|
4738
4879
|
floating: s
|
|
4739
4880
|
} = a;
|
|
4740
4881
|
const r = J(t), o = Ht(t), n = Mt(o), h = q(t), c = r === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, x = i[n] / 2 - s[n] / 2;
|
|
4741
|
-
let
|
|
4882
|
+
let g;
|
|
4742
4883
|
switch (h) {
|
|
4743
4884
|
case "top":
|
|
4744
|
-
|
|
4885
|
+
g = {
|
|
4745
4886
|
x: d,
|
|
4746
4887
|
y: i.y - s.height
|
|
4747
4888
|
};
|
|
4748
4889
|
break;
|
|
4749
4890
|
case "bottom":
|
|
4750
|
-
|
|
4891
|
+
g = {
|
|
4751
4892
|
x: d,
|
|
4752
4893
|
y: i.y + i.height
|
|
4753
4894
|
};
|
|
4754
4895
|
break;
|
|
4755
4896
|
case "right":
|
|
4756
|
-
|
|
4897
|
+
g = {
|
|
4757
4898
|
x: i.x + i.width,
|
|
4758
4899
|
y: f
|
|
4759
4900
|
};
|
|
4760
4901
|
break;
|
|
4761
4902
|
case "left":
|
|
4762
|
-
|
|
4903
|
+
g = {
|
|
4763
4904
|
x: i.x - s.width,
|
|
4764
4905
|
y: f
|
|
4765
4906
|
};
|
|
4766
4907
|
break;
|
|
4767
4908
|
default:
|
|
4768
|
-
|
|
4909
|
+
g = {
|
|
4769
4910
|
x: i.x,
|
|
4770
4911
|
y: i.y
|
|
4771
4912
|
};
|
|
4772
4913
|
}
|
|
4773
4914
|
switch (lt(t)) {
|
|
4774
4915
|
case "start":
|
|
4775
|
-
|
|
4916
|
+
g[o] -= x * (e && c ? -1 : 1);
|
|
4776
4917
|
break;
|
|
4777
4918
|
case "end":
|
|
4778
|
-
|
|
4919
|
+
g[o] += x * (e && c ? -1 : 1);
|
|
4779
4920
|
break;
|
|
4780
4921
|
}
|
|
4781
|
-
return
|
|
4922
|
+
return g;
|
|
4782
4923
|
}
|
|
4783
4924
|
const Oi = async (a, t, e) => {
|
|
4784
4925
|
const {
|
|
@@ -4794,15 +4935,15 @@ const Oi = async (a, t, e) => {
|
|
|
4794
4935
|
}), {
|
|
4795
4936
|
x: d,
|
|
4796
4937
|
y: f
|
|
4797
|
-
} = zt(c, i, h), x = i,
|
|
4798
|
-
for (let
|
|
4938
|
+
} = zt(c, i, h), x = i, g = {}, p = 0;
|
|
4939
|
+
for (let u = 0; u < n.length; u++) {
|
|
4799
4940
|
const {
|
|
4800
4941
|
name: w,
|
|
4801
4942
|
fn: y
|
|
4802
|
-
} = n[
|
|
4803
|
-
x:
|
|
4943
|
+
} = n[u], {
|
|
4944
|
+
x: C,
|
|
4804
4945
|
y: m,
|
|
4805
|
-
data:
|
|
4946
|
+
data: E,
|
|
4806
4947
|
reset: b
|
|
4807
4948
|
} = await y({
|
|
4808
4949
|
x: d,
|
|
@@ -4810,7 +4951,7 @@ const Oi = async (a, t, e) => {
|
|
|
4810
4951
|
initialPlacement: i,
|
|
4811
4952
|
placement: x,
|
|
4812
4953
|
strategy: s,
|
|
4813
|
-
middlewareData:
|
|
4954
|
+
middlewareData: g,
|
|
4814
4955
|
rects: c,
|
|
4815
4956
|
platform: o,
|
|
4816
4957
|
elements: {
|
|
@@ -4818,11 +4959,11 @@ const Oi = async (a, t, e) => {
|
|
|
4818
4959
|
floating: t
|
|
4819
4960
|
}
|
|
4820
4961
|
});
|
|
4821
|
-
d =
|
|
4822
|
-
...
|
|
4962
|
+
d = C ?? d, f = m ?? f, g = {
|
|
4963
|
+
...g,
|
|
4823
4964
|
[w]: {
|
|
4824
|
-
...
|
|
4825
|
-
...
|
|
4965
|
+
...g[w],
|
|
4966
|
+
...E
|
|
4826
4967
|
}
|
|
4827
4968
|
}, b && p <= 50 && (p++, typeof b == "object" && (b.placement && (x = b.placement), b.rects && (c = b.rects === !0 ? await o.getElementRects({
|
|
4828
4969
|
reference: a,
|
|
@@ -4831,14 +4972,14 @@ const Oi = async (a, t, e) => {
|
|
|
4831
4972
|
}) : b.rects), {
|
|
4832
4973
|
x: d,
|
|
4833
4974
|
y: f
|
|
4834
|
-
} = zt(c, x, h)),
|
|
4975
|
+
} = zt(c, x, h)), u = -1);
|
|
4835
4976
|
}
|
|
4836
4977
|
return {
|
|
4837
4978
|
x: d,
|
|
4838
4979
|
y: f,
|
|
4839
4980
|
placement: x,
|
|
4840
4981
|
strategy: s,
|
|
4841
|
-
middlewareData:
|
|
4982
|
+
middlewareData: g
|
|
4842
4983
|
};
|
|
4843
4984
|
};
|
|
4844
4985
|
async function le(a, t) {
|
|
@@ -4856,18 +4997,18 @@ async function le(a, t) {
|
|
|
4856
4997
|
rootBoundary: d = "viewport",
|
|
4857
4998
|
elementContext: f = "floating",
|
|
4858
4999
|
altBoundary: x = !1,
|
|
4859
|
-
padding:
|
|
4860
|
-
} = at(t, a), p = ae(
|
|
5000
|
+
padding: g = 0
|
|
5001
|
+
} = at(t, a), p = ae(g), w = n[x ? f === "floating" ? "reference" : "floating" : f], y = ut(await r.getClippingRect({
|
|
4861
5002
|
element: (e = await (r.isElement == null ? void 0 : r.isElement(w))) == null || e ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(n.floating)),
|
|
4862
5003
|
boundary: c,
|
|
4863
5004
|
rootBoundary: d,
|
|
4864
5005
|
strategy: h
|
|
4865
|
-
})),
|
|
5006
|
+
})), C = f === "floating" ? {
|
|
4866
5007
|
x: i,
|
|
4867
5008
|
y: s,
|
|
4868
5009
|
width: o.floating.width,
|
|
4869
5010
|
height: o.floating.height
|
|
4870
|
-
} : o.reference, m = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(n.floating)),
|
|
5011
|
+
} : o.reference, m = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(n.floating)), E = await (r.isElement == null ? void 0 : r.isElement(m)) ? await (r.getScale == null ? void 0 : r.getScale(m)) || {
|
|
4871
5012
|
x: 1,
|
|
4872
5013
|
y: 1
|
|
4873
5014
|
} : {
|
|
@@ -4875,15 +5016,15 @@ async function le(a, t) {
|
|
|
4875
5016
|
y: 1
|
|
4876
5017
|
}, b = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
4877
5018
|
elements: n,
|
|
4878
|
-
rect:
|
|
5019
|
+
rect: C,
|
|
4879
5020
|
offsetParent: m,
|
|
4880
5021
|
strategy: h
|
|
4881
|
-
}) :
|
|
5022
|
+
}) : C);
|
|
4882
5023
|
return {
|
|
4883
|
-
top: (y.top - b.top + p.top) /
|
|
4884
|
-
bottom: (b.bottom - y.bottom + p.bottom) /
|
|
4885
|
-
left: (y.left - b.left + p.left) /
|
|
4886
|
-
right: (b.right - y.right + p.right) /
|
|
5024
|
+
top: (y.top - b.top + p.top) / E.y,
|
|
5025
|
+
bottom: (b.bottom - y.bottom + p.bottom) / E.y,
|
|
5026
|
+
left: (y.left - b.left + p.left) / E.x,
|
|
5027
|
+
right: (b.right - y.right + p.right) / E.x
|
|
4887
5028
|
};
|
|
4888
5029
|
}
|
|
4889
5030
|
const Si = (a) => ({
|
|
@@ -4907,23 +5048,23 @@ const Si = (a) => ({
|
|
|
4907
5048
|
const f = ae(d), x = {
|
|
4908
5049
|
x: e,
|
|
4909
5050
|
y: i
|
|
4910
|
-
},
|
|
4911
|
-
let
|
|
4912
|
-
(!
|
|
4913
|
-
const
|
|
5051
|
+
}, g = Ht(s), p = Mt(g), u = await o.getDimensions(c), w = g === "y", y = w ? "top" : "left", C = w ? "bottom" : "right", m = w ? "clientHeight" : "clientWidth", E = r.reference[p] + r.reference[g] - x[g] - r.floating[p], b = x[g] - r.reference[g], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
|
|
5052
|
+
let O = R ? R[m] : 0;
|
|
5053
|
+
(!O || !await (o.isElement == null ? void 0 : o.isElement(R))) && (O = n.floating[m] || r.floating[p]);
|
|
5054
|
+
const L = E / 2 - b / 2, _ = O / 2 - u[p] / 2 - 1, v = rt(f[y], _), A = rt(f[C], _), S = v, M = O - u[p] - A, T = O / 2 - u[p] / 2 + L, B = It(S, T, M), Y = !h.arrow && lt(s) != null && T !== B && r.reference[p] / 2 - (T < S ? v : A) - u[p] / 2 < 0, k = Y ? T < S ? T - S : T - M : 0;
|
|
4914
5055
|
return {
|
|
4915
|
-
[
|
|
5056
|
+
[g]: x[g] + k,
|
|
4916
5057
|
data: {
|
|
4917
|
-
[
|
|
4918
|
-
centerOffset:
|
|
5058
|
+
[g]: B,
|
|
5059
|
+
centerOffset: T - B - k,
|
|
4919
5060
|
...Y && {
|
|
4920
|
-
alignmentOffset:
|
|
5061
|
+
alignmentOffset: k
|
|
4921
5062
|
}
|
|
4922
5063
|
},
|
|
4923
5064
|
reset: Y
|
|
4924
5065
|
};
|
|
4925
5066
|
}
|
|
4926
|
-
}),
|
|
5067
|
+
}), Li = function(a) {
|
|
4927
5068
|
return a === void 0 && (a = {}), {
|
|
4928
5069
|
name: "flip",
|
|
4929
5070
|
options: a,
|
|
@@ -4940,52 +5081,52 @@ const Si = (a) => ({
|
|
|
4940
5081
|
mainAxis: d = !0,
|
|
4941
5082
|
crossAxis: f = !0,
|
|
4942
5083
|
fallbackPlacements: x,
|
|
4943
|
-
fallbackStrategy:
|
|
5084
|
+
fallbackStrategy: g = "bestFit",
|
|
4944
5085
|
fallbackAxisSideDirection: p = "none",
|
|
4945
|
-
flipAlignment:
|
|
5086
|
+
flipAlignment: u = !0,
|
|
4946
5087
|
...w
|
|
4947
5088
|
} = at(a, t);
|
|
4948
5089
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
4949
5090
|
return {};
|
|
4950
|
-
const y = q(s),
|
|
4951
|
-
!x && R && b.push(...
|
|
4952
|
-
const
|
|
5091
|
+
const y = q(s), C = J(n), m = q(n) === n, E = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), b = x || (m || !u ? [xt(n)] : vi(n)), R = p !== "none";
|
|
5092
|
+
!x && R && b.push(..._i(n, u, p, E));
|
|
5093
|
+
const O = [n, ...b], L = await le(t, w), _ = [];
|
|
4953
5094
|
let v = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
4954
|
-
if (d &&
|
|
4955
|
-
const
|
|
4956
|
-
|
|
5095
|
+
if (d && _.push(L[y]), f) {
|
|
5096
|
+
const T = bi(s, o, E);
|
|
5097
|
+
_.push(L[T[0]], L[T[1]]);
|
|
4957
5098
|
}
|
|
4958
5099
|
if (v = [...v, {
|
|
4959
5100
|
placement: s,
|
|
4960
|
-
overflows:
|
|
4961
|
-
}], !
|
|
4962
|
-
var
|
|
4963
|
-
const
|
|
4964
|
-
if (
|
|
5101
|
+
overflows: _
|
|
5102
|
+
}], !_.every((T) => T <= 0)) {
|
|
5103
|
+
var A, S;
|
|
5104
|
+
const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, B = O[T];
|
|
5105
|
+
if (B)
|
|
4965
5106
|
return {
|
|
4966
5107
|
data: {
|
|
4967
|
-
index:
|
|
5108
|
+
index: T,
|
|
4968
5109
|
overflows: v
|
|
4969
5110
|
},
|
|
4970
5111
|
reset: {
|
|
4971
|
-
placement:
|
|
5112
|
+
placement: B
|
|
4972
5113
|
}
|
|
4973
5114
|
};
|
|
4974
|
-
let Y = (
|
|
5115
|
+
let Y = (S = v.filter((k) => k.overflows[0] <= 0).sort((k, W) => k.overflows[1] - W.overflows[1])[0]) == null ? void 0 : S.placement;
|
|
4975
5116
|
if (!Y)
|
|
4976
|
-
switch (
|
|
5117
|
+
switch (g) {
|
|
4977
5118
|
case "bestFit": {
|
|
4978
5119
|
var M;
|
|
4979
|
-
const
|
|
5120
|
+
const k = (M = v.filter((W) => {
|
|
4980
5121
|
if (R) {
|
|
4981
5122
|
const P = J(W.placement);
|
|
4982
|
-
return P ===
|
|
5123
|
+
return P === C || // Create a bias to the `y` side axis due to horizontal
|
|
4983
5124
|
// reading directions favoring greater width.
|
|
4984
5125
|
P === "y";
|
|
4985
5126
|
}
|
|
4986
5127
|
return !0;
|
|
4987
5128
|
}).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, Ee) => P + Ee, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 : M[0];
|
|
4988
|
-
|
|
5129
|
+
k && (Y = k);
|
|
4989
5130
|
break;
|
|
4990
5131
|
}
|
|
4991
5132
|
case "initialPlacement":
|
|
@@ -5003,7 +5144,7 @@ const Si = (a) => ({
|
|
|
5003
5144
|
}
|
|
5004
5145
|
};
|
|
5005
5146
|
};
|
|
5006
|
-
async function
|
|
5147
|
+
async function Ai(a, t) {
|
|
5007
5148
|
const {
|
|
5008
5149
|
placement: e,
|
|
5009
5150
|
platform: i,
|
|
@@ -5011,7 +5152,7 @@ async function Ti(a, t) {
|
|
|
5011
5152
|
} = a, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), n = lt(e), h = J(e) === "y", c = ["left", "top"].includes(o) ? -1 : 1, d = r && h ? -1 : 1, f = at(t, a);
|
|
5012
5153
|
let {
|
|
5013
5154
|
mainAxis: x,
|
|
5014
|
-
crossAxis:
|
|
5155
|
+
crossAxis: g,
|
|
5015
5156
|
alignmentAxis: p
|
|
5016
5157
|
} = typeof f == "number" ? {
|
|
5017
5158
|
mainAxis: f,
|
|
@@ -5022,15 +5163,15 @@ async function Ti(a, t) {
|
|
|
5022
5163
|
crossAxis: f.crossAxis || 0,
|
|
5023
5164
|
alignmentAxis: f.alignmentAxis
|
|
5024
5165
|
};
|
|
5025
|
-
return n && typeof p == "number" && (
|
|
5026
|
-
x:
|
|
5166
|
+
return n && typeof p == "number" && (g = n === "end" ? p * -1 : p), h ? {
|
|
5167
|
+
x: g * d,
|
|
5027
5168
|
y: x * c
|
|
5028
5169
|
} : {
|
|
5029
5170
|
x: x * c,
|
|
5030
|
-
y:
|
|
5171
|
+
y: g * d
|
|
5031
5172
|
};
|
|
5032
5173
|
}
|
|
5033
|
-
const
|
|
5174
|
+
const Ti = function(a) {
|
|
5034
5175
|
return a === void 0 && (a = 0), {
|
|
5035
5176
|
name: "offset",
|
|
5036
5177
|
options: a,
|
|
@@ -5041,7 +5182,7 @@ const Li = function(a) {
|
|
|
5041
5182
|
y: r,
|
|
5042
5183
|
placement: o,
|
|
5043
5184
|
middlewareData: n
|
|
5044
|
-
} = t, h = await
|
|
5185
|
+
} = t, h = await Ai(t, a);
|
|
5045
5186
|
return o === ((e = n.offset) == null ? void 0 : e.placement) && (i = n.arrow) != null && i.alignmentOffset ? {} : {
|
|
5046
5187
|
x: s + h.x,
|
|
5047
5188
|
y: r + h.y,
|
|
@@ -5068,11 +5209,11 @@ const Li = function(a) {
|
|
|
5068
5209
|
fn: (w) => {
|
|
5069
5210
|
let {
|
|
5070
5211
|
x: y,
|
|
5071
|
-
y:
|
|
5212
|
+
y: C
|
|
5072
5213
|
} = w;
|
|
5073
5214
|
return {
|
|
5074
5215
|
x: y,
|
|
5075
|
-
y:
|
|
5216
|
+
y: C
|
|
5076
5217
|
};
|
|
5077
5218
|
}
|
|
5078
5219
|
},
|
|
@@ -5081,25 +5222,25 @@ const Li = function(a) {
|
|
|
5081
5222
|
x: e,
|
|
5082
5223
|
y: i
|
|
5083
5224
|
}, d = await le(t, h), f = J(q(s)), x = ne(f);
|
|
5084
|
-
let
|
|
5225
|
+
let g = c[x], p = c[f];
|
|
5085
5226
|
if (r) {
|
|
5086
|
-
const w = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right",
|
|
5087
|
-
|
|
5227
|
+
const w = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", C = g + d[w], m = g - d[y];
|
|
5228
|
+
g = It(C, g, m);
|
|
5088
5229
|
}
|
|
5089
5230
|
if (o) {
|
|
5090
|
-
const w = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right",
|
|
5091
|
-
p =
|
|
5231
|
+
const w = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", C = p + d[w], m = p - d[y];
|
|
5232
|
+
p = It(C, p, m);
|
|
5092
5233
|
}
|
|
5093
|
-
const
|
|
5234
|
+
const u = n.fn({
|
|
5094
5235
|
...t,
|
|
5095
|
-
[x]:
|
|
5236
|
+
[x]: g,
|
|
5096
5237
|
[f]: p
|
|
5097
5238
|
});
|
|
5098
5239
|
return {
|
|
5099
|
-
...
|
|
5240
|
+
...u,
|
|
5100
5241
|
data: {
|
|
5101
|
-
x:
|
|
5102
|
-
y:
|
|
5242
|
+
x: u.x - e,
|
|
5243
|
+
y: u.y - i,
|
|
5103
5244
|
enabled: {
|
|
5104
5245
|
[x]: r,
|
|
5105
5246
|
[f]: o
|
|
@@ -5129,7 +5270,7 @@ function he(a) {
|
|
|
5129
5270
|
function X(a) {
|
|
5130
5271
|
return gt() ? a instanceof Element || a instanceof F(a).Element : !1;
|
|
5131
5272
|
}
|
|
5132
|
-
function
|
|
5273
|
+
function K(a) {
|
|
5133
5274
|
return gt() ? a instanceof HTMLElement || a instanceof F(a).HTMLElement : !1;
|
|
5134
5275
|
}
|
|
5135
5276
|
function $t(a) {
|
|
@@ -5141,7 +5282,7 @@ function ht(a) {
|
|
|
5141
5282
|
overflowX: e,
|
|
5142
5283
|
overflowY: i,
|
|
5143
5284
|
display: s
|
|
5144
|
-
} =
|
|
5285
|
+
} = N(a);
|
|
5145
5286
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
|
|
5146
5287
|
}
|
|
5147
5288
|
function Hi(a) {
|
|
@@ -5157,12 +5298,12 @@ function wt(a) {
|
|
|
5157
5298
|
});
|
|
5158
5299
|
}
|
|
5159
5300
|
function Dt(a) {
|
|
5160
|
-
const t = Ft(), e = X(a) ?
|
|
5301
|
+
const t = Ft(), e = X(a) ? N(a) : a;
|
|
5161
5302
|
return e.transform !== "none" || e.perspective !== "none" || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (e.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (e.contain || "").includes(i));
|
|
5162
5303
|
}
|
|
5163
5304
|
function Di(a) {
|
|
5164
5305
|
let t = $(a);
|
|
5165
|
-
for (;
|
|
5306
|
+
for (; K(t) && !Q(t); ) {
|
|
5166
5307
|
if (Dt(t))
|
|
5167
5308
|
return t;
|
|
5168
5309
|
if (wt(t))
|
|
@@ -5177,7 +5318,7 @@ function Ft() {
|
|
|
5177
5318
|
function Q(a) {
|
|
5178
5319
|
return ["html", "body", "#document"].includes(tt(a));
|
|
5179
5320
|
}
|
|
5180
|
-
function
|
|
5321
|
+
function N(a) {
|
|
5181
5322
|
return F(a).getComputedStyle(a);
|
|
5182
5323
|
}
|
|
5183
5324
|
function pt(a) {
|
|
@@ -5203,25 +5344,25 @@ function $(a) {
|
|
|
5203
5344
|
}
|
|
5204
5345
|
function ce(a) {
|
|
5205
5346
|
const t = $(a);
|
|
5206
|
-
return Q(t) ? a.ownerDocument ? a.ownerDocument.body : a.body :
|
|
5347
|
+
return Q(t) ? a.ownerDocument ? a.ownerDocument.body : a.body : K(t) && ht(t) ? t : ce(t);
|
|
5207
5348
|
}
|
|
5208
5349
|
function St(a, t, e) {
|
|
5209
5350
|
var i;
|
|
5210
5351
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
5211
5352
|
const s = ce(a), r = s === ((i = a.ownerDocument) == null ? void 0 : i.body), o = F(s);
|
|
5212
5353
|
if (r) {
|
|
5213
|
-
const n =
|
|
5354
|
+
const n = Lt(o);
|
|
5214
5355
|
return t.concat(o, o.visualViewport || [], ht(s) ? s : [], n && e ? St(n) : []);
|
|
5215
5356
|
}
|
|
5216
5357
|
return t.concat(s, St(s, [], e));
|
|
5217
5358
|
}
|
|
5218
|
-
function
|
|
5359
|
+
function Lt(a) {
|
|
5219
5360
|
return a.parent && Object.getPrototypeOf(a.parent) ? a.frameElement : null;
|
|
5220
5361
|
}
|
|
5221
5362
|
function de(a) {
|
|
5222
|
-
const t =
|
|
5363
|
+
const t = N(a);
|
|
5223
5364
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
5224
|
-
const s =
|
|
5365
|
+
const s = K(a), r = s ? a.offsetWidth : e, o = s ? a.offsetHeight : i, n = ft(e) !== r || ft(i) !== o;
|
|
5225
5366
|
return n && (e = r, i = o), {
|
|
5226
5367
|
width: e,
|
|
5227
5368
|
height: i,
|
|
@@ -5233,7 +5374,7 @@ function fe(a) {
|
|
|
5233
5374
|
}
|
|
5234
5375
|
function Z(a) {
|
|
5235
5376
|
const t = fe(a);
|
|
5236
|
-
if (!
|
|
5377
|
+
if (!K(t))
|
|
5237
5378
|
return z(1);
|
|
5238
5379
|
const e = t.getBoundingClientRect(), {
|
|
5239
5380
|
width: i,
|
|
@@ -5265,11 +5406,11 @@ function ot(a, t, e, i) {
|
|
|
5265
5406
|
const n = Xi(r, e, i) ? xe(r) : z(0);
|
|
5266
5407
|
let h = (s.left + n.x) / o.x, c = (s.top + n.y) / o.y, d = s.width / o.x, f = s.height / o.y;
|
|
5267
5408
|
if (r) {
|
|
5268
|
-
const x = F(r),
|
|
5269
|
-
let p = x,
|
|
5270
|
-
for (;
|
|
5271
|
-
const w = Z(
|
|
5272
|
-
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += m, c +=
|
|
5409
|
+
const x = F(r), g = i && X(i) ? F(i) : i;
|
|
5410
|
+
let p = x, u = Lt(p);
|
|
5411
|
+
for (; u && i && g !== p; ) {
|
|
5412
|
+
const w = Z(u), y = u.getBoundingClientRect(), C = N(u), m = y.left + (u.clientLeft + parseFloat(C.paddingLeft)) * w.x, E = y.top + (u.clientTop + parseFloat(C.paddingTop)) * w.y;
|
|
5413
|
+
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += m, c += E, p = F(u), u = Lt(p);
|
|
5273
5414
|
}
|
|
5274
5415
|
}
|
|
5275
5416
|
return ut({
|
|
@@ -5279,7 +5420,7 @@ function ot(a, t, e, i) {
|
|
|
5279
5420
|
y: c
|
|
5280
5421
|
});
|
|
5281
5422
|
}
|
|
5282
|
-
function
|
|
5423
|
+
function Ni(a) {
|
|
5283
5424
|
let {
|
|
5284
5425
|
elements: t,
|
|
5285
5426
|
rect: e,
|
|
@@ -5293,8 +5434,8 @@ function ki(a) {
|
|
|
5293
5434
|
scrollLeft: 0,
|
|
5294
5435
|
scrollTop: 0
|
|
5295
5436
|
}, c = z(1);
|
|
5296
|
-
const d = z(0), f =
|
|
5297
|
-
if ((f || !f && !r) && ((tt(i) !== "body" || ht(o)) && (h = pt(i)),
|
|
5437
|
+
const d = z(0), f = K(i);
|
|
5438
|
+
if ((f || !f && !r) && ((tt(i) !== "body" || ht(o)) && (h = pt(i)), K(i))) {
|
|
5298
5439
|
const x = ot(i);
|
|
5299
5440
|
c = Z(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
|
|
5300
5441
|
}
|
|
@@ -5305,25 +5446,25 @@ function ki(a) {
|
|
|
5305
5446
|
y: e.y * c.y - h.scrollTop * c.y + d.y
|
|
5306
5447
|
};
|
|
5307
5448
|
}
|
|
5308
|
-
function
|
|
5449
|
+
function Bi(a) {
|
|
5309
5450
|
return Array.from(a.getClientRects());
|
|
5310
5451
|
}
|
|
5311
|
-
function
|
|
5452
|
+
function At(a, t) {
|
|
5312
5453
|
const e = pt(a).scrollLeft;
|
|
5313
5454
|
return t ? t.left + e : ot(V(a)).left + e;
|
|
5314
5455
|
}
|
|
5315
|
-
function
|
|
5456
|
+
function ki(a) {
|
|
5316
5457
|
const t = V(a), e = pt(a), i = a.ownerDocument.body, s = U(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), r = U(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
|
|
5317
|
-
let o = -e.scrollLeft +
|
|
5458
|
+
let o = -e.scrollLeft + At(a);
|
|
5318
5459
|
const n = -e.scrollTop;
|
|
5319
|
-
return
|
|
5460
|
+
return N(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
|
|
5320
5461
|
width: s,
|
|
5321
5462
|
height: r,
|
|
5322
5463
|
x: o,
|
|
5323
5464
|
y: n
|
|
5324
5465
|
};
|
|
5325
5466
|
}
|
|
5326
|
-
function
|
|
5467
|
+
function Ki(a, t) {
|
|
5327
5468
|
const e = F(a), i = V(a), s = e.visualViewport;
|
|
5328
5469
|
let r = i.clientWidth, o = i.clientHeight, n = 0, h = 0;
|
|
5329
5470
|
if (s) {
|
|
@@ -5339,7 +5480,7 @@ function Bi(a, t) {
|
|
|
5339
5480
|
};
|
|
5340
5481
|
}
|
|
5341
5482
|
function Yi(a, t) {
|
|
5342
|
-
const e = ot(a, !0, t === "fixed"), i = e.top + a.clientTop, s = e.left + a.clientLeft, r =
|
|
5483
|
+
const e = ot(a, !0, t === "fixed"), i = e.top + a.clientTop, s = e.left + a.clientLeft, r = K(a) ? Z(a) : z(1), o = a.clientWidth * r.x, n = a.clientHeight * r.y, h = s * r.x, c = i * r.y;
|
|
5343
5484
|
return {
|
|
5344
5485
|
width: o,
|
|
5345
5486
|
height: n,
|
|
@@ -5350,9 +5491,9 @@ function Yi(a, t) {
|
|
|
5350
5491
|
function Gt(a, t, e) {
|
|
5351
5492
|
let i;
|
|
5352
5493
|
if (t === "viewport")
|
|
5353
|
-
i =
|
|
5494
|
+
i = Ki(a, e);
|
|
5354
5495
|
else if (t === "document")
|
|
5355
|
-
i =
|
|
5496
|
+
i = ki(V(a));
|
|
5356
5497
|
else if (X(t))
|
|
5357
5498
|
i = Yi(t, e);
|
|
5358
5499
|
else {
|
|
@@ -5367,17 +5508,17 @@ function Gt(a, t, e) {
|
|
|
5367
5508
|
}
|
|
5368
5509
|
function ue(a, t) {
|
|
5369
5510
|
const e = $(a);
|
|
5370
|
-
return e === t || !X(e) || Q(e) ? !1 :
|
|
5511
|
+
return e === t || !X(e) || Q(e) ? !1 : N(e).position === "fixed" || ue(e, t);
|
|
5371
5512
|
}
|
|
5372
5513
|
function Vi(a, t) {
|
|
5373
5514
|
const e = t.get(a);
|
|
5374
5515
|
if (e)
|
|
5375
5516
|
return e;
|
|
5376
5517
|
let i = St(a, [], !1).filter((n) => X(n) && tt(n) !== "body"), s = null;
|
|
5377
|
-
const r =
|
|
5518
|
+
const r = N(a).position === "fixed";
|
|
5378
5519
|
let o = r ? $(a) : a;
|
|
5379
5520
|
for (; X(o) && !Q(o); ) {
|
|
5380
|
-
const n =
|
|
5521
|
+
const n = N(o), h = Dt(o);
|
|
5381
5522
|
!h && n.position === "fixed" && (s = null), (r ? !h && !s : !h && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && ue(a, o)) ? i = i.filter((d) => d !== o) : s = n, o = $(o);
|
|
5382
5523
|
}
|
|
5383
5524
|
return t.set(a, i), i;
|
|
@@ -5411,7 +5552,7 @@ function Pi(a) {
|
|
|
5411
5552
|
};
|
|
5412
5553
|
}
|
|
5413
5554
|
function zi(a, t, e) {
|
|
5414
|
-
const i =
|
|
5555
|
+
const i = K(t), s = V(t), r = e === "fixed", o = ot(a, !0, r, t);
|
|
5415
5556
|
let n = {
|
|
5416
5557
|
scrollLeft: 0,
|
|
5417
5558
|
scrollTop: 0
|
|
@@ -5419,14 +5560,14 @@ function zi(a, t, e) {
|
|
|
5419
5560
|
const h = z(0);
|
|
5420
5561
|
if (i || !i && !r)
|
|
5421
5562
|
if ((tt(t) !== "body" || ht(s)) && (n = pt(t)), i) {
|
|
5422
|
-
const
|
|
5423
|
-
h.x =
|
|
5424
|
-
} else s && (h.x =
|
|
5563
|
+
const g = ot(t, !0, r, t);
|
|
5564
|
+
h.x = g.x + t.clientLeft, h.y = g.y + t.clientTop;
|
|
5565
|
+
} else s && (h.x = At(s));
|
|
5425
5566
|
let c = 0, d = 0;
|
|
5426
5567
|
if (s && !i && !r) {
|
|
5427
|
-
const
|
|
5428
|
-
d =
|
|
5429
|
-
|
|
5568
|
+
const g = s.getBoundingClientRect();
|
|
5569
|
+
d = g.top + n.scrollTop, c = g.left + n.scrollLeft - // RTL <body> scrollbar.
|
|
5570
|
+
At(s, g);
|
|
5430
5571
|
}
|
|
5431
5572
|
const f = o.left + n.scrollLeft - h.x - c, x = o.top + n.scrollTop - h.y - d;
|
|
5432
5573
|
return {
|
|
@@ -5437,10 +5578,10 @@ function zi(a, t, e) {
|
|
|
5437
5578
|
};
|
|
5438
5579
|
}
|
|
5439
5580
|
function mt(a) {
|
|
5440
|
-
return
|
|
5581
|
+
return N(a).position === "static";
|
|
5441
5582
|
}
|
|
5442
5583
|
function qt(a, t) {
|
|
5443
|
-
if (!
|
|
5584
|
+
if (!K(a) || N(a).position === "fixed")
|
|
5444
5585
|
return null;
|
|
5445
5586
|
if (t)
|
|
5446
5587
|
return t(a);
|
|
@@ -5451,7 +5592,7 @@ function ge(a, t) {
|
|
|
5451
5592
|
const e = F(a);
|
|
5452
5593
|
if (wt(a))
|
|
5453
5594
|
return e;
|
|
5454
|
-
if (!
|
|
5595
|
+
if (!K(a)) {
|
|
5455
5596
|
let s = $(a);
|
|
5456
5597
|
for (; s && !Q(s); ) {
|
|
5457
5598
|
if (X(s) && !mt(s))
|
|
@@ -5478,20 +5619,20 @@ const $i = async function(a) {
|
|
|
5478
5619
|
};
|
|
5479
5620
|
};
|
|
5480
5621
|
function Gi(a) {
|
|
5481
|
-
return
|
|
5622
|
+
return N(a).direction === "rtl";
|
|
5482
5623
|
}
|
|
5483
5624
|
const qi = {
|
|
5484
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
5625
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Ni,
|
|
5485
5626
|
getDocumentElement: V,
|
|
5486
5627
|
getClippingRect: Wi,
|
|
5487
5628
|
getOffsetParent: ge,
|
|
5488
5629
|
getElementRects: $i,
|
|
5489
|
-
getClientRects:
|
|
5630
|
+
getClientRects: Bi,
|
|
5490
5631
|
getDimensions: Pi,
|
|
5491
5632
|
getScale: Z,
|
|
5492
5633
|
isElement: X,
|
|
5493
5634
|
isRTL: Gi
|
|
5494
|
-
}, we =
|
|
5635
|
+
}, we = Ti, pe = Mi, ye = Li, ji = Si, me = (a, t, e) => {
|
|
5495
5636
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
5496
5637
|
platform: qi,
|
|
5497
5638
|
...e
|
|
@@ -5544,10 +5685,10 @@ let Ui = class {
|
|
|
5544
5685
|
e && (t.clientX < e.x || t.clientX > e.x + e.width || t.clientY < e.y || t.clientY > e.y + e.height) && this.hide();
|
|
5545
5686
|
}), this.ctx.on("startEdit", () => {
|
|
5546
5687
|
this.hide();
|
|
5547
|
-
}), this.ctx.on("visibleCellHoverChange", (t) => {
|
|
5548
|
-
(t.ellipsis || t.message) && this.show(t);
|
|
5549
|
-
}), this.ctx.on("visibleCellMouseleave", () => {
|
|
5550
|
-
this.hide();
|
|
5688
|
+
}), this.ctx.on("visibleCellHoverChange", (t, e) => {
|
|
5689
|
+
this.floatingEl.contains(e.target) || (t.ellipsis || t.message) && this.show(t);
|
|
5690
|
+
}), this.ctx.on("visibleCellMouseleave", (t, e) => {
|
|
5691
|
+
this.floatingEl.contains(e.target) || this.hide();
|
|
5551
5692
|
});
|
|
5552
5693
|
}
|
|
5553
5694
|
show(t) {
|
|
@@ -5663,6 +5804,10 @@ class Zi {
|
|
|
5663
5804
|
this.ctx.emit("setMoveFocus", "BOTTOM");
|
|
5664
5805
|
return;
|
|
5665
5806
|
}
|
|
5807
|
+
if (t.code === "Enter" && !this.ctx.editing) {
|
|
5808
|
+
t.preventDefault(), this.startEdit();
|
|
5809
|
+
return;
|
|
5810
|
+
}
|
|
5666
5811
|
const e = t.key, i = t.ctrlKey, s = t.altKey, r = t.shiftKey, o = t.metaKey;
|
|
5667
5812
|
i || s || r || o || [
|
|
5668
5813
|
"Enter",
|
|
@@ -5742,21 +5887,21 @@ class Zi {
|
|
|
5742
5887
|
}
|
|
5743
5888
|
startEditByInput(t, e = !1) {
|
|
5744
5889
|
const i = e ? null : t.getValue(), { editorType: s } = t;
|
|
5745
|
-
this.ctx.config.ENABLE_MERGE_CELL_LINK && t.updateSpanInfo();
|
|
5746
|
-
let {
|
|
5747
|
-
this.drawX =
|
|
5890
|
+
t.update(), this.ctx.config.ENABLE_MERGE_CELL_LINK && t.updateSpanInfo();
|
|
5891
|
+
let { height: r, width: o, drawY: n, drawX: h } = t;
|
|
5892
|
+
this.drawX = h, this.drawY = n;
|
|
5748
5893
|
const {
|
|
5749
5894
|
config: { CELL_PADDING: c },
|
|
5750
5895
|
header: d
|
|
5751
5896
|
} = this.ctx;
|
|
5752
5897
|
let f = this.ctx.body.visibleHeight;
|
|
5753
|
-
if (
|
|
5754
|
-
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${
|
|
5898
|
+
if (r > f && (r = f), this.editorEl.style.display = "inline-block", this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = `${this.drawY - 1}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text") {
|
|
5899
|
+
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${o - 1}px`, this.inputEl.style.minHeight = `${r - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${o - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${c}px`, i !== null && (this.inputEl.value = i), this.inputEl.focus();
|
|
5755
5900
|
const x = this.inputEl.value.length;
|
|
5756
5901
|
this.inputEl.setSelectionRange(x, x);
|
|
5757
5902
|
} else
|
|
5758
5903
|
this.inputEl.style.display = "none";
|
|
5759
|
-
(this.inputEl.scrollHeight >
|
|
5904
|
+
(this.inputEl.scrollHeight > r || this.drawY < d.height) && this.autoSize();
|
|
5760
5905
|
}
|
|
5761
5906
|
doneEditByInput() {
|
|
5762
5907
|
if (this.cellTarget && this.cellTarget.editorType === "text") {
|
|
@@ -5871,7 +6016,7 @@ class Qi {
|
|
|
5871
6016
|
height: `${o}px`
|
|
5872
6017
|
},
|
|
5873
6018
|
cells: c
|
|
5874
|
-
},
|
|
6019
|
+
}, g = {
|
|
5875
6020
|
key: "center",
|
|
5876
6021
|
style: {
|
|
5877
6022
|
position: "absolute",
|
|
@@ -5903,7 +6048,7 @@ class Qi {
|
|
|
5903
6048
|
width: `${r}px`,
|
|
5904
6049
|
height: `${o}px`
|
|
5905
6050
|
},
|
|
5906
|
-
views: [x,
|
|
6051
|
+
views: [x, g, p]
|
|
5907
6052
|
};
|
|
5908
6053
|
}
|
|
5909
6054
|
getBody() {
|
|
@@ -5929,7 +6074,7 @@ class Qi {
|
|
|
5929
6074
|
height: `${d}px`
|
|
5930
6075
|
},
|
|
5931
6076
|
cells: e
|
|
5932
|
-
},
|
|
6077
|
+
}, g = {
|
|
5933
6078
|
key: "center",
|
|
5934
6079
|
style: {
|
|
5935
6080
|
position: "absolute",
|
|
@@ -5961,13 +6106,13 @@ class Qi {
|
|
|
5961
6106
|
width: `${c}px`,
|
|
5962
6107
|
height: `${d}px`
|
|
5963
6108
|
},
|
|
5964
|
-
views: [x,
|
|
6109
|
+
views: [x, g, p]
|
|
5965
6110
|
};
|
|
5966
6111
|
}
|
|
5967
6112
|
getFooter() {
|
|
5968
6113
|
const t = [], e = [], i = [];
|
|
5969
|
-
this.ctx.footer.renderRows.forEach((
|
|
5970
|
-
|
|
6114
|
+
this.ctx.footer.renderRows.forEach((u) => {
|
|
6115
|
+
u.cells.forEach((w) => {
|
|
5971
6116
|
w.cellType === "footer" && w.renderFooter && (w.render = w.renderFooter, w.fixed === "left" ? e.push(w) : w.fixed === "right" ? i.push(w) : t.push(w));
|
|
5972
6117
|
});
|
|
5973
6118
|
});
|
|
@@ -5997,7 +6142,7 @@ class Qi {
|
|
|
5997
6142
|
height: `${c}px`
|
|
5998
6143
|
},
|
|
5999
6144
|
cells: t
|
|
6000
|
-
},
|
|
6145
|
+
}, g = {
|
|
6001
6146
|
key: "right",
|
|
6002
6147
|
style: {
|
|
6003
6148
|
position: "absolute",
|
|
@@ -6018,7 +6163,7 @@ class Qi {
|
|
|
6018
6163
|
width: `${h}px`,
|
|
6019
6164
|
height: `${c}px`
|
|
6020
6165
|
},
|
|
6021
|
-
views: [f, x,
|
|
6166
|
+
views: [f, x, g]
|
|
6022
6167
|
};
|
|
6023
6168
|
}
|
|
6024
6169
|
}
|
|
@@ -6051,8 +6196,8 @@ class ts {
|
|
|
6051
6196
|
me(x, this.contextMenuEl, {
|
|
6052
6197
|
placement: "right-start",
|
|
6053
6198
|
middleware: [we(), pe(), ye()]
|
|
6054
|
-
}).then(({ x:
|
|
6055
|
-
this.show(
|
|
6199
|
+
}).then(({ x: g, y: p }) => {
|
|
6200
|
+
this.show(g, p);
|
|
6056
6201
|
});
|
|
6057
6202
|
}), this.ctx.on("click", this.hide.bind(this)), this.ctx.on("onScroll", this.hide.bind(this)), this.ctx.on("resize", this.hide.bind(this));
|
|
6058
6203
|
}
|
|
@@ -6309,12 +6454,12 @@ class ss {
|
|
|
6309
6454
|
setSelectionByRows(t, e = !0) {
|
|
6310
6455
|
t.forEach((i) => {
|
|
6311
6456
|
const s = this.ctx.database.getRowKeyByItem(i);
|
|
6312
|
-
this.ctx.database.setRowSelection(s, e);
|
|
6457
|
+
this.ctx.database.setRowSelection(s, e, !1);
|
|
6313
6458
|
}), this.ctx.emit("selectionChange", this.getSelectionRows()), this.ctx.emit("draw");
|
|
6314
6459
|
}
|
|
6315
6460
|
setSelectionByRowKeys(t, e = !0) {
|
|
6316
6461
|
t.forEach((i) => {
|
|
6317
|
-
this.ctx.database.setRowSelection(i, e);
|
|
6462
|
+
this.ctx.database.setRowSelection(i, e, !1);
|
|
6318
6463
|
}), this.ctx.emit("selectionChange", this.getSelectionRows()), this.ctx.emit("draw");
|
|
6319
6464
|
}
|
|
6320
6465
|
toggleAllSelection() {
|
|
@@ -6349,6 +6494,10 @@ class ss {
|
|
|
6349
6494
|
getSpanObjByColumn: ie
|
|
6350
6495
|
};
|
|
6351
6496
|
}
|
|
6497
|
+
getColumnByKey(t) {
|
|
6498
|
+
var e;
|
|
6499
|
+
return (e = this.ctx.database.getColumnByKey(t)) == null ? void 0 : e.column;
|
|
6500
|
+
}
|
|
6352
6501
|
/**
|
|
6353
6502
|
* 销毁
|
|
6354
6503
|
*/
|