vxe-table 3.23.1 → 3.23.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 (77) 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/custom/mixin.js +6 -0
  6. package/es/table/module/export/export-panel.js +3 -2
  7. package/es/table/module/export/mixin.js +12 -6
  8. package/es/table/module/filter/mixin.js +102 -76
  9. package/es/table/src/body.js +12 -4
  10. package/es/table/src/footer.js +12 -4
  11. package/es/table/src/header.js +12 -4
  12. package/es/table/src/methods.js +14 -5
  13. package/es/table/src/table.js +8 -0
  14. package/es/table/src/util.js +1 -0
  15. package/es/table/style.css +35 -60
  16. package/es/table/style.min.css +1 -1
  17. package/es/ui/index.js +1 -1
  18. package/es/ui/src/dom.js +1 -1
  19. package/es/ui/src/log.js +1 -1
  20. package/es/vxe-table/style.css +35 -60
  21. package/es/vxe-table/style.min.css +1 -1
  22. package/lib/index.css +1 -1
  23. package/lib/index.min.css +1 -1
  24. package/lib/index.umd.js +194 -110
  25. package/lib/index.umd.min.js +1 -1
  26. package/lib/style.css +1 -1
  27. package/lib/style.min.css +1 -1
  28. package/lib/table/module/custom/mixin.js +8 -0
  29. package/lib/table/module/custom/mixin.min.js +1 -1
  30. package/lib/table/module/export/export-panel.js +3 -2
  31. package/lib/table/module/export/export-panel.min.js +1 -1
  32. package/lib/table/module/export/mixin.js +15 -6
  33. package/lib/table/module/export/mixin.min.js +1 -1
  34. package/lib/table/module/filter/mixin.js +116 -83
  35. package/lib/table/module/filter/mixin.min.js +1 -1
  36. package/lib/table/src/body.js +11 -3
  37. package/lib/table/src/body.min.js +1 -1
  38. package/lib/table/src/footer.js +11 -3
  39. package/lib/table/src/footer.min.js +1 -1
  40. package/lib/table/src/header.js +11 -3
  41. package/lib/table/src/header.min.js +1 -1
  42. package/lib/table/src/methods.js +3 -3
  43. package/lib/table/src/methods.min.js +1 -1
  44. package/lib/table/src/table.js +8 -0
  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/mixin.ts +7 -0
  60. package/packages/table/module/export/export-panel.ts +3 -2
  61. package/packages/table/module/export/mixin.ts +11 -6
  62. package/packages/table/module/filter/mixin.ts +102 -72
  63. package/packages/table/src/body.ts +13 -4
  64. package/packages/table/src/footer.ts +14 -4
  65. package/packages/table/src/header.ts +14 -4
  66. package/packages/table/src/methods.ts +14 -5
  67. package/packages/table/src/table.ts +9 -0
  68. package/packages/table/src/util.ts +1 -0
  69. package/packages/ui/src/dom.ts +1 -1
  70. package/packages/ui/src/utils.ts +1 -1
  71. package/styles/components/table.scss +37 -75
  72. /package/es/{iconfont.1787542588120.ttf → iconfont.1788176636871.ttf} +0 -0
  73. /package/es/{iconfont.1787542588120.woff → iconfont.1788176636871.woff} +0 -0
  74. /package/es/{iconfont.1787542588120.woff2 → iconfont.1788176636871.woff2} +0 -0
  75. /package/lib/{iconfont.1787542588120.ttf → iconfont.1788176636871.ttf} +0 -0
  76. /package/lib/{iconfont.1787542588120.woff → iconfont.1788176636871.woff} +0 -0
  77. /package/lib/{iconfont.1787542588120.woff2 → iconfont.1788176636871.woff2} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "3.23.1",
3
+ "version": "3.23.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",
@@ -65,7 +65,7 @@
65
65
  "vue-i18n": "^8.15.1",
66
66
  "vue-router": "^3.5.1",
67
67
  "vue-template-compiler": "2.6.14",
68
- "vxe-pc-ui": "3.17.14"
68
+ "vxe-pc-ui": "3.17.23"
69
69
  },
