vxe-table 4.10.14 → 4.10.15
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/hook.js +5 -5
- package/es/table/src/body.js +57 -43
- package/es/table/src/table.js +209 -44
- 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 +330 -107
- 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/hook.js +10 -5
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/src/body.js +65 -58
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/table.js +253 -42
- 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/hook.ts +5 -5
- package/packages/table/src/body.ts +60 -50
- package/packages/table/src/table.ts +220 -44
- package/styles/components/table.scss +26 -0
- /package/es/{iconfont.1739333111603.ttf → iconfont.1739428251944.ttf} +0 -0
- /package/es/{iconfont.1739333111603.woff → iconfont.1739428251944.woff} +0 -0
- /package/es/{iconfont.1739333111603.woff2 → iconfont.1739428251944.woff2} +0 -0
- /package/lib/{iconfont.1739333111603.ttf → iconfont.1739428251944.ttf} +0 -0
- /package/lib/{iconfont.1739333111603.woff → iconfont.1739428251944.woff} +0 -0
- /package/lib/{iconfont.1739333111603.woff2 → iconfont.1739428251944.woff2} +0 -0
package/es/table/src/body.js
CHANGED
|
@@ -21,7 +21,7 @@ export default defineComponent({
|
|
|
21
21
|
setup(props) {
|
|
22
22
|
const $xeTable = inject('$xeTable', {});
|
|
23
23
|
const { xID, props: tableProps, context: tableContext, reactData: tableReactData, internalData: tableInternalData } = $xeTable;
|
|
24
|
-
const { computeEditOpts, computeMouseOpts, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeColumnDragOpts,
|
|
24
|
+
const { computeEditOpts, computeMouseOpts, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeColumnDragOpts, computeResizableOpts } = $xeTable.getComputeMaps();
|
|
25
25
|
const refElem = ref();
|
|
26
26
|
const refBodyScroll = ref();
|
|
27
27
|
const refBodyTable = ref();
|
|
@@ -379,7 +379,7 @@ export default defineComponent({
|
|
|
379
379
|
};
|
|
380
380
|
const renderRows = (fixedType, isOptimizeMode, tableData, tableColumn) => {
|
|
381
381
|
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
|
|
382
|
-
const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData;
|
|
382
|
+
const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove, rowExpandHeightFlag } = tableReactData;
|
|
383
383
|
const { fullAllDataRowIdData } = tableInternalData;
|
|
384
384
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
385
385
|
const radioOpts = computeRadioOpts.value;
|
|
@@ -412,19 +412,19 @@ export default defineComponent({
|
|
|
412
412
|
};
|
|
413
413
|
}
|
|
414
414
|
const rowid = getRowid($xeTable, row);
|
|
415
|
-
const
|
|
415
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
416
416
|
let rowLevel = 0;
|
|
417
417
|
let seq = -1;
|
|
418
418
|
let _rowIndex = 0;
|
|
419
|
-
if (
|
|
420
|
-
rowLevel =
|
|
419
|
+
if (rowRest) {
|
|
420
|
+
rowLevel = rowRest.level;
|
|
421
421
|
if (treeConfig && transform && seqMode === 'increasing') {
|
|
422
|
-
seq =
|
|
422
|
+
seq = rowRest._index + 1;
|
|
423
423
|
}
|
|
424
424
|
else {
|
|
425
|
-
seq =
|
|
425
|
+
seq = rowRest.seq;
|
|
426
426
|
}
|
|
427
|
-
_rowIndex =
|
|
427
|
+
_rowIndex = rowRest._index;
|
|
428
428
|
}
|
|
429
429
|
const params = { $table: $xeTable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
|
|
430
430
|
// 行是否被展开
|
|
@@ -472,39 +472,57 @@ export default defineComponent({
|
|
|
472
472
|
// 如果行被展开了
|
|
473
473
|
if (isExpandRow) {
|
|
474
474
|
const expandOpts = computeExpandOpts.value;
|
|
475
|
-
const { height: expandHeight, padding } = expandOpts;
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
475
|
+
const { height: expandHeight, padding, mode: expandMode } = expandOpts;
|
|
476
|
+
if (expandMode === 'fixed') {
|
|
477
|
+
rows.push(h('tr', {
|
|
478
|
+
class: 'vxe-body--row-expanded-place',
|
|
479
|
+
key: `expand_${rowid}`,
|
|
480
|
+
rowid
|
|
481
|
+
}, [
|
|
482
|
+
h('td', {
|
|
483
|
+
class: 'vxe-body--row-expanded-place-column',
|
|
484
|
+
colspan: tableColumn.length,
|
|
485
|
+
style: {
|
|
486
|
+
height: `${rowExpandHeightFlag ? (rowRest.expandHeight || expandHeight) : 0}px`
|
|
487
|
+
}
|
|
488
|
+
})
|
|
489
|
+
]));
|
|
482
490
|
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
491
|
+
else {
|
|
492
|
+
const cellStyle = {};
|
|
493
|
+
if (expandHeight) {
|
|
494
|
+
cellStyle.height = `${expandHeight}px`;
|
|
495
|
+
}
|
|
496
|
+
if (treeConfig) {
|
|
497
|
+
cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`;
|
|
498
|
+
}
|
|
499
|
+
const { showOverflow } = expandColumn;
|
|
500
|
+
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow;
|
|
501
|
+
const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
|
|
502
|
+
rows.push(h('tr', {
|
|
503
|
+
class: ['vxe-body--expanded-row', {
|
|
504
|
+
'is--padding': padding
|
|
505
|
+
}],
|
|
506
|
+
key: `expand_${rowid}`
|
|
496
507
|
}, [
|
|
497
|
-
h('
|
|
498
|
-
class: {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
508
|
+
h('td', {
|
|
509
|
+
class: ['vxe-body--expanded-column', {
|
|
510
|
+
'fixed--hidden': fixedType && !hasFixedColumn,
|
|
511
|
+
'col--ellipsis': hasEllipsis
|
|
512
|
+
}],
|
|
513
|
+
colspan: tableColumn.length
|
|
503
514
|
}, [
|
|
504
|
-
|
|
515
|
+
h('div', {
|
|
516
|
+
class: ['vxe-body--expanded-cell', {
|
|
517
|
+
'is--ellipsis': expandHeight
|
|
518
|
+
}],
|
|
519
|
+
style: cellStyle
|
|
520
|
+
}, [
|
|
521
|
+
expandColumn.renderData(expandParams)
|
|
522
|
+
])
|
|
505
523
|
])
|
|
506
|
-
])
|
|
507
|
-
|
|
524
|
+
]));
|
|
525
|
+
}
|
|
508
526
|
}
|
|
509
527
|
// 如果是树形表格
|
|
510
528
|
if (isExpandTree) {
|
|
@@ -551,14 +569,13 @@ export default defineComponent({
|
|
|
551
569
|
const emptyOpts = computeEmptyOpts.value;
|
|
552
570
|
const mouseOpts = computeMouseOpts.value;
|
|
553
571
|
const rowDragOpts = computeRowDragOpts.value;
|
|
554
|
-
const
|
|
555
|
-
const rightFixedWidth = computeRightFixedWidth.value;
|
|
572
|
+
const expandOpts = computeExpandOpts.value;
|
|
556
573
|
let renderDataList = tableData;
|
|
557
574
|
let renderColumnList = tableColumn;
|
|
558
575
|
let isOptimizeMode = false;
|
|
559
576
|
// 如果是使用优化模式
|
|
560
577
|
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
561
|
-
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
578
|
+
if ((expandColumn && expandOpts.mode !== 'fixed') || spanMethod || footerSpanMethod) {
|
|
562
579
|
// 如果不支持优化模式
|
|
563
580
|
}
|
|
564
581
|
else {
|
|
@@ -639,9 +656,6 @@ export default defineComponent({
|
|
|
639
656
|
$xeTable.triggerBodyScrollEvent(evnt, fixedType);
|
|
640
657
|
}
|
|
641
658
|
};
|
|
642
|
-
if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
|
|
643
|
-
ons.onWheel = $xeTable.triggerBodyWheelEvent;
|
|
644
|
-
}
|
|
645
659
|
return h('div', {
|
|
646
660
|
ref: refElem,
|
|
647
661
|
class: ['vxe-table--body-wrapper', fixedType ? `fixed-${fixedType}--wrapper` : 'body--wrapper'],
|