vxe-table 4.23.19 → 4.24.0-beta.1
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/README.md +2 -0
- package/dist/all.esm.js +631 -343
- package/dist/all.esm.min.js +3 -3
- package/dist/style.css +85 -13
- package/dist/style.mini.css +1 -1
- package/es/components.d.ts +1 -3
- package/es/components.js +1 -2
- package/es/style.css +85 -13
- package/es/style.mini.css +1 -1
- package/es/table/module/custom/panel.js +2 -2
- package/es/table/module/edit/hook.js +95 -5
- package/es/table/src/body.d.ts +2 -2
- package/es/table/src/body.js +26 -49
- package/es/table/src/table.js +256 -35
- package/es/table/style.css +82 -13
- package/es/table/style.mini.css +1 -1
- package/es/ui/abandon.d.ts +82 -0
- package/es/ui/abandon.js +90 -0
- package/es/ui/index.d.ts +1 -82
- package/es/ui/index.js +6 -91
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +82 -13
- package/es/vxe-table/style.mini.css +1 -1
- package/lib/components.d.ts +1 -3
- package/lib/components.js +1 -2
- package/lib/index.umd.js +630 -340
- package/lib/index.umd.min.js +3 -3
- package/lib/style.css +85 -13
- package/lib/style.mini.css +1 -1
- package/lib/table/module/custom/panel.js +2 -2
- package/lib/table/module/edit/hook.js +95 -5
- package/lib/table/src/body.d.ts +2 -2
- package/lib/table/src/body.js +26 -49
- package/lib/table/src/table.js +256 -35
- package/lib/table/style/style.css +82 -13
- package/lib/table/style/style.mini.css +1 -1
- package/lib/ui/abandon.d.ts +82 -0
- package/lib/ui/abandon.js +110 -0
- package/lib/ui/index.d.ts +1 -82
- package/lib/ui/index.js +7 -91
- package/lib/ui/src/log.js +1 -1
- package/lib/vxe-table/style/style.css +82 -13
- package/lib/vxe-table/style/style.mini.css +1 -1
- package/package.json +2 -2
- package/packages/components.ts +2 -5
- package/packages/table/module/custom/panel.ts +2 -2
- package/packages/table/module/edit/hook.ts +95 -5
- package/packages/table/src/body.ts +28 -50
- package/packages/table/src/table.ts +292 -34
- package/packages/ui/abandon.ts +136 -0
- package/packages/ui/index.ts +12 -122
- package/styles/components/table.scss +141 -87
- package/styles/theme/base.scss +3 -0
- /package/dist/{iconfont.1794474448348.ttf → iconfont.1794559626301.ttf} +0 -0
- /package/dist/{iconfont.1794474448348.woff → iconfont.1794559626301.woff} +0 -0
- /package/dist/{iconfont.1794474448348.woff2 → iconfont.1794559626301.woff2} +0 -0
- /package/es/{iconfont.1794474448348.ttf → iconfont.1794559626301.ttf} +0 -0
- /package/es/{iconfont.1794474448348.woff → iconfont.1794559626301.woff} +0 -0
- /package/es/{iconfont.1794474448348.woff2 → iconfont.1794559626301.woff2} +0 -0
- /package/lib/{iconfont.1794474448348.ttf → iconfont.1794559626301.ttf} +0 -0
- /package/lib/{iconfont.1794474448348.woff → iconfont.1794559626301.woff} +0 -0
- /package/lib/{iconfont.1794474448348.woff2 → iconfont.1794559626301.woff2} +0 -0
|
@@ -377,8 +377,8 @@ var panel_default = (
|
|
|
377
377
|
const { prevDragCol, prevDragGroupField, prevDragAggFnColid, prevDragPos, prevDragToChild } = customPanelInternalData;
|
|
378
378
|
const dragOffsetIndex = prevDragPos === "bottom" ? 1 : 0;
|
|
379
379
|
if (prevDragGroupField || prevDragAggFnColid) {
|
|
380
|
-
if ($xeTable.
|
|
381
|
-
$xeTable.
|
|
380
|
+
if ($xeTable.handlePivotTableAggPanelDgedEvent) {
|
|
381
|
+
$xeTable.handlePivotTableAggPanelDgedEvent(evnt);
|
|
382
382
|
}
|
|
383
383
|
} else if (prevDragCol && dragCol) {
|
|
384
384
|
if (prevDragCol !== dragCol) {
|
|
@@ -127,7 +127,25 @@ hooks.add("tableEditModule", {
|
|
|
127
127
|
}
|
|
128
128
|
pChilds[funcName](item);
|
|
129
129
|
pMapChilds[funcName](item);
|
|
130
|
-
const rest = {
|
|
130
|
+
const rest = {
|
|
131
|
+
row: item,
|
|
132
|
+
rowid,
|
|
133
|
+
_seq: -1,
|
|
134
|
+
seq: -1,
|
|
135
|
+
index: -1,
|
|
136
|
+
_index: -1,
|
|
137
|
+
$index: -1,
|
|
138
|
+
treeIndex: -1,
|
|
139
|
+
_tIndex: -1,
|
|
140
|
+
items: pChilds,
|
|
141
|
+
parent: parentRow,
|
|
142
|
+
level: parentLevel + 1,
|
|
143
|
+
linesMask: 0,
|
|
144
|
+
height: 0,
|
|
145
|
+
resizeHeight: 0,
|
|
146
|
+
oTop: 0,
|
|
147
|
+
expandHeight: 0
|
|
148
|
+
};
|
|
131
149
|
fullDataRowIdData[rowid] = rest;
|
|
132
150
|
fullAllDataRowIdData[rowid] = rest;
|
|
133
151
|
} else {
|
|
@@ -136,7 +154,25 @@ hooks.add("tableEditModule", {
|
|
|
136
154
|
}
|
|
137
155
|
afterFullData[funcName](item);
|
|
138
156
|
tableFullTreeData[funcName](item);
|
|
139
|
-
const rest = {
|
|
157
|
+
const rest = {
|
|
158
|
+
row: item,
|
|
159
|
+
rowid,
|
|
160
|
+
_seq: -1,
|
|
161
|
+
seq: -1,
|
|
162
|
+
index: -1,
|
|
163
|
+
_index: -1,
|
|
164
|
+
$index: -1,
|
|
165
|
+
treeIndex: -1,
|
|
166
|
+
_tIndex: -1,
|
|
167
|
+
items: tableFullTreeData,
|
|
168
|
+
parent: null,
|
|
169
|
+
level: 0,
|
|
170
|
+
linesMask: 0,
|
|
171
|
+
height: 0,
|
|
172
|
+
resizeHeight: 0,
|
|
173
|
+
oTop: 0,
|
|
174
|
+
expandHeight: 0
|
|
175
|
+
};
|
|
140
176
|
fullDataRowIdData[rowid] = rest;
|
|
141
177
|
fullAllDataRowIdData[rowid] = rest;
|
|
142
178
|
}
|
|
@@ -179,7 +215,25 @@ hooks.add("tableEditModule", {
|
|
|
179
215
|
} else {
|
|
180
216
|
newRecords.forEach((item) => {
|
|
181
217
|
const rowid = (0, import_util.getRowid)($xeTable, item);
|
|
182
|
-
const rest = {
|
|
218
|
+
const rest = {
|
|
219
|
+
row: item,
|
|
220
|
+
rowid,
|
|
221
|
+
_seq: -1,
|
|
222
|
+
seq: -1,
|
|
223
|
+
index: -1,
|
|
224
|
+
_index: -1,
|
|
225
|
+
$index: -1,
|
|
226
|
+
treeIndex: -1,
|
|
227
|
+
_tIndex: -1,
|
|
228
|
+
items: afterFullData,
|
|
229
|
+
parent: null,
|
|
230
|
+
level: 0,
|
|
231
|
+
linesMask: 0,
|
|
232
|
+
height: 0,
|
|
233
|
+
resizeHeight: 0,
|
|
234
|
+
oTop: 0,
|
|
235
|
+
expandHeight: 0
|
|
236
|
+
};
|
|
183
237
|
fullDataRowIdData[rowid] = rest;
|
|
184
238
|
fullAllDataRowIdData[rowid] = rest;
|
|
185
239
|
afterFullData.unshift(item);
|
|
@@ -204,7 +258,25 @@ hooks.add("tableEditModule", {
|
|
|
204
258
|
} else {
|
|
205
259
|
newRecords.forEach((item) => {
|
|
206
260
|
const rowid = (0, import_util.getRowid)($xeTable, item);
|
|
207
|
-
const rest = {
|
|
261
|
+
const rest = {
|
|
262
|
+
row: item,
|
|
263
|
+
rowid,
|
|
264
|
+
_seq: -1,
|
|
265
|
+
seq: -1,
|
|
266
|
+
index: -1,
|
|
267
|
+
_index: -1,
|
|
268
|
+
treeIndex: -1,
|
|
269
|
+
_tIndex: -1,
|
|
270
|
+
$index: -1,
|
|
271
|
+
items: afterFullData,
|
|
272
|
+
parent: null,
|
|
273
|
+
level: 0,
|
|
274
|
+
linesMask: 0,
|
|
275
|
+
height: 0,
|
|
276
|
+
resizeHeight: 0,
|
|
277
|
+
oTop: 0,
|
|
278
|
+
expandHeight: 0
|
|
279
|
+
};
|
|
208
280
|
fullDataRowIdData[rowid] = rest;
|
|
209
281
|
fullAllDataRowIdData[rowid] = rest;
|
|
210
282
|
afterFullData.push(item);
|
|
@@ -243,7 +315,25 @@ hooks.add("tableEditModule", {
|
|
|
243
315
|
treeRecords,
|
|
244
316
|
(item) => {
|
|
245
317
|
const rowid = (0, import_util.getRowid)($xeTable, item);
|
|
246
|
-
const rest = {
|
|
318
|
+
const rest = {
|
|
319
|
+
row: item,
|
|
320
|
+
rowid,
|
|
321
|
+
_seq: -1,
|
|
322
|
+
seq: -1,
|
|
323
|
+
index: -1,
|
|
324
|
+
_index: -1,
|
|
325
|
+
$index: -1,
|
|
326
|
+
treeIndex: -1,
|
|
327
|
+
_tIndex: -1,
|
|
328
|
+
items: parentMapChilds,
|
|
329
|
+
parent: parentRow,
|
|
330
|
+
level: parentLevel + 1,
|
|
331
|
+
linesMask: 0,
|
|
332
|
+
height: 0,
|
|
333
|
+
resizeHeight: 0,
|
|
334
|
+
oTop: 0,
|
|
335
|
+
expandHeight: 0
|
|
336
|
+
};
|
|
247
337
|
if (item[childrenField]) {
|
|
248
338
|
item[mapChildrenField] = item[childrenField];
|
|
249
339
|
}
|
package/lib/table/src/body.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropType } from 'vue';
|
|
1
|
+
import { PropType, VNode } from 'vue';
|
|
2
2
|
import type { VxeTableDefines } from '../../../types';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
tableData: PropType<any[]>;
|
|
@@ -8,7 +8,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8
8
|
type: PropType<"right" | "left" | "">;
|
|
9
9
|
default: string;
|
|
10
10
|
};
|
|
11
|
-
}, () =>
|
|
11
|
+
}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
12
12
|
[key: string]: any;
|
|
13
13
|
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
14
14
|
tableData: PropType<any[]>;
|
package/lib/table/src/body.js
CHANGED
|
@@ -79,7 +79,8 @@ var body_default = (
|
|
|
79
79
|
computeVirtualXOpts,
|
|
80
80
|
computeVirtualYOpts,
|
|
81
81
|
computeIsBodyRenderOptimize,
|
|
82
|
-
computeRendererOpts
|
|
82
|
+
computeRendererOpts,
|
|
83
|
+
computeShowTreeLine
|
|
83
84
|
} = $xeTable.getComputeMaps();
|
|
84
85
|
const refElem = (0, import_vue.ref)();
|
|
85
86
|
const refBodyScroll = (0, import_vue.ref)();
|
|
@@ -95,60 +96,33 @@ var body_default = (
|
|
|
95
96
|
const { lastSTime } = tableInternalData;
|
|
96
97
|
return !!(isDragResize || lastSTime && Date.now() < lastSTime + delayHover);
|
|
97
98
|
};
|
|
98
|
-
const renderLine = (rowid, params
|
|
99
|
+
const renderLine = (rowid, params) => {
|
|
99
100
|
const { column } = params;
|
|
100
101
|
const { treeConfig } = tableProps;
|
|
101
|
-
const cellOpts = computeCellOpts.value;
|
|
102
|
-
const rowOpts = computeRowOpts.value;
|
|
103
|
-
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
104
|
-
const treeOpts = computeTreeOpts.value;
|
|
105
102
|
const { slots, treeNode } = column;
|
|
106
|
-
const
|
|
107
|
-
if (treeConfig && treeNode
|
|
103
|
+
const lineVNs = [];
|
|
104
|
+
if (treeConfig && treeNode) {
|
|
108
105
|
if (slots && slots.line) {
|
|
109
106
|
return $xeTable.callSlot(slots.line, params);
|
|
110
107
|
}
|
|
108
|
+
const treeOpts = computeTreeOpts.value;
|
|
109
|
+
const { fullAllDataRowIdData } = tableInternalData;
|
|
110
|
+
const { lineType } = treeOpts;
|
|
111
111
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
if (!rLevel && !treeOpts.showRootLine) {
|
|
122
|
-
return [];
|
|
123
|
-
}
|
|
124
|
-
if (prevRow) {
|
|
125
|
-
const prevRowRest = fullAllDataRowIdData[(0, import_util.getRowid)($xeTable, prevRow)] || {};
|
|
126
|
-
lineHeight = `${prevRowRest.lineHeight || 0}px`;
|
|
127
|
-
} else if (rLevel && parentRow) {
|
|
128
|
-
const parentRowRest = fullAllDataRowIdData[(0, import_util.getRowid)($xeTable, parentRow)] || {};
|
|
129
|
-
lineHeight = `calc(-1em + ${Math.floor(cellHeight / 2 + (0, import_util.getCellRestHeight)(parentRowRest, cellOpts, rowOpts, defaultRowHeight) / 2)}px)`;
|
|
130
|
-
}
|
|
131
|
-
return [
|
|
132
|
-
(0, import_vue.h)(
|
|
133
|
-
"div",
|
|
134
|
-
{
|
|
135
|
-
key: "tl",
|
|
136
|
-
class: "vxe-tree--line-wrapper"
|
|
137
|
-
},
|
|
138
|
-
[
|
|
139
|
-
(0, import_vue.h)("div", {
|
|
140
|
-
class: "vxe-tree--line",
|
|
141
|
-
style: {
|
|
142
|
-
height: lineHeight,
|
|
143
|
-
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
144
|
-
left: `calc(${rLevel * treeOpts.indent}px + 1em)`
|
|
145
|
-
}
|
|
112
|
+
const treeLines = rowRest.treeLines;
|
|
113
|
+
if (treeLines) {
|
|
114
|
+
treeLines.forEach((item, i) => {
|
|
115
|
+
lineVNs.push(
|
|
116
|
+
(0, import_vue.h)("span", {
|
|
117
|
+
key: "le" + i,
|
|
118
|
+
class: ["vxe-tree--line", `type--${lineType || "solid"}`, item.type],
|
|
119
|
+
style: item.style
|
|
146
120
|
})
|
|
147
|
-
|
|
148
|
-
)
|
|
149
|
-
|
|
121
|
+
);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
150
124
|
}
|
|
151
|
-
return
|
|
125
|
+
return lineVNs;
|
|
152
126
|
};
|
|
153
127
|
const renderTdColumn = (seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) => {
|
|
154
128
|
const $xeGrid = $xeTable.xeGrid;
|
|
@@ -156,6 +130,7 @@ var body_default = (
|
|
|
156
130
|
const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, treeConfig, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps;
|
|
157
131
|
const { tableData, tableColumn, dragRow, overflowX, overflowY, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps, currColFlag } = tableReactData;
|
|
158
132
|
const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore, keepUpdateFieldMaps, currentCol } = tableInternalData;
|
|
133
|
+
const showTreeLine = computeShowTreeLine.value;
|
|
159
134
|
const cellOpts = computeCellOpts.value;
|
|
160
135
|
const validOpts = computeValidOpts.value;
|
|
161
136
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
@@ -349,6 +324,7 @@ var body_default = (
|
|
|
349
324
|
}
|
|
350
325
|
}
|
|
351
326
|
}
|
|
327
|
+
const tdStyle = {};
|
|
352
328
|
const tcStyle = {};
|
|
353
329
|
if (maxHeight) {
|
|
354
330
|
tcStyle.maxHeight = maxHeight + "px";
|
|
@@ -367,6 +343,7 @@ var body_default = (
|
|
|
367
343
|
}
|
|
368
344
|
if (scrollYLoad || scrollXLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
369
345
|
tcStyle.height = cellHeight + "px";
|
|
346
|
+
tdStyle["--vxe-ui-table-cell-height"] = cellHeight + "px";
|
|
370
347
|
} else {
|
|
371
348
|
tcStyle.minHeight = cellHeight + "px";
|
|
372
349
|
}
|
|
@@ -390,8 +367,8 @@ var body_default = (
|
|
|
390
367
|
})
|
|
391
368
|
);
|
|
392
369
|
} else {
|
|
393
|
-
if (treeConfig) {
|
|
394
|
-
tdVNs.push(...renderLine(rowid, cellParams
|
|
370
|
+
if (treeConfig && showTreeLine) {
|
|
371
|
+
tdVNs.push(...renderLine(rowid, cellParams));
|
|
395
372
|
}
|
|
396
373
|
const clVNs = [];
|
|
397
374
|
if (!isVNPreEmptyStatus) {
|
|
@@ -532,7 +509,7 @@ var body_default = (
|
|
|
532
509
|
],
|
|
533
510
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex,
|
|
534
511
|
...tdAttrs,
|
|
535
|
-
style: Object.assign(
|
|
512
|
+
style: Object.assign(tdStyle, import_xe_utils.default.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, import_xe_utils.default.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle),
|
|
536
513
|
...tdOns
|
|
537
514
|
},
|
|
538
515
|
isOptimizeMode && fixedHiddenColumn ? [] : tdVNs
|
package/lib/table/src/table.js
CHANGED
|
@@ -581,6 +581,14 @@ var table_default = (
|
|
|
581
581
|
const computeTreeOpts = (0, import_vue.computed)(() => {
|
|
582
582
|
return Object.assign({}, getConfig().table.treeConfig, props.treeConfig);
|
|
583
583
|
});
|
|
584
|
+
const computeShowTreeLine = (0, import_vue.computed)(() => {
|
|
585
|
+
const treeOpts = computeTreeOpts.value;
|
|
586
|
+
return (0, import_utils.getDefaultConfig)(treeOpts.showLine, treeOpts.line);
|
|
587
|
+
});
|
|
588
|
+
const computeShowTreeRootLine = (0, import_vue.computed)(() => {
|
|
589
|
+
const treeOpts = computeTreeOpts.value;
|
|
590
|
+
return treeOpts.showRootLine;
|
|
591
|
+
});
|
|
584
592
|
const computeEmptyOpts = (0, import_vue.computed)(() => {
|
|
585
593
|
return Object.assign({}, getConfig().table.emptyRender, props.emptyRender);
|
|
586
594
|
});
|
|
@@ -614,8 +622,11 @@ var table_default = (
|
|
|
614
622
|
return "";
|
|
615
623
|
});
|
|
616
624
|
const computeTableStyle = (0, import_vue.computed)(() => {
|
|
625
|
+
const { treeConfig } = props;
|
|
617
626
|
const barWidth = computeScrollYWidth.value;
|
|
618
627
|
const barHeight = computeScrollXHeight.value;
|
|
628
|
+
const treeOpts = computeTreeOpts.value;
|
|
629
|
+
const { indent, lineWidth, lineColor } = treeOpts;
|
|
619
630
|
const stys = {};
|
|
620
631
|
if (barWidth || barHeight) {
|
|
621
632
|
stys["--vxe-ui-table-view-scrollbar-width"] = (0, import_dom.toCssUnit)(barWidth || barHeight);
|
|
@@ -623,6 +634,15 @@ var table_default = (
|
|
|
623
634
|
stys["--vxe-ui-table-view-scrollbar-height"] = (0, import_dom.toCssUnit)(barHeight || barWidth);
|
|
624
635
|
stys["--vxe-ui-scrollbar-x-height"] = (0, import_dom.toCssUnit)(barHeight || barWidth);
|
|
625
636
|
}
|
|
637
|
+
if (treeConfig) {
|
|
638
|
+
stys["--vxe-ui-table-tree-node-indent"] = (0, import_dom.toCssUnit)(indent);
|
|
639
|
+
}
|
|
640
|
+
if (lineWidth) {
|
|
641
|
+
stys["--vxe-ui-table-tree-node-line-width"] = (0, import_dom.toCssUnit)(lineWidth);
|
|
642
|
+
}
|
|
643
|
+
if (lineColor) {
|
|
644
|
+
stys["--vxe-ui-table-tree-node-line-color"] = (0, import_dom.toCssUnit)(lineColor);
|
|
645
|
+
}
|
|
626
646
|
return stys;
|
|
627
647
|
});
|
|
628
648
|
const computeTableRowExpandedList = (0, import_vue.computed)(() => {
|
|
@@ -867,6 +887,7 @@ var table_default = (
|
|
|
867
887
|
computePrintOpts,
|
|
868
888
|
computeExpandOpts,
|
|
869
889
|
computeTreeOpts,
|
|
890
|
+
computeShowTreeLine,
|
|
870
891
|
computeEmptyOpts,
|
|
871
892
|
computeLoadingOpts,
|
|
872
893
|
computeCellOffsetWidth,
|
|
@@ -2050,9 +2071,9 @@ var table_default = (
|
|
|
2050
2071
|
if (!el || !el.clientWidth) {
|
|
2051
2072
|
return;
|
|
2052
2073
|
}
|
|
2053
|
-
const treeOpts = computeTreeOpts.value;
|
|
2054
2074
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
2055
|
-
|
|
2075
|
+
const showTreeLine = computeShowTreeLine.value;
|
|
2076
|
+
if (!isAllOverflow && (scrollYLoad || scrollXLoad || treeConfig && showTreeLine)) {
|
|
2056
2077
|
const { handleGetRowId } = (0, import_util.createHandleGetRowId)($xeTable);
|
|
2057
2078
|
const rowWrapperMaps = {};
|
|
2058
2079
|
el.querySelectorAll(".vxe-cell--wrapper[rowid]").forEach((wrapperElem) => {
|
|
@@ -2113,36 +2134,174 @@ var table_default = (
|
|
|
2113
2134
|
return cellValue;
|
|
2114
2135
|
};
|
|
2115
2136
|
};
|
|
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
|
+
}
|
|
2116
2230
|
const updateAfterTreeIndex = () => {
|
|
2117
2231
|
const { fullDataRowIdData, fullAllDataRowIdData, afterFullData, afterTreeFullData } = internalData;
|
|
2118
2232
|
const treeOpts = computeTreeOpts.value;
|
|
2119
|
-
const { transform, mapChildrenField } = treeOpts;
|
|
2233
|
+
const { lazy, transform, showRootLine, mapChildrenField } = treeOpts;
|
|
2120
2234
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
2235
|
+
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
2236
|
+
const showTreeLine = computeShowTreeLine.value;
|
|
2121
2237
|
const fullMaps = {};
|
|
2122
|
-
|
|
2238
|
+
const treeFullSize = afterTreeFullData.length;
|
|
2239
|
+
const rowNum = 0;
|
|
2123
2240
|
const { handleGetRowId } = (0, import_util.createHandleGetRowId)($xeTable);
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2241
|
+
function handleTreeDFS(row, index, items, parentRow, depth, isFirstRow, isLastRow, isLastChild, stackMask, seq) {
|
|
2242
|
+
const rowid = handleGetRowId(row);
|
|
2243
|
+
let rowRest = fullAllDataRowIdData[rowid];
|
|
2244
|
+
const rowChilds = row[transform ? mapChildrenField : childrenField];
|
|
2245
|
+
if (rowRest) {
|
|
2246
|
+
rowRest.seq = seq;
|
|
2247
|
+
rowRest._seq = rowNum;
|
|
2248
|
+
rowRest.items = items;
|
|
2249
|
+
rowRest.treeIndex = index;
|
|
2250
|
+
rowRest._index = rowNum;
|
|
2251
|
+
rowRest._tIndex = rowNum;
|
|
2252
|
+
} else {
|
|
2253
|
+
rowRest = {
|
|
2254
|
+
row,
|
|
2255
|
+
rowid,
|
|
2256
|
+
_seq: rowNum,
|
|
2257
|
+
seq,
|
|
2258
|
+
index,
|
|
2259
|
+
$index: -1,
|
|
2260
|
+
_index: rowNum,
|
|
2261
|
+
treeIndex: index,
|
|
2262
|
+
_tIndex: rowNum,
|
|
2263
|
+
items,
|
|
2264
|
+
parent: parentRow,
|
|
2265
|
+
level: 0,
|
|
2266
|
+
linesMask: 0,
|
|
2267
|
+
height: 0,
|
|
2268
|
+
resizeHeight: 0,
|
|
2269
|
+
oTop: 0,
|
|
2270
|
+
expandHeight: 0
|
|
2271
|
+
};
|
|
2272
|
+
fullAllDataRowIdData[rowid] = rowRest;
|
|
2273
|
+
fullDataRowIdData[rowid] = rowRest;
|
|
2274
|
+
}
|
|
2275
|
+
let linesMask = stackMask >> 1;
|
|
2276
|
+
if (!isLastChild) {
|
|
2277
|
+
linesMask |= 1 << depth - 1;
|
|
2278
|
+
}
|
|
2279
|
+
rowRest.seq = seq;
|
|
2280
|
+
rowRest._seq = rowNum;
|
|
2281
|
+
rowRest.level = depth - 1;
|
|
2282
|
+
rowRest.linesMask = linesMask;
|
|
2283
|
+
const hasChild = rowChilds && rowChilds.length;
|
|
2284
|
+
let hasLazyChilds = false;
|
|
2285
|
+
let isLazyLoaded = false;
|
|
2286
|
+
if (lazy) {
|
|
2287
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
2288
|
+
hasLazyChilds = row[hasChildField];
|
|
2289
|
+
isLazyLoaded = !!rest.treeLoaded;
|
|
2290
|
+
}
|
|
2291
|
+
const isExpandable = lazy ? isLazyLoaded ? hasChild : hasChild || hasLazyChilds : hasChild;
|
|
2292
|
+
rowRest.treeLines = showTreeLine && treeFullSize > 1 ? getTreeNodeLines(isExpandable, depth, linesMask, isFirstRow, isLastRow, showRootLine) : [];
|
|
2293
|
+
let nextStackMask = stackMask;
|
|
2294
|
+
if (!isLastChild) {
|
|
2295
|
+
nextStackMask |= 1 << depth;
|
|
2296
|
+
}
|
|
2297
|
+
fullMaps[rowid] = row;
|
|
2298
|
+
for (let i = 0; i < rowChilds.length; i++) {
|
|
2299
|
+
handleTreeDFS(rowChilds[i], i, rowChilds, row, depth + 1, false, false, i === rowChilds.length - 1, nextStackMask, `${seq}.${i + 1}`);
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
for (let i = 0; i < treeFullSize; i++) {
|
|
2303
|
+
handleTreeDFS(afterTreeFullData[i], i, afterTreeFullData, null, 1, !i, i === treeFullSize - 1, i === treeFullSize - 1, 0, "" + i);
|
|
2304
|
+
}
|
|
2146
2305
|
if (transform) {
|
|
2147
2306
|
afterFullData.forEach((row, index) => {
|
|
2148
2307
|
const rowid = handleGetRowId(row);
|
|
@@ -2168,7 +2327,25 @@ var table_default = (
|
|
|
2168
2327
|
rowRest._seq = rowNum;
|
|
2169
2328
|
rowRest._index = index;
|
|
2170
2329
|
} else {
|
|
2171
|
-
const rest = {
|
|
2330
|
+
const rest = {
|
|
2331
|
+
row,
|
|
2332
|
+
rowid,
|
|
2333
|
+
_seq: rowNum,
|
|
2334
|
+
seq,
|
|
2335
|
+
index: -1,
|
|
2336
|
+
$index: -1,
|
|
2337
|
+
_index: index,
|
|
2338
|
+
treeIndex: -1,
|
|
2339
|
+
_tIndex: -1,
|
|
2340
|
+
items: [],
|
|
2341
|
+
parent: null,
|
|
2342
|
+
level: 0,
|
|
2343
|
+
linesMask: 0,
|
|
2344
|
+
height: 0,
|
|
2345
|
+
resizeHeight: 0,
|
|
2346
|
+
oTop: 0,
|
|
2347
|
+
expandHeight: 0
|
|
2348
|
+
};
|
|
2172
2349
|
fullAllDataRowIdData[rowid] = rest;
|
|
2173
2350
|
fullDataRowIdData[rowid] = rest;
|
|
2174
2351
|
}
|
|
@@ -4850,7 +5027,25 @@ var table_default = (
|
|
|
4850
5027
|
(childRow, index, items, path, parentItem, nodes) => {
|
|
4851
5028
|
const rowid = (0, import_util.getRowid)($xeTable, childRow);
|
|
4852
5029
|
const parentRow = parentItem || parentRest.row;
|
|
4853
|
-
const rest = {
|
|
5030
|
+
const rest = {
|
|
5031
|
+
row: childRow,
|
|
5032
|
+
rowid,
|
|
5033
|
+
_seq: -1,
|
|
5034
|
+
seq: -1,
|
|
5035
|
+
index,
|
|
5036
|
+
_index: -1,
|
|
5037
|
+
$index: -1,
|
|
5038
|
+
treeIndex: -1,
|
|
5039
|
+
_tIndex: -1,
|
|
5040
|
+
items,
|
|
5041
|
+
parent: parentRow,
|
|
5042
|
+
level: parentLevel + nodes.length,
|
|
5043
|
+
linesMask: 0,
|
|
5044
|
+
height: 0,
|
|
5045
|
+
resizeHeight: 0,
|
|
5046
|
+
oTop: 0,
|
|
5047
|
+
expandHeight: 0
|
|
5048
|
+
};
|
|
4854
5049
|
fullDataRowIdData[rowid] = rest;
|
|
4855
5050
|
fullAllDataRowIdData[rowid] = rest;
|
|
4856
5051
|
},
|
|
@@ -9293,9 +9488,25 @@ var table_default = (
|
|
|
9293
9488
|
errLog("vxe.error.repeatKey", [currKeyField, rowid]);
|
|
9294
9489
|
}
|
|
9295
9490
|
if (!rowRest) {
|
|
9296
|
-
rowRest = {
|
|
9297
|
-
|
|
9298
|
-
|
|
9491
|
+
rowRest = {
|
|
9492
|
+
row,
|
|
9493
|
+
rowid,
|
|
9494
|
+
_seq: -1,
|
|
9495
|
+
seq,
|
|
9496
|
+
index: -1,
|
|
9497
|
+
_index: -1,
|
|
9498
|
+
$index: -1,
|
|
9499
|
+
treeIndex: index,
|
|
9500
|
+
_tIndex: -1,
|
|
9501
|
+
items,
|
|
9502
|
+
parent: parentRow,
|
|
9503
|
+
level,
|
|
9504
|
+
linesMask: 0,
|
|
9505
|
+
height: 0,
|
|
9506
|
+
resizeHeight: 0,
|
|
9507
|
+
oTop: 0,
|
|
9508
|
+
expandHeight: 0
|
|
9509
|
+
};
|
|
9299
9510
|
}
|
|
9300
9511
|
if (isReset || isReLoaded) {
|
|
9301
9512
|
rowRest.treeLoaded = false;
|
|
@@ -11001,8 +11212,8 @@ var table_default = (
|
|
|
11001
11212
|
$xeTable.handleHeaderCellDragMousedownEvent(evnt, params);
|
|
11002
11213
|
}
|
|
11003
11214
|
}
|
|
11004
|
-
if (!triggerDrag && (0, import_utils.hasEnableConf)(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.
|
|
11005
|
-
$xeTable.
|
|
11215
|
+
if (!triggerDrag && (0, import_utils.hasEnableConf)(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handleHeadCellAreaMouseDnEvent) {
|
|
11216
|
+
$xeTable.handleHeadCellAreaMouseDnEvent(evnt, Object.assign({ cell, triggerSort, triggerFilter }, params));
|
|
11006
11217
|
}
|
|
11007
11218
|
$xeTable.focus();
|
|
11008
11219
|
if ($xeTable.closeMenu) {
|
|
@@ -13585,7 +13796,7 @@ var table_default = (
|
|
|
13585
13796
|
const validTipConfig = computeValidTipConfig.value;
|
|
13586
13797
|
const validOpts = computeValidOpts.value;
|
|
13587
13798
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
13588
|
-
const
|
|
13799
|
+
const showTreeLine = computeShowTreeLine.value;
|
|
13589
13800
|
const rowOpts = computeRowOpts.value;
|
|
13590
13801
|
const columnOpts = computeColumnOpts.value;
|
|
13591
13802
|
const vSize = computeSize.value;
|
|
@@ -13643,7 +13854,7 @@ var table_default = (
|
|
|
13643
13854
|
"not--footer": !showFooter,
|
|
13644
13855
|
"is--group": isGroup,
|
|
13645
13856
|
"is-row-group": isRowGroupStatus,
|
|
13646
|
-
"is--tree-line": treeConfig &&
|
|
13857
|
+
"is--tree-line": treeConfig && showTreeLine,
|
|
13647
13858
|
"is--fixed-left": leftList.length,
|
|
13648
13859
|
"is--fixed-right": rightList.length,
|
|
13649
13860
|
"is--animat": !!props.animat,
|
|
@@ -14196,6 +14407,16 @@ var table_default = (
|
|
|
14196
14407
|
$xeTable.recalculate(true);
|
|
14197
14408
|
});
|
|
14198
14409
|
});
|
|
14410
|
+
const lineFlag = (0, import_vue.ref)(0);
|
|
14411
|
+
(0, import_vue.watch)(computeShowTreeLine, () => {
|
|
14412
|
+
lineFlag.value++;
|
|
14413
|
+
});
|
|
14414
|
+
(0, import_vue.watch)(computeShowTreeRootLine, () => {
|
|
14415
|
+
lineFlag.value++;
|
|
14416
|
+
});
|
|
14417
|
+
(0, import_vue.watch)(lineFlag, () => {
|
|
14418
|
+
updateAfterDataIndex();
|
|
14419
|
+
});
|
|
14199
14420
|
(0, import_vue.watch)(reScrollFlag, () => {
|
|
14200
14421
|
updateScrollbar().then(() => {
|
|
14201
14422
|
updateScrollbar();
|