vxe-table 4.15.0-beta.1 → 4.15.0-beta.10

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 (160) hide show
  1. package/es/grid/src/grid.js +88 -1
  2. package/es/locale/lang/ar-EG.js +2 -1
  3. package/es/locale/lang/de-DE.js +2 -1
  4. package/es/locale/lang/en-US.js +2 -1
  5. package/es/locale/lang/es-ES.js +2 -1
  6. package/es/locale/lang/fr-FR.js +2 -1
  7. package/es/locale/lang/hu-HU.js +2 -1
  8. package/es/locale/lang/hy-AM.js +2 -1
  9. package/es/locale/lang/id-ID.js +2 -1
  10. package/es/locale/lang/it-IT.js +2 -1
  11. package/es/locale/lang/ja-JP.js +2 -1
  12. package/es/locale/lang/ko-KR.js +2 -1
  13. package/es/locale/lang/ms-MY.js +2 -1
  14. package/es/locale/lang/nb-NO.js +2 -1
  15. package/es/locale/lang/pt-BR.js +2 -1
  16. package/es/locale/lang/ru-RU.js +2 -1
  17. package/es/locale/lang/th-TH.js +2 -1
  18. package/es/locale/lang/ug-CN.js +2 -1
  19. package/es/locale/lang/uk-UA.js +2 -1
  20. package/es/locale/lang/uz-UZ.js +2 -1
  21. package/es/locale/lang/vi-VN.js +2 -1
  22. package/es/locale/lang/zh-CHT.js +2 -1
  23. package/es/locale/lang/zh-CN.js +2 -1
  24. package/es/style.css +1 -1
  25. package/es/table/module/filter/hook.js +9 -22
  26. package/es/table/module/keyboard/hook.js +2 -2
  27. package/es/table/src/body.js +2 -2
  28. package/es/table/src/cell.js +5 -5
  29. package/es/table/src/footer.js +2 -3
  30. package/es/table/src/header.js +2 -2
  31. package/es/table/src/table.js +158 -37
  32. package/es/ui/index.js +2 -1
  33. package/es/ui/src/log.js +1 -1
  34. package/lib/grid/src/grid.js +96 -1
  35. package/lib/grid/src/grid.min.js +1 -1
  36. package/lib/index.umd.js +142 -67
  37. package/lib/index.umd.min.js +1 -1
  38. package/lib/locale/lang/ar-EG.js +2 -1
  39. package/lib/locale/lang/ar-EG.min.js +1 -1
  40. package/lib/locale/lang/ar-EG.umd.js +2 -1
  41. package/lib/locale/lang/de-DE.js +2 -1
  42. package/lib/locale/lang/de-DE.min.js +1 -1
  43. package/lib/locale/lang/de-DE.umd.js +2 -1
  44. package/lib/locale/lang/en-US.js +2 -1
  45. package/lib/locale/lang/en-US.min.js +1 -1
  46. package/lib/locale/lang/en-US.umd.js +2 -1
  47. package/lib/locale/lang/es-ES.js +2 -1
  48. package/lib/locale/lang/es-ES.min.js +1 -1
  49. package/lib/locale/lang/es-ES.umd.js +2 -1
  50. package/lib/locale/lang/fr-FR.js +2 -1
  51. package/lib/locale/lang/fr-FR.min.js +1 -1
  52. package/lib/locale/lang/fr-FR.umd.js +2 -1
  53. package/lib/locale/lang/hu-HU.js +2 -1
  54. package/lib/locale/lang/hu-HU.min.js +1 -1
  55. package/lib/locale/lang/hu-HU.umd.js +2 -1
  56. package/lib/locale/lang/hy-AM.js +2 -1
  57. package/lib/locale/lang/hy-AM.min.js +1 -1
  58. package/lib/locale/lang/hy-AM.umd.js +2 -1
  59. package/lib/locale/lang/id-ID.js +2 -1
  60. package/lib/locale/lang/id-ID.min.js +1 -1
  61. package/lib/locale/lang/id-ID.umd.js +2 -1
  62. package/lib/locale/lang/it-IT.js +2 -1
  63. package/lib/locale/lang/it-IT.min.js +1 -1
  64. package/lib/locale/lang/it-IT.umd.js +2 -1
  65. package/lib/locale/lang/ja-JP.js +2 -1
  66. package/lib/locale/lang/ja-JP.min.js +1 -1
  67. package/lib/locale/lang/ja-JP.umd.js +2 -1
  68. package/lib/locale/lang/ko-KR.js +2 -1
  69. package/lib/locale/lang/ko-KR.min.js +1 -1
  70. package/lib/locale/lang/ko-KR.umd.js +2 -1
  71. package/lib/locale/lang/ms-MY.js +2 -1
  72. package/lib/locale/lang/ms-MY.min.js +1 -1
  73. package/lib/locale/lang/ms-MY.umd.js +2 -1
  74. package/lib/locale/lang/nb-NO.js +2 -1
  75. package/lib/locale/lang/nb-NO.min.js +1 -1
  76. package/lib/locale/lang/nb-NO.umd.js +2 -1
  77. package/lib/locale/lang/pt-BR.js +2 -1
  78. package/lib/locale/lang/pt-BR.min.js +1 -1
  79. package/lib/locale/lang/pt-BR.umd.js +2 -1
  80. package/lib/locale/lang/ru-RU.js +2 -1
  81. package/lib/locale/lang/ru-RU.min.js +1 -1
  82. package/lib/locale/lang/ru-RU.umd.js +2 -1
  83. package/lib/locale/lang/th-TH.js +2 -1
  84. package/lib/locale/lang/th-TH.min.js +1 -1
  85. package/lib/locale/lang/th-TH.umd.js +2 -1
  86. package/lib/locale/lang/ug-CN.js +2 -1
  87. package/lib/locale/lang/ug-CN.min.js +1 -1
  88. package/lib/locale/lang/ug-CN.umd.js +2 -1
  89. package/lib/locale/lang/uk-UA.js +2 -1
  90. package/lib/locale/lang/uk-UA.min.js +1 -1
  91. package/lib/locale/lang/uk-UA.umd.js +2 -1
  92. package/lib/locale/lang/uz-UZ.js +2 -1
  93. package/lib/locale/lang/uz-UZ.min.js +1 -1
  94. package/lib/locale/lang/uz-UZ.umd.js +2 -1
  95. package/lib/locale/lang/vi-VN.js +2 -1
  96. package/lib/locale/lang/vi-VN.min.js +1 -1
  97. package/lib/locale/lang/vi-VN.umd.js +2 -1
  98. package/lib/locale/lang/zh-CHT.js +2 -1
  99. package/lib/locale/lang/zh-CHT.min.js +1 -1
  100. package/lib/locale/lang/zh-CHT.umd.js +2 -1
  101. package/lib/locale/lang/zh-CN.js +2 -1
  102. package/lib/locale/lang/zh-CN.min.js +1 -1
  103. package/lib/locale/lang/zh-CN.umd.js +2 -1
  104. package/lib/style.css +1 -1
  105. package/lib/table/module/filter/hook.js +10 -33
  106. package/lib/table/module/filter/hook.min.js +1 -1
  107. package/lib/table/module/keyboard/hook.js +2 -2
  108. package/lib/table/module/keyboard/hook.min.js +1 -1
  109. package/lib/table/src/body.js +2 -2
  110. package/lib/table/src/body.min.js +1 -1
  111. package/lib/table/src/cell.js +5 -4
  112. package/lib/table/src/cell.min.js +1 -1
  113. package/lib/table/src/footer.js +2 -3
  114. package/lib/table/src/footer.min.js +1 -1
  115. package/lib/table/src/header.js +2 -2
  116. package/lib/table/src/header.min.js +1 -1
  117. package/lib/table/src/table.js +18 -17
  118. package/lib/table/src/table.min.js +1 -1
  119. package/lib/ui/index.js +2 -1
  120. package/lib/ui/index.min.js +1 -1
  121. package/lib/ui/src/log.js +1 -1
  122. package/lib/ui/src/log.min.js +1 -1
  123. package/package.json +1 -1
  124. package/packages/grid/src/grid.ts +90 -1
  125. package/packages/locale/lang/ar-EG.ts +2 -1
  126. package/packages/locale/lang/de-DE.ts +2 -1
  127. package/packages/locale/lang/en-US.ts +2 -1
  128. package/packages/locale/lang/es-ES.ts +2 -1
  129. package/packages/locale/lang/fr-FR.ts +2 -1
  130. package/packages/locale/lang/hu-HU.ts +2 -1
  131. package/packages/locale/lang/hy-AM.ts +2 -1
  132. package/packages/locale/lang/id-ID.ts +2 -1
  133. package/packages/locale/lang/it-IT.ts +2 -1
  134. package/packages/locale/lang/ja-JP.ts +2 -1
  135. package/packages/locale/lang/ko-KR.ts +2 -1
  136. package/packages/locale/lang/ms-MY.ts +2 -1
  137. package/packages/locale/lang/nb-NO.ts +2 -1
  138. package/packages/locale/lang/pt-BR.ts +2 -1
  139. package/packages/locale/lang/ru-RU.ts +2 -1
  140. package/packages/locale/lang/th-TH.ts +2 -1
  141. package/packages/locale/lang/ug-CN.ts +2 -1
  142. package/packages/locale/lang/uk-UA.ts +2 -1
  143. package/packages/locale/lang/uz-UZ.ts +2 -1
  144. package/packages/locale/lang/vi-VN.ts +2 -1
  145. package/packages/locale/lang/zh-CHT.ts +2 -1
  146. package/packages/locale/lang/zh-CN.ts +2 -1
  147. package/packages/table/module/filter/hook.ts +10 -24
  148. package/packages/table/module/keyboard/hook.ts +2 -2
  149. package/packages/table/src/body.ts +2 -2
  150. package/packages/table/src/cell.ts +5 -5
  151. package/packages/table/src/footer.ts +2 -3
  152. package/packages/table/src/header.ts +2 -2
  153. package/packages/table/src/table.ts +168 -37
  154. package/packages/ui/index.ts +1 -0
  155. /package/es/{iconfont.1753080055966.ttf → iconfont.1753519951433.ttf} +0 -0
  156. /package/es/{iconfont.1753080055966.woff → iconfont.1753519951433.woff} +0 -0
  157. /package/es/{iconfont.1753080055966.woff2 → iconfont.1753519951433.woff2} +0 -0
  158. /package/lib/{iconfont.1753080055966.ttf → iconfont.1753519951433.ttf} +0 -0
  159. /package/lib/{iconfont.1753080055966.woff → iconfont.1753519951433.woff} +0 -0
  160. /package/lib/{iconfont.1753080055966.woff2 → iconfont.1753519951433.woff2} +0 -0