70
70
  "vetur": {
71
71
  "tags": "helper/vetur/tags.json",
@@ -511,6 +511,13 @@ export default {
511
511
  handleCustomStyle () {
512
512
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
513
513
 
514
+ const reactData = $xeTable.reactData
515
+ const { customStore } = reactData
516
+
517
+ if (!customStore.visible) {
518
+ return $xeTable.$nextTick()
519
+ }
520
+ reactData.isCustomDragStatus = false
514
521
  return updatePopupStyle($xeTable)
515
522
  }
516
523
  } as any
@@ -190,9 +190,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
190
190
  const { hasMerge, columns } = storeData
191
191
  const checkedAll = $xeExportPanel.computeCheckedAll
192
192
  const supportMerge = $xeExportPanel.computeSupportMerge
193
- const expColumns = XEUtils.searchTree(columns, column => column.checked, { children: 'children', mapChildren: 'childNodes', original: true })
193
+ // 内部导出使用 _columns -> _children 为自定义子集
194
+ const expColumns = XEUtils.searchTree(columns, column => column.checked, { children: 'children', mapChildren: '_children', original: true })
194
195
  return Object.assign({}, defaultOptions, {
195
- columns: expColumns,
196
+ _columns: expColumns,
196
197
  isMerge: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false
197
198
  })
198
199
  },
@@ -1252,7 +1252,7 @@ function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTableP
1252
1252
  const exportOpts = $xeTable.computeExportOpts
1253
1253
  const hasTree = !!treeConfig
1254
1254
  const hasRowGroup = rowGroupList.length > 0
1255
- const customOpts = $xeTable.computeCustomOpts
1255
+ const printOpts = $xeTable.computePrintOpts
1256
1256
  const selectRecords = $xeTable.getCheckboxRecords()
1257
1257
  const proxyOpts = $xeGGWrapper ? $xeGGWrapper.computeProxyOpts : {}
1258
1258
  const hasFooter = !!footerTableData.length
@@ -1275,9 +1275,9 @@ function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTableP
1275
1275
  defOpts.isTreeAllExpanded = (defOpts as any).isAllExpand
1276
1276
  }
1277
1277
 
1278
- const types = defOpts.types || XEUtils.keys(exportOpts._typeMaps)
1278
+ const types: string[] = isPrint ? [] : (defOpts.types || XEUtils.keys(exportOpts._typeMaps))
1279
1279
  const modes = defOpts.modes || []
1280
- const checkMethod = customOpts.checkMethod
1280
+ const checkMethod = (isPrint ? printOpts : exportOpts).checkMethod
1281
1281
  const exportColumns = collectColumn.slice(0)
1282
1282
  const { columns, excludeFields, includeFields, extraFields } = defOpts
1283
1283
  // 处理类型
@@ -1381,10 +1381,10 @@ function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTableP
1381
1381
  }
1382
1382
  }
1383
1383
  if (!modeList.some(item => item.value === mode)) {
1384
- exportParams.mode = modeList[0].value
1384
+ exportParams.mode = modeList.length ? modeList[0].value : ''
1385
1385
  }
1386
1386
  if (!typeList.some(item => item.value === type)) {
1387
- exportParams.type = typeList[0].value
1387
+ exportParams.type = typeList.length ? typeList[0].value : ''
1388
1388
  }
