vxe-table 3.12.16 → 3.12.17
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/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +5 -5
- package/es/table/src/body.js +60 -47
- package/es/table/src/methods.js +123 -24
- package/es/table/src/table.js +101 -23
- package/es/table/style.css +26 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +26 -0
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +350 -113
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +10 -5
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/body.js +71 -59
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +141 -23
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +126 -24
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +26 -0
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +26 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/edit/mixin.ts +5 -5
- package/packages/table/src/body.ts +62 -48
- package/packages/table/src/methods.ts +125 -24
- package/packages/table/src/table.ts +108 -24
- package/styles/components/table.scss +26 -0
- /package/es/{iconfont.1739333092714.ttf → iconfont.1739428244406.ttf} +0 -0
- /package/es/{iconfont.1739333092714.woff → iconfont.1739428244406.woff} +0 -0
- /package/es/{iconfont.1739333092714.woff2 → iconfont.1739428244406.woff2} +0 -0
- /package/lib/{iconfont.1739333092714.ttf → iconfont.1739428244406.ttf} +0 -0
- /package/lib/{iconfont.1739333092714.woff → iconfont.1739428244406.woff} +0 -0
- /package/lib/{iconfont.1739333092714.woff2 → iconfont.1739428244406.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
2
|
import { getFuncText, isEnableConf } from '../../ui/src/utils';
|
|
3
3
|
import { initTpImg } from '../../ui/src/dom';
|
|
4
|
+
import { getRowid } from './util';
|
|
4
5
|
import { VxeUI } from '../../ui';
|
|
5
6
|
import methods from './methods';
|
|
6
7
|
import TableBodyComponent from './body';
|
|
@@ -173,6 +174,74 @@ function handleUpdateResize(_vm) {
|
|
|
173
174
|
_vm.recalculate();
|
|
174
175
|
}
|
|
175
176
|
}
|
|
177
|
+
function renderRowExpandedVNs(h, $xeTable) {
|
|
178
|
+
const props = $xeTable;
|
|
179
|
+
const reactData = $xeTable;
|
|
180
|
+
const internalData = $xeTable;
|
|
181
|
+
const { treeConfig } = props;
|
|
182
|
+
const { expandColumn } = reactData;
|
|
183
|
+
const tableRowExpandedList = $xeTable.computeTableRowExpandedList;
|
|
184
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
185
|
+
const { mode } = expandOpts;
|
|
186
|
+
if (mode !== 'fixed') {
|
|
187
|
+
return renderEmptyElement($xeTable);
|
|
188
|
+
}
|
|
189
|
+
const expandVNs = [
|
|
190
|
+
h('div', {
|
|
191
|
+
key: 'repY',
|
|
192
|
+
ref: 'refRowExpandYSpaceElem'
|
|
193
|
+
})
|
|
194
|
+
];
|
|
195
|
+
if (expandColumn) {
|
|
196
|
+
tableRowExpandedList.forEach((row) => {
|
|
197
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
198
|
+
const { height: expandHeight, padding } = expandOpts;
|
|
199
|
+
const { fullAllDataRowIdData } = internalData;
|
|
200
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
201
|
+
const { transform, seqMode } = treeOpts;
|
|
202
|
+
const cellStyle = {};
|
|
203
|
+
const rowid = getRowid($xeTable, row);
|
|
204
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
205
|
+
let rowLevel = 0;
|
|
206
|
+
let seq = -1;
|
|
207
|
+
let _rowIndex = 0;
|
|
208
|
+
const rowIndex = $xeTable.getRowIndex(row);
|
|
209
|
+
const $rowIndex = $xeTable.getVMRowIndex(row);
|
|
210
|
+
if (rest) {
|
|
211
|
+
rowLevel = rest.level;
|
|
212
|
+
if (treeConfig && transform && seqMode === 'increasing') {
|
|
213
|
+
seq = rest._index + 1;
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
seq = rest.seq;
|
|
217
|
+
}
|
|
218
|
+
_rowIndex = rest._index;
|
|
219
|
+
}
|
|
220
|
+
if (expandHeight) {
|
|
221
|
+
cellStyle.height = `${expandHeight}px`;
|
|
222
|
+
}
|
|
223
|
+
if (treeConfig) {
|
|
224
|
+
cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`;
|
|
225
|
+
}
|
|
226
|
+
const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: '', type: 'body', level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
|
|
227
|
+
expandVNs.push(h('div', {
|
|
228
|
+
key: rowid,
|
|
229
|
+
class: ['vxe-body--row-expanded-cell', {
|
|
230
|
+
'is--padding': padding,
|
|
231
|
+
'is--ellipsis': expandHeight
|
|
232
|
+
}],
|
|
233
|
+
attrs: {
|
|
234
|
+
rowid
|
|
235
|
+
},
|
|
236
|
+
style: cellStyle
|
|
237
|
+
}, expandColumn.renderData(h, expandParams)));
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
return h('div', {
|
|
241
|
+
ref: 'refRowExpandElem',
|
|
242
|
+
class: 'vxe-table--row-expanded-wrapper'
|
|
243
|
+
}, expandVNs);
|
|
244
|
+
}
|
|
176
245
|
function renderScrollX(h, $xeTable) {
|
|
177
246
|
return h('div', {
|
|
178
247
|
key: 'vsx',
|
|
@@ -242,11 +311,18 @@ function renderViewport(h, $xeTable) {
|
|
|
242
311
|
const props = $xeTable;
|
|
243
312
|
const reactData = $xeTable;
|
|
244
313
|
const { showHeader, showFooter } = props;
|
|
245
|
-
const { overflowX, tableData, tableColumn, tableGroupColumn, footerTableData, columnStore } = reactData;
|
|
314
|
+
const { overflowX, scrollYLoad, tableData, tableColumn, tableGroupColumn, footerTableData, columnStore } = reactData;
|
|
246
315
|
const { leftList, rightList } = columnStore;
|
|
316
|
+
const leftFixedWidth = $xeTable.computeLeftFixedWidth;
|
|
317
|
+
const rightFixedWidth = $xeTable.computeRightFixedWidth;
|
|
318
|
+
const ons = {};
|
|
319
|
+
if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
|
|
320
|
+
ons.onWheel = $xeTable.triggerBodyWheelEvent;
|
|
321
|
+
}
|
|
247
322
|
return h('div', {
|
|
248
323
|
ref: 'refTableViewportElem',
|
|
249
|
-
class: 'vxe-table--viewport-wrapper'
|
|
324
|
+
class: 'vxe-table--viewport-wrapper',
|
|
325
|
+
on: ons
|
|
250
326
|
}, [
|
|
251
327
|
h('div', {
|
|
252
328
|
class: 'vxe-table--main-wrapper'
|
|
@@ -292,7 +368,8 @@ function renderViewport(h, $xeTable) {
|
|
|
292
368
|
}, [
|
|
293
369
|
leftList && leftList.length && overflowX ? renderFixed(h, $xeTable, 'left') : renderEmptyElement($xeTable),
|
|
294
370
|
rightList && rightList.length && overflowX ? renderFixed(h, $xeTable, 'right') : renderEmptyElement($xeTable)
|
|
295
|
-
])
|
|
371
|
+
]),
|
|
372
|
+
renderRowExpandedVNs(h, $xeTable)
|
|
296
373
|
]);
|
|
297
374
|
}
|
|
298
375
|
function renderBody(h, $xeTable) {
|
|
@@ -560,8 +637,9 @@ export default {
|
|
|
560
637
|
mini: 36
|
|
561
638
|
},
|
|
562
639
|
scrollVMLoading: false,
|
|
563
|
-
|
|
564
|
-
|
|
640
|
+
rowExpandHeightFlag: 1,
|
|
641
|
+
calcCellHeightFlag: 1,
|
|
642
|
+
resizeHeightFlag: 1,
|
|
565
643
|
isCustomStatus: false,
|
|
566
644
|
isDragRowMove: false,
|
|
567
645
|
dragRow: null,
|
|
@@ -934,6 +1012,24 @@ export default {
|
|
|
934
1012
|
computeCustomOpts() {
|
|
935
1013
|
return Object.assign({}, getConfig().table.customConfig, this.customConfig);
|
|
936
1014
|
},
|
|
1015
|
+
computeTableRowExpandedList() {
|
|
1016
|
+
const $xeTable = this;
|
|
1017
|
+
const reactData = $xeTable;
|
|
1018
|
+
const { rowExpandedMaps, tableData, expandColumn } = reactData;
|
|
1019
|
+
const expandList = [];
|
|
1020
|
+
if (expandColumn) {
|
|
1021
|
+
const rowKeys = {};
|
|
1022
|
+
tableData.forEach(row => {
|
|
1023
|
+
rowKeys[getRowid($xeTable, row)] = true;
|
|
1024
|
+
});
|
|
1025
|
+
XEUtils.each(rowExpandedMaps, (row, rowid) => {
|
|
1026
|
+
if (rowKeys[rowid]) {
|
|
1027
|
+
expandList.push(row);
|
|
1028
|
+
}
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
return expandList;
|
|
1032
|
+
},
|
|
937
1033
|
computeAutoWidthColumnList() {
|
|
938
1034
|
const { tableColumn, visibleColumn } = this;
|
|
939
1035
|
return tableColumn.length || visibleColumn.length ? visibleColumn.filter((column) => column.width === 'auto' || column.minWidth === 'auto') : [];
|
|
@@ -1367,27 +1463,9 @@ export default {
|
|
|
1367
1463
|
mounted() {
|
|
1368
1464
|
const $xeTable = this;
|
|
1369
1465
|
const props = $xeTable;
|
|
1370
|
-
const reactData = $xeTable;
|
|
1371
|
-
const { rowHeightStore } = reactData;
|
|
1372
|
-
const varEl = $xeTable.$refs.refVarElem;
|
|
1373
1466
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
1374
1467
|
const rowOpts = $xeTable.computeRowOpts;
|
|
1375
1468
|
const customOpts = $xeTable.computeCustomOpts;
|
|
1376
|
-
if (varEl) {
|
|
1377
|
-
const [defEl, mediumEl, smallEl, miniEl] = varEl.children;
|
|
1378
|
-
if (defEl) {
|
|
1379
|
-
rowHeightStore.default = defEl.clientHeight;
|
|
1380
|
-
}
|
|
1381
|
-
if (mediumEl) {
|
|
1382
|
-
rowHeightStore.medium = mediumEl.clientHeight;
|
|
1383
|
-
}
|
|
1384
|
-
if (smallEl) {
|
|
1385
|
-
rowHeightStore.small = smallEl.clientHeight;
|
|
1386
|
-
}
|
|
1387
|
-
if (miniEl) {
|
|
1388
|
-
rowHeightStore.mini = miniEl.clientHeight;
|
|
1389
|
-
}
|
|
1390
|
-
}
|
|
1391
1469
|
if (columnOpts.drag || rowOpts.drag || customOpts.allowSort) {
|
|
1392
1470
|
initTpImg();
|
|
1393
1471
|
}
|
package/es/table/style.css
CHANGED
|
@@ -3042,6 +3042,32 @@
|
|
|
3042
3042
|
flex-direction: row;
|
|
3043
3043
|
align-items: center;
|
|
3044
3044
|
}
|
|
3045
|
+
.vxe-table--render-default .vxe-table--row-expanded-wrapper {
|
|
3046
|
+
position: absolute;
|
|
3047
|
+
top: 0;
|
|
3048
|
+
left: 0;
|
|
3049
|
+
width: 100%;
|
|
3050
|
+
height: 100%;
|
|
3051
|
+
overflow: hidden;
|
|
3052
|
+
pointer-events: none;
|
|
3053
|
+
}
|
|
3054
|
+
.vxe-table--render-default .vxe-body--row-expanded-cell {
|
|
3055
|
+
position: absolute;
|
|
3056
|
+
z-index: 5;
|
|
3057
|
+
top: 0;
|
|
3058
|
+
left: 0;
|
|
3059
|
+
width: 100%;
|
|
3060
|
+
overflow: auto;
|
|
3061
|
+
background-color: var(--vxe-ui-layout-background-color);
|
|
3062
|
+
pointer-events: all;
|
|
3063
|
+
}
|
|
3064
|
+
.vxe-table--render-default .vxe-body--row-expanded-cell.is--padding {
|
|
3065
|
+
padding: var(--vxe-ui-table-expand-padding-default);
|
|
3066
|
+
}
|
|
3067
|
+
.vxe-table--render-default .vxe-body--row-expanded-place-column {
|
|
3068
|
+
border-bottom: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
3069
|
+
border-right: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
3070
|
+
}
|
|
3045
3071
|
.vxe-table--render-default .vxe-table--expanded {
|
|
3046
3072
|
cursor: pointer;
|
|
3047
3073
|
}
|