e-virt-table 0.0.4 → 0.0.6

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.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 we = Object.defineProperty;
3
- var pe = (a, t, e) => t in a ? we(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
4
- var c = (a, t, e) => pe(a, typeof t != "symbol" ? t + "" : 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 ye(a, t) {
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 me() {
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 me() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
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 Ee(a) {
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 || !Ee(i)) return i;
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 be = /%[sdj%]/g, $t = function() {
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" && ($t = function(t, e) {
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(be, function(n) {
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 Ce(a) {
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 || Ce(t) && typeof a == "string" && !a);
123
+ return !!(a == null || t === "array" && Array.isArray(a) && !a.length || ve(t) && typeof a == "string" && !a);
124
124
  }
125
- function ve(a, t, e) {
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 Re(a) {
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
- ye(t, a);
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 Ie(a, t, e, i, s) {
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 = Re(a);
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) : ve(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 Oe(a) {
186
+ function _e(a) {
187
187
  return !!(a && a.message !== void 0);
188
188
  }
189
- function _e(a, t) {
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 = _e(t, a.fullFields) : i = t[e.field || a.fullField], Oe(e) ? (e.field = e.field || a.fullField, e.fieldValue = i, e) : {
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 qt = function(t, e, i, s, r, o) {
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
- }, Se = function(t, e, i, s, r) {
219
+ }, Te = function(t, e, i, s, r) {
220
220
  (/^\s+$/.test(e) || e === "") && s.push(H(r.messages.whitespace, t.fullField));
221
- }, lt, Te = function() {
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(Te());
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
- }, Le = function(t, e, i, s, r) {
295
+ }, Ae = function(t, e, i, s, r) {
296
296
  if (t.required && e === void 0) {
297
- qt(t, e, i, s, r);
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
- }, Ae = function(t, e, i, s, r) {
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", He = function(t, e, i, s, r) {
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
- }, Me = function(t, e, i, s, r) {
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: qt,
320
- whitespace: Se,
321
- type: Le,
322
- range: Ae,
323
- enum: He,
324
- pattern: Me
325
- }, De = function(t, e, i, s, r) {
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
- }, ke = function(t, e, i, s, r) {
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
- }, Fe = function(t, e, i, s, r) {
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
- }, Xe = function(t, e, i, s, r) {
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
- }, Ne = function(t, e, i, s, r) {
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
- }, Ke = function(t, e, i, s, r) {
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
- }, Ye = function(t, e, i, s, r) {
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
- }, Be = function(t, e, i, s, r) {
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
- }, We = function(t, e, i, s, r) {
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
- }, Pe = "enum", Ve = function(t, e, i, s, r) {
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[Pe](t, e, s, o, r);
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
- }, ze = function(t, e, i, s, r) {
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
- }, $e = function(t, e, i, s, r) {
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
- }, qe = function(t, e, i, s, r) {
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
- }, Ge = function(t, e, i, s, r) {
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: De,
445
- method: ke,
446
- number: Fe,
447
- boolean: Xe,
448
- regexp: Ne,
449
- integer: Ke,
450
- float: Ye,
451
- array: Be,
452
- object: We,
453
- enum: Ve,
454
- pattern: ze,
455
- date: $e,
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: qe,
460
- any: Ge
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 Ie(x, h, function(g, w) {
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 = $t;
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 Gt(a, t) {
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 jt(a) {
666
- return a ? a.map((t) => jt(t.children) + 1).sort((t, e) => e - t)[0] : 0;
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 je(a = []) {
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 Ut(a = [], t = 1, e = 0) {
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 = Ut(i.children, t - 1, e + 1);
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 Ue {
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 Ze {
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 Je {
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 Qe {
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 ti {
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 ei {
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 Zt {
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 Jt extends Zt {
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 Qt extends Zt {
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 Qt)
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 Jt && ["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"));
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 ei(i.config || {}), this.eventBus = new Qe(), this.eventBrowser = new Je(this), this.eventTable = new si(this), this.paint = new ti(e), this.database = new Ue(this, i), this.history = new Ze(this), this.icons = new ii(this);
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 Bt {
2770
+ class Wt {
2763
2771
  constructor(t, e) {
2764
2772
  c(this, "ctx");
2765
2773
  c(this, "type");
@@ -2816,35 +2824,15 @@ class Bt {
2816
2824
  return t >= i && t <= i + r && e >= s && e <= s + o;
2817
2825
  }
2818
2826
  isOnScrollbar(t, e) {
2819
- return this.isPointInElement(
2820
- t,
2821
- e,
2822
- this.barX,
2823
- this.barY,
2824
- this.barWidth,
2825
- this.barHeight
2826
- );
2827
+ return this.isPointInElement(t, e, this.barX, this.barY, this.barWidth, this.barHeight);
2827
2828
  }
2828
2829
  isOnTrack(t, e) {
2829
- return this.isPointInElement(
2830
- t,
2831
- e,
2832
- this.trackX,
2833
- this.trackY,
2834
- this.trackWidth,
2835
- this.trackHeight
2836
- );
2830
+ return this.isPointInElement(t, e, this.trackX, this.trackY, this.trackWidth, this.trackHeight);
2837
2831
  }
2838
2832
  updateScroll(t) {
2839
2833
  t.preventDefault();
2840
2834
  const e = t.deltaX, i = t.deltaY;
2841
- this.type === "vertical" && t.shiftKey === !1 ? this.scroll = Math.max(0, Math.min(this.scroll + i, this.distance)) : this.type === "horizontal" && (t.shiftKey ? this.scroll = Math.max(
2842
- 0,
2843
- Math.min(this.scroll + i, this.distance)
2844
- ) : this.scroll = Math.max(
2845
- 0,
2846
- Math.min(this.scroll + e, this.distance)
2847
- ));
2835
+ this.type === "vertical" && t.shiftKey === !1 ? this.scroll = Math.max(0, Math.min(this.scroll + i, this.distance)) : this.type === "horizontal" && (t.shiftKey ? this.scroll = Math.max(0, Math.min(this.scroll + i, this.distance)) : this.scroll = Math.max(0, Math.min(this.scroll + e, this.distance)));
2848
2836
  }
2849
2837
  updatedSize() {
2850
2838
  const {
@@ -2853,12 +2841,7 @@ class Bt {
2853
2841
  config: { SCROLLER_TRACK_SIZE: i = 0, SCROLLER_SIZE: s = 0 }
2854
2842
  } = this.ctx, r = this.ctx.target.width + 1, o = this.ctx.target.height, n = e.height, h = e.width, l = t.height, d = this.ctx.footer.height;
2855
2843
  if (this.type === "vertical") {
2856
- this.visibleDistance = o - i - n, this.distance = l - this.visibleDistance + d, this.trackX = r - i, this.trackY = 0, this.splitPoints = [
2857
- this.trackX,
2858
- n,
2859
- this.trackX + i,
2860
- n
2861
- ], this.trackWidth = i, this.trackHeight = o, this.barX = this.trackX + (i - s) / 2, this.barWidth = s;
2844
+ this.visibleDistance = o - i - n, this.distance = l - this.visibleDistance + d, this.trackX = r - i, this.trackY = 0, this.splitPoints = [this.trackX, n, this.trackX + i, n], this.trackWidth = i, this.trackHeight = o, this.barX = this.trackX + (i - s) / 2, this.barWidth = s;
2862
2845
  const f = this.distance ? this.visibleDistance / l : 0;
2863
2846
  let x = Math.floor(f * this.visibleDistance);
2864
2847
  x < 30 ? x = 30 : x > this.visibleDistance && (x = 0), this.barHeight = x, this.barY = n + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
@@ -2876,32 +2859,15 @@ class Bt {
2876
2859
  }
2877
2860
  draw() {
2878
2861
  const {
2879
- config: {
2880
- SCROLLER_FOCUS_COLOR: t,
2881
- SCROLLER_COLOR: e,
2882
- BORDER_COLOR: i,
2883
- SCROLLER_TRACK_COLOR: s
2884
- }
2862
+ config: { SCROLLER_FOCUS_COLOR: t, SCROLLER_COLOR: e, BORDER_COLOR: i, SCROLLER_TRACK_COLOR: s }
2885
2863
  } = this.ctx;
2886
- this.updatedSize(), this.ctx.paint.drawRect(
2887
- this.trackX,
2888
- this.trackY,
2889
- this.trackWidth,
2890
- this.trackHeight,
2891
- {
2892
- borderColor: i,
2893
- fillColor: s
2894
- }
2895
- ), this.ctx.paint.drawRect(
2896
- this.barX,
2897
- this.barY,
2898
- this.barWidth,
2899
- this.barHeight,
2900
- {
2901
- fillColor: this.isFocus || this.isDragging ? t : e,
2902
- radius: 4
2903
- }
2904
- ), this.splitPoints.length > 0 && this.ctx.paint.drawLine(this.splitPoints, {
2864
+ this.updatedSize(), this.ctx.paint.drawRect(this.trackX, this.trackY, this.trackWidth, this.trackHeight, {
2865
+ borderColor: i,
2866
+ fillColor: s
2867
+ }), this.ctx.paint.drawRect(this.barX, this.barY, this.barWidth, this.barHeight, {
2868
+ fillColor: this.isFocus || this.isDragging ? t : e,
2869
+ radius: 4
2870
+ }), this.splitPoints.length > 0 && this.ctx.paint.drawLine(this.splitPoints, {
2905
2871
  borderColor: i,
2906
2872
  borderWidth: 1
2907
2873
  }), this.ctx.scrollerFocus = this.isFocus;
@@ -2912,7 +2878,7 @@ class oi {
2912
2878
  c(this, "ctx");
2913
2879
  c(this, "verticalScrollbar");
2914
2880
  c(this, "horizontalScrollbar");
2915
- this.ctx = t, this.verticalScrollbar = new Bt(t, "vertical"), this.horizontalScrollbar = new Bt(t, "horizontal"), this.ctx.on("wheel", (e) => this.onWheel(e)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("setScroll", (e, i) => {
2881
+ 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
2882
  this.setScroll(e, i);
2917
2883
  }), this.ctx.on("setScrollX", (e) => {
2918
2884
  this.setScrollX(e);
@@ -2935,7 +2901,7 @@ class oi {
2935
2901
  draw() {
2936
2902
  this.verticalScrollbar.draw(), this.horizontalScrollbar.draw();
2937
2903
  const t = Math.floor(this.horizontalScrollbar.scroll), e = Math.floor(this.verticalScrollbar.scroll);
2938
- (t !== this.ctx.scrollX || e !== this.ctx.scrollY) && (this.ctx.scrollX = t, this.ctx.scrollY = e, this.ctx.emit("draw"), this.ctx.emit("onScroll", t, e), t !== this.ctx.scrollX && this.ctx.emit("onScrollX", t), e !== this.ctx.scrollY && this.ctx.emit("onScrollY", e));
2904
+ (t !== this.ctx.scrollX || e !== this.ctx.scrollY) && (this.ctx.emit("onScroll", t, e), t !== this.ctx.scrollX && this.ctx.emit("onScrollX", t), e !== this.ctx.scrollY && this.ctx.emit("onScrollY", e), this.ctx.scrollX = t, this.ctx.scrollY = e, this.ctx.emit("draw"));
2939
2905
  }
2940
2906
  setScroll(t, e) {
2941
2907
  this.horizontalScrollbar.scroll = t, this.verticalScrollbar.scroll = e, this.ctx.emit("draw");
@@ -2951,9 +2917,7 @@ class oi {
2951
2917
  i && this.setScrollX(i.x - e.visibleWidth / 2);
2952
2918
  }
2953
2919
  scrollToColIndex(t) {
2954
- const { header: e } = this.ctx, i = e.leafCellHeaders.find(
2955
- (s) => s.colIndex === t
2956
- );
2920
+ const { header: e } = this.ctx, i = e.leafCellHeaders.find((s) => s.colIndex === t);
2957
2921
  i && i.x > e.visibleWidth / 2 && this.setScrollX(i.x - e.visibleWidth / 2);
2958
2922
  }
2959
2923
  scrollToRowIndex(t) {
@@ -3004,7 +2968,7 @@ class ni {
3004
2968
  c(this, "renderFixedCellHeaders", []);
3005
2969
  this.ctx = t, this.ctx.on(
3006
2970
  "resetHeader",
3007
- Gt(() => {
2971
+ jt(() => {
3008
2972
  this.init(), this.ctx.emit("draw");
3009
2973
  }, 100)
3010
2974
  ), this.init(), this.initResizeColumn();
@@ -3014,13 +2978,13 @@ class ni {
3014
2978
  config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
3015
2979
  } = this.ctx, i = this.ctx.database.getColumns();
3016
2980
  this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
3017
- const s = jt(i), r = It(i);
2981
+ const s = Ut(i), r = It(i);
3018
2982
  this.height = t * s, this.width = r.reduce(
3019
2983
  (d, f) => d + ((f == null ? void 0 : f.width) || 100),
3020
2984
  0
3021
2985
  ), this.visibleHeight = this.height;
3022
- const o = je(Ut(i, s));
3023
- this.columnIndex = 0, this.resizeNum = 0, console.log("spanColumns", o), this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
2986
+ const o = Ue(Zt(i, s));
2987
+ this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
3024
2988
  const n = this.ctx.targetContainer.getBoundingClientRect();
3025
2989
  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
2990
  const d = this.visibleWidth - this.width, f = Math.floor(d / this.resizeNum * 100) / 100;
@@ -3128,7 +3092,7 @@ class ni {
3128
3092
  const n = t[o], h = r * (n.rowspan || 1), l = r * n.level;
3129
3093
  let d = n.width || 100;
3130
3094
  n.children && (d = It(n.children).reduce((u, y) => u + ((y == null ? void 0 : y.width) || 100), 0));
3131
- const f = new Qt(
3095
+ const f = new te(
3132
3096
  this.ctx,
3133
3097
  this.columnIndex,
3134
3098
  s,
@@ -3202,7 +3166,7 @@ class ni {
3202
3166
  }), this.drawTipLine();
3203
3167
  }
3204
3168
  }
3205
- class te {
3169
+ class ee {
3206
3170
  constructor(t, e, i = 0, s = 0, r = 0, o = 0, n, h = "body") {
3207
3171
  c(this, "ctx");
3208
3172
  c(this, "x", 0);
@@ -3221,7 +3185,7 @@ class te {
3221
3185
  update() {
3222
3186
  const { header: t } = this.ctx, e = [], i = [], s = [];
3223
3187
  t.renderLeafCellHeaders.forEach((r) => {
3224
- const o = new Jt(
3188
+ const o = new Qt(
3225
3189
  this.ctx,
3226
3190
  this.rowIndex,
3227
3191
  r.colIndex,
@@ -3432,7 +3396,7 @@ class ai {
3432
3396
  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
3397
  const l = [];
3434
3398
  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 te(this.ctx, f, 0, y + this.y, t.width, u, x);
3399
+ 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
3400
  l.push(g);
3437
3401
  }
3438
3402
  this.renderRows = l, this.ctx.body.renderRows = l;
@@ -3500,7 +3464,7 @@ class ci {
3500
3464
  let e = this.y;
3501
3465
  const i = [];
3502
3466
  this.data.forEach((s, r) => {
3503
- const o = new te(
3467
+ const o = new ee(
3504
3468
  this.ctx,
3505
3469
  r,
3506
3470
  0,
@@ -3537,7 +3501,7 @@ class hi {
3537
3501
  init() {
3538
3502
  this.ctx.on(
3539
3503
  "mousemove",
3540
- Gt((t) => {
3504
+ jt((t) => {
3541
3505
  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
3506
  (this.ctx.selectorMove || this.ctx.autofillMove) && (s ? this.stopAdjustPosition() : this.startAdjustPosition(t));
3543
3507
  }, 100)
@@ -4009,7 +3973,7 @@ function q(a) {
4009
3973
  function ct(a) {
4010
3974
  return a.split("-")[1];
4011
3975
  }
4012
- function ee(a) {
3976
+ function ie(a) {
4013
3977
  return a === "x" ? "y" : "x";
4014
3978
  }
4015
3979
  function Ht(a) {
@@ -4019,7 +3983,7 @@ function J(a) {
4019
3983
  return ["top", "bottom"].includes(q(a)) ? "y" : "x";
4020
3984
  }
4021
3985
  function Mt(a) {
4022
- return ee(J(a));
3986
+ return ie(J(a));
4023
3987
  }
4024
3988
  function xi(a, t, e) {
4025
3989
  e === void 0 && (e = !1);
@@ -4064,7 +4028,7 @@ function pi(a) {
4064
4028
  ...a
4065
4029
  };
4066
4030
  }
4067
- function ie(a) {
4031
+ function se(a) {
4068
4032
  return typeof a != "number" ? pi(a) : {
4069
4033
  top: a,
4070
4034
  right: a,
@@ -4090,7 +4054,7 @@ function ut(a) {
4090
4054
  y: e
4091
4055
  };
4092
4056
  }
4093
- function Wt(a, t, e) {
4057
+ function Pt(a, t, e) {
4094
4058
  let {
4095
4059
  reference: i,
4096
4060
  floating: s
@@ -4152,7 +4116,7 @@ const yi = async (a, t, e) => {
4152
4116
  }), {
4153
4117
  x: d,
4154
4118
  y: f
4155
- } = Wt(l, i, h), x = i, u = {}, y = 0;
4119
+ } = Pt(l, i, h), x = i, u = {}, y = 0;
4156
4120
  for (let g = 0; g < n.length; g++) {
4157
4121
  const {
4158
4122
  name: w,
@@ -4189,7 +4153,7 @@ const yi = async (a, t, e) => {
4189
4153
  }) : C.rects), {
4190
4154
  x: d,
4191
4155
  y: f
4192
- } = Wt(l, x, h)), g = -1);
4156
+ } = Pt(l, x, h)), g = -1);
4193
4157
  }
4194
4158
  return {
4195
4159
  x: d,
@@ -4199,7 +4163,7 @@ const yi = async (a, t, e) => {
4199
4163
  middlewareData: u
4200
4164
  };
4201
4165
  };
4202
- async function se(a, t) {
4166
+ async function re(a, t) {
4203
4167
  var e;
4204
4168
  t === void 0 && (t = {});
4205
4169
  const {
@@ -4215,7 +4179,7 @@ async function se(a, t) {
4215
4179
  elementContext: f = "floating",
4216
4180
  altBoundary: x = !1,
4217
4181
  padding: u = 0
4218
- } = at(t, a), y = ie(u), w = n[x ? f === "floating" ? "reference" : "floating" : f], p = ut(await r.getClippingRect({
4182
+ } = at(t, a), y = se(u), w = n[x ? f === "floating" ? "reference" : "floating" : f], p = ut(await r.getClippingRect({
4219
4183
  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
4184
  boundary: l,
4221
4185
  rootBoundary: d,
@@ -4262,7 +4226,7 @@ const mi = (a) => ({
4262
4226
  } = at(a, t) || {};
4263
4227
  if (l == null)
4264
4228
  return {};
4265
- const f = ie(d), x = {
4229
+ const f = se(d), x = {
4266
4230
  x: e,
4267
4231
  y: i
4268
4232
  }, 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 +4271,7 @@ const mi = (a) => ({
4307
4271
  return {};
4308
4272
  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
4273
  !x && R && C.push(...wi(n, g, y, b));
4310
- const T = [n, ...C], L = await se(t, w), A = [];
4274
+ const T = [n, ...C], L = await re(t, w), A = [];
4311
4275
  let D = ((i = r.flip) == null ? void 0 : i.overflows) || [];
4312
4276
  if (d && A.push(L[p]), f) {
4313
4277
  const _ = xi(s, o, b);
@@ -4342,7 +4306,7 @@ const mi = (a) => ({
4342
4306
  P === "y";
4343
4307
  }
4344
4308
  return !0;
4345
- }).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, ge) => P + ge, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 : S[0];
4309
+ }).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
4310
  X && (K = X);
4347
4311
  break;
4348
4312
  }
@@ -4438,7 +4402,7 @@ const Ci = function(a) {
4438
4402
  } = at(a, t), l = {
4439
4403
  x: e,
4440
4404
  y: i
4441
- }, d = await se(t, h), f = J(q(s)), x = ee(f);
4405
+ }, d = await re(t, h), f = J(q(s)), x = ie(f);
4442
4406
  let u = l[x], y = l[f];
4443
4407
  if (r) {
4444
4408
  const w = x === "y" ? "top" : "left", p = x === "y" ? "bottom" : "right", E = u + d[w], m = u - d[p];
@@ -4471,7 +4435,7 @@ function gt() {
4471
4435
  return typeof window < "u";
4472
4436
  }
4473
4437
  function tt(a) {
4474
- return re(a) ? (a.nodeName || "").toLowerCase() : "#document";
4438
+ return oe(a) ? (a.nodeName || "").toLowerCase() : "#document";
4475
4439
  }
4476
4440
  function M(a) {
4477
4441
  var t;
@@ -4479,9 +4443,9 @@ function M(a) {
4479
4443
  }
4480
4444
  function Y(a) {
4481
4445
  var t;
4482
- return (t = (re(a) ? a.ownerDocument : a.document) || window.document) == null ? void 0 : t.documentElement;
4446
+ return (t = (oe(a) ? a.ownerDocument : a.document) || window.document) == null ? void 0 : t.documentElement;
4483
4447
  }
4484
- function re(a) {
4448
+ function oe(a) {
4485
4449
  return gt() ? a instanceof Node || a instanceof M(a).Node : !1;
4486
4450
  }
4487
4451
  function k(a) {
@@ -4490,7 +4454,7 @@ function k(a) {
4490
4454
  function N(a) {
4491
4455
  return gt() ? a instanceof HTMLElement || a instanceof M(a).HTMLElement : !1;
4492
4456
  }
4493
- function Pt(a) {
4457
+ function Vt(a) {
4494
4458
  return !gt() || typeof ShadowRoot > "u" ? !1 : a instanceof ShadowRoot || a instanceof M(a).ShadowRoot;
4495
4459
  }
4496
4460
  function ht(a) {
@@ -4554,19 +4518,19 @@ function z(a) {
4554
4518
  // Step into the shadow DOM of the parent of a slotted node.
4555
4519
  a.assignedSlot || // DOM Element detected.
4556
4520
  a.parentNode || // ShadowRoot detected.
4557
- Pt(a) && a.host || // Fallback.
4521
+ Vt(a) && a.host || // Fallback.
4558
4522
  Y(a)
4559
4523
  );
4560
- return Pt(t) ? t.host : t;
4524
+ return Vt(t) ? t.host : t;
4561
4525
  }
4562
- function oe(a) {
4526
+ function ne(a) {
4563
4527
  const t = z(a);
4564
- return Q(t) ? a.ownerDocument ? a.ownerDocument.body : a.body : N(t) && ht(t) ? t : oe(t);
4528
+ return Q(t) ? a.ownerDocument ? a.ownerDocument.body : a.body : N(t) && ht(t) ? t : ne(t);
4565
4529
  }
4566
4530
  function St(a, t, e) {
4567
4531
  var i;
4568
4532
  t === void 0 && (t = []), e === void 0 && (e = !0);
4569
- const s = oe(a), r = s === ((i = a.ownerDocument) == null ? void 0 : i.body), o = M(s);
4533
+ const s = ne(a), r = s === ((i = a.ownerDocument) == null ? void 0 : i.body), o = M(s);
4570
4534
  if (r) {
4571
4535
  const n = Tt(o);
4572
4536
  return t.concat(o, o.visualViewport || [], ht(s) ? s : [], n && e ? St(n) : []);
@@ -4576,7 +4540,7 @@ function St(a, t, e) {
4576
4540
  function Tt(a) {
4577
4541
  return a.parent && Object.getPrototypeOf(a.parent) ? a.frameElement : null;
4578
4542
  }
4579
- function ne(a) {
4543
+ function ae(a) {
4580
4544
  const t = F(a);
4581
4545
  let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
4582
4546
  const s = N(a), r = s ? a.offsetWidth : e, o = s ? a.offsetHeight : i, n = ft(e) !== r || ft(i) !== o;
@@ -4586,18 +4550,18 @@ function ne(a) {
4586
4550
  $: n
4587
4551
  };
4588
4552
  }
4589
- function ae(a) {
4553
+ function ce(a) {
4590
4554
  return k(a) ? a : a.contextElement;
4591
4555
  }
4592
4556
  function Z(a) {
4593
- const t = ae(a);
4557
+ const t = ce(a);
4594
4558
  if (!N(t))
4595
4559
  return V(1);
4596
4560
  const e = t.getBoundingClientRect(), {
4597
4561
  width: i,
4598
4562
  height: s,
4599
4563
  $: r
4600
- } = ne(t);
4564
+ } = ae(t);
4601
4565
  let o = (r ? ft(e.width) : e.width) / i, n = (r ? ft(e.height) : e.height) / s;
4602
4566
  return (!o || !Number.isFinite(o)) && (o = 1), (!n || !Number.isFinite(n)) && (n = 1), {
4603
4567
  x: o,
@@ -4605,7 +4569,7 @@ function Z(a) {
4605
4569
  };
4606
4570
  }
4607
4571
  const Oi = /* @__PURE__ */ V(0);
4608
- function ce(a) {
4572
+ function he(a) {
4609
4573
  const t = M(a);
4610
4574
  return !kt() || !t.visualViewport ? Oi : {
4611
4575
  x: t.visualViewport.offsetLeft,
@@ -4617,10 +4581,10 @@ function _i(a, t, e) {
4617
4581
  }
4618
4582
  function ot(a, t, e, i) {
4619
4583
  t === void 0 && (t = !1), e === void 0 && (e = !1);
4620
- const s = a.getBoundingClientRect(), r = ae(a);
4584
+ const s = a.getBoundingClientRect(), r = ce(a);
4621
4585
  let o = V(1);
4622
4586
  t && (i ? k(i) && (o = Z(i)) : o = Z(a));
4623
- const n = _i(r, e, i) ? ce(r) : V(0);
4587
+ const n = _i(r, e, i) ? he(r) : V(0);
4624
4588
  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
4589
  if (r) {
4626
4590
  const x = M(r), u = i && k(i) ? M(i) : i;
@@ -4705,7 +4669,7 @@ function Hi(a, t) {
4705
4669
  y: l
4706
4670
  };
4707
4671
  }
4708
- function Vt(a, t, e) {
4672
+ function zt(a, t, e) {
4709
4673
  let i;
4710
4674
  if (t === "viewport")
4711
4675
  i = Ai(a, e);
@@ -4714,7 +4678,7 @@ function Vt(a, t, e) {
4714
4678
  else if (k(t))
4715
4679
  i = Hi(t, e);
4716
4680
  else {
4717
- const s = ce(a);
4681
+ const s = he(a);
4718
4682
  i = {
4719
4683
  ...t,
4720
4684
  x: t.x - s.x,
@@ -4723,9 +4687,9 @@ function Vt(a, t, e) {
4723
4687
  }
4724
4688
  return ut(i);
4725
4689
  }
4726
- function he(a, t) {
4690
+ function le(a, t) {
4727
4691
  const e = z(a);
4728
- return e === t || !k(e) || Q(e) ? !1 : F(e).position === "fixed" || he(e, t);
4692
+ return e === t || !k(e) || Q(e) ? !1 : F(e).position === "fixed" || le(e, t);
4729
4693
  }
4730
4694
  function Mi(a, t) {
4731
4695
  const e = t.get(a);
@@ -4736,7 +4700,7 @@ function Mi(a, t) {
4736
4700
  let o = r ? z(a) : a;
4737
4701
  for (; k(o) && !Q(o); ) {
4738
4702
  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 && he(a, o)) ? i = i.filter((d) => d !== o) : s = n, o = z(o);
4703
+ !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
4704
  }
4741
4705
  return t.set(a, i), i;
4742
4706
  }
@@ -4748,9 +4712,9 @@ function Di(a) {
4748
4712
  strategy: s
4749
4713
  } = a;
4750
4714
  const o = [...e === "clippingAncestors" ? wt(t) ? [] : Mi(t, this._c) : [].concat(e), i], n = o[0], h = o.reduce((l, d) => {
4751
- const f = Vt(t, d, s);
4715
+ const f = zt(t, d, s);
4752
4716
  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
- }, Vt(t, n, s));
4717
+ }, zt(t, n, s));
4754
4718
  return {
4755
4719
  width: h.right - h.left,
4756
4720
  height: h.bottom - h.top,
@@ -4762,7 +4726,7 @@ function ki(a) {
4762
4726
  const {
4763
4727
  width: t,
4764
4728
  height: e
4765
- } = ne(a);
4729
+ } = ae(a);
4766
4730
  return {
4767
4731
  width: t,
4768
4732
  height: e
@@ -4797,7 +4761,7 @@ function Fi(a, t, e) {
4797
4761
  function mt(a) {
4798
4762
  return F(a).position === "static";
4799
4763
  }
4800
- function zt(a, t) {
4764
+ function $t(a, t) {
4801
4765
  if (!N(a) || F(a).position === "fixed")
4802
4766
  return null;
4803
4767
  if (t)
@@ -4805,7 +4769,7 @@ function zt(a, t) {
4805
4769
  let e = a.offsetParent;
4806
4770
  return Y(a) === e && (e = e.ownerDocument.body), e;
4807
4771
  }
4808
- function le(a, t) {
4772
+ function de(a, t) {
4809
4773
  const e = M(a);
4810
4774
  if (wt(a))
4811
4775
  return e;
@@ -4818,13 +4782,13 @@ function le(a, t) {
4818
4782
  }
4819
4783
  return e;
4820
4784
  }
4821
- let i = zt(a, t);
4785
+ let i = $t(a, t);
4822
4786
  for (; i && Ri(i) && mt(i); )
4823
- i = zt(i, t);
4787
+ i = $t(i, t);
4824
4788
  return i && Q(i) && mt(i) && !Dt(i) ? e : i || Ii(a) || e;
4825
4789
  }
4826
4790
  const Xi = async function(a) {
4827
- const t = this.getOffsetParent || le, e = this.getDimensions, i = await e(a.floating);
4791
+ const t = this.getOffsetParent || de, e = this.getDimensions, i = await e(a.floating);
4828
4792
  return {
4829
4793
  reference: Fi(a.reference, await t(a.floating), a.strategy),
4830
4794
  floating: {
@@ -4842,14 +4806,14 @@ const Ki = {
4842
4806
  convertOffsetParentRelativeRectToViewportRelativeRect: Si,
4843
4807
  getDocumentElement: Y,
4844
4808
  getClippingRect: Di,
4845
- getOffsetParent: le,
4809
+ getOffsetParent: de,
4846
4810
  getElementRects: Xi,
4847
4811
  getClientRects: Ti,
4848
4812
  getDimensions: ki,
4849
4813
  getScale: Z,
4850
4814
  isElement: k,
4851
4815
  isRTL: Ni
4852
- }, de = Ci, fe = vi, xe = Ei, Yi = mi, ue = (a, t, e) => {
4816
+ }, fe = Ci, xe = vi, ue = Ei, Yi = mi, ge = (a, t, e) => {
4853
4817
  const i = /* @__PURE__ */ new Map(), s = {
4854
4818
  platform: Ki,
4855
4819
  ...e
@@ -4917,7 +4881,7 @@ let Bi = class {
4917
4881
  return;
4918
4882
  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
4883
  const s = t.drawX + i.x, r = t.drawY + i.y;
4920
- ue({
4884
+ ge({
4921
4885
  getBoundingClientRect() {
4922
4886
  return {
4923
4887
  width: t.visibleWidth,
@@ -4932,7 +4896,7 @@ let Bi = class {
4932
4896
  }
4933
4897
  }, this.floatingEl, {
4934
4898
  placement: t.overflowTooltipPlacement,
4935
- middleware: [fe(), xe(), de(6), Yi({ element: this.arrowEl })]
4899
+ middleware: [xe(), ue(), fe(6), Yi({ element: this.arrowEl })]
4936
4900
  }).then((n) => {
4937
4901
  const { x: h, y: l, placement: d, middlewareData: f } = n;
4938
4902
  if (Object.assign(this.floatingEl.style, {
@@ -5027,13 +4991,13 @@ class Wi {
5027
4991
  });
5028
4992
  }
5029
4993
  initTextEditor() {
5030
- const { CSS_PREFIX: t, SELECT_BORDER_COLOR: e } = this.ctx.config;
5031
- this.inputEl = document.createElement("div"), this.inputEl.addEventListener("keydown", (o) => {
5032
- this.enable && (o.code === "Enter" || o.code === "Escape") && (o.preventDefault(), this.inputEl.blur());
4994
+ const { CSS_PREFIX: t, SELECT_BORDER_COLOR: e, ENABLE_EDIT_TEXT_ENTER: i } = this.ctx.config;
4995
+ this.inputEl = document.createElement("div"), this.inputEl.addEventListener("keydown", (n) => {
4996
+ i && this.enable && (n.code === "Enter" || n.code === "Escape") && (n.preventDefault(), this.inputEl.blur());
5033
4997
  }), this.inputEl.addEventListener("blur", () => {
5034
4998
  this.doneEdit();
5035
4999
  }), this.editorEl = document.createElement("div"), this.editorEl.className = `${t}-self-editor`, this.inputEl.className = `${t}-self-editor-input`;
5036
- const i = {
5000
+ const s = {
5037
5001
  position: "absolute",
5038
5002
  top: "-10000px",
5039
5003
  left: "-10000px",
@@ -5049,8 +5013,8 @@ class Wi {
5049
5013
  display: "flex",
5050
5014
  alignItems: "center"
5051
5015
  };
5052
- Object.assign(this.editorEl.style, i);
5053
- const s = {
5016
+ Object.assign(this.editorEl.style, s);
5017
+ const r = {
5054
5018
  width: "100%",
5055
5019
  boxSizing: "border-box",
5056
5020
  padding: "8px",
@@ -5066,15 +5030,15 @@ class Wi {
5066
5030
  background: "#fff",
5067
5031
  cursor: "text"
5068
5032
  };
5069
- Object.assign(this.inputEl.style, s);
5070
- const r = navigator.userAgent.toLowerCase().includes("firefox");
5071
- this.inputEl.contentEditable = r ? "true" : "plaintext-only", this.editorEl.appendChild(this.inputEl), this.ctx.targetContainer.appendChild(this.editorEl);
5033
+ Object.assign(this.inputEl.style, r);
5034
+ const o = navigator.userAgent.toLowerCase().includes("firefox");
5035
+ this.inputEl.contentEditable = o ? "true" : "plaintext-only", this.editorEl.appendChild(this.inputEl), this.ctx.targetContainer.appendChild(this.editorEl);
5072
5036
  }
5073
5037
  startEditByInput(t) {
5074
5038
  if (t.editorType !== "text")
5075
5039
  return;
5076
5040
  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.innerText = e), this.inputEl.focus();
5041
+ 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
5042
  const h = window.getSelection();
5079
5043
  h == null || h.selectAllChildren(this.inputEl), h == null || h.collapseToEnd();
5080
5044
  }
@@ -5355,9 +5319,9 @@ class zi {
5355
5319
  }),
5356
5320
  contextElement: document.body
5357
5321
  };
5358
- ue(x, this.contextMenuEl, {
5322
+ ge(x, this.contextMenuEl, {
5359
5323
  placement: "right-start",
5360
- middleware: [de(), fe(), xe()]
5324
+ middleware: [fe(), xe(), ue()]
5361
5325
  }).then(({ x: u, y }) => {
5362
5326
  this.show(u, y);
5363
5327
  });
@@ -5365,7 +5329,7 @@ class zi {
5365
5329
  }
5366
5330
  //创建右键菜单,绑定子项点击事件
5367
5331
  createContextMenu() {
5368
- this.contextMenuEl.className = "e-virt-table-context-menu", this.ctx.targetContainer.appendChild(this.contextMenuEl);
5332
+ this.contextMenuEl.replaceChildren(), this.contextMenuEl.className = "e-virt-table-context-menu", this.ctx.targetContainer.appendChild(this.contextMenuEl);
5369
5333
  const { CONTEXT_MENU: t } = this.ctx.config;
5370
5334
  this.createContextMenuItems(t, (e) => {
5371
5335
  switch (e.value) {
@@ -5406,6 +5370,9 @@ class zi {
5406
5370
  top: "-99999px"
5407
5371
  });
5408
5372
  }
5373
+ updated() {
5374
+ this.createContextMenu();
5375
+ }
5409
5376
  destroy() {
5410
5377
  this.contextMenuEl.remove();
5411
5378
  }
@@ -5435,6 +5402,7 @@ class Gi {
5435
5402
  });
5436
5403
  }
5437
5404
  loadConfig(t) {
5405
+ this.ctx.config.init(t), this.ctx.database.init(), this.contextMenu.updated(), this.ctx.emit("draw");
5438
5406
  }
5439
5407
  loadColumns(t) {
5440
5408
  this.editor.doneEdit(), this.ctx.database.setColumns(t), this.header.init(), this.ctx.emit("draw");
@@ -5571,7 +5539,7 @@ class Gi {
5571
5539
  * 销毁
5572
5540
  */
5573
5541
  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(), console.log("销毁");
5542
+ 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
5543
  }
5576
5544
  }
5577
5545
  export {