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.
Files changed (44) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/module/edit/hook.js +5 -5
  6. package/es/table/src/body.js +57 -43
  7. package/es/table/src/table.js +209 -44
  8. package/es/table/style.css +26 -0
  9. package/es/table/style.min.css +1 -1
  10. package/es/ui/index.js +1 -1
  11. package/es/ui/src/log.js +1 -1
  12. package/es/vxe-table/style.css +26 -0
  13. package/es/vxe-table/style.min.css +1 -1
  14. package/lib/index.css +1 -1
  15. package/lib/index.min.css +1 -1
  16. package/lib/index.umd.js +330 -107
  17. package/lib/index.umd.min.js +1 -1
  18. package/lib/style.css +1 -1
  19. package/lib/style.min.css +1 -1
  20. package/lib/table/module/edit/hook.js +10 -5
  21. package/lib/table/module/edit/hook.min.js +1 -1
  22. package/lib/table/src/body.js +65 -58
  23. package/lib/table/src/body.min.js +1 -1
  24. package/lib/table/src/table.js +253 -42
  25. package/lib/table/src/table.min.js +1 -1
  26. package/lib/table/style/style.css +26 -0
  27. package/lib/table/style/style.min.css +1 -1
  28. package/lib/ui/index.js +1 -1
  29. package/lib/ui/index.min.js +1 -1
  30. package/lib/ui/src/log.js +1 -1
  31. package/lib/ui/src/log.min.js +1 -1
  32. package/lib/vxe-table/style/style.css +26 -0
  33. package/lib/vxe-table/style/style.min.css +1 -1
  34. package/package.json +1 -1
  35. package/packages/table/module/edit/hook.ts +5 -5
  36. package/packages/table/src/body.ts +60 -50
  37. package/packages/table/src/table.ts +220 -44
  38. package/styles/components/table.scss +26 -0
  39. /package/es/{iconfont.1739333111603.ttf → iconfont.1739426300784.ttf} +0 -0
  40. /package/es/{iconfont.1739333111603.woff → iconfont.1739426300784.woff} +0 -0
  41. /package/es/{iconfont.1739333111603.woff2 → iconfont.1739426300784.woff2} +0 -0
  42. /package/lib/{iconfont.1739333111603.ttf → iconfont.1739426300784.ttf} +0 -0
  43. /package/lib/{iconfont.1739333111603.woff → iconfont.1739426300784.woff} +0 -0
  44. /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, computeLeftFixedWidth, computeRightFixedWidth, computeResizableOpts } = $xeTable.getComputeMaps()
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 rest = fullAllDataRowIdData[rowid]
465
+ const rowRest = fullAllDataRowIdData[rowid]
466
466
  let rowLevel = 0
467
467
  let seq: string | number = -1
468
468
  let _rowIndex = 0
469
- if (rest) {
470
- rowLevel = rest.level
469
+ if (rowRest) {
470
+ rowLevel = rowRest.level
471
471
  if (treeConfig && transform && seqMode === 'increasing') {
472
- seq = rest._index + 1
472
+ seq = rowRest._index + 1
473
473
  } else {
474
- seq = rest.seq
474
+ seq = rowRest.seq
475
475
  }
476
- _rowIndex = rest._index
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
- const cellStyle: any = {}
542
- if (expandHeight) {
543
- cellStyle.height = `${expandHeight}px`
544
- }
545
- if (treeConfig) {
546
- cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`
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('div', {
569
- class: {
570
- 'vxe-body--expanded-cell': 1,
571
- 'is--ellipsis': expandHeight
572
- },
573
- style: cellStyle
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
- expandColumn.renderData(expandParams)
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 leftFixedWidth = computeLeftFixedWidth.value
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,