vxe-table 4.11.0-beta.0 → 4.11.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 (72) hide show
  1. package/README.md +18 -13
  2. package/es/index.css +1 -1
  3. package/es/index.min.css +1 -1
  4. package/es/locale/lang/id-ID.js +695 -0
  5. package/es/style.css +1 -1
  6. package/es/style.min.css +1 -1
  7. package/es/table/module/edit/hook.js +1 -7
  8. package/es/table/module/export/export-panel.js +8 -0
  9. package/es/table/module/export/hook.js +30 -11
  10. package/es/table/render/index.js +10 -0
  11. package/es/table/src/body.js +4 -2
  12. package/es/table/src/cell.js +3 -0
  13. package/es/table/src/footer.js +4 -2
  14. package/es/table/src/header.js +6 -4
  15. package/es/table/src/table.js +46 -21
  16. package/es/table/style.css +1 -1
  17. package/es/table/style.min.css +1 -1
  18. package/es/ui/index.js +1 -1
  19. package/es/ui/src/log.js +1 -1
  20. package/es/vxe-table/style.css +1 -1
  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 +119 -47
  25. package/lib/index.umd.min.js +1 -1
  26. package/lib/locale/lang/id-ID.js +701 -0
  27. package/lib/locale/lang/id-ID.min.js +1 -0
  28. package/lib/style.css +1 -1
  29. package/lib/style.min.css +1 -1
  30. package/lib/table/module/edit/hook.js +1 -9
  31. package/lib/table/module/edit/hook.min.js +1 -1
  32. package/lib/table/module/export/export-panel.js +8 -0
  33. package/lib/table/module/export/hook.js +33 -10
  34. package/lib/table/module/export/hook.min.js +1 -1
  35. package/lib/table/render/index.js +10 -0
  36. package/lib/table/render/index.min.js +1 -1
  37. package/lib/table/src/body.js +4 -1
  38. package/lib/table/src/body.min.js +1 -1
  39. package/lib/table/src/cell.js +3 -0
  40. package/lib/table/src/cell.min.js +1 -1
  41. package/lib/table/src/footer.js +4 -1
  42. package/lib/table/src/footer.min.js +1 -1
  43. package/lib/table/src/header.js +6 -3
  44. package/lib/table/src/header.min.js +1 -1
  45. package/lib/table/src/table.js +48 -21
  46. package/lib/table/src/table.min.js +1 -1
  47. package/lib/table/style/style.css +1 -1
  48. package/lib/table/style/style.min.css +1 -1
  49. package/lib/ui/index.js +1 -1
  50. package/lib/ui/index.min.js +1 -1
  51. package/lib/ui/src/log.js +1 -1
  52. package/lib/ui/src/log.min.js +1 -1
  53. package/lib/vxe-table/style/style.css +1 -1
  54. package/lib/vxe-table/style/style.min.css +1 -1
  55. package/package.json +2 -2
  56. package/packages/locale/lang/id-ID.ts +695 -0
  57. package/packages/table/module/edit/hook.ts +1 -7
  58. package/packages/table/module/export/export-panel.ts +9 -0
  59. package/packages/table/module/export/hook.ts +37 -20
  60. package/packages/table/render/index.ts +10 -0
  61. package/packages/table/src/body.ts +5 -2
  62. package/packages/table/src/cell.ts +3 -0
  63. package/packages/table/src/footer.ts +5 -2
  64. package/packages/table/src/header.ts +7 -4
  65. package/packages/table/src/table.ts +50 -22
  66. package/styles/components/table.scss +1 -1
  67. /package/es/{iconfont.1739430864081.ttf → iconfont.1739790215610.ttf} +0 -0
  68. /package/es/{iconfont.1739430864081.woff → iconfont.1739790215610.woff} +0 -0
  69. /package/es/{iconfont.1739430864081.woff2 → iconfont.1739790215610.woff2} +0 -0
  70. /package/lib/{iconfont.1739430864081.ttf → iconfont.1739790215610.ttf} +0 -0
  71. /package/lib/{iconfont.1739430864081.woff → iconfont.1739790215610.woff} +0 -0
  72. /package/lib/{iconfont.1739430864081.woff2 → iconfont.1739790215610.woff2} +0 -0