@@ -68,8 +68,7 @@ export default defineVxeComponent({
68
68
  const renderOpts = editRender || cellRender
69
69
  const compConf = renderOpts ? renderer.get(renderOpts.name) : null
70
70
  const showAllTip = tooltipOpts.showAll
71
- const isColGroup = column.children && column.children.length
72
- const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX
71
+ const fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed)
73
72
  const isPadding = XEUtils.isBoolean(footerCellOpts.padding) ? footerCellOpts.padding : cellOpts.padding
74
73
  const footOverflow = XEUtils.eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow
75
74
  const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
@@ -159,7 +158,7 @@ export default defineVxeComponent({
159
158
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
160
159
 
161
160
  let isVNPreEmptyStatus = false
162
- if (isOptimizeMode && !isMergeCell) {
161
+ if (isOptimizeMode && overflowX && !isMergeCell) {
163
162
  if (scrollXLoad && !column.fixed && !virtualXOpts.immediate && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
164
163
  isVNPreEmptyStatus = true
165
164
  }
@@ -66,7 +66,7 @@ export default defineVxeComponent({
66
66
  const renderOpts = editRender || cellRender
67
67
  const compConf = renderOpts ? renderer.get(renderOpts.name) : null
68
68
  const isColGroup = column.children && column.children.length
69
- const fixedHiddenColumn = fixedType ? (column.fixed !== fixedType && !isColGroup) : !!column.fixed && overflowX
69
+ const fixedHiddenColumn = overflowX && !isColGroup && (fixedType ? column.fixed !== fixedType : !!column.fixed)
70
70
  const isPadding = XEUtils.isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding
71
71
  const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
72
72
  const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
@@ -130,7 +130,7 @@ export default defineVxeComponent({
130
130
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
131
131
 
132
132
  let isVNPreEmptyStatus = false
133
- if (isOptimizeMode && !isGroup) {
133
+ if (isOptimizeMode && overflowX && !isGroup) {
134
134
  if (!dragCol || dragCol.id !== colid) {
135
135
  if (scrollXLoad && !column.fixed && !virtualXOpts.immediate && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
136
136
  isVNPreEmptyStatus = true
@@ -1443,16 +1443,23 @@ export default defineVxeComponent({
1443
1443
  }
1444
1444
 
1445
1445
  const handleSortEvent = (evnt: Event | null, sortConfs: VxeTableDefines.SortConfs | VxeTableDefines.SortConfs[], isUpdate?: boolean) => {
1446
+ const { tableFullColumn } = internalData
1446
1447
  const sortOpts = computeSortOpts.value
1447
1448
  const { multiple, remote, orders } = sortOpts
1448
1449
  if (!XEUtils.isArray(sortConfs)) {
1449
1450
  sortConfs = [sortConfs]
1450
1451
  }
1451
1452
  if (sortConfs && sortConfs.length) {
1453
+ const orderActiveMaps: Record<string, VxeTableDefines.ColumnInfo> = {}
1452
1454
  if (!multiple) {
1453
1455
  sortConfs = [sortConfs[0]]
1454
- clearAllSort()
1456
+ tableFullColumn.forEach((column) => {
1457
+ if (column.order) {
1458
+ orderActiveMaps[column.id] = column
1459
+ }
1460
+ })
1455
1461
  }
1462
+ const sortColMpps: Record<string, VxeTableDefines.ColumnInfo> = {}
1456
1463
  let firstColumn: any = null
1457
1464
  sortConfs.forEach((confs: any, index: number) => {
1458
1465
  let { field, order } = confs
@@ -1471,8 +1478,16 @@ export default defineVxeComponent({
1471
1478
  column.order = order
1472
1479
  }
1473
1480
  column.sortTime = Date.now() + index
1481
+ sortColMpps[column.id] = column
1474
1482
  }
1475
1483
  })
1484
+ if (!multiple) {
1485
+ XEUtils.each(orderActiveMaps, (oaCol: VxeTableDefines.ColumnInfo, oaId) => {
1486
+ if (!sortColMpps[oaId]) {
1487
+ oaCol.order = null
1488
+ }
1489
+ })
1490
+ }
1476
1491
  if (isUpdate) {
1477
1492
  if (!remote) {
1478
1493
  $xeTable.handleTableData(true)
@@ -2907,19 +2922,17 @@ export default defineVxeComponent({
2907
2922
  const handleDefaultTreeExpand = () => {
2908
2923
  const { treeConfig } = props
2909
2924
  if (treeConfig) {
2910
- const { tableFullData } = internalData
2925
+ const { fullAllDataRowIdData } = internalData
2911
2926
  const treeOpts = computeTreeOpts.value
2912
2927
  const { expandAll, expandRowKeys } = treeOpts
2913
- const childrenField = treeOpts.children || treeOpts.childrenField
2914
2928
  if (expandAll) {
2915
2929
  $xeTable.setAllTreeExpand(true)
2916
2930
  } else if (expandRowKeys) {
2917
2931
  const defExpandeds: any[] = []
2918
- const rowkey = getRowkey($xeTable)
2919
- expandRowKeys.forEach((rowid: any) => {
2920
- const matchObj = XEUtils.findTree(tableFullData, item => rowid === XEUtils.get(item, rowkey), { children: childrenField })
2921
- if (matchObj) {
2922
- defExpandeds.push(matchObj.item)
2932
+ expandRowKeys.forEach((rowid) => {
2933
+ const rowRest = fullAllDataRowIdData[rowid]
2934
+ if (rowRest) {
2935
+ defExpandeds.push(rowRest.row)
2923
2936
  }
2924
2937
  })
2925
2938
  $xeTable.setTreeExpand(defExpandeds, true)
@@ -3525,6 +3538,13 @@ export default defineVxeComponent({
3525
3538
  }
3526
3539
  reactData.isRowLoading = false
3527
3540
  handleRecalculateStyle(false, false, false)
3541
+ // 如果是自动行高,特殊情况需调用 recalculate 手动刷新
3542
+ if (!props.showOverflow) {
3543
+ setTimeout(() => {
3544
+ handleLazyRecalculate(false, true, true)
3545
+ setTimeout(() => handleLazyRecalculate(false, true, true), 3000)
3546
+ }, 2000)
3547
+ }
3528
3548
  // 是否变更虚拟滚动
3529
3549
  if (oldScrollYLoad === sYLoad) {
3530
3550
  restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop)
@@ -3557,6 +3577,7 @@ export default defineVxeComponent({
3557
3577
  handleDefaultRadioChecked()
3558
3578
  handleDefaultRowExpand()
3559
3579
  handleDefaultTreeExpand()
3580
+ handleDefaultRowGroupExpand()
3560
3581
  handleDefaultMergeCells()
3561
3582
  handleDefaultMergeFooterItems()
3562
3583
  nextTick(() => setTimeout(() => $xeTable.recalculate()))
@@ -3980,6 +4001,22 @@ export default defineVxeComponent({
3980
4001
  })
3981
4002
  }
3982
4003
 
4004
+ /**
4005
+ * 处理默认展开分组行
4006
+ */
4007
+ const handleDefaultRowGroupExpand = () => {
4008
+ const { isRowGroupStatus } = reactData
4009
+ if (isRowGroupStatus) {
4010
+ const aggregateOpts = computeAggregateOpts.value
4011
+ const { expandAll, expandGroupFields } = aggregateOpts
4012
+ if (expandAll) {
4013
+ $xeTable.setAllRowGroupExpand(true)
4014
+ } else if (expandGroupFields && expandGroupFields.length) {
4015
+ $xeTable.setRowGroupExpandByField(expandGroupFields, true)
4016
+ }
4017
+ }
4018
+ }
4019
+
3983
4020
  const handleCheckAllEvent = (evnt: Event | null, value: any) => {
3984
4021
  handleCheckedAllCheckboxRow(value)
3985
4022
  if (evnt) {
@@ -5933,11 +5970,10 @@ export default defineVxeComponent({
5933
5970
  return nextTick()
5934
5971
  },
5935
5972
  setSort (sortConfs, isUpdate) {
5936
- // 已废弃,即将去掉事件触发 new Event('click') -> null
5937
- return handleSortEvent(new Event('click'), sortConfs, isUpdate)
5973
+ return handleSortEvent(null, sortConfs, isUpdate)
5938
5974
  },
5939
- setSortByEvent (evnt, sortConfs, isUpdate) {
5940
- return handleSortEvent(evnt, sortConfs, isUpdate)
5975
+ setSortByEvent (evnt, sortConfs) {
5976
+ return handleSortEvent(evnt, sortConfs, true)
5941
5977
  },
5942
5978
  /**
5943
5979
  * 清空指定列的排序条件
@@ -5965,6 +6001,7 @@ export default defineVxeComponent({
5965
6001
  clearSortByEvent (evnt, fieldOrColumn) {
5966
6002
  const { tableFullColumn } = internalData
5967
6003
  const sortOpts = computeSortOpts.value
6004
+ const { multiple } = sortOpts
5968
6005
  const sortCols: VxeTableDefines.ColumnInfo[] = []
5969
6006
  let column: VxeTableDefines.ColumnInfo<any> | null = null
5970
6007
  if (evnt) {
@@ -5984,11 +6021,18 @@ export default defineVxeComponent({
5984
6021
  if (!sortOpts.remote) {
5985
6022
  $xeTable.handleTableData(true)
5986
6023
  }
5987
- if (sortCols.length) {
6024
+
6025
+ if (!multiple) {
6026
+ column = sortCols[0]
6027
+ }
6028
+
6029
+ if (column) {
6030
+ $xeTable.handleColumnSortEvent(evnt, column)
6031
+ }
6032
+
6033
+ if (multiple && sortCols.length) {
5988
6034
  const params = { $table: $xeTable, $event: evnt, cols: sortCols, sortList: [] }
5989
6035
  dispatchEvent('clear-all-sort', params, evnt)
5990
- } else if (column) {
5991
- $xeTable.handleColumnSortEvent(evnt, column)
5992
6036
  }
5993
6037
  }
5994
6038
  return nextTick().then(() => {
@@ -6019,13 +6063,11 @@ export default defineVxeComponent({
6019
6063
  }
6020
6064
  return sortList
6021
6065
  },
6022
- setFilterByEvent (evnt, fieldOrColumn, options, isUpdate) {
6066
+ setFilterByEvent (evnt, fieldOrColumn, options) {
6023
6067
  const column = handleFieldOrColumn($xeTable, fieldOrColumn)
6024
6068
  if (column && column.filters) {
6025
6069
  column.filters = toFilters(options || [])
6026
- if (isUpdate) {
6027
- return $xeTable.handleColumnConfirmFilter(column, evnt)
6028
- }
6070
+ return $xeTable.handleColumnConfirmFilter(column, evnt)
6029
6071
  }
6030
6072
  return nextTick()
6031
6073
  },
@@ -6069,6 +6111,7 @@ export default defineVxeComponent({
6069
6111
  const { filterStore } = reactData
6070
6112
  const { tableFullColumn } = internalData
6071
6113
  const filterOpts = computeFilterOpts.value
6114
+ const { multiple } = filterOpts
6072
6115
  const filterCols: VxeTableDefines.ColumnInfo[] = []
6073
6116
  let column: VxeTableDefines.ColumnInfo<any> | null = null
6074
6117
  if (fieldOrColumn) {
@@ -6091,19 +6134,49 @@ export default defineVxeComponent({
6091
6134
  style: null,
6092
6135
  options: [],
6093
6136
  column: null,
6094
- multiple: false,
6137
+ multiple: false, // 选项是覅多选
6095
6138
  visible: false
6096
6139
  })
6097
6140
  }
6141
+
6098
6142
  if (!filterOpts.remote) {
6099
6143
  $xeTable.updateData()
6100
6144
  }
6101
- if (filterCols.length) {
6145
+
6146
+ if (!multiple) {
6147
+ column = filterCols[0]
6148
+ }
6149
+
6150
+ if (column) {
6151
+ const filterList = () => $xeTable.getCheckedFilters()
6152
+ const values: any[] = []
6153
+ const datas: any[] = []
6154
+ column.filters.forEach((item: any) => {
6155
+ if (item.checked) {
6156
+ values.push(item.value)
6157
+ datas.push(item.data)
6158
+ }
6159
+ })
6160
+ const params = {
6161
+ $table: $xeTable,
6162
+ $event: evnt as Event,
6163
+ column,
6164
+ field: column.field,
6165
+ property: column.field,
6166
+ values,
6167
+ datas,
6168
+ filters: filterList,
6169
+ filterList
6170
+ }
6171
+ $xeTable.dispatchEvent('filter-change', params, evnt)
6172
+ $xeTable.dispatchEvent('clear-filter', params, evnt)
6173
+ }
6174
+
6175
+ if (multiple && filterCols.length) {
6102
6176
  const params = { $table: $xeTable, $event: evnt, cols: filterCols, filterList: [] }
6103
6177
  dispatchEvent('clear-all-filter', params, evnt)
6104
- } else if (column) {
6105
- $xeTable.dispatchEvent('clear-filter', { filterList: () => $xeTable.getCheckedFilters() }, evnt)
6106
6178
  }
6179
+
6107
6180
  return nextTick()
6108
6181
  },
6109
6182
  /**
@@ -6361,6 +6434,32 @@ export default defineVxeComponent({
6361
6434
  }
6362
6435
  return nextTick()
6363
6436
  },
6437
+ setRowGroupExpandByField (groupFields, expanded) {
6438
+ const { isRowGroupStatus } = reactData
6439
+ const aggregateOpts = computeAggregateOpts.value
6440
+ const { childrenField } = aggregateOpts
6441
+ if (groupFields) {
6442
+ if (!XEUtils.isArray(groupFields)) {
6443
+ groupFields = [groupFields]
6444
+ }
6445
+ if (isRowGroupStatus) {
6446
+ const rows: any[] = []
6447
+ const gfKeys: Record<string, boolean> = {}
6448
+ groupFields.forEach(groupField => {
6449
+ gfKeys[groupField] = true
6450
+ })
6451
+ XEUtils.eachTree(internalData.afterGroupFullData, (row) => {
6452
+ if (row.isAggregate && gfKeys[row.groupField]) {
6453
+ rows.push(row)
6454
+ }
6455
+ }, { children: childrenField })
6456
+ if (rows.length) {
6457
+ return handleRowGroupVirtualExpand(rows, expanded)
6458
+ }
6459
+ }
6460
+ }
6461
+ return nextTick()
6462
+ },
6364
6463
  setAllRowGroupExpand (expanded) {
6365
6464
  const { tableFullGroupData } = internalData
6366
6465
  const aggregateOpts = computeAggregateOpts.value
@@ -6576,8 +6675,6 @@ export default defineVxeComponent({
6576
6675
  },
6577
6676
  /**
6578
6677
  * 如果有滚动条,则滚动到对应的位置
6579
- * @param {Number} scrollLeft 左距离
6580
- * @param {Number} scrollTop 上距离
6581
6678
  */
6582
6679
  scrollTo (scrollLeft, scrollTop) {
6583
6680
  const { elemStore } = internalData
@@ -6591,6 +6688,12 @@ export default defineVxeComponent({
6591
6688
 
6592
6689
  internalData.intoRunScroll = true
6593
6690
 
6691
+ if (scrollLeft) {
6692
+ if (!XEUtils.isNumber(scrollLeft)) {
6693
+ scrollTop = scrollLeft.top
6694
+ scrollLeft = scrollLeft.left
6695
+ }
6696
+ }
6594
6697
  if (XEUtils.isNumber(scrollLeft)) {
6595
6698
  setScrollLeft(xHandleEl, scrollLeft)
6596
6699
  setScrollLeft(bodyScrollElem, scrollLeft)
@@ -7998,7 +8101,7 @@ export default defineVxeComponent({
7998
8101
  evnt.preventDefault()
7999
8102
  const { column } = params
8000
8103
  const { columnStore, overflowX, scrollbarHeight } = reactData
8001
- const { elemStore, visibleColumn } = internalData
8104
+ const { visibleColumn } = internalData
8002
8105
  const { leftList, rightList } = columnStore
8003
8106
  const resizableOpts = computeResizableOpts.value
8004
8107
  const osbHeight = overflowX ? scrollbarHeight : 0
@@ -8016,25 +8119,30 @@ export default defineVxeComponent({
8016
8119
  const { clientX: dragClientX } = evnt
8017
8120
  const dragBtnElem = evnt.target as HTMLDivElement
8018
8121
  let resizeColumn = column
8019
- if (column.children && column.children.length) {
8122
+ const isDragGroupCol = column.children && column.children.length
8123
+ if (isDragGroupCol) {
8020
8124
  XEUtils.eachTree(column.children, childColumn => {
8021
8125
  resizeColumn = childColumn
8022
8126
  })
8023
8127
  }
8024
- const cell = dragBtnElem.parentNode as HTMLTableCellElement
8025
- const cellParams = Object.assign(params, { cell })
8026
- let dragLeft = 0
8027
- const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
8028
- if (!bodyScrollElem) {
8128
+ let cell = dragBtnElem.parentElement as HTMLTableCellElement | null
8129
+ if (isDragGroupCol) {
8130
+ const trEl = cell ? cell.parentElement as HTMLTableRowElement : null
8131
+ const theadEl = trEl ? trEl.parentElement as HTMLTableElement : null
8132
+ cell = theadEl ? theadEl.querySelector<HTMLTableCellElement>(`.vxe-header--column[colid="${resizeColumn.id}"]`) : null
8133
+ }
8134
+ if (!cell) {
8029
8135
  return
8030
8136
  }
8137
+ const cellParams = XEUtils.assign(params, { cell })
8138
+ let dragLeft = 0
8031
8139
  const tableRect = tableEl.getBoundingClientRect()
8032
8140
  const rightContainerRect = rightContainerElem ? rightContainerElem.getBoundingClientRect() : null
8033
8141
  const cellRect = cell.getBoundingClientRect()
8034
8142
  const dragBtnRect = dragBtnElem.getBoundingClientRect()
8035
8143
 
8036
8144
  const dragBtnWidth = dragBtnElem.clientWidth
8037
- const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2)
8145
+ const dragBtnOffsetWidth = XEUtils.floor(dragBtnWidth / 2)
8038
8146
  const dragPosLeft = dragBtnRect.x - tableRect.x + dragBtnOffsetWidth
8039
8147
 
8040
8148
  const minInterval = getColReMinWidth(cellParams) - dragBtnOffsetWidth // 列之间的最小间距
@@ -8387,6 +8495,26 @@ export default defineVxeComponent({
8387
8495
  handleRefreshColumnQueue () {
8388
8496
  reactData.reColumnFlag++
8389
8497
  },
8498
+ handleFilterOptions (column) {
8499
+ const { filterStore } = reactData
8500
+ const { filters, filterMultiple, filterRender } = column
8501
+ const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null
8502
+ const frMethod = column.filterRecoverMethod || (compConf ? (compConf.tableFilterRecoverMethod || compConf.filterRecoverMethod) : null)
8503
+ filterStore.multiple = filterMultiple
8504
+ filterStore.options = filters
8505
+ filterStore.column = column
8506
+ // 复原状态
8507
+ filterStore.options.forEach((option: any) => {
8508
+ const { _checked, checked } = option
8509
+ option._checked = checked
8510
+ if (!checked && _checked !== checked) {
8511
+ if (frMethod) {
8512
+ frMethod({ option, column, $table: $xeTable })
8513
+ }
8514
+ }
8515
+ })
8516
+ $xeTable.checkFilterOptions()
8517
+ },
8390
8518
  preventEvent (evnt, type, args, next, end) {
8391
8519
  let evntList = interceptor.get(type)
8392
8520
 
@@ -9337,8 +9465,8 @@ export default defineVxeComponent({
9337
9465
  $xeTable.handleHeaderCellDragMousedownEvent(evnt, params)
9338
9466
  }
9339
9467
  }
9340
- if (!triggerDrag && mouseConfig && mouseOpts.area && $xeTable.handleHeaderCellAreaEvent) {
9341
- $xeTable.handleHeaderCellAreaEvent(evnt, Object.assign({ cell, triggerSort, triggerFilter }, params))
9468
+ if (!triggerDrag && mouseConfig && mouseOpts.area && $xeTable.handleHeaderCellAreaModownEvent) {
9469
+ $xeTable.handleHeaderCellAreaModownEvent(evnt, Object.assign({ cell, triggerSort, triggerFilter }, params))
9342
9470
  }
9343
9471
  $xeTable.focus()
9344
9472
  if ($xeTable.closeMenu) {
@@ -11897,7 +12025,7 @@ export default defineVxeComponent({
11897
12025
  if (rowOpts.height && !props.showOverflow) {
11898
12026
  warnLog('vxe.error.notProp', ['table.show-overflow'])
11899
12027
  }
11900
- if (!$xeTable.triggerCellAreaMousednEvent) {
12028
+ if (!$xeTable.triggerCellAreaModownEvent) {
11901
12029
  if (props.areaConfig) {
11902
12030
  warnLog('vxe.error.notProp', ['area-config'])
11903
12031
  }
@@ -11935,7 +12063,10 @@ export default defineVxeComponent({
11935
12063
  warnLog('vxe.error.delProp', ['row-group-config.countFields', 'column.agg-func'])
11936
12064
  }
11937
12065
  if (aggregateOpts.aggregateMethod) {
11938
- warnLog('vxe.error.delProp', ['row-group-config.aggregateMethod', 'aggregate-config.countMethod'])
12066
+ warnLog('vxe.error.delProp', ['row-group-config.aggregateMethod', 'aggregate-config.calcValuesMethod'])
12067
+ }
12068
+ if (aggregateOpts.countMethod) {
12069
+ warnLog('vxe.error.delProp', ['aggregate-config.countMethod', 'aggregate-config.calcValuesMethod'])
11939
12070
  }
11940
12071
  if (props.treeConfig && treeOpts.children) {
11941
12072
  warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField'])
@@ -144,6 +144,7 @@ VxeUI.setConfig({
144
144
  // filterMethod: null,
145
145
  // destroyOnClose: false,
146
146
  // isEvery: false,
147
+ multiple: true,
147
148
  showIcon: true
148
149
  },
149
150
  aggregateConfig: {