e-virt-table 1.3.6 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +359 -341
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Autofill.js +11 -7
- package/dist/lib/Autofill.js.map +1 -1
- package/dist/lib/Config.d.ts +6 -0
- package/dist/lib/Config.js +21 -0
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Context.d.ts +1 -0
- package/dist/lib/Context.js +6 -0
- package/dist/lib/Context.js.map +1 -1
- package/dist/lib/Database.d.ts +5 -0
- package/dist/lib/Database.js +39 -1
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/EVirtTable.d.ts +1 -0
- package/dist/lib/EVirtTable.js +3 -0
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/Editor.js +16 -12
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/EventBrowser.js +0 -1
- package/dist/lib/EventBrowser.js.map +1 -1
- package/dist/lib/EventTable.js +3 -2
- package/dist/lib/EventTable.js.map +1 -1
- package/dist/lib/Selector.js +2 -2
- package/dist/lib/Selector.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -24,10 +24,10 @@ class fe {
|
|
|
24
24
|
rowKey: r,
|
|
25
25
|
...x
|
|
26
26
|
};
|
|
27
|
-
x.validator(u, c, (
|
|
28
|
-
|
|
27
|
+
x.validator(u, c, (g) => {
|
|
28
|
+
g && e.push({
|
|
29
29
|
...u,
|
|
30
|
-
message:
|
|
30
|
+
message: g
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
}
|
|
@@ -531,7 +531,7 @@ class bt extends jt {
|
|
|
531
531
|
return;
|
|
532
532
|
const l = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: d = !1, expandLoading: f = !1, level: x = 0 } = l || {};
|
|
533
533
|
this.rowExpand = c, this.rowHasChildren = d;
|
|
534
|
-
const { TREE_INDENT: u = 16, CHECKBOX_SIZE:
|
|
534
|
+
const { TREE_INDENT: u = 16, CHECKBOX_SIZE: g, TREE_ICON_SIZE: m } = this.ctx.config;
|
|
535
535
|
if (r = x * u, f) {
|
|
536
536
|
const v = this.ctx.icons.get("loading");
|
|
537
537
|
a = "loading", o = v;
|
|
@@ -539,10 +539,10 @@ class bt extends jt {
|
|
|
539
539
|
const v = this.ctx.icons.get("expand"), _ = this.ctx.icons.get("shrink");
|
|
540
540
|
o = c ? _ : v, a = c ? "shrink" : "expand";
|
|
541
541
|
}
|
|
542
|
-
let
|
|
543
|
-
(this.align === "center" || this.align === "right") && (p = this.drawX + (this.visibleWidth -
|
|
544
|
-
let C = p + r + e, b = this.drawY + (this.visibleHeight - E) / 2, y = r + this.drawX +
|
|
545
|
-
this.type === "selection-tree" ? (C = r + this.drawSelectionImageX + this.drawSelectionImageWidth, y = C +
|
|
542
|
+
let w = m, E = m, p = this.drawX;
|
|
543
|
+
(this.align === "center" || this.align === "right") && (p = this.drawX + (this.visibleWidth - w - 2 * e) / 2, this.align = "left");
|
|
544
|
+
let C = p + r + e, b = this.drawY + (this.visibleHeight - E) / 2, y = r + this.drawX + w - 0.5;
|
|
545
|
+
this.type === "selection-tree" ? (C = r + this.drawSelectionImageX + this.drawSelectionImageWidth, y = C + w - e / 2) : this.type === "tree-selection" ? y = C + g + w - e / 2 : y = C + w - e / 2, this.drawTextX = y, this.drawTextWidth = this.drawX + this.visibleWidth - y, !(C + w + e > this.drawX + this.visibleWidth) && (b + E + e > this.drawY + this.visibleHeight || (this.drawTreeImageX = C, this.drawTreeImageY = b, this.drawTreeImageWidth = w, this.drawTreeImageHeight = E, o ? (this.drawTreeImageName = a, this.drawTreeImageSource = o) : (this.drawTreeImageName = "", this.drawTreeImageSource = void 0)));
|
|
546
546
|
}
|
|
547
547
|
drawTreeLine() {
|
|
548
548
|
const { TREE_LINE: e, TREE_INDENT: i = 16, TREE_ICON_SIZE: s = 16, TREE_LINE_COLOR: o = "#e1e6eb" } = this.ctx.config;
|
|
@@ -551,10 +551,10 @@ class bt extends jt {
|
|
|
551
551
|
let d = this.drawTreeImageX - a * i;
|
|
552
552
|
const f = Array.isArray(r.parentRowKeys) ? r.parentRowKeys : [];
|
|
553
553
|
if (a > 0) {
|
|
554
|
-
for (let
|
|
555
|
-
const E = f[
|
|
554
|
+
for (let w = 0; w < a - 1; w += 1) {
|
|
555
|
+
const E = f[w + 1];
|
|
556
556
|
if (!!(E ? this.ctx.database.getRowForRowKey(E) || {} : {}).isLastChild) continue;
|
|
557
|
-
const b = Math.round(this.drawTreeImageX - (a -
|
|
557
|
+
const b = Math.round(this.drawTreeImageX - (a - w) * i + s / 2);
|
|
558
558
|
this.ctx.paint.drawLine([b, this.drawY, b, this.drawY + this.visibleHeight], {
|
|
559
559
|
borderColor: o,
|
|
560
560
|
borderWidth: 1,
|
|
@@ -562,8 +562,8 @@ class bt extends jt {
|
|
|
562
562
|
lineDashOffset: 0
|
|
563
563
|
});
|
|
564
564
|
}
|
|
565
|
-
const x = Math.round(this.drawTreeImageX - i + s / 2),
|
|
566
|
-
this.ctx.paint.drawLine([x, this.drawY, x,
|
|
565
|
+
const x = Math.round(this.drawTreeImageX - i + s / 2), g = !!r.isLastChild ? c : this.drawY + this.visibleHeight;
|
|
566
|
+
this.ctx.paint.drawLine([x, this.drawY, x, g], {
|
|
567
567
|
borderColor: o,
|
|
568
568
|
borderWidth: 1,
|
|
569
569
|
lineDash: [4, 4],
|
|
@@ -601,35 +601,35 @@ class bt extends jt {
|
|
|
601
601
|
HIGHLIGHT_SELECTED_ROW_COLOR: f,
|
|
602
602
|
HIGHLIGHT_HOVER_ROW: x,
|
|
603
603
|
HIGHLIGHT_HOVER_ROW_COLOR: u,
|
|
604
|
-
STRIPE:
|
|
604
|
+
STRIPE: g,
|
|
605
605
|
STRIPE_COLOR: m
|
|
606
606
|
} = this.ctx.config;
|
|
607
607
|
if (this.cellType === "footer") {
|
|
608
608
|
let _ = c, S = l;
|
|
609
609
|
if (typeof o == "function") {
|
|
610
|
-
const
|
|
610
|
+
const R = o, { backgroundColor: I, color: T, font: O } = R({
|
|
611
611
|
row: this.row,
|
|
612
612
|
rowIndex: this.rowIndex,
|
|
613
613
|
colIndex: this.colIndex,
|
|
614
614
|
column: this.column,
|
|
615
615
|
value: this.getValue()
|
|
616
616
|
}) || {};
|
|
617
|
-
|
|
617
|
+
I && (_ = I), T && (S = T), O && (this.drawTextFont = O);
|
|
618
618
|
}
|
|
619
619
|
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = _, this.drawTextColor = S;
|
|
620
620
|
return;
|
|
621
621
|
}
|
|
622
|
-
let
|
|
622
|
+
let w = "transparent";
|
|
623
623
|
const E = this.ctx.hoverCell, p = this.ctx.currentCell;
|
|
624
624
|
let C = this.rowIndex, b = this.rowIndex;
|
|
625
625
|
if (this.rowspan !== 1 && (x || d)) {
|
|
626
626
|
const _ = this.getSpanInfo(), { yArr: S } = _;
|
|
627
627
|
C = S[0], b = S[1];
|
|
628
628
|
}
|
|
629
|
-
x && E && (E.rowKey === this.rowKey && (
|
|
629
|
+
x && E && (E.rowKey === this.rowKey && (w = u), E.rowIndex >= C && E.rowIndex <= b && (w = u)), d && p && (p.rowKey === this.rowKey && (w = f), p.rowIndex >= C && p.rowIndex <= b && (w = f)), this.drawCellSkyBgColor = w;
|
|
630
630
|
let y = e, v = a;
|
|
631
|
-
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (y = i, v = r),
|
|
632
|
-
const _ = s, { backgroundColor: S, color:
|
|
631
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (y = i, v = r), g && (this.rowIndex % 2 ? y = m : y = e), typeof s == "function") {
|
|
632
|
+
const _ = s, { backgroundColor: S, color: R, font: I } = _({
|
|
633
633
|
row: this.row,
|
|
634
634
|
rowIndex: this.rowIndex,
|
|
635
635
|
colIndex: this.colIndex,
|
|
@@ -637,7 +637,7 @@ class bt extends jt {
|
|
|
637
637
|
isHasChanged: this.isHasChanged,
|
|
638
638
|
value: this.getValue()
|
|
639
639
|
}) || {};
|
|
640
|
-
S && (y = S),
|
|
640
|
+
S && (y = S), R && (v = R), I && (this.drawTextFont = I);
|
|
641
641
|
}
|
|
642
642
|
this.drawCellBgColor = y, this.drawTextColor = v;
|
|
643
643
|
}
|
|
@@ -648,22 +648,22 @@ class bt extends jt {
|
|
|
648
648
|
const d = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: f = 0, CELL_PADDING: x } = this.ctx.config;
|
|
649
649
|
let u = this.drawX + x;
|
|
650
650
|
(this.align === "center" || this.align === "right") && (u = this.drawX + (e - f) / 2);
|
|
651
|
-
let
|
|
651
|
+
let g = u, m = this.drawY + (i - f) / 2;
|
|
652
652
|
if (a !== "selection-tree") {
|
|
653
653
|
if (a === "tree-selection") {
|
|
654
654
|
const { TREE_INDENT: p = 16, TREE_ICON_SIZE: C } = this.ctx.config, b = this.ctx.database.getRowForRowKey(c), { level: y = 0 } = b || {}, v = y * p;
|
|
655
|
-
|
|
655
|
+
g = u + C + v;
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
|
-
let
|
|
658
|
+
let w = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck";
|
|
659
659
|
if (a === "selection-tree" || a === "tree-selection") {
|
|
660
660
|
const p = this.ctx.database.getTreeSelectionState(c);
|
|
661
|
-
p.indeterminate && d ? (
|
|
661
|
+
p.indeterminate && d ? (w = this.ctx.icons.get("checkbox-indeterminate"), E = "checkbox-indeterminate") : p.checked && d ? (w = this.ctx.icons.get("checkbox-check"), E = "checkbox-check") : !p.checked && d ? (w = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), E = "checkbox-disabled");
|
|
662
662
|
} else {
|
|
663
663
|
const p = this.ctx.database.getRowSelection(c);
|
|
664
|
-
p && d ? (
|
|
664
|
+
p && d ? (w = this.ctx.icons.get("checkbox-check"), E = "checkbox-check") : p && !d ? (w = this.ctx.icons.get("checkbox-check-disabled"), E = "checkbox-check-disabled") : !p && d ? (w = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), E = "checkbox-disabled");
|
|
665
665
|
}
|
|
666
|
-
|
|
666
|
+
g + f + x > this.drawX + this.visibleWidth || m + f + x > this.drawY + this.visibleHeight || (a === "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(E)) && (this.drawSelectionImageX = g, this.drawSelectionImageY = m, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = E, this.drawSelectionImageSource = w) : (this.drawSelectionImageX = g, this.drawSelectionImageY = m, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = E, this.drawSelectionImageSource = w));
|
|
667
667
|
}
|
|
668
668
|
updateHoverIcon() {
|
|
669
669
|
if (this.ctx.database.getReadonly(this.rowKey, this.key))
|
|
@@ -683,10 +683,10 @@ class bt extends jt {
|
|
|
683
683
|
if (this.hoverIconName && !this.ctx.editing && a) {
|
|
684
684
|
let l = 0, c = 0;
|
|
685
685
|
if (a.rowKey === this.rowKey && (l = this.drawX + this.width - s - o, c = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && r) {
|
|
686
|
-
const f = this.getSpanInfo(), { yArr: x } = f, u = x[0],
|
|
687
|
-
if (a.rowIndex >= u && a.rowIndex <=
|
|
688
|
-
const { width: m, height:
|
|
689
|
-
l = this.drawX - p + m - s - o, c = this.drawY - E + (
|
|
686
|
+
const f = this.getSpanInfo(), { yArr: x } = f, u = x[0], g = x[1];
|
|
687
|
+
if (a.rowIndex >= u && a.rowIndex <= g) {
|
|
688
|
+
const { width: m, height: w, offsetTop: E, offsetLeft: p } = f;
|
|
689
|
+
l = this.drawX - p + m - s - o, c = this.drawY - E + (w - s) / 2;
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
692
|
const d = this.ctx.icons.get(this.hoverIconName);
|
|
@@ -959,13 +959,13 @@ class bt extends jt {
|
|
|
959
959
|
drawBorder(e) {
|
|
960
960
|
const { drawX: i, drawY: s, rowIndex: o, colIndex: r, height: a, width: l } = this;
|
|
961
961
|
let c = i, d = s;
|
|
962
|
-
const { xArr: f, yArr: x, lineDash: u = [], borderWidth:
|
|
962
|
+
const { xArr: f, yArr: x, lineDash: u = [], borderWidth: g = 1, borderColor: m, fillColor: w } = e, E = f[0], p = f[1], C = x[0], b = x[1];
|
|
963
963
|
if (r >= E && r <= p && o === C) {
|
|
964
964
|
const y = r === p ? 1 : 0, v = r === E ? 1 : 0;
|
|
965
965
|
this.ctx.paint.drawLine([c + v, d + 1, c + l - y, d + 1], {
|
|
966
966
|
borderColor: m,
|
|
967
|
-
fillColor:
|
|
968
|
-
borderWidth:
|
|
967
|
+
fillColor: w,
|
|
968
|
+
borderWidth: g,
|
|
969
969
|
lineCap: "round",
|
|
970
970
|
lineJoin: "round",
|
|
971
971
|
lineDash: u
|
|
@@ -975,8 +975,8 @@ class bt extends jt {
|
|
|
975
975
|
const y = o === C ? 1 : 0, v = o === b ? 1 : 0;
|
|
976
976
|
this.ctx.paint.drawLine([c + l - 1, d + y, c + l - 1, d + a - v], {
|
|
977
977
|
borderColor: m,
|
|
978
|
-
fillColor:
|
|
979
|
-
borderWidth:
|
|
978
|
+
fillColor: w,
|
|
979
|
+
borderWidth: g,
|
|
980
980
|
lineCap: "round",
|
|
981
981
|
lineJoin: "round",
|
|
982
982
|
lineDash: u
|
|
@@ -986,8 +986,8 @@ class bt extends jt {
|
|
|
986
986
|
const y = r === p ? 1 : 0, v = r === E ? 1 : 0;
|
|
987
987
|
this.ctx.paint.drawLine([c + v, d + a - 1, c + l - y, d + a - 1], {
|
|
988
988
|
borderColor: m,
|
|
989
|
-
fillColor:
|
|
990
|
-
borderWidth:
|
|
989
|
+
fillColor: w,
|
|
990
|
+
borderWidth: g,
|
|
991
991
|
lineCap: "round",
|
|
992
992
|
lineJoin: "round",
|
|
993
993
|
lineDash: u
|
|
@@ -997,8 +997,8 @@ class bt extends jt {
|
|
|
997
997
|
const y = o === b ? 1 : 0, v = o === C ? 1 : 0;
|
|
998
998
|
this.ctx.paint.drawLine([c + 1, d + v, c + 1, d + a - y], {
|
|
999
999
|
borderColor: m,
|
|
1000
|
-
fillColor:
|
|
1001
|
-
borderWidth:
|
|
1000
|
+
fillColor: w,
|
|
1001
|
+
borderWidth: g,
|
|
1002
1002
|
lineCap: "round",
|
|
1003
1003
|
lineJoin: "round",
|
|
1004
1004
|
lineDash: u
|
|
@@ -1032,6 +1032,8 @@ class ye {
|
|
|
1032
1032
|
resizableData: {}
|
|
1033
1033
|
});
|
|
1034
1034
|
n(this, "overlayerAutoHeightMap", /* @__PURE__ */ new Map());
|
|
1035
|
+
n(this, "maxRowHeightMap", /* @__PURE__ */ new Map());
|
|
1036
|
+
// 记录每行的最大渲染高度(按 rowKey 存储)
|
|
1035
1037
|
n(this, "bufferCheckState", {
|
|
1036
1038
|
buffer: !1,
|
|
1037
1039
|
check: !1,
|
|
@@ -1049,7 +1051,7 @@ class ye {
|
|
|
1049
1051
|
}
|
|
1050
1052
|
// 初始化默认不忽略清空改变值和校验map
|
|
1051
1053
|
init(t = !0) {
|
|
1052
|
-
this.ctx.paint.clearTextCache(), this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear();
|
|
1054
|
+
this.ctx.paint.clearTextCache(), this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear(), this.maxRowHeightMap.clear();
|
|
1053
1055
|
const e = this.getColumns(), i = Q(e);
|
|
1054
1056
|
if (this.ctx.hasSelection = i.some((s) => s.type === "selection"), this.ctx.hasTree = i.some((s) => s.type === "tree"), t) {
|
|
1055
1057
|
this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear();
|
|
@@ -1075,9 +1077,9 @@ class ye {
|
|
|
1075
1077
|
var p;
|
|
1076
1078
|
const { ROW_KEY: a = "", DEFAULT_EXPAND_ALL: l, CELL_HEIGHT: c, SELECTABLE_METHOD: d, CHECKBOX_KEY: f } = this.ctx.config, x = o[a], u = x != null ? `${x}` : zt();
|
|
1077
1079
|
this.itemRowKeyMap.set(o, u);
|
|
1078
|
-
const
|
|
1079
|
-
let
|
|
1080
|
-
if (typeof d == "function" && (
|
|
1080
|
+
const g = o._height || c, m = o._readonly;
|
|
1081
|
+
let w = !0;
|
|
1082
|
+
if (typeof d == "function" && (w = d), f) {
|
|
1081
1083
|
const C = o[f];
|
|
1082
1084
|
if (this.checkboxKeyMap.has(C)) {
|
|
1083
1085
|
const b = this.checkboxKeyMap.get(C) || [];
|
|
@@ -1096,10 +1098,10 @@ class ye {
|
|
|
1096
1098
|
index: r,
|
|
1097
1099
|
rowIndex: r,
|
|
1098
1100
|
level: e,
|
|
1099
|
-
height:
|
|
1101
|
+
height: g,
|
|
1100
1102
|
calculatedHeight: -1,
|
|
1101
1103
|
check: !1,
|
|
1102
|
-
selectable:
|
|
1104
|
+
selectable: w,
|
|
1103
1105
|
expand: E,
|
|
1104
1106
|
expandLazy: !1,
|
|
1105
1107
|
hasChildren: o._hasChildren || (Array.isArray(o.children) ? o.children.length > 0 : !1),
|
|
@@ -1139,10 +1141,19 @@ class ye {
|
|
|
1139
1141
|
const o = this.rowIndexRowKeyMap.get(i);
|
|
1140
1142
|
if (o) {
|
|
1141
1143
|
const r = this.rowKeyMap.get(o);
|
|
1142
|
-
r.calculatedHeight = s
|
|
1144
|
+
if (r.calculatedHeight = s, this.ctx.config.REMEMBER_MAX_ROW_HEIGHT) {
|
|
1145
|
+
const a = this.maxRowHeightMap.get(o) || r.height;
|
|
1146
|
+
s > a && this.maxRowHeightMap.set(o, s);
|
|
1147
|
+
}
|
|
1143
1148
|
}
|
|
1144
1149
|
}), this.clearBufferData(), this.getData(), this.ctx.emit("draw"));
|
|
1145
1150
|
}
|
|
1151
|
+
/**
|
|
1152
|
+
* 清除最大行高记录
|
|
1153
|
+
*/
|
|
1154
|
+
clearMaxRowHeight() {
|
|
1155
|
+
this.maxRowHeightMap.clear(), this.clearBufferData(), this.getData(), this.ctx.emit("draw");
|
|
1156
|
+
}
|
|
1146
1157
|
/**
|
|
1147
1158
|
* 获取所有行数据(平铺)
|
|
1148
1159
|
* @returns 获取转化平铺数据
|
|
@@ -1158,15 +1169,15 @@ class ye {
|
|
|
1158
1169
|
}
|
|
1159
1170
|
generateColumns(t) {
|
|
1160
1171
|
const e = (i) => i.map((s) => {
|
|
1161
|
-
var l, c, d, f, x, u,
|
|
1172
|
+
var l, c, d, f, x, u, g, m;
|
|
1162
1173
|
const o = s.children && Array.isArray(s.children) ? e(s.children) : void 0, r = {
|
|
1163
1174
|
hide: (c = (l = this.customHeader) == null ? void 0 : l.hideData) == null ? void 0 : c[s.key],
|
|
1164
1175
|
fixed: (f = (d = this.customHeader) == null ? void 0 : d.fixedData) == null ? void 0 : f[s.key],
|
|
1165
1176
|
sort: (u = (x = this.customHeader) == null ? void 0 : x.sortData) == null ? void 0 : u[s.key],
|
|
1166
|
-
width: (m = (
|
|
1177
|
+
width: (m = (g = this.customHeader) == null ? void 0 : g.resizableData) == null ? void 0 : m[s.key]
|
|
1167
1178
|
}, a = {};
|
|
1168
|
-
for (const [
|
|
1169
|
-
E !== void 0 && (a[
|
|
1179
|
+
for (const [w, E] of Object.entries(r))
|
|
1180
|
+
E !== void 0 && (a[w] = E);
|
|
1170
1181
|
return {
|
|
1171
1182
|
...s,
|
|
1172
1183
|
children: o,
|
|
@@ -1201,7 +1212,12 @@ class ye {
|
|
|
1201
1212
|
const i = (o) => {
|
|
1202
1213
|
o.forEach((r) => {
|
|
1203
1214
|
t.push(r);
|
|
1204
|
-
const a = this.itemRowKeyMap.get(r), { expand: l, hasChildren: c, height: d, calculatedHeight: f } = this.rowKeyMap.get(a), x = this.sumHeight
|
|
1215
|
+
const a = this.itemRowKeyMap.get(r), { expand: l, hasChildren: c, height: d, calculatedHeight: f } = this.rowKeyMap.get(a), x = this.sumHeight;
|
|
1216
|
+
let u = Math.max(f, d);
|
|
1217
|
+
if (this.ctx.config.REMEMBER_MAX_ROW_HEIGHT) {
|
|
1218
|
+
const g = this.maxRowHeightMap.get(a) || d;
|
|
1219
|
+
u > g ? (this.maxRowHeightMap.set(a, u), u = u) : u = g;
|
|
1220
|
+
}
|
|
1205
1221
|
this.sumHeight += u, this.rowIndexRowKeyMap.set(e, a), this.rowKeyRowIndexMap.set(a, e), this.positions.push({
|
|
1206
1222
|
top: x,
|
|
1207
1223
|
height: u,
|
|
@@ -1407,54 +1423,54 @@ class ye {
|
|
|
1407
1423
|
async batchSetItemValue(t, e = !1, i = !0, s = "none") {
|
|
1408
1424
|
let o = [], r = i;
|
|
1409
1425
|
const a = /* @__PURE__ */ new Set();
|
|
1410
|
-
let l = [], c = t.map((
|
|
1411
|
-
const { rowKey: m, key:
|
|
1412
|
-
let E =
|
|
1413
|
-
const C = this.getRowDataItemForRowKey(m), b = this.getItemValue(m,
|
|
1426
|
+
let l = [], c = t.map((g) => {
|
|
1427
|
+
const { rowKey: m, key: w } = g;
|
|
1428
|
+
let E = g.value, p = E;
|
|
1429
|
+
const C = this.getRowDataItemForRowKey(m), b = this.getItemValue(m, w), y = this.getVirtualBodyCellByKey(m, w);
|
|
1414
1430
|
return (y == null ? void 0 : y.type) === "number" && (["", void 0, null].includes(E) ? p = null : /^-?\d+(\.\d+)?$/.test(`${E}`) ? p = Number(E) : (p = b, l.push({
|
|
1415
|
-
...
|
|
1431
|
+
...g,
|
|
1416
1432
|
value: p,
|
|
1417
1433
|
oldValue: b,
|
|
1418
1434
|
row: C
|
|
1419
1435
|
}))), {
|
|
1420
|
-
...
|
|
1436
|
+
...g,
|
|
1421
1437
|
value: p,
|
|
1422
1438
|
oldValue: b,
|
|
1423
1439
|
row: C
|
|
1424
1440
|
};
|
|
1425
1441
|
});
|
|
1426
|
-
if (c = c.filter((
|
|
1427
|
-
const
|
|
1442
|
+
if (c = c.filter((g) => !l.some((m) => g.rowKey === m.rowKey && g.key === m.key)), l.length) {
|
|
1443
|
+
const g = {
|
|
1428
1444
|
code: "ERR_BATCH_SET_NUMBER_VALUE",
|
|
1429
1445
|
message: "Assignment failed, not a numeric type",
|
|
1430
1446
|
data: l
|
|
1431
1447
|
};
|
|
1432
|
-
this.ctx.emit("error",
|
|
1448
|
+
this.ctx.emit("error", g);
|
|
1433
1449
|
}
|
|
1434
|
-
if (c = c.filter((
|
|
1450
|
+
if (c = c.filter((g) => g.oldValue !== g.value), !c.length)
|
|
1435
1451
|
return;
|
|
1436
1452
|
const { BEFORE_VALUE_CHANGE_METHOD: d } = this.ctx.config;
|
|
1437
|
-
s === "none" && typeof d == "function" && (c = await d(c), r = !1), c.forEach((
|
|
1438
|
-
const { value: m, rowKey:
|
|
1439
|
-
a.add(
|
|
1440
|
-
rowKey:
|
|
1453
|
+
s === "none" && typeof d == "function" && (c = await d(c), r = !1), c.forEach((g) => {
|
|
1454
|
+
const { value: m, rowKey: w, key: E } = g, p = this.getItemValue(w, E);
|
|
1455
|
+
a.add(w), this.setItemValue(w, E, m, !1, !1, !1, r), o.push({
|
|
1456
|
+
rowKey: w,
|
|
1441
1457
|
key: E,
|
|
1442
1458
|
oldValue: p,
|
|
1443
1459
|
newValue: m
|
|
1444
1460
|
});
|
|
1445
1461
|
});
|
|
1446
1462
|
let f = [];
|
|
1447
|
-
a.forEach((
|
|
1448
|
-
f.push(this.ctx.database.getRowDataItemForRowKey(
|
|
1463
|
+
a.forEach((g) => {
|
|
1464
|
+
f.push(this.ctx.database.getRowDataItemForRowKey(g));
|
|
1449
1465
|
});
|
|
1450
|
-
const x = c.map(({ rowKey:
|
|
1466
|
+
const x = c.map(({ rowKey: g, key: m }) => this.getValidator(g, m));
|
|
1451
1467
|
Promise.all(x).then(() => {
|
|
1452
1468
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1453
1469
|
});
|
|
1454
|
-
const u = c.map((
|
|
1455
|
-
const m = !!this.getValidationError(
|
|
1470
|
+
const u = c.map((g) => {
|
|
1471
|
+
const m = !!this.getValidationError(g.rowKey, g.key).length;
|
|
1456
1472
|
return {
|
|
1457
|
-
...
|
|
1473
|
+
...g,
|
|
1458
1474
|
errorTip: m
|
|
1459
1475
|
};
|
|
1460
1476
|
});
|
|
@@ -1491,15 +1507,15 @@ class ye {
|
|
|
1491
1507
|
this.originalDataMap.has(f) || this.originalDataMap.set(f, c);
|
|
1492
1508
|
const x = this.originalDataMap.get(f), u = this.getRowDataItemForRowKey(t);
|
|
1493
1509
|
if (r) {
|
|
1494
|
-
const
|
|
1495
|
-
if ((
|
|
1510
|
+
const g = this.getVirtualBodyCellByKey(t, e);
|
|
1511
|
+
if ((g == null ? void 0 : g.type) === "number")
|
|
1496
1512
|
if (["", void 0, null].includes(i))
|
|
1497
1513
|
d = null;
|
|
1498
1514
|
else if (/^-?\d+(\.\d+)?$/.test(`${i}`))
|
|
1499
1515
|
d = Number(i);
|
|
1500
1516
|
else {
|
|
1501
1517
|
d = c;
|
|
1502
|
-
const
|
|
1518
|
+
const w = {
|
|
1503
1519
|
code: "ERR_SET_NUMBER_VALUE",
|
|
1504
1520
|
message: "Assignment failed, not a numeric type",
|
|
1505
1521
|
data: [
|
|
@@ -1512,7 +1528,7 @@ class ye {
|
|
|
1512
1528
|
}
|
|
1513
1529
|
]
|
|
1514
1530
|
};
|
|
1515
|
-
this.ctx.emit("error",
|
|
1531
|
+
this.ctx.emit("error", w);
|
|
1516
1532
|
}
|
|
1517
1533
|
if (d === c)
|
|
1518
1534
|
return {
|
|
@@ -1661,23 +1677,23 @@ class ye {
|
|
|
1661
1677
|
return { checked: s, indeterminate: !1 };
|
|
1662
1678
|
let r = !1, a = s;
|
|
1663
1679
|
if (this.ctx.config.TREE_SELECT_MODE === "auto") {
|
|
1664
|
-
const c = (
|
|
1665
|
-
const E = this.getTreeChildren(
|
|
1680
|
+
const c = (w) => {
|
|
1681
|
+
const E = this.getTreeChildren(w);
|
|
1666
1682
|
let p = [];
|
|
1667
1683
|
for (const C of E)
|
|
1668
1684
|
p.push(C), p.push(...c(C));
|
|
1669
1685
|
return p;
|
|
1670
|
-
}, f = c(t).map((
|
|
1671
|
-
r =
|
|
1686
|
+
}, f = c(t).map((w) => this.selectionMap.get(w)), x = f.filter((w) => w == null ? void 0 : w.check).length, u = f.length, g = x > 0;
|
|
1687
|
+
r = g && !(x === u), a = s || g, s && u > 0 && x === 0 && (a = !1, r = !1);
|
|
1672
1688
|
} else if (this.ctx.config.TREE_SELECT_MODE === "cautious") {
|
|
1673
|
-
const c = (
|
|
1674
|
-
const E = this.getTreeChildren(
|
|
1689
|
+
const c = (w) => {
|
|
1690
|
+
const E = this.getTreeChildren(w);
|
|
1675
1691
|
let p = [];
|
|
1676
1692
|
for (const C of E)
|
|
1677
1693
|
p.push(C), p.push(...c(C));
|
|
1678
1694
|
return p;
|
|
1679
|
-
}, f = c(t).map((
|
|
1680
|
-
r =
|
|
1695
|
+
}, f = c(t).map((w) => this.selectionMap.get(w)), x = f.filter((w) => w == null ? void 0 : w.check).length, u = f.length, g = x > 0, m = x === u;
|
|
1696
|
+
r = g && !m, a = s || m, s && u > 0 && x === 0 && (a = !1, r = !1);
|
|
1681
1697
|
} else this.ctx.config.TREE_SELECT_MODE === "strictly" && (r = !1, a = s);
|
|
1682
1698
|
return { checked: a, indeterminate: r };
|
|
1683
1699
|
}
|
|
@@ -1782,11 +1798,11 @@ class ye {
|
|
|
1782
1798
|
this.rowKeyMap.forEach((x, u) => {
|
|
1783
1799
|
var m;
|
|
1784
1800
|
(m = this.selectionMap.get(u)) != null && m.check && (s += 1);
|
|
1785
|
-
let
|
|
1786
|
-
typeof
|
|
1801
|
+
let g = x.selectable;
|
|
1802
|
+
typeof g == "function" && (g = g({
|
|
1787
1803
|
row: x.item,
|
|
1788
1804
|
rowIndex: x.rowIndex
|
|
1789
|
-
})),
|
|
1805
|
+
})), g && (o += 1);
|
|
1790
1806
|
});
|
|
1791
1807
|
const l = r > i && s === 0 && a, c = o && o > s && s > 0 || l, d = o !== 0, f = !!o && o === s;
|
|
1792
1808
|
return this.bufferCheckState = {
|
|
@@ -1964,7 +1980,7 @@ class ye {
|
|
|
1964
1980
|
height: f,
|
|
1965
1981
|
width: x,
|
|
1966
1982
|
colspan: u,
|
|
1967
|
-
mergeRow:
|
|
1983
|
+
mergeRow: g,
|
|
1968
1984
|
mergeCol: m
|
|
1969
1985
|
} = t;
|
|
1970
1986
|
if (d === 1 && u === 1)
|
|
@@ -1986,41 +2002,41 @@ class ye {
|
|
|
1986
2002
|
}
|
|
1987
2003
|
]
|
|
1988
2004
|
};
|
|
1989
|
-
let
|
|
1990
|
-
if (d !== 1 &&
|
|
2005
|
+
let w = e, E = e, p = a, C = a, b = [], y = 0, v = 0, _ = 0, S = 0;
|
|
2006
|
+
if (d !== 1 && g) {
|
|
1991
2007
|
S = x;
|
|
1992
|
-
const
|
|
2008
|
+
const R = l.reduce((I, T) => {
|
|
1993
2009
|
const O = this.getItemValue(s, T) ?? "";
|
|
1994
|
-
return `${
|
|
2010
|
+
return `${I}${O}`;
|
|
1995
2011
|
}, "");
|
|
1996
|
-
for (let
|
|
1997
|
-
const T = this.rowIndexRowKeyMap.get(
|
|
2012
|
+
for (let I = e - 1; I >= 0; I--) {
|
|
2013
|
+
const T = this.rowIndexRowKeyMap.get(I) || "", O = l.reduce((M, L) => {
|
|
1998
2014
|
const A = this.getItemValue(T, L) ?? "";
|
|
1999
2015
|
return `${M}${A}`;
|
|
2000
2016
|
}, "");
|
|
2001
|
-
if (
|
|
2002
|
-
|
|
2017
|
+
if (R === O)
|
|
2018
|
+
w = I;
|
|
2003
2019
|
else
|
|
2004
2020
|
break;
|
|
2005
2021
|
}
|
|
2006
|
-
for (let
|
|
2007
|
-
const T = this.rowIndexRowKeyMap.get(
|
|
2022
|
+
for (let I = e; I <= this.ctx.maxRowIndex; I++) {
|
|
2023
|
+
const T = this.rowIndexRowKeyMap.get(I) || "", O = l.reduce((M, L) => {
|
|
2008
2024
|
const A = this.getItemValue(T, L) ?? "";
|
|
2009
2025
|
return `${M}${A}`;
|
|
2010
2026
|
}, "");
|
|
2011
|
-
if (
|
|
2012
|
-
E =
|
|
2027
|
+
if (R === O)
|
|
2028
|
+
E = I;
|
|
2013
2029
|
else
|
|
2014
2030
|
break;
|
|
2015
2031
|
}
|
|
2016
|
-
for (let
|
|
2017
|
-
const { height: T } = this.positions[
|
|
2032
|
+
for (let I = w; I < e; I++) {
|
|
2033
|
+
const { height: T } = this.positions[I];
|
|
2018
2034
|
y += T;
|
|
2019
2035
|
}
|
|
2020
|
-
for (let
|
|
2021
|
-
const { height: T } = this.positions[
|
|
2036
|
+
for (let I = w; I <= E; I++) {
|
|
2037
|
+
const { height: T } = this.positions[I];
|
|
2022
2038
|
_ += T;
|
|
2023
|
-
const O = this.rowIndexRowKeyMap.get(
|
|
2039
|
+
const O = this.rowIndexRowKeyMap.get(I) || "", { item: M } = this.rowKeyMap.get(O), L = this.getItemValue(O, i);
|
|
2024
2040
|
b.push({
|
|
2025
2041
|
rowKey: O,
|
|
2026
2042
|
key: i,
|
|
@@ -2031,47 +2047,47 @@ class ye {
|
|
|
2031
2047
|
}
|
|
2032
2048
|
if (u !== 1 && m) {
|
|
2033
2049
|
_ = f;
|
|
2034
|
-
for (let
|
|
2035
|
-
const
|
|
2036
|
-
if (!
|
|
2050
|
+
for (let R = a - 1; R >= 0; R--) {
|
|
2051
|
+
const I = this.getColumnByColIndex(R);
|
|
2052
|
+
if (!I)
|
|
2037
2053
|
break;
|
|
2038
|
-
const T = this.getItemValue(s, i), O = this.getItemValue(s,
|
|
2039
|
-
if (T === O && c.includes(
|
|
2040
|
-
p =
|
|
2054
|
+
const T = this.getItemValue(s, i), O = this.getItemValue(s, I.key);
|
|
2055
|
+
if (T === O && c.includes(I.key))
|
|
2056
|
+
p = R;
|
|
2041
2057
|
else
|
|
2042
2058
|
break;
|
|
2043
2059
|
}
|
|
2044
|
-
for (let
|
|
2045
|
-
const
|
|
2046
|
-
if (!
|
|
2060
|
+
for (let R = a; R <= this.ctx.maxColIndex; R++) {
|
|
2061
|
+
const I = this.getColumnByColIndex(R);
|
|
2062
|
+
if (!I)
|
|
2047
2063
|
break;
|
|
2048
|
-
const T = this.getItemValue(s, i), O = this.getItemValue(s,
|
|
2049
|
-
if (T === O && c.includes(
|
|
2050
|
-
C =
|
|
2064
|
+
const T = this.getItemValue(s, i), O = this.getItemValue(s, I.key);
|
|
2065
|
+
if (T === O && c.includes(I.key))
|
|
2066
|
+
C = R;
|
|
2051
2067
|
else
|
|
2052
2068
|
break;
|
|
2053
2069
|
}
|
|
2054
|
-
for (let
|
|
2055
|
-
const
|
|
2056
|
-
if (!
|
|
2070
|
+
for (let R = p; R < a; R++) {
|
|
2071
|
+
const I = this.getColumnByColIndex(R);
|
|
2072
|
+
if (!I)
|
|
2057
2073
|
break;
|
|
2058
|
-
v +=
|
|
2074
|
+
v += I.width || 100;
|
|
2059
2075
|
}
|
|
2060
|
-
for (let
|
|
2061
|
-
const
|
|
2062
|
-
if (!
|
|
2076
|
+
for (let R = p; R <= C; R++) {
|
|
2077
|
+
const I = this.getColumnByColIndex(R);
|
|
2078
|
+
if (!I)
|
|
2063
2079
|
break;
|
|
2064
|
-
S +=
|
|
2080
|
+
S += I.width || 100, b.push({
|
|
2065
2081
|
rowKey: s,
|
|
2066
|
-
key:
|
|
2067
|
-
value: this.getItemValue(s,
|
|
2082
|
+
key: I.key,
|
|
2083
|
+
value: this.getItemValue(s, I.key),
|
|
2068
2084
|
row: o
|
|
2069
2085
|
});
|
|
2070
2086
|
}
|
|
2071
2087
|
}
|
|
2072
2088
|
return {
|
|
2073
2089
|
xArr: [p, C],
|
|
2074
|
-
yArr: [
|
|
2090
|
+
yArr: [w, E],
|
|
2075
2091
|
rowspan: d,
|
|
2076
2092
|
colspan: u,
|
|
2077
2093
|
height: _,
|
|
@@ -2269,7 +2285,7 @@ class be {
|
|
|
2269
2285
|
this.history = [], this.historyIndex = -1;
|
|
2270
2286
|
}
|
|
2271
2287
|
}
|
|
2272
|
-
class
|
|
2288
|
+
class Re {
|
|
2273
2289
|
constructor(t) {
|
|
2274
2290
|
n(this, "eventTasks", /* @__PURE__ */ new Set());
|
|
2275
2291
|
n(this, "ctx");
|
|
@@ -2296,7 +2312,7 @@ class Ie {
|
|
|
2296
2312
|
this.ctx.emit("resetHeader", t), this.ctx.emit("resize", t);
|
|
2297
2313
|
}
|
|
2298
2314
|
handleMouseDown(t) {
|
|
2299
|
-
this.clearDomSelection(), t.button === 0 && (this.ctx.mousedown = !0), this.ctx.
|
|
2315
|
+
this.clearDomSelection(), t.button === 0 && (this.ctx.mousedown = !0), this.ctx.emit("mousedown", t);
|
|
2300
2316
|
}
|
|
2301
2317
|
handleMousemove(t) {
|
|
2302
2318
|
const e = t, i = this.ctx.containerElement.getBoundingClientRect(), s = e.clientX - i.left, o = e.clientY - i.top;
|
|
@@ -2351,7 +2367,7 @@ class Ie {
|
|
|
2351
2367
|
}
|
|
2352
2368
|
}
|
|
2353
2369
|
}
|
|
2354
|
-
class
|
|
2370
|
+
class Ie {
|
|
2355
2371
|
constructor() {
|
|
2356
2372
|
n(this, "events", /* @__PURE__ */ new Map());
|
|
2357
2373
|
}
|
|
@@ -2485,7 +2501,7 @@ class ve {
|
|
|
2485
2501
|
* @returns 是否溢出
|
|
2486
2502
|
*/
|
|
2487
2503
|
drawText(t = "", e, i, s, o, r = {}) {
|
|
2488
|
-
var
|
|
2504
|
+
var I;
|
|
2489
2505
|
this.ctx.save();
|
|
2490
2506
|
const {
|
|
2491
2507
|
font: a = "12px Arial",
|
|
@@ -2495,12 +2511,12 @@ class ve {
|
|
|
2495
2511
|
verticalAlign: f = "middle",
|
|
2496
2512
|
maxLineClamp: x = 1,
|
|
2497
2513
|
autoRowHeight: u = !1,
|
|
2498
|
-
offsetLeft:
|
|
2514
|
+
offsetLeft: g = 0,
|
|
2499
2515
|
offsetRight: m = 0
|
|
2500
2516
|
} = r;
|
|
2501
2517
|
if (this.ctx.font = a, this.ctx.fillStyle = c, this.ctx.textAlign = l, ["", null, void 0].includes(t))
|
|
2502
2518
|
return this.ctx.restore(), !1;
|
|
2503
|
-
const E = parseInt(((
|
|
2519
|
+
const E = parseInt(((I = a.match(/\d+/)) == null ? void 0 : I[0]) || "12") * (r.lineHeight || 1.2), p = s - d * 2 - g - m;
|
|
2504
2520
|
let C = !1;
|
|
2505
2521
|
const b = Math.round((o - 2 * d) / E);
|
|
2506
2522
|
let y = this.wrapText(t, p, r.cacheTextKey), v = Math.min(y.length, Math.max(b, 1));
|
|
@@ -2508,23 +2524,23 @@ class ve {
|
|
|
2508
2524
|
let _ = i + d;
|
|
2509
2525
|
const S = Math.round(v * E);
|
|
2510
2526
|
f === "middle" ? _ = i + (o - S) / 2 : f === "bottom" && (_ = i + o - S - d);
|
|
2511
|
-
let
|
|
2512
|
-
l === "center" ?
|
|
2527
|
+
let R = e + d + g;
|
|
2528
|
+
l === "center" ? R = e + s / 2 : l === "right" && (R = e + s - d - m);
|
|
2513
2529
|
for (let T = 0; T < y.length; T++) {
|
|
2514
2530
|
const O = y[T], M = _ + T * E;
|
|
2515
2531
|
if (this.ctx.textBaseline = "top", T === v - 1) {
|
|
2516
2532
|
const A = y.slice(T).join(""), { _text: D, ellipsis: H } = this.handleEllipsis(A, s, d, a);
|
|
2517
|
-
this.ctx.fillText(D,
|
|
2533
|
+
this.ctx.fillText(D, R, M), C = H;
|
|
2518
2534
|
break;
|
|
2519
2535
|
}
|
|
2520
|
-
this.ctx.fillText(O,
|
|
2536
|
+
this.ctx.fillText(O, R, M);
|
|
2521
2537
|
}
|
|
2522
2538
|
if (r.textCallback && y.length) {
|
|
2523
2539
|
const T = y.reduce((D, H) => Math.max(D, this.ctx.measureText(H).width), 0), O = Math.round(T);
|
|
2524
|
-
let M =
|
|
2525
|
-
l === "center" ? (M =
|
|
2540
|
+
let M = R, L = R + O;
|
|
2541
|
+
l === "center" ? (M = R - O / 2, L = R + O / 2) : l === "right" && (M = R - O, L = R);
|
|
2526
2542
|
const A = {
|
|
2527
|
-
x:
|
|
2543
|
+
x: R,
|
|
2528
2544
|
y: _,
|
|
2529
2545
|
width: O,
|
|
2530
2546
|
height: S,
|
|
@@ -2584,8 +2600,8 @@ class ve {
|
|
|
2584
2600
|
} = i;
|
|
2585
2601
|
this.ctx.save(), this.ctx.font = s, this.ctx.fillStyle = a, this.ctx.textAlign = r;
|
|
2586
2602
|
const d = parseInt(((m = s.match(/\d+/)) == null ? void 0 : m[0]) || "12"), f = d * (i.lineHeight || 1.2), x = e - o * 2, u = this.wrapText(t, x, c);
|
|
2587
|
-
let
|
|
2588
|
-
return l === "auto" ?
|
|
2603
|
+
let g = 1;
|
|
2604
|
+
return l === "auto" ? g = u.length : u.length > l ? g = l : g = u.length, this.ctx.restore(), Math.max(Math.floor(g * f + o * 2), Math.floor(d + o * 2));
|
|
2589
2605
|
}
|
|
2590
2606
|
handleEllipsis(t, e, i = 0, s = "12px Arial") {
|
|
2591
2607
|
this.ctx.save();
|
|
@@ -2835,6 +2851,10 @@ class Dt {
|
|
|
2835
2851
|
n(this, "ENABLE_MERGE_CELL_LINK", !1);
|
|
2836
2852
|
/** 启用填充器 */
|
|
2837
2853
|
n(this, "ENABLE_AUTOFILL", !1);
|
|
2854
|
+
/** 启用选择器-批量跨列选择 */
|
|
2855
|
+
n(this, "ENABLE_AUTOFILL_SPAN_COL", !0);
|
|
2856
|
+
/** 启用选择器-批量跨行选择 */
|
|
2857
|
+
n(this, "ENABLE_AUTOFILL_SPAN_ROW", !0);
|
|
2838
2858
|
/** 启用body右键菜单 */
|
|
2839
2859
|
n(this, "ENABLE_CONTEXT_MENU", !1);
|
|
2840
2860
|
/** 启用表头右键菜单 */
|
|
@@ -2913,6 +2933,8 @@ class Dt {
|
|
|
2913
2933
|
n(this, "CELL_LINE_HEIGHT", 1.3);
|
|
2914
2934
|
/** 全局自动行高 */
|
|
2915
2935
|
n(this, "AUTO_ROW_HEIGHT", !1);
|
|
2936
|
+
/** 记录最大行高(开启后横向滚动不会导致行高变小) */
|
|
2937
|
+
n(this, "REMEMBER_MAX_ROW_HEIGHT", !1);
|
|
2916
2938
|
/** 启用拖拽表头 */
|
|
2917
2939
|
n(this, "ENABLE_DRAG_COLUMN", !1);
|
|
2918
2940
|
/** header 格子样式 */
|
|
@@ -2970,7 +2992,7 @@ class Dt {
|
|
|
2970
2992
|
}), Object.assign(this, t, this._config);
|
|
2971
2993
|
}
|
|
2972
2994
|
}
|
|
2973
|
-
const qt = '<svg t="1724122015492" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4237" width="32" height="32"><path d="M401.472 316.992l159.04 217.664L591.488 512l-30.976-22.656-159.04 217.728q-2.24 3.008-3.84 6.464-1.6 3.456-2.496 7.104-0.896 3.648-1.024 7.424-0.192 3.84 0.384 7.552 0.64 3.712 1.92 7.296 1.28 3.52 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992 3.072 2.24 6.464 3.84 3.456 1.6 7.168 2.496 3.648 0.896 7.424 1.024 3.776 0.192 7.488-0.448 3.776-0.576 7.296-1.856 3.584-1.28 6.784-3.264 3.2-1.92 6.016-4.48 2.816-2.56 5.056-5.632l159.04-217.728q3.584-4.928 5.504-10.752 1.92-5.76 1.92-11.904 0-6.08-1.92-11.904-1.92-5.76-5.504-10.752L463.488 271.68q-2.24-3.072-5.056-5.632-2.752-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.52-1.28-7.296-1.856-3.712-0.576-7.488-0.448-3.84 0.192-7.424 1.088-3.712 0.896-7.168 2.496-3.392 1.6-6.4 3.84-3.136 2.176-5.696 4.992-2.56 2.752-4.48 6.016-1.984 3.2-3.264 6.784-1.28 3.52-1.92 7.296-0.576 3.712-0.384 7.488 0.128 3.84 1.024 7.488 0.896 3.648 2.496 7.04 1.6 3.456 3.84 6.528z m30.976-61.056q-3.776 0-7.488 0.704-3.712 0.768-7.168 2.24-3.52 1.408-6.656 3.52-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.176 7.232-0.768 3.712-0.768 7.488 0 3.776 0.768 7.488 0.704 3.712 2.176 7.232 1.408 3.456 3.52 6.592 2.112 3.2 4.8 5.824 2.688 2.688 5.76 4.8 3.2 2.112 6.72 3.52 3.456 1.472 7.168 2.176 3.712 0.768 7.488 0.768 3.84 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.656 1.472-3.52 2.24-7.232 0.704-3.712 0.704-7.488 0-3.84-0.704-7.488-0.768-3.712-2.24-7.232-1.408-3.456-3.52-6.592-2.112-3.2-4.8-5.824-2.624-2.688-5.76-4.8-3.2-2.112-6.656-3.52-3.52-1.472-7.232-2.24Q436.224 256 432.448 256z m0 435.392q-3.776 0-7.488 0.704-3.712 0.768-7.168 2.176-3.52 1.472-6.656 3.584-3.2 2.112-5.824 4.736-2.688 2.688-4.8 5.824-2.112 3.2-3.52 6.656-1.472 3.52-2.176 7.232-0.768 3.712-0.768 7.488 0 3.776 0.768 7.488 0.704 3.712 2.176 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.76 2.688 2.752 5.76 4.8 3.2 2.112 6.72 3.584 3.456 1.472 7.168 2.176 3.712 0.768 7.488 0.768 3.84 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.472 6.592-3.584 3.2-2.048 5.824-4.736 2.688-2.688 4.8-5.824 2.112-3.2 3.52-6.656 1.472-3.456 2.24-7.168 0.704-3.712 0.704-7.488 0-3.84-0.704-7.488-0.768-3.712-2.24-7.232-1.408-3.52-3.52-6.656-2.112-3.136-4.8-5.76-2.624-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704z" p-id="4238"></path></svg>', Nt = '<svg t="1722595535853" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M640 128H384c-170.496 0-256 85.504-256 256v256c0 170.496 85.504 256 256 256h256c170.496 0 256-85.504 256-256V384c0-170.496-85.504-256-256-256z m67.584 302.592c-2.048 4.608-4.608 8.704-8.192 12.288L506.88 634.88c-3.584 3.584-7.68 6.144-12.288 8.192-4.608 2.048-9.728 3.072-14.848 3.072s-10.24-1.024-14.848-3.072c-4.608-2.048-8.704-4.608-12.288-8.192l-96.256-96.256c-3.584-3.584-6.144-7.68-8.192-12.288-2.048-4.608-3.072-9.728-3.072-14.848 0-2.56 0-5.12 1.024-7.68 0.512-2.56 1.024-5.12 2.048-7.168 1.024-2.56 2.048-4.608 3.584-6.656 1.536-2.048 3.072-4.096 4.608-5.632 1.536-2.048 3.584-3.584 5.632-4.608 2.048-1.536 4.096-2.56 6.656-3.584 2.56-1.024 4.608-1.536 7.168-2.048 2.56-0.512 5.12-0.512 7.68-0.512 5.12 0 10.24 1.024 14.848 3.072 4.608 2.048 8.704 4.608 12.288 8.192l69.12 68.608L645.12 389.12c3.584-3.584 7.68-6.144 12.288-8.192 4.608-2.048 9.728-3.072 14.848-3.072 2.56 0 5.12 0 7.68 0.512s5.12 1.024 7.168 2.048c2.56 1.024 4.608 2.048 6.656 3.584 2.048 1.536 4.096 3.072 5.632 4.608 1.536 1.536 3.584 3.584 4.608 5.632 1.536 2.048 2.56 4.096 3.584 6.656 1.024 2.56 1.536 4.608 2.048 7.168 0.512 2.56 1.024 5.12 1.024 7.68 0 5.12-1.024 10.24-3.072 14.848z" p-id="4552"></path></svg>', kt = '<svg t="1724122044148" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M707.648 401.28L489.28 560.704l22.656 30.976 22.656-30.976L316.16 401.216q-3.072-2.24-6.464-3.84-3.456-1.536-7.104-2.432-3.712-0.896-7.488-1.088-3.776-0.128-7.488 0.448-3.776 0.64-7.296 1.92-3.584 1.28-6.784 3.2-3.2 1.984-6.016 4.544-2.816 2.56-5.056 5.632-2.176 3.072-3.84 6.464-1.536 3.456-2.432 7.104-0.896 3.712-1.088 7.488-0.128 3.776 0.448 7.488 0.64 3.776 1.92 7.296 1.28 3.584 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992l218.368 159.552q4.928 3.584 10.752 5.504 5.76 1.92 11.904 1.92 6.08 0 11.904-1.92 5.76-1.92 10.752-5.504l218.368-159.552q3.008-2.24 5.568-4.992 2.56-2.816 4.544-6.016 1.92-3.2 3.264-6.784 1.28-3.52 1.92-7.296 0.576-3.712 0.384-7.488-0.128-3.84-1.024-7.488-0.896-3.648-2.496-7.04-1.6-3.456-3.84-6.528-2.24-3.072-4.992-5.632-2.816-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.584-1.28-7.296-1.856-3.712-0.64-7.488-0.448-3.84 0.192-7.488 1.088-3.648 0.896-7.04 2.496-3.456 1.536-6.528 3.84z m61.056 30.976q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.472-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.72-3.584-3.456-1.408-7.168-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.656 3.584-3.136 2.112-5.76 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.584 6.656-1.408 3.52-2.176 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.176 7.168 1.472 3.52 3.584 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.168-2.176 3.52-1.408 6.656-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.048-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z m-436.736 0q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.408-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.592 3.584-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.24 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.24 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z" p-id="4552"></path></svg>',
|
|
2995
|
+
const qt = '<svg t="1724122015492" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4237" width="32" height="32"><path d="M401.472 316.992l159.04 217.664L591.488 512l-30.976-22.656-159.04 217.728q-2.24 3.008-3.84 6.464-1.6 3.456-2.496 7.104-0.896 3.648-1.024 7.424-0.192 3.84 0.384 7.552 0.64 3.712 1.92 7.296 1.28 3.52 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992 3.072 2.24 6.464 3.84 3.456 1.6 7.168 2.496 3.648 0.896 7.424 1.024 3.776 0.192 7.488-0.448 3.776-0.576 7.296-1.856 3.584-1.28 6.784-3.264 3.2-1.92 6.016-4.48 2.816-2.56 5.056-5.632l159.04-217.728q3.584-4.928 5.504-10.752 1.92-5.76 1.92-11.904 0-6.08-1.92-11.904-1.92-5.76-5.504-10.752L463.488 271.68q-2.24-3.072-5.056-5.632-2.752-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.52-1.28-7.296-1.856-3.712-0.576-7.488-0.448-3.84 0.192-7.424 1.088-3.712 0.896-7.168 2.496-3.392 1.6-6.4 3.84-3.136 2.176-5.696 4.992-2.56 2.752-4.48 6.016-1.984 3.2-3.264 6.784-1.28 3.52-1.92 7.296-0.576 3.712-0.384 7.488 0.128 3.84 1.024 7.488 0.896 3.648 2.496 7.04 1.6 3.456 3.84 6.528z m30.976-61.056q-3.776 0-7.488 0.704-3.712 0.768-7.168 2.24-3.52 1.408-6.656 3.52-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.176 7.232-0.768 3.712-0.768 7.488 0 3.776 0.768 7.488 0.704 3.712 2.176 7.232 1.408 3.456 3.52 6.592 2.112 3.2 4.8 5.824 2.688 2.688 5.76 4.8 3.2 2.112 6.72 3.52 3.456 1.472 7.168 2.176 3.712 0.768 7.488 0.768 3.84 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.656 1.472-3.52 2.24-7.232 0.704-3.712 0.704-7.488 0-3.84-0.704-7.488-0.768-3.712-2.24-7.232-1.408-3.456-3.52-6.592-2.112-3.2-4.8-5.824-2.624-2.688-5.76-4.8-3.2-2.112-6.656-3.52-3.52-1.472-7.232-2.24Q436.224 256 432.448 256z m0 435.392q-3.776 0-7.488 0.704-3.712 0.768-7.168 2.176-3.52 1.472-6.656 3.584-3.2 2.112-5.824 4.736-2.688 2.688-4.8 5.824-2.112 3.2-3.52 6.656-1.472 3.52-2.176 7.232-0.768 3.712-0.768 7.488 0 3.776 0.768 7.488 0.704 3.712 2.176 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.76 2.688 2.752 5.76 4.8 3.2 2.112 6.72 3.584 3.456 1.472 7.168 2.176 3.712 0.768 7.488 0.768 3.84 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.472 6.592-3.584 3.2-2.048 5.824-4.736 2.688-2.688 4.8-5.824 2.112-3.2 3.52-6.656 1.472-3.456 2.24-7.168 0.704-3.712 0.704-7.488 0-3.84-0.704-7.488-0.768-3.712-2.24-7.232-1.408-3.52-3.52-6.656-2.112-3.136-4.8-5.76-2.624-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704z" p-id="4238"></path></svg>', Nt = '<svg t="1722595535853" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M640 128H384c-170.496 0-256 85.504-256 256v256c0 170.496 85.504 256 256 256h256c170.496 0 256-85.504 256-256V384c0-170.496-85.504-256-256-256z m67.584 302.592c-2.048 4.608-4.608 8.704-8.192 12.288L506.88 634.88c-3.584 3.584-7.68 6.144-12.288 8.192-4.608 2.048-9.728 3.072-14.848 3.072s-10.24-1.024-14.848-3.072c-4.608-2.048-8.704-4.608-12.288-8.192l-96.256-96.256c-3.584-3.584-6.144-7.68-8.192-12.288-2.048-4.608-3.072-9.728-3.072-14.848 0-2.56 0-5.12 1.024-7.68 0.512-2.56 1.024-5.12 2.048-7.168 1.024-2.56 2.048-4.608 3.584-6.656 1.536-2.048 3.072-4.096 4.608-5.632 1.536-2.048 3.584-3.584 5.632-4.608 2.048-1.536 4.096-2.56 6.656-3.584 2.56-1.024 4.608-1.536 7.168-2.048 2.56-0.512 5.12-0.512 7.68-0.512 5.12 0 10.24 1.024 14.848 3.072 4.608 2.048 8.704 4.608 12.288 8.192l69.12 68.608L645.12 389.12c3.584-3.584 7.68-6.144 12.288-8.192 4.608-2.048 9.728-3.072 14.848-3.072 2.56 0 5.12 0 7.68 0.512s5.12 1.024 7.168 2.048c2.56 1.024 4.608 2.048 6.656 3.584 2.048 1.536 4.096 3.072 5.632 4.608 1.536 1.536 3.584 3.584 4.608 5.632 1.536 2.048 2.56 4.096 3.584 6.656 1.024 2.56 1.536 4.608 2.048 7.168 0.512 2.56 1.024 5.12 1.024 7.68 0 5.12-1.024 10.24-3.072 14.848z" p-id="4552"></path></svg>', kt = '<svg t="1724122044148" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M707.648 401.28L489.28 560.704l22.656 30.976 22.656-30.976L316.16 401.216q-3.072-2.24-6.464-3.84-3.456-1.536-7.104-2.432-3.712-0.896-7.488-1.088-3.776-0.128-7.488 0.448-3.776 0.64-7.296 1.92-3.584 1.28-6.784 3.2-3.2 1.984-6.016 4.544-2.816 2.56-5.056 5.632-2.176 3.072-3.84 6.464-1.536 3.456-2.432 7.104-0.896 3.712-1.088 7.488-0.128 3.776 0.448 7.488 0.64 3.776 1.92 7.296 1.28 3.584 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992l218.368 159.552q4.928 3.584 10.752 5.504 5.76 1.92 11.904 1.92 6.08 0 11.904-1.92 5.76-1.92 10.752-5.504l218.368-159.552q3.008-2.24 5.568-4.992 2.56-2.816 4.544-6.016 1.92-3.2 3.264-6.784 1.28-3.52 1.92-7.296 0.576-3.712 0.384-7.488-0.128-3.84-1.024-7.488-0.896-3.648-2.496-7.04-1.6-3.456-3.84-6.528-2.24-3.072-4.992-5.632-2.816-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.584-1.28-7.296-1.856-3.712-0.64-7.488-0.448-3.84 0.192-7.488 1.088-3.648 0.896-7.04 2.496-3.456 1.536-6.528 3.84z m61.056 30.976q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.472-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.72-3.584-3.456-1.408-7.168-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.656 3.584-3.136 2.112-5.76 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.584 6.656-1.408 3.52-2.176 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.176 7.168 1.472 3.52 3.584 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.168-2.176 3.52-1.408 6.656-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.048-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z m-436.736 0q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.408-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.592 3.584-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.24 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.24 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z" p-id="4552"></path></svg>', Rt = '<svg t="1755138507987" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5079" width="200" height="200"><path d="M512 938.688a42.688 42.688 0 0 1-35.072-18.432l-192-277.312A42.56 42.56 0 0 1 320 576h384a42.752 42.752 0 0 1 35.072 66.944l-192 277.312a42.688 42.688 0 0 1-35.072 18.432" fill="currentColor" p-id="2016"></path><path d="M704 448H320a42.752 42.752 0 0 1-35.072-66.944l192-277.312c16-23.04 54.208-23.04 70.144 0l192 277.312A42.56 42.56 0 0 1 704 448" fill="currentColor" p-id="2015"></path></svg>', _e = Rt.replace('fill="currentColor" p-id="2016"', 'fill="#bec4c7" p-id="2016"'), Se = Rt.replace('fill="currentColor" p-id="2015"', 'fill="#bec4c7" p-id="2015"');
|
|
2974
2996
|
class Te {
|
|
2975
2997
|
constructor(t) {
|
|
2976
2998
|
n(this, "ctx");
|
|
@@ -3061,7 +3083,7 @@ class Te {
|
|
|
3061
3083
|
{
|
|
3062
3084
|
name: "sort-default",
|
|
3063
3085
|
configName: "SORTABLE_ICON_SVG",
|
|
3064
|
-
svg:
|
|
3086
|
+
svg: Rt,
|
|
3065
3087
|
color: "#bec4c7"
|
|
3066
3088
|
}
|
|
3067
3089
|
]);
|
|
@@ -3340,8 +3362,8 @@ class Oe {
|
|
|
3340
3362
|
this.ctx = t, this.init();
|
|
3341
3363
|
}
|
|
3342
3364
|
init() {
|
|
3343
|
-
this.resizeObserver = new ResizeObserver(() => {
|
|
3344
|
-
this.ctx.emit("resetHeader"), this.ctx.emit("resizeObserver");
|
|
3365
|
+
this.resizeObserver = new ResizeObserver((t) => {
|
|
3366
|
+
this.ctx.emit("resetHeader"), this.ctx.emit("resizeObserver", t), this.ctx.emit("containerResize", this.ctx.containerElement);
|
|
3345
3367
|
}), this.resizeObserver.observe(this.ctx.containerElement), this.mutationObserver = new MutationObserver((t) => {
|
|
3346
3368
|
for (const e of t)
|
|
3347
3369
|
e.type === "attributes" && e.attributeName === "class" && (this.ctx.config.updateCssVar(), this.ctx.emit("draw"));
|
|
@@ -3485,10 +3507,10 @@ class Oe {
|
|
|
3485
3507
|
colIndex: t.colIndex,
|
|
3486
3508
|
column: t.column,
|
|
3487
3509
|
value: t.getValue()
|
|
3488
|
-
}).then((
|
|
3489
|
-
this.ctx.database.setExpandChildren(t.rowKey,
|
|
3490
|
-
}).catch((
|
|
3491
|
-
this.ctx.database.expandLoading(t.rowKey, !1), console.error(
|
|
3510
|
+
}).then((g) => {
|
|
3511
|
+
this.ctx.database.setExpandChildren(t.rowKey, g), this.ctx.database.expandLoading(t.rowKey, !1), this.ctx.emit("expandChange", this.ctx.database.getExpandRowKeys());
|
|
3512
|
+
}).catch((g) => {
|
|
3513
|
+
this.ctx.database.expandLoading(t.rowKey, !1), console.error(g);
|
|
3492
3514
|
}));
|
|
3493
3515
|
else {
|
|
3494
3516
|
const u = this.ctx.database.getIsExpand(t.rowKey);
|
|
@@ -3673,6 +3695,8 @@ class Le {
|
|
|
3673
3695
|
// 自动填充移动中
|
|
3674
3696
|
n(this, "selectorMove", !1);
|
|
3675
3697
|
// 选择器移动中
|
|
3698
|
+
n(this, "disableHoverIconClick", !1);
|
|
3699
|
+
// 禁用hoverIconClick,防止填充选择器移动时,触发hoverIconClick
|
|
3676
3700
|
n(this, "selectColsIng", !1);
|
|
3677
3701
|
// 选择列中
|
|
3678
3702
|
n(this, "selectRowsIng", !1);
|
|
@@ -3776,7 +3800,7 @@ class Le {
|
|
|
3776
3800
|
loadingElement: c,
|
|
3777
3801
|
contextMenuElement: d
|
|
3778
3802
|
} = t;
|
|
3779
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = l, this.loadingElement = c, this.contextMenuElement = d, this.config = new Dt(e.config || {}), this.eventBus = new
|
|
3803
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = l, this.loadingElement = c, this.contextMenuElement = d, this.config = new Dt(e.config || {}), this.eventBus = new Ie(), this.eventBrowser = new Re(this), this.eventTable = new Oe(this), this.paint = new ve(this.canvasElement), this.database = new ye(this, e), this.history = new be(this), this.icons = new Te(this);
|
|
3780
3804
|
}
|
|
3781
3805
|
setConfig(t) {
|
|
3782
3806
|
this.config = new Dt(t);
|
|
@@ -4002,8 +4026,8 @@ class Xt {
|
|
|
4002
4026
|
} = this.ctx, l = s, c = i, d = e.height, f = e.width, x = t.height, u = this.ctx.footer.height;
|
|
4003
4027
|
if (this.type === "vertical") {
|
|
4004
4028
|
this.visibleDistance = c - o - d, this.distance = x - this.visibleDistance + u, this.trackX = l - o, this.trackY = 0, this.splitPoints = [this.trackX, d, this.trackX + o, d], this.trackWidth = o, this.trackHeight = c, this.barX = this.trackX - 1 + (o - r) / 2, this.barWidth = r;
|
|
4005
|
-
const
|
|
4006
|
-
let m = Math.floor(
|
|
4029
|
+
const g = this.distance ? this.visibleDistance / (x + u) : 0;
|
|
4030
|
+
let m = Math.floor(g * this.visibleDistance);
|
|
4007
4031
|
m < 30 ? m = 30 : m > this.visibleDistance && (m = 0), this.barHeight = m, this.barY = d + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
4008
4032
|
} else {
|
|
4009
4033
|
this.visibleDistance = l - o, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
@@ -4012,11 +4036,11 @@ class Xt {
|
|
|
4012
4036
|
l - o,
|
|
4013
4037
|
c
|
|
4014
4038
|
];
|
|
4015
|
-
const
|
|
4016
|
-
this.trackX = 0, this.trackY = c - o +
|
|
4039
|
+
const g = a ? 0 : 0.5;
|
|
4040
|
+
this.trackX = 0, this.trackY = c - o + g, this.trackWidth = l, this.trackHeight = o;
|
|
4017
4041
|
const m = this.distance ? this.visibleDistance / f : 0;
|
|
4018
|
-
let
|
|
4019
|
-
this.barY = this.trackY - 1 + (o - r) / 2,
|
|
4042
|
+
let w = Math.floor(m * this.visibleDistance);
|
|
4043
|
+
this.barY = this.trackY - 1 + (o - r) / 2, w < 30 ? w = 30 : w >= this.visibleDistance && (w = 0), this.barWidth = w, this.barHeight = r, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
4020
4044
|
}
|
|
4021
4045
|
}
|
|
4022
4046
|
draw() {
|
|
@@ -4245,8 +4269,8 @@ class He {
|
|
|
4245
4269
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [], this.visibleHeight = this.height, this.visibleColumns = $t(i);
|
|
4246
4270
|
const s = rt(this.visibleColumns), o = Q(this.visibleColumns);
|
|
4247
4271
|
this.height = t * s, this.width = o.reduce((f, x) => {
|
|
4248
|
-
const u = x.width || 100, { maxWidth:
|
|
4249
|
-
return
|
|
4272
|
+
const u = x.width || 100, { maxWidth: g, minWidth: m } = x;
|
|
4273
|
+
return g && u > g ? f + g : m && u < m ? f + m : f + u;
|
|
4250
4274
|
}, 0), this.columnIndex = 0, this.resizeNum = 0;
|
|
4251
4275
|
const r = ue(nt(this.visibleColumns, s));
|
|
4252
4276
|
this.render(r, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
@@ -4294,7 +4318,7 @@ class He {
|
|
|
4294
4318
|
const { offsetX: r, offsetY: a } = this.ctx.getOffset(t), l = r, c = a, d = o.getDrawX(), f = o.getDrawY();
|
|
4295
4319
|
if (l > d + o.width - 5 && l < d + o.width + 4 && l < e - 4 && // 视窗中最后一列不允许调整宽
|
|
4296
4320
|
c > f) {
|
|
4297
|
-
const x = o.colIndex + o.colspan - 1, u = this.leafCellHeaders.find((
|
|
4321
|
+
const x = o.colIndex + o.colspan - 1, u = this.leafCellHeaders.find((g) => g.colIndex === x);
|
|
4298
4322
|
if (!u || !u.fixed && this.ctx.stageWidth - this.ctx.fixedRightWidth < d + o.width)
|
|
4299
4323
|
return;
|
|
4300
4324
|
this.ctx.isTarget(t) && a <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = u);
|
|
@@ -4418,7 +4442,7 @@ class He {
|
|
|
4418
4442
|
for (let r = 0; r < i; r++) {
|
|
4419
4443
|
const a = t[r], l = o * (a.rowspan || 0), c = o * (a.level || 0);
|
|
4420
4444
|
let { minWidth: d, maxWidth: f } = a, x = a.width || 100;
|
|
4421
|
-
d && x < d && (x = d), f && x > f && (x = f), a.children && (x = Q(a.children).reduce((m,
|
|
4445
|
+
d && x < d && (x = d), f && x > f && (x = f), a.children && (x = Q(a.children).reduce((m, w) => m + ((w == null ? void 0 : w.width) || 100), 0));
|
|
4422
4446
|
const u = new mt(this.ctx, this.columnIndex, s, c, x, l, a);
|
|
4423
4447
|
this.ctx.database.setHeader(a.key, u), this.allCellHeaders.push(u), a.children || (this.leafCellHeaders.push(u), u.column.widthFillDisable || this.resizeNum++), a.fixed === "left" ? this.fixedLeftCellHeaders.push(u) : a.fixed === "right" ? this.fixedRightCellHeaders.push(u) : this.centerCellHeaders.push(u), !a.children && this.columnIndex++, a.children && this.render(a.children, s), s += x;
|
|
4424
4448
|
}
|
|
@@ -4646,18 +4670,18 @@ class De {
|
|
|
4646
4670
|
if (!e.width)
|
|
4647
4671
|
return;
|
|
4648
4672
|
this.x = 0, x === "top" && o ? this.y = e.height + i.height : this.y = e.height;
|
|
4649
|
-
const { data: u, sumHeight:
|
|
4650
|
-
this.height =
|
|
4673
|
+
const { data: u, sumHeight: g } = s.getData();
|
|
4674
|
+
this.height = g, this.data = u, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - r;
|
|
4651
4675
|
const m = this.ctx.footer.height;
|
|
4652
4676
|
this.ctx.isEmpty = !this.data.length, !this.data.length && !a ? this.height = l : !this.data.length && a && (this.height = a - e.height - m - r);
|
|
4653
|
-
let
|
|
4654
|
-
|
|
4655
|
-
let E =
|
|
4677
|
+
let w = this.height + e.height + r;
|
|
4678
|
+
w += m;
|
|
4679
|
+
let E = w;
|
|
4656
4680
|
const p = window.innerHeight, { top: C } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
4657
4681
|
if (p > C && d && !a) {
|
|
4658
4682
|
const O = p - C - f;
|
|
4659
|
-
O > e.height + r ? E = O :
|
|
4660
|
-
} else this.data.length && a ? E = a : this.data.length && c &&
|
|
4683
|
+
O > e.height + r ? E = O : w > c && (E = c);
|
|
4684
|
+
} else this.data.length && a ? E = a : this.data.length && c && w > c && (E = c);
|
|
4661
4685
|
E > 0 && (this.ctx.stageHeight = Math.floor(E), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
|
|
4662
4686
|
let b = this.ctx.stageHeight - e.height - r;
|
|
4663
4687
|
o ? this.visibleHeight = b - m : 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 = u;
|
|
@@ -4673,8 +4697,8 @@ class De {
|
|
|
4673
4697
|
width: this.width,
|
|
4674
4698
|
height: this.data.length ? 0 : l + m
|
|
4675
4699
|
});
|
|
4676
|
-
const
|
|
4677
|
-
this.ctx.canvasElement.setAttribute("style", `height:${
|
|
4700
|
+
const R = Math.round(t.width / y * 1e4) / 1e4, I = Math.round(t.height / y * 1e4) / 1e4;
|
|
4701
|
+
this.ctx.canvasElement.setAttribute("style", `height:${I}px;width:${R}px;`), this.ctx.paint.scale(y);
|
|
4678
4702
|
}
|
|
4679
4703
|
// 调整行的高度
|
|
4680
4704
|
initResizeRow() {
|
|
@@ -4714,8 +4738,8 @@ class De {
|
|
|
4714
4738
|
const f = this.renderRows[d];
|
|
4715
4739
|
if (s > f.y - l + f.height - 1.5 && s < f.y - l + f.height + 1.5 && s < a - 4)
|
|
4716
4740
|
for (let u = 0; u < f.cells.length; u++) {
|
|
4717
|
-
const
|
|
4718
|
-
o >
|
|
4741
|
+
const g = f.cells[u];
|
|
4742
|
+
o > g.drawX + 10 && o < g.drawX + g.width - 10 && g.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = f);
|
|
4719
4743
|
}
|
|
4720
4744
|
}
|
|
4721
4745
|
}
|
|
@@ -4798,8 +4822,8 @@ class De {
|
|
|
4798
4822
|
this.headIndex = Math.max(0, l), this.tailIndex = Math.min(this.ctx.maxRowIndex, c + 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;
|
|
4799
4823
|
const d = [];
|
|
4800
4824
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
4801
|
-
const x = this.headIndex + f, u = this.visibleRows[f], { height:
|
|
4802
|
-
d.push(
|
|
4825
|
+
const x = this.headIndex + f, u = this.visibleRows[f], { height: g, top: m } = this.ctx.database.getPositionForRowIndex(x), w = new Zt(this.ctx, x, 0, m + this.y, t.width, g, u);
|
|
4826
|
+
d.push(w);
|
|
4803
4827
|
}
|
|
4804
4828
|
this.renderRows = d, this.ctx.body.renderRows = d;
|
|
4805
4829
|
}
|
|
@@ -4944,7 +4968,7 @@ class ke {
|
|
|
4944
4968
|
}), this.ctx.on("mouseup", () => {
|
|
4945
4969
|
this.ctx.selectorMove = !1, this.ctx.stopAdjustPosition();
|
|
4946
4970
|
const t = setTimeout(() => {
|
|
4947
|
-
this.ctx.adjustPositioning = !1, clearTimeout(t);
|
|
4971
|
+
this.ctx.adjustPositioning = !1, this.ctx.disableHoverIconClick = !1, clearTimeout(t);
|
|
4948
4972
|
}, 0);
|
|
4949
4973
|
}), this.ctx.on("cellHeaderHoverChange", (t) => {
|
|
4950
4974
|
this.ctx.mousedown && this.selectCols(t);
|
|
@@ -5020,7 +5044,7 @@ class ke {
|
|
|
5020
5044
|
o = [a, a];
|
|
5021
5045
|
}
|
|
5022
5046
|
if (JSON.stringify(this.ctx.selector.xArr) !== JSON.stringify(o) || JSON.stringify(this.ctx.selector.yArr) !== JSON.stringify(r)) {
|
|
5023
|
-
this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0;
|
|
5047
|
+
this.ctx.mousedown && (this.ctx.selectorMove = !0, this.ctx.disableHoverIconClick = !0), this.ctx.selector.enable = !0;
|
|
5024
5048
|
const {
|
|
5025
5049
|
SELECTOR_AREA_MIN_X: a,
|
|
5026
5050
|
SELECTOR_AREA_MAX_X: l,
|
|
@@ -5028,15 +5052,15 @@ class ke {
|
|
|
5028
5052
|
SELECTOR_AREA_MAX_Y: d,
|
|
5029
5053
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
5030
5054
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
5031
|
-
} = this.ctx.config, u = a,
|
|
5055
|
+
} = this.ctx.config, u = a, g = l || this.ctx.maxColIndex - f, m = c, w = d || this.ctx.maxRowIndex - x;
|
|
5032
5056
|
let [E, p] = o, [C, b] = r;
|
|
5033
|
-
if (E < u || p >
|
|
5057
|
+
if (E < u || p > g || C < m || b > w)
|
|
5034
5058
|
return;
|
|
5035
|
-
if (this.ctx.
|
|
5059
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
5036
5060
|
const v = this.adjustMergeCells(o, r);
|
|
5037
5061
|
C = v.yArr[0], b = v.yArr[1], E = v.xArr[0], p = v.xArr[1], this.ctx.onlyMergeCell = v.onlyMergeCell;
|
|
5038
5062
|
}
|
|
5039
|
-
E === p && C === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, o = [Math.max(u, E), Math.min(
|
|
5063
|
+
E === p && C === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, o = [Math.max(u, E), Math.min(g, p)], r = [Math.max(m, C), Math.min(w, b)];
|
|
5040
5064
|
const { BEFORE_SET_SELECTOR_METHOD: y } = this.ctx.config;
|
|
5041
5065
|
if (typeof y == "function") {
|
|
5042
5066
|
const _ = y({
|
|
@@ -5052,7 +5076,7 @@ class ke {
|
|
|
5052
5076
|
}
|
|
5053
5077
|
}
|
|
5054
5078
|
adjustMergeCells(t, e) {
|
|
5055
|
-
var
|
|
5079
|
+
var g;
|
|
5056
5080
|
const [i, s] = e, [o, r] = t;
|
|
5057
5081
|
if (s === this.ctx.maxRowIndex && i === 0 || r === this.ctx.maxColIndex && o === 0)
|
|
5058
5082
|
return {
|
|
@@ -5062,13 +5086,13 @@ class ke {
|
|
|
5062
5086
|
};
|
|
5063
5087
|
let a = [], l = [];
|
|
5064
5088
|
for (let m = 0; m <= e[1] - e[0]; m++)
|
|
5065
|
-
for (let
|
|
5066
|
-
const E = m + e[0], p =
|
|
5089
|
+
for (let w = 0; w <= t[1] - t[0]; w++) {
|
|
5090
|
+
const E = m + e[0], p = w + t[0], C = this.ctx.database.getVirtualBodyCell(E, p);
|
|
5067
5091
|
C && ((E === i || E === s) && a.push(C), (p === o || p === r) && l.push(C));
|
|
5068
5092
|
}
|
|
5069
5093
|
const c = a.reduce(
|
|
5070
|
-
(m,
|
|
5071
|
-
const { yArr: E } =
|
|
5094
|
+
(m, w) => {
|
|
5095
|
+
const { yArr: E } = w.getSpanInfo(), [p, C] = E;
|
|
5072
5096
|
return m.minY = Math.min(m.minY, p), m.maxY = Math.max(m.maxY, C), m;
|
|
5073
5097
|
},
|
|
5074
5098
|
{
|
|
@@ -5076,8 +5100,8 @@ class ke {
|
|
|
5076
5100
|
maxY: s
|
|
5077
5101
|
}
|
|
5078
5102
|
), d = l.reduce(
|
|
5079
|
-
(m,
|
|
5080
|
-
const { xArr: E } =
|
|
5103
|
+
(m, w) => {
|
|
5104
|
+
const { xArr: E } = w.getSpanInfo(), [p, C] = E;
|
|
5081
5105
|
return m.minX = Math.min(m.minX, p), m.maxX = Math.max(m.maxX, C), m;
|
|
5082
5106
|
},
|
|
5083
5107
|
{
|
|
@@ -5087,8 +5111,8 @@ class ke {
|
|
|
5087
5111
|
), f = [d.minX, d.maxX], x = [c.minY, c.maxY];
|
|
5088
5112
|
let u = !1;
|
|
5089
5113
|
if (d.minX !== d.maxX || c.minY !== c.maxY) {
|
|
5090
|
-
const m = JSON.stringify(f) + JSON.stringify(x),
|
|
5091
|
-
u = (
|
|
5114
|
+
const m = JSON.stringify(f) + JSON.stringify(x), w = (g = this.ctx.focusCell) == null ? void 0 : g.getSpanInfo();
|
|
5115
|
+
u = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) === m;
|
|
5092
5116
|
}
|
|
5093
5117
|
return {
|
|
5094
5118
|
xArr: f,
|
|
@@ -5123,8 +5147,8 @@ class ke {
|
|
|
5123
5147
|
SELECTOR_AREA_MAX_Y: r,
|
|
5124
5148
|
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
5125
5149
|
SELECTOR_AREA_MAX_Y_OFFSET: l
|
|
5126
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - a, f = o, x = r || this.ctx.maxRowIndex - l, u = [c, d],
|
|
5127
|
-
this.setSelector(u,
|
|
5150
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - a, f = o, x = r || this.ctx.maxRowIndex - l, u = [c, d], g = [f, x];
|
|
5151
|
+
this.setSelector(u, g);
|
|
5128
5152
|
}
|
|
5129
5153
|
}
|
|
5130
5154
|
selectRows(t, e = !0) {
|
|
@@ -5231,10 +5255,10 @@ class ke {
|
|
|
5231
5255
|
for (let c = 0; c <= t[1] - t[0]; c++) {
|
|
5232
5256
|
const d = l + e[0], f = c + t[0], x = this.ctx.database.getItemValueForRowIndexAndColIndex(d, f);
|
|
5233
5257
|
if (x) {
|
|
5234
|
-
const { rowKey: u, key:
|
|
5235
|
-
this.ctx.database.getReadonly(u,
|
|
5258
|
+
const { rowKey: u, key: g } = x;
|
|
5259
|
+
this.ctx.database.getReadonly(u, g) || (r.add(u), o.push({
|
|
5236
5260
|
rowKey: u,
|
|
5237
|
-
key:
|
|
5261
|
+
key: g,
|
|
5238
5262
|
value: s,
|
|
5239
5263
|
row: {}
|
|
5240
5264
|
//内部有设置
|
|
@@ -5261,14 +5285,14 @@ class ke {
|
|
|
5261
5285
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
5262
5286
|
navigator.clipboard.readText().then(async (o) => {
|
|
5263
5287
|
let r = ge(o);
|
|
5264
|
-
const a = [i, i + r[0].length - 1], l = [e, e + r.length - 1], [c, d] = l, [f, x] = a, u = d - this.ctx.maxRowIndex,
|
|
5265
|
-
(u > 0 ||
|
|
5288
|
+
const a = [i, i + r[0].length - 1], l = [e, e + r.length - 1], [c, d] = l, [f, x] = a, u = d - this.ctx.maxRowIndex, g = x - this.ctx.maxColIndex;
|
|
5289
|
+
(u > 0 || g > 0) && this.ctx.emit("onPastedDataOverflow", {
|
|
5266
5290
|
maxY: d,
|
|
5267
5291
|
maxX: x,
|
|
5268
5292
|
minY: c,
|
|
5269
5293
|
minX: f,
|
|
5270
5294
|
overflowRowCount: u,
|
|
5271
|
-
overflowColCount:
|
|
5295
|
+
overflowColCount: g,
|
|
5272
5296
|
textArr: r
|
|
5273
5297
|
});
|
|
5274
5298
|
const m = r.length === 1 && r[0].length === 1;
|
|
@@ -5280,18 +5304,18 @@ class ke {
|
|
|
5280
5304
|
this.ctx.hasEvent("error") ? this.ctx.emit("error", C) : alert(C.message);
|
|
5281
5305
|
return;
|
|
5282
5306
|
}
|
|
5283
|
-
let
|
|
5307
|
+
let w = [];
|
|
5284
5308
|
for (let C = 0; C <= r.length - 1; C++) {
|
|
5285
5309
|
const b = r[C].length;
|
|
5286
5310
|
for (let y = 0; y <= b - 1; y++) {
|
|
5287
|
-
const v = C + e, _ = y + i, S = r[C][y],
|
|
5311
|
+
const v = C + e, _ = y + i, S = r[C][y], R = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
5288
5312
|
v,
|
|
5289
5313
|
_
|
|
5290
5314
|
);
|
|
5291
|
-
if (
|
|
5292
|
-
const { rowKey:
|
|
5293
|
-
this.ctx.database.getReadonly(
|
|
5294
|
-
rowKey:
|
|
5315
|
+
if (R) {
|
|
5316
|
+
const { rowKey: I, key: T } = R;
|
|
5317
|
+
this.ctx.database.getReadonly(I, T) || (s.add(I), w.push({
|
|
5318
|
+
rowKey: I,
|
|
5295
5319
|
key: T,
|
|
5296
5320
|
value: S,
|
|
5297
5321
|
row: {}
|
|
@@ -5306,30 +5330,30 @@ class ke {
|
|
|
5306
5330
|
this.ctx.selector.yArrCopy,
|
|
5307
5331
|
!0
|
|
5308
5332
|
// 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
|
|
5309
|
-
), b =
|
|
5333
|
+
), b = w.map((y) => `${y.rowKey}-${y.key}`);
|
|
5310
5334
|
C.forEach((y) => {
|
|
5311
|
-
b.includes(`${y.rowKey}-${y.key}`) ||
|
|
5335
|
+
b.includes(`${y.rowKey}-${y.key}`) || w.unshift(y);
|
|
5312
5336
|
}), this.isCut = !1;
|
|
5313
5337
|
}
|
|
5314
|
-
if (!
|
|
5338
|
+
if (!w.length)
|
|
5315
5339
|
return;
|
|
5316
5340
|
const { BEFORE_PASTE_DATA_METHOD: E } = this.ctx.config;
|
|
5317
5341
|
if (typeof E == "function") {
|
|
5318
|
-
const C = E, b =
|
|
5342
|
+
const C = E, b = w.map((y) => ({
|
|
5319
5343
|
rowKey: y.rowKey,
|
|
5320
5344
|
key: y.key,
|
|
5321
5345
|
value: y.value,
|
|
5322
5346
|
oldValue: this.ctx.database.getItemValue(y.rowKey, y.key),
|
|
5323
5347
|
row: this.ctx.database.getRowDataItemForRowKey(y.rowKey)
|
|
5324
5348
|
}));
|
|
5325
|
-
if (
|
|
5349
|
+
if (w = await C(b, a, l, r), w && !w.length)
|
|
5326
5350
|
return;
|
|
5327
5351
|
}
|
|
5328
|
-
this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(
|
|
5352
|
+
this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(w, !0);
|
|
5329
5353
|
let p = [];
|
|
5330
5354
|
s.forEach((C) => {
|
|
5331
5355
|
p.push(this.ctx.database.getRowDataItemForRowKey(C));
|
|
5332
|
-
}), this.ctx.emit("pasteChange",
|
|
5356
|
+
}), this.ctx.emit("pasteChange", w, p), this.ctx.emit("draw");
|
|
5333
5357
|
}).catch((o) => {
|
|
5334
5358
|
console.error("Failed to get the clipboard content:", o);
|
|
5335
5359
|
});
|
|
@@ -5390,19 +5414,19 @@ class ke {
|
|
|
5390
5414
|
body: l,
|
|
5391
5415
|
scrollX: c,
|
|
5392
5416
|
scrollY: d,
|
|
5393
|
-
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: x, FOOTER_POSITION: u, ENABLE_MERGE_CELL_LINK:
|
|
5417
|
+
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: x, FOOTER_POSITION: u, ENABLE_MERGE_CELL_LINK: g }
|
|
5394
5418
|
} = this.ctx;
|
|
5395
5419
|
if (!i)
|
|
5396
5420
|
return;
|
|
5397
|
-
|
|
5398
|
-
const { drawX: m, drawY:
|
|
5399
|
-
let v = r.height -
|
|
5421
|
+
g && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
5422
|
+
const { drawX: m, drawY: w, width: E, height: p, fixed: C } = i, b = o - m + 1, y = i.drawX + E - (e - s) + 1;
|
|
5423
|
+
let v = r.height - w, _ = p;
|
|
5400
5424
|
_ > l.visibleHeight && (_ = l.visibleHeight);
|
|
5401
5425
|
let S = 0;
|
|
5402
|
-
x && (u === "top" ? v = r.height + a.height -
|
|
5403
|
-
const
|
|
5404
|
-
let
|
|
5405
|
-
y > 0 && !C ?
|
|
5426
|
+
x && (u === "top" ? v = r.height + a.height - w : S = a.visibleHeight);
|
|
5427
|
+
const R = w + _ - (t - S - f);
|
|
5428
|
+
let I = c, T = d;
|
|
5429
|
+
y > 0 && !C ? I = Math.floor(c + y) : b > 0 && !C && (I = Math.floor(c - b)), v > 0 ? T = Math.floor(d - v) : R > 0 && (T = Math.floor(d + R)), (Math.abs(c - I) > 2 || Math.abs(d - T) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(I, T), this.ctx.emit("adjustBoundaryPosition", i));
|
|
5406
5430
|
}
|
|
5407
5431
|
destroy() {
|
|
5408
5432
|
}
|
|
@@ -5437,49 +5461,44 @@ class Xe {
|
|
|
5437
5461
|
return !(JSON.stringify(this.ctx.autofill.xArr) === JSON.stringify(t) && JSON.stringify(this.ctx.autofill.yArr) === JSON.stringify(e));
|
|
5438
5462
|
}
|
|
5439
5463
|
setMousedown() {
|
|
5440
|
-
this.ctx.autofill.enable = !0, this.ctx.autofillMove = !0;
|
|
5464
|
+
this.ctx.autofill.enable = !0, this.ctx.autofillMove = !0, this.ctx.disableHoverIconClick = !0;
|
|
5441
5465
|
}
|
|
5442
5466
|
setMouseUp() {
|
|
5443
5467
|
if (!this.ctx.autofill.enable)
|
|
5444
5468
|
return;
|
|
5445
|
-
this.isAutofillIng() && this.autofillData(), this.ctx.autofill.enable = !1, this.ctx.autofillMove = !1, this.ctx.autofill.xArr = [-1, -1], this.ctx.autofill.yArr = [-1, -1]
|
|
5469
|
+
this.isAutofillIng() && this.autofillData(), this.ctx.autofill.enable = !1, this.ctx.autofillMove = !1, this.ctx.autofill.xArr = [-1, -1], this.ctx.autofill.yArr = [-1, -1], setTimeout(() => {
|
|
5470
|
+
this.ctx.disableHoverIconClick = !1;
|
|
5471
|
+
}, 0);
|
|
5446
5472
|
}
|
|
5447
5473
|
setAutofill(t, e) {
|
|
5448
|
-
const { ENABLE_AUTOFILL: i,
|
|
5474
|
+
const { ENABLE_AUTOFILL: i, ENABLE_AUTOFILL_SPAN_COL: s, ENABLE_AUTOFILL_SPAN_ROW: o } = this.ctx.config;
|
|
5449
5475
|
if (!i)
|
|
5450
5476
|
return;
|
|
5451
5477
|
let r = t, a = e;
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
a = [l, l];
|
|
5455
|
-
}
|
|
5456
|
-
if (!s) {
|
|
5457
|
-
const [l] = r;
|
|
5458
|
-
r = [l, l];
|
|
5459
|
-
}
|
|
5460
|
-
if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(r) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(a)) {
|
|
5478
|
+
const l = this.ctx.selector.xArr, c = this.ctx.selector.yArr;
|
|
5479
|
+
if (!(!o && JSON.stringify(c) !== JSON.stringify(a)) && !(!s && JSON.stringify(l) !== JSON.stringify(r)) && (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(r) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(a))) {
|
|
5461
5480
|
const {
|
|
5462
|
-
SELECTOR_AREA_MIN_X:
|
|
5463
|
-
SELECTOR_AREA_MAX_X:
|
|
5464
|
-
SELECTOR_AREA_MIN_Y:
|
|
5465
|
-
SELECTOR_AREA_MAX_Y:
|
|
5466
|
-
SELECTOR_AREA_MAX_X_OFFSET:
|
|
5467
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
5468
|
-
} = this.ctx.config, w =
|
|
5469
|
-
let [
|
|
5470
|
-
if (
|
|
5481
|
+
SELECTOR_AREA_MIN_X: d,
|
|
5482
|
+
SELECTOR_AREA_MAX_X: f,
|
|
5483
|
+
SELECTOR_AREA_MIN_Y: x,
|
|
5484
|
+
SELECTOR_AREA_MAX_Y: u,
|
|
5485
|
+
SELECTOR_AREA_MAX_X_OFFSET: g,
|
|
5486
|
+
SELECTOR_AREA_MAX_Y_OFFSET: m
|
|
5487
|
+
} = this.ctx.config, w = d, E = f || this.ctx.maxColIndex - g, p = x, C = u || this.ctx.maxRowIndex - m;
|
|
5488
|
+
let [b, y] = r, [v, _] = a;
|
|
5489
|
+
if (b < w || v < p)
|
|
5471
5490
|
return;
|
|
5472
|
-
r = [Math.max(w,
|
|
5473
|
-
const { BEFORE_SET_AUTOFILL_METHOD:
|
|
5474
|
-
if (typeof
|
|
5475
|
-
const
|
|
5491
|
+
r = [Math.max(w, b), Math.min(E, y)], a = [Math.max(p, v), Math.min(C, _)];
|
|
5492
|
+
const { BEFORE_SET_AUTOFILL_METHOD: S } = this.ctx.config;
|
|
5493
|
+
if (typeof S == "function") {
|
|
5494
|
+
const I = S({
|
|
5476
5495
|
focusCell: this.ctx.focusCell,
|
|
5477
5496
|
xArr: r,
|
|
5478
5497
|
yArr: a
|
|
5479
5498
|
});
|
|
5480
|
-
if (!
|
|
5499
|
+
if (!I)
|
|
5481
5500
|
return;
|
|
5482
|
-
r =
|
|
5501
|
+
r = I.xArr, a = I.yArr;
|
|
5483
5502
|
}
|
|
5484
5503
|
this.ctx.autofill.xArr = r, this.ctx.autofill.yArr = a, this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
|
|
5485
5504
|
}
|
|
@@ -5490,9 +5509,9 @@ class Xe {
|
|
|
5490
5509
|
async autofillData() {
|
|
5491
5510
|
const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
|
|
5492
5511
|
for (let u = 0; u <= e.yArr[1] - e.yArr[0]; u++)
|
|
5493
|
-
for (let
|
|
5494
|
-
const m = u + e.yArr[0],
|
|
5495
|
-
i.set(`${m}-${
|
|
5512
|
+
for (let g = 0; g <= e.xArr[1] - e.xArr[0]; g++) {
|
|
5513
|
+
const m = u + e.yArr[0], w = g + e.xArr[0];
|
|
5514
|
+
i.set(`${m}-${w}`, !0);
|
|
5496
5515
|
}
|
|
5497
5516
|
const { value: s } = e, o = s[0].length, r = s.length, a = this.ctx.autofill.xArr, l = this.ctx.autofill.yArr, c = o === 1 && r === 1;
|
|
5498
5517
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !c) {
|
|
@@ -5505,8 +5524,8 @@ class Xe {
|
|
|
5505
5524
|
}
|
|
5506
5525
|
let d = [];
|
|
5507
5526
|
for (let u = 0; u <= l[1] - l[0]; u++)
|
|
5508
|
-
for (let
|
|
5509
|
-
const m =
|
|
5527
|
+
for (let g = 0; g <= a[1] - a[0]; g++) {
|
|
5528
|
+
const m = g + a[0], w = u + l[0], E = s[u % r][g % o], p = this.ctx.database.getItemValueForRowIndexAndColIndex(w, m), C = `${w}-${m}`;
|
|
5510
5529
|
if (p && !i.has(C)) {
|
|
5511
5530
|
const { rowKey: b, key: y } = p;
|
|
5512
5531
|
this.ctx.database.getReadonly(b, y) || (t.add(b), d.push({
|
|
@@ -5522,14 +5541,14 @@ class Xe {
|
|
|
5522
5541
|
this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr;
|
|
5523
5542
|
const { BEFORE_AUTOFILL_DATA_METHOD: f } = this.ctx.config;
|
|
5524
5543
|
if (typeof f == "function") {
|
|
5525
|
-
const u = f,
|
|
5544
|
+
const u = f, g = d.map((m) => ({
|
|
5526
5545
|
rowKey: m.rowKey,
|
|
5527
5546
|
key: m.key,
|
|
5528
5547
|
value: m.value,
|
|
5529
5548
|
oldValue: this.ctx.database.getItemValue(m.rowKey, m.key),
|
|
5530
5549
|
row: this.ctx.database.getRowDataItemForRowKey(m.rowKey)
|
|
5531
5550
|
}));
|
|
5532
|
-
if (d = await u(
|
|
5551
|
+
if (d = await u(g, a, l), d && !d.length)
|
|
5533
5552
|
return;
|
|
5534
5553
|
}
|
|
5535
5554
|
this.ctx.batchSetItemValueByEditor(d, !0);
|
|
@@ -5577,7 +5596,7 @@ function it(h) {
|
|
|
5577
5596
|
function Jt(h) {
|
|
5578
5597
|
return h === "x" ? "y" : "x";
|
|
5579
5598
|
}
|
|
5580
|
-
function
|
|
5599
|
+
function It(h) {
|
|
5581
5600
|
return h === "y" ? "height" : "width";
|
|
5582
5601
|
}
|
|
5583
5602
|
const Ke = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
@@ -5589,7 +5608,7 @@ function vt(h) {
|
|
|
5589
5608
|
}
|
|
5590
5609
|
function Fe(h, t, e) {
|
|
5591
5610
|
e === void 0 && (e = !1);
|
|
5592
|
-
const i = it(h), s = vt(h), o =
|
|
5611
|
+
const i = it(h), s = vt(h), o = It(s);
|
|
5593
5612
|
let r = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
5594
5613
|
return t.reference[o] > t.floating[o] && (r = lt(r)), [r, lt(r)];
|
|
5595
5614
|
}
|
|
@@ -5661,7 +5680,7 @@ function Kt(h, t, e) {
|
|
|
5661
5680
|
reference: i,
|
|
5662
5681
|
floating: s
|
|
5663
5682
|
} = h;
|
|
5664
|
-
const o = V(t), r = vt(t), a =
|
|
5683
|
+
const o = V(t), r = vt(t), a = It(r), l = $(t), c = o === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, x = i[a] / 2 - s[a] / 2;
|
|
5665
5684
|
let u;
|
|
5666
5685
|
switch (l) {
|
|
5667
5686
|
case "top":
|
|
@@ -5718,10 +5737,10 @@ const Ue = async (h, t, e) => {
|
|
|
5718
5737
|
}), {
|
|
5719
5738
|
x: d,
|
|
5720
5739
|
y: f
|
|
5721
|
-
} = Kt(c, i, l), x = i, u = {},
|
|
5740
|
+
} = Kt(c, i, l), x = i, u = {}, g = 0;
|
|
5722
5741
|
for (let m = 0; m < a.length; m++) {
|
|
5723
5742
|
const {
|
|
5724
|
-
name:
|
|
5743
|
+
name: w,
|
|
5725
5744
|
fn: E
|
|
5726
5745
|
} = a[m], {
|
|
5727
5746
|
x: p,
|
|
@@ -5744,11 +5763,11 @@ const Ue = async (h, t, e) => {
|
|
|
5744
5763
|
});
|
|
5745
5764
|
d = p ?? d, f = C ?? f, u = {
|
|
5746
5765
|
...u,
|
|
5747
|
-
[
|
|
5748
|
-
...u[
|
|
5766
|
+
[w]: {
|
|
5767
|
+
...u[w],
|
|
5749
5768
|
...b
|
|
5750
5769
|
}
|
|
5751
|
-
}, y &&
|
|
5770
|
+
}, y && g <= 50 && (g++, typeof y == "object" && (y.placement && (x = y.placement), y.rects && (c = y.rects === !0 ? await r.getElementRects({
|
|
5752
5771
|
reference: h,
|
|
5753
5772
|
floating: t,
|
|
5754
5773
|
strategy: s
|
|
@@ -5781,8 +5800,8 @@ async function te(h, t) {
|
|
|
5781
5800
|
elementContext: f = "floating",
|
|
5782
5801
|
altBoundary: x = !1,
|
|
5783
5802
|
padding: u = 0
|
|
5784
|
-
} = et(t, h),
|
|
5785
|
-
element: (e = await (o.isElement == null ? void 0 : o.isElement(
|
|
5803
|
+
} = et(t, h), g = Qt(u), w = a[x ? f === "floating" ? "reference" : "floating" : f], E = ct(await o.getClippingRect({
|
|
5804
|
+
element: (e = await (o.isElement == null ? void 0 : o.isElement(w))) == null || e ? w : w.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(a.floating)),
|
|
5786
5805
|
boundary: c,
|
|
5787
5806
|
rootBoundary: d,
|
|
5788
5807
|
strategy: l
|
|
@@ -5804,10 +5823,10 @@ async function te(h, t) {
|
|
|
5804
5823
|
strategy: l
|
|
5805
5824
|
}) : p);
|
|
5806
5825
|
return {
|
|
5807
|
-
top: (E.top - y.top +
|
|
5808
|
-
bottom: (y.bottom - E.bottom +
|
|
5809
|
-
left: (E.left - y.left +
|
|
5810
|
-
right: (y.right - E.right +
|
|
5826
|
+
top: (E.top - y.top + g.top) / b.y,
|
|
5827
|
+
bottom: (y.bottom - E.bottom + g.bottom) / b.y,
|
|
5828
|
+
left: (E.left - y.left + g.left) / b.x,
|
|
5829
|
+
right: (y.right - E.right + g.right) / b.x
|
|
5811
5830
|
};
|
|
5812
5831
|
}
|
|
5813
5832
|
const je = (h) => ({
|
|
@@ -5831,10 +5850,10 @@ const je = (h) => ({
|
|
|
5831
5850
|
const f = Qt(d), x = {
|
|
5832
5851
|
x: e,
|
|
5833
5852
|
y: i
|
|
5834
|
-
}, u = vt(s),
|
|
5853
|
+
}, u = vt(s), g = It(u), m = await r.getDimensions(c), w = u === "y", E = w ? "top" : "left", p = w ? "bottom" : "right", C = w ? "clientHeight" : "clientWidth", b = o.reference[g] + o.reference[u] - x[u] - o.floating[g], y = x[u] - o.reference[u], v = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
|
|
5835
5854
|
let _ = v ? v[C] : 0;
|
|
5836
|
-
(!_ || !await (r.isElement == null ? void 0 : r.isElement(v))) && (_ = a.floating[C] || o.floating[
|
|
5837
|
-
const S = b / 2 - y / 2,
|
|
5855
|
+
(!_ || !await (r.isElement == null ? void 0 : r.isElement(v))) && (_ = a.floating[C] || o.floating[g]);
|
|
5856
|
+
const S = b / 2 - y / 2, R = _ / 2 - m[g] / 2 - 1, I = j(f[E], R), T = j(f[p], R), O = I, M = _ - m[g] - T, L = _ / 2 - m[g] / 2 + S, A = Et(O, L, M), D = !l.arrow && it(s) != null && L !== A && o.reference[g] / 2 - (L < O ? I : T) - m[g] / 2 < 0, H = D ? L < O ? L - O : L - M : 0;
|
|
5838
5857
|
return {
|
|
5839
5858
|
[u]: x[u] + H,
|
|
5840
5859
|
data: {
|
|
@@ -5865,44 +5884,44 @@ const je = (h) => ({
|
|
|
5865
5884
|
crossAxis: f = !0,
|
|
5866
5885
|
fallbackPlacements: x,
|
|
5867
5886
|
fallbackStrategy: u = "bestFit",
|
|
5868
|
-
fallbackAxisSideDirection:
|
|
5887
|
+
fallbackAxisSideDirection: g = "none",
|
|
5869
5888
|
flipAlignment: m = !0,
|
|
5870
|
-
...
|
|
5889
|
+
...w
|
|
5871
5890
|
} = et(h, t);
|
|
5872
5891
|
if ((e = o.arrow) != null && e.alignmentOffset)
|
|
5873
5892
|
return {};
|
|
5874
|
-
const E = $(s), p = V(a), C = $(a) === a, b = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), y = x || (C || !m ? [lt(a)] : We(a)), v =
|
|
5875
|
-
!x && v && y.push(...$e(a, m,
|
|
5876
|
-
const _ = [a, ...y], S = await te(t,
|
|
5877
|
-
let
|
|
5878
|
-
if (d &&
|
|
5893
|
+
const E = $(s), p = V(a), C = $(a) === a, b = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), y = x || (C || !m ? [lt(a)] : We(a)), v = g !== "none";
|
|
5894
|
+
!x && v && y.push(...$e(a, m, g, b));
|
|
5895
|
+
const _ = [a, ...y], S = await te(t, w), R = [];
|
|
5896
|
+
let I = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
5897
|
+
if (d && R.push(S[E]), f) {
|
|
5879
5898
|
const L = Fe(s, r, b);
|
|
5880
|
-
|
|
5899
|
+
R.push(S[L[0]], S[L[1]]);
|
|
5881
5900
|
}
|
|
5882
|
-
if (
|
|
5901
|
+
if (I = [...I, {
|
|
5883
5902
|
placement: s,
|
|
5884
|
-
overflows:
|
|
5885
|
-
}], !
|
|
5903
|
+
overflows: R
|
|
5904
|
+
}], !R.every((L) => L <= 0)) {
|
|
5886
5905
|
var T, O;
|
|
5887
5906
|
const L = (((T = o.flip) == null ? void 0 : T.index) || 0) + 1, A = _[L];
|
|
5888
5907
|
if (A && (!(f === "alignment" ? p !== V(A) : !1) || // We leave the current main axis only if every placement on that axis
|
|
5889
5908
|
// overflows the main axis.
|
|
5890
|
-
|
|
5909
|
+
I.every((k) => V(k.placement) === p ? k.overflows[0] > 0 : !0)))
|
|
5891
5910
|
return {
|
|
5892
5911
|
data: {
|
|
5893
5912
|
index: L,
|
|
5894
|
-
overflows:
|
|
5913
|
+
overflows: I
|
|
5895
5914
|
},
|
|
5896
5915
|
reset: {
|
|
5897
5916
|
placement: A
|
|
5898
5917
|
}
|
|
5899
5918
|
};
|
|
5900
|
-
let D = (O =
|
|
5919
|
+
let D = (O = I.filter((H) => H.overflows[0] <= 0).sort((H, k) => H.overflows[1] - k.overflows[1])[0]) == null ? void 0 : O.placement;
|
|
5901
5920
|
if (!D)
|
|
5902
5921
|
switch (u) {
|
|
5903
5922
|
case "bestFit": {
|
|
5904
5923
|
var M;
|
|
5905
|
-
const H = (M =
|
|
5924
|
+
const H = (M = I.filter((k) => {
|
|
5906
5925
|
if (v) {
|
|
5907
5926
|
const W = V(k.placement);
|
|
5908
5927
|
return W === p || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -5938,7 +5957,7 @@ async function Je(h, t) {
|
|
|
5938
5957
|
let {
|
|
5939
5958
|
mainAxis: x,
|
|
5940
5959
|
crossAxis: u,
|
|
5941
|
-
alignmentAxis:
|
|
5960
|
+
alignmentAxis: g
|
|
5942
5961
|
} = typeof f == "number" ? {
|
|
5943
5962
|
mainAxis: f,
|
|
5944
5963
|
crossAxis: 0,
|
|
@@ -5948,7 +5967,7 @@ async function Je(h, t) {
|
|
|
5948
5967
|
crossAxis: f.crossAxis || 0,
|
|
5949
5968
|
alignmentAxis: f.alignmentAxis
|
|
5950
5969
|
};
|
|
5951
|
-
return a && typeof
|
|
5970
|
+
return a && typeof g == "number" && (u = a === "end" ? g * -1 : g), l ? {
|
|
5952
5971
|
x: u * d,
|
|
5953
5972
|
y: x * c
|
|
5954
5973
|
} : {
|
|
@@ -5991,11 +6010,11 @@ const Qe = function(h) {
|
|
|
5991
6010
|
mainAxis: o = !0,
|
|
5992
6011
|
crossAxis: r = !1,
|
|
5993
6012
|
limiter: a = {
|
|
5994
|
-
fn: (
|
|
6013
|
+
fn: (w) => {
|
|
5995
6014
|
let {
|
|
5996
6015
|
x: E,
|
|
5997
6016
|
y: p
|
|
5998
|
-
} =
|
|
6017
|
+
} = w;
|
|
5999
6018
|
return {
|
|
6000
6019
|
x: E,
|
|
6001
6020
|
y: p
|
|
@@ -6007,19 +6026,19 @@ const Qe = function(h) {
|
|
|
6007
6026
|
x: e,
|
|
6008
6027
|
y: i
|
|
6009
6028
|
}, d = await te(t, l), f = V($(s)), x = Jt(f);
|
|
6010
|
-
let u = c[x],
|
|
6029
|
+
let u = c[x], g = c[f];
|
|
6011
6030
|
if (o) {
|
|
6012
|
-
const
|
|
6031
|
+
const w = x === "y" ? "top" : "left", E = x === "y" ? "bottom" : "right", p = u + d[w], C = u - d[E];
|
|
6013
6032
|
u = Et(p, u, C);
|
|
6014
6033
|
}
|
|
6015
6034
|
if (r) {
|
|
6016
|
-
const
|
|
6017
|
-
|
|
6035
|
+
const w = f === "y" ? "top" : "left", E = f === "y" ? "bottom" : "right", p = g + d[w], C = g - d[E];
|
|
6036
|
+
g = Et(p, g, C);
|
|
6018
6037
|
}
|
|
6019
6038
|
const m = a.fn({
|
|
6020
6039
|
...t,
|
|
6021
6040
|
[x]: u,
|
|
6022
|
-
[f]:
|
|
6041
|
+
[f]: g
|
|
6023
6042
|
});
|
|
6024
6043
|
return {
|
|
6025
6044
|
...m,
|
|
@@ -6197,10 +6216,10 @@ function G(h, t, e, i) {
|
|
|
6197
6216
|
let l = (s.left + a.x) / r.x, c = (s.top + a.y) / r.y, d = s.width / r.x, f = s.height / r.y;
|
|
6198
6217
|
if (o) {
|
|
6199
6218
|
const x = N(o), u = i && X(i) ? N(i) : i;
|
|
6200
|
-
let
|
|
6201
|
-
for (; m && i && u !==
|
|
6202
|
-
const
|
|
6203
|
-
l *=
|
|
6219
|
+
let g = x, m = Ct(g);
|
|
6220
|
+
for (; m && i && u !== g; ) {
|
|
6221
|
+
const w = U(m), E = m.getBoundingClientRect(), p = B(m), C = E.left + (m.clientLeft + parseFloat(p.paddingLeft)) * w.x, b = E.top + (m.clientTop + parseFloat(p.paddingTop)) * w.y;
|
|
6222
|
+
l *= w.x, c *= w.y, d *= w.x, f *= w.y, l += C, c += b, g = N(m), m = Ct(g);
|
|
6204
6223
|
}
|
|
6205
6224
|
}
|
|
6206
6225
|
return ct({
|
|
@@ -6420,10 +6439,10 @@ const bi = async function(h) {
|
|
|
6420
6439
|
}
|
|
6421
6440
|
};
|
|
6422
6441
|
};
|
|
6423
|
-
function
|
|
6442
|
+
function Ri(h) {
|
|
6424
6443
|
return B(h).direction === "rtl";
|
|
6425
6444
|
}
|
|
6426
|
-
const
|
|
6445
|
+
const Ii = {
|
|
6427
6446
|
convertOffsetParentRelativeRectToViewportRelativeRect: fi,
|
|
6428
6447
|
getDocumentElement: F,
|
|
6429
6448
|
getClippingRect: pi,
|
|
@@ -6433,7 +6452,7 @@ const Ri = {
|
|
|
6433
6452
|
getDimensions: Ci,
|
|
6434
6453
|
getScale: U,
|
|
6435
6454
|
isElement: X,
|
|
6436
|
-
isRTL:
|
|
6455
|
+
isRTL: Ri
|
|
6437
6456
|
};
|
|
6438
6457
|
function le(h, t) {
|
|
6439
6458
|
return h.x === t.x && h.y === t.y && h.width === t.width && h.height === t.height;
|
|
@@ -6455,8 +6474,8 @@ function vi(h, t) {
|
|
|
6455
6474
|
} = c;
|
|
6456
6475
|
if (a || t(), !x || !u)
|
|
6457
6476
|
return;
|
|
6458
|
-
const
|
|
6459
|
-
rootMargin: -
|
|
6477
|
+
const g = ot(f), m = ot(s.clientWidth - (d + x)), w = ot(s.clientHeight - (f + u)), E = ot(d), C = {
|
|
6478
|
+
rootMargin: -g + "px " + -m + "px " + -w + "px " + -E + "px",
|
|
6460
6479
|
threshold: z(0, j(1, l)) || 1
|
|
6461
6480
|
};
|
|
6462
6481
|
let b = !0;
|
|
@@ -6507,22 +6526,22 @@ function yt(h, t, e, i) {
|
|
|
6507
6526
|
(C = u) == null || C.observe(t);
|
|
6508
6527
|
})), e();
|
|
6509
6528
|
}), c && !l && u.observe(c), u.observe(t));
|
|
6510
|
-
let
|
|
6511
|
-
l &&
|
|
6512
|
-
function
|
|
6529
|
+
let g, m = l ? G(h) : null;
|
|
6530
|
+
l && w();
|
|
6531
|
+
function w() {
|
|
6513
6532
|
const E = G(h);
|
|
6514
|
-
m && !le(m, E) && e(), m = E,
|
|
6533
|
+
m && !le(m, E) && e(), m = E, g = requestAnimationFrame(w);
|
|
6515
6534
|
}
|
|
6516
6535
|
return e(), () => {
|
|
6517
6536
|
var E;
|
|
6518
6537
|
d.forEach((p) => {
|
|
6519
6538
|
s && p.removeEventListener("scroll", e), o && p.removeEventListener("resize", e);
|
|
6520
|
-
}), f == null || f(), (E = u) == null || E.disconnect(), u = null, l && cancelAnimationFrame(
|
|
6539
|
+
}), f == null || f(), (E = u) == null || E.disconnect(), u = null, l && cancelAnimationFrame(g);
|
|
6521
6540
|
};
|
|
6522
6541
|
}
|
|
6523
6542
|
const ht = Qe, dt = ti, Lt = qe, _i = je, ft = (h, t, e) => {
|
|
6524
6543
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
6525
|
-
platform:
|
|
6544
|
+
platform: Ii,
|
|
6526
6545
|
...e
|
|
6527
6546
|
}, o = {
|
|
6528
6547
|
...s.platform,
|
|
@@ -6678,7 +6697,9 @@ class Ti {
|
|
|
6678
6697
|
}), this.ctx.on("cellHeaderMousedown", () => {
|
|
6679
6698
|
this.enable && this.doneEdit(), this.cellTarget = null;
|
|
6680
6699
|
}), this.ctx.on("hoverIconClick", (t) => {
|
|
6681
|
-
this.editCell(t.rowIndex, t.colIndex);
|
|
6700
|
+
this.ctx.disableHoverIconClick || this.editCell(t.rowIndex, t.colIndex);
|
|
6701
|
+
}), this.ctx.on("cellMousedown", () => {
|
|
6702
|
+
this.inputEl.focus({ preventScroll: !0 });
|
|
6682
6703
|
}), this.ctx.on("keydown", (t) => {
|
|
6683
6704
|
if (!this.ctx.isTarget(t) || !this.ctx.focusCell)
|
|
6684
6705
|
return;
|
|
@@ -6772,9 +6793,7 @@ class Ti {
|
|
|
6772
6793
|
return !(e < o || e > r || t < a || t > l);
|
|
6773
6794
|
}
|
|
6774
6795
|
initTextEditor() {
|
|
6775
|
-
this.inputEl = document.createElement("textarea"), this.inputEl.setAttribute("rows", "1"), this.inputEl.addEventListener("input", this.autoSize.bind(this)), this.inputEl.
|
|
6776
|
-
this.doneEdit();
|
|
6777
|
-
}), this.editorEl = this.ctx.editorElement, this.inputEl.className = "e-virt-table-editor-textarea", this.editorEl.appendChild(this.inputEl), this.ctx.containerElement.appendChild(this.editorEl);
|
|
6796
|
+
this.inputEl = document.createElement("textarea"), this.inputEl.id = "e-virt-table-editor-textarea", this.inputEl.setAttribute("rows", "1"), this.inputEl.setAttribute("tabindex", "-1"), this.inputEl.addEventListener("input", this.autoSize.bind(this)), this.editorEl = this.ctx.editorElement, this.inputEl.className = "e-virt-table-editor-textarea", this.editorEl.appendChild(this.inputEl), this.ctx.containerElement.appendChild(this.editorEl);
|
|
6778
6797
|
}
|
|
6779
6798
|
autoSize() {
|
|
6780
6799
|
this.inputEl.style.height = "auto";
|
|
@@ -6800,18 +6819,12 @@ class Ti {
|
|
|
6800
6819
|
header: d
|
|
6801
6820
|
} = this.ctx;
|
|
6802
6821
|
let f = this.ctx.body.visibleHeight;
|
|
6803
|
-
|
|
6804
|
-
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${r - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${r - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${c}px`, i !== null && (this.inputEl.value = i), this.inputEl.focus({ preventScroll: !0 });
|
|
6805
|
-
const x = this.inputEl.value.length;
|
|
6806
|
-
this.inputEl.setSelectionRange(x, x);
|
|
6807
|
-
} else
|
|
6808
|
-
this.inputEl.style.display = "none";
|
|
6809
|
-
(this.inputEl.scrollHeight > o || this.drawY < d.height) && this.autoSize();
|
|
6822
|
+
o > f && (o = f), this.editorEl.style.display = "inline-block", this.editorEl.style.zIndex = "100", this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = `${this.drawY - 1}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text" ? (this.inputEl.style.display = "inline-block", this.inputEl.style.minWidth = `${r - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${r - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${c}px`, this.inputEl.value = "", i !== null && (this.inputEl.value = i)) : this.inputEl.style.display = "none", (this.inputEl.scrollHeight > o || this.drawY < d.height) && this.autoSize();
|
|
6810
6823
|
}
|
|
6811
6824
|
doneEditByInput() {
|
|
6812
6825
|
if (this.cellTarget && this.cellTarget.editorType === "text") {
|
|
6813
6826
|
const { rowKey: t, key: e } = this.cellTarget, i = this.cellTarget.getValue(), s = this.inputEl.value;
|
|
6814
|
-
s !== i && !(s === "" && i === null) && !this.cancel && this.ctx.setItemValueByEditor(t, e, s, !0)
|
|
6827
|
+
s !== i && !(s === "" && i === null) && !this.cancel && this.ctx.setItemValueByEditor(t, e, s, !0);
|
|
6815
6828
|
}
|
|
6816
6829
|
}
|
|
6817
6830
|
startEdit(t = !1) {
|
|
@@ -6840,7 +6853,9 @@ class Ti {
|
|
|
6840
6853
|
o && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = o, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget), this.ctx.emit("drawView"));
|
|
6841
6854
|
}
|
|
6842
6855
|
doneEdit() {
|
|
6843
|
-
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.
|
|
6856
|
+
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.inputEl.style.display = "inline-block", this.editorEl.style.zIndex = "-1", setTimeout(() => {
|
|
6857
|
+
this.inputEl.focus({ preventScroll: !0 });
|
|
6858
|
+
}, 0), this.ctx.emit("draw"));
|
|
6844
6859
|
}
|
|
6845
6860
|
clearEditor() {
|
|
6846
6861
|
this.doneEdit(), this.cellTarget = null, this.selectorArrStr = "", this.ctx.clearSelector(), this.ctx.focusCell = void 0, this.ctx.emit("draw");
|
|
@@ -6928,8 +6943,8 @@ class Li {
|
|
|
6928
6943
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
6929
6944
|
} = this.ctx, { visibleWidth: o, visibleHeight: r, renderCellHeaders: a } = this.ctx.header;
|
|
6930
6945
|
let l = [], c = [], d = [];
|
|
6931
|
-
a.forEach((
|
|
6932
|
-
|
|
6946
|
+
a.forEach((w) => {
|
|
6947
|
+
w.render && (w.fixed === "left" ? c.push(w) : w.fixed === "right" ? d.push(w) : l.push(w));
|
|
6933
6948
|
});
|
|
6934
6949
|
const f = e - i, x = {
|
|
6935
6950
|
key: "left",
|
|
@@ -6953,7 +6968,7 @@ class Li {
|
|
|
6953
6968
|
height: `${r}px`
|
|
6954
6969
|
},
|
|
6955
6970
|
cells: l
|
|
6956
|
-
},
|
|
6971
|
+
}, g = {
|
|
6957
6972
|
key: "right",
|
|
6958
6973
|
style: {
|
|
6959
6974
|
position: "absolute",
|
|
@@ -6974,14 +6989,14 @@ class Li {
|
|
|
6974
6989
|
width: `${o}px`,
|
|
6975
6990
|
height: `${r}px`
|
|
6976
6991
|
},
|
|
6977
|
-
views: [x, u,
|
|
6992
|
+
views: [x, u, g]
|
|
6978
6993
|
};
|
|
6979
6994
|
}
|
|
6980
6995
|
getBody() {
|
|
6981
6996
|
const t = [], e = [], i = [];
|
|
6982
6997
|
let s = this.ctx.body.renderRows;
|
|
6983
|
-
this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((
|
|
6984
|
-
|
|
6998
|
+
this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((w) => {
|
|
6999
|
+
w.cells.forEach((E) => {
|
|
6985
7000
|
E.cellType === "footer" && (E.render = E.renderFooter), E.render && (E.fixed === "left" ? e.push(E) : E.fixed === "right" ? i.push(E) : t.push(E));
|
|
6986
7001
|
});
|
|
6987
7002
|
});
|
|
@@ -7011,7 +7026,7 @@ class Li {
|
|
|
7011
7026
|
height: `${d}px`
|
|
7012
7027
|
},
|
|
7013
7028
|
cells: t
|
|
7014
|
-
},
|
|
7029
|
+
}, g = {
|
|
7015
7030
|
key: "right",
|
|
7016
7031
|
style: {
|
|
7017
7032
|
position: "absolute",
|
|
@@ -7032,14 +7047,14 @@ class Li {
|
|
|
7032
7047
|
width: `${c}px`,
|
|
7033
7048
|
height: `${d}px`
|
|
7034
7049
|
},
|
|
7035
|
-
views: [x, u,
|
|
7050
|
+
views: [x, u, g]
|
|
7036
7051
|
};
|
|
7037
7052
|
}
|
|
7038
7053
|
getFooter() {
|
|
7039
7054
|
const t = [], e = [], i = [];
|
|
7040
7055
|
this.ctx.footer.renderRows.forEach((m) => {
|
|
7041
|
-
m.cells.forEach((
|
|
7042
|
-
|
|
7056
|
+
m.cells.forEach((w) => {
|
|
7057
|
+
w.cellType === "footer" && w.renderFooter && (w.render = w.renderFooter, w.fixed === "left" ? e.push(w) : w.fixed === "right" ? i.push(w) : t.push(w));
|
|
7043
7058
|
});
|
|
7044
7059
|
});
|
|
7045
7060
|
const {
|
|
@@ -7338,9 +7353,9 @@ class Mi {
|
|
|
7338
7353
|
const { ENABLE_CONTEXT_MENU: i, CUSTOM_BODY_CONTEXT_MENU: s, CONTEXT_MENU: o } = this.ctx.config, r = [...o, ...s];
|
|
7339
7354
|
if (!i || r.length === 0) return;
|
|
7340
7355
|
e.preventDefault();
|
|
7341
|
-
const { xArr: a, yArr: l } = this.ctx.selector, [c, d] = a, [f, x] = l, { rowIndex: u, colIndex:
|
|
7342
|
-
u >= f && u <= x &&
|
|
7343
|
-
onClick: (
|
|
7356
|
+
const { xArr: a, yArr: l } = this.ctx.selector, [c, d] = a, [f, x] = l, { rowIndex: u, colIndex: g } = t;
|
|
7357
|
+
u >= f && u <= x && g >= c && g <= d || this.ctx.emit("setSelectorCell", t, e), this.currentDOMTreeMenu && this.currentDOMTreeMenu.destroy(), this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new Pt(this.contextMenuEl, r, {
|
|
7358
|
+
onClick: (w, E) => {
|
|
7344
7359
|
E === "copy" ? (this.ctx.emit("contextMenuCopy"), this.hide()) : E === "paste" ? (this.ctx.emit("contextMenuPaste"), this.hide()) : E === "cut" ? (this.ctx.emit("contextMenuCut"), this.hide()) : E === "clearSelected" && (this.ctx.emit("contextMenuClearSelected"), this.hide());
|
|
7345
7360
|
}
|
|
7346
7361
|
}), this.currentDOMTreeMenu.positionMenu(e);
|
|
@@ -7355,8 +7370,8 @@ class Mi {
|
|
|
7355
7370
|
const { HEADER_CONTEXT_MENU: l, CUSTOM_HEADER_CONTEXT_MENU: c, ENABLE_HEADER_CONTEXT_MENU: d } = this.ctx.config, f = [...l, ...c];
|
|
7356
7371
|
if (!d || f.length === 0) return;
|
|
7357
7372
|
e.preventDefault();
|
|
7358
|
-
const { xArr: x } = this.ctx.selector, [u,
|
|
7359
|
-
m >= u && m <=
|
|
7373
|
+
const { xArr: x } = this.ctx.selector, [u, g] = x, { colIndex: m } = t;
|
|
7374
|
+
m >= u && m <= g || (this.ctx.focusCellHeader = t, this.ctx.emit("selectCols", t)), this.currentDOMTreeMenu && this.currentDOMTreeMenu.destroy();
|
|
7360
7375
|
const E = this.ctx.database.getColumns(), p = f.map((C) => C.value === "visible" ? {
|
|
7361
7376
|
...C,
|
|
7362
7377
|
children: this.filterColumns(E)
|
|
@@ -7365,19 +7380,19 @@ class Mi {
|
|
|
7365
7380
|
onClick: (C, b) => {
|
|
7366
7381
|
const { xArr: y } = this.ctx.selector, [v, _] = y;
|
|
7367
7382
|
if (b === "fixedLeft" || b === "fixedRight" || b === "fixedNone") {
|
|
7368
|
-
const S = this.ctx.header.allCellHeaders.filter((
|
|
7383
|
+
const S = this.ctx.header.allCellHeaders.filter((R) => R.colIndex >= v && R.colIndex <= _).filter((R) => R.level === 0).filter((R) => !R.column.fixedDisabled).map((R) => R.key);
|
|
7369
7384
|
this.ctx.database.setCustomHeaderFixedData(
|
|
7370
7385
|
S,
|
|
7371
7386
|
b === "fixedLeft" ? "left" : b === "fixedRight" ? "right" : ""
|
|
7372
7387
|
), this.hide();
|
|
7373
7388
|
} else if (b === "hide") {
|
|
7374
|
-
const S = this.ctx.header.leafCellHeaders.filter((
|
|
7389
|
+
const S = this.ctx.header.leafCellHeaders.filter((R) => R.colIndex >= v && R.colIndex <= _).filter((R) => !R.children.length).filter((R) => !R.column.hideDisabled).map((R) => R.key);
|
|
7375
7390
|
S.length > 0 && this.ctx.database.setCustomHeaderHideData(S, !0), this.hide();
|
|
7376
7391
|
} else if (b !== "visible") if (b.startsWith("visible_")) {
|
|
7377
7392
|
const S = b.replace("visible_", "");
|
|
7378
7393
|
this.ctx.database.setCustomHeaderHideData([S], !1), this.currentDOMTreeMenu && this.currentDOMTreeMenu.removeSubMenuItem(b);
|
|
7379
|
-
const
|
|
7380
|
-
Q(
|
|
7394
|
+
const R = this.ctx.database.getColumns();
|
|
7395
|
+
Q(R).filter((O) => O.hide).length === 0 && this.hide();
|
|
7381
7396
|
} else b === "resetHeader" && (this.ctx.database.resetCustomHeader(), this.hide());
|
|
7382
7397
|
}
|
|
7383
7398
|
}), this.positionMenu(e);
|
|
@@ -7757,6 +7772,9 @@ class ki {
|
|
|
7757
7772
|
clearSort() {
|
|
7758
7773
|
this.ctx.database.clearSort();
|
|
7759
7774
|
}
|
|
7775
|
+
clearMaxRowHeight() {
|
|
7776
|
+
this.ctx.database.clearMaxRowHeight();
|
|
7777
|
+
}
|
|
7760
7778
|
contextMenuHide() {
|
|
7761
7779
|
this.contextMenu.hide();
|
|
7762
7780
|
}
|