e-virt-table 1.0.4 → 1.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
@@ -2,23 +2,23 @@
2
2
  var Ce = Object.defineProperty;
3
3
  var be = (a, t, e) => t in a ? Ce(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
4
4
  var l = (a, t, e) => be(a, typeof t != "symbol" ? t + "" : t, e);
5
- function q() {
6
- return q = Object.assign ? Object.assign.bind() : function(a) {
5
+ function G() {
6
+ return G = Object.assign ? Object.assign.bind() : function(a) {
7
7
  for (var t = 1; t < arguments.length; t++) {
8
8
  var e = arguments[t];
9
9
  for (var i in e)
10
10
  Object.prototype.hasOwnProperty.call(e, i) && (a[i] = e[i]);
11
11
  }
12
12
  return a;
13
- }, q.apply(this, arguments);
13
+ }, G.apply(this, arguments);
14
14
  }
15
15
  function ve(a, t) {
16
16
  a.prototype = Object.create(t.prototype), a.prototype.constructor = a, st(a, t);
17
17
  }
18
- function mt(a) {
19
- return mt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
18
+ function Et(a) {
19
+ return Et = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
20
20
  return e.__proto__ || Object.getPrototypeOf(e);
21
- }, mt(a);
21
+ }, Et(a);
22
22
  }
23
23
  function st(a, t) {
24
24
  return st = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(i, s) {
@@ -57,7 +57,7 @@ function Ct(a) {
57
57
  t.set(i, s);
58
58
  }
59
59
  function s() {
60
- return dt(i, arguments, mt(this).constructor);
60
+ return dt(i, arguments, Et(this).constructor);
61
61
  }
62
62
  return s.prototype = Object.create(i.prototype, {
63
63
  constructor: {
@@ -122,7 +122,7 @@ function Oe(a) {
122
122
  function H(a, t) {
123
123
  return !!(a == null || t === "array" && Array.isArray(a) && !a.length || Oe(t) && typeof a == "string" && !a);
124
124
  }
125
- function Ae(a, t, e) {
125
+ function Se(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);
@@ -131,7 +131,7 @@ function Ae(a, t, e) {
131
131
  t(n, o);
132
132
  });
133
133
  }
134
- function kt(a, t, e) {
134
+ function Xt(a, t, e) {
135
135
  var i = 0, s = a.length;
136
136
  function r(o) {
137
137
  if (o && o.length) {
@@ -149,7 +149,7 @@ function Le(a) {
149
149
  t.push.apply(t, a[e] || []);
150
150
  }), t;
151
151
  }
152
- var Xt = /* @__PURE__ */ function(a) {
152
+ var kt = /* @__PURE__ */ function(a) {
153
153
  ve(t, a);
154
154
  function t(e, i) {
155
155
  var s;
@@ -157,13 +157,13 @@ var Xt = /* @__PURE__ */ function(a) {
157
157
  }
158
158
  return t;
159
159
  }(/* @__PURE__ */ Ct(Error));
160
- function Se(a, t, e, i, s) {
160
+ function Ae(a, t, e, i, s) {
161
161
  if (t.first) {
162
162
  var r = new Promise(function(u, x) {
163
163
  var p = function(y) {
164
- return i(y), y.length ? x(new Xt(y, bt(y))) : u(s);
164
+ return i(y), y.length ? x(new kt(y, bt(y))) : u(s);
165
165
  }, g = Le(a);
166
- kt(g, e, p);
166
+ Xt(g, e, p);
167
167
  });
168
168
  return r.catch(function(u) {
169
169
  return u;
@@ -172,11 +172,11 @@ function Se(a, t, e, i, s) {
172
172
  var o = t.firstFields === !0 ? Object.keys(a) : t.firstFields || [], n = Object.keys(a), h = n.length, c = 0, d = [], f = new Promise(function(u, x) {
173
173
  var p = function(w) {
174
174
  if (d.push.apply(d, w), c++, c === h)
175
- return i(d), d.length ? x(new Xt(d, bt(d))) : u(s);
175
+ return i(d), d.length ? x(new kt(d, bt(d))) : u(s);
176
176
  };
177
177
  n.length || (i(d), u(s)), n.forEach(function(g) {
178
178
  var w = a[g];
179
- o.indexOf(g) !== -1 ? kt(w, e, p) : Ae(w, e, p);
179
+ o.indexOf(g) !== -1 ? Xt(w, e, p) : Se(w, e, p);
180
180
  });
181
181
  });
182
182
  return f.catch(function(u) {
@@ -209,7 +209,7 @@ function Kt(a, t) {
209
209
  for (var e in t)
210
210
  if (t.hasOwnProperty(e)) {
211
211
  var i = t[e];
212
- typeof i == "object" && typeof a[e] == "object" ? a[e] = q({}, a[e], i) : a[e] = i;
212
+ typeof i == "object" && typeof a[e] == "object" ? a[e] = G({}, a[e], i) : a[e] = i;
213
213
  }
214
214
  }
215
215
  return a;
@@ -237,13 +237,13 @@ var Ut = function(t, e, i, s, r, o) {
237
237
  `).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), n = new RegExp("^" + s + "$"), h = function(C) {
238
238
  return C && C.exact ? r : new RegExp("(?:" + t(C) + e + t(C) + ")|(?:" + t(C) + s + t(C) + ")", "g");
239
239
  };
240
- h.v4 = function(E) {
241
- return E && E.exact ? o : new RegExp("" + t(E) + e + t(E), "g");
242
- }, h.v6 = function(E) {
243
- return E && E.exact ? n : new RegExp("" + t(E) + s + t(E), "g");
240
+ h.v4 = function(m) {
241
+ return m && m.exact ? o : new RegExp("" + t(m) + e + t(m), "g");
242
+ }, h.v6 = function(m) {
243
+ return m && m.exact ? n : new RegExp("" + t(m) + s + t(m), "g");
244
244
  };
245
- var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source, u = h.v6().source, x = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", p = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", g = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", y = '(?:[/?#][^\\s"]*)?', m = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + u + "|" + x + p + g + ")" + w + y;
246
- return ct = new RegExp("(?:^" + m + "$)", "i"), ct;
245
+ var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source, u = h.v6().source, x = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", p = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", g = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", y = '(?:[/?#][^\\s"]*)?', E = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + u + "|" + x + p + g + ")" + w + y;
246
+ return ct = new RegExp("(?:^" + E + "$)", "i"), ct;
247
247
  }, Bt = {
248
248
  // http://emailregex.com/
249
249
  email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
@@ -299,12 +299,12 @@ var Ut = function(t, e, i, s, r, o) {
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(D(r.messages.types[n], t.fullField, t.type)) : n && typeof e !== t.type && s.push(D(r.messages.types[n], t.fullField, t.type));
302
- }, ke = function(t, e, i, s, r) {
302
+ }, Xe = function(t, e, i, s, r) {
303
303
  var o = typeof t.len == "number", n = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null, u = typeof e == "number", x = typeof e == "string", p = Array.isArray(e);
304
304
  if (u ? f = "number" : x ? f = "string" : p && (f = "array"), !f)
305
305
  return !1;
306
306
  p && (d = e.length), x && (d = e.replace(c, "_").length), o ? d !== t.len && s.push(D(r.messages[f].len, t.fullField, t.len)) : n && !h && d < t.min ? s.push(D(r.messages[f].min, t.fullField, t.min)) : h && !n && d > t.max ? s.push(D(r.messages[f].max, t.fullField, t.max)) : n && h && (d < t.min || d > t.max) && s.push(D(r.messages[f].range, t.fullField, t.min, t.max));
307
- }, j = "enum", Xe = function(t, e, i, s, r) {
307
+ }, j = "enum", ke = function(t, e, i, s, r) {
308
308
  t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(D(r.messages[j], t.fullField, t[j].join(", ")));
309
309
  }, Ne = function(t, e, i, s, r) {
310
310
  if (t.pattern) {
@@ -319,8 +319,8 @@ var Ut = function(t, e, i, s, r, o) {
319
319
  required: Ut,
320
320
  whitespace: He,
321
321
  type: Fe,
322
- range: ke,
323
- enum: Xe,
322
+ range: Xe,
323
+ enum: ke,
324
324
  pattern: Ne
325
325
  }, Ke = function(t, e, i, s, r) {
326
326
  var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
@@ -386,7 +386,7 @@ var Ut = function(t, e, i, s, r, o) {
386
386
  _.required(t, e, s, o, r, "array"), e != null && (_.type(t, e, s, o, r), _.range(t, e, s, o, r));
387
387
  }
388
388
  i(o);
389
- }, qe = function(t, e, i, s, r) {
389
+ }, Ge = 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 (H(e) && !t.required)
@@ -394,12 +394,12 @@ var Ut = function(t, e, i, s, r, o) {
394
394
  _.required(t, e, s, o, r), e !== void 0 && _.type(t, e, s, o, r);
395
395
  }
396
396
  i(o);
397
- }, Ge = "enum", je = function(t, e, i, s, r) {
397
+ }, qe = "enum", je = 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 (H(e) && !t.required)
401
401
  return i();
402
- _.required(t, e, s, o, r), e !== void 0 && _[Ge](t, e, s, o, r);
402
+ _.required(t, e, s, o, r), e !== void 0 && _[qe](t, e, s, o, r);
403
403
  }
404
404
  i(o);
405
405
  }, Ue = function(t, e, i, s, r) {
@@ -449,7 +449,7 @@ var Ut = function(t, e, i, s, r, o) {
449
449
  integer: Pe,
450
450
  float: ze,
451
451
  array: $e,
452
- object: qe,
452
+ object: Ge,
453
453
  enum: je,
454
454
  pattern: Ue,
455
455
  date: Ze,
@@ -538,15 +538,15 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
538
538
  return c && c(null, n), Promise.resolve(n);
539
539
  function d(g) {
540
540
  var w = [], y = {};
541
- function m(C) {
541
+ function E(C) {
542
542
  if (Array.isArray(C)) {
543
543
  var b;
544
544
  w = (b = w).concat.apply(b, C);
545
545
  } else
546
546
  w.push(C);
547
547
  }
548
- for (var E = 0; E < g.length; E++)
549
- m(g[E]);
548
+ for (var m = 0; m < g.length; m++)
549
+ E(g[m]);
550
550
  w.length ? (y = bt(w), c(w, y)) : c(null, n);
551
551
  }
552
552
  if (h.messages) {
@@ -557,12 +557,12 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
557
557
  var u = {}, x = h.keys || Object.keys(this.rules);
558
558
  x.forEach(function(g) {
559
559
  var w = o.rules[g], y = n[g];
560
- w.forEach(function(m) {
561
- var E = m;
562
- typeof E.transform == "function" && (n === i && (n = q({}, n)), y = n[g] = E.transform(y)), typeof E == "function" ? E = {
563
- validator: E
564
- } : E = q({}, E), E.validator = o.getValidationMethod(E), E.validator && (E.field = g, E.fullField = E.fullField || g, E.type = o.getType(E), u[g] = u[g] || [], u[g].push({
565
- rule: E,
560
+ w.forEach(function(E) {
561
+ var m = E;
562
+ typeof m.transform == "function" && (n === i && (n = G({}, n)), y = n[g] = m.transform(y)), typeof m == "function" ? m = {
563
+ validator: m
564
+ } : m = G({}, m), m.validator = o.getValidationMethod(m), m.validator && (m.field = g, m.fullField = m.fullField || g, m.type = o.getType(m), u[g] = u[g] || [], u[g].push({
565
+ rule: m,
566
566
  value: y,
567
567
  source: n,
568
568
  field: g
@@ -570,23 +570,23 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
570
570
  });
571
571
  });
572
572
  var p = {};
573
- return Se(u, h, function(g, w) {
574
- var y = g.rule, m = (y.type === "object" || y.type === "array") && (typeof y.fields == "object" || typeof y.defaultField == "object");
575
- m = m && (y.required || !y.required && g.value), y.field = g.field;
576
- function E(R, A) {
577
- return q({}, A, {
573
+ return Ae(u, h, function(g, w) {
574
+ var y = g.rule, E = (y.type === "object" || y.type === "array") && (typeof y.fields == "object" || typeof y.defaultField == "object");
575
+ E = E && (y.required || !y.required && g.value), y.field = g.field;
576
+ function m(R, S) {
577
+ return G({}, S, {
578
578
  fullField: y.fullField + "." + R,
579
579
  fullFields: y.fullFields ? [].concat(y.fullFields, [R]) : [R]
580
580
  });
581
581
  }
582
582
  function C(R) {
583
583
  R === void 0 && (R = []);
584
- var A = Array.isArray(R) ? R : [R];
585
- !h.suppressWarning && A.length && a.warning("async-validator:", A), A.length && y.message !== void 0 && (A = [].concat(y.message));
586
- var L = A.map(Nt(y, n));
584
+ var S = Array.isArray(R) ? R : [R];
585
+ !h.suppressWarning && S.length && a.warning("async-validator:", S), S.length && y.message !== void 0 && (S = [].concat(y.message));
586
+ var L = S.map(Nt(y, n));
587
587
  if (h.first && L.length)
588
588
  return p[y.field] = 1, w(L);
589
- if (!m)
589
+ if (!E)
590
590
  w(L);
591
591
  else {
592
592
  if (y.required && !g.value)
@@ -594,14 +594,14 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
594
594
  var I = {};
595
595
  y.defaultField && Object.keys(g.value).map(function(O) {
596
596
  I[O] = y.defaultField;
597
- }), I = q({}, I, g.rule.fields);
597
+ }), I = G({}, I, g.rule.fields);
598
598
  var v = {};
599
599
  Object.keys(I).forEach(function(O) {
600
600
  var M = I[O], T = Array.isArray(M) ? M : [M];
601
- v[O] = T.map(E.bind(null, O));
601
+ v[O] = T.map(m.bind(null, O));
602
602
  });
603
- var S = new a(v);
604
- S.messages(h.messages), g.rule.options && (g.rule.options.messages = h.messages, g.rule.options.error = h.error), S.validate(g.value, g.rule.options || h, function(O) {
603
+ var A = new a(v);
604
+ A.messages(h.messages), g.rule.options && (g.rule.options.messages = h.messages, g.rule.options.error = h.error), A.validate(g.value, g.rule.options || h, function(O) {
605
605
  var M = [];
606
606
  L && L.length && M.push.apply(M, L), O && O.length && M.push.apply(M, O), w(M.length ? M : null);
607
607
  });
@@ -1046,18 +1046,18 @@ class Tt extends se {
1046
1046
  HIGHLIGHT_HOVER_ROW_COLOR: f
1047
1047
  } = this.ctx.config;
1048
1048
  if (this.cellType === "footer") {
1049
- let y = n, m = o;
1049
+ let y = n, E = o;
1050
1050
  if (typeof r == "function") {
1051
- const E = r, { backgroundColor: C, color: b } = E({
1051
+ const m = r, { backgroundColor: C, color: b } = m({
1052
1052
  row: this.row,
1053
1053
  rowIndex: this.rowIndex,
1054
1054
  colIndex: this.colIndex,
1055
1055
  column: this.column,
1056
1056
  value: this.getValue()
1057
1057
  }) || {};
1058
- C && (y = C), b && (m = b);
1058
+ C && (y = C), b && (E = b);
1059
1059
  }
1060
- this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = y, this.drawTextColor = m;
1060
+ this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = y, this.drawTextColor = E;
1061
1061
  return;
1062
1062
  }
1063
1063
  let u = "transparent";
@@ -1069,7 +1069,7 @@ class Tt extends se {
1069
1069
  return;
1070
1070
  }
1071
1071
  if (this.ctx.database.getReadonly(this.rowKey, this.key) || (g = i, w = o), typeof s == "function") {
1072
- const y = s, { backgroundColor: m, color: E } = y({
1072
+ const y = s, { backgroundColor: E, color: m } = y({
1073
1073
  row: this.row,
1074
1074
  rowIndex: this.rowIndex,
1075
1075
  colIndex: this.colIndex,
@@ -1077,7 +1077,7 @@ class Tt extends se {
1077
1077
  isHasChanged: this.isHasChanged,
1078
1078
  value: this.getValue()
1079
1079
  }) || {};
1080
- m && (g = m), E && (w = E);
1080
+ E && (g = E), m && (w = m);
1081
1081
  }
1082
1082
  this.drawCellBgColor = g, this.drawTextColor = w;
1083
1083
  }
@@ -1248,23 +1248,31 @@ class Tt extends se {
1248
1248
  xArr: r,
1249
1249
  yArr: o,
1250
1250
  borderColor: this.ctx.config.SELECT_BORDER_COLOR || "rgb(82,146,247)",
1251
- fillColor: this.ctx.config.SELECT_AREA_COLOR || "rgba(82,146,247,0.1)",
1251
+ fillColor: "transparent",
1252
1252
  borderWidth: 1,
1253
1253
  lineDash: [4, 4]
1254
1254
  }), this.drawBorder({
1255
1255
  xArr: this.ctx.autofill.xArr,
1256
1256
  yArr: this.ctx.autofill.yArr,
1257
1257
  borderColor: this.ctx.config.SELECT_BORDER_COLOR || "rgb(82,146,247)",
1258
- fillColor: this.ctx.config.SELECT_AREA_COLOR || "rgba(82,146,247,0.1)",
1258
+ fillColor: "transparent",
1259
1259
  borderWidth: 1,
1260
1260
  lineDash: [4, 4]
1261
1261
  }), this.drawBorder({
1262
1262
  xArr: i,
1263
1263
  yArr: s,
1264
1264
  borderColor: this.ctx.config.SELECT_BORDER_COLOR || "rgb(82,146,247)",
1265
- fillColor: this.ctx.config.SELECT_AREA_COLOR || "rgba(82,146,247,0.1)",
1265
+ fillColor: "transparent",
1266
1266
  borderWidth: 1
1267
1267
  });
1268
+ const [n, h] = i, [c, d] = s;
1269
+ !(n === h && c === d) && this.colIndex >= n && this.colIndex <= h && this.rowIndex >= c && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.width, this.height, {
1270
+ borderColor: "transparent",
1271
+ fillColor: this.ctx.config.SELECT_AREA_COLOR || "rgba(82,146,247,0.1)"
1272
+ }), this.operation && this.rowIndex >= c && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.visibleWidth, this.visibleHeight, {
1273
+ borderColor: "transparent",
1274
+ fillColor: this.ctx.config.SELECT_ROW_COL_BG_COLOR || "transparent"
1275
+ });
1268
1276
  }
1269
1277
  drawErrorTip() {
1270
1278
  if (this.cellType === "footer" || !this.message || this.rowspan === 0 || this.colspan === 0)
@@ -1289,29 +1297,29 @@ class Tt extends se {
1289
1297
  const { drawX: i, drawY: s, width: r, rowIndex: o, colIndex: n } = this;
1290
1298
  let h = i + 0.5, c = s + 0.5, d = this.height;
1291
1299
  o === 0 && (c = this.y + 1, d = d - 1), n === this.ctx.maxColIndex && (h = h - 1);
1292
- const { xArr: f, yArr: u, lineDash: x = [], borderWidth: p = 1, borderColor: g, fillColor: w } = e, y = f[0], m = f[1], E = u[0], C = u[1];
1293
- n >= y && n <= m && o === E && this.ctx.paint.drawLine([h, c, h + r - 2, c], {
1300
+ const { xArr: f, yArr: u, lineDash: x = [], borderWidth: p = 1, borderColor: g, fillColor: w } = e, y = f[0], E = f[1], m = u[0], C = u[1];
1301
+ n >= y && n <= E && o === m && this.ctx.paint.drawLine([h, c, h + r - 2, c], {
1294
1302
  borderColor: g,
1295
1303
  fillColor: w,
1296
1304
  borderWidth: p,
1297
1305
  lineCap: "round",
1298
1306
  lineJoin: "round",
1299
1307
  lineDash: x
1300
- }), n >= y && n <= m && o === C && this.ctx.paint.drawLine([h, c + d - 1.5, h + r, c + d - 1.5], {
1308
+ }), n >= y && n <= E && o === C && this.ctx.paint.drawLine([h, c + d - 1.5, h + r, c + d - 1.5], {
1301
1309
  borderColor: g,
1302
1310
  fillColor: w,
1303
1311
  borderWidth: p,
1304
1312
  lineCap: "round",
1305
1313
  lineJoin: "round",
1306
1314
  lineDash: x
1307
- }), n === y && o >= E && o <= C && this.ctx.paint.drawLine([h, c, h, c + d - 1], {
1315
+ }), n === y && o >= m && o <= C && this.ctx.paint.drawLine([h, c, h, c + d - 1], {
1308
1316
  borderColor: g,
1309
1317
  fillColor: w,
1310
1318
  borderWidth: p,
1311
1319
  lineCap: "round",
1312
1320
  lineJoin: "round",
1313
1321
  lineDash: x
1314
- }), n === m && o >= E && o <= C && this.ctx.paint.drawLine([h + r - 1.5, c, h + r - 1.5, c + d - 1.5], {
1322
+ }), n === E && o >= m && o <= C && this.ctx.paint.drawLine([h + r - 1.5, c, h + r - 1.5, c + d - 1.5], {
1315
1323
  borderColor: g,
1316
1324
  fillColor: w,
1317
1325
  borderWidth: p,
@@ -1347,7 +1355,7 @@ class ni {
1347
1355
  this.data = i, this.footerData = r, this.columns = s, this.setLoading(!0), this.init();
1348
1356
  }
1349
1357
  init() {
1350
- this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear(), this.itemRowKeyMap = /* @__PURE__ */ new WeakMap(), this.initData(this.data);
1358
+ this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear(), this.itemRowKeyMap = /* @__PURE__ */ new WeakMap(), this.initData(this.data), this.getData();
1351
1359
  }
1352
1360
  /**
1353
1361
  * 清除缓存数据
@@ -2039,16 +2047,16 @@ class ni {
2039
2047
  }
2040
2048
  ]
2041
2049
  };
2042
- let w = e, y = e, m = n, E = n, C = [], b = 0, R = 0, A = 0, L = 0;
2050
+ let w = e, y = e, E = n, m = n, C = [], b = 0, R = 0, S = 0, L = 0;
2043
2051
  if (d !== 1 && p) {
2044
2052
  L = u;
2045
- const I = h.reduce((v, S) => {
2046
- const O = this.getItemValue(s, S) ?? "";
2053
+ const I = h.reduce((v, A) => {
2054
+ const O = this.getItemValue(s, A) ?? "";
2047
2055
  return `${v}${O}`;
2048
2056
  }, "");
2049
2057
  for (let v = e - 1; v >= 0; v--) {
2050
- const S = this.rowIndexRowKeyMap.get(v) || "", O = h.reduce((M, T) => {
2051
- const N = this.getItemValue(S, T) ?? "";
2058
+ const A = this.rowIndexRowKeyMap.get(v) || "", O = h.reduce((M, T) => {
2059
+ const N = this.getItemValue(A, T) ?? "";
2052
2060
  return `${M}${N}`;
2053
2061
  }, "");
2054
2062
  if (I === O)
@@ -2057,8 +2065,8 @@ class ni {
2057
2065
  break;
2058
2066
  }
2059
2067
  for (let v = e; v <= this.ctx.maxRowIndex; v++) {
2060
- const S = this.rowIndexRowKeyMap.get(v) || "", O = h.reduce((M, T) => {
2061
- const N = this.getItemValue(S, T) ?? "";
2068
+ const A = this.rowIndexRowKeyMap.get(v) || "", O = h.reduce((M, T) => {
2069
+ const N = this.getItemValue(A, T) ?? "";
2062
2070
  return `${M}${N}`;
2063
2071
  }, "");
2064
2072
  if (I === O)
@@ -2067,12 +2075,12 @@ class ni {
2067
2075
  break;
2068
2076
  }
2069
2077
  for (let v = w; v < e; v++) {
2070
- const { height: S } = this.positions[v];
2071
- b += S;
2078
+ const { height: A } = this.positions[v];
2079
+ b += A;
2072
2080
  }
2073
2081
  for (let v = w; v <= y; v++) {
2074
- const { height: S } = this.positions[v];
2075
- A += S;
2082
+ const { height: A } = this.positions[v];
2083
+ S += A;
2076
2084
  const O = this.rowIndexRowKeyMap.get(v) || "", { item: M } = this.rowKeyMap.get(O), T = this.getItemValue(O, i);
2077
2085
  C.push({
2078
2086
  rowKey: O,
@@ -2083,14 +2091,14 @@ class ni {
2083
2091
  }
2084
2092
  }
2085
2093
  if (x !== 1 && g) {
2086
- A = f;
2094
+ S = f;
2087
2095
  for (let I = n - 1; I >= 0; I--) {
2088
2096
  const v = this.getColumnByColIndex(I);
2089
2097
  if (!v)
2090
2098
  break;
2091
- const S = this.getItemValue(s, i), O = this.getItemValue(s, v.key);
2092
- if (S === O && c.includes(v.key))
2093
- m = I;
2099
+ const A = this.getItemValue(s, i), O = this.getItemValue(s, v.key);
2100
+ if (A === O && c.includes(v.key))
2101
+ E = I;
2094
2102
  else
2095
2103
  break;
2096
2104
  }
@@ -2098,19 +2106,19 @@ class ni {
2098
2106
  const v = this.getColumnByColIndex(I);
2099
2107
  if (!v)
2100
2108
  break;
2101
- const S = this.getItemValue(s, i), O = this.getItemValue(s, v.key);
2102
- if (S === O && c.includes(v.key))
2103
- E = I;
2109
+ const A = this.getItemValue(s, i), O = this.getItemValue(s, v.key);
2110
+ if (A === O && c.includes(v.key))
2111
+ m = I;
2104
2112
  else
2105
2113
  break;
2106
2114
  }
2107
- for (let I = m; I < n; I++) {
2115
+ for (let I = E; I < n; I++) {
2108
2116
  const v = this.getColumnByColIndex(I);
2109
2117
  if (!v)
2110
2118
  break;
2111
2119
  R += v.width || 100;
2112
2120
  }
2113
- for (let I = m; I <= E; I++) {
2121
+ for (let I = E; I <= m; I++) {
2114
2122
  const v = this.getColumnByColIndex(I);
2115
2123
  if (!v)
2116
2124
  break;
@@ -2123,11 +2131,11 @@ class ni {
2123
2131
  }
2124
2132
  }
2125
2133
  return {
2126
- xArr: [m, E],
2134
+ xArr: [E, m],
2127
2135
  yArr: [w, y],
2128
2136
  rowspan: d,
2129
2137
  colspan: x,
2130
- height: A,
2138
+ height: S,
2131
2139
  width: L,
2132
2140
  offsetTop: b,
2133
2141
  offsetLeft: R,
@@ -2240,7 +2248,7 @@ class li {
2240
2248
  this.ctx = t, this.init();
2241
2249
  }
2242
2250
  init() {
2243
- this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(this.ctx.stageElement, "click", this.handleClick.bind(this)), this.bind(window, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.stageElement, "wheel", this.handleWheel.bind(this)), this.bind(this.ctx.stageElement, "contextmenu", this.handleContextMenu.bind(this)), this.bind(this.ctx.stageElement, "mousedown", this.handleMouseDown.bind(this)), this.bind(this.ctx.stageElement, "dblclick", this.handleDblclick.bind(this)), this.bind(this.ctx.stageElement, "mouseover", this.handleMouseover.bind(this)), this.bind(this.ctx.stageElement, "mouseout", this.handleMouseout.bind(this));
2251
+ this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(this.ctx.stageElement, "click", this.handleClick.bind(this)), this.bind(window, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.stageElement, "wheel", this.handleWheel.bind(this)), this.bind(this.ctx.stageElement, "touchstart", this.handleTouchstart.bind(this)), this.bind(this.ctx.stageElement, "touchend", this.handleTouchend.bind(this)), this.bind(this.ctx.stageElement, "touchmove", this.handleTouchmove.bind(this)), this.bind(this.ctx.stageElement, "contextmenu", this.handleContextMenu.bind(this)), this.bind(this.ctx.stageElement, "mousedown", this.handleMouseDown.bind(this)), this.bind(this.ctx.stageElement, "dblclick", this.handleDblclick.bind(this)), this.bind(this.ctx.stageElement, "mouseover", this.handleMouseover.bind(this)), this.bind(this.ctx.stageElement, "mouseout", this.handleMouseout.bind(this));
2244
2252
  }
2245
2253
  destroy() {
2246
2254
  this.eventTasks.forEach((t, e) => {
@@ -2269,6 +2277,15 @@ class li {
2269
2277
  handleWheel(t) {
2270
2278
  this.ctx.emit("wheel", t);
2271
2279
  }
2280
+ handleTouchstart(t) {
2281
+ this.ctx.emit("touchstart", t);
2282
+ }
2283
+ handleTouchend(t) {
2284
+ this.ctx.emit("touchend", t);
2285
+ }
2286
+ handleTouchmove(t) {
2287
+ this.ctx.emit("touchmove", t);
2288
+ }
2272
2289
  handleContextMenu(t) {
2273
2290
  this.ctx.emit("contextMenu", t);
2274
2291
  }
@@ -2503,7 +2520,7 @@ class Wt {
2503
2520
  l(this, "SCROLLER_FOCUS_COLOR", "#bbbec4");
2504
2521
  l(this, "SELECT_BORDER_COLOR", "rgb(82,146,247)");
2505
2522
  l(this, "SELECT_AREA_COLOR", "rgba(82,146,247,0.1)");
2506
- l(this, "SELECT_BG_COLOR", "rgba(82,146,247,0.1)");
2523
+ l(this, "SELECT_ROW_COL_BG_COLOR", "transparent");
2507
2524
  l(this, "AUTOFILL_POINT_BORDER_COLOR", "#fff");
2508
2525
  l(this, "EDIT_BG_COLOR", "#fcf6ed");
2509
2526
  l(this, "CHECKBOX_KEY", "");
@@ -2669,15 +2686,19 @@ class di {
2669
2686
  const t = [];
2670
2687
  for (let e = 0; e < this.list.length; e++) {
2671
2688
  const i = this.list[e];
2672
- let s = i.color;
2689
+ let s = i.color, r = i.svg;
2673
2690
  if (i.configColorName) {
2674
- const o = this.ctx.config[i.configColorName];
2675
- o && (s = o);
2691
+ const n = this.ctx.config[i.configColorName];
2692
+ n && (s = n);
2676
2693
  }
2677
- const r = this.createImageFromSVG(i.svg, s).then((o) => {
2678
- this.icons.set(i.name, o);
2694
+ if (i.configName) {
2695
+ const n = this.ctx.config[i.configName];
2696
+ n && (r = n);
2697
+ }
2698
+ const o = this.createImageFromSVG(r, s).then((n) => {
2699
+ this.icons.set(i.name, n);
2679
2700
  });
2680
- t.push(r);
2701
+ t.push(o);
2681
2702
  }
2682
2703
  for (let e = 0; e < this.ctx.config.ICONS.length; e++) {
2683
2704
  const i = this.ctx.config.ICONS[e];
@@ -2789,7 +2810,17 @@ class re extends se {
2789
2810
  color: this.drawTextColor,
2790
2811
  align: this.align,
2791
2812
  verticalAlign: this.verticalAlign
2792
- }), this.drawSelection();
2813
+ }), this.drawSelection(), this.drawSelector();
2814
+ }
2815
+ drawSelector() {
2816
+ const { ENABLE_SELECTOR: e } = this.ctx.config;
2817
+ if (!e)
2818
+ return;
2819
+ const { xArr: i } = this.ctx.selector, [s, r] = i;
2820
+ this.colIndex >= s && this.colIndex <= r && this.ctx.paint.drawRect(this.drawX, this.drawY, this.width, this.height, {
2821
+ borderColor: "transparent",
2822
+ fillColor: this.ctx.config.SELECT_ROW_COL_BG_COLOR || "transparent"
2823
+ });
2793
2824
  }
2794
2825
  drawSelection() {
2795
2826
  const { width: e, height: i, type: s } = this;
@@ -2835,7 +2866,7 @@ class fi {
2835
2866
  init() {
2836
2867
  this.resizeObserver = new ResizeObserver(() => {
2837
2868
  this.ctx.emit("resetHeader"), this.ctx.emit("resizeObserver");
2838
- }), this.resizeObserver.observe(this.ctx.stageElement), this.ctx.on("mousedown", (t) => {
2869
+ }), this.resizeObserver.observe(this.ctx.containerElement), this.ctx.on("mousedown", (t) => {
2839
2870
  if (t.button !== 0 || this.isBusy(t))
2840
2871
  return;
2841
2872
  const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, r = i;
@@ -3110,7 +3141,7 @@ class xi {
3110
3141
  } else
3111
3142
  this.database.setItemValue(t, e, i, s, r, !0);
3112
3143
  }
3113
- batchSetItemValueByEditor(t, e) {
3144
+ batchSetItemValueByEditor(t, e = !0) {
3114
3145
  if (this.config.ENABLE_MERGE_CELL_LINK) {
3115
3146
  const i = [];
3116
3147
  t.forEach((s) => {
@@ -3244,6 +3275,15 @@ class Pt {
3244
3275
  onWheel(t) {
3245
3276
  this.updateScroll(t);
3246
3277
  }
3278
+ onTouchmove(t) {
3279
+ const { clientY: e, clientX: i } = t.touches[0], s = e - this.clientY, r = i - this.clientX;
3280
+ let o = 0;
3281
+ this.type === "vertical" ? (o = Math.max(0, Math.min(this.dragStart - s, this.distance)), this.hasScrollbar() && !(o === 0 && s > 0 || o === this.distance && s < 0) && t.preventDefault()) : this.type === "horizontal" && (o = Math.max(0, Math.min(this.dragStart - r, this.distance))), this.scroll = o;
3282
+ }
3283
+ onTouchstart(t) {
3284
+ const { clientY: e, clientX: i } = t.touches[0];
3285
+ this.clientX = i, this.clientY = e, this.dragStart = this.scroll;
3286
+ }
3247
3287
  onMouseDown(t) {
3248
3288
  if (!(t.target instanceof Element) || !this.ctx.isTarget())
3249
3289
  return;
@@ -3263,12 +3303,16 @@ class Pt {
3263
3303
  this.isDragging = !1, this.isFocus = !1, this.clientX = 0, this.clientY = 0;
3264
3304
  }
3265
3305
  onMouseMove(t) {
3266
- const { offsetX: e, offsetY: i, clientX: s, clientY: r } = t;
3306
+ const { offsetX: e, offsetY: i, clientX: s, clientY: r, buttons: o } = t;
3307
+ if (o === 0) {
3308
+ this.onMouseUp();
3309
+ return;
3310
+ }
3267
3311
  if (this.isOnScrollbar(e, i) && t.target === this.ctx.canvasElement ? this.isFocus = !0 : this.isFocus = !1, s == this.clientX && r == this.clientY) return;
3268
- let o = 0;
3269
- if (this.type === "horizontal" ? o = s - this.clientX : o = r - this.clientY, this.isDragging && o !== 0) {
3270
- let n = 0;
3271
- this.type === "vertical" ? n = this.dragStart + o / (this.visibleDistance - this.barHeight) * this.distance : n = this.dragStart + o / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(n, this.distance));
3312
+ let n = 0;
3313
+ if (this.type === "horizontal" ? n = s - this.clientX : n = r - this.clientY, this.isDragging && n !== 0) {
3314
+ let h = 0;
3315
+ this.type === "vertical" ? h = this.dragStart + n / (this.visibleDistance - this.barHeight) * this.distance : h = this.dragStart + n / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(h, this.distance));
3272
3316
  }
3273
3317
  }
3274
3318
  isPointInElement(t, e, i, s, r, o) {
@@ -3333,7 +3377,9 @@ class ui {
3333
3377
  l(this, "ctx");
3334
3378
  l(this, "verticalScrollbar");
3335
3379
  l(this, "horizontalScrollbar");
3336
- this.ctx = t, this.verticalScrollbar = new Pt(t, "vertical"), this.horizontalScrollbar = new Pt(t, "horizontal"), this.ctx.on("wheel", (e) => this.onWheel(e)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("setScroll", (e, i) => {
3380
+ this.ctx = t, this.verticalScrollbar = new Pt(t, "vertical"), this.horizontalScrollbar = new Pt(t, "horizontal"), this.ctx.on("wheel", (e) => this.onWheel(e)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("touchmove", (e) => this.onTouchmove(e)), this.ctx.on("touchstart", (e) => {
3381
+ this.onTouchstart(e);
3382
+ }), this.ctx.on("setScroll", (e, i) => {
3337
3383
  this.setScroll(e, i);
3338
3384
  }), this.ctx.on("setScrollX", (e) => {
3339
3385
  this.setScrollX(e);
@@ -3342,21 +3388,27 @@ class ui {
3342
3388
  });
3343
3389
  }
3344
3390
  onWheel(t) {
3345
- this.verticalScrollbar.onWheel(t), this.horizontalScrollbar.onWheel(t), this.draw();
3391
+ this.verticalScrollbar.onWheel(t), this.horizontalScrollbar.onWheel(t), this.draw(!0);
3392
+ }
3393
+ onTouchmove(t) {
3394
+ this.verticalScrollbar.onTouchmove(t), this.horizontalScrollbar.onTouchmove(t), this.draw(!0);
3395
+ }
3396
+ onTouchstart(t) {
3397
+ this.verticalScrollbar.onTouchstart(t), this.horizontalScrollbar.onTouchstart(t), this.draw(!0);
3346
3398
  }
3347
3399
  onMouseDown(t) {
3348
- this.verticalScrollbar.onMouseDown(t), this.horizontalScrollbar.onMouseDown(t), this.draw();
3400
+ this.verticalScrollbar.onMouseDown(t), this.horizontalScrollbar.onMouseDown(t), this.draw(!0);
3349
3401
  }
3350
3402
  onMouseMove(t) {
3351
- this.verticalScrollbar.onMouseMove(t), this.horizontalScrollbar.onMouseMove(t), this.draw();
3403
+ this.verticalScrollbar.onMouseMove(t), this.horizontalScrollbar.onMouseMove(t), this.draw(!0);
3352
3404
  }
3353
3405
  onMouseUp() {
3354
3406
  this.verticalScrollbar.onMouseUp(), this.horizontalScrollbar.onMouseUp(), this.ctx.scrollerMove = !1;
3355
3407
  }
3356
- draw() {
3408
+ draw(t = !1) {
3357
3409
  this.verticalScrollbar.draw(), this.horizontalScrollbar.draw();
3358
- const t = Math.floor(this.horizontalScrollbar.scroll), e = Math.floor(this.verticalScrollbar.scroll);
3359
- (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"));
3410
+ const e = Math.floor(this.horizontalScrollbar.scroll), i = Math.floor(this.verticalScrollbar.scroll);
3411
+ (e !== this.ctx.scrollX || i !== this.ctx.scrollY) && (this.ctx.emit("onScroll", e, i, t), e !== this.ctx.scrollX && this.ctx.emit("onScrollX", e, t), i !== this.ctx.scrollY && this.ctx.emit("onScrollY", i, t), this.ctx.scrollX = e, this.ctx.scrollY = i, this.ctx.emit("draw"));
3360
3412
  }
3361
3413
  setScroll(t, e) {
3362
3414
  this.horizontalScrollbar.scroll = t, this.verticalScrollbar.scroll = e, this.ctx.emit("draw");
@@ -3707,16 +3759,16 @@ class wi {
3707
3759
  width: this.width,
3708
3760
  height: this.data.length ? 0 : h + w
3709
3761
  });
3710
- let m = this.height + e.height + o;
3711
- m += w;
3712
- let E = 0;
3713
- this.data.length && d ? (E = window.innerHeight - g - f, E < 0 && (E = 32, console.error(
3762
+ let E = this.height + e.height + o;
3763
+ E += w;
3764
+ let m = 0;
3765
+ this.data.length && d ? (m = window.innerHeight - g - f, m < 0 && (m = 32, console.error(
3714
3766
  "There is an error in the height calculation ENABLE_OFFSET_HEIGHT and OFFSET_HEIGHT are invalid"
3715
- ))) : this.data.length && n ? E = n : this.data.length && c && m > c ? E = c : E = m, E > 0 && (this.ctx.stageHeight = Math.floor(E), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
3767
+ ))) : this.data.length && n ? m = n : this.data.length && c && E > c ? m = c : m = E, m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight - 0.5}px`);
3716
3768
  let C = this.ctx.stageHeight - e.height - o;
3717
3769
  r ? this.visibleHeight = C - w : this.visibleHeight = C, this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = x;
3718
- const b = window.devicePixelRatio || 1, R = this.ctx.stageWidth * b, A = this.ctx.stageHeight * b;
3719
- t.width = Math.floor(R), t.height = Math.floor(A), this.ctx.canvasElement.setAttribute(
3770
+ const b = window.devicePixelRatio || 1, R = this.ctx.stageWidth * b, S = this.ctx.stageHeight * b;
3771
+ t.width = Math.floor(R), t.height = Math.floor(S), this.ctx.canvasElement.setAttribute(
3720
3772
  "style",
3721
3773
  ` height:${this.ctx.stageHeight}px;width:${this.ctx.stageWidth}px;`
3722
3774
  ), this.ctx.paint.scale(b);
@@ -3823,6 +3875,8 @@ class wi {
3823
3875
  const { header: t, database: e, scrollY: i } = this.ctx, s = i, { data: r, positions: o } = e.getData();
3824
3876
  this.ctx.maxRowIndex = r.length - 1;
3825
3877
  const n = this.binarySearch(o, s);
3878
+ if (n === -1)
3879
+ return;
3826
3880
  let h = this.binarySearch(o, s + this.visibleHeight);
3827
3881
  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;
3828
3882
  const c = [];
@@ -4026,24 +4080,24 @@ class yi {
4026
4080
  SELECTOR_AREA_MAX_X_OFFSET: f,
4027
4081
  SELECTOR_AREA_MAX_Y_OFFSET: u
4028
4082
  } = this.ctx.config, x = n, p = h || this.ctx.maxColIndex - f, g = c, w = d || this.ctx.maxRowIndex - u;
4029
- let [y, m] = r, [E, C] = o;
4030
- if (y < x || m > p || E < g || C > w)
4083
+ let [y, E] = r, [m, C] = o;
4084
+ if (y < x || E > p || m < g || C > w)
4031
4085
  return;
4032
4086
  if (this.ctx.stageElement.focus(), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
4033
4087
  const R = this.adjustMergeCells(r, o);
4034
- E = R.yArr[0], C = R.yArr[1], y = R.xArr[0], m = R.xArr[1], this.ctx.onlyMergeCell = R.onlyMergeCell;
4088
+ m = R.yArr[0], C = R.yArr[1], y = R.xArr[0], E = R.xArr[1], this.ctx.onlyMergeCell = R.onlyMergeCell;
4035
4089
  }
4036
- y === m && E === C ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(x, y), Math.min(p, m)], o = [Math.max(g, E), Math.min(w, C)];
4090
+ y === E && m === C ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(x, y), Math.min(p, E)], o = [Math.max(g, m), Math.min(w, C)];
4037
4091
  const { BEFORE_SET_SELECTOR_METHOD: b } = this.ctx.config;
4038
4092
  if (typeof b == "function") {
4039
- const A = b({
4093
+ const S = b({
4040
4094
  focusCell: this.ctx.focusCell,
4041
4095
  xArr: r,
4042
4096
  yArr: o
4043
4097
  });
4044
- if (!A)
4098
+ if (!S)
4045
4099
  return;
4046
- r = A.xArr, o = A.yArr;
4100
+ r = S.xArr, o = S.yArr;
4047
4101
  }
4048
4102
  this.ctx.selector.xArr = r, this.ctx.selector.yArr = o, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
4049
4103
  }
@@ -4054,13 +4108,13 @@ class yi {
4054
4108
  let n = [], h = [];
4055
4109
  for (let g = 0; g <= e[1] - e[0]; g++)
4056
4110
  for (let w = 0; w <= t[1] - t[0]; w++) {
4057
- const y = g + e[0], m = w + t[0], E = this.ctx.database.getVirtualBodyCell(y, m);
4058
- E && ((y === i || y === s) && n.push(E), (m === r || m === o) && h.push(E));
4111
+ const y = g + e[0], E = w + t[0], m = this.ctx.database.getVirtualBodyCell(y, E);
4112
+ m && ((y === i || y === s) && n.push(m), (E === r || E === o) && h.push(m));
4059
4113
  }
4060
4114
  const c = n.reduce(
4061
4115
  (g, w) => {
4062
- const { yArr: y } = w.getSpanInfo(), [m, E] = y;
4063
- return g.minY = Math.min(g.minY, m), g.maxY = Math.max(g.maxY, E), g;
4116
+ const { yArr: y } = w.getSpanInfo(), [E, m] = y;
4117
+ return g.minY = Math.min(g.minY, E), g.maxY = Math.max(g.maxY, m), g;
4064
4118
  },
4065
4119
  {
4066
4120
  minY: i,
@@ -4068,8 +4122,8 @@ class yi {
4068
4122
  }
4069
4123
  ), d = h.reduce(
4070
4124
  (g, w) => {
4071
- const { xArr: y } = w.getSpanInfo(), [m, E] = y;
4072
- return g.minX = Math.min(g.minX, m), g.maxX = Math.max(g.maxX, E), g;
4125
+ const { xArr: y } = w.getSpanInfo(), [E, m] = y;
4126
+ return g.minX = Math.min(g.minX, E), g.maxX = Math.max(g.maxX, m), g;
4073
4127
  },
4074
4128
  {
4075
4129
  minX: r,
@@ -4270,16 +4324,16 @@ class yi {
4270
4324
  for (let x = 0; x <= o.length - 1; x++) {
4271
4325
  const p = o[x].length;
4272
4326
  for (let g = 0; g <= p - 1; g++) {
4273
- const w = x + e, y = g + i, m = o[x][g], E = this.ctx.database.getItemValueForRowIndexAndColIndex(
4327
+ const w = x + e, y = g + i, E = o[x][g], m = this.ctx.database.getItemValueForRowIndexAndColIndex(
4274
4328
  w,
4275
4329
  y
4276
4330
  );
4277
- if (E) {
4278
- const { rowKey: C, key: b } = E;
4331
+ if (m) {
4332
+ const { rowKey: C, key: b } = m;
4279
4333
  this.ctx.database.getReadonly(C, b) || (s.add(C), d.push({
4280
4334
  rowKey: C,
4281
4335
  key: b,
4282
- value: m,
4336
+ value: E,
4283
4337
  row: {}
4284
4338
  //内部有设置
4285
4339
  }));
@@ -4409,20 +4463,20 @@ class yi {
4409
4463
  if (!i)
4410
4464
  return;
4411
4465
  p && this.ctx.onlyMergeCell && i.updateSpanInfo();
4412
- const { drawX: g, drawY: w, width: y, height: m, fixed: E } = i, C = r - g + 1, b = i.drawX + y - (e - s) + 1;
4413
- let R = o.height - w, A = m;
4414
- A > h.visibleHeight && (A = h.visibleHeight);
4466
+ const { drawX: g, drawY: w, width: y, height: E, fixed: m } = i, C = r - g + 1, b = i.drawX + y - (e - s) + 1;
4467
+ let R = o.height - w, S = E;
4468
+ S > h.visibleHeight && (S = h.visibleHeight);
4415
4469
  let L = 0;
4416
4470
  u && (x === "top" ? R = o.height + n.height - w : L = n.visibleHeight);
4417
- const I = w + A - (t - L - f);
4418
- let v = c, S = d;
4419
- b > 0 && !E ? v = Math.floor(c + b) : C > 0 && !E && (v = Math.floor(c - C)), R > 0 ? S = Math.floor(d - R) : I > 0 && (S = Math.floor(d + I)), (Math.abs(c - v) > 2 || Math.abs(d - S) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(v, S), this.ctx.emit("adjustBoundaryPosition", i));
4471
+ const I = w + S - (t - L - f);
4472
+ let v = c, A = d;
4473
+ b > 0 && !m ? v = Math.floor(c + b) : C > 0 && !m && (v = Math.floor(c - C)), R > 0 ? A = Math.floor(d - R) : I > 0 && (A = Math.floor(d + I)), (Math.abs(c - v) > 2 || Math.abs(d - A) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(v, A), this.ctx.emit("adjustBoundaryPosition", i));
4420
4474
  }
4421
4475
  destroy() {
4422
4476
  this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
4423
4477
  }
4424
4478
  }
4425
- class Ei {
4479
+ class mi {
4426
4480
  constructor(t) {
4427
4481
  l(this, "ctx");
4428
4482
  this.ctx = t, this.init();
@@ -4480,10 +4534,10 @@ class Ei {
4480
4534
  SELECTOR_AREA_MAX_X_OFFSET: u,
4481
4535
  SELECTOR_AREA_MAX_Y_OFFSET: x
4482
4536
  } = this.ctx.config, p = h, g = c || this.ctx.maxColIndex - u, w = d, y = f || this.ctx.maxRowIndex - x;
4483
- let [m, E] = o, [C, b] = n;
4484
- if (m < p || C < w)
4537
+ let [E, m] = o, [C, b] = n;
4538
+ if (E < p || C < w)
4485
4539
  return;
4486
- o = [Math.max(p, m), Math.min(g, E)], n = [Math.max(w, C), Math.min(y, b)];
4540
+ o = [Math.max(p, E), Math.min(g, m)], n = [Math.max(w, C), Math.min(y, b)];
4487
4541
  const { BEFORE_SET_AUTOFILL_METHOD: R } = this.ctx.config;
4488
4542
  if (typeof R == "function") {
4489
4543
  const L = R({
@@ -4520,9 +4574,9 @@ class Ei {
4520
4574
  let d = [];
4521
4575
  for (let x = 0; x <= h[1] - h[0]; x++)
4522
4576
  for (let p = 0; p <= n[1] - n[0]; p++) {
4523
- const g = p + n[0], w = x + h[0], y = s[x % o][p % r], m = this.ctx.database.getItemValueForRowIndexAndColIndex(w, g), E = `${w}-${g}`;
4524
- if (m && !i.has(E)) {
4525
- const { rowKey: C, key: b } = m;
4577
+ const g = p + n[0], w = x + h[0], y = s[x % o][p % r], E = this.ctx.database.getItemValueForRowIndexAndColIndex(w, g), m = `${w}-${g}`;
4578
+ if (E && !i.has(m)) {
4579
+ const { rowKey: C, key: b } = E;
4526
4580
  this.ctx.database.getReadonly(C, b) || (t.add(C), d.push({
4527
4581
  rowKey: C,
4528
4582
  key: b,
@@ -4567,7 +4621,7 @@ class Ei {
4567
4621
  const rt = Math.min, U = Math.max, ft = Math.round, z = (a) => ({
4568
4622
  x: a,
4569
4623
  y: a
4570
- }), mi = {
4624
+ }), Ei = {
4571
4625
  left: "right",
4572
4626
  right: "left",
4573
4627
  bottom: "top",
@@ -4582,7 +4636,7 @@ function _t(a, t, e) {
4582
4636
  function at(a, t) {
4583
4637
  return typeof a == "function" ? a(t) : a;
4584
4638
  }
4585
- function G(a) {
4639
+ function q(a) {
4586
4640
  return a.split("-")[0];
4587
4641
  }
4588
4642
  function lt(a) {
@@ -4595,7 +4649,7 @@ function Mt(a) {
4595
4649
  return a === "y" ? "height" : "width";
4596
4650
  }
4597
4651
  function J(a) {
4598
- return ["top", "bottom"].includes(G(a)) ? "y" : "x";
4652
+ return ["top", "bottom"].includes(q(a)) ? "y" : "x";
4599
4653
  }
4600
4654
  function Ht(a) {
4601
4655
  return ne(J(a));
@@ -4628,11 +4682,11 @@ function Ri(a, t, e) {
4628
4682
  }
4629
4683
  function Ii(a, t, e, i) {
4630
4684
  const s = lt(a);
4631
- let r = Ri(G(a), e === "start", i);
4685
+ let r = Ri(q(a), e === "start", i);
4632
4686
  return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
4633
4687
  }
4634
4688
  function xt(a) {
4635
- return a.replace(/left|right|bottom|top/g, (t) => mi[t]);
4689
+ return a.replace(/left|right|bottom|top/g, (t) => Ei[t]);
4636
4690
  }
4637
4691
  function _i(a) {
4638
4692
  return {
@@ -4674,7 +4728,7 @@ function zt(a, t, e) {
4674
4728
  reference: i,
4675
4729
  floating: s
4676
4730
  } = a;
4677
- const r = J(t), o = Ht(t), n = Mt(o), h = G(t), c = r === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, u = i[n] / 2 - s[n] / 2;
4731
+ const r = J(t), o = Ht(t), n = Mt(o), h = q(t), c = r === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, u = i[n] / 2 - s[n] / 2;
4678
4732
  let x;
4679
4733
  switch (h) {
4680
4734
  case "top":
@@ -4737,8 +4791,8 @@ const Oi = async (a, t, e) => {
4737
4791
  name: w,
4738
4792
  fn: y
4739
4793
  } = n[g], {
4740
- x: m,
4741
- y: E,
4794
+ x: E,
4795
+ y: m,
4742
4796
  data: C,
4743
4797
  reset: b
4744
4798
  } = await y({
@@ -4755,7 +4809,7 @@ const Oi = async (a, t, e) => {
4755
4809
  floating: t
4756
4810
  }
4757
4811
  });
4758
- d = m ?? d, f = E ?? f, x = {
4812
+ d = E ?? d, f = m ?? f, x = {
4759
4813
  ...x,
4760
4814
  [w]: {
4761
4815
  ...x[w],
@@ -4799,12 +4853,12 @@ async function le(a, t) {
4799
4853
  boundary: c,
4800
4854
  rootBoundary: d,
4801
4855
  strategy: h
4802
- })), m = f === "floating" ? {
4856
+ })), E = f === "floating" ? {
4803
4857
  x: i,
4804
4858
  y: s,
4805
4859
  width: o.floating.width,
4806
4860
  height: o.floating.height
4807
- } : o.reference, E = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(n.floating)), C = await (r.isElement == null ? void 0 : r.isElement(E)) ? await (r.getScale == null ? void 0 : r.getScale(E)) || {
4861
+ } : o.reference, m = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(n.floating)), C = await (r.isElement == null ? void 0 : r.isElement(m)) ? await (r.getScale == null ? void 0 : r.getScale(m)) || {
4808
4862
  x: 1,
4809
4863
  y: 1
4810
4864
  } : {
@@ -4812,10 +4866,10 @@ async function le(a, t) {
4812
4866
  y: 1
4813
4867
  }, b = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
4814
4868
  elements: n,
4815
- rect: m,
4816
- offsetParent: E,
4869
+ rect: E,
4870
+ offsetParent: m,
4817
4871
  strategy: h
4818
- }) : m);
4872
+ }) : E);
4819
4873
  return {
4820
4874
  top: (y.top - b.top + p.top) / C.y,
4821
4875
  bottom: (b.bottom - y.bottom + p.bottom) / C.y,
@@ -4823,7 +4877,7 @@ async function le(a, t) {
4823
4877
  right: (b.right - y.right + p.right) / C.x
4824
4878
  };
4825
4879
  }
4826
- const Ai = (a) => ({
4880
+ const Si = (a) => ({
4827
4881
  name: "arrow",
4828
4882
  options: a,
4829
4883
  async fn(t) {
@@ -4844,10 +4898,10 @@ const Ai = (a) => ({
4844
4898
  const f = ae(d), u = {
4845
4899
  x: e,
4846
4900
  y: i
4847
- }, x = Ht(s), p = Mt(x), g = await o.getDimensions(c), w = x === "y", y = w ? "top" : "left", m = w ? "bottom" : "right", E = w ? "clientHeight" : "clientWidth", C = r.reference[p] + r.reference[x] - u[x] - r.floating[p], b = u[x] - r.reference[x], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
4848
- let A = R ? R[E] : 0;
4849
- (!A || !await (o.isElement == null ? void 0 : o.isElement(R))) && (A = n.floating[E] || r.floating[p]);
4850
- const L = C / 2 - b / 2, I = A / 2 - g[p] / 2 - 1, v = rt(f[y], I), S = rt(f[m], I), O = v, M = A - g[p] - S, T = A / 2 - g[p] / 2 + L, N = _t(O, T, M), Y = !h.arrow && lt(s) != null && T !== N && r.reference[p] / 2 - (T < O ? v : S) - g[p] / 2 < 0, K = Y ? T < O ? T - O : T - M : 0;
4901
+ }, x = Ht(s), p = Mt(x), g = await o.getDimensions(c), w = x === "y", y = w ? "top" : "left", E = w ? "bottom" : "right", m = w ? "clientHeight" : "clientWidth", C = r.reference[p] + r.reference[x] - u[x] - r.floating[p], b = u[x] - r.reference[x], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
4902
+ let S = R ? R[m] : 0;
4903
+ (!S || !await (o.isElement == null ? void 0 : o.isElement(R))) && (S = n.floating[m] || r.floating[p]);
4904
+ const L = C / 2 - b / 2, I = S / 2 - g[p] / 2 - 1, v = rt(f[y], I), A = rt(f[E], I), O = v, M = S - g[p] - A, T = S / 2 - g[p] / 2 + L, N = _t(O, T, M), Y = !h.arrow && lt(s) != null && T !== N && r.reference[p] / 2 - (T < O ? v : A) - g[p] / 2 < 0, K = Y ? T < O ? T - O : T - M : 0;
4851
4905
  return {
4852
4906
  [x]: u[x] + K,
4853
4907
  data: {
@@ -4884,9 +4938,9 @@ const Ai = (a) => ({
4884
4938
  } = at(a, t);
4885
4939
  if ((e = r.arrow) != null && e.alignmentOffset)
4886
4940
  return {};
4887
- const y = G(s), m = J(n), E = G(n) === n, C = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), b = u || (E || !g ? [xt(n)] : vi(n)), R = p !== "none";
4941
+ const y = q(s), E = J(n), m = q(n) === n, C = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), b = u || (m || !g ? [xt(n)] : vi(n)), R = p !== "none";
4888
4942
  !u && R && b.push(...Ii(n, g, p, C));
4889
- const A = [n, ...b], L = await le(t, w), I = [];
4943
+ const S = [n, ...b], L = await le(t, w), I = [];
4890
4944
  let v = ((i = r.flip) == null ? void 0 : i.overflows) || [];
4891
4945
  if (d && I.push(L[y]), f) {
4892
4946
  const T = bi(s, o, C);
@@ -4896,8 +4950,8 @@ const Ai = (a) => ({
4896
4950
  placement: s,
4897
4951
  overflows: I
4898
4952
  }], !I.every((T) => T <= 0)) {
4899
- var S, O;
4900
- const T = (((S = r.flip) == null ? void 0 : S.index) || 0) + 1, N = A[T];
4953
+ var A, O;
4954
+ const T = (((A = r.flip) == null ? void 0 : A.index) || 0) + 1, N = S[T];
4901
4955
  if (N)
4902
4956
  return {
4903
4957
  data: {
@@ -4916,12 +4970,12 @@ const Ai = (a) => ({
4916
4970
  const K = (M = v.filter((W) => {
4917
4971
  if (R) {
4918
4972
  const P = J(W.placement);
4919
- return P === m || // Create a bias to the `y` side axis due to horizontal
4973
+ return P === E || // Create a bias to the `y` side axis due to horizontal
4920
4974
  // reading directions favoring greater width.
4921
4975
  P === "y";
4922
4976
  }
4923
4977
  return !0;
4924
- }).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, me) => P + me, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 : M[0];
4978
+ }).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, Ee) => P + Ee, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 : M[0];
4925
4979
  K && (Y = K);
4926
4980
  break;
4927
4981
  }
@@ -4940,12 +4994,12 @@ const Ai = (a) => ({
4940
4994
  }
4941
4995
  };
4942
4996
  };
4943
- async function Si(a, t) {
4997
+ async function Ai(a, t) {
4944
4998
  const {
4945
4999
  placement: e,
4946
5000
  platform: i,
4947
5001
  elements: s
4948
- } = a, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = G(e), n = lt(e), h = J(e) === "y", c = ["left", "top"].includes(o) ? -1 : 1, d = r && h ? -1 : 1, f = at(t, a);
5002
+ } = a, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), n = lt(e), h = J(e) === "y", c = ["left", "top"].includes(o) ? -1 : 1, d = r && h ? -1 : 1, f = at(t, a);
4949
5003
  let {
4950
5004
  mainAxis: u,
4951
5005
  crossAxis: x,
@@ -4978,7 +5032,7 @@ const Ti = function(a) {
4978
5032
  y: r,
4979
5033
  placement: o,
4980
5034
  middlewareData: n
4981
- } = t, h = await Si(t, a);
5035
+ } = t, h = await Ai(t, a);
4982
5036
  return o === ((e = n.offset) == null ? void 0 : e.placement) && (i = n.arrow) != null && i.alignmentOffset ? {} : {
4983
5037
  x: s + h.x,
4984
5038
  y: r + h.y,
@@ -5005,11 +5059,11 @@ const Ti = function(a) {
5005
5059
  fn: (w) => {
5006
5060
  let {
5007
5061
  x: y,
5008
- y: m
5062
+ y: E
5009
5063
  } = w;
5010
5064
  return {
5011
5065
  x: y,
5012
- y: m
5066
+ y: E
5013
5067
  };
5014
5068
  }
5015
5069
  },
@@ -5017,15 +5071,15 @@ const Ti = function(a) {
5017
5071
  } = at(a, t), c = {
5018
5072
  x: e,
5019
5073
  y: i
5020
- }, d = await le(t, h), f = J(G(s)), u = ne(f);
5074
+ }, d = await le(t, h), f = J(q(s)), u = ne(f);
5021
5075
  let x = c[u], p = c[f];
5022
5076
  if (r) {
5023
- const w = u === "y" ? "top" : "left", y = u === "y" ? "bottom" : "right", m = x + d[w], E = x - d[y];
5024
- x = _t(m, x, E);
5077
+ const w = u === "y" ? "top" : "left", y = u === "y" ? "bottom" : "right", E = x + d[w], m = x - d[y];
5078
+ x = _t(E, x, m);
5025
5079
  }
5026
5080
  if (o) {
5027
- const w = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", m = p + d[w], E = p - d[y];
5028
- p = _t(m, p, E);
5081
+ const w = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", E = p + d[w], m = p - d[y];
5082
+ p = _t(E, p, m);
5029
5083
  }
5030
5084
  const g = n.fn({
5031
5085
  ...t,
@@ -5063,7 +5117,7 @@ function V(a) {
5063
5117
  function he(a) {
5064
5118
  return gt() ? a instanceof Node || a instanceof F(a).Node : !1;
5065
5119
  }
5066
- function k(a) {
5120
+ function X(a) {
5067
5121
  return gt() ? a instanceof Element || a instanceof F(a).Element : !1;
5068
5122
  }
5069
5123
  function B(a) {
@@ -5078,7 +5132,7 @@ function ht(a) {
5078
5132
  overflowX: e,
5079
5133
  overflowY: i,
5080
5134
  display: s
5081
- } = X(a);
5135
+ } = k(a);
5082
5136
  return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
5083
5137
  }
5084
5138
  function Hi(a) {
@@ -5094,7 +5148,7 @@ function wt(a) {
5094
5148
  });
5095
5149
  }
5096
5150
  function Dt(a) {
5097
- const t = Ft(), e = k(a) ? X(a) : a;
5151
+ const t = Ft(), e = X(a) ? k(a) : a;
5098
5152
  return e.transform !== "none" || e.perspective !== "none" || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (e.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (e.contain || "").includes(i));
5099
5153
  }
5100
5154
  function Di(a) {
@@ -5114,11 +5168,11 @@ function Ft() {
5114
5168
  function Q(a) {
5115
5169
  return ["html", "body", "#document"].includes(tt(a));
5116
5170
  }
5117
- function X(a) {
5171
+ function k(a) {
5118
5172
  return F(a).getComputedStyle(a);
5119
5173
  }
5120
5174
  function pt(a) {
5121
- return k(a) ? {
5175
+ return X(a) ? {
5122
5176
  scrollLeft: a.scrollLeft,
5123
5177
  scrollTop: a.scrollTop
5124
5178
  } : {
@@ -5142,21 +5196,21 @@ function ce(a) {
5142
5196
  const t = $(a);
5143
5197
  return Q(t) ? a.ownerDocument ? a.ownerDocument.body : a.body : B(t) && ht(t) ? t : ce(t);
5144
5198
  }
5145
- function At(a, t, e) {
5199
+ function St(a, t, e) {
5146
5200
  var i;
5147
5201
  t === void 0 && (t = []), e === void 0 && (e = !0);
5148
5202
  const s = ce(a), r = s === ((i = a.ownerDocument) == null ? void 0 : i.body), o = F(s);
5149
5203
  if (r) {
5150
5204
  const n = Lt(o);
5151
- return t.concat(o, o.visualViewport || [], ht(s) ? s : [], n && e ? At(n) : []);
5205
+ return t.concat(o, o.visualViewport || [], ht(s) ? s : [], n && e ? St(n) : []);
5152
5206
  }
5153
- return t.concat(s, At(s, [], e));
5207
+ return t.concat(s, St(s, [], e));
5154
5208
  }
5155
5209
  function Lt(a) {
5156
5210
  return a.parent && Object.getPrototypeOf(a.parent) ? a.frameElement : null;
5157
5211
  }
5158
5212
  function de(a) {
5159
- const t = X(a);
5213
+ const t = k(a);
5160
5214
  let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
5161
5215
  const s = B(a), r = s ? a.offsetWidth : e, o = s ? a.offsetHeight : i, n = ft(e) !== r || ft(i) !== o;
5162
5216
  return n && (e = r, i = o), {
@@ -5166,7 +5220,7 @@ function de(a) {
5166
5220
  };
5167
5221
  }
5168
5222
  function fe(a) {
5169
- return k(a) ? a : a.contextElement;
5223
+ return X(a) ? a : a.contextElement;
5170
5224
  }
5171
5225
  function Z(a) {
5172
5226
  const t = fe(a);
@@ -5191,22 +5245,22 @@ function xe(a) {
5191
5245
  y: t.visualViewport.offsetTop
5192
5246
  };
5193
5247
  }
5194
- function ki(a, t, e) {
5248
+ function Xi(a, t, e) {
5195
5249
  return t === void 0 && (t = !1), !e || t && e !== F(a) ? !1 : t;
5196
5250
  }
5197
5251
  function ot(a, t, e, i) {
5198
5252
  t === void 0 && (t = !1), e === void 0 && (e = !1);
5199
5253
  const s = a.getBoundingClientRect(), r = fe(a);
5200
5254
  let o = z(1);
5201
- t && (i ? k(i) && (o = Z(i)) : o = Z(a));
5202
- const n = ki(r, e, i) ? xe(r) : z(0);
5255
+ t && (i ? X(i) && (o = Z(i)) : o = Z(a));
5256
+ const n = Xi(r, e, i) ? xe(r) : z(0);
5203
5257
  let h = (s.left + n.x) / o.x, c = (s.top + n.y) / o.y, d = s.width / o.x, f = s.height / o.y;
5204
5258
  if (r) {
5205
- const u = F(r), x = i && k(i) ? F(i) : i;
5259
+ const u = F(r), x = i && X(i) ? F(i) : i;
5206
5260
  let p = u, g = Lt(p);
5207
5261
  for (; g && i && x !== p; ) {
5208
- const w = Z(g), y = g.getBoundingClientRect(), m = X(g), E = y.left + (g.clientLeft + parseFloat(m.paddingLeft)) * w.x, C = y.top + (g.clientTop + parseFloat(m.paddingTop)) * w.y;
5209
- h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += E, c += C, p = F(g), g = Lt(p);
5262
+ const w = Z(g), y = g.getBoundingClientRect(), E = k(g), m = y.left + (g.clientLeft + parseFloat(E.paddingLeft)) * w.x, C = y.top + (g.clientTop + parseFloat(E.paddingTop)) * w.y;
5263
+ h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += m, c += C, p = F(g), g = Lt(p);
5210
5264
  }
5211
5265
  }
5212
5266
  return ut({
@@ -5216,7 +5270,7 @@ function ot(a, t, e, i) {
5216
5270
  y: c
5217
5271
  });
5218
5272
  }
5219
- function Xi(a) {
5273
+ function ki(a) {
5220
5274
  let {
5221
5275
  elements: t,
5222
5276
  rect: e,
@@ -5245,15 +5299,15 @@ function Xi(a) {
5245
5299
  function Ni(a) {
5246
5300
  return Array.from(a.getClientRects());
5247
5301
  }
5248
- function St(a, t) {
5302
+ function At(a, t) {
5249
5303
  const e = pt(a).scrollLeft;
5250
5304
  return t ? t.left + e : ot(V(a)).left + e;
5251
5305
  }
5252
5306
  function Ki(a) {
5253
5307
  const t = V(a), e = pt(a), i = a.ownerDocument.body, s = U(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), r = U(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
5254
- let o = -e.scrollLeft + St(a);
5308
+ let o = -e.scrollLeft + At(a);
5255
5309
  const n = -e.scrollTop;
5256
- return X(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
5310
+ return k(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
5257
5311
  width: s,
5258
5312
  height: r,
5259
5313
  x: o,
@@ -5284,13 +5338,13 @@ function Yi(a, t) {
5284
5338
  y: c
5285
5339
  };
5286
5340
  }
5287
- function qt(a, t, e) {
5341
+ function Gt(a, t, e) {
5288
5342
  let i;
5289
5343
  if (t === "viewport")
5290
5344
  i = Bi(a, e);
5291
5345
  else if (t === "document")
5292
5346
  i = Ki(V(a));
5293
- else if (k(t))
5347
+ else if (X(t))
5294
5348
  i = Yi(t, e);
5295
5349
  else {
5296
5350
  const s = xe(a);
@@ -5304,17 +5358,17 @@ function qt(a, t, e) {
5304
5358
  }
5305
5359
  function ue(a, t) {
5306
5360
  const e = $(a);
5307
- return e === t || !k(e) || Q(e) ? !1 : X(e).position === "fixed" || ue(e, t);
5361
+ return e === t || !X(e) || Q(e) ? !1 : k(e).position === "fixed" || ue(e, t);
5308
5362
  }
5309
5363
  function Vi(a, t) {
5310
5364
  const e = t.get(a);
5311
5365
  if (e)
5312
5366
  return e;
5313
- let i = At(a, [], !1).filter((n) => k(n) && tt(n) !== "body"), s = null;
5314
- const r = X(a).position === "fixed";
5367
+ let i = St(a, [], !1).filter((n) => X(n) && tt(n) !== "body"), s = null;
5368
+ const r = k(a).position === "fixed";
5315
5369
  let o = r ? $(a) : a;
5316
- for (; k(o) && !Q(o); ) {
5317
- const n = X(o), h = Dt(o);
5370
+ for (; X(o) && !Q(o); ) {
5371
+ const n = k(o), h = Dt(o);
5318
5372
  !h && n.position === "fixed" && (s = null), (r ? !h && !s : !h && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && ue(a, o)) ? i = i.filter((d) => d !== o) : s = n, o = $(o);
5319
5373
  }
5320
5374
  return t.set(a, i), i;
@@ -5327,9 +5381,9 @@ function Wi(a) {
5327
5381
  strategy: s
5328
5382
  } = a;
5329
5383
  const o = [...e === "clippingAncestors" ? wt(t) ? [] : Vi(t, this._c) : [].concat(e), i], n = o[0], h = o.reduce((c, d) => {
5330
- const f = qt(t, d, s);
5384
+ const f = Gt(t, d, s);
5331
5385
  return c.top = U(f.top, c.top), c.right = rt(f.right, c.right), c.bottom = rt(f.bottom, c.bottom), c.left = U(f.left, c.left), c;
5332
- }, qt(t, n, s));
5386
+ }, Gt(t, n, s));
5333
5387
  return {
5334
5388
  width: h.right - h.left,
5335
5389
  height: h.bottom - h.top,
@@ -5358,12 +5412,12 @@ function zi(a, t, e) {
5358
5412
  if ((tt(t) !== "body" || ht(s)) && (n = pt(t)), i) {
5359
5413
  const x = ot(t, !0, r, t);
5360
5414
  h.x = x.x + t.clientLeft, h.y = x.y + t.clientTop;
5361
- } else s && (h.x = St(s));
5415
+ } else s && (h.x = At(s));
5362
5416
  let c = 0, d = 0;
5363
5417
  if (s && !i && !r) {
5364
5418
  const x = s.getBoundingClientRect();
5365
5419
  d = x.top + n.scrollTop, c = x.left + n.scrollLeft - // RTL <body> scrollbar.
5366
- St(s, x);
5420
+ At(s, x);
5367
5421
  }
5368
5422
  const f = o.left + n.scrollLeft - h.x - c, u = o.top + n.scrollTop - h.y - d;
5369
5423
  return {
@@ -5373,11 +5427,11 @@ function zi(a, t, e) {
5373
5427
  height: o.height
5374
5428
  };
5375
5429
  }
5376
- function Et(a) {
5377
- return X(a).position === "static";
5430
+ function mt(a) {
5431
+ return k(a).position === "static";
5378
5432
  }
5379
- function Gt(a, t) {
5380
- if (!B(a) || X(a).position === "fixed")
5433
+ function qt(a, t) {
5434
+ if (!B(a) || k(a).position === "fixed")
5381
5435
  return null;
5382
5436
  if (t)
5383
5437
  return t(a);
@@ -5391,16 +5445,16 @@ function ge(a, t) {
5391
5445
  if (!B(a)) {
5392
5446
  let s = $(a);
5393
5447
  for (; s && !Q(s); ) {
5394
- if (k(s) && !Et(s))
5448
+ if (X(s) && !mt(s))
5395
5449
  return s;
5396
5450
  s = $(s);
5397
5451
  }
5398
5452
  return e;
5399
5453
  }
5400
- let i = Gt(a, t);
5401
- for (; i && Hi(i) && Et(i); )
5402
- i = Gt(i, t);
5403
- return i && Q(i) && Et(i) && !Dt(i) ? e : i || Di(a) || e;
5454
+ let i = qt(a, t);
5455
+ for (; i && Hi(i) && mt(i); )
5456
+ i = qt(i, t);
5457
+ return i && Q(i) && mt(i) && !Dt(i) ? e : i || Di(a) || e;
5404
5458
  }
5405
5459
  const $i = async function(a) {
5406
5460
  const t = this.getOffsetParent || ge, e = this.getDimensions, i = await e(a.floating);
@@ -5414,11 +5468,11 @@ const $i = async function(a) {
5414
5468
  }
5415
5469
  };
5416
5470
  };
5417
- function qi(a) {
5418
- return X(a).direction === "rtl";
5471
+ function Gi(a) {
5472
+ return k(a).direction === "rtl";
5419
5473
  }
5420
- const Gi = {
5421
- convertOffsetParentRelativeRectToViewportRelativeRect: Xi,
5474
+ const qi = {
5475
+ convertOffsetParentRelativeRectToViewportRelativeRect: ki,
5422
5476
  getDocumentElement: V,
5423
5477
  getClippingRect: Wi,
5424
5478
  getOffsetParent: ge,
@@ -5426,11 +5480,11 @@ const Gi = {
5426
5480
  getClientRects: Ni,
5427
5481
  getDimensions: Pi,
5428
5482
  getScale: Z,
5429
- isElement: k,
5430
- isRTL: qi
5431
- }, we = Ti, pe = Mi, ye = Li, ji = Ai, Ee = (a, t, e) => {
5483
+ isElement: X,
5484
+ isRTL: Gi
5485
+ }, we = Ti, pe = Mi, ye = Li, ji = Si, me = (a, t, e) => {
5432
5486
  const i = /* @__PURE__ */ new Map(), s = {
5433
- platform: Gi,
5487
+ platform: qi,
5434
5488
  ...e
5435
5489
  }, r = {
5436
5490
  ...s.platform,
@@ -5498,7 +5552,7 @@ let Ui = class {
5498
5552
  return;
5499
5553
  this.enable = !0, this.contentEl.style.maxWidth = `${t.overflowTooltipMaxWidth || 500}px`, this.contentEl.style.minWidth = "100px", 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;
5500
5554
  const s = t.drawX + i.x, r = t.drawY + i.y;
5501
- Ee({
5555
+ me({
5502
5556
  getBoundingClientRect() {
5503
5557
  return {
5504
5558
  width: t.visibleWidth,
@@ -5610,7 +5664,7 @@ class Zi {
5610
5664
  const { xArr: e, yArr: i } = this.ctx.selector;
5611
5665
  this.selectorArrStr = JSON.stringify(e) + JSON.stringify(i);
5612
5666
  }), this.ctx.on("cellClick", (t) => {
5613
- if (t.editorType === "none" || this.ctx.adjustPositioning || !this.isInSelectorRange(t.rowIndex, t.colIndex))
5667
+ if (this.ctx.adjustPositioning || !this.isInSelectorRange(t.rowIndex, t.colIndex))
5614
5668
  return;
5615
5669
  const { xArr: e, yArr: i } = this.ctx.selector, s = JSON.stringify(e) + JSON.stringify(i);
5616
5670
  if (this.selectorArrStr === s && this.cellTarget) {
@@ -5695,8 +5749,11 @@ class Zi {
5695
5749
  const e = this.ctx.focusCell;
5696
5750
  if (!e || ["index", "index-selection", "selection"].includes(e.type) || this.enable)
5697
5751
  return;
5698
- const { rowKey: i, key: s } = e, r = this.ctx.database.getReadonly(i, s);
5699
- e && !r && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = e, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
5752
+ const { rowKey: i, key: s, editorType: r } = e;
5753
+ if (r === "none")
5754
+ return;
5755
+ const o = this.ctx.database.getReadonly(i, s);
5756
+ e && !o && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = e, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
5700
5757
  }
5701
5758
  editCell(t, e) {
5702
5759
  const i = this.ctx.body.renderRows.find((c) => c.rowIndex === t);
@@ -5713,7 +5770,7 @@ class Zi {
5713
5770
  r && !h && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = r, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
5714
5771
  }
5715
5772
  doneEdit() {
5716
- this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.ctx.emit("draw"));
5773
+ this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.ctx.emit("drawView"));
5717
5774
  }
5718
5775
  destroy() {
5719
5776
  var t;
@@ -5965,7 +6022,7 @@ class ts {
5965
6022
  }),
5966
6023
  contextElement: document.body
5967
6024
  };
5968
- Ee(u, this.contextMenuEl, {
6025
+ me(u, this.contextMenuEl, {
5969
6026
  placement: "right-start",
5970
6027
  middleware: [we(), pe(), ye()]
5971
6028
  }).then(({ x, y: p }) => {
@@ -6046,7 +6103,7 @@ class ss {
6046
6103
  r,
6047
6104
  o
6048
6105
  );
6049
- this.ctx = new xi(n, this.options), this.header = new gi(this.ctx), this.footer = new pi(this.ctx), this.body = new wi(this.ctx), this.scroller = new ui(this.ctx), this.selector = new yi(this.ctx), this.autofill = new Ei(this.ctx), this.tooltip = new Ui(this.ctx), this.empty = new Ji(this.ctx), this.editor = new Zi(this.ctx), this.overlayer = new Qi(this.ctx), this.contextMenu = new ts(this.ctx), this.ctx.on("draw", () => {
6106
+ this.ctx = new xi(n, this.options), this.header = new gi(this.ctx), this.footer = new pi(this.ctx), this.body = new wi(this.ctx), this.scroller = new ui(this.ctx), this.selector = new yi(this.ctx), this.autofill = new mi(this.ctx), this.tooltip = new Ui(this.ctx), this.empty = new Ji(this.ctx), this.editor = new Zi(this.ctx), this.overlayer = new Qi(this.ctx), this.contextMenu = new ts(this.ctx), this.ctx.on("draw", () => {
6050
6107
  this.draw();
6051
6108
  }), this.ctx.on("drawView", () => {
6052
6109
  this.draw(!0);