e-virt-table 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +169 -157
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Config.d.ts +3 -1
- package/dist/lib/Config.js +9 -0
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Context.d.ts +1 -0
- package/dist/lib/Context.js +3 -0
- package/dist/lib/Context.js.map +1 -1
- package/dist/lib/ContextMenu.d.ts +1 -0
- package/dist/lib/ContextMenu.js +4 -0
- package/dist/lib/ContextMenu.js.map +1 -1
- package/dist/lib/EVirtTable.js +5 -4
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/Editor.js +6 -2
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/Header.js +0 -1
- package/dist/lib/Header.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(':root{--e-virt-table-color-white: #fff;--e-virt-table-color-black: #000000;--e-virt-table-color-primary: rgb(82, 146, 247);--e-virt-table-text-color-primary: "#333";--e-virt-table-text-color-regular: "#666";--e-virt-table-text-color-secondary: "#999";--e-virt-table-box-shadow: 0 2px 12px 0 #0000001a;--e-virt-table-editor-bg-color: #fff}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;line-height:0;z-index:100;overflow:hidden;background-color:var(--e-virt-table-editor-bg-color);border:2px solid var(--e-virt-table-color-primary);box-sizing:border-box;box-shadow:var(--e-virt-table-box-shadow);pointer-events:auto;display:flex;align-items:center}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--e-virt-table-text-color-regular);background-color:var(--e-virt-table-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--e-virt-table-box-shadow);width:fit-content;padding:6px 0;z-index:9999;left:-99999px;top:-99999px}.e-virt-table-context-menu-item{cursor:pointer;padding:8px 24px}.e-virt-table-context-menu-item:hover{color:var(--e-virt-table-color-primary);background-color:#f5f7fa}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var c = (a, t, e) =>
|
|
2
|
+
var pe = Object.defineProperty;
|
|
3
|
+
var ye = (a, t, e) => t in a ? pe(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
4
|
+
var c = (a, t, e) => ye(a, typeof t != "symbol" ? t + "" : t, e);
|
|
5
5
|
function $() {
|
|
6
6
|
return $ = Object.assign ? Object.assign.bind() : function(a) {
|
|
7
7
|
for (var t = 1; t < arguments.length; t++) {
|
|
@@ -12,7 +12,7 @@ function $() {
|
|
|
12
12
|
return a;
|
|
13
13
|
}, $.apply(this, arguments);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function me(a, t) {
|
|
16
16
|
a.prototype = Object.create(t.prototype), a.prototype.constructor = a, st(a, t);
|
|
17
17
|
}
|
|
18
18
|
function Et(a) {
|
|
@@ -25,7 +25,7 @@ function st(a, t) {
|
|
|
25
25
|
return i.__proto__ = s, i;
|
|
26
26
|
}, st(a, t);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Ee() {
|
|
29
29
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
30
30
|
if (typeof Proxy == "function") return !0;
|
|
31
31
|
try {
|
|
@@ -36,20 +36,20 @@ function me() {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
function dt(a, t, e) {
|
|
39
|
-
return
|
|
39
|
+
return Ee() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
|
|
40
40
|
var n = [null];
|
|
41
41
|
n.push.apply(n, r);
|
|
42
42
|
var h = Function.bind.apply(s, n), l = new h();
|
|
43
43
|
return o && st(l, o.prototype), l;
|
|
44
44
|
}, dt.apply(null, arguments);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function be(a) {
|
|
47
47
|
return Function.toString.call(a).indexOf("[native code]") !== -1;
|
|
48
48
|
}
|
|
49
49
|
function bt(a) {
|
|
50
50
|
var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
51
51
|
return bt = function(i) {
|
|
52
|
-
if (i === null || !
|
|
52
|
+
if (i === null || !be(i)) return i;
|
|
53
53
|
if (typeof i != "function")
|
|
54
54
|
throw new TypeError("Super expression must either be null or a function");
|
|
55
55
|
if (typeof t < "u") {
|
|
@@ -69,9 +69,9 @@ function bt(a) {
|
|
|
69
69
|
}), st(s, i);
|
|
70
70
|
}, bt(a);
|
|
71
71
|
}
|
|
72
|
-
var
|
|
72
|
+
var Ce = /%[sdj%]/g, qt = function() {
|
|
73
73
|
};
|
|
74
|
-
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (
|
|
74
|
+
typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (qt = function(t, e) {
|
|
75
75
|
typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && e.every(function(i) {
|
|
76
76
|
return typeof i == "string";
|
|
77
77
|
}) && console.warn(t, e);
|
|
@@ -91,7 +91,7 @@ function H(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(Ce, function(n) {
|
|
95
95
|
if (n === "%%")
|
|
96
96
|
return "%";
|
|
97
97
|
if (s >= r)
|
|
@@ -116,13 +116,13 @@ function H(a) {
|
|
|
116
116
|
}
|
|
117
117
|
return a;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function ve(a) {
|
|
120
120
|
return a === "string" || a === "url" || a === "hex" || a === "email" || a === "date" || a === "pattern";
|
|
121
121
|
}
|
|
122
122
|
function I(a, t) {
|
|
123
|
-
return !!(a == null || t === "array" && Array.isArray(a) && !a.length ||
|
|
123
|
+
return !!(a == null || t === "array" && Array.isArray(a) && !a.length || ve(t) && typeof a == "string" && !a);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Re(a, t, e) {
|
|
126
126
|
var i = [], s = 0, r = a.length;
|
|
127
127
|
function o(n) {
|
|
128
128
|
i.push.apply(i, n || []), s++, s === r && e(i);
|
|
@@ -143,26 +143,26 @@ function Ft(a, t, e) {
|
|
|
143
143
|
}
|
|
144
144
|
r([]);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Ie(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
152
|
var Xt = /* @__PURE__ */ function(a) {
|
|
153
|
-
|
|
153
|
+
me(t, a);
|
|
154
154
|
function t(e, i) {
|
|
155
155
|
var s;
|
|
156
156
|
return s = a.call(this, "Async Validation Error") || this, s.errors = e, s.fields = i, s;
|
|
157
157
|
}
|
|
158
158
|
return t;
|
|
159
159
|
}(/* @__PURE__ */ bt(Error));
|
|
160
|
-
function
|
|
160
|
+
function Oe(a, t, e, i, s) {
|
|
161
161
|
if (t.first) {
|
|
162
162
|
var r = new Promise(function(x, u) {
|
|
163
163
|
var y = function(p) {
|
|
164
164
|
return i(p), p.length ? u(new Xt(p, Ct(p))) : x(s);
|
|
165
|
-
}, g =
|
|
165
|
+
}, g = Ie(a);
|
|
166
166
|
Ft(g, e, y);
|
|
167
167
|
});
|
|
168
168
|
return r.catch(function(x) {
|
|
@@ -176,17 +176,17 @@ function Ie(a, t, e, i, s) {
|
|
|
176
176
|
};
|
|
177
177
|
n.length || (i(d), x(s)), n.forEach(function(g) {
|
|
178
178
|
var w = a[g];
|
|
179
|
-
o.indexOf(g) !== -1 ? Ft(w, e, y) :
|
|
179
|
+
o.indexOf(g) !== -1 ? Ft(w, e, y) : Re(w, e, y);
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
182
|
return f.catch(function(x) {
|
|
183
183
|
return x;
|
|
184
184
|
}), f;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function _e(a) {
|
|
187
187
|
return !!(a && a.message !== void 0);
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function Se(a, t) {
|
|
190
190
|
for (var e = a, i = 0; i < t.length; i++) {
|
|
191
191
|
if (e == null)
|
|
192
192
|
return e;
|
|
@@ -197,7 +197,7 @@ function _e(a, t) {
|
|
|
197
197
|
function Nt(a, t) {
|
|
198
198
|
return function(e) {
|
|
199
199
|
var i;
|
|
200
|
-
return a.fullFields ? i =
|
|
200
|
+
return a.fullFields ? i = Se(t, a.fullFields) : i = t[e.field || a.fullField], _e(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
|
|
@@ -214,11 +214,11 @@ function Kt(a, t) {
|
|
|
214
214
|
}
|
|
215
215
|
return a;
|
|
216
216
|
}
|
|
217
|
-
var
|
|
217
|
+
var Gt = function(t, e, i, s, r, o) {
|
|
218
218
|
t.required && (!i.hasOwnProperty(t.field) || I(e, o || t.type)) && s.push(H(r.messages.required, t.fullField));
|
|
219
|
-
},
|
|
219
|
+
}, Te = function(t, e, i, s, r) {
|
|
220
220
|
(/^\s+$/.test(e) || e === "") && s.push(H(r.messages.whitespace, t.fullField));
|
|
221
|
-
}, lt,
|
|
221
|
+
}, lt, Le = function() {
|
|
222
222
|
if (lt)
|
|
223
223
|
return lt;
|
|
224
224
|
var a = "[a-fA-F\\d:]", t = function(b) {
|
|
@@ -287,26 +287,26 @@ var qt = function(t, e, i, s, r, o) {
|
|
|
287
287
|
return typeof t == "string" && t.length <= 320 && !!t.match(Yt.email);
|
|
288
288
|
},
|
|
289
289
|
url: function(t) {
|
|
290
|
-
return typeof t == "string" && t.length <= 2048 && !!t.match(
|
|
290
|
+
return typeof t == "string" && t.length <= 2048 && !!t.match(Le());
|
|
291
291
|
},
|
|
292
292
|
hex: function(t) {
|
|
293
293
|
return typeof t == "string" && !!t.match(Yt.hex);
|
|
294
294
|
}
|
|
295
|
-
},
|
|
295
|
+
}, Ae = function(t, e, i, s, r) {
|
|
296
296
|
if (t.required && e === void 0) {
|
|
297
|
-
|
|
297
|
+
Gt(t, e, i, s, r);
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
300
|
var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], n = t.type;
|
|
301
301
|
o.indexOf(n) > -1 ? et[n](e) || s.push(H(r.messages.types[n], t.fullField, t.type)) : n && typeof e !== t.type && s.push(H(r.messages.types[n], t.fullField, t.type));
|
|
302
|
-
},
|
|
302
|
+
}, He = function(t, e, i, s, r) {
|
|
303
303
|
var o = typeof t.len == "number", n = typeof t.min == "number", h = typeof t.max == "number", l = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null, x = typeof e == "number", u = typeof e == "string", y = Array.isArray(e);
|
|
304
304
|
if (x ? f = "number" : u ? f = "string" : y && (f = "array"), !f)
|
|
305
305
|
return !1;
|
|
306
306
|
y && (d = e.length), u && (d = e.replace(l, "_").length), o ? d !== t.len && s.push(H(r.messages[f].len, t.fullField, t.len)) : n && !h && d < t.min ? s.push(H(r.messages[f].min, t.fullField, t.min)) : h && !n && d > t.max ? s.push(H(r.messages[f].max, t.fullField, t.max)) : n && h && (d < t.min || d > t.max) && s.push(H(r.messages[f].range, t.fullField, t.min, t.max));
|
|
307
|
-
}, j = "enum",
|
|
307
|
+
}, j = "enum", Me = function(t, e, i, s, r) {
|
|
308
308
|
t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(H(r.messages[j], t.fullField, t[j].join(", ")));
|
|
309
|
-
},
|
|
309
|
+
}, De = 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(H(r.messages.pattern.mismatch, t.fullField, e, t.pattern));
|
|
@@ -316,13 +316,13 @@ var qt = function(t, e, i, s, r, o) {
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}, v = {
|
|
319
|
-
required:
|
|
320
|
-
whitespace:
|
|
321
|
-
type:
|
|
322
|
-
range:
|
|
323
|
-
enum:
|
|
324
|
-
pattern:
|
|
325
|
-
},
|
|
319
|
+
required: Gt,
|
|
320
|
+
whitespace: Te,
|
|
321
|
+
type: Ae,
|
|
322
|
+
range: He,
|
|
323
|
+
enum: Me,
|
|
324
|
+
pattern: De
|
|
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 (I(e, "string") && !t.required)
|
|
@@ -330,7 +330,7 @@ var qt = function(t, e, i, s, r, o) {
|
|
|
330
330
|
v.required(t, e, s, o, r, "string"), I(e, "string") || (v.type(t, e, s, o, r), v.range(t, e, s, o, r), v.pattern(t, e, s, o, r), t.whitespace === !0 && v.whitespace(t, e, s, o, r));
|
|
331
331
|
}
|
|
332
332
|
i(o);
|
|
333
|
-
},
|
|
333
|
+
}, Fe = 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 (I(e) && !t.required)
|
|
@@ -338,7 +338,7 @@ var qt = function(t, e, i, s, r, o) {
|
|
|
338
338
|
v.required(t, e, s, o, r), e !== void 0 && v.type(t, e, s, o, r);
|
|
339
339
|
}
|
|
340
340
|
i(o);
|
|
341
|
-
},
|
|
341
|
+
}, Xe = function(t, e, i, s, r) {
|
|
342
342
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
343
343
|
if (n) {
|
|
344
344
|
if (e === "" && (e = void 0), I(e) && !t.required)
|
|
@@ -346,7 +346,7 @@ var qt = function(t, e, i, s, r, o) {
|
|
|
346
346
|
v.required(t, e, s, o, r), e !== void 0 && (v.type(t, e, s, o, r), v.range(t, e, s, o, r));
|
|
347
347
|
}
|
|
348
348
|
i(o);
|
|
349
|
-
},
|
|
349
|
+
}, Ne = function(t, e, i, s, r) {
|
|
350
350
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
351
351
|
if (n) {
|
|
352
352
|
if (I(e) && !t.required)
|
|
@@ -354,7 +354,7 @@ var qt = function(t, e, i, s, r, o) {
|
|
|
354
354
|
v.required(t, e, s, o, r), e !== void 0 && v.type(t, e, s, o, r);
|
|
355
355
|
}
|
|
356
356
|
i(o);
|
|
357
|
-
},
|
|
357
|
+
}, Ke = function(t, e, i, s, r) {
|
|
358
358
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
359
359
|
if (n) {
|
|
360
360
|
if (I(e) && !t.required)
|
|
@@ -362,7 +362,7 @@ var qt = function(t, e, i, s, r, o) {
|
|
|
362
362
|
v.required(t, e, s, o, r), I(e) || v.type(t, e, s, o, r);
|
|
363
363
|
}
|
|
364
364
|
i(o);
|
|
365
|
-
},
|
|
365
|
+
}, Ye = function(t, e, i, s, r) {
|
|
366
366
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
367
367
|
if (n) {
|
|
368
368
|
if (I(e) && !t.required)
|
|
@@ -370,7 +370,7 @@ var qt = function(t, e, i, s, r, o) {
|
|
|
370
370
|
v.required(t, e, s, o, r), e !== void 0 && (v.type(t, e, s, o, r), v.range(t, e, s, o, r));
|
|
371
371
|
}
|
|
372
372
|
i(o);
|
|
373
|
-
},
|
|
373
|
+
}, Be = function(t, e, i, s, r) {
|
|
374
374
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
375
375
|
if (n) {
|
|
376
376
|
if (I(e) && !t.required)
|
|
@@ -378,7 +378,7 @@ var qt = function(t, e, i, s, r, o) {
|
|
|
378
378
|
v.required(t, e, s, o, r), e !== void 0 && (v.type(t, e, s, o, r), v.range(t, e, s, o, r));
|
|
379
379
|
}
|
|
380
380
|
i(o);
|
|
381
|
-
},
|
|
381
|
+
}, We = function(t, e, i, s, r) {
|
|
382
382
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
383
383
|
if (n) {
|
|
384
384
|
if (e == null && !t.required)
|
|
@@ -386,7 +386,7 @@ var qt = function(t, e, i, s, r, o) {
|
|
|
386
386
|
v.required(t, e, s, o, r, "array"), e != null && (v.type(t, e, s, o, r), v.range(t, e, s, o, r));
|
|
387
387
|
}
|
|
388
388
|
i(o);
|
|
389
|
-
},
|
|
389
|
+
}, Pe = function(t, e, i, s, r) {
|
|
390
390
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
391
391
|
if (n) {
|
|
392
392
|
if (I(e) && !t.required)
|
|
@@ -394,15 +394,15 @@ var qt = function(t, e, i, s, r, o) {
|
|
|
394
394
|
v.required(t, e, s, o, r), e !== void 0 && v.type(t, e, s, o, r);
|
|
395
395
|
}
|
|
396
396
|
i(o);
|
|
397
|
-
},
|
|
397
|
+
}, Ve = "enum", ze = function(t, e, i, s, r) {
|
|
398
398
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
399
399
|
if (n) {
|
|
400
400
|
if (I(e) && !t.required)
|
|
401
401
|
return i();
|
|
402
|
-
v.required(t, e, s, o, r), e !== void 0 && v[
|
|
402
|
+
v.required(t, e, s, o, r), e !== void 0 && v[Ve](t, e, s, o, r);
|
|
403
403
|
}
|
|
404
404
|
i(o);
|
|
405
|
-
},
|
|
405
|
+
}, $e = function(t, e, i, s, r) {
|
|
406
406
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
407
407
|
if (n) {
|
|
408
408
|
if (I(e, "string") && !t.required)
|
|
@@ -410,7 +410,7 @@ var qt = function(t, e, i, s, r, o) {
|
|
|
410
410
|
v.required(t, e, s, o, r), I(e, "string") || v.pattern(t, e, s, o, r);
|
|
411
411
|
}
|
|
412
412
|
i(o);
|
|
413
|
-
},
|
|
413
|
+
}, qe = function(t, e, i, s, r) {
|
|
414
414
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
415
415
|
if (n) {
|
|
416
416
|
if (I(e, "date") && !t.required)
|
|
@@ -421,7 +421,7 @@ var qt = function(t, e, i, s, r, o) {
|
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
i(o);
|
|
424
|
-
},
|
|
424
|
+
}, Ge = function(t, e, i, s, r) {
|
|
425
425
|
var o = [], n = Array.isArray(e) ? "array" : typeof e;
|
|
426
426
|
v.required(t, e, s, o, r, n), i(o);
|
|
427
427
|
}, yt = function(t, e, i, s, r) {
|
|
@@ -432,7 +432,7 @@ var qt = function(t, e, i, s, r, o) {
|
|
|
432
432
|
v.required(t, e, s, n, r, o), I(e, o) || v.type(t, e, s, n, r);
|
|
433
433
|
}
|
|
434
434
|
i(n);
|
|
435
|
-
},
|
|
435
|
+
}, je = function(t, e, i, s, r) {
|
|
436
436
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
437
437
|
if (n) {
|
|
438
438
|
if (I(e) && !t.required)
|
|
@@ -441,23 +441,23 @@ var qt = function(t, e, i, s, r, o) {
|
|
|
441
441
|
}
|
|
442
442
|
i(o);
|
|
443
443
|
}, it = {
|
|
444
|
-
string:
|
|
445
|
-
method:
|
|
446
|
-
number:
|
|
447
|
-
boolean:
|
|
448
|
-
regexp:
|
|
449
|
-
integer:
|
|
450
|
-
float:
|
|
451
|
-
array:
|
|
452
|
-
object:
|
|
453
|
-
enum:
|
|
454
|
-
pattern:
|
|
455
|
-
date:
|
|
444
|
+
string: ke,
|
|
445
|
+
method: Fe,
|
|
446
|
+
number: Xe,
|
|
447
|
+
boolean: Ne,
|
|
448
|
+
regexp: Ke,
|
|
449
|
+
integer: Ye,
|
|
450
|
+
float: Be,
|
|
451
|
+
array: We,
|
|
452
|
+
object: Pe,
|
|
453
|
+
enum: ze,
|
|
454
|
+
pattern: $e,
|
|
455
|
+
date: qe,
|
|
456
456
|
url: yt,
|
|
457
457
|
hex: yt,
|
|
458
458
|
email: yt,
|
|
459
|
-
required:
|
|
460
|
-
any:
|
|
459
|
+
required: Ge,
|
|
460
|
+
any: je
|
|
461
461
|
};
|
|
462
462
|
function vt() {
|
|
463
463
|
return {
|
|
@@ -570,7 +570,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
572
|
var y = {};
|
|
573
|
-
return
|
|
573
|
+
return Oe(x, h, function(g, w) {
|
|
574
574
|
var p = g.rule, E = (p.type === "object" || p.type === "array") && (typeof p.fields == "object" || typeof p.defaultField == "object");
|
|
575
575
|
E = E && (p.required || !p.required && g.value), p.field = g.field;
|
|
576
576
|
function m(R, T) {
|
|
@@ -644,7 +644,7 @@ nt.register = function(t, e) {
|
|
|
644
644
|
throw new Error("Cannot register a validator by type, validator is not a function");
|
|
645
645
|
it[t] = e;
|
|
646
646
|
};
|
|
647
|
-
nt.warning =
|
|
647
|
+
nt.warning = qt;
|
|
648
648
|
nt.messages = Rt;
|
|
649
649
|
nt.validators = it;
|
|
650
650
|
function At() {
|
|
@@ -653,7 +653,7 @@ function At() {
|
|
|
653
653
|
return (a === "x" ? t : t & 3 | 8).toString(16);
|
|
654
654
|
});
|
|
655
655
|
}
|
|
656
|
-
function
|
|
656
|
+
function jt(a, t) {
|
|
657
657
|
let e = 0, i;
|
|
658
658
|
return function(...s) {
|
|
659
659
|
const r = (/* @__PURE__ */ new Date()).getTime(), o = r - e;
|
|
@@ -662,10 +662,10 @@ function Gt(a, t) {
|
|
|
662
662
|
}, t - o));
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
|
-
function
|
|
666
|
-
return a ? a.map((t) =>
|
|
665
|
+
function Ut(a) {
|
|
666
|
+
return a ? a.map((t) => Ut(t.children) + 1).sort((t, e) => e - t)[0] : 0;
|
|
667
667
|
}
|
|
668
|
-
function
|
|
668
|
+
function Ue(a = []) {
|
|
669
669
|
let t = [], e = [], i = [];
|
|
670
670
|
return a.forEach((s) => {
|
|
671
671
|
s.fixed === "left" ? t.push(s) : s.fixed === "right" ? i.push(s) : e.push(s);
|
|
@@ -675,14 +675,14 @@ function je(a = []) {
|
|
|
675
675
|
...i.sort((s, r) => s.sort - r.sort)
|
|
676
676
|
];
|
|
677
677
|
}
|
|
678
|
-
function
|
|
678
|
+
function Zt(a = [], t = 1, e = 0) {
|
|
679
679
|
return a.map((i) => {
|
|
680
680
|
if (i.children) {
|
|
681
681
|
let s = 0, r = i.fixed;
|
|
682
682
|
i.children.forEach((n) => {
|
|
683
683
|
n.fixed = r;
|
|
684
684
|
});
|
|
685
|
-
const o =
|
|
685
|
+
const o = Zt(i.children, t - 1, e + 1);
|
|
686
686
|
return o && o.forEach((n) => {
|
|
687
687
|
s += n.colspan;
|
|
688
688
|
}), {
|
|
@@ -708,7 +708,7 @@ function It(a = []) {
|
|
|
708
708
|
e.children ? t = t.concat(It(e.children)) : t.push(e);
|
|
709
709
|
}), t;
|
|
710
710
|
}
|
|
711
|
-
class
|
|
711
|
+
class Ze {
|
|
712
712
|
//虚拟滚动位置
|
|
713
713
|
constructor(t, e) {
|
|
714
714
|
c(this, "loading", !1);
|
|
@@ -1333,7 +1333,7 @@ class Ue {
|
|
|
1333
1333
|
return this.validationErrorMap.get(i) || [];
|
|
1334
1334
|
}
|
|
1335
1335
|
}
|
|
1336
|
-
class
|
|
1336
|
+
class Je {
|
|
1337
1337
|
constructor(t) {
|
|
1338
1338
|
c(this, "ctx");
|
|
1339
1339
|
c(this, "history", []);
|
|
@@ -1390,7 +1390,7 @@ class Ze {
|
|
|
1390
1390
|
this.history = [], this.historyIndex = -1;
|
|
1391
1391
|
}
|
|
1392
1392
|
}
|
|
1393
|
-
class
|
|
1393
|
+
class Qe {
|
|
1394
1394
|
constructor(t) {
|
|
1395
1395
|
c(this, "eventTasks", /* @__PURE__ */ new Map());
|
|
1396
1396
|
c(this, "ctx");
|
|
@@ -1436,7 +1436,7 @@ class Je {
|
|
|
1436
1436
|
t.removeEventListener(e, i), this.eventTasks.delete(e);
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
|
-
class
|
|
1439
|
+
class ti {
|
|
1440
1440
|
constructor() {
|
|
1441
1441
|
c(this, "events", /* @__PURE__ */ new Map());
|
|
1442
1442
|
}
|
|
@@ -1474,7 +1474,7 @@ class Qe {
|
|
|
1474
1474
|
this.events.clear();
|
|
1475
1475
|
}
|
|
1476
1476
|
}
|
|
1477
|
-
class
|
|
1477
|
+
class ei {
|
|
1478
1478
|
constructor(t) {
|
|
1479
1479
|
c(this, "ctx");
|
|
1480
1480
|
const e = t.getContext("2d");
|
|
@@ -1616,7 +1616,7 @@ class ti {
|
|
|
1616
1616
|
};
|
|
1617
1617
|
}
|
|
1618
1618
|
}
|
|
1619
|
-
class
|
|
1619
|
+
class Bt {
|
|
1620
1620
|
constructor(t) {
|
|
1621
1621
|
c(this, "PROCESSOR_NUM", 50);
|
|
1622
1622
|
c(this, "CSS_PREFIX", "e-virt-table");
|
|
@@ -1679,6 +1679,8 @@ class ei {
|
|
|
1679
1679
|
c(this, "ENABLE_SELECTOR", !1);
|
|
1680
1680
|
c(this, "ENABLE_EDIT_SINGLE_CLICK", !1);
|
|
1681
1681
|
// 启用单点击立马编辑
|
|
1682
|
+
c(this, "ENABLE_EDIT_TEXT_ENTER", !0);
|
|
1683
|
+
// 启用文本编辑器回车键确认
|
|
1682
1684
|
c(this, "ENABLE_SELECTOR_SINGLE", !1);
|
|
1683
1685
|
c(this, "ENABLE_SELECTOR_SPAN_COL", !0);
|
|
1684
1686
|
c(this, "ENABLE_SELECTOR_SPAN_ROW", !0);
|
|
@@ -1727,6 +1729,9 @@ class ei {
|
|
|
1727
1729
|
c(this, "EXPAND_LAZY_METHOD");
|
|
1728
1730
|
Object.assign(this, t);
|
|
1729
1731
|
}
|
|
1732
|
+
init(t) {
|
|
1733
|
+
Object.assign(this, t);
|
|
1734
|
+
}
|
|
1730
1735
|
}
|
|
1731
1736
|
class ii {
|
|
1732
1737
|
constructor(t) {
|
|
@@ -1838,7 +1843,7 @@ class ii {
|
|
|
1838
1843
|
return this.icons.get(t);
|
|
1839
1844
|
}
|
|
1840
1845
|
}
|
|
1841
|
-
class
|
|
1846
|
+
class Jt {
|
|
1842
1847
|
constructor(t, e, i, s, r, o, n) {
|
|
1843
1848
|
c(this, "ctx");
|
|
1844
1849
|
c(this, "x", 0);
|
|
@@ -1875,7 +1880,7 @@ class Zt {
|
|
|
1875
1880
|
getRightFixedX() {
|
|
1876
1881
|
}
|
|
1877
1882
|
}
|
|
1878
|
-
class
|
|
1883
|
+
class Qt extends Jt {
|
|
1879
1884
|
constructor(e, i, s, r, o, n, h, l, d, f = "body") {
|
|
1880
1885
|
super(e, r, o, n, h, l.fixed, f);
|
|
1881
1886
|
c(this, "formatter");
|
|
@@ -2304,7 +2309,7 @@ class Jt extends Zt {
|
|
|
2304
2309
|
});
|
|
2305
2310
|
}
|
|
2306
2311
|
}
|
|
2307
|
-
class
|
|
2312
|
+
class te extends Jt {
|
|
2308
2313
|
constructor(e, i, s, r, o, n, h) {
|
|
2309
2314
|
super(e, s, r, o, n, h.fixed, "header");
|
|
2310
2315
|
c(this, "align");
|
|
@@ -2529,7 +2534,7 @@ class si {
|
|
|
2529
2534
|
*/
|
|
2530
2535
|
selectionClick(t) {
|
|
2531
2536
|
if (["selection", "index-selection"].includes(t.type) && this.ctx.isPointer)
|
|
2532
|
-
if (t instanceof
|
|
2537
|
+
if (t instanceof te)
|
|
2533
2538
|
t.drawImageName === "checkbox-uncheck" || t.drawImageName === "checkbox-indeterminate" ? this.ctx.database.toggleAllSelection() : t.drawImageName === "checkbox-check" && this.ctx.database.clearSelection();
|
|
2534
2539
|
else {
|
|
2535
2540
|
if (!this.ctx.database.getRowSelectable(t.rowKey))
|
|
@@ -2569,7 +2574,7 @@ class si {
|
|
|
2569
2574
|
*/
|
|
2570
2575
|
imageEnterAndLeave(t, e) {
|
|
2571
2576
|
const i = e.offsetY, s = e.offsetX;
|
|
2572
|
-
s > t.drawImageX && s < t.drawImageX + t.drawImageWidth && i > t.drawImageY && i < t.drawImageY + t.drawImageHeight ? (this.ctx.target.style.cursor = "pointer", this.ctx.isPointer = !0, t instanceof
|
|
2577
|
+
s > t.drawImageX && s < t.drawImageX + t.drawImageWidth && i > t.drawImageY && i < t.drawImageY + t.drawImageHeight ? (this.ctx.target.style.cursor = "pointer", this.ctx.isPointer = !0, t instanceof Qt && ["selection", "index-selection"].includes(t.type) && (this.ctx.database.getRowSelectable(t.rowKey) || (this.ctx.target.style.cursor = "not-allowed"))) : (this.ctx.isPointer = !1, this.ctx.target.style.cursor === "pointer" && (this.ctx.target.style.cursor = "default"));
|
|
2573
2578
|
}
|
|
2574
2579
|
isBusy(t) {
|
|
2575
2580
|
const e = t.offsetY, i = t.offsetX;
|
|
@@ -2673,7 +2678,10 @@ class ri {
|
|
|
2673
2678
|
c(this, "database");
|
|
2674
2679
|
c(this, "history");
|
|
2675
2680
|
c(this, "config");
|
|
2676
|
-
this.target = e, this.targetContainer = t, this.target.setAttribute("uuid", this.uuid), this.config = new
|
|
2681
|
+
this.target = e, this.targetContainer = t, this.target.setAttribute("uuid", this.uuid), this.config = new Bt(i.config || {}), this.eventBus = new ti(), this.eventBrowser = new Qe(this), this.eventTable = new si(this), this.paint = new ei(e), this.database = new Ze(this, i), this.history = new Je(this), this.icons = new ii(this);
|
|
2682
|
+
}
|
|
2683
|
+
setConfig(t) {
|
|
2684
|
+
this.config = new Bt(t);
|
|
2677
2685
|
}
|
|
2678
2686
|
setFocusCell(t) {
|
|
2679
2687
|
var e;
|
|
@@ -2759,7 +2767,7 @@ class ri {
|
|
|
2759
2767
|
this.eventTable.destroy(), this.eventBrowser.destroy(), this.eventBus.destroy();
|
|
2760
2768
|
}
|
|
2761
2769
|
}
|
|
2762
|
-
class
|
|
2770
|
+
class Wt {
|
|
2763
2771
|
constructor(t, e) {
|
|
2764
2772
|
c(this, "ctx");
|
|
2765
2773
|
c(this, "type");
|
|
@@ -2912,7 +2920,7 @@ class oi {
|
|
|
2912
2920
|
c(this, "ctx");
|
|
2913
2921
|
c(this, "verticalScrollbar");
|
|
2914
2922
|
c(this, "horizontalScrollbar");
|
|
2915
|
-
this.ctx = t, this.verticalScrollbar = new
|
|
2923
|
+
this.ctx = t, this.verticalScrollbar = new Wt(t, "vertical"), this.horizontalScrollbar = new Wt(t, "horizontal"), this.ctx.on("wheel", (e) => this.onWheel(e)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("setScroll", (e, i) => {
|
|
2916
2924
|
this.setScroll(e, i);
|
|
2917
2925
|
}), this.ctx.on("setScrollX", (e) => {
|
|
2918
2926
|
this.setScrollX(e);
|
|
@@ -3004,7 +3012,7 @@ class ni {
|
|
|
3004
3012
|
c(this, "renderFixedCellHeaders", []);
|
|
3005
3013
|
this.ctx = t, this.ctx.on(
|
|
3006
3014
|
"resetHeader",
|
|
3007
|
-
|
|
3015
|
+
jt(() => {
|
|
3008
3016
|
this.init(), this.ctx.emit("draw");
|
|
3009
3017
|
}, 100)
|
|
3010
3018
|
), this.init(), this.initResizeColumn();
|
|
@@ -3014,13 +3022,13 @@ class ni {
|
|
|
3014
3022
|
config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
|
|
3015
3023
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3016
3024
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3017
|
-
const s =
|
|
3025
|
+
const s = Ut(i), r = It(i);
|
|
3018
3026
|
this.height = t * s, this.width = r.reduce(
|
|
3019
3027
|
(d, f) => d + ((f == null ? void 0 : f.width) || 100),
|
|
3020
3028
|
0
|
|
3021
3029
|
), this.visibleHeight = this.height;
|
|
3022
|
-
const o =
|
|
3023
|
-
this.columnIndex = 0, this.resizeNum = 0,
|
|
3030
|
+
const o = Ue(Zt(i, s));
|
|
3031
|
+
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3024
3032
|
const n = this.ctx.targetContainer.getBoundingClientRect();
|
|
3025
3033
|
if (this.resizeNum > 0 ? this.ctx.target.width = n.width : this.ctx.target.width = this.width + e - 1, this.visibleWidth = this.ctx.target.width - e, this.resizeNum) {
|
|
3026
3034
|
const d = this.visibleWidth - this.width, f = Math.floor(d / this.resizeNum * 100) / 100;
|
|
@@ -3128,7 +3136,7 @@ class ni {
|
|
|
3128
3136
|
const n = t[o], h = r * (n.rowspan || 1), l = r * n.level;
|
|
3129
3137
|
let d = n.width || 100;
|
|
3130
3138
|
n.children && (d = It(n.children).reduce((u, y) => u + ((y == null ? void 0 : y.width) || 100), 0));
|
|
3131
|
-
const f = new
|
|
3139
|
+
const f = new te(
|
|
3132
3140
|
this.ctx,
|
|
3133
3141
|
this.columnIndex,
|
|
3134
3142
|
s,
|
|
@@ -3202,7 +3210,7 @@ class ni {
|
|
|
3202
3210
|
}), this.drawTipLine();
|
|
3203
3211
|
}
|
|
3204
3212
|
}
|
|
3205
|
-
class
|
|
3213
|
+
class ee {
|
|
3206
3214
|
constructor(t, e, i = 0, s = 0, r = 0, o = 0, n, h = "body") {
|
|
3207
3215
|
c(this, "ctx");
|
|
3208
3216
|
c(this, "x", 0);
|
|
@@ -3221,7 +3229,7 @@ class te {
|
|
|
3221
3229
|
update() {
|
|
3222
3230
|
const { header: t } = this.ctx, e = [], i = [], s = [];
|
|
3223
3231
|
t.renderLeafCellHeaders.forEach((r) => {
|
|
3224
|
-
const o = new
|
|
3232
|
+
const o = new Qt(
|
|
3225
3233
|
this.ctx,
|
|
3226
3234
|
this.rowIndex,
|
|
3227
3235
|
r.colIndex,
|
|
@@ -3432,7 +3440,7 @@ class ai {
|
|
|
3432
3440
|
h === -1 && (h = r.length), this.headIndex = Math.max(0, n), this.tailIndex = Math.min(this.ctx.maxRowIndex, h + 1), this.visibleRows = r.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
|
|
3433
3441
|
const l = [];
|
|
3434
3442
|
for (let d = 0; d < this.visibleRows.length; d++) {
|
|
3435
|
-
const f = this.headIndex + d, x = this.visibleRows[d], { height: u, top: y } = this.ctx.database.getPositionForRowIndex(f), g = new
|
|
3443
|
+
const f = this.headIndex + d, x = this.visibleRows[d], { height: u, top: y } = this.ctx.database.getPositionForRowIndex(f), g = new ee(this.ctx, f, 0, y + this.y, t.width, u, x);
|
|
3436
3444
|
l.push(g);
|
|
3437
3445
|
}
|
|
3438
3446
|
this.renderRows = l, this.ctx.body.renderRows = l;
|
|
@@ -3500,7 +3508,7 @@ class ci {
|
|
|
3500
3508
|
let e = this.y;
|
|
3501
3509
|
const i = [];
|
|
3502
3510
|
this.data.forEach((s, r) => {
|
|
3503
|
-
const o = new
|
|
3511
|
+
const o = new ee(
|
|
3504
3512
|
this.ctx,
|
|
3505
3513
|
r,
|
|
3506
3514
|
0,
|
|
@@ -3537,7 +3545,7 @@ class hi {
|
|
|
3537
3545
|
init() {
|
|
3538
3546
|
this.ctx.on(
|
|
3539
3547
|
"mousemove",
|
|
3540
|
-
|
|
3548
|
+
jt((t) => {
|
|
3541
3549
|
const { offsetX: e, offsetY: i } = t, s = this.ctx.isTarget(t.target) && e > 0 && e < this.ctx.body.visibleWidth && i > this.ctx.header.visibleHeight && i < this.ctx.header.visibleHeight + this.ctx.body.visibleHeight;
|
|
3542
3550
|
(this.ctx.selectorMove || this.ctx.autofillMove) && (s ? this.stopAdjustPosition() : this.startAdjustPosition(t));
|
|
3543
3551
|
}, 100)
|
|
@@ -4009,7 +4017,7 @@ function q(a) {
|
|
|
4009
4017
|
function ct(a) {
|
|
4010
4018
|
return a.split("-")[1];
|
|
4011
4019
|
}
|
|
4012
|
-
function
|
|
4020
|
+
function ie(a) {
|
|
4013
4021
|
return a === "x" ? "y" : "x";
|
|
4014
4022
|
}
|
|
4015
4023
|
function Ht(a) {
|
|
@@ -4019,7 +4027,7 @@ function J(a) {
|
|
|
4019
4027
|
return ["top", "bottom"].includes(q(a)) ? "y" : "x";
|
|
4020
4028
|
}
|
|
4021
4029
|
function Mt(a) {
|
|
4022
|
-
return
|
|
4030
|
+
return ie(J(a));
|
|
4023
4031
|
}
|
|
4024
4032
|
function xi(a, t, e) {
|
|
4025
4033
|
e === void 0 && (e = !1);
|
|
@@ -4064,7 +4072,7 @@ function pi(a) {
|
|
|
4064
4072
|
...a
|
|
4065
4073
|
};
|
|
4066
4074
|
}
|
|
4067
|
-
function
|
|
4075
|
+
function se(a) {
|
|
4068
4076
|
return typeof a != "number" ? pi(a) : {
|
|
4069
4077
|
top: a,
|
|
4070
4078
|
right: a,
|
|
@@ -4090,7 +4098,7 @@ function ut(a) {
|
|
|
4090
4098
|
y: e
|
|
4091
4099
|
};
|
|
4092
4100
|
}
|
|
4093
|
-
function
|
|
4101
|
+
function Pt(a, t, e) {
|
|
4094
4102
|
let {
|
|
4095
4103
|
reference: i,
|
|
4096
4104
|
floating: s
|
|
@@ -4152,7 +4160,7 @@ const yi = async (a, t, e) => {
|
|
|
4152
4160
|
}), {
|
|
4153
4161
|
x: d,
|
|
4154
4162
|
y: f
|
|
4155
|
-
} =
|
|
4163
|
+
} = Pt(l, i, h), x = i, u = {}, y = 0;
|
|
4156
4164
|
for (let g = 0; g < n.length; g++) {
|
|
4157
4165
|
const {
|
|
4158
4166
|
name: w,
|
|
@@ -4189,7 +4197,7 @@ const yi = async (a, t, e) => {
|
|
|
4189
4197
|
}) : C.rects), {
|
|
4190
4198
|
x: d,
|
|
4191
4199
|
y: f
|
|
4192
|
-
} =
|
|
4200
|
+
} = Pt(l, x, h)), g = -1);
|
|
4193
4201
|
}
|
|
4194
4202
|
return {
|
|
4195
4203
|
x: d,
|
|
@@ -4199,7 +4207,7 @@ const yi = async (a, t, e) => {
|
|
|
4199
4207
|
middlewareData: u
|
|
4200
4208
|
};
|
|
4201
4209
|
};
|
|
4202
|
-
async function
|
|
4210
|
+
async function re(a, t) {
|
|
4203
4211
|
var e;
|
|
4204
4212
|
t === void 0 && (t = {});
|
|
4205
4213
|
const {
|
|
@@ -4215,7 +4223,7 @@ async function se(a, t) {
|
|
|
4215
4223
|
elementContext: f = "floating",
|
|
4216
4224
|
altBoundary: x = !1,
|
|
4217
4225
|
padding: u = 0
|
|
4218
|
-
} = at(t, a), y =
|
|
4226
|
+
} = at(t, a), y = se(u), w = n[x ? f === "floating" ? "reference" : "floating" : f], p = ut(await r.getClippingRect({
|
|
4219
4227
|
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)),
|
|
4220
4228
|
boundary: l,
|
|
4221
4229
|
rootBoundary: d,
|
|
@@ -4262,7 +4270,7 @@ const mi = (a) => ({
|
|
|
4262
4270
|
} = at(a, t) || {};
|
|
4263
4271
|
if (l == null)
|
|
4264
4272
|
return {};
|
|
4265
|
-
const f =
|
|
4273
|
+
const f = se(d), x = {
|
|
4266
4274
|
x: e,
|
|
4267
4275
|
y: i
|
|
4268
4276
|
}, u = Mt(s), y = Ht(u), g = await o.getDimensions(l), w = u === "y", p = w ? "top" : "left", E = w ? "bottom" : "right", m = w ? "clientHeight" : "clientWidth", b = r.reference[y] + r.reference[u] - x[u] - r.floating[y], C = x[u] - r.reference[u], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l));
|
|
@@ -4307,7 +4315,7 @@ const mi = (a) => ({
|
|
|
4307
4315
|
return {};
|
|
4308
4316
|
const p = q(s), E = J(n), m = q(n) === n, b = await (h.isRTL == null ? void 0 : h.isRTL(l.floating)), C = x || (m || !g ? [xt(n)] : ui(n)), R = y !== "none";
|
|
4309
4317
|
!x && R && C.push(...wi(n, g, y, b));
|
|
4310
|
-
const T = [n, ...C], L = await
|
|
4318
|
+
const T = [n, ...C], L = await re(t, w), A = [];
|
|
4311
4319
|
let D = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
4312
4320
|
if (d && A.push(L[p]), f) {
|
|
4313
4321
|
const _ = xi(s, o, b);
|
|
@@ -4342,7 +4350,7 @@ const mi = (a) => ({
|
|
|
4342
4350
|
P === "y";
|
|
4343
4351
|
}
|
|
4344
4352
|
return !0;
|
|
4345
|
-
}).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P,
|
|
4353
|
+
}).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, we) => P + we, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 : S[0];
|
|
4346
4354
|
X && (K = X);
|
|
4347
4355
|
break;
|
|
4348
4356
|
}
|
|
@@ -4438,7 +4446,7 @@ const Ci = function(a) {
|
|
|
4438
4446
|
} = at(a, t), l = {
|
|
4439
4447
|
x: e,
|
|
4440
4448
|
y: i
|
|
4441
|
-
}, d = await
|
|
4449
|
+
}, d = await re(t, h), f = J(q(s)), x = ie(f);
|
|
4442
4450
|
let u = l[x], y = l[f];
|
|
4443
4451
|
if (r) {
|
|
4444
4452
|
const w = x === "y" ? "top" : "left", p = x === "y" ? "bottom" : "right", E = u + d[w], m = u - d[p];
|
|
@@ -4471,7 +4479,7 @@ function gt() {
|
|
|
4471
4479
|
return typeof window < "u";
|
|
4472
4480
|
}
|
|
4473
4481
|
function tt(a) {
|
|
4474
|
-
return
|
|
4482
|
+
return oe(a) ? (a.nodeName || "").toLowerCase() : "#document";
|
|
4475
4483
|
}
|
|
4476
4484
|
function M(a) {
|
|
4477
4485
|
var t;
|
|
@@ -4479,9 +4487,9 @@ function M(a) {
|
|
|
4479
4487
|
}
|
|
4480
4488
|
function Y(a) {
|
|
4481
4489
|
var t;
|
|
4482
|
-
return (t = (
|
|
4490
|
+
return (t = (oe(a) ? a.ownerDocument : a.document) || window.document) == null ? void 0 : t.documentElement;
|
|
4483
4491
|
}
|
|
4484
|
-
function
|
|
4492
|
+
function oe(a) {
|
|
4485
4493
|
return gt() ? a instanceof Node || a instanceof M(a).Node : !1;
|
|
4486
4494
|
}
|
|
4487
4495
|
function k(a) {
|
|
@@ -4490,7 +4498,7 @@ function k(a) {
|
|
|
4490
4498
|
function N(a) {
|
|
4491
4499
|
return gt() ? a instanceof HTMLElement || a instanceof M(a).HTMLElement : !1;
|
|
4492
4500
|
}
|
|
4493
|
-
function
|
|
4501
|
+
function Vt(a) {
|
|
4494
4502
|
return !gt() || typeof ShadowRoot > "u" ? !1 : a instanceof ShadowRoot || a instanceof M(a).ShadowRoot;
|
|
4495
4503
|
}
|
|
4496
4504
|
function ht(a) {
|
|
@@ -4554,19 +4562,19 @@ function z(a) {
|
|
|
4554
4562
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
4555
4563
|
a.assignedSlot || // DOM Element detected.
|
|
4556
4564
|
a.parentNode || // ShadowRoot detected.
|
|
4557
|
-
|
|
4565
|
+
Vt(a) && a.host || // Fallback.
|
|
4558
4566
|
Y(a)
|
|
4559
4567
|
);
|
|
4560
|
-
return
|
|
4568
|
+
return Vt(t) ? t.host : t;
|
|
4561
4569
|
}
|
|
4562
|
-
function
|
|
4570
|
+
function ne(a) {
|
|
4563
4571
|
const t = z(a);
|
|
4564
|
-
return Q(t) ? a.ownerDocument ? a.ownerDocument.body : a.body : N(t) && ht(t) ? t :
|
|
4572
|
+
return Q(t) ? a.ownerDocument ? a.ownerDocument.body : a.body : N(t) && ht(t) ? t : ne(t);
|
|
4565
4573
|
}
|
|
4566
4574
|
function St(a, t, e) {
|
|
4567
4575
|
var i;
|
|
4568
4576
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
4569
|
-
const s =
|
|
4577
|
+
const s = ne(a), r = s === ((i = a.ownerDocument) == null ? void 0 : i.body), o = M(s);
|
|
4570
4578
|
if (r) {
|
|
4571
4579
|
const n = Tt(o);
|
|
4572
4580
|
return t.concat(o, o.visualViewport || [], ht(s) ? s : [], n && e ? St(n) : []);
|
|
@@ -4576,7 +4584,7 @@ function St(a, t, e) {
|
|
|
4576
4584
|
function Tt(a) {
|
|
4577
4585
|
return a.parent && Object.getPrototypeOf(a.parent) ? a.frameElement : null;
|
|
4578
4586
|
}
|
|
4579
|
-
function
|
|
4587
|
+
function ae(a) {
|
|
4580
4588
|
const t = F(a);
|
|
4581
4589
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
4582
4590
|
const s = N(a), r = s ? a.offsetWidth : e, o = s ? a.offsetHeight : i, n = ft(e) !== r || ft(i) !== o;
|
|
@@ -4586,18 +4594,18 @@ function ne(a) {
|
|
|
4586
4594
|
$: n
|
|
4587
4595
|
};
|
|
4588
4596
|
}
|
|
4589
|
-
function
|
|
4597
|
+
function ce(a) {
|
|
4590
4598
|
return k(a) ? a : a.contextElement;
|
|
4591
4599
|
}
|
|
4592
4600
|
function Z(a) {
|
|
4593
|
-
const t =
|
|
4601
|
+
const t = ce(a);
|
|
4594
4602
|
if (!N(t))
|
|
4595
4603
|
return V(1);
|
|
4596
4604
|
const e = t.getBoundingClientRect(), {
|
|
4597
4605
|
width: i,
|
|
4598
4606
|
height: s,
|
|
4599
4607
|
$: r
|
|
4600
|
-
} =
|
|
4608
|
+
} = ae(t);
|
|
4601
4609
|
let o = (r ? ft(e.width) : e.width) / i, n = (r ? ft(e.height) : e.height) / s;
|
|
4602
4610
|
return (!o || !Number.isFinite(o)) && (o = 1), (!n || !Number.isFinite(n)) && (n = 1), {
|
|
4603
4611
|
x: o,
|
|
@@ -4605,7 +4613,7 @@ function Z(a) {
|
|
|
4605
4613
|
};
|
|
4606
4614
|
}
|
|
4607
4615
|
const Oi = /* @__PURE__ */ V(0);
|
|
4608
|
-
function
|
|
4616
|
+
function he(a) {
|
|
4609
4617
|
const t = M(a);
|
|
4610
4618
|
return !kt() || !t.visualViewport ? Oi : {
|
|
4611
4619
|
x: t.visualViewport.offsetLeft,
|
|
@@ -4617,10 +4625,10 @@ function _i(a, t, e) {
|
|
|
4617
4625
|
}
|
|
4618
4626
|
function ot(a, t, e, i) {
|
|
4619
4627
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
4620
|
-
const s = a.getBoundingClientRect(), r =
|
|
4628
|
+
const s = a.getBoundingClientRect(), r = ce(a);
|
|
4621
4629
|
let o = V(1);
|
|
4622
4630
|
t && (i ? k(i) && (o = Z(i)) : o = Z(a));
|
|
4623
|
-
const n = _i(r, e, i) ?
|
|
4631
|
+
const n = _i(r, e, i) ? he(r) : V(0);
|
|
4624
4632
|
let h = (s.left + n.x) / o.x, l = (s.top + n.y) / o.y, d = s.width / o.x, f = s.height / o.y;
|
|
4625
4633
|
if (r) {
|
|
4626
4634
|
const x = M(r), u = i && k(i) ? M(i) : i;
|
|
@@ -4705,7 +4713,7 @@ function Hi(a, t) {
|
|
|
4705
4713
|
y: l
|
|
4706
4714
|
};
|
|
4707
4715
|
}
|
|
4708
|
-
function
|
|
4716
|
+
function zt(a, t, e) {
|
|
4709
4717
|
let i;
|
|
4710
4718
|
if (t === "viewport")
|
|
4711
4719
|
i = Ai(a, e);
|
|
@@ -4714,7 +4722,7 @@ function Vt(a, t, e) {
|
|
|
4714
4722
|
else if (k(t))
|
|
4715
4723
|
i = Hi(t, e);
|
|
4716
4724
|
else {
|
|
4717
|
-
const s =
|
|
4725
|
+
const s = he(a);
|
|
4718
4726
|
i = {
|
|
4719
4727
|
...t,
|
|
4720
4728
|
x: t.x - s.x,
|
|
@@ -4723,9 +4731,9 @@ function Vt(a, t, e) {
|
|
|
4723
4731
|
}
|
|
4724
4732
|
return ut(i);
|
|
4725
4733
|
}
|
|
4726
|
-
function
|
|
4734
|
+
function le(a, t) {
|
|
4727
4735
|
const e = z(a);
|
|
4728
|
-
return e === t || !k(e) || Q(e) ? !1 : F(e).position === "fixed" ||
|
|
4736
|
+
return e === t || !k(e) || Q(e) ? !1 : F(e).position === "fixed" || le(e, t);
|
|
4729
4737
|
}
|
|
4730
4738
|
function Mi(a, t) {
|
|
4731
4739
|
const e = t.get(a);
|
|
@@ -4736,7 +4744,7 @@ function Mi(a, t) {
|
|
|
4736
4744
|
let o = r ? z(a) : a;
|
|
4737
4745
|
for (; k(o) && !Q(o); ) {
|
|
4738
4746
|
const n = F(o), h = Dt(o);
|
|
4739
|
-
!h && n.position === "fixed" && (s = null), (r ? !h && !s : !h && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h &&
|
|
4747
|
+
!h && n.position === "fixed" && (s = null), (r ? !h && !s : !h && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && le(a, o)) ? i = i.filter((d) => d !== o) : s = n, o = z(o);
|
|
4740
4748
|
}
|
|
4741
4749
|
return t.set(a, i), i;
|
|
4742
4750
|
}
|
|
@@ -4748,9 +4756,9 @@ function Di(a) {
|
|
|
4748
4756
|
strategy: s
|
|
4749
4757
|
} = a;
|
|
4750
4758
|
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Mi(t, this._c) : [].concat(e), i], n = o[0], h = o.reduce((l, d) => {
|
|
4751
|
-
const f =
|
|
4759
|
+
const f = zt(t, d, s);
|
|
4752
4760
|
return l.top = U(f.top, l.top), l.right = rt(f.right, l.right), l.bottom = rt(f.bottom, l.bottom), l.left = U(f.left, l.left), l;
|
|
4753
|
-
},
|
|
4761
|
+
}, zt(t, n, s));
|
|
4754
4762
|
return {
|
|
4755
4763
|
width: h.right - h.left,
|
|
4756
4764
|
height: h.bottom - h.top,
|
|
@@ -4762,7 +4770,7 @@ function ki(a) {
|
|
|
4762
4770
|
const {
|
|
4763
4771
|
width: t,
|
|
4764
4772
|
height: e
|
|
4765
|
-
} =
|
|
4773
|
+
} = ae(a);
|
|
4766
4774
|
return {
|
|
4767
4775
|
width: t,
|
|
4768
4776
|
height: e
|
|
@@ -4797,7 +4805,7 @@ function Fi(a, t, e) {
|
|
|
4797
4805
|
function mt(a) {
|
|
4798
4806
|
return F(a).position === "static";
|
|
4799
4807
|
}
|
|
4800
|
-
function
|
|
4808
|
+
function $t(a, t) {
|
|
4801
4809
|
if (!N(a) || F(a).position === "fixed")
|
|
4802
4810
|
return null;
|
|
4803
4811
|
if (t)
|
|
@@ -4805,7 +4813,7 @@ function zt(a, t) {
|
|
|
4805
4813
|
let e = a.offsetParent;
|
|
4806
4814
|
return Y(a) === e && (e = e.ownerDocument.body), e;
|
|
4807
4815
|
}
|
|
4808
|
-
function
|
|
4816
|
+
function de(a, t) {
|
|
4809
4817
|
const e = M(a);
|
|
4810
4818
|
if (wt(a))
|
|
4811
4819
|
return e;
|
|
@@ -4818,13 +4826,13 @@ function le(a, t) {
|
|
|
4818
4826
|
}
|
|
4819
4827
|
return e;
|
|
4820
4828
|
}
|
|
4821
|
-
let i =
|
|
4829
|
+
let i = $t(a, t);
|
|
4822
4830
|
for (; i && Ri(i) && mt(i); )
|
|
4823
|
-
i =
|
|
4831
|
+
i = $t(i, t);
|
|
4824
4832
|
return i && Q(i) && mt(i) && !Dt(i) ? e : i || Ii(a) || e;
|
|
4825
4833
|
}
|
|
4826
4834
|
const Xi = async function(a) {
|
|
4827
|
-
const t = this.getOffsetParent ||
|
|
4835
|
+
const t = this.getOffsetParent || de, e = this.getDimensions, i = await e(a.floating);
|
|
4828
4836
|
return {
|
|
4829
4837
|
reference: Fi(a.reference, await t(a.floating), a.strategy),
|
|
4830
4838
|
floating: {
|
|
@@ -4842,14 +4850,14 @@ const Ki = {
|
|
|
4842
4850
|
convertOffsetParentRelativeRectToViewportRelativeRect: Si,
|
|
4843
4851
|
getDocumentElement: Y,
|
|
4844
4852
|
getClippingRect: Di,
|
|
4845
|
-
getOffsetParent:
|
|
4853
|
+
getOffsetParent: de,
|
|
4846
4854
|
getElementRects: Xi,
|
|
4847
4855
|
getClientRects: Ti,
|
|
4848
4856
|
getDimensions: ki,
|
|
4849
4857
|
getScale: Z,
|
|
4850
4858
|
isElement: k,
|
|
4851
4859
|
isRTL: Ni
|
|
4852
|
-
},
|
|
4860
|
+
}, fe = Ci, xe = vi, ue = Ei, Yi = mi, ge = (a, t, e) => {
|
|
4853
4861
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
4854
4862
|
platform: Ki,
|
|
4855
4863
|
...e
|
|
@@ -4917,7 +4925,7 @@ let Bi = class {
|
|
|
4917
4925
|
return;
|
|
4918
4926
|
this.enable = !0, this.contentEl.style.maxWidth = `${t.overflowTooltipMaxWidth || 500}px`, this.contentEl.style.width = "100%", this.contentEl.style.display = "inline-block", this.contentEl.style.wordBreak = "break-all", this.contentEl.style.lineHeight = "1.5", this.contentEl.innerText = e;
|
|
4919
4927
|
const s = t.drawX + i.x, r = t.drawY + i.y;
|
|
4920
|
-
|
|
4928
|
+
ge({
|
|
4921
4929
|
getBoundingClientRect() {
|
|
4922
4930
|
return {
|
|
4923
4931
|
width: t.visibleWidth,
|
|
@@ -4932,7 +4940,7 @@ let Bi = class {
|
|
|
4932
4940
|
}
|
|
4933
4941
|
}, this.floatingEl, {
|
|
4934
4942
|
placement: t.overflowTooltipPlacement,
|
|
4935
|
-
middleware: [
|
|
4943
|
+
middleware: [xe(), ue(), fe(6), Yi({ element: this.arrowEl })]
|
|
4936
4944
|
}).then((n) => {
|
|
4937
4945
|
const { x: h, y: l, placement: d, middlewareData: f } = n;
|
|
4938
4946
|
if (Object.assign(this.floatingEl.style, {
|
|
@@ -5027,13 +5035,13 @@ class Wi {
|
|
|
5027
5035
|
});
|
|
5028
5036
|
}
|
|
5029
5037
|
initTextEditor() {
|
|
5030
|
-
const { CSS_PREFIX: t, SELECT_BORDER_COLOR: e } = this.ctx.config;
|
|
5031
|
-
this.inputEl = document.createElement("div"), this.inputEl.addEventListener("keydown", (
|
|
5032
|
-
this.enable && (
|
|
5038
|
+
const { CSS_PREFIX: t, SELECT_BORDER_COLOR: e, ENABLE_EDIT_TEXT_ENTER: i } = this.ctx.config;
|
|
5039
|
+
this.inputEl = document.createElement("div"), this.inputEl.addEventListener("keydown", (n) => {
|
|
5040
|
+
i && this.enable && (n.code === "Enter" || n.code === "Escape") && (n.preventDefault(), this.inputEl.blur());
|
|
5033
5041
|
}), this.inputEl.addEventListener("blur", () => {
|
|
5034
5042
|
this.doneEdit();
|
|
5035
5043
|
}), this.editorEl = document.createElement("div"), this.editorEl.className = `${t}-self-editor`, this.inputEl.className = `${t}-self-editor-input`;
|
|
5036
|
-
const
|
|
5044
|
+
const s = {
|
|
5037
5045
|
position: "absolute",
|
|
5038
5046
|
top: "-10000px",
|
|
5039
5047
|
left: "-10000px",
|
|
@@ -5049,8 +5057,8 @@ class Wi {
|
|
|
5049
5057
|
display: "flex",
|
|
5050
5058
|
alignItems: "center"
|
|
5051
5059
|
};
|
|
5052
|
-
Object.assign(this.editorEl.style,
|
|
5053
|
-
const
|
|
5060
|
+
Object.assign(this.editorEl.style, s);
|
|
5061
|
+
const r = {
|
|
5054
5062
|
width: "100%",
|
|
5055
5063
|
boxSizing: "border-box",
|
|
5056
5064
|
padding: "8px",
|
|
@@ -5066,15 +5074,15 @@ class Wi {
|
|
|
5066
5074
|
background: "#fff",
|
|
5067
5075
|
cursor: "text"
|
|
5068
5076
|
};
|
|
5069
|
-
Object.assign(this.inputEl.style,
|
|
5070
|
-
const
|
|
5071
|
-
this.inputEl.contentEditable =
|
|
5077
|
+
Object.assign(this.inputEl.style, r);
|
|
5078
|
+
const o = navigator.userAgent.toLowerCase().includes("firefox");
|
|
5079
|
+
this.inputEl.contentEditable = o ? "true" : "plaintext-only", this.editorEl.appendChild(this.inputEl), this.ctx.targetContainer.appendChild(this.editorEl);
|
|
5072
5080
|
}
|
|
5073
5081
|
startEditByInput(t) {
|
|
5074
5082
|
if (t.editorType !== "text")
|
|
5075
5083
|
return;
|
|
5076
5084
|
const e = t.getValue(), { width: i, height: s } = t, r = t.getDrawX(), o = t.getDrawY(), { CELL_PADDING: n } = this.ctx.config;
|
|
5077
|
-
this.editorEl.style.left = `${r}px`, this.editorEl.style.top = `${o}px`, this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${s - 1}px`, this.inputEl.style.padding = `${n}px`, e !== null && (this.inputEl.
|
|
5085
|
+
this.editorEl.style.left = `${r}px`, this.editorEl.style.top = `${o}px`, this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${s - 1}px`, this.inputEl.style.padding = `${n}px`, e !== null && (this.inputEl.textContent = e), this.inputEl.focus();
|
|
5078
5086
|
const h = window.getSelection();
|
|
5079
5087
|
h == null || h.selectAllChildren(this.inputEl), h == null || h.collapseToEnd();
|
|
5080
5088
|
}
|
|
@@ -5355,9 +5363,9 @@ class zi {
|
|
|
5355
5363
|
}),
|
|
5356
5364
|
contextElement: document.body
|
|
5357
5365
|
};
|
|
5358
|
-
|
|
5366
|
+
ge(x, this.contextMenuEl, {
|
|
5359
5367
|
placement: "right-start",
|
|
5360
|
-
middleware: [
|
|
5368
|
+
middleware: [fe(), xe(), ue()]
|
|
5361
5369
|
}).then(({ x: u, y }) => {
|
|
5362
5370
|
this.show(u, y);
|
|
5363
5371
|
});
|
|
@@ -5365,7 +5373,7 @@ class zi {
|
|
|
5365
5373
|
}
|
|
5366
5374
|
//创建右键菜单,绑定子项点击事件
|
|
5367
5375
|
createContextMenu() {
|
|
5368
|
-
this.contextMenuEl.className = "e-virt-table-context-menu", this.ctx.targetContainer.appendChild(this.contextMenuEl);
|
|
5376
|
+
this.contextMenuEl.replaceChildren(), this.contextMenuEl.className = "e-virt-table-context-menu", this.ctx.targetContainer.appendChild(this.contextMenuEl);
|
|
5369
5377
|
const { CONTEXT_MENU: t } = this.ctx.config;
|
|
5370
5378
|
this.createContextMenuItems(t, (e) => {
|
|
5371
5379
|
switch (e.value) {
|
|
@@ -5406,6 +5414,9 @@ class zi {
|
|
|
5406
5414
|
top: "-99999px"
|
|
5407
5415
|
});
|
|
5408
5416
|
}
|
|
5417
|
+
updated() {
|
|
5418
|
+
this.createContextMenu();
|
|
5419
|
+
}
|
|
5409
5420
|
destroy() {
|
|
5410
5421
|
this.contextMenuEl.remove();
|
|
5411
5422
|
}
|
|
@@ -5435,6 +5446,7 @@ class Gi {
|
|
|
5435
5446
|
});
|
|
5436
5447
|
}
|
|
5437
5448
|
loadConfig(t) {
|
|
5449
|
+
this.ctx.config.init(t), this.ctx.database.init(), this.contextMenu.updated(), this.ctx.emit("draw");
|
|
5438
5450
|
}
|
|
5439
5451
|
loadColumns(t) {
|
|
5440
5452
|
this.editor.doneEdit(), this.ctx.database.setColumns(t), this.header.init(), this.ctx.emit("draw");
|
|
@@ -5571,7 +5583,7 @@ class Gi {
|
|
|
5571
5583
|
* 销毁
|
|
5572
5584
|
*/
|
|
5573
5585
|
destroy() {
|
|
5574
|
-
this.overlayer.destroy(), this.empty.destroy(), this.editor.destroy(), this.tooltip.destroy(), this.selector.destroy(), this.autofill.destroy(), this.contextMenu.destroy(), this.ctx.destroy(), this.target.remove()
|
|
5586
|
+
this.overlayer.destroy(), this.empty.destroy(), this.editor.destroy(), this.tooltip.destroy(), this.selector.destroy(), this.autofill.destroy(), this.contextMenu.destroy(), this.ctx.destroy(), this.target.remove();
|
|
5575
5587
|
}
|
|
5576
5588
|
}
|
|
5577
5589
|
export {
|