vxe-table 4.24.0-beta.2 → 4.24.0-beta.4
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/all.esm.js +144 -129
- package/dist/all.esm.min.js +3 -3
- package/dist/style.css +90 -34
- package/dist/style.mini.css +1 -1
- package/es/style.css +90 -34
- package/es/style.mini.css +1 -1
- package/es/table/module/export/hook.js +4 -3
- package/es/table/src/body.js +2 -2
- package/es/table/src/cell.js +6 -6
- package/es/table/src/table.js +32 -111
- package/es/table/src/tree.d.ts +6 -0
- package/es/table/src/tree.js +96 -0
- package/es/table/style.css +78 -26
- package/es/table/style.mini.css +1 -1
- package/es/ui/index.js +5 -6
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +78 -26
- package/es/vxe-table/style.mini.css +1 -1
- package/lib/index.umd.js +144 -129
- package/lib/index.umd.min.js +3 -3
- package/lib/style.css +90 -34
- package/lib/style.mini.css +1 -1
- package/lib/table/module/export/hook.js +4 -3
- package/lib/table/src/body.js +2 -2
- package/lib/table/src/cell.js +6 -6
- package/lib/table/src/table.js +32 -111
- package/lib/table/src/tree.d.ts +6 -0
- package/lib/table/src/tree.js +116 -0
- package/lib/table/style/style.css +78 -26
- package/lib/table/style/style.mini.css +1 -1
- package/lib/ui/index.js +5 -6
- package/lib/ui/src/log.js +1 -1
- package/lib/vxe-table/style/style.css +78 -26
- package/lib/vxe-table/style/style.mini.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/export/hook.ts +4 -3
- package/packages/table/src/body.ts +2 -2
- package/packages/table/src/cell.ts +9 -10
- package/packages/table/src/table.ts +32 -129
- package/packages/table/src/tree.ts +112 -0
- package/packages/ui/index.ts +4 -5
- package/styles/components/icon.scss +11 -3
- package/styles/components/old-icon.scss +6 -3
- package/styles/components/table.scss +14 -4
- package/styles/theme/base.scss +13 -9
- /package/dist/{iconfont.1794563906464.ttf → iconfont.1794794325954.ttf} +0 -0
- /package/dist/{iconfont.1794563906464.woff → iconfont.1794794325954.woff} +0 -0
- /package/dist/{iconfont.1794563906464.woff2 → iconfont.1794794325954.woff2} +0 -0
- /package/es/{iconfont.1794563906464.ttf → iconfont.1794794325954.ttf} +0 -0
- /package/es/{iconfont.1794563906464.woff → iconfont.1794794325954.woff} +0 -0
- /package/es/{iconfont.1794563906464.woff2 → iconfont.1794794325954.woff2} +0 -0
- /package/lib/{iconfont.1794563906464.ttf → iconfont.1794794325954.ttf} +0 -0
- /package/lib/{iconfont.1794563906464.woff → iconfont.1794794325954.woff} +0 -0
- /package/lib/{iconfont.1794563906464.woff2 → iconfont.1794794325954.woff2} +0 -0
|
@@ -696,6 +696,7 @@ hooks.add("tableExportModule", {
|
|
|
696
696
|
const { isAllSelected, isIndeterminate } = reactData;
|
|
697
697
|
const { mergeBodyCellMaps, mergeFooterCellMaps } = internalData;
|
|
698
698
|
const treeOpts = computeTreeOpts.value;
|
|
699
|
+
const treeIndent = treeOpts.indent || 20;
|
|
699
700
|
const { print: isPrint, widthMode, isHeader, isFooter, isColgroup, isMerge, colgroups, _columnConfs, original } = opts;
|
|
700
701
|
const isAutoWidth = widthMode === "auto";
|
|
701
702
|
const isScaleWidth = widthMode === "scale";
|
|
@@ -838,11 +839,11 @@ hooks.add("tableExportModule", {
|
|
|
838
839
|
}
|
|
839
840
|
classNames.push("vxe-table--tree-node");
|
|
840
841
|
if (column.type === "radio") {
|
|
841
|
-
return `<td class="${classNames.join(" ")}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level *
|
|
842
|
+
return `<td class="${classNames.join(" ")}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeIndent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell"><input type="radio" name="radio_${id}" ${item._radioDisabled ? "disabled " : ""}${getBooleanValue(cellValue) ? "checked" : ""}><span>${item._radioLabel}</span></div></div></div></td>`;
|
|
842
843
|
} else if (column.type === "checkbox") {
|
|
843
|
-
return `<td class="${classNames.join(" ")}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level *
|
|
844
|
+
return `<td class="${classNames.join(" ")}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeIndent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell"><input type="checkbox" ${item._checkboxDisabled ? "disabled " : ""}${getBooleanValue(cellValue) ? "checked" : ""}><span>${item._checkboxLabel}</span></div></div></div></td>`;
|
|
844
845
|
}
|
|
845
|
-
return `<td class="${classNames.join(" ")}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level *
|
|
846
|
+
return `<td class="${classNames.join(" ")}" title="${cellValue}"><div style="${getCellWidthStyle(column)}"><div class="vxe-table--tree-node-wrapper" style="padding-left: ${item._level * treeIndent}px"><div class="vxe-table--tree-icon-wrapper">${treeIcon}</div><div class="vxe-table--tree-cell">${cellValue}</div></div></div></td>`;
|
|
846
847
|
}
|
|
847
848
|
if (column.type === "radio") {
|
|
848
849
|
return `<td class="${classNames.join(" ")}"><div style="${getCellWidthStyle(column)}"><input type="radio" name="radio_${id}" ${item._radioDisabled ? "disabled " : ""}${getBooleanValue(cellValue) ? "checked" : ""}><span>${item._radioLabel}</span></div></td>`;
|
package/lib/table/src/body.js
CHANGED
|
@@ -115,7 +115,7 @@ var body_default = (
|
|
|
115
115
|
lineVNs.push(
|
|
116
116
|
(0, import_vue.h)("span", {
|
|
117
117
|
key: "le" + i,
|
|
118
|
-
class: ["vxe-tree
|
|
118
|
+
class: ["vxe-table--tree-node-line", `type--${lineType || "solid"}`, item.type],
|
|
119
119
|
style: item.style
|
|
120
120
|
})
|
|
121
121
|
);
|
|
@@ -663,7 +663,7 @@ var body_default = (
|
|
|
663
663
|
cellStyle.height = `${expandHeight}px`;
|
|
664
664
|
}
|
|
665
665
|
if (treeConfig) {
|
|
666
|
-
cellStyle.paddingLeft =
|
|
666
|
+
cellStyle.paddingLeft = `calc(${rowLevel} * var(--vxe-ui-table-tree-node-indent) + 30px)`;
|
|
667
667
|
}
|
|
668
668
|
const { showOverflow } = expandColumn || {};
|
|
669
669
|
const colid = expandColumn.id;
|
package/lib/table/src/cell.js
CHANGED
|
@@ -565,7 +565,7 @@ const Cell = {
|
|
|
565
565
|
const { rowGroupExpandedFlag } = tableReactData;
|
|
566
566
|
const { rowGroupExpandedMaps } = tableInternalData;
|
|
567
567
|
const aggregateOpts = computeAggregateOpts.value;
|
|
568
|
-
const { mode, padding,
|
|
568
|
+
const { mode, padding, showIcon, iconOpen, iconClose } = aggregateOpts;
|
|
569
569
|
const rowid = (0, import_util.getRowid)($table, row);
|
|
570
570
|
const isExpand = !!rowGroupExpandedFlag && !!rowGroupExpandedMaps[rowid];
|
|
571
571
|
return (0, import_vue.h)(
|
|
@@ -577,8 +577,8 @@ const Cell = {
|
|
|
577
577
|
"is--expanded": isExpand
|
|
578
578
|
}
|
|
579
579
|
],
|
|
580
|
-
style: mode !== "column" && padding
|
|
581
|
-
paddingLeft:
|
|
580
|
+
style: mode !== "column" && padding ? {
|
|
581
|
+
paddingLeft: `calc(${level} * var(--vxe-ui-table-row-group-tree-node-indent))`
|
|
582
582
|
} : void 0
|
|
583
583
|
},
|
|
584
584
|
[
|
|
@@ -623,7 +623,7 @@ const Cell = {
|
|
|
623
623
|
const { treeExpandedFlag } = tableReactData;
|
|
624
624
|
const { fullAllDataRowIdData, treeExpandedMaps, treeExpandLazyLoadedMaps } = tableInternalData;
|
|
625
625
|
const treeOpts = computeTreeOpts.value;
|
|
626
|
-
const { padding,
|
|
626
|
+
const { padding, lazy, trigger, visibleMethod, iconLoaded, showIcon, iconOpen, iconClose } = treeOpts;
|
|
627
627
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
628
628
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
629
629
|
const rowChilds = row[childrenField];
|
|
@@ -657,8 +657,8 @@ const Cell = {
|
|
|
657
657
|
"is--active": isActive
|
|
658
658
|
}
|
|
659
659
|
],
|
|
660
|
-
style: padding
|
|
661
|
-
paddingLeft:
|
|
660
|
+
style: padding ? {
|
|
661
|
+
paddingLeft: `calc(${level} * var(--vxe-ui-table-tree-node-indent))`
|
|
662
662
|
} : void 0
|
|
663
663
|
},
|
|
664
664
|
[
|
package/lib/table/src/table.js
CHANGED
|
@@ -40,6 +40,7 @@ var import_utils = require("../../ui/src/utils");
|
|
|
40
40
|
var import_util = require("./util");
|
|
41
41
|
var import_vn = require("../../ui/src/vn");
|
|
42
42
|
var import_anime = require("../../ui/src/anime");
|
|
43
|
+
var import_tree = require("./tree");
|
|
43
44
|
var import_log = require("../../ui/src/log");
|
|
44
45
|
var import_store = require("./store");
|
|
45
46
|
var import_cell = __toESM(require("./cell"));
|
|
@@ -622,11 +623,14 @@ var table_default = (
|
|
|
622
623
|
return "";
|
|
623
624
|
});
|
|
624
625
|
const computeTableStyle = (0, import_vue.computed)(() => {
|
|
625
|
-
const { treeConfig } = props;
|
|
626
626
|
const barWidth = computeScrollYWidth.value;
|
|
627
627
|
const barHeight = computeScrollXHeight.value;
|
|
628
628
|
const treeOpts = computeTreeOpts.value;
|
|
629
|
-
const { indent, lineWidth, lineColor } = treeOpts;
|
|
629
|
+
const { indent: treeIndent, lineWidth, lineColor } = treeOpts;
|
|
630
|
+
const expandOpts = computeExpandOpts.value;
|
|
631
|
+
const { indent: edIndent } = expandOpts;
|
|
632
|
+
const aggregateOpts = computeAggregateOpts.value;
|
|
633
|
+
const { indent: rgIndent } = aggregateOpts;
|
|
630
634
|
const stys = {};
|
|
631
635
|
if (barWidth || barHeight) {
|
|
632
636
|
stys["--vxe-ui-table-view-scrollbar-width"] = (0, import_dom.toCssUnit)(barWidth || barHeight);
|
|
@@ -634,8 +638,14 @@ var table_default = (
|
|
|
634
638
|
stys["--vxe-ui-table-view-scrollbar-height"] = (0, import_dom.toCssUnit)(barHeight || barWidth);
|
|
635
639
|
stys["--vxe-ui-scrollbar-x-height"] = (0, import_dom.toCssUnit)(barHeight || barWidth);
|
|
636
640
|
}
|
|
637
|
-
if (
|
|
638
|
-
stys["--vxe-ui-table-tree-node-indent"] = (0, import_dom.toCssUnit)(
|
|
641
|
+
if (edIndent) {
|
|
642
|
+
stys["--vxe-ui-table-expand-tree-node-indent"] = (0, import_dom.toCssUnit)(edIndent);
|
|
643
|
+
}
|
|
644
|
+
if (rgIndent) {
|
|
645
|
+
stys["--vxe-ui-table-row-group-tree-node-indent"] = (0, import_dom.toCssUnit)(rgIndent);
|
|
646
|
+
}
|
|
647
|
+
if (treeIndent) {
|
|
648
|
+
stys["--vxe-ui-table-tree-node-indent"] = (0, import_dom.toCssUnit)(treeIndent);
|
|
639
649
|
}
|
|
640
650
|
if (lineWidth) {
|
|
641
651
|
stys["--vxe-ui-table-tree-node-line-width"] = (0, import_dom.toCssUnit)(lineWidth);
|
|
@@ -888,6 +898,7 @@ var table_default = (
|
|
|
888
898
|
computeExpandOpts,
|
|
889
899
|
computeTreeOpts,
|
|
890
900
|
computeShowTreeLine,
|
|
901
|
+
computeShowTreeRootLine,
|
|
891
902
|
computeEmptyOpts,
|
|
892
903
|
computeLoadingOpts,
|
|
893
904
|
computeCellOffsetWidth,
|
|
@@ -2134,109 +2145,17 @@ var table_default = (
|
|
|
2134
2145
|
return cellValue;
|
|
2135
2146
|
};
|
|
2136
2147
|
};
|
|
2137
|
-
function getTreeNodeLines(isExpandable, depth, linesMask, isFirstRow, isLastRow, showRootLine) {
|
|
2138
|
-
const lines = [];
|
|
2139
|
-
for (let col = 1; col <= depth; col++) {
|
|
2140
|
-
const leftVal = `var(--vxe-ui-table-tree-node-btn-width) + var(--vxe-ui-table-tree-node-indent) * ${col - 1}`;
|
|
2141
|
-
const through = (linesMask & 1 << col - 1) !== 0;
|
|
2142
|
-
if (col === 1 && !showRootLine) {
|
|
2143
|
-
continue;
|
|
2144
|
-
}
|
|
2145
|
-
if (col < depth) {
|
|
2146
|
-
if (through) {
|
|
2147
|
-
let top = "0";
|
|
2148
|
-
let height = "100%";
|
|
2149
|
-
if (isFirstRow) {
|
|
2150
|
-
top = "50%";
|
|
2151
|
-
height = "50%";
|
|
2152
|
-
} else if (isLastRow) {
|
|
2153
|
-
top = "0";
|
|
2154
|
-
height = "50%";
|
|
2155
|
-
}
|
|
2156
|
-
lines.push({
|
|
2157
|
-
type: "v",
|
|
2158
|
-
style: {
|
|
2159
|
-
left: `calc(${leftVal})`,
|
|
2160
|
-
top,
|
|
2161
|
-
height
|
|
2162
|
-
}
|
|
2163
|
-
});
|
|
2164
|
-
}
|
|
2165
|
-
} else {
|
|
2166
|
-
let vTop = "0";
|
|
2167
|
-
let vHeight = through ? "100%" : "50%";
|
|
2168
|
-
if (isFirstRow && isLastRow) {
|
|
2169
|
-
vTop = "50%";
|
|
2170
|
-
vHeight = "0px";
|
|
2171
|
-
} else if (isFirstRow) {
|
|
2172
|
-
vTop = "50%";
|
|
2173
|
-
vHeight = "50%";
|
|
2174
|
-
} else if (isLastRow) {
|
|
2175
|
-
vTop = "0";
|
|
2176
|
-
vHeight = "50%";
|
|
2177
|
-
}
|
|
2178
|
-
if (isExpandable && vHeight !== "0px") {
|
|
2179
|
-
let cutType = "v cut";
|
|
2180
|
-
if (vTop === "0" && vHeight === "50%") {
|
|
2181
|
-
cutType = "v cut-top";
|
|
2182
|
-
} else if (vTop === "50%" && vHeight === "50%") {
|
|
2183
|
-
cutType = "v cut-bottom";
|
|
2184
|
-
} else if (vHeight === "100%") {
|
|
2185
|
-
cutType = "v cut-full";
|
|
2186
|
-
}
|
|
2187
|
-
lines.push({
|
|
2188
|
-
type: cutType,
|
|
2189
|
-
style: {
|
|
2190
|
-
left: `calc(${leftVal})`,
|
|
2191
|
-
top: vTop,
|
|
2192
|
-
height: vHeight
|
|
2193
|
-
}
|
|
2194
|
-
});
|
|
2195
|
-
} else {
|
|
2196
|
-
if (vHeight !== "0px") {
|
|
2197
|
-
lines.push({
|
|
2198
|
-
type: "v",
|
|
2199
|
-
style: {
|
|
2200
|
-
left: `calc(${leftVal})`,
|
|
2201
|
-
top: vTop,
|
|
2202
|
-
height: vHeight
|
|
2203
|
-
}
|
|
2204
|
-
});
|
|
2205
|
-
}
|
|
2206
|
-
}
|
|
2207
|
-
if (isExpandable) {
|
|
2208
|
-
lines.push({
|
|
2209
|
-
type: "h",
|
|
2210
|
-
style: {
|
|
2211
|
-
left: `calc(${leftVal} + var(--vxe-ui-table-tree-node-btn-width) / 2 + 1px)`,
|
|
2212
|
-
top: "50%",
|
|
2213
|
-
width: "calc(var(--vxe-ui-table-tree-node-indent) - var(--vxe-ui-table-tree-node-btn-width) - 0.25em)"
|
|
2214
|
-
}
|
|
2215
|
-
});
|
|
2216
|
-
} else {
|
|
2217
|
-
lines.push({
|
|
2218
|
-
type: "h",
|
|
2219
|
-
style: {
|
|
2220
|
-
left: `calc(${leftVal})`,
|
|
2221
|
-
top: "50%",
|
|
2222
|
-
width: "calc(var(--vxe-ui-table-tree-node-indent) - var(--vxe-ui-table-tree-node-btn-width))"
|
|
2223
|
-
}
|
|
2224
|
-
});
|
|
2225
|
-
}
|
|
2226
|
-
}
|
|
2227
|
-
}
|
|
2228
|
-
return lines;
|
|
2229
|
-
}
|
|
2230
2148
|
const updateAfterTreeIndex = () => {
|
|
2231
2149
|
const { fullDataRowIdData, fullAllDataRowIdData, afterFullData, afterTreeFullData } = internalData;
|
|
2232
2150
|
const treeOpts = computeTreeOpts.value;
|
|
2233
|
-
const { lazy, transform,
|
|
2151
|
+
const { lazy, transform, mapChildrenField } = treeOpts;
|
|
2234
2152
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
2235
2153
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
2236
2154
|
const showTreeLine = computeShowTreeLine.value;
|
|
2155
|
+
const showTreeRootLine = computeShowTreeRootLine.value;
|
|
2237
2156
|
const fullMaps = {};
|
|
2238
2157
|
const treeFullSize = afterTreeFullData.length;
|
|
2239
|
-
|
|
2158
|
+
let rowNum = 0;
|
|
2240
2159
|
const { handleGetRowId } = (0, import_util.createHandleGetRowId)($xeTable);
|
|
2241
2160
|
function handleTreeDFS(row, index, items, parentRow, depth, isFirstRow, isLastRow, isLastChild, stackMask, seq) {
|
|
2242
2161
|
const rowid = handleGetRowId(row);
|
|
@@ -2244,22 +2163,19 @@ var table_default = (
|
|
|
2244
2163
|
const rowChilds = row[transform ? mapChildrenField : childrenField];
|
|
2245
2164
|
if (rowRest) {
|
|
2246
2165
|
rowRest.seq = seq;
|
|
2247
|
-
rowRest._seq = rowNum;
|
|
2248
2166
|
rowRest.items = items;
|
|
2249
2167
|
rowRest.treeIndex = index;
|
|
2250
|
-
rowRest._index = rowNum;
|
|
2251
|
-
rowRest._tIndex = rowNum;
|
|
2252
2168
|
} else {
|
|
2253
2169
|
rowRest = {
|
|
2254
2170
|
row,
|
|
2255
2171
|
rowid,
|
|
2256
|
-
_seq:
|
|
2257
|
-
seq,
|
|
2172
|
+
_seq: 0,
|
|
2173
|
+
seq: 0,
|
|
2258
2174
|
index,
|
|
2259
2175
|
$index: -1,
|
|
2260
|
-
_index:
|
|
2176
|
+
_index: 0,
|
|
2261
2177
|
treeIndex: index,
|
|
2262
|
-
_tIndex:
|
|
2178
|
+
_tIndex: 0,
|
|
2263
2179
|
items,
|
|
2264
2180
|
parent: parentRow,
|
|
2265
2181
|
level: 0,
|
|
@@ -2278,6 +2194,8 @@ var table_default = (
|
|
|
2278
2194
|
}
|
|
2279
2195
|
rowRest.seq = seq;
|
|
2280
2196
|
rowRest._seq = rowNum;
|
|
2197
|
+
rowRest._index = rowNum;
|
|
2198
|
+
rowRest._tIndex = rowNum;
|
|
2281
2199
|
rowRest.level = depth - 1;
|
|
2282
2200
|
rowRest.linesMask = linesMask;
|
|
2283
2201
|
const hasChild = rowChilds && rowChilds.length;
|
|
@@ -2289,14 +2207,17 @@ var table_default = (
|
|
|
2289
2207
|
isLazyLoaded = !!rest.treeLoaded;
|
|
2290
2208
|
}
|
|
2291
2209
|
const isExpandable = lazy ? isLazyLoaded ? hasChild : hasChild || hasLazyChilds : hasChild;
|
|
2292
|
-
rowRest.treeLines = showTreeLine && treeFullSize > 1 ? getTreeNodeLines(isExpandable, depth, linesMask, isFirstRow, isLastRow,
|
|
2210
|
+
rowRest.treeLines = showTreeLine && treeFullSize > 1 ? (0, import_tree.getTreeNodeLines)(isExpandable, depth, linesMask, isFirstRow, isLastRow, showTreeRootLine) : [];
|
|
2293
2211
|
let nextStackMask = stackMask;
|
|
2294
2212
|
if (!isLastChild) {
|
|
2295
2213
|
nextStackMask |= 1 << depth;
|
|
2296
2214
|
}
|
|
2215
|
+
rowNum++;
|
|
2297
2216
|
fullMaps[rowid] = row;
|
|
2298
|
-
|
|
2299
|
-
|
|
2217
|
+
if (rowChilds) {
|
|
2218
|
+
for (let i = 0; i < rowChilds.length; i++) {
|
|
2219
|
+
handleTreeDFS(rowChilds[i], i, rowChilds, row, depth + 1, false, false, i === rowChilds.length - 1, nextStackMask, `${seq}.${i + 1}`);
|
|
2220
|
+
}
|
|
2300
2221
|
}
|
|
2301
2222
|
}
|
|
2302
2223
|
for (let i = 0; i < treeFullSize; i++) {
|
|
@@ -13419,7 +13340,7 @@ var table_default = (
|
|
|
13419
13340
|
const { handleGetRowId } = (0, import_util.createHandleGetRowId)($xeTable);
|
|
13420
13341
|
tableRowExpandedList.forEach((row) => {
|
|
13421
13342
|
const expandOpts2 = computeExpandOpts.value;
|
|
13422
|
-
const { height: expandHeight, padding
|
|
13343
|
+
const { height: expandHeight, padding } = expandOpts2;
|
|
13423
13344
|
const { fullAllDataRowIdData, fullColumnIdData } = internalData;
|
|
13424
13345
|
const treeOpts = computeTreeOpts.value;
|
|
13425
13346
|
const { transform, seqMode } = treeOpts;
|
|
@@ -13449,7 +13370,7 @@ var table_default = (
|
|
|
13449
13370
|
cellStyle.height = `${expandHeight}px`;
|
|
13450
13371
|
}
|
|
13451
13372
|
if (isRowGroupStatus || treeConfig) {
|
|
13452
|
-
cellStyle.paddingLeft =
|
|
13373
|
+
cellStyle.paddingLeft = `calc(${rowLevel} * var(--vxe-ui-table-expand-tree-node-indent) + 30px)`;
|
|
13453
13374
|
}
|
|
13454
13375
|
let columnIndex = -1;
|
|
13455
13376
|
let $columnIndex = -1;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VxeTableDefines } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* 分配树节点的连接线
|
|
4
|
+
* 类名(cut-full / cut-top / cut-bottom)
|
|
5
|
+
*/
|
|
6
|
+
export declare function getTreeNodeLines(isExpandable: boolean, depth: number, linesMask: number, isFirstRow: boolean, isLastRow: boolean, showRootLine: boolean | undefined): VxeTableDefines.RowCacheTreeLineData[];
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var tree_exports = {};
|
|
20
|
+
__export(tree_exports, {
|
|
21
|
+
getTreeNodeLines: () => getTreeNodeLines
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(tree_exports);
|
|
24
|
+
function getTreeNodeLines(isExpandable, depth, linesMask, isFirstRow, isLastRow, showRootLine) {
|
|
25
|
+
const lines = [];
|
|
26
|
+
for (let col = 1; col <= depth; col++) {
|
|
27
|
+
const leftVal = `var(--vxe-ui-table-tree-node-btn-width) + var(--vxe-ui-table-tree-node-indent) * ${col - 1}`;
|
|
28
|
+
const through = (linesMask & 1 << col - 1) !== 0;
|
|
29
|
+
if (col === 1 && !showRootLine) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (col < depth) {
|
|
33
|
+
if (through) {
|
|
34
|
+
let top = "0";
|
|
35
|
+
let height = "100%";
|
|
36
|
+
if (isFirstRow) {
|
|
37
|
+
top = "50%";
|
|
38
|
+
height = "50%";
|
|
39
|
+
} else if (isLastRow) {
|
|
40
|
+
top = "0";
|
|
41
|
+
height = "50%";
|
|
42
|
+
}
|
|
43
|
+
lines.push({
|
|
44
|
+
type: "v",
|
|
45
|
+
style: {
|
|
46
|
+
left: `calc(${leftVal})`,
|
|
47
|
+
top,
|
|
48
|
+
height
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
let vTop = "0";
|
|
54
|
+
let vHeight = through ? "100%" : "50%";
|
|
55
|
+
if (isFirstRow && isLastRow) {
|
|
56
|
+
vTop = "50%";
|
|
57
|
+
vHeight = "0px";
|
|
58
|
+
} else if (isFirstRow) {
|
|
59
|
+
vTop = "50%";
|
|
60
|
+
vHeight = "50%";
|
|
61
|
+
} else if (isLastRow) {
|
|
62
|
+
vTop = "0";
|
|
63
|
+
vHeight = "50%";
|
|
64
|
+
}
|
|
65
|
+
if (isExpandable && vHeight !== "0px") {
|
|
66
|
+
let cutType = "v cut";
|
|
67
|
+
if (vTop === "0" && vHeight === "50%") {
|
|
68
|
+
cutType = "v cut-top";
|
|
69
|
+
} else if (vTop === "50%" && vHeight === "50%") {
|
|
70
|
+
cutType = "v cut-bottom";
|
|
71
|
+
} else if (vHeight === "100%") {
|
|
72
|
+
cutType = "v cut-full";
|
|
73
|
+
}
|
|
74
|
+
lines.push({
|
|
75
|
+
type: cutType,
|
|
76
|
+
style: {
|
|
77
|
+
left: `calc(${leftVal})`,
|
|
78
|
+
top: vTop,
|
|
79
|
+
height: vHeight
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
} else {
|
|
83
|
+
if (vHeight !== "0px") {
|
|
84
|
+
lines.push({
|
|
85
|
+
type: "v",
|
|
86
|
+
style: {
|
|
87
|
+
left: `calc(${leftVal})`,
|
|
88
|
+
top: vTop,
|
|
89
|
+
height: vHeight
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (isExpandable) {
|
|
95
|
+
lines.push({
|
|
96
|
+
type: "h",
|
|
97
|
+
style: {
|
|
98
|
+
left: `calc(${leftVal} + var(--vxe-ui-table-tree-node-btn-width) / 2 + 1px)`,
|
|
99
|
+
top: "50%",
|
|
100
|
+
width: "calc(var(--vxe-ui-table-tree-node-indent) - var(--vxe-ui-table-tree-node-btn-width) - 0.2em)"
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
} else {
|
|
104
|
+
lines.push({
|
|
105
|
+
type: "h",
|
|
106
|
+
style: {
|
|
107
|
+
left: `calc(${leftVal})`,
|
|
108
|
+
top: "50%",
|
|
109
|
+
width: "calc(var(--vxe-ui-table-tree-node-indent) - var(--vxe-ui-table-tree-node-btn-width) / 2 - 0.1em)"
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return lines;
|
|
116
|
+
}
|