1389
1389
  if (!exportParams.widthMode) {
1390
1390
  exportParams.widthMode = ''
@@ -1536,7 +1536,12 @@ export default {
1536
1536
 
1537
1537
  let isCustomCol = false
1538
1538
  let customCols = []
1539
- if (columns) {
1539
+ const _columns = (opts as any)._columns
1540
+ if (_columns) {
1541
+ // 内部导出使用 _columns -> _children 为自定义子集
1542
+ isCustomCol = true
1543
+ customCols = XEUtils.searchTree(_columns, () => true, { children: '_children', mapChildren: 'childNodes', original: true })
1544
+ } else if (columns) {
1540
1545
  isCustomCol = true
1541
1546
  customCols = XEUtils.searchTree(columns, () => true, { children: 'children', mapChildren: 'childNodes', original: true })
1542
1547
  } else {
@@ -10,6 +10,96 @@ const { renderer } = VxeUI
10
10
 
11
11
  const sourceType = 'table'
12
12
 
13
+ function updatePopupStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
14
+ const $xeGrid = $xeTable.$xeGrid
15
+ const $xeGantt = $xeTable.$xeGantt
16
+ const reactData = $xeTable as unknown as TableReactData
17
+ const internalData = $xeTable as unknown as TableInternalData
18
+ const $xeGGWrapper = $xeGrid || $xeGantt
19
+
20
+ const { filterStore } = reactData
21
+ const { elemStore } = internalData
22
+ const { column, targetEl } = filterStore
23
+ if (!column || !targetEl) {
24
+ return $xeTable.$nextTick()
25
+ }
26
+ const tableEl = $xeTable.$refs.refElem as HTMLDivElement
27
+ const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode()
28
+ const filterOpts = $xeTable.computeFilterOpts
29
+ const { maxHeight: customMaxHeight, transfer, zIndex } = filterOpts
30
+ const currEl = targetEl
31
+ const tableRect = tableEl.getBoundingClientRect()
32
+ const filterRender = column ? column.filterRender : null
33
+ const compConf = filterRender && isEnableConf(filterRender) ? renderer.get(filterRender.name) : null
34
+
35
+ const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
36
+ if (!headerScrollElem) {
37
+ return $xeTable.$nextTick()
38
+ }
39
+ const tableFilter = $xeTable.$refs.refTableFilter
40
+ const filterWrapperElem = tableFilter ? (tableFilter as any).$el as HTMLDivElement : null
41
+ if (!filterWrapperElem) {
42
+ return $xeTable.$nextTick()
43
+ }
44
+ const btnRect = currEl.getBoundingClientRect()
45
+ const filterHeadElem = filterWrapperElem.querySelector<HTMLDivElement>('.vxe-table--filter-header')
46
+ const filterFootElem = filterWrapperElem.querySelector<HTMLDivElement>('.vxe-table--filter-footer')
47
+ const filterWidth = filterWrapperElem.offsetWidth
48
+ const centerWidth = currEl ? filterWidth / 2 : ((filterWidth - column.renderWidth) / 2)
49
+ let left = 0
50
+ let top = 0
51
+ let maxHeight: number = 0
52
+ /**
53
+ * 是否显示筛选按钮图标
54
+ * 如果不存在图标,则相对单元格居中显示
55
+ */
56
+ if (transfer) {
57
+ left = btnRect.left - centerWidth + scrollLeft
58
+ top = btnRect.top + currEl.clientHeight + scrollTop
59
+ 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))
60
+ if (left < 16) {
61
+ left = 16
62
+ } else if (left > (visibleWidth - filterWidth - 16)) {
63
+ left = visibleWidth - filterWidth - 16
64
+ }
65
+ } else {
66
+ left = btnRect.left - tableRect.left - centerWidth
67
+ top = btnRect.top - tableRect.top + currEl.clientHeight
68
+ maxHeight = Math.max(40, tableEl.clientHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 14)
69
+ if (left < 1) {
70
+ left = 1
71
+ } else if (left > (tableEl.clientWidth - filterWidth - 1)) {
72
+ left = tableEl.clientWidth - filterWidth - 1
73
+ }
74
+ if ($xeGGWrapper) {
75
+ const wrapperEl = $xeGGWrapper.$refs.refElem as HTMLDivElement
76
+ if (wrapperEl) {
77
+ const wrapperRect = wrapperEl.getBoundingClientRect()
78
+ top += tableRect.top - wrapperRect.top
79
+ }
80
+ }
81
+ }
82
+ const fStys: Record<string, any> = {
83
+ top: toCssUnit(top),
84
+ left: toCssUnit(left)
85
+ }
86
+ if (zIndex) {
87
+ fStys.zIndex = zIndex
88
+ }
89
+ filterStore.style = fStys
90
+ // 筛选面板是自适应表格高度
91
+ if (compConf ? !compConf.tableFilterAutoHeight : false) {
92
+ maxHeight = 0
93
+ } else {
94
+ if (customMaxHeight) {
95
+ maxHeight = customMaxHeight > maxHeight ? maxHeight : customMaxHeight
96
+ }
97
+ }
98
+ // 判断面板不能大于表格高度
99
+ filterStore.maxHeight = maxHeight
100
+ return $xeTable.$nextTick()
101
+ }
102
+
13
103
  export default {
14
104
  methods: {
15
105
  /**
@@ -99,92 +189,22 @@ export default {
99
189
  },
100
190
  handleOpenFilterColumn (evnt: MouseEvent, btnEl: HTMLDivElement | null, colEl: HTMLDivElement, column: VxeTableDefines.ColumnInfo, params: any) {
101
191
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
102
- const $xeGrid = $xeTable.$xeGrid
103
- const $xeGantt = $xeTable.$xeGantt
104
192
  const reactData = $xeTable as unknown as TableReactData
105
193
  const internalData = $xeTable as unknown as TableInternalData
106
- const $xeGGWrapper = $xeGrid || $xeGantt
107
194
 
108
195
  const { initStore, filterStore } = reactData
109
- const { elemStore } = internalData
110
196
  if (filterStore.column === column && filterStore.visible) {
111
197
  filterStore.visible = false
112
198
  } else {
113
- const tableEl = $xeTable.$refs.refElem as HTMLDivElement
114
- const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode()
115
- const filterOpts = $xeTable.computeFilterOpts
116
- const { maxHeight: customMaxHeight, transfer, zIndex } = filterOpts
117
199
  const currEl = btnEl || colEl
118
- const tableRect = tableEl.getBoundingClientRect()
119
- const filterRender = column ? column.filterRender : null
120
- const compConf = filterRender && isEnableConf(filterRender) ? renderer.get(filterRender.name) : null
121
200
  $xeTable.handleFilterOptions(column)
122
201
  internalData._currFilterParams = params
202
+ filterStore.targetEl = currEl
123
203
  filterStore.style = null
124
204
  filterStore.visible = true
125
205
  initStore.filter = true
126
206
  $xeTable.$nextTick(() => {
127
- const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
128
- if (!headerScrollElem) {
129
- return
130
- }
131
- const tableFilter = $xeTable.$refs.refTableFilter
132
- const filterWrapperElem = tableFilter ? (tableFilter as any).$el as HTMLDivElement : null
133
- if (!filterWrapperElem) {
134
- return
135
- }
136
- const btnRect = currEl.getBoundingClientRect()
137
- const filterHeadElem = filterWrapperElem.querySelector<HTMLDivElement>('.vxe-table--filter-header')
138
- const filterFootElem = filterWrapperElem.querySelector<HTMLDivElement>('.vxe-table--filter-footer')
139
- const filterWidth = filterWrapperElem.offsetWidth
140
- const centerWidth = filterWidth / 2
141
- let left = 0
142
- let top = 0
143
- let maxHeight = 0
144
- if (transfer) {
145
- left = btnRect.left - centerWidth + scrollLeft
146
- top = btnRect.top + currEl.clientHeight + scrollTop
147
- 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))
148
- if (left < 16) {
149
- left = 16
150
- } else if (left > (visibleWidth - filterWidth - 16)) {
151
- left = visibleWidth - filterWidth - 16
152
- }
153
- } else {
154
- left = btnRect.left - tableRect.left - centerWidth
155
- top = btnRect.top - tableRect.top + currEl.clientHeight
156
- maxHeight = Math.max(40, tableEl.clientHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 14)
157
- if (left < 1) {
158
- left = 1
159
- } else if (left > (tableEl.clientWidth - filterWidth - 1)) {
160
- left = tableEl.clientWidth - filterWidth - 1
161
- }
162
- if ($xeGGWrapper) {
163
- const wrapperEl = $xeGGWrapper.$refs.refElem as HTMLDivElement
164
- if (wrapperEl) {
165
- const wrapperRect = wrapperEl.getBoundingClientRect()
166
- top += tableRect.top - wrapperRect.top
167
- }
168
- }
169
- }
170
- const fStys: Record<string, any> = {
171
- top: toCssUnit(top),
172
- left: toCssUnit(left)
173
- }
174
- if (zIndex) {
175
- fStys.zIndex = zIndex
176
- }
177
- filterStore.style = fStys
178
- // 筛选面板是自适应表格高度
179
- if (compConf ? !compConf.tableFilterAutoHeight : false) {
180
- maxHeight = 0
181
- } else {
182
- if (customMaxHeight) {
183
- maxHeight = customMaxHeight > maxHeight ? maxHeight : customMaxHeight
184
- }
185
- }
186
- // 判断面板不能大于表格高度
187
- filterStore.maxHeight = maxHeight
207
+ updatePopupStyle($xeTable)
188
208
  })
189
209
  }
190
210
  $xeTable.dispatchEvent('filter-visible', { column, field: column.field, property: column.field, filterList: $xeTable.getCheckedFilters(), visible: filterStore.visible }, evnt)
@@ -462,6 +482,16 @@ export default {
462
482
  }
463
483
  }
464
484
  },
485
+ handleFilterStyle () {
486
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
487
+ const reactData = $xeTable as unknown as TableReactData
488
+
489
+ const { filterStore } = reactData
490
+ if (!filterStore.visible) {
491
+ return $xeTable.$nextTick()
492
+ }
493
+ return updatePopupStyle($xeTable)
494
+ },
465
495
  /**
466
496
  * 清空指定列的筛选条件
467
497
  * 如果为空则清空所有列的筛选条件
@@ -2,7 +2,7 @@ import { PropType, CreateElement } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import { VxeUI } from '../../ui'
4
4
  import { defineVxeComponent } from '../../ui/src/comp'
5
- import { isEnableConf, getClass } from '../../ui/src/utils'
5
+ import { isEnableConf, getClass, getDefaultConfig } from '../../ui/src/utils'
6
6
  import { getRowid, createHandleGetRowId, getCellRestHeight } from './util'
7
7
  import { updateCellTitle } from '../../ui/src/dom'
8
8
  import { getSlotVNs } from '../../ui/src/vn'
@@ -144,8 +144,14 @@ function renderTdColumn (
144
144
  const isEdit = isEnableConf(editRender)
145
145
  const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0
146
146
  let fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed)
147
- const isCellPadding = XEUtils.eqNull(padding) ? (allPadding === null ? cellOpts.padding : allPadding) : padding
148
- const cellOverflow = XEUtils.eqNull(showOverflow) ? allShowOverflow : showOverflow
147
+ const cellPadding = getDefaultConfig(padding, (allPadding === null ? cellOpts.padding : allPadding))
148
+ const isAllCellPadding = cellPadding === true
149
+ const isCellPaddingTop = cellPadding ? (isAllCellPadding || cellPadding.top !== false) : false
150
+ const isCellPaddingBottom = cellPadding ? (isAllCellPadding || cellPadding.bottom !== false) : false
151
+ const isCellPaddingLeft = cellPadding ? (isAllCellPadding || cellPadding.left !== false) : false
152
+ const isCellPaddingRight = cellPadding ? (isAllCellPadding || cellPadding.right !== false) : false
153
+
154
+ const cellOverflow = getDefaultConfig(showOverflow, allShowOverflow)
149
155
  const showEllipsis = cellOverflow === 'ellipsis'
150
156
  const showTitle = cellOverflow === 'title'
151
157
  const showTooltip = cellOverflow === true ? tooltipOpts.mode === 'tooltip' : cellOverflow === 'tooltip'
@@ -466,7 +472,10 @@ function renderTdColumn (
466
472
  'col--max-height': maxHeight,
467
473
  'fixed--width': !isAutoCellWidth,
468
474
  'fixed--hidden': fixedHiddenColumn,
469
- 'is--padding': isCellPadding,
475
+ 'is--pg-top': isCellPaddingTop,
476
+ 'is--pg-bottom': isCellPaddingBottom,
477
+ 'is--pg-left': isCellPaddingLeft,
478
+ 'is--pg-right': isCellPaddingRight,
470
479
  'is--progress': (fixedHiddenColumn && isAllOverflow) || isVNPreEmptyStatus,
471
480
  'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
472
481
  'is--drag-disabled': isDisabledDrag,
@@ -2,7 +2,7 @@ import { PropType, CreateElement } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import { VxeUI } from '../../ui'
4
4
  import { defineVxeComponent } from '../../ui/src/comp'
5
- import { getClass } from '../../ui/src/utils'
5
+ import { getClass, getDefaultConfig } from '../../ui/src/utils'
6
6
  import { updateCellTitle } from '../../ui/src/dom'
7
7
  import { getCalcHeight } from './util'
8
8
 
@@ -44,8 +44,15 @@ function renderRows (h: CreateElement, _vm: any, isOptimizeMode: boolean, tableC
44
44
  const compConf = renderOpts ? renderer.get(renderOpts.name) : null
45
45
  const showAllTip = footerTooltipOpts.showAll
46
46
  const fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed)
47
- const isPadding = XEUtils.isBoolean(footerCellOpts.padding) ? footerCellOpts.padding : cellOpts.padding
48
- const footOverflow = XEUtils.eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow
47
+
48
+ const cellPadding = getDefaultConfig(footerCellOpts.padding, cellOpts.padding)
49
+ const isAllCellPadding = cellPadding === true
50
+ const isCellPaddingTop = cellPadding ? (isAllCellPadding || cellPadding.top !== false) : false
51
+ const isCellPaddingBottom = cellPadding ? (isAllCellPadding || cellPadding.bottom !== false) : false
52
+ const isCellPaddingLeft = cellPadding ? (isAllCellPadding || cellPadding.left !== false) : false
53
+ const isCellPaddingRight = cellPadding ? (isAllCellPadding || cellPadding.right !== false) : false
54
+
55
+ const footOverflow = getDefaultConfig(showFooterOverflow, allColumnFooterOverflow)
49
56
  const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
50
57
  const showEllipsis = (footOverflow === true ? footerTooltipOpts.mode : footOverflow) === 'ellipsis'
51
58
  const showTitle = (footOverflow === true ? footerTooltipOpts.mode : footOverflow) === 'title'
@@ -155,7 +162,10 @@ function renderRows (h: CreateElement, _vm: any, isOptimizeMode: boolean, tableC
155
162
  'col--last': isLastColumn,
156
163
  'fixed--width': !isAutoCellWidth,
157
164
  'fixed--hidden': fixedHiddenColumn,
158
- 'is--padding': isPadding,
165
+ 'is--pg-top': isCellPaddingTop,
166
+ 'is--pg-bottom': isCellPaddingBottom,
167
+ 'is--pg-left': isCellPaddingLeft,
168
+ 'is--pg-right': isCellPaddingRight,
159
169
  'col--ellipsis': hasEllipsis,
160
170
  'col--current': currentColumn === column
161
171
  }, getClass(footerClassName, cellParams), getClass(footerCellClassName, cellParams)],
@@ -2,7 +2,7 @@ import { PropType, CreateElement } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import { VxeUI } from '../../ui'
4
4
  import { defineVxeComponent } from '../../ui/src/comp'
5
- import { isEnableConf, getClass } from '../../ui/src/utils'
5
+ import { isEnableConf, getClass, getDefaultConfig } from '../../ui/src/utils'
6
6
  import { getCalcHeight, convertHeaderColumnToRows, convertHeaderToGridRows } from './util'
7
7
  import { getSlotVNs } from '../../ui/src/vn'
8
8
 
@@ -46,8 +46,15 @@ function renderRows (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMod
46
46
  const compConf = renderOpts ? renderer.get(renderOpts.name) : null
47
47
  const isColGroup = column.children && column.children.length
48
48
  const fixedHiddenColumn = overflowX && !isColGroup && (fixedType ? column.fixed !== fixedType : !!column.fixed)
49
- const isPadding = XEUtils.isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding
50
- const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
49
+
50
+ const cellPadding = getDefaultConfig(headerCellOpts.padding, cellOpts.padding)
51
+ const isAllCellPadding = cellPadding === true
52
+ const isCellPaddingTop = cellPadding ? (isAllCellPadding || cellPadding.top !== false) : false
53
+ const isCellPaddingBottom = cellPadding ? (isAllCellPadding || cellPadding.bottom !== false) : false
54
+ const isCellPaddingLeft = cellPadding ? (isAllCellPadding || cellPadding.left !== false) : false
55
+ const isCellPaddingRight = cellPadding ? (isAllCellPadding || cellPadding.right !== false) : false
56
+
57
+ const headOverflow = getDefaultConfig(showHeaderOverflow, allColumnHeaderOverflow)
51
58
  const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
52
59
  const showEllipsis = headOverflow === 'ellipsis'
53
60
  const showTitle = headOverflow === 'title'
@@ -170,7 +177,10 @@ function renderRows (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMod
170
177
  'col--group': isColGroup,
171
178
  'col--ellipsis': hasEllipsis,
172
179
  'fixed--width': !isAutoCellWidth,
173
- 'is--padding': isPadding,
180
+ 'is--pg-top': isCellPaddingTop,
181
+ 'is--pg-bottom': isCellPaddingBottom,
182
+ 'is--pg-left': isCellPaddingLeft,
183
+ 'is--pg-right': isCellPaddingRight,
174
184
  'is--sortable': column.sortable,
175
185
  'col--filter': !!filters,
176
186
  'is--filter-active': hasFilter,
@@ -2634,10 +2634,9 @@ const calcCellHeight = ($xeTable: VxeTableConstructor) => {
2634
2634
  if (!el || !el.clientWidth) {
2635
2635
  return
2636
2636
  }
2637
- const cellOpts = $xeTable.computeCellOpts
2638
2637
  const treeOpts = $xeTable.computeTreeOpts
2639
2638
  const defaultRowHeight = $xeTable.computeDefaultRowHeight
2640
- if (!isAllOverflow && (scrollYLoad || scrollXLoad || cellOpts.maxHeight || (treeConfig && treeOpts.showLine))) {
2639
+ if (!isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine))) {
2641
2640
  const { handleGetRowId } = createHandleGetRowId($xeTable)
2642
2641
  el.setAttribute('data-calc-row', 'Y')
2643
2642
  tableData.forEach(row => {
@@ -7915,7 +7914,13 @@ const tableMethods: any = {
7915
7914
  },
7916
7915
  handleGlobalScrollEvent (evnt: MouseEvent) {
7917
7916
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
7917
+ const reactData = $xeTable as unknown as TableReactData
7918
7918
 
7919
+ const { filterStore } = reactData
7920
+ const filterOpts = $xeTable.computeFilterOpts
7921
+ if (filterStore.visible && filterOpts.transfer) {
7922
+ $xeTable.handleFilterStyle()
7923
+ }
7919
7924
  reUpdateCustomStyleEvent($xeTable, evnt)
7920
7925
  },
7921
7926
  /**
@@ -7934,11 +7939,15 @@ const tableMethods: any = {
7934
7939
  */
7935
7940
  keydownEvent (evnt: any) {
7936
7941
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
7942
+ const props = $xeTable
7943
+ const reactData = $xeTable as unknown as TableReactData
7937
7944
 
7938
- const { filterStore, ctxMenuStore, editStore, keyboardConfig, mouseConfig, mouseOpts, keyboardOpts } = this
7945
+ const { mouseConfig, keyboardConfig } = props
7946
+ const { filterStore, ctxMenuStore, editStore } = reactData
7947
+ const mouseOpts = $xeTable.computeMouseOpts
7948
+ const keyboardOpts = $xeTable.computeKeyboardOpts
7939
7949
  const { actived } = editStore
7940
- const { keyCode } = evnt
7941
- const isEsc = keyCode === 27
7950
+ const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE)
7942
7951
  if (isEsc) {
7943
7952
  this.preventEvent(evnt, 'event.keydown', null, () => {
7944
7953
  $xeTable.dispatchEvent('keydown-start', {}, evnt)
@@ -1508,6 +1508,12 @@ export default {
1508
1508
  const scrollbarXOpts = $xeTable.computeScrollbarXOpts
1509
1509
  const scrollbarYOpts = $xeTable.computeScrollbarYOpts
1510
1510
  return `${scrollbarXOpts.visible}${scrollbarYOpts.visible}`
1511
+ },
1512
+ computeCellConfHeitht () {
1513
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
1514
+
1515
+ const cellOpts = $xeTable.computeCellOpts
1516
+ return cellOpts.height
1511
1517
  }
1512
1518
  } as any,
1513
1519
  watch: {
@@ -1595,6 +1601,9 @@ export default {
1595
1601
  computeScrollbarVisible () {
1596
1602
  this.reLayoutFlag++
1597
1603
  },
1604
+ computeCellConfHeitht () {
1605
+ this.reLayoutFlag++
1606
+ },
1598
1607
  reLayoutFlag () {
1599
1608
  const $xeTable = this
1600
1609
 
@@ -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) {
@@ -55,6 +55,6 @@ export function getClass (property: any, params: any) {
55
55
  return property ? XEUtils.isFunction(property) ? property(params) : property : ''
56
56
  }
57
57
 
58
- export function getDefaultConfig (val1: any, def1: any) {
58
+ export function getDefaultConfig <T = any, D = any> (val1: T, def1: D): (T | D) {
59
59
  return XEUtils.eqNull(val1) ? def1 : val1
60
60
  }