e-virt-table 1.3.9 → 1.3.10
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 +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +41 -31
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Config.d.ts +2 -0
- package/dist/lib/Config.js +7 -0
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Database.js +4 -1
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/Header.js +1 -1
- package/dist/lib/Header.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1072,45 +1072,53 @@ class ye {
|
|
|
1072
1072
|
* @param level
|
|
1073
1073
|
*/
|
|
1074
1074
|
initData(t, e = 0, i = []) {
|
|
1075
|
-
const s = t.length
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1075
|
+
const s = t.length, {
|
|
1076
|
+
ROW_KEY: o = "",
|
|
1077
|
+
DEFAULT_EXPAND_ALL: r,
|
|
1078
|
+
CELL_HEIGHT: a,
|
|
1079
|
+
SELECTABLE_METHOD: l,
|
|
1080
|
+
CHECKBOX_KEY: c,
|
|
1081
|
+
TREE_CHILDREN_KEY: d
|
|
1082
|
+
} = this.ctx.config;
|
|
1083
|
+
t.forEach((f, x) => {
|
|
1084
|
+
var C;
|
|
1085
|
+
d !== "children" && (f.children = f[d]);
|
|
1086
|
+
const u = f[o], g = u != null ? `${u}` : zt();
|
|
1087
|
+
this.itemRowKeyMap.set(f, g);
|
|
1088
|
+
const m = f._height || a, w = f._readonly;
|
|
1089
|
+
let E = !0;
|
|
1090
|
+
if (typeof l == "function" && (E = l), c) {
|
|
1091
|
+
const b = f[c];
|
|
1092
|
+
if (this.checkboxKeyMap.has(b)) {
|
|
1093
|
+
const y = this.checkboxKeyMap.get(b) || [];
|
|
1094
|
+
y.push(g), this.checkboxKeyMap.set(b, y);
|
|
1087
1095
|
} else
|
|
1088
|
-
this.checkboxKeyMap.set(
|
|
1096
|
+
this.checkboxKeyMap.set(b, [g]);
|
|
1089
1097
|
}
|
|
1090
|
-
this.selectionMap.set(
|
|
1091
|
-
key:
|
|
1092
|
-
row:
|
|
1093
|
-
check: ((
|
|
1098
|
+
this.selectionMap.set(g, {
|
|
1099
|
+
key: c ? f[c] : g,
|
|
1100
|
+
row: f,
|
|
1101
|
+
check: ((C = this.selectionMap.get(g)) == null ? void 0 : C.check) || !1
|
|
1094
1102
|
});
|
|
1095
|
-
const
|
|
1096
|
-
this.expandMap.set(
|
|
1097
|
-
readonly:
|
|
1098
|
-
index:
|
|
1099
|
-
rowIndex:
|
|
1103
|
+
const p = r || this.expandMap.get(g) || f._expand || !1;
|
|
1104
|
+
this.expandMap.set(g, p), this.rowKeyMap.set(g, {
|
|
1105
|
+
readonly: w,
|
|
1106
|
+
index: x,
|
|
1107
|
+
rowIndex: x,
|
|
1100
1108
|
level: e,
|
|
1101
|
-
height:
|
|
1109
|
+
height: m,
|
|
1102
1110
|
calculatedHeight: -1,
|
|
1103
1111
|
check: !1,
|
|
1104
|
-
selectable:
|
|
1105
|
-
expand:
|
|
1112
|
+
selectable: E,
|
|
1113
|
+
expand: p,
|
|
1106
1114
|
expandLazy: !1,
|
|
1107
|
-
hasChildren:
|
|
1115
|
+
hasChildren: f._hasChildren || (Array.isArray(f.children) ? f.children.length > 0 : !1),
|
|
1108
1116
|
expandLoading: !1,
|
|
1109
|
-
item:
|
|
1117
|
+
item: f,
|
|
1110
1118
|
parentRowKeys: i,
|
|
1111
1119
|
parentRowKey: i[i.length - 1] || "",
|
|
1112
|
-
isLastChild:
|
|
1113
|
-
}), Array.isArray(
|
|
1120
|
+
isLastChild: x === s - 1
|
|
1121
|
+
}), Array.isArray(f.children) && f.children.length && this.initData(f.children, e + 1, [...i, g]);
|
|
1114
1122
|
});
|
|
1115
1123
|
}
|
|
1116
1124
|
/**
|
|
@@ -2809,6 +2817,8 @@ class Dt {
|
|
|
2809
2817
|
n(this, "ENABLE_SELECTOR", !0);
|
|
2810
2818
|
/** 树形选择模式 */
|
|
2811
2819
|
n(this, "TREE_SELECT_MODE", "auto");
|
|
2820
|
+
/** 树形子项key名称 */
|
|
2821
|
+
n(this, "TREE_CHILDREN_KEY", "children");
|
|
2812
2822
|
/** 树形缩进宽度 */
|
|
2813
2823
|
n(this, "TREE_INDENT", 20);
|
|
2814
2824
|
/** 树形图标大小 */
|
|
@@ -4270,9 +4280,9 @@ class He {
|
|
|
4270
4280
|
const f = this.ctx.database.getColumns();
|
|
4271
4281
|
this.columns = f;
|
|
4272
4282
|
}
|
|
4273
|
-
this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [], this.
|
|
4283
|
+
this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [], this.visibleColumns = $t(this.columns);
|
|
4274
4284
|
const s = ot(this.visibleColumns), o = J(this.visibleColumns);
|
|
4275
|
-
this.height = e * s, this.width = o.reduce((f, x) => {
|
|
4285
|
+
this.height = e * s, this.visibleHeight = this.height, this.width = o.reduce((f, x) => {
|
|
4276
4286
|
const u = x.width || 100, { maxWidth: g, minWidth: m } = x;
|
|
4277
4287
|
return g && u > g ? f + g : m && u < m ? f + m : f + u;
|
|
4278
4288
|
}, 0), this.columnIndex = 0, this.resizeNum = 0;
|