@@ -289,12 +289,10 @@ hooks.add('tableEditModule', {
289
289
  }
290
290
 
291
291
  const handleClearEdit = (evnt: Event | null, targetRow?: any) => {
292
- const { mouseConfig } = props
293
292
  const { editStore } = reactData
294
293
  const { actived, focused } = editStore
295
294
  const { row, column } = actived
296
295
  const validOpts = computeValidOpts.value
297
- const mouseOpts = computeMouseOpts.value
298
296
  if (row || column) {
299
297
  if (targetRow && getRowid($xeTable, targetRow) !== getRowid($xeTable, row)) {
300
298
  return nextTick()
@@ -322,11 +320,7 @@ hooks.add('tableEditModule', {
322
320
  }
323
321
  }
324
322
  }
325
- return nextTick().then(() => {
326
- if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
327
- return $xeTable.handleRecalculateCellAreas()
328
- }
329
- })
323
+ return nextTick().then(() => $xeTable.updateCellAreas())
330
324
  }
331
325
 
332
326
  const handleEditActive = (params: any, evnt: Event | null, isFocus: boolean) => {
@@ -50,6 +50,11 @@ export default defineComponent({
50
50
  return !defaultOptions.original && defaultOptions.mode === 'current' && (storeData.isPrint || ['html', 'xlsx'].indexOf(defaultOptions.type) > -1)
51
51
  })
52
52
 
53
+ // const computeSupportGroup = computed(() => {
54
+ // const { defaultOptions } = props
55
+ // return ['html', 'xlsx', 'csv', 'txt'].indexOf(defaultOptions.type) > -1
56
+ // })
57
+
53
58
  const computeSupportStyle = computed(() => {
54
59
  const { defaultOptions } = props
55
60
  return !defaultOptions.original && ['xlsx'].indexOf(defaultOptions.type) > -1
@@ -166,6 +171,7 @@ export default defineComponent({
166
171
  const showSheet = computeShowSheet.value
167
172
  const supportMerge = computeSupportMerge.value
168
173
  const supportStyle = computeSupportStyle.value
174
+ // const supportGroup = computeSupportGroup.value
169
175
  const slots = defaultOptions.slots || {}
170
176
  const topSlot = slots.top
171
177
  const bottomSlot = slots.bottom
@@ -415,6 +421,9 @@ export default defineComponent({
415
421
  }, [
416
422
  VxeUICheckboxComponent
417
423
  ? h(VxeUICheckboxComponent, {
424
+ // modelValue: supportGroup || (isHeader && hasColgroup && supportMerge) ? defaultOptions.isColgroup : false,
425
+ // title: getI18n('vxe.export.expColgroupTitle'),
426
+ // disabled: !supportGroup && (!isHeader || !hasColgroup || !supportMerge),
418
427
  modelValue: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
419
428
  title: getI18n('vxe.export.expColgroupTitle'),
420
429
  disabled: !isHeader || !hasColgroup || !supportMerge,
@@ -92,9 +92,9 @@ function getBooleanValue (cellValue: any) {
92
92
  return cellValue === 'TRUE' || cellValue === 'true' || cellValue === true
93
93
  }
94
94
 
95
- function getFooterData (opts: any, footerTableData: any) {
95
+ function getFooterData (opts: VxeTablePropTypes.ExportHandleOptions, footerTableData: any[]) {
96
96
  const { footerFilterMethod } = opts
97
- return footerFilterMethod ? footerTableData.filter((items: any, index: any) => footerFilterMethod({ items, $rowIndex: index })) : footerTableData
97
+ return footerFilterMethod ? footerTableData.filter((items, index) => footerFilterMethod({ items, $rowIndex: index })) : footerTableData
98
98
  }
99
99
 
100
100
  function getCsvCellTypeLabel (column: any, cellValue: any) {
@@ -511,7 +511,7 @@ hooks.add('tableExportModule', {
511
511
  return XEUtils.get(row, column.field)
512
512
  }
513
513
 
514
- const toCsv = (opts: any, columns: any[], datas: any[]) => {
514
+ const toCsv = (opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) => {
515
515
  let content = csvBOM
516
516
  if (opts.isHeader) {
517
517
  content += columns.map((column) => toTxtCellLabel(getHeaderTitle(opts, column))).join(',') + enterSymbol
@@ -522,14 +522,14 @@ hooks.add('tableExportModule', {
522
522
  if (opts.isFooter) {
523
523
  const { footerTableData } = reactData
524
524
  const footers = getFooterData(opts, footerTableData)
525
- footers.forEach((row: any) => {
525
+ footers.forEach((row) => {
526
526
  content += columns.map((column: any) => toTxtCellLabel(getFooterCellValue(opts, row, column))).join(',') + enterSymbol
527
527
  })
528
528
  }
529
529
  return content
530
530
  }
531
531
 
532
- const toTxt = (opts: any, columns: any[], datas: any[]) => {
532
+ const toTxt = (opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) => {
533
533
  let content = ''
534
534
  if (opts.isHeader) {
535
535
  content += columns.map((column) => toTxtCellLabel(getHeaderTitle(opts, column))).join('\t') + enterSymbol
@@ -540,14 +540,14 @@ hooks.add('tableExportModule', {
540
540
  if (opts.isFooter) {
541
541
  const { footerTableData } = reactData
542
542
  const footers = getFooterData(opts, footerTableData)
543
- footers.forEach((row: any) => {
543
+ footers.forEach((row) => {
544
544
  content += columns.map((column: any) => toTxtCellLabel(getFooterCellValue(opts, row, column))).join('\t') + enterSymbol
545
545
  })
546
546
  }
547
547
  return content
548
548
  }
549
549
 
550
- const hasEllipsis = (column: any, property: string, allColumnOverflow: any) => {
550
+ const hasEllipsis = (column: VxeTableDefines.ColumnInfo, property: 'showOverflow' | 'showHeaderOverflow', allColumnOverflow: VxeTablePropTypes.ShowOverflow | undefined) => {
551
551
  const columnOverflow = column[property]
552
552
  const headOverflow = XEUtils.isUndefined(columnOverflow) || XEUtils.isNull(columnOverflow) ? allColumnOverflow : columnOverflow
553
553
  const showEllipsis = headOverflow === 'ellipsis'
@@ -562,7 +562,7 @@ hooks.add('tableExportModule', {
562
562
  return isEllipsis
563
563
  }
564
564
 
565
- const toHtml = (opts: any, columns: any, datas: any) => {
565
+ const toHtml = (opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) => {
566
566
  const { id, border, treeConfig, headerAlign: allHeaderAlign, align: allAlign, footerAlign: allFooterAlign, showOverflow: allColumnOverflow, showHeaderOverflow: allColumnHeaderOverflow } = props
567
567
  const { isAllSelected, isIndeterminate, mergeList } = reactData
568
568
  const treeOpts = computeTreeOpts.value
@@ -762,7 +762,7 @@ hooks.add('tableExportModule', {
762
762
  return `${xml}</Table></Worksheet></Workbook>`
763
763
  }
764
764
 
765
- const getContent = (opts: any, columns: any, datas: any) => {
765
+ const getContent = (opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) => {
766
766
  if (columns.length) {
767
767
  switch (opts.type) {
768
768
  case 'csv':
@@ -1138,24 +1138,28 @@ hooks.add('tableExportModule', {
1138
1138
  * @param {Object} options 参数
1139
1139
  */
1140
1140
  exportData (options) {
1141
- const { treeConfig } = props
1142
- const { isGroup, tableGroupColumn } = reactData
1141
+ const { treeConfig, showHeader, showFooter } = props
1142
+ const { mergeList, mergeFooterList, isGroup, tableGroupColumn } = reactData
1143
1143
  const { tableFullColumn, afterFullData } = internalData
1144
1144
  const exportOpts = computeExportOpts.value
1145
1145
  const treeOpts = computeTreeOpts.value
1146
+ const proxyOpts = $xeGrid ? $xeGrid.getComputeMaps().computeProxyOpts.value : {} as VxeGridPropTypes.ProxyOpts
1147
+ const hasMerge = !!(mergeList.length || mergeFooterList.length)
1146
1148
  const opts = Object.assign({
1149
+ message: true,
1150
+ isHeader: showHeader,
1151
+ isFooter: showFooter,
1152
+ isColgroup: isGroup,
1153
+ isMerge: hasMerge,
1154
+ useStyle: true,
1155
+ current: 'current',
1156
+ modes: ['current', 'selected'].concat(proxyOpts.ajax && proxyOpts.ajax.queryAll ? ['all'] : []),
1157
+ download: true,
1158
+ type: 'csv'
1147
1159
  // filename: '',
1148
1160
  // sheetName: '',
1149
1161
  // original: false,
1150
- // message: false,
1151
- isHeader: true,
1152
- isFooter: true,
1153
- isColgroup: true,
1154
- // isMerge: false,
1155
1162
  // isAllExpand: false,
1156
- download: true,
1157
- type: 'csv',
1158
- mode: 'current'
1159
1163
  // data: null,
1160
1164
  // remote: false,
1161
1165
  // dataFilterMethod: null,
@@ -1167,7 +1171,20 @@ hooks.add('tableExportModule', {
1167
1171
  }, exportOpts, options)
1168
1172
  const { filename, sheetName, type, mode, columns, original, columnFilterMethod, beforeExportMethod, includeFields, excludeFields } = opts
1169
1173
  let groups: any[] = []
1170
- const customCols = columns && columns.length ? columns : null
1174
+ const customCols = columns && columns.length
1175
+ ? columns
1176
+ : XEUtils.searchTree(tableGroupColumn, column => {
1177
+ const isColGroup = column.children && column.children.length
1178
+ let isChecked = false
1179
+ if (columns && columns.length) {
1180
+ isChecked = handleFilterColumns(opts, column, columns)
1181
+ } else if (excludeFields || includeFields) {
1182
+ isChecked = handleFilterFields(opts, column, includeFields, excludeFields)
1183
+ } else {
1184
+ isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column))
1185
+ }
1186
+ return isChecked
1187
+ }, { children: 'children', mapChildren: 'childNodes', original: true })
1171
1188
  const handleOptions: VxeTablePropTypes.ExportHandleOptions = Object.assign({ } as { data: any[], colgroups: any[], columns: any[] }, opts, { filename: '', sheetName: '' })
1172
1189
  // 如果设置源数据,则默认导出设置了字段的列
1173
1190
  if (!customCols && !columnFilterMethod) {
@@ -819,6 +819,11 @@ renderer.mixin({
819
819
  tableFilterDefaultMethod: handleFilterMethod,
820
820
  tableExportMethod: handleExportSelectMethod
821
821
  },
822
+ formatOption: {
823
+ renderTableDefault (renderOpts, params) {
824
+ return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params))
825
+ }
826
+ },
822
827
  VxeTreeSelect: {
823
828
  tableAutoFocus: 'input',
824
829
  renderTableEdit: defaultTableOrTreeSelectEditRender,
@@ -827,6 +832,11 @@ renderer.mixin({
827
832
  },
828
833
  tableExportMethod: handleExportTreeSelectMethod
829
834
  },
835
+ formatTree: {
836
+ renderTableDefault (renderOpts, params) {
837
+ return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params))
838
+ }
839
+ },
830
840
  VxeTableSelect: {
831
841
  tableAutoFocus: 'input',
832
842
  renderTableEdit: defaultTableOrTreeSelectEditRender,
@@ -635,7 +635,7 @@ export default defineComponent({
635
635
 
636
636
  const { fixedColumn, fixedType, tableColumn } = props
637
637
  const { spanMethod, footerSpanMethod, mouseConfig } = tableProps
638
- const { isGroup, tableData, isRowLoading, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData
638
+ const { isGroup, tableData, isRowLoading, isColLoading, overflowX, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData
639
639
  const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData
640
640
  const rowOpts = computeRowOpts.value
641
641
  const emptyOpts = computeEmptyOpts.value
@@ -655,8 +655,11 @@ export default defineComponent({
655
655
  }
656
656
  }
657
657
 
658
- if (fixedType) {
658
+ if (fixedType || !overflowX) {
659
659
  renderColumnList = visibleColumn
660
+ }
661
+
662
+ if (fixedType) {
660
663
  if (isOptimizeMode) {
661
664
  renderColumnList = fixedColumn || []
662
665
  }
@@ -806,6 +806,9 @@ export const Cell = {
806
806
  class: ['vxe-table--expanded', {
807
807
  'is--active': isActive
808
808
  }],
809
+ onMousedown (evnt) {
810
+ evnt.stopPropagation()
811
+ },
809
812
  onClick (evnt: MouseEvent) {
810
813
  $table.triggerRowExpandEvent(evnt, params)
811
814
  }
@@ -267,7 +267,7 @@ export default defineComponent({
267
267
  const { fixedType, fixedColumn, tableColumn } = props
268
268
  const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps
269
269
  const { visibleColumn, fullColumnIdData } = tableInternalData
270
- const { isGroup, scrollXLoad, scrollYLoad, dragCol } = tableReactData
270
+ const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
271
271
 
272
272
  let renderColumnList = tableColumn
273
273
  let isOptimizeMode = false
@@ -280,8 +280,11 @@ export default defineComponent({
280
280
  }
281
281
  }
282
282
 
283
- if (fixedType) {
283
+ if (fixedType || !overflowX) {
284
284
  renderColumnList = visibleColumn
285
+ }
286
+
287
+ if (fixedType) {
285
288
  if (isOptimizeMode) {
286
289
  renderColumnList = fixedColumn || []
287
290
  }
@@ -142,8 +142,8 @@ export default defineComponent({
142
142
  'is--sortable': column.sortable,
143
143
  'col--filter': !!filters,
144
144
  'is--filter-active': hasFilter,
145
- 'is--drag-active': !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
146
- 'is--drag-disabled': isDisabledDrag,
145
+ 'is--drag-active': columnOpts.drag && !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
146
+ 'is--drag-disabled': columnOpts.drag && isDisabledDrag,
147
147
  'col--current': currentColumn === column
148
148
  },
149
149
  headerClassName ? (XEUtils.isFunction(headerClassName) ? headerClassName(cellParams) : headerClassName) : '',
@@ -223,7 +223,7 @@ export default defineComponent({
223
223
  const renderVN = () => {
224
224
  const { fixedType, fixedColumn, tableColumn } = props
225
225
  const { mouseConfig, showHeaderOverflow: allColumnHeaderOverflow, spanMethod, footerSpanMethod } = tableProps
226
- const { isGroup, scrollXLoad, scrollYLoad, dragCol } = tableReactData
226
+ const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
227
227
  const { visibleColumn, fullColumnIdData } = tableInternalData
228
228
 
229
229
  const mouseOpts = computeMouseOpts.value
@@ -243,8 +243,11 @@ export default defineComponent({
243
243
  }
244
244
  }
245
245
 
246
- if (fixedType) {
246
+ if (fixedType || !overflowX) {
247
247
  renderColumnList = visibleColumn
248
+ }
249
+
250
+ if (fixedType) {
248
251
  // 如果是使用优化模式
249
252
  if (isOptimizeMode) {
250
253
  renderColumnList = fixedColumn || []
@@ -1247,6 +1247,7 @@ export default defineComponent({
1247
1247
  const fullColumnIdData: Record<string, VxeTableDefines.ColumnCacheItem> = internalData.fullColumnIdData = {}
1248
1248
  const fullColumnFieldData: Record<string, VxeTableDefines.ColumnCacheItem> = internalData.fullColumnFieldData = {}
1249
1249
  const mouseOpts = computeMouseOpts.value
1250
+ const expandOpts = computeExpandOpts.value
1250
1251
  const columnOpts = computeColumnOpts.value
1251
1252
  const columnDragOpts = computeColumnDragOpts.value
1252
1253
  const { isCrossDrag, isSelfToChildDrag } = columnDragOpts
@@ -1333,10 +1334,8 @@ export default defineComponent({
1333
1334
  tableFullColumn.forEach(handleFunc)
1334
1335
  }
1335
1336
 
1336
- if (process.env.VUE_APP_VXE_ENV === 'development') {
1337
- if (expandColumn && mouseOpts.area) {
1338
- errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand'])
1339
- }
1337
+ if ((expandColumn && expandOpts.mode !== 'fixed') && mouseOpts.area) {
1338
+ errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand'])
1340
1339
  }
1341
1340
 
1342
1341
  if (process.env.VUE_APP_VXE_ENV === 'development') {
@@ -2607,7 +2606,10 @@ export default defineComponent({
2607
2606
  delete rExpandLazyLoadedMaps[rowid]
2608
2607
  }
2609
2608
  reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps
2610
- nextTick().then(() => tableMethods.recalculate()).then(() => resolve())
2609
+ nextTick()
2610
+ .then(() => $xeTable.recalculate())
2611
+ .then(() => $xeTable.updateCellAreas())
2612
+ .then(() => resolve())
2611
2613
  })
2612
2614
  } else {
2613
2615
  resolve()
@@ -3089,6 +3091,7 @@ export default defineComponent({
3089
3091
  }
3090
3092
 
3091
3093
  const handleColumn = (collectColumn: VxeTableDefines.ColumnInfo[]) => {
3094
+ const expandOpts = computeExpandOpts.value
3092
3095
  internalData.collectColumn = collectColumn
3093
3096
  const tableFullColumn = getColumnList(collectColumn)
3094
3097
  internalData.tableFullColumn = tableFullColumn
@@ -3098,6 +3101,7 @@ export default defineComponent({
3098
3101
  return Promise.resolve(
3099
3102
  restoreCustomStorage()
3100
3103
  ).then(() => {
3104
+ const { scrollXLoad, scrollYLoad, expandColumn } = reactData
3101
3105
  cacheColumnMap()
3102
3106
  parseColumns(true).then(() => {
3103
3107
  if (reactData.scrollXLoad) {
@@ -3107,11 +3111,11 @@ export default defineComponent({
3107
3111
  $xeTable.clearMergeCells()
3108
3112
  $xeTable.clearMergeFooterItems()
3109
3113
  $xeTable.handleTableData(true)
3110
- if (process.env.VUE_APP_VXE_ENV === 'development') {
3111
- if ((reactData.scrollXLoad || reactData.scrollYLoad) && reactData.expandColumn) {
3112
- warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
3113
- }
3114
+
3115
+ if ((scrollXLoad || scrollYLoad) && (expandColumn && expandOpts.mode !== 'fixed')) {
3116
+ warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
3114
3117
  }
3118
+
3115
3119
  return nextTick().then(() => {
3116
3120
  if ($xeToolbar) {
3117
3121
  $xeToolbar.syncUpdate({
@@ -3495,6 +3499,15 @@ export default defineComponent({
3495
3499
  }
3496
3500
  }
3497
3501
 
3502
+ const handleRowExpandScroll = () => {
3503
+ const { elemStore } = internalData
3504
+ const rowExpandEl = refRowExpandElem.value
3505
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
3506
+ if (rowExpandEl && bodyScrollElem) {
3507
+ rowExpandEl.scrollTop = bodyScrollElem.scrollTop
3508
+ }
3509
+ }
3510
+
3498
3511
  tableMethods = {
3499
3512
  dispatchEvent,
3500
3513
  /**
@@ -5211,14 +5224,14 @@ export default defineComponent({
5211
5224
  * @param {Boolean} expanded 是否展开
5212
5225
  */
5213
5226
  setRowExpand (rows, expanded) {
5214
- const { rowExpandedMaps, rowExpandLazyLoadedMaps, expandColumn: column } = reactData
5227
+ const { rowExpandedMaps, rowExpandLazyLoadedMaps, expandColumn } = reactData
5215
5228
  const { fullAllDataRowIdData } = internalData
5216
5229
  let rExpandedMaps = { ...rowExpandedMaps }
5217
5230
  const expandOpts = computeExpandOpts.value
5218
5231
  const { reserve, lazy, accordion, toggleMethod } = expandOpts
5219
5232
  const lazyRests: any[] = []
5220
- const columnIndex = tableMethods.getColumnIndex(column)
5221
- const $columnIndex = tableMethods.getVMColumnIndex(column)
5233
+ const columnIndex = $xeTable.getColumnIndex(expandColumn)
5234
+ const $columnIndex = $xeTable.getVMColumnIndex(expandColumn)
5222
5235
  if (rows) {
5223
5236
  if (!XEUtils.isArray(rows)) {
5224
5237
  rows = [rows]
@@ -5228,7 +5241,7 @@ export default defineComponent({
5228
5241
  rExpandedMaps = {}
5229
5242
  rows = rows.slice(rows.length - 1, rows.length)
5230
5243
  }
5231
- const validRows: any[] = toggleMethod ? rows.filter((row: any) => toggleMethod({ $table: $xeTable, expanded, column, columnIndex, $columnIndex, row, rowIndex: tableMethods.getRowIndex(row), $rowIndex: tableMethods.getVMRowIndex(row) })) : rows
5244
+ const validRows: any[] = toggleMethod ? rows.filter((row: any) => toggleMethod({ $table: $xeTable, expanded, column: expandColumn, columnIndex, $columnIndex, row, rowIndex: tableMethods.getRowIndex(row), $rowIndex: tableMethods.getVMRowIndex(row) })) : rows
5232
5245
  if (expanded) {
5233
5246
  validRows.forEach((row: any) => {
5234
5247
  const rowid = getRowid($xeTable, row)
@@ -5251,11 +5264,19 @@ export default defineComponent({
5251
5264
  })
5252
5265
  }
5253
5266
  if (reserve) {
5254
- validRows.forEach((row: any) => handleRowExpandReserve(row, expanded))
5267
+ validRows.forEach((row) => handleRowExpandReserve(row, expanded))
5255
5268
  }
5256
5269
  }
5257
5270
  reactData.rowExpandedMaps = rExpandedMaps
5258
- return Promise.all(lazyRests).then(() => tableMethods.recalculate())
5271
+ return Promise.all(lazyRests)
5272
+ .then(() => $xeTable.recalculate())
5273
+ .then(() => {
5274
+ if (expandColumn) {
5275
+ updateRowExpandStyle()
5276
+ handleRowExpandScroll()
5277
+ }
5278
+ return $xeTable.updateCellAreas()
5279
+ })
5259
5280
  },
5260
5281
  /**
5261
5282
  * 判断行是否为展开状态
@@ -5289,7 +5310,7 @@ export default defineComponent({
5289
5310
  if (expList.length) {
5290
5311
  tableMethods.recalculate()
5291
5312
  }
5292
- })
5313
+ }).then(() => $xeTable.updateCellAreas())
5293
5314
  },
5294
5315
  clearRowExpandReserve () {
5295
5316
  internalData.rowExpandedReserveRowMap = {}
@@ -5712,8 +5733,8 @@ export default defineComponent({
5712
5733
  updateCellAreas () {
5713
5734
  const { mouseConfig } = props
5714
5735
  const mouseOpts = computeMouseOpts.value
5715
- if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreas) {
5716
- return $xeTable.handleRecalculateCellAreas()
5736
+ if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreaEvent) {
5737
+ return $xeTable.handleRecalculateCellAreaEvent()
5717
5738
  }
5718
5739
  return nextTick()
5719
5740
  },
@@ -7384,7 +7405,7 @@ export default defineComponent({
7384
7405
  vLen++
7385
7406
  })
7386
7407
 
7387
- const isSelected = vLen > 0 ? sLen >= vLen : sLen >= rootList.length
7408
+ const isSelected = rootList.length > 0 ? (vLen > 0 ? (sLen >= vLen) : (sLen >= rootList.length)) : false
7388
7409
  const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1)
7389
7410
 
7390
7411
  reactData.isAllSelected = isSelected
@@ -9046,7 +9067,7 @@ export default defineComponent({
9046
9067
  updateScrollYStatus,
9047
9068
  // 更新横向 X 可视渲染上下剩余空间大小
9048
9069
  updateScrollXSpace () {
9049
- const { isGroup, scrollXLoad } = reactData
9070
+ const { isGroup, scrollXLoad, overflowX } = reactData
9050
9071
  const { visibleColumn, scrollXStore, elemStore, tableWidth } = internalData
9051
9072
  const tableHeader = refTableHeader.value
9052
9073
  const tableBody = refTableBody.value
@@ -9060,7 +9081,7 @@ export default defineComponent({
9060
9081
  const footerElem = tableFooterElem ? tableFooterElem.querySelector('.vxe-table--footer') as HTMLTableElement : null
9061
9082
  const leftSpaceWidth = visibleColumn.slice(0, scrollXStore.startIndex).reduce((previous, column) => previous + column.renderWidth, 0)
9062
9083
  let marginLeft = ''
9063
- if (scrollXLoad) {
9084
+ if (scrollXLoad && overflowX) {
9064
9085
  marginLeft = `${leftSpaceWidth}px`
9065
9086
  }
9066
9087
  if (headerElem) {
@@ -9889,6 +9910,7 @@ export default defineComponent({
9889
9910
  }
9890
9911
  loadTableData(value, true).then(() => {
9891
9912
  const { scrollXLoad, scrollYLoad, expandColumn } = reactData
9913
+ const expandOpts = computeExpandOpts.value
9892
9914
  internalData.inited = true
9893
9915
  internalData.initStatus = true
9894
9916
  if (!initStatus) {
@@ -9899,7 +9921,7 @@ export default defineComponent({
9899
9921
  // if (checkboxColumn && internalData.tableFullData.length > 300 && !checkboxOpts.checkField) {
9900
9922
  // warnLog('vxe.error.checkProp', ['checkbox-config.checkField'])
9901
9923
  // }
9902
- if ((scrollXLoad || scrollYLoad) && expandColumn) {
9924
+ if ((scrollXLoad || scrollYLoad) && (expandColumn && expandOpts.mode !== 'fixed')) {
9903
9925
  warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
9904
9926
  }
9905
9927
  return tableMethods.recalculate()
@@ -9950,6 +9972,12 @@ export default defineComponent({
9950
9972
  watch(() => props.showFooter, () => {
9951
9973
  reScrollFlag.value++
9952
9974
  })
9975
+ watch(() => reactData.overflowX, () => {
9976
+ reScrollFlag.value++
9977
+ })
9978
+ watch(() => reactData.overflowY, () => {
9979
+ reScrollFlag.value++
9980
+ })
9953
9981
  watch(reScrollFlag, () => {
9954
9982
  nextTick(() => {
9955
9983
  tableMethods.recalculate(true).then(() => tableMethods.refreshScroll())
@@ -271,7 +271,7 @@
271
271
  display: none;
272
272
  position: absolute;
273
273
  pointer-events: none;
274
- z-index: 1;
274
+ z-index: 6;
275
275
  }
276
276
 
277
277
  .vxe-table--header-wrapper {