e-virt-table 1.2.11 → 1.2.12

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
@@ -221,8 +221,8 @@ var Zt = function(t, e, i, s, r, o) {
221
221
  }, ct, Xe = function() {
222
222
  if (ct)
223
223
  return ct;
224
- var l = "[a-fA-F\\d:]", t = function(C) {
225
- return C && C.includeBoundaries ? "(?:(?<=\\s|^)(?=" + l + ")|(?<=" + l + ")(?=\\s|$))" : "";
224
+ var l = "[a-fA-F\\d:]", t = function(b) {
225
+ return b && b.includeBoundaries ? "(?:(?<=\\s|^)(?=" + l + ")|(?<=" + l + ")(?=\\s|$))" : "";
226
226
  }, e = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}", i = "[a-fA-F\\d]{1,4}", s = (`
227
227
  (?:
228
228
  (?:` + i + ":){7}(?:" + i + `|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
@@ -234,16 +234,16 @@ var Zt = function(t, e, i, s, r, o) {
234
234
  (?:` + i + ":){1}(?:(?::" + i + "){0,4}:" + e + "|(?::" + i + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
235
235
  (?::(?:(?::` + i + "){0,5}:" + e + "|(?::" + i + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
236
236
  )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
237
- `).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), n = new RegExp("^" + s + "$"), h = function(C) {
238
- return C && C.exact ? r : new RegExp("(?:" + t(C) + e + t(C) + ")|(?:" + t(C) + s + t(C) + ")", "g");
237
+ `).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), n = new RegExp("^" + s + "$"), h = function(b) {
238
+ return b && b.exact ? r : new RegExp("(?:" + t(b) + e + t(b) + ")|(?:" + t(b) + s + t(b) + ")", "g");
239
239
  };
240
240
  h.v4 = function(y) {
241
241
  return y && y.exact ? o : new RegExp("" + t(y) + e + t(y), "g");
242
242
  }, h.v6 = function(y) {
243
243
  return y && y.exact ? n : new RegExp("" + t(y) + s + t(y), "g");
244
244
  };
245
- var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source, x = h.v6().source, g = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", p = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", u = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", m = '(?:[/?#][^\\s"]*)?', b = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + x + "|" + g + p + u + ")" + w + m;
246
- return ct = new RegExp("(?:^" + b + "$)", "i"), ct;
245
+ var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source, x = h.v6().source, g = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", p = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", u = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", m = '(?:[/?#][^\\s"]*)?', C = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + x + "|" + g + p + u + ")" + w + m;
246
+ return ct = new RegExp("(?:^" + C + "$)", "i"), ct;
247
247
  }, Kt = {
248
248
  // http://emailregex.com/
249
249
  email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
@@ -538,15 +538,15 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
538
538
  return c && c(null, n), Promise.resolve(n);
539
539
  function d(u) {
540
540
  var w = [], m = {};
541
- function b(C) {
542
- if (Array.isArray(C)) {
541
+ function C(b) {
542
+ if (Array.isArray(b)) {
543
543
  var E;
544
- w = (E = w).concat.apply(E, C);
544
+ w = (E = w).concat.apply(E, b);
545
545
  } else
546
- w.push(C);
546
+ w.push(b);
547
547
  }
548
548
  for (var y = 0; y < u.length; y++)
549
- b(u[y]);
549
+ C(u[y]);
550
550
  w.length ? (m = bt(w), c(w, m)) : c(null, n);
551
551
  }
552
552
  if (h.messages) {
@@ -557,8 +557,8 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
557
557
  var x = {}, g = h.keys || Object.keys(this.rules);
558
558
  g.forEach(function(u) {
559
559
  var w = o.rules[u], m = n[u];
560
- w.forEach(function(b) {
561
- var y = b;
560
+ w.forEach(function(C) {
561
+ var y = C;
562
562
  typeof y.transform == "function" && (n === i && (n = q({}, n)), m = n[u] = y.transform(m)), typeof y == "function" ? y = {
563
563
  validator: y
564
564
  } : y = q({}, y), y.validator = o.getValidationMethod(y), y.validator && (y.field = u, y.fullField = y.fullField || u, y.type = o.getType(y), x[u] = x[u] || [], x[u].push({
@@ -571,22 +571,22 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
571
571
  });
572
572
  var p = {};
573
573
  return Ae(x, h, function(u, w) {
574
- var m = u.rule, b = (m.type === "object" || m.type === "array") && (typeof m.fields == "object" || typeof m.defaultField == "object");
575
- b = b && (m.required || !m.required && u.value), m.field = u.field;
574
+ var m = u.rule, C = (m.type === "object" || m.type === "array") && (typeof m.fields == "object" || typeof m.defaultField == "object");
575
+ C = C && (m.required || !m.required && u.value), m.field = u.field;
576
576
  function y(R, O) {
577
577
  return q({}, O, {
578
578
  fullField: m.fullField + "." + R,
579
579
  fullFields: m.fullFields ? [].concat(m.fullFields, [R]) : [R]
580
580
  });
581
581
  }
582
- function C(R) {
582
+ function b(R) {
583
583
  R === void 0 && (R = []);
584
584
  var O = Array.isArray(R) ? R : [R];
585
585
  !h.suppressWarning && O.length && l.warning("async-validator:", O), O.length && m.message !== void 0 && (O = [].concat(m.message));
586
586
  var I = O.map(Nt(m, n));
587
587
  if (h.first && I.length)
588
588
  return p[m.field] = 1, w(I);
589
- if (!b)
589
+ if (!C)
590
590
  w(I);
591
591
  else {
592
592
  if (m.required && !u.value)
@@ -609,21 +609,21 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
609
609
  }
610
610
  var E;
611
611
  if (m.asyncValidator)
612
- E = m.asyncValidator(m, u.value, C, u.source, h);
612
+ E = m.asyncValidator(m, u.value, b, u.source, h);
613
613
  else if (m.validator) {
614
614
  try {
615
- E = m.validator(m, u.value, C, u.source, h);
615
+ E = m.validator(m, u.value, b, u.source, h);
616
616
  } catch (R) {
617
617
  console.error == null || console.error(R), h.suppressValidatorError || setTimeout(function() {
618
618
  throw R;
619
- }, 0), C(R.message);
619
+ }, 0), b(R.message);
620
620
  }
621
- E === !0 ? C() : E === !1 ? C(typeof m.message == "function" ? m.message(m.fullField || m.field) : m.message || (m.fullField || m.field) + " fails") : E instanceof Array ? C(E) : E instanceof Error && C(E.message);
621
+ E === !0 ? b() : E === !1 ? b(typeof m.message == "function" ? m.message(m.fullField || m.field) : m.message || (m.fullField || m.field) + " fails") : E instanceof Array ? b(E) : E instanceof Error && b(E.message);
622
622
  }
623
623
  E && E.then && E.then(function() {
624
- return C();
624
+ return b();
625
625
  }, function(R) {
626
- return C(R);
626
+ return b(R);
627
627
  });
628
628
  }, function(u) {
629
629
  d(u);
@@ -1069,13 +1069,13 @@ class At extends re {
1069
1069
  return;
1070
1070
  }
1071
1071
  let w = "transparent";
1072
- const m = this.ctx.hoverCell, b = this.ctx.currentCell;
1073
- let y = this.rowIndex, C = this.rowIndex;
1072
+ const m = this.ctx.hoverCell, C = this.ctx.currentCell;
1073
+ let y = this.rowIndex, b = this.rowIndex;
1074
1074
  if (this.rowspan !== 1 && (x || d)) {
1075
1075
  const O = this.getSpanInfo(), { yArr: I } = O;
1076
- y = I[0], C = I[1];
1076
+ y = I[0], b = I[1];
1077
1077
  }
1078
- x && m && (m.rowKey === this.rowKey && (w = g), m.rowIndex >= y && m.rowIndex <= C && (w = g)), d && b && (b.rowKey === this.rowKey && (w = f), b.rowIndex >= y && b.rowIndex <= C && (w = f)), this.drawCellSkyBgColor = w;
1078
+ x && m && (m.rowKey === this.rowKey && (w = g), m.rowIndex >= y && m.rowIndex <= b && (w = g)), d && C && (C.rowKey === this.rowKey && (w = f), C.rowIndex >= y && C.rowIndex <= b && (w = f)), this.drawCellSkyBgColor = w;
1079
1079
  let E = e, R = n;
1080
1080
  if (this.ctx.database.getReadonly(this.rowKey, this.key) || (E = i, R = o), p && (this.rowIndex % 2 ? E = u : E = e), typeof s == "function") {
1081
1081
  const O = s, { backgroundColor: I, color: _ } = O({
@@ -1118,8 +1118,8 @@ class At extends re {
1118
1118
  if (n.rowKey === this.rowKey && (h = this.drawX + this.width - s - r, c = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && o) {
1119
1119
  const f = this.getSpanInfo(), { yArr: x } = f, g = x[0], p = x[1];
1120
1120
  if (n.rowIndex >= g && n.rowIndex <= p) {
1121
- const { width: u, height: w, offsetTop: m, offsetLeft: b } = f;
1122
- h = this.drawX - b + u - s - r, c = this.drawY - m + (w - s) / 2;
1121
+ const { width: u, height: w, offsetTop: m, offsetLeft: C } = f;
1122
+ h = this.drawX - C + u - s - r, c = this.drawY - m + (w - s) / 2;
1123
1123
  }
1124
1124
  }
1125
1125
  const d = this.ctx.icons.get(this.hoverIconName);
@@ -1348,9 +1348,9 @@ class At extends re {
1348
1348
  drawBorder(e) {
1349
1349
  const { drawX: i, drawY: s, rowIndex: r, colIndex: o, height: n, width: h } = this;
1350
1350
  let c = i, d = s;
1351
- const { xArr: f, yArr: x, lineDash: g = [], borderWidth: p = 1, borderColor: u, fillColor: w } = e, m = f[0], b = f[1], y = x[0], C = x[1];
1352
- if (o >= m && o <= b && r === y) {
1353
- const E = o === b ? 1 : 0, R = o === m ? 1 : 0;
1351
+ const { xArr: f, yArr: x, lineDash: g = [], borderWidth: p = 1, borderColor: u, fillColor: w } = e, m = f[0], C = f[1], y = x[0], b = x[1];
1352
+ if (o >= m && o <= C && r === y) {
1353
+ const E = o === C ? 1 : 0, R = o === m ? 1 : 0;
1354
1354
  this.ctx.paint.drawLine([c + R, d + 1, c + h - E, d + 1], {
1355
1355
  borderColor: u,
1356
1356
  fillColor: w,
@@ -1360,8 +1360,8 @@ class At extends re {
1360
1360
  lineDash: g
1361
1361
  });
1362
1362
  }
1363
- if (o === b && r >= y && r <= C) {
1364
- const E = r === y ? 1 : 0, R = r === C ? 1 : 0;
1363
+ if (o === C && r >= y && r <= b) {
1364
+ const E = r === y ? 1 : 0, R = r === b ? 1 : 0;
1365
1365
  this.ctx.paint.drawLine([c + h - 1, d + E, c + h - 1, d + n - R], {
1366
1366
  borderColor: u,
1367
1367
  fillColor: w,
@@ -1371,8 +1371,8 @@ class At extends re {
1371
1371
  lineDash: g
1372
1372
  });
1373
1373
  }
1374
- if (o >= m && o <= b && r === C) {
1375
- const E = o === b ? 1 : 0, R = o === m ? 1 : 0;
1374
+ if (o >= m && o <= C && r === b) {
1375
+ const E = o === C ? 1 : 0, R = o === m ? 1 : 0;
1376
1376
  this.ctx.paint.drawLine([c + R, d + n - 1, c + h - E, d + n - 1], {
1377
1377
  borderColor: u,
1378
1378
  fillColor: w,
@@ -1382,8 +1382,8 @@ class At extends re {
1382
1382
  lineDash: g
1383
1383
  });
1384
1384
  }
1385
- if (o === m && r >= y && r <= C) {
1386
- const E = r === C ? 1 : 0, R = r === y ? 1 : 0;
1385
+ if (o === m && r >= y && r <= b) {
1386
+ const E = r === b ? 1 : 0, R = r === y ? 1 : 0;
1387
1387
  this.ctx.paint.drawLine([c + 1, d + R, c + 1, d + n - E], {
1388
1388
  borderColor: u,
1389
1389
  fillColor: w,
@@ -1445,7 +1445,7 @@ class li {
1445
1445
  */
1446
1446
  initData(t, e = 0) {
1447
1447
  t.forEach((i, s) => {
1448
- var m, b;
1448
+ var m;
1449
1449
  let r = !1;
1450
1450
  Array.isArray(i.children) && (r = i._hasChildren, i.children.length && (r = !0, this.initData(i.children, e + 1)));
1451
1451
  const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: d } = this.ctx.config, f = i[o], x = f != null ? `${f}` : Jt();
@@ -1453,24 +1453,20 @@ class li {
1453
1453
  const g = i._height || h, p = i._readonly;
1454
1454
  let u = !0;
1455
1455
  if (typeof c == "function" && (u = c), d) {
1456
- const y = i[d];
1457
- if (this.checkboxKeyMap.has(y)) {
1458
- const C = this.checkboxKeyMap.get(y) || [];
1459
- C.push(x), this.checkboxKeyMap.set(y, C);
1456
+ const C = i[d];
1457
+ if (this.checkboxKeyMap.has(C)) {
1458
+ const y = this.checkboxKeyMap.get(C) || [];
1459
+ y.push(x), this.checkboxKeyMap.set(C, y);
1460
1460
  } else
1461
- this.checkboxKeyMap.set(y, [x]);
1461
+ this.checkboxKeyMap.set(C, [x]);
1462
1462
  }
1463
1463
  this.selectionMap.set(x, {
1464
1464
  key: d ? i[d] : x,
1465
1465
  row: i,
1466
1466
  check: ((m = this.selectionMap.get(x)) == null ? void 0 : m.check) || !1
1467
1467
  });
1468
- const w = n || ((b = this.expandMap.get(x)) == null ? void 0 : b.expand) || i._expand || !1;
1469
- this.expandMap.set(x, {
1470
- key: x,
1471
- row: i,
1472
- expand: w
1473
- }), this.rowKeyMap.set(x, {
1468
+ const w = n || this.expandMap.get(x) || i._expand || !1;
1469
+ this.expandMap.set(x, w), this.rowKeyMap.set(x, {
1474
1470
  readonly: p,
1475
1471
  index: s,
1476
1472
  rowIndex: s,
@@ -1586,20 +1582,12 @@ class li {
1586
1582
  */
1587
1583
  expandItem(t, e = !1) {
1588
1584
  const i = this.rowKeyMap.get(t);
1589
- i.expand = e, this.expandMap.set(t, {
1590
- key: t,
1591
- row: i.item,
1592
- expand: e
1593
- }), this.clearBufferData(), this.ctx.emit("draw");
1585
+ i.expand = e, this.expandMap.set(t, e), this.clearBufferData(), this.ctx.emit("draw");
1594
1586
  }
1595
1587
  setExpandRowKeys(t, e = !0) {
1596
- t.forEach((i) => {
1588
+ this.expandMap.clear(), t.forEach((i) => {
1597
1589
  const s = this.rowKeyMap.get(i);
1598
- this.expandMap.set(i, {
1599
- key: i,
1600
- row: s.item,
1601
- expand: e
1602
- }), s.expand = e;
1590
+ this.expandMap.set(i, e), s.expand = e;
1603
1591
  }), this.clearBufferData(), this.ctx.emit("draw");
1604
1592
  }
1605
1593
  getExpandRowKeys() {
@@ -1609,12 +1597,8 @@ class li {
1609
1597
  }), t;
1610
1598
  }
1611
1599
  expandAll(t) {
1612
- this.rowKeyMap.forEach((e) => {
1613
- e.expand = t, this.expandMap.set(e.key, {
1614
- key: e.key,
1615
- row: e.item,
1616
- expand: t
1617
- });
1600
+ this.expandMap.clear(), this.rowKeyMap.forEach((e) => {
1601
+ e.expand = t, this.expandMap.set(e.key, t);
1618
1602
  }), this.clearBufferData(), this.ctx.emit("draw");
1619
1603
  }
1620
1604
  expandLoading(t, e = !1) {
@@ -1623,11 +1607,7 @@ class li {
1623
1607
  }
1624
1608
  setExpandChildren(t, e) {
1625
1609
  const i = this.rowKeyMap.get(t);
1626
- i.expand = !0, this.expandMap.set(t, {
1627
- key: t,
1628
- row: i.item,
1629
- expand: !0
1630
- }), i.expandLazy = !0, i.item.children = e, this.initData(i.item.children, i.level + 1), this.clearBufferData();
1610
+ i.expand = !0, this.expandMap.set(t, !0), i.expandLazy = !0, i.item.children = e, this.initData(i.item.children, i.level + 1), this.clearBufferData();
1631
1611
  }
1632
1612
  getIsExpandLoading(t) {
1633
1613
  return this.rowKeyMap.get(t).expandLoading;
@@ -1959,9 +1939,13 @@ class li {
1959
1939
  clearSelection(t = !1) {
1960
1940
  t ? this.rowKeyMap.forEach((i, s) => {
1961
1941
  this.setRowSelection(s, !1, !1);
1962
- }) : this.selectionMap.forEach((i, s) => {
1963
- this.setRowSelection(s, !1, !1);
1964
- });
1942
+ }) : (this.selectionMap.clear(), this.rowKeyMap.forEach((i, s) => {
1943
+ this.selectionMap.set(s, {
1944
+ check: !1,
1945
+ row: i.item,
1946
+ key: s
1947
+ });
1948
+ }));
1965
1949
  const e = this.getSelectionRows();
1966
1950
  this.ctx.emit("clearSelection"), this.ctx.emit("selectionChange", e), this.bufferCheckState.buffer = !1, this.ctx.emit("draw");
1967
1951
  }
@@ -2200,7 +2184,7 @@ class li {
2200
2184
  }
2201
2185
  ]
2202
2186
  };
2203
- let w = e, m = e, b = n, y = n, C = [], E = 0, R = 0, O = 0, I = 0;
2187
+ let w = e, m = e, C = n, y = n, b = [], E = 0, R = 0, O = 0, I = 0;
2204
2188
  if (d !== 1 && p) {
2205
2189
  I = x;
2206
2190
  const _ = h.reduce((v, S) => {
@@ -2235,7 +2219,7 @@ class li {
2235
2219
  const { height: S } = this.positions[v];
2236
2220
  O += S;
2237
2221
  const T = this.rowIndexRowKeyMap.get(v) || "", { item: M } = this.rowKeyMap.get(T), A = this.getItemValue(T, i);
2238
- C.push({
2222
+ b.push({
2239
2223
  rowKey: T,
2240
2224
  key: i,
2241
2225
  value: A,
@@ -2251,7 +2235,7 @@ class li {
2251
2235
  break;
2252
2236
  const S = this.getItemValue(s, i), T = this.getItemValue(s, v.key);
2253
2237
  if (S === T && c.includes(v.key))
2254
- b = _;
2238
+ C = _;
2255
2239
  else
2256
2240
  break;
2257
2241
  }
@@ -2265,17 +2249,17 @@ class li {
2265
2249
  else
2266
2250
  break;
2267
2251
  }
2268
- for (let _ = b; _ < n; _++) {
2252
+ for (let _ = C; _ < n; _++) {
2269
2253
  const v = this.getColumnByColIndex(_);
2270
2254
  if (!v)
2271
2255
  break;
2272
2256
  R += v.width || 100;
2273
2257
  }
2274
- for (let _ = b; _ <= y; _++) {
2258
+ for (let _ = C; _ <= y; _++) {
2275
2259
  const v = this.getColumnByColIndex(_);
2276
2260
  if (!v)
2277
2261
  break;
2278
- I += v.width || 100, C.push({
2262
+ I += v.width || 100, b.push({
2279
2263
  rowKey: s,
2280
2264
  key: v.key,
2281
2265
  value: this.getItemValue(s, v.key),
@@ -2284,7 +2268,7 @@ class li {
2284
2268
  }
2285
2269
  }
2286
2270
  return {
2287
- xArr: [b, y],
2271
+ xArr: [C, y],
2288
2272
  yArr: [w, m],
2289
2273
  rowspan: d,
2290
2274
  colspan: g,
@@ -2292,7 +2276,7 @@ class li {
2292
2276
  width: I,
2293
2277
  offsetTop: E,
2294
2278
  offsetLeft: R,
2295
- dataList: C
2279
+ dataList: b
2296
2280
  };
2297
2281
  }
2298
2282
  setLoading(t) {
@@ -4010,14 +3994,14 @@ class mi {
4010
3994
  let w = this.height + e.height + o;
4011
3995
  w += u;
4012
3996
  let m = w;
4013
- const b = window.innerHeight, { top: y } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
4014
- if (b > y && d && !n) {
4015
- const T = b - y - f;
3997
+ const C = window.innerHeight, { top: y } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
3998
+ if (C > y && d && !n) {
3999
+ const T = C - y - f;
4016
4000
  T > e.height + o ? m = T : w > c && (m = c);
4017
4001
  } else this.data.length && n ? m = n : this.data.length && c && w > c && (m = c);
4018
4002
  m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
4019
- let C = this.ctx.stageHeight - e.height - o;
4020
- r ? this.visibleHeight = C - u : this.visibleHeight = C, this.data.length || (this.height = this.visibleHeight), this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = g;
4003
+ let b = this.ctx.stageHeight - e.height - o;
4004
+ r ? this.visibleHeight = b - u : this.visibleHeight = b, this.data.length || (this.height = this.visibleHeight), this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = g;
4021
4005
  const E = window.devicePixelRatio || 1, R = this.ctx.stageWidth * E, O = this.ctx.stageHeight * E;
4022
4006
  t.width = Math.round(R), t.height = Math.round(O);
4023
4007
  const I = this.data.length ? "not-empty" : "empty";
@@ -4376,14 +4360,14 @@ class Ei {
4376
4360
  SELECTOR_AREA_MAX_X_OFFSET: f,
4377
4361
  SELECTOR_AREA_MAX_Y_OFFSET: x
4378
4362
  } = this.ctx.config, g = n, p = h || this.ctx.maxColIndex - f, u = c, w = d || this.ctx.maxRowIndex - x;
4379
- let [m, b] = r, [y, C] = o;
4380
- if (m < g || b > p || y < u || C > w)
4363
+ let [m, C] = r, [y, b] = o;
4364
+ if (m < g || C > p || y < u || b > w)
4381
4365
  return;
4382
4366
  if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
4383
4367
  const R = this.adjustMergeCells(r, o);
4384
- y = R.yArr[0], C = R.yArr[1], m = R.xArr[0], b = R.xArr[1], this.ctx.onlyMergeCell = R.onlyMergeCell;
4368
+ y = R.yArr[0], b = R.yArr[1], m = R.xArr[0], C = R.xArr[1], this.ctx.onlyMergeCell = R.onlyMergeCell;
4385
4369
  }
4386
- m === b && y === C ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(g, m), Math.min(p, b)], o = [Math.max(u, y), Math.min(w, C)];
4370
+ m === C && y === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(g, m), Math.min(p, C)], o = [Math.max(u, y), Math.min(w, b)];
4387
4371
  const { BEFORE_SET_SELECTOR_METHOD: E } = this.ctx.config;
4388
4372
  if (typeof E == "function") {
4389
4373
  const O = E({
@@ -4404,13 +4388,13 @@ class Ei {
4404
4388
  let n = [], h = [];
4405
4389
  for (let u = 0; u <= e[1] - e[0]; u++)
4406
4390
  for (let w = 0; w <= t[1] - t[0]; w++) {
4407
- const m = u + e[0], b = w + t[0], y = this.ctx.database.getVirtualBodyCell(m, b);
4408
- y && ((m === i || m === s) && n.push(y), (b === r || b === o) && h.push(y));
4391
+ const m = u + e[0], C = w + t[0], y = this.ctx.database.getVirtualBodyCell(m, C);
4392
+ y && ((m === i || m === s) && n.push(y), (C === r || C === o) && h.push(y));
4409
4393
  }
4410
4394
  const c = n.reduce(
4411
4395
  (u, w) => {
4412
- const { yArr: m } = w.getSpanInfo(), [b, y] = m;
4413
- return u.minY = Math.min(u.minY, b), u.maxY = Math.max(u.maxY, y), u;
4396
+ const { yArr: m } = w.getSpanInfo(), [C, y] = m;
4397
+ return u.minY = Math.min(u.minY, C), u.maxY = Math.max(u.maxY, y), u;
4414
4398
  },
4415
4399
  {
4416
4400
  minY: i,
@@ -4418,8 +4402,8 @@ class Ei {
4418
4402
  }
4419
4403
  ), d = h.reduce(
4420
4404
  (u, w) => {
4421
- const { xArr: m } = w.getSpanInfo(), [b, y] = m;
4422
- return u.minX = Math.min(u.minX, b), u.maxX = Math.max(u.maxX, y), u;
4405
+ const { xArr: m } = w.getSpanInfo(), [C, y] = m;
4406
+ return u.minX = Math.min(u.minX, C), u.maxX = Math.max(u.maxX, y), u;
4423
4407
  },
4424
4408
  {
4425
4409
  minX: r,
@@ -4630,8 +4614,8 @@ class Ei {
4630
4614
  }
4631
4615
  let w = [];
4632
4616
  for (let y = 0; y <= o.length - 1; y++) {
4633
- const C = o[y].length;
4634
- for (let E = 0; E <= C - 1; E++) {
4617
+ const b = o[y].length;
4618
+ for (let E = 0; E <= b - 1; E++) {
4635
4619
  const R = y + e, O = E + i, I = o[y][E], _ = this.ctx.database.getItemValueForRowIndexAndColIndex(
4636
4620
  R,
4637
4621
  O
@@ -4654,30 +4638,30 @@ class Ei {
4654
4638
  this.ctx.selector.yArrCopy,
4655
4639
  !0
4656
4640
  // 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
4657
- ), C = w.map((E) => `${E.rowKey}-${E.key}`);
4641
+ ), b = w.map((E) => `${E.rowKey}-${E.key}`);
4658
4642
  y.forEach((E) => {
4659
- C.includes(`${E.rowKey}-${E.key}`) || w.unshift(E);
4643
+ b.includes(`${E.rowKey}-${E.key}`) || w.unshift(E);
4660
4644
  }), this.isCut = !1;
4661
4645
  }
4662
4646
  if (!w.length)
4663
4647
  return;
4664
4648
  const { BEFORE_PASTE_DATA_METHOD: m } = this.ctx.config;
4665
4649
  if (typeof m == "function") {
4666
- const y = m, C = w.map((E) => ({
4650
+ const y = m, b = w.map((E) => ({
4667
4651
  rowKey: E.rowKey,
4668
4652
  key: E.key,
4669
4653
  value: E.value,
4670
4654
  oldValue: this.ctx.database.getItemValue(E.rowKey, E.key),
4671
4655
  row: this.ctx.database.getRowDataItemForRowKey(E.rowKey)
4672
4656
  }));
4673
- if (w = await y(C, n, h, o), w && !w.length)
4657
+ if (w = await y(b, n, h, o), w && !w.length)
4674
4658
  return;
4675
4659
  }
4676
4660
  this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(w, !0);
4677
- let b = [];
4661
+ let C = [];
4678
4662
  s.forEach((y) => {
4679
- b.push(this.ctx.database.getRowDataItemForRowKey(y));
4680
- }), this.ctx.emit("pasteChange", w, b);
4663
+ C.push(this.ctx.database.getRowDataItemForRowKey(y));
4664
+ }), this.ctx.emit("pasteChange", w, C);
4681
4665
  }).catch((r) => {
4682
4666
  console.error("Failed to get the clipboard content:", r);
4683
4667
  });
@@ -4771,14 +4755,14 @@ class Ei {
4771
4755
  if (!i)
4772
4756
  return;
4773
4757
  p && this.ctx.onlyMergeCell && i.updateSpanInfo();
4774
- const { drawX: u, drawY: w, width: m, height: b, fixed: y } = i, C = r - u + 1, E = i.drawX + m - (e - s) + 1;
4775
- let R = o.height - w, O = b;
4758
+ const { drawX: u, drawY: w, width: m, height: C, fixed: y } = i, b = r - u + 1, E = i.drawX + m - (e - s) + 1;
4759
+ let R = o.height - w, O = C;
4776
4760
  O > h.visibleHeight && (O = h.visibleHeight);
4777
4761
  let I = 0;
4778
4762
  x && (g === "top" ? R = o.height + n.height - w : I = n.visibleHeight);
4779
4763
  const _ = w + O - (t - I - f);
4780
4764
  let v = c, S = d;
4781
- E > 0 && !y ? v = Math.floor(c + E) : C > 0 && !y && (v = Math.floor(c - C)), R > 0 ? S = Math.floor(d - R) : _ > 0 && (S = Math.floor(d + _)), (Math.abs(c - v) > 2 || Math.abs(d - S) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(v, S), this.ctx.emit("adjustBoundaryPosition", i));
4765
+ E > 0 && !y ? v = Math.floor(c + E) : b > 0 && !y && (v = Math.floor(c - b)), R > 0 ? S = Math.floor(d - R) : _ > 0 && (S = Math.floor(d + _)), (Math.abs(c - v) > 2 || Math.abs(d - S) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(v, S), this.ctx.emit("adjustBoundaryPosition", i));
4782
4766
  }
4783
4767
  destroy() {
4784
4768
  this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
@@ -4843,10 +4827,10 @@ class Ci {
4843
4827
  SELECTOR_AREA_MAX_X_OFFSET: x,
4844
4828
  SELECTOR_AREA_MAX_Y_OFFSET: g
4845
4829
  } = this.ctx.config, p = h, u = c || this.ctx.maxColIndex - x, w = d, m = f || this.ctx.maxRowIndex - g;
4846
- let [b, y] = o, [C, E] = n;
4847
- if (b < p || C < w)
4830
+ let [C, y] = o, [b, E] = n;
4831
+ if (C < p || b < w)
4848
4832
  return;
4849
- o = [Math.max(p, b), Math.min(u, y)], n = [Math.max(w, C), Math.min(m, E)];
4833
+ o = [Math.max(p, C), Math.min(u, y)], n = [Math.max(w, b), Math.min(m, E)];
4850
4834
  const { BEFORE_SET_AUTOFILL_METHOD: R } = this.ctx.config;
4851
4835
  if (typeof R == "function") {
4852
4836
  const I = R({
@@ -4883,11 +4867,11 @@ class Ci {
4883
4867
  let d = [];
4884
4868
  for (let g = 0; g <= h[1] - h[0]; g++)
4885
4869
  for (let p = 0; p <= n[1] - n[0]; p++) {
4886
- const u = p + n[0], w = g + h[0], m = s[g % o][p % r], b = this.ctx.database.getItemValueForRowIndexAndColIndex(w, u), y = `${w}-${u}`;
4887
- if (b && !i.has(y)) {
4888
- const { rowKey: C, key: E } = b;
4889
- this.ctx.database.getReadonly(C, E) || (t.add(C), d.push({
4890
- rowKey: C,
4870
+ const u = p + n[0], w = g + h[0], m = s[g % o][p % r], C = this.ctx.database.getItemValueForRowIndexAndColIndex(w, u), y = `${w}-${u}`;
4871
+ if (C && !i.has(y)) {
4872
+ const { rowKey: b, key: E } = C;
4873
+ this.ctx.database.getReadonly(b, E) || (t.add(b), d.push({
4874
+ rowKey: b,
4891
4875
  key: E,
4892
4876
  value: m,
4893
4877
  row: {}
@@ -5100,9 +5084,9 @@ const Si = async (l, t, e) => {
5100
5084
  name: w,
5101
5085
  fn: m
5102
5086
  } = n[u], {
5103
- x: b,
5087
+ x: C,
5104
5088
  y,
5105
- data: C,
5089
+ data: b,
5106
5090
  reset: E
5107
5091
  } = await m({
5108
5092
  x: d,
@@ -5118,11 +5102,11 @@ const Si = async (l, t, e) => {
5118
5102
  floating: t
5119
5103
  }
5120
5104
  });
5121
- d = b ?? d, f = y ?? f, g = {
5105
+ d = C ?? d, f = y ?? f, g = {
5122
5106
  ...g,
5123
5107
  [w]: {
5124
5108
  ...g[w],
5125
- ...C
5109
+ ...b
5126
5110
  }
5127
5111
  }, E && p <= 50 && (p++, typeof E == "object" && (E.placement && (x = E.placement), E.rects && (c = E.rects === !0 ? await o.getElementRects({
5128
5112
  reference: l,
@@ -5162,12 +5146,12 @@ async function he(l, t) {
5162
5146
  boundary: c,
5163
5147
  rootBoundary: d,
5164
5148
  strategy: h
5165
- })), b = f === "floating" ? {
5149
+ })), C = f === "floating" ? {
5166
5150
  x: i,
5167
5151
  y: s,
5168
5152
  width: o.floating.width,
5169
5153
  height: o.floating.height
5170
- } : o.reference, y = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(n.floating)), C = await (r.isElement == null ? void 0 : r.isElement(y)) ? await (r.getScale == null ? void 0 : r.getScale(y)) || {
5154
+ } : o.reference, y = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(n.floating)), b = await (r.isElement == null ? void 0 : r.isElement(y)) ? await (r.getScale == null ? void 0 : r.getScale(y)) || {
5171
5155
  x: 1,
5172
5156
  y: 1
5173
5157
  } : {
@@ -5175,15 +5159,15 @@ async function he(l, t) {
5175
5159
  y: 1
5176
5160
  }, E = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
5177
5161
  elements: n,
5178
- rect: b,
5162
+ rect: C,
5179
5163
  offsetParent: y,
5180
5164
  strategy: h
5181
- }) : b);
5165
+ }) : C);
5182
5166
  return {
5183
- top: (m.top - E.top + p.top) / C.y,
5184
- bottom: (E.bottom - m.bottom + p.bottom) / C.y,
5185
- left: (m.left - E.left + p.left) / C.x,
5186
- right: (E.right - m.right + p.right) / C.x
5167
+ top: (m.top - E.top + p.top) / b.y,
5168
+ bottom: (E.bottom - m.bottom + p.bottom) / b.y,
5169
+ left: (m.left - E.left + p.left) / b.x,
5170
+ right: (E.right - m.right + p.right) / b.x
5187
5171
  };
5188
5172
  }
5189
5173
  const Ti = (l) => ({
@@ -5207,10 +5191,10 @@ const Ti = (l) => ({
5207
5191
  const f = le(d), x = {
5208
5192
  x: e,
5209
5193
  y: i
5210
- }, g = Ht(s), p = Mt(g), u = await o.getDimensions(c), w = g === "y", m = w ? "top" : "left", b = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", C = r.reference[p] + r.reference[g] - x[g] - r.floating[p], E = x[g] - r.reference[g], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
5194
+ }, g = Ht(s), p = Mt(g), u = await o.getDimensions(c), w = g === "y", m = w ? "top" : "left", C = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = r.reference[p] + r.reference[g] - x[g] - r.floating[p], E = x[g] - r.reference[g], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
5211
5195
  let O = R ? R[y] : 0;
5212
5196
  (!O || !await (o.isElement == null ? void 0 : o.isElement(R))) && (O = n.floating[y] || r.floating[p]);
5213
- const I = C / 2 - E / 2, _ = O / 2 - u[p] / 2 - 1, v = rt(f[m], _), S = rt(f[b], _), T = v, M = O - u[p] - S, A = O / 2 - u[p] / 2 + I, N = It(T, A, M), Y = !h.arrow && lt(s) != null && A !== N && r.reference[p] / 2 - (A < T ? v : S) - u[p] / 2 < 0, k = Y ? A < T ? A - T : A - M : 0;
5197
+ const I = b / 2 - E / 2, _ = O / 2 - u[p] / 2 - 1, v = rt(f[m], _), S = rt(f[C], _), T = v, M = O - u[p] - S, A = O / 2 - u[p] / 2 + I, N = It(T, A, M), Y = !h.arrow && lt(s) != null && A !== N && r.reference[p] / 2 - (A < T ? v : S) - u[p] / 2 < 0, k = Y ? A < T ? A - T : A - M : 0;
5214
5198
  return {
5215
5199
  [g]: x[g] + k,
5216
5200
  data: {
@@ -5247,12 +5231,12 @@ const Ti = (l) => ({
5247
5231
  } = at(l, t);
5248
5232
  if ((e = r.arrow) != null && e.alignmentOffset)
5249
5233
  return {};
5250
- const m = G(s), b = J(n), y = G(n) === n, C = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), E = x || (y || !u ? [xt(n)] : _i(n)), R = p !== "none";
5251
- !x && R && E.push(...Oi(n, u, p, C));
5234
+ const m = G(s), C = J(n), y = G(n) === n, b = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), E = x || (y || !u ? [xt(n)] : _i(n)), R = p !== "none";
5235
+ !x && R && E.push(...Oi(n, u, p, b));
5252
5236
  const O = [n, ...E], I = await he(t, w), _ = [];
5253
5237
  let v = ((i = r.flip) == null ? void 0 : i.overflows) || [];
5254
5238
  if (d && _.push(I[m]), f) {
5255
- const A = Ri(s, o, C);
5239
+ const A = Ri(s, o, b);
5256
5240
  _.push(I[A[0]], I[A[1]]);
5257
5241
  }
5258
5242
  if (v = [...v, {
@@ -5279,7 +5263,7 @@ const Ti = (l) => ({
5279
5263
  const k = (M = v.filter((W) => {
5280
5264
  if (R) {
5281
5265
  const P = J(W.placement);
5282
- return P === b || // Create a bias to the `y` side axis due to horizontal
5266
+ return P === C || // Create a bias to the `y` side axis due to horizontal
5283
5267
  // reading directions favoring greater width.
5284
5268
  P === "y";
5285
5269
  }
@@ -5368,11 +5352,11 @@ const Hi = function(l) {
5368
5352
  fn: (w) => {
5369
5353
  let {
5370
5354
  x: m,
5371
- y: b
5355
+ y: C
5372
5356
  } = w;
5373
5357
  return {
5374
5358
  x: m,
5375
- y: b
5359
+ y: C
5376
5360
  };
5377
5361
  }
5378
5362
  },
@@ -5383,12 +5367,12 @@ const Hi = function(l) {
5383
5367
  }, d = await he(t, h), f = J(G(s)), x = ae(f);
5384
5368
  let g = c[x], p = c[f];
5385
5369
  if (r) {
5386
- const w = x === "y" ? "top" : "left", m = x === "y" ? "bottom" : "right", b = g + d[w], y = g - d[m];
5387
- g = It(b, g, y);
5370
+ const w = x === "y" ? "top" : "left", m = x === "y" ? "bottom" : "right", C = g + d[w], y = g - d[m];
5371
+ g = It(C, g, y);
5388
5372
  }
5389
5373
  if (o) {
5390
- const w = f === "y" ? "top" : "left", m = f === "y" ? "bottom" : "right", b = p + d[w], y = p - d[m];
5391
- p = It(b, p, y);
5374
+ const w = f === "y" ? "top" : "left", m = f === "y" ? "bottom" : "right", C = p + d[w], y = p - d[m];
5375
+ p = It(C, p, y);
5392
5376
  }
5393
5377
  const u = n.fn({
5394
5378
  ...t,
@@ -5568,8 +5552,8 @@ function ot(l, t, e, i) {
5568
5552
  const x = X(r), g = i && B(i) ? X(i) : i;
5569
5553
  let p = x, u = St(p);
5570
5554
  for (; u && i && g !== p; ) {
5571
- const w = Z(u), m = u.getBoundingClientRect(), b = F(u), y = m.left + (u.clientLeft + parseFloat(b.paddingLeft)) * w.x, C = m.top + (u.clientTop + parseFloat(b.paddingTop)) * w.y;
5572
- h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += C, p = X(u), u = St(p);
5555
+ const w = Z(u), m = u.getBoundingClientRect(), C = F(u), y = m.left + (u.clientLeft + parseFloat(C.paddingLeft)) * w.x, b = m.top + (u.clientTop + parseFloat(C.paddingTop)) * w.y;
5556
+ h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b, p = X(u), u = St(p);
5573
5557
  }
5574
5558
  }
5575
5559
  return ut({