vxe-table 4.21.1 → 4.21.3

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 (76) hide show
  1. package/dist/all.esm.js +166 -102
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  4. package/es/index.css +1 -1
  5. package/es/index.min.css +1 -1
  6. package/es/style.css +1 -1
  7. package/es/style.min.css +1 -1
  8. package/es/table/module/custom/hook.js +4 -0
  9. package/es/table/module/export/export-panel.js +3 -2
  10. package/es/table/module/export/hook.js +13 -7
  11. package/es/table/module/filter/hook.js +97 -79
  12. package/es/table/src/body.js +12 -4
  13. package/es/table/src/footer.js +12 -3
  14. package/es/table/src/header.js +12 -4
  15. package/es/table/src/table.js +12 -2
  16. package/es/table/src/util.js +1 -0
  17. package/es/table/style.css +35 -60
  18. package/es/table/style.min.css +1 -1
  19. package/es/ui/index.js +1 -1
  20. package/es/ui/src/dom.js +1 -1
  21. package/es/ui/src/log.js +1 -1
  22. package/es/vxe-table/style.css +35 -60
  23. package/es/vxe-table/style.min.css +1 -1
  24. package/lib/index.css +1 -1
  25. package/lib/index.min.css +1 -1
  26. package/lib/index.umd.js +176 -110
  27. package/lib/index.umd.min.js +1 -1
  28. package/lib/style.css +1 -1
  29. package/lib/style.min.css +1 -1
  30. package/lib/table/module/custom/hook.js +6 -0
  31. package/lib/table/module/custom/hook.min.js +1 -1
  32. package/lib/table/module/export/export-panel.js +3 -2
  33. package/lib/table/module/export/export-panel.min.js +1 -1
  34. package/lib/table/module/export/hook.js +15 -7
  35. package/lib/table/module/export/hook.min.js +1 -1
  36. package/lib/table/module/filter/hook.js +111 -86
  37. package/lib/table/module/filter/hook.min.js +1 -1
  38. package/lib/table/src/body.js +11 -3
  39. package/lib/table/src/body.min.js +1 -1
  40. package/lib/table/src/footer.js +12 -3
  41. package/lib/table/src/footer.min.js +1 -1
  42. package/lib/table/src/header.js +11 -3
  43. package/lib/table/src/header.min.js +1 -1
  44. package/lib/table/src/table.js +3 -3
  45. package/lib/table/src/table.min.js +1 -1
  46. package/lib/table/src/util.js +1 -0
  47. package/lib/table/src/util.min.js +1 -1
  48. package/lib/table/style/style.css +35 -60
  49. package/lib/table/style/style.min.css +1 -1
  50. package/lib/ui/index.js +1 -1
  51. package/lib/ui/index.min.js +1 -1
  52. package/lib/ui/src/dom.js +1 -1
  53. package/lib/ui/src/dom.min.js +1 -1
  54. package/lib/ui/src/log.js +1 -1
  55. package/lib/ui/src/log.min.js +1 -1
  56. package/lib/vxe-table/style/style.css +35 -60
  57. package/lib/vxe-table/style/style.min.css +1 -1
  58. package/package.json +2 -2
  59. package/packages/table/module/custom/hook.ts +4 -0
  60. package/packages/table/module/export/export-panel.ts +3 -2
  61. package/packages/table/module/export/hook.ts +12 -7
  62. package/packages/table/module/filter/hook.ts +94 -75
  63. package/packages/table/src/body.ts +14 -4
  64. package/packages/table/src/footer.ts +14 -3
  65. package/packages/table/src/header.ts +14 -4
  66. package/packages/table/src/table.ts +12 -2
  67. package/packages/table/src/util.ts +1 -0
  68. package/packages/ui/src/dom.ts +1 -1
  69. package/packages/ui/src/utils.ts +1 -1
  70. package/styles/components/table.scss +37 -75
  71. /package/es/{iconfont.1787542597284.ttf → iconfont.1788176649939.ttf} +0 -0
  72. /package/es/{iconfont.1787542597284.woff → iconfont.1788176649939.woff} +0 -0
  73. /package/es/{iconfont.1787542597284.woff2 → iconfont.1788176649939.woff2} +0 -0
  74. /package/lib/{iconfont.1787542597284.ttf → iconfont.1788176649939.ttf} +0 -0
  75. /package/lib/{iconfont.1787542597284.woff → iconfont.1788176649939.woff} +0 -0
  76. /package/lib/{iconfont.1787542597284.woff2 → iconfont.1788176649939.woff2} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "4.21.1",
3
+ "version": "4.21.3",
4
4
  "description": "A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -66,7 +66,7 @@
66
66
  "typescript": "~5.9.3",
67
67
  "vue": "3.4.27",
68
68
  "vue-router": "~4.5.1",
69
- "vxe-pc-ui": "4.17.14"
69
+ "vxe-pc-ui": "4.17.23"
70
70
  },
71
71
  "vetur": {
72
72
  "tags": "helper/vetur/tags.json",
@@ -482,7 +482,11 @@ VxeUI.hooks.add('tableCustomModule', {
482
482
  handleUpdateCustomColumn,
483
483
  handleCustomStyle () {
484
484
  const reactData = $xeTable.reactData
485
+ const { customStore } = reactData
485
486
 
487
+ if (!customStore.visible) {
488
+ return nextTick()
489
+ }
486
490
  reactData.isCustomDragStatus = false
487
491
  return updatePopupStyle()
488
492
  }
@@ -137,9 +137,10 @@ export default defineVxeComponent({
137
137
  const { hasMerge, columns } = storeData
138
138
  const checkedAll = computeCheckedAll.value
139
139
  const supportMerge = computeSupportMerge.value
140
- const expColumns = XEUtils.searchTree(columns, (column: any) => column.checked, { children: 'children', mapChildren: 'childNodes', original: true })
140
+ // 内部导出使用 _columns -> _children 为自定义子集
141
+ const expColumns = XEUtils.searchTree(columns, (column: any) => column.checked, { children: 'children', mapChildren: '_children', original: true })
141
142
  return Object.assign({}, defaultOptions, {
142
- columns: expColumns,
143
+ _columns: expColumns,
143
144
  isMerge: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false
144
145
  })
145
146
  }
@@ -304,7 +304,7 @@ const tableExportMethodKeys: (keyof TableExportMethods)[] = ['exportData', 'impo
304
304
  hooks.add('tableExportModule', {
305
305
  setupTable ($xeTable) {
306
306
  const { props, reactData, internalData } = $xeTable
307
- const { computeTreeOpts, computePrintOpts, computeExportOpts, computeImportOpts, computeCustomOpts, computeSeqOpts, computeRadioOpts, computeCheckboxOpts, computeColumnOpts, computeAggregateOpts } = $xeTable.getComputeMaps()
307
+ const { computeTreeOpts, computePrintOpts, computeExportOpts, computeImportOpts, computeSeqOpts, computeRadioOpts, computeCheckboxOpts, computeColumnOpts, computeAggregateOpts } = $xeTable.getComputeMaps()
308
308
 
309
309
  const getSeq = (cellValue: any, row: any, $rowIndex: number, column: VxeTableDefines.ColumnInfo, $columnIndex: number) => {
310
310
  const seqOpts = computeSeqOpts.value
@@ -1280,9 +1280,9 @@ hooks.add('tableExportModule', {
1280
1280
  const { initStore, isGroup, rowGroupList, footerTableData, exportStore, exportParams } = reactData
1281
1281
  const { collectColumn, mergeBodyList, mergeFooterList } = internalData
1282
1282
  const exportOpts = computeExportOpts.value
1283
+ const printOpts = computePrintOpts.value
1283
1284
  const hasTree = !!treeConfig
1284
1285
  const hasRowGroup = rowGroupList.length > 0
1285
- const customOpts = computeCustomOpts.value
1286
1286
  const selectRecords = $xeTable.getCheckboxRecords()
1287
1287
  const proxyOpts = $xeGGWrapper ? $xeGGWrapper.getComputeMaps().computeProxyOpts.value : {} as VxeGridPropTypes.ProxyOpts
1288
1288
  const hasFooter = !!footerTableData.length
@@ -1305,9 +1305,9 @@ hooks.add('tableExportModule', {
1305
1305
  defOpts.isTreeAllExpanded = (defOpts as any).isAllExpand
1306
1306
  }
1307
1307
 
1308
- const types: string[] = defOpts.types || XEUtils.keys(exportOpts._typeMaps)
1308
+ const types: string[] = isPrint ? [] : (defOpts.types || XEUtils.keys(exportOpts._typeMaps))
1309
1309
  const modes: string[] = defOpts.modes || []
1310
- const checkMethod = customOpts.checkMethod
1310
+ const checkMethod = (isPrint ? printOpts : exportOpts).checkMethod
1311
1311
  const exportColumns = collectColumn.slice(0)
1312
1312
  const { columns, excludeFields, includeFields, extraFields } = defOpts
1313
1313
  // 处理类型
@@ -1411,10 +1411,10 @@ hooks.add('tableExportModule', {
1411
1411
  }
1412
1412
  }
1413
1413
  if (!modeList.some(item => item.value === mode)) {
1414
- exportParams.mode = modeList[0].value
1414
+ exportParams.mode = modeList.length ? modeList[0].value : ''
1415
1415
  }
1416
1416
  if (!typeList.some(item => item.value === type)) {
1417
- exportParams.type = typeList[0].value
1417
+ exportParams.type = typeList.length ? typeList[0].value : ''
1418
1418
  }
1419
1419
  if (!exportParams.widthMode) {
1420
1420
  exportParams.widthMode = ''
@@ -1510,7 +1510,12 @@ hooks.add('tableExportModule', {
1510
1510
 
1511
1511
  let isCustomCol = false
1512
1512
  let customCols = []
1513
- if (columns) {
1513
+ const _columns = (opts as any)._columns
1514
+ if (_columns) {
1515
+ // 内部导出使用 _columns -> _children 为自定义子集
1516
+ isCustomCol = true
1517
+ customCols = XEUtils.searchTree(_columns, () => true, { children: '_children', mapChildren: 'childNodes', original: true })
1518
+ } else if (columns) {
1514
1519
  isCustomCol = true
1515
1520
  customCols = XEUtils.searchTree(columns, () => true, { children: 'children', mapChildren: 'childNodes', original: true })
1516
1521
  } else {
@@ -23,6 +23,89 @@ hooks.add('tableFilterModule', {
23
23
  const { refElem, refTableFilter } = $xeTable.getRefMaps()
24
24
  const { computeFilterOpts, computeMouseOpts } = $xeTable.getComputeMaps()
25
25
 
26
+ const updatePopupStyle = () => {
27
+ const { filterStore } = reactData
28
+ const { elemStore } = internalData
29
+ const { column, targetEl } = filterStore
30
+ if (!column || !targetEl) {
31
+ return nextTick()
32
+ }
33
+ const tableEl = refElem.value
34
+ const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode()
35
+ const filterOpts = computeFilterOpts.value
36
+ const { maxHeight: customMaxHeight, transfer, zIndex } = filterOpts
37
+ const currEl = targetEl
38
+ const tableRect = tableEl.getBoundingClientRect()
39
+ const filterRender = column ? column.filterRender : null
40
+ const compConf = filterRender && isEnableConf(filterRender) ? renderer.get(filterRender.name) : null
41
+
42
+ const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
43
+ if (!headerScrollElem) {
44
+ return nextTick()
45
+ }
46
+ const tableFilter = refTableFilter.value
47
+ const filterWrapperElem = tableFilter ? tableFilter.getRefMaps().refElem.value as HTMLDivElement : null
48
+ if (!filterWrapperElem) {
49
+ return nextTick()
50
+ }
51
+ const btnRect = currEl.getBoundingClientRect()
52
+ const filterHeadElem = filterWrapperElem.querySelector<HTMLDivElement>('.vxe-table--filter-header')
53
+ const filterFootElem = filterWrapperElem.querySelector<HTMLDivElement>('.vxe-table--filter-footer')
54
+ const filterWidth = filterWrapperElem.offsetWidth
55
+ const centerWidth = currEl ? filterWidth / 2 : ((filterWidth - column.renderWidth) / 2)
56
+ let left = 0
57
+ let top = 0
58
+ let maxHeight: number = 0
59
+ /**
60
+ * 是否显示筛选按钮图标
61
+ * 如果不存在图标,则相对单元格居中显示
62
+ */
63
+ if (transfer) {
64
+ left = btnRect.left - centerWidth + scrollLeft
65
+ top = btnRect.top + currEl.clientHeight + scrollTop
66
+ maxHeight = Math.min(Math.max(tableRect.height, Math.floor(visibleHeight / 2)), Math.max(80, visibleHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 28))
67
+ if (left < 16) {
68
+ left = 16
69
+ } else if (left > (visibleWidth - filterWidth - 16)) {
70
+ left = visibleWidth - filterWidth - 16
71
+ }
72
+ } else {
73
+ left = btnRect.left - tableRect.left - centerWidth
74
+ top = btnRect.top - tableRect.top + currEl.clientHeight
75
+ maxHeight = Math.max(40, tableEl.clientHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 14)
76
+ if (left < 1) {
77
+ left = 1
78
+ } else if (left > (tableEl.clientWidth - filterWidth - 1)) {
79
+ left = tableEl.clientWidth - filterWidth - 1
80
+ }
81
+ if ($xeGGWrapper) {
82
+ const wrapperEl = $xeGGWrapper.getRefMaps().refElem.value
83
+ if (wrapperEl) {
84
+ const wrapperRect = wrapperEl.getBoundingClientRect()
85
+ top += tableRect.top - wrapperRect.top
86
+ }
87
+ }
88
+ }
89
+ const fStys: Record<string, any> = {
90
+ top: toCssUnit(top),
91
+ left: toCssUnit(left)
92
+ }
93
+ if (zIndex) {
94
+ fStys.zIndex = zIndex
95
+ }
96
+ filterStore.style = fStys
97
+ // 筛选面板是自适应表格高度
98
+ if (compConf ? !compConf.tableFilterAutoHeight : false) {
99
+ maxHeight = 0
100
+ } else {
101
+ if (customMaxHeight) {
102
+ maxHeight = customMaxHeight > maxHeight ? maxHeight : customMaxHeight
103
+ }
104
+ }
105
+ // 判断面板不能大于表格高度
106
+ filterStore.maxHeight = maxHeight
107
+ return nextTick()
108
+ }
26
109
  const filterPrivateMethods: TableFilterPrivateMethods = {
27
110
  checkFilterOptions () {
28
111
  const { filterStore } = reactData
@@ -35,91 +118,20 @@ hooks.add('tableFilterModule', {
35
118
  },
36
119
  handleOpenFilterColumn (evnt: MouseEvent, btnEl: HTMLDivElement | null, colEl: HTMLDivElement, column: VxeTableDefines.ColumnInfo, params: any) {
37
120
  const { initStore, filterStore } = reactData
38
- const { elemStore } = internalData
39
121
  if (filterStore.column === column && filterStore.visible) {
40
122
  filterStore.visible = false
41
123
  } else {
42
- const tableEl = refElem.value
43
- const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode()
44
- const filterOpts = computeFilterOpts.value
45
- const { maxHeight: customMaxHeight, transfer, zIndex } = filterOpts
46
124
  const currEl = btnEl || colEl
47
- const tableRect = tableEl.getBoundingClientRect()
48
- const filterRender = column ? column.filterRender : null
49
- const compConf = filterRender && isEnableConf(filterRender) ? renderer.get(filterRender.name) : null
50
125
  $xeTable.handleFilterOptions(column)
51
126
  internalData._currFilterParams = params
127
+ filterStore.targetEl = currEl
52
128
  filterStore.style = null
53
129
  filterStore.visible = true
54
130
  initStore.filter = true
55
- nextTick(() => {
56
- const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
57
- if (!headerScrollElem) {
58
- return
59
- }
60
- const tableFilter = refTableFilter.value
61
- const filterWrapperElem = tableFilter ? tableFilter.getRefMaps().refElem.value as HTMLDivElement : null
62
- if (!filterWrapperElem) {
63
- return
64
- }
65
- const btnRect = currEl.getBoundingClientRect()
66
- const filterHeadElem = filterWrapperElem.querySelector<HTMLDivElement>('.vxe-table--filter-header')
67
- const filterFootElem = filterWrapperElem.querySelector<HTMLDivElement>('.vxe-table--filter-footer')
68
- const filterWidth = filterWrapperElem.offsetWidth
69
- const centerWidth = btnEl ? filterWidth / 2 : ((filterWidth - column.renderWidth) / 2)
70
- let left = 0
71
- let top = 0
72
- let maxHeight: number = 0
73
- /**
74
- * 是否显示筛选按钮图标
75
- * 如果不存在图标,则相对单元格居中显示
76
- */
77
- if (transfer) {
78
- left = btnRect.left - centerWidth + scrollLeft
79
- top = btnRect.top + currEl.clientHeight + scrollTop
80
- maxHeight = Math.min(Math.max(tableRect.height, Math.floor(visibleHeight / 2)), Math.max(80, visibleHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 28))
81
- if (left < 16) {
82
- left = 16
83
- } else if (left > (visibleWidth - filterWidth - 16)) {
84
- left = visibleWidth - filterWidth - 16
85
- }
86
- } else {
87
- left = btnRect.left - tableRect.left - centerWidth
88
- top = btnRect.top - tableRect.top + currEl.clientHeight
89
- maxHeight = Math.max(40, tableEl.clientHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 14)
90
- if (left < 1) {
91
- left = 1
92
- } else if (left > (tableEl.clientWidth - filterWidth - 1)) {
93
- left = tableEl.clientWidth - filterWidth - 1
94
- }
95
- if ($xeGGWrapper) {
96
- const wrapperEl = $xeGGWrapper.getRefMaps().refElem.value
97
- if (wrapperEl) {
98
- const wrapperRect = wrapperEl.getBoundingClientRect()
99
- top += tableRect.top - wrapperRect.top
100
- }
101
- }
102
- }
103
- const fStys: Record<string, any> = {
104
- top: toCssUnit(top),
105
- left: toCssUnit(left)
106
- }
107
- if (zIndex) {
108
- fStys.zIndex = zIndex
109
- }
110
- filterStore.style = fStys
111
- // 筛选面板是自适应表格高度
112
- if (compConf ? !compConf.tableFilterAutoHeight : false) {
113
- maxHeight = 0
114
- } else {
115
- if (customMaxHeight) {
116
- maxHeight = customMaxHeight > maxHeight ? maxHeight : customMaxHeight
117
- }
118
- }
119
- // 判断面板不能大于表格高度
120
- filterStore.maxHeight = maxHeight
121
- })
122
131
  }
132
+ nextTick(() => {
133
+ updatePopupStyle()
134
+ })
123
135
  $xeTable.dispatchEvent('filter-visible', { column, field: column.field, property: column.field, filterList: $xeTable.getCheckedFilters(), visible: filterStore.visible }, evnt)
124
136
  },
125
137
  /**
@@ -276,6 +288,13 @@ hooks.add('tableFilterModule', {
276
288
  $xeTable.dispatchEvent('clear-filter', { filterList: [] }, evnt)
277
289
  }
278
290
  }
291
+ },
292
+ handleFilterStyle () {
293
+ const { filterStore } = reactData
294
+ if (!filterStore.visible) {
295
+ return nextTick()
296
+ }
297
+ return updatePopupStyle()
279
298
  }
280
299
  }
281
300
 
@@ -4,7 +4,7 @@ import XEUtils from 'xe-utils'
4
4
  import { VxeUI } from '../../ui'
5
5
  import { getRowid, createHandleGetRowId, getCellRestHeight } from './util'
6
6
  import { updateCellTitle, getPropClass } from '../../ui/src/dom'
7
- import { isEnableConf } from '../../ui/src/utils'
7
+ import { isEnableConf, getDefaultConfig } from '../../ui/src/utils'
8
8
  import { getSlotVNs } from '../../ui/src/vn'
9
9
 
10
10
  import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableDefines, VxeComponentSlotType } from '../../../types'
@@ -159,8 +159,15 @@ export default defineVxeComponent({
159
159
  const isEdit = isEnableConf(editRender)
160
160
  const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0
161
161
  let fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed)
162
- const isCellPadding = XEUtils.eqNull(padding) ? (allPadding === null ? cellOpts.padding : allPadding) : padding
163
- const cellOverflow = XEUtils.eqNull(showOverflow) ? allShowOverflow : showOverflow
162
+
163
+ const cellPadding = getDefaultConfig(padding, (allPadding === null ? cellOpts.padding : allPadding))
164
+ const isAllCellPadding = cellPadding === true
165
+ const isCellPaddingTop = cellPadding ? (isAllCellPadding || cellPadding.top !== false) : false
166
+ const isCellPaddingBottom = cellPadding ? (isAllCellPadding || cellPadding.bottom !== false) : false
167
+ const isCellPaddingLeft = cellPadding ? (isAllCellPadding || cellPadding.left !== false) : false
168
+ const isCellPaddingRight = cellPadding ? (isAllCellPadding || cellPadding.right !== false) : false
169
+
170
+ const cellOverflow = getDefaultConfig(showOverflow, allShowOverflow)
164
171
  const showEllipsis = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === 'ellipsis'
165
172
  const showTitle = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === 'title'
166
173
  const showTooltip = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === 'tooltip'
@@ -473,7 +480,10 @@ export default defineVxeComponent({
473
480
  'col--max-height': maxHeight,
474
481
  'fixed--width': !isAutoCellWidth,
475
482
  'fixed--hidden': fixedHiddenColumn,
476
- 'is--padding': isCellPadding,
483
+ 'is--pg-top': isCellPaddingTop,
484
+ 'is--pg-bottom': isCellPaddingBottom,
485
+ 'is--pg-left': isCellPaddingLeft,
486
+ 'is--pg-right': isCellPaddingRight,
477
487
  'is--progress': (fixedHiddenColumn && isAllOverflow) || isVNPreEmptyStatus,
478
488
  'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
479
489
  'is--drag-disabled': isDisabledDrag,
@@ -6,6 +6,7 @@ import { updateCellTitle, getPropClass } from '../../ui/src/dom'
6
6
  import { getCalcHeight } from './util'
7
7
 
8
8
  import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableMethods, VxeTableDefines } from '../../../types'
9
+ import { getDefaultConfig } from '../../ui/src/utils'
9
10
 
10
11
  const { renderer, renderEmptyElement } = VxeUI
11
12
 
@@ -71,8 +72,15 @@ export default defineVxeComponent({
71
72
  const compConf = renderOpts ? renderer.get(renderOpts.name) : null
72
73
  const showAllTip = footerTooltipOpts.showAll
73
74
  const fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed)
74
- const isPadding = XEUtils.isBoolean(footerCellOpts.padding) ? footerCellOpts.padding : cellOpts.padding
75
- const footOverflow = XEUtils.eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow
75
+
76
+ const cellPadding = getDefaultConfig(footerCellOpts.padding, cellOpts.padding)
77
+ const isAllCellPadding = cellPadding === true
78
+ const isCellPaddingTop = cellPadding ? (isAllCellPadding || cellPadding.top !== false) : false
79
+ const isCellPaddingBottom = cellPadding ? (isAllCellPadding || cellPadding.bottom !== false) : false
80
+ const isCellPaddingLeft = cellPadding ? (isAllCellPadding || cellPadding.left !== false) : false
81
+ const isCellPaddingRight = cellPadding ? (isAllCellPadding || cellPadding.right !== false) : false
82
+
83
+ const footOverflow = getDefaultConfig(showFooterOverflow, allColumnFooterOverflow)
76
84
  const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
77
85
  const showEllipsis = (footOverflow === true ? footerTooltipOpts.mode : footOverflow) === 'ellipsis'
78
86
  const showTitle = (footOverflow === true ? footerTooltipOpts.mode : footOverflow) === 'title'
@@ -182,7 +190,10 @@ export default defineVxeComponent({
182
190
  'col--last': isLastColumn,
183
191
  'fixed--width': !isAutoCellWidth,
184
192
  'fixed--hidden': fixedHiddenColumn,
185
- 'is--padding': isPadding,
193
+ 'is--pg-top': isCellPaddingTop,
194
+ 'is--pg-bottom': isCellPaddingBottom,
195
+ 'is--pg-left': isCellPaddingLeft,
196
+ 'is--pg-right': isCellPaddingRight,
186
197
  'col--ellipsis': hasEllipsis,
187
198
  'col--current': currentColumn === column
188
199
  }, getPropClass(footerClassName, cellParams), getPropClass(footerCellClassName, cellParams)],
@@ -2,7 +2,7 @@ import { h, ref, Ref, PropType, inject, nextTick, watch, onMounted, onUnmounted
2
2
  import { defineVxeComponent } from '../../ui/src/comp'
3
3
  import XEUtils from 'xe-utils'
4
4
  import { VxeUI } from '../../ui'
5
- import { isEnableConf } from '../../ui/src/utils'
5
+ import { getDefaultConfig, isEnableConf } from '../../ui/src/utils'
6
6
  import { getCalcHeight, convertHeaderColumnToRows, convertHeaderToGridRows } from './util'
7
7
  import { getSlotVNs } from '../../ui/src/vn'
8
8
 
@@ -85,8 +85,15 @@ export default defineVxeComponent({
85
85
  const compConf = renderOpts ? renderer.get(renderOpts.name) : null
86
86
  const isColGroup = column.children && column.children.length
87
87
  const fixedHiddenColumn = overflowX && !isColGroup && (fixedType ? column.fixed !== fixedType : !!column.fixed)
88
- const isPadding = XEUtils.isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding
89
- const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
88
+
89
+ const cellPadding = getDefaultConfig(headerCellOpts.padding, cellOpts.padding)
90
+ const isAllCellPadding = cellPadding === true
91
+ const isCellPaddingTop = cellPadding ? (isAllCellPadding || cellPadding.top !== false) : false
92
+ const isCellPaddingBottom = cellPadding ? (isAllCellPadding || cellPadding.bottom !== false) : false
93
+ const isCellPaddingLeft = cellPadding ? (isAllCellPadding || cellPadding.left !== false) : false
94
+ const isCellPaddingRight = cellPadding ? (isAllCellPadding || cellPadding.right !== false) : false
95
+
96
+ const headOverflow = getDefaultConfig(showHeaderOverflow, allColumnHeaderOverflow)
90
97
  const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
91
98
  const showEllipsis = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'ellipsis'
92
99
  const showTitle = (headOverflow === true ? headerTooltipOpts.mode : headOverflow) === 'title'
@@ -210,7 +217,10 @@ export default defineVxeComponent({
210
217
  'col--group': isColGroup,
211
218
  'col--ellipsis': hasEllipsis,
212
219
  'fixed--width': !isAutoCellWidth,
213
- 'is--padding': isPadding,
220
+ 'is--pg-top': isCellPaddingTop,
221
+ 'is--pg-bottom': isCellPaddingBottom,
222
+ 'is--pg-left': isCellPaddingLeft,
223
+ 'is--pg-right': isCellPaddingRight,
214
224
  'is--sortable': column.sortable,
215
225
  'col--filter': !!filters,
216
226
  'is--filter-active': hasFilter,
@@ -2176,10 +2176,9 @@ export default defineVxeComponent({
2176
2176
  if (!el || !el.clientWidth) {
2177
2177
  return
2178
2178
  }
2179
- const cellOpts = computeCellOpts.value
2180
2179
  const treeOpts = computeTreeOpts.value
2181
2180
  const defaultRowHeight = computeDefaultRowHeight.value
2182
- if (!isAllOverflow && (scrollYLoad || scrollXLoad || cellOpts.maxHeight || (treeConfig && treeOpts.showLine))) {
2181
+ if (!isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine))) {
2183
2182
  const { handleGetRowId } = createHandleGetRowId($xeTable)
2184
2183
  el.setAttribute('data-calc-row', 'Y')
2185
2184
  tableData.forEach(row => {
@@ -8597,6 +8596,11 @@ export default defineVxeComponent({
8597
8596
  }
8598
8597
 
8599
8598
  const handleGlobalScrollEvent = (evnt: MouseEvent) => {
8599
+ const { filterStore } = reactData
8600
+ const filterOpts = computeFilterOpts.value
8601
+ if (filterStore.visible && filterOpts.transfer) {
8602
+ $xeTable.handleFilterStyle()
8603
+ }
8600
8604
  reUpdateCustomStyleEvent(evnt)
8601
8605
  }
8602
8606
 
@@ -14485,6 +14489,12 @@ export default defineVxeComponent({
14485
14489
  }, () => {
14486
14490
  reLayoutFlag.value++
14487
14491
  })
14492
+ watch(() => {
14493
+ const cellOpts = computeCellOpts.value
14494
+ return cellOpts.height
14495
+ }, () => {
14496
+ reLayoutFlag.value++
14497
+ })
14488
14498
  watch(reLayoutFlag, () => {
14489
14499
  $xeTable.recalculate(true)
14490
14500
  })
@@ -251,6 +251,7 @@ export function createReactData (): TableReactData {
251
251
  customColumnList: [],
252
252
  // 当前选中的筛选列
253
253
  filterStore: {
254
+ targetEl: null,
254
255
  isAllSelected: false,
255
256
  isIndeterminate: false,
256
257
  style: null,
@@ -20,7 +20,7 @@ export function getTpImg () {
20
20
  }
21
21
 
22
22
  export function getPropClass (property: any, params: any) {
23
- return property ? XEUtils.isFunction(property) ? property(params) : property : ''
23
+ return property ? (XEUtils.isFunction(property) ? property(params) : property) || '' : ''
24
24
  }
25
25
 
26
26
  function getClsRE (cls: any) {
@@ -51,6 +51,6 @@ export function eqEmptyValue (cellValue: any) {
51
51
  return cellValue === '' || XEUtils.eqNull(cellValue)
52
52
  }
53
53
 
54
- export function getDefaultConfig (val1: any, def1: any) {
54
+ export function getDefaultConfig <T = any, D = any> (val1: T, def1: D): (T | D) {
55
55
  return XEUtils.eqNull(val1) ? def1 : val1
56
56
  }
@@ -8,20 +8,27 @@
8
8
  // 局部变量
9
9
  .vxe-table {
10
10
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-default);
11
+ --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-default);
12
+ --vxe-ui-table-current-row-line-height: var(--vxe-ui-table-row-line-height);
11
13
  &.size--xlarge {
12
14
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-xlarge);
15
+ --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-xlarge);
13
16
  }
14
17
  &.size--large {
15
18
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-large);
19
+ --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-large);
16
20
  }
17
21
  &.size--medium {
18
22
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-medium);
23
+ --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-medium);
19
24
  }
20
25
  &.size--small {
21
26
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-small);
27
+ --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-small);
22
28
  }
23
29
  &.size--mini {
24
30
  --vxe-ui-table-current-font-size: var(--vxe-ui-font-size-mini);
31
+ --vxe-ui-table-current-cell-padding: var(--vxe-ui-table-cell-padding-mini);
25
32
  }
26
33
  }
27
34
 
@@ -1392,6 +1399,34 @@ $btnThemeList: (
1392
1399
  white-space: nowrap;
1393
1400
  }
1394
1401
 
1402
+ .vxe-header--column,
1403
+ .vxe-body--column,
1404
+ .vxe-footer--column {
1405
+ &.is--pg-top {
1406
+ .vxe-cell {
1407
+ padding-top: var(--vxe-ui-table-current-cell-padding);
1408
+ }
1409
+ }
1410
+ &.is--pg-bottom {
1411
+ .vxe-cell {
1412
+ padding-bottom: var(--vxe-ui-table-current-cell-padding);
1413
+ }
1414
+ }
1415
+ &.is--pg-left {
1416
+ .vxe-cell {
1417
+ padding-left: var(--vxe-ui-table-current-cell-padding);
1418
+ }
1419
+ }
1420
+ &.is--pg-right {
1421
+ .vxe-cell {
1422
+ padding-right: var(--vxe-ui-table-current-cell-padding);
1423
+ }
1424
+ }
1425
+ .vxe-default-textarea {
1426
+ padding: var(--vxe-ui-table-current-cell-padding);
1427
+ }
1428
+ }
1429
+
1395
1430
  /*table*/
1396
1431
  .vxe-table--render-default {
1397
1432
  position: relative;
@@ -1504,7 +1539,7 @@ $btnThemeList: (
1504
1539
  .vxe-body--column,
1505
1540
  .vxe-footer--column {
1506
1541
  position: relative;
1507
- line-height: var(--vxe-ui-table-row-line-height);
1542
+ line-height: var(--vxe-ui-table-current-row-line-height);
1508
1543
  text-align: left;
1509
1544
  &.col--center {
1510
1545
  text-align: center;
@@ -1573,7 +1608,7 @@ $btnThemeList: (
1573
1608
  .vxe-body--column,
1574
1609
  .vxe-footer--column {
1575
1610
  position: relative;
1576
- line-height: var(--vxe-ui-table-row-line-height);
1611
+ line-height: var(--vxe-ui-table-current-row-line-height);
1577
1612
  text-align: left;
1578
1613
  &.col--current {
1579
1614
  background-color: var(--vxe-ui-table-column-current-background-color);
@@ -1857,18 +1892,6 @@ $btnThemeList: (
1857
1892
  .vxe-table--empty-block {
1858
1893
  min-height: var(--vxe-ui-table-row-height-medium);
1859
1894
  }
1860
- .vxe-header--column,
1861
- .vxe-body--column,
1862
- .vxe-footer--column {
1863
- &.is--padding {
1864
- .vxe-cell {
1865
- padding: var(--vxe-ui-table-cell-padding-medium);
1866
- .vxe-default-textarea {
1867
- padding: var(--vxe-ui-table-cell-padding-medium);
1868
- }
1869
- }
1870
- }
1871
- }
1872
1895
  .vxe-cell {
1873
1896
  .vxe-default-input,
1874
1897
  .vxe-default-textarea,
@@ -1890,18 +1913,6 @@ $btnThemeList: (
1890
1913
  .vxe-table--empty-block {
1891
1914
  min-height: var(--vxe-ui-table-row-height-small);
1892
1915
  }
1893
- .vxe-header--column,
1894
- .vxe-body--column,
1895
- .vxe-footer--column {
1896
- &.is--padding {
1897
- .vxe-cell {
1898
- padding: var(--vxe-ui-table-cell-padding-small);
1899
- .vxe-default-textarea {
1900
- padding: var(--vxe-ui-table-cell-padding-small);
1901
- }
1902
- }
1903
- }
1904
- }
1905
1916
  .vxe-cell {
1906
1917
  .vxe-default-input,
1907
1918
  .vxe-default-textarea,
@@ -1923,18 +1934,6 @@ $btnThemeList: (
1923
1934
  .vxe-table--empty-block {
1924
1935
  min-height: var(--vxe-ui-table-row-height-mini);
1925
1936
  }
1926
- .vxe-header--column,
1927
- .vxe-body--column,
1928
- .vxe-footer--column {
1929
- &.is--padding {
1930
- .vxe-cell {
1931
- padding: var(--vxe-ui-table-cell-padding-mini);
1932
- .vxe-default-textarea {
1933
- padding: var(--vxe-ui-table-cell-padding-mini);
1934
- }
1935
- }
1936
- }
1937
- }
1938
1937
  .vxe-cell {
1939
1938
  .vxe-default-input,
1940
1939
  .vxe-default-textarea,
@@ -1951,19 +1950,6 @@ $btnThemeList: (
1951
1950
  padding: 0 var(--vxe-ui-table-cell-padding-mini);
1952
1951
  }
1953
1952
  }
1954
-
1955
- .vxe-header--column,
1956
- .vxe-body--column,
1957
- .vxe-footer--column {
1958
- &.is--padding {
1959
- .vxe-cell {
1960
- padding: var(--vxe-ui-table-cell-padding-default);
1961
- .vxe-default-textarea {
1962
- padding: var(--vxe-ui-table-cell-padding-default);
1963
- }
1964
- }
1965
- }
1966
- }
1967
1953
 
1968
1954
  .vxe-cell {
1969
1955
  white-space: pre-line;
@@ -2396,30 +2382,6 @@ $btnThemeList: (
2396
2382
  }
2397
2383
  }
2398
2384
 
2399
- &.size--medium {
2400
- .vxe-cell--checkbox {
2401
- font-size: var(--vxe-checkbox-font-size-medium);
2402
- }
2403
- .vxe-cell--radio {
2404
- font-size: var(--vxe-radio-font-size-medium);
2405
- }
2406
- }
2407
- &.size--small {
2408
- .vxe-cell--checkbox {
2409
- font-size: var(--vxe-checkbox-font-size-small);
2410
- }
2411
- .vxe-cell--radio {
2412
- font-size: var(--vxe-radio-font-size-small);
2413
- }
2414
- }
2415
- &.size--mini {
2416
- .vxe-cell--checkbox {
2417
- font-size: var(--vxe-checkbox-font-size-mini);
2418
- }
2419
- .vxe-cell--radio {
2420
- font-size: var(--vxe-radio-font-size-mini);
2421
- }
2422
- }
2423
2385
 
2424
2386
  /*暂无数据*/
2425
2387
  .vxe-table--empty-placeholder,