vxe-table 4.10.14 → 4.10.15-beta.0
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.1739426300784.ttf} +0 -0
- /package/es/{iconfont.1739333111603.woff → iconfont.1739426300784.woff} +0 -0
- /package/es/{iconfont.1739333111603.woff2 → iconfont.1739426300784.woff2} +0 -0
- /package/lib/{iconfont.1739333111603.ttf → iconfont.1739426300784.ttf} +0 -0
- /package/lib/{iconfont.1739333111603.woff → iconfont.1739426300784.woff} +0 -0
- /package/lib/{iconfont.1739333111603.woff2 → iconfont.1739426300784.woff2} +0 -0
|
@@ -27,7 +27,7 @@ export default defineComponent({
|
|
|
27
27
|
const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTablePrivateMethods)
|
|
28
28
|
|
|
29
29
|
const { xID, props: tableProps, context: tableContext, reactData: tableReactData, internalData: tableInternalData } = $xeTable
|
|
30
|
-
const { computeEditOpts, computeMouseOpts, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeColumnDragOpts,
|
|
30
|
+
const { computeEditOpts, computeMouseOpts, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeColumnDragOpts, computeResizableOpts } = $xeTable.getComputeMaps()
|
|
31
31
|
|
|
32
32
|
const refElem = ref() as Ref<HTMLDivElement>
|
|
33
33
|
const refBodyScroll = ref() as Ref<HTMLDivElement>
|
|
@@ -429,7 +429,7 @@ export default defineComponent({
|
|
|
429
429
|
|
|
430
430
|
const renderRows = (fixedType: 'left' | 'right' | '', isOptimizeMode: boolean, tableData: any[], tableColumn: VxeTableDefines.ColumnInfo[]) => {
|
|
431
431
|
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps
|
|
432
|
-
const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData
|
|
432
|
+
const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove, rowExpandHeightFlag } = tableReactData
|
|
433
433
|
const { fullAllDataRowIdData } = tableInternalData
|
|
434
434
|
const checkboxOpts = computeCheckboxOpts.value
|
|
435
435
|
const radioOpts = computeRadioOpts.value
|
|
@@ -462,18 +462,18 @@ export default defineComponent({
|
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
464
|
const rowid = getRowid($xeTable, row)
|
|
465
|
-
const
|
|
465
|
+
const rowRest = fullAllDataRowIdData[rowid]
|
|
466
466
|
let rowLevel = 0
|
|
467
467
|
let seq: string | number = -1
|
|
468
468
|
let _rowIndex = 0
|
|
469
|
-
if (
|
|
470
|
-
rowLevel =
|
|
469
|
+
if (rowRest) {
|
|
470
|
+
rowLevel = rowRest.level
|
|
471
471
|
if (treeConfig && transform && seqMode === 'increasing') {
|
|
472
|
-
seq =
|
|
472
|
+
seq = rowRest._index + 1
|
|
473
473
|
} else {
|
|
474
|
-
seq =
|
|
474
|
+
seq = rowRest.seq
|
|
475
475
|
}
|
|
476
|
-
_rowIndex =
|
|
476
|
+
_rowIndex = rowRest._index
|
|
477
477
|
}
|
|
478
478
|
const params = { $table: $xeTable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex }
|
|
479
479
|
// 行是否被展开
|
|
@@ -537,46 +537,60 @@ export default defineComponent({
|
|
|
537
537
|
// 如果行被展开了
|
|
538
538
|
if (isExpandRow) {
|
|
539
539
|
const expandOpts = computeExpandOpts.value
|
|
540
|
-
const { height: expandHeight, padding } = expandOpts
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
}
|
|
548
|
-
const { showOverflow } = expandColumn
|
|
549
|
-
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow
|
|
550
|
-
const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex }
|
|
551
|
-
rows.push(
|
|
552
|
-
h('tr', {
|
|
553
|
-
class: ['vxe-body--expanded-row', {
|
|
554
|
-
'is--padding': padding
|
|
555
|
-
}],
|
|
556
|
-
key: `expand_${rowid}`,
|
|
557
|
-
style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(expandParams) : rowStyle) : null,
|
|
558
|
-
...trOn
|
|
559
|
-
}, [
|
|
560
|
-
h('td', {
|
|
561
|
-
class: {
|
|
562
|
-
'vxe-body--expanded-column': 1,
|
|
563
|
-
'fixed--hidden': fixedType && !hasFixedColumn,
|
|
564
|
-
'col--ellipsis': hasEllipsis
|
|
565
|
-
},
|
|
566
|
-
colspan: tableColumn.length
|
|
540
|
+
const { height: expandHeight, padding, mode: expandMode } = expandOpts
|
|
541
|
+
if (expandMode === 'fixed') {
|
|
542
|
+
rows.push(
|
|
543
|
+
h('tr', {
|
|
544
|
+
class: 'vxe-body--row-expanded-place',
|
|
545
|
+
key: `expand_${rowid}`,
|
|
546
|
+
rowid
|
|
567
547
|
}, [
|
|
568
|
-
h('
|
|
569
|
-
class:
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
548
|
+
h('td', {
|
|
549
|
+
class: 'vxe-body--row-expanded-place-column',
|
|
550
|
+
colspan: tableColumn.length,
|
|
551
|
+
style: {
|
|
552
|
+
height: `${rowExpandHeightFlag ? (rowRest.expandHeight || expandHeight) : 0}px`
|
|
553
|
+
}
|
|
554
|
+
})
|
|
555
|
+
])
|
|
556
|
+
)
|
|
557
|
+
} else {
|
|
558
|
+
const cellStyle: any = {}
|
|
559
|
+
if (expandHeight) {
|
|
560
|
+
cellStyle.height = `${expandHeight}px`
|
|
561
|
+
}
|
|
562
|
+
if (treeConfig) {
|
|
563
|
+
cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`
|
|
564
|
+
}
|
|
565
|
+
const { showOverflow } = expandColumn
|
|
566
|
+
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow
|
|
567
|
+
const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex }
|
|
568
|
+
rows.push(
|
|
569
|
+
h('tr', {
|
|
570
|
+
class: ['vxe-body--expanded-row', {
|
|
571
|
+
'is--padding': padding
|
|
572
|
+
}],
|
|
573
|
+
key: `expand_${rowid}`
|
|
574
|
+
}, [
|
|
575
|
+
h('td', {
|
|
576
|
+
class: ['vxe-body--expanded-column', {
|
|
577
|
+
'fixed--hidden': fixedType && !hasFixedColumn,
|
|
578
|
+
'col--ellipsis': hasEllipsis
|
|
579
|
+
}],
|
|
580
|
+
colspan: tableColumn.length
|
|
574
581
|
}, [
|
|
575
|
-
|
|
582
|
+
h('div', {
|
|
583
|
+
class: ['vxe-body--expanded-cell', {
|
|
584
|
+
'is--ellipsis': expandHeight
|
|
585
|
+
}],
|
|
586
|
+
style: cellStyle
|
|
587
|
+
}, [
|
|
588
|
+
expandColumn.renderData(expandParams)
|
|
589
|
+
])
|
|
576
590
|
])
|
|
577
591
|
])
|
|
578
|
-
|
|
579
|
-
|
|
592
|
+
)
|
|
593
|
+
}
|
|
580
594
|
}
|
|
581
595
|
// 如果是树形表格
|
|
582
596
|
if (isExpandTree) {
|
|
@@ -627,15 +641,14 @@ export default defineComponent({
|
|
|
627
641
|
const emptyOpts = computeEmptyOpts.value
|
|
628
642
|
const mouseOpts = computeMouseOpts.value
|
|
629
643
|
const rowDragOpts = computeRowDragOpts.value
|
|
630
|
-
const
|
|
631
|
-
const rightFixedWidth = computeRightFixedWidth.value
|
|
644
|
+
const expandOpts = computeExpandOpts.value
|
|
632
645
|
|
|
633
646
|
let renderDataList = tableData
|
|
634
647
|
let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
|
|
635
648
|
let isOptimizeMode = false
|
|
636
649
|
// 如果是使用优化模式
|
|
637
650
|
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
638
|
-
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
651
|
+
if ((expandColumn && expandOpts.mode !== 'fixed') || spanMethod || footerSpanMethod) {
|
|
639
652
|
// 如果不支持优化模式
|
|
640
653
|
} else {
|
|
641
654
|
isOptimizeMode = true
|
|
@@ -716,9 +729,6 @@ export default defineComponent({
|
|
|
716
729
|
$xeTable.triggerBodyScrollEvent(evnt, fixedType)
|
|
717
730
|
}
|
|
718
731
|
}
|
|
719
|
-
if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
|
|
720
|
-
ons.onWheel = $xeTable.triggerBodyWheelEvent
|
|
721
|
-
}
|
|
722
732
|
|
|
723
733
|
return h('div', {
|
|
724
734
|
ref: refElem,
|