vxe-table 4.19.3 → 4.19.4

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 (112) hide show
  1. package/dist/all.esm.js +79 -13
  2. package/dist/style.css +1 -1
  3. package/es/locale/lang/ar-EG.js +2 -2
  4. package/es/locale/lang/de-DE.js +1 -1
  5. package/es/locale/lang/en-US.js +1 -1
  6. package/es/locale/lang/fr-FR.js +2 -2
  7. package/es/locale/lang/hu-HU.js +1 -1
  8. package/es/locale/lang/hy-AM.js +1 -1
  9. package/es/locale/lang/id-ID.js +2 -2
  10. package/es/locale/lang/it-IT.js +1 -1
  11. package/es/locale/lang/ko-KR.js +1 -1
  12. package/es/locale/lang/ms-MY.js +2 -2
  13. package/es/locale/lang/nb-NO.js +2 -2
  14. package/es/locale/lang/pt-BR.js +2 -2
  15. package/es/locale/lang/th-TH.js +1 -1
  16. package/es/locale/lang/ug-CN.js +1 -1
  17. package/es/locale/lang/uk-UA.js +1 -1
  18. package/es/locale/lang/uz-UZ.js +1 -1
  19. package/es/style.css +1 -1
  20. package/es/table/module/export/hook.js +70 -10
  21. package/es/table/src/cell.js +7 -1
  22. package/es/ui/index.js +1 -1
  23. package/es/ui/src/log.js +1 -1
  24. package/lib/index.umd.js +111 -32
  25. package/lib/index.umd.min.js +1 -1
  26. package/lib/locale/lang/ar-EG.js +2 -2
  27. package/lib/locale/lang/ar-EG.min.js +1 -1
  28. package/lib/locale/lang/ar-EG.umd.js +2 -2
  29. package/lib/locale/lang/de-DE.js +1 -1
  30. package/lib/locale/lang/de-DE.min.js +1 -1
  31. package/lib/locale/lang/de-DE.umd.js +1 -1
  32. package/lib/locale/lang/en-US.js +1 -1
  33. package/lib/locale/lang/en-US.min.js +1 -1
  34. package/lib/locale/lang/en-US.umd.js +1 -1
  35. package/lib/locale/lang/fr-FR.js +2 -2
  36. package/lib/locale/lang/fr-FR.min.js +1 -1
  37. package/lib/locale/lang/fr-FR.umd.js +2 -2
  38. package/lib/locale/lang/hu-HU.js +1 -1
  39. package/lib/locale/lang/hu-HU.min.js +1 -1
  40. package/lib/locale/lang/hu-HU.umd.js +1 -1
  41. package/lib/locale/lang/hy-AM.js +1 -1
  42. package/lib/locale/lang/hy-AM.min.js +1 -1
  43. package/lib/locale/lang/hy-AM.umd.js +1 -1
  44. package/lib/locale/lang/id-ID.js +2 -2
  45. package/lib/locale/lang/id-ID.min.js +1 -1
  46. package/lib/locale/lang/id-ID.umd.js +2 -2
  47. package/lib/locale/lang/it-IT.js +1 -1
  48. package/lib/locale/lang/it-IT.min.js +1 -1
  49. package/lib/locale/lang/it-IT.umd.js +1 -1
  50. package/lib/locale/lang/ko-KR.js +1 -1
  51. package/lib/locale/lang/ko-KR.min.js +1 -1
  52. package/lib/locale/lang/ko-KR.umd.js +1 -1
  53. package/lib/locale/lang/ms-MY.js +2 -2
  54. package/lib/locale/lang/ms-MY.min.js +1 -1
  55. package/lib/locale/lang/ms-MY.umd.js +2 -2
  56. package/lib/locale/lang/nb-NO.js +2 -2
  57. package/lib/locale/lang/nb-NO.min.js +1 -1
  58. package/lib/locale/lang/nb-NO.umd.js +2 -2
  59. package/lib/locale/lang/pt-BR.js +2 -2
  60. package/lib/locale/lang/pt-BR.min.js +1 -1
  61. package/lib/locale/lang/pt-BR.umd.js +2 -2
  62. package/lib/locale/lang/th-TH.js +1 -1
  63. package/lib/locale/lang/th-TH.min.js +1 -1
  64. package/lib/locale/lang/th-TH.umd.js +1 -1
  65. package/lib/locale/lang/ug-CN.js +1 -1
  66. package/lib/locale/lang/ug-CN.min.js +1 -1
  67. package/lib/locale/lang/ug-CN.umd.js +1 -1
  68. package/lib/locale/lang/uk-UA.js +1 -1
  69. package/lib/locale/lang/uk-UA.min.js +1 -1
  70. package/lib/locale/lang/uk-UA.umd.js +1 -1
  71. package/lib/locale/lang/uz-UZ.js +1 -1
  72. package/lib/locale/lang/uz-UZ.min.js +1 -1
  73. package/lib/locale/lang/uz-UZ.umd.js +1 -1
  74. package/lib/style.css +1 -1
  75. package/lib/table/module/export/hook.js +103 -29
  76. package/lib/table/module/export/hook.min.js +1 -1
  77. package/lib/table/src/cell.js +6 -1
  78. package/lib/table/src/cell.min.js +1 -1
  79. package/lib/ui/index.js +1 -1
  80. package/lib/ui/index.min.js +1 -1
  81. package/lib/ui/src/log.js +1 -1
  82. package/lib/ui/src/log.min.js +1 -1
  83. package/package.json +1 -1
  84. package/packages/locale/lang/ar-EG.ts +850 -850
  85. package/packages/locale/lang/de-DE.ts +850 -850
  86. package/packages/locale/lang/en-US.ts +850 -850
  87. package/packages/locale/lang/es-ES.ts +850 -850
  88. package/packages/locale/lang/fr-FR.ts +850 -850
  89. package/packages/locale/lang/hu-HU.ts +850 -850
  90. package/packages/locale/lang/hy-AM.ts +850 -850
  91. package/packages/locale/lang/id-ID.ts +850 -850
  92. package/packages/locale/lang/it-IT.ts +850 -850
  93. package/packages/locale/lang/ja-JP.ts +850 -850
  94. package/packages/locale/lang/ko-KR.ts +850 -850
  95. package/packages/locale/lang/ms-MY.ts +850 -850
  96. package/packages/locale/lang/nb-NO.ts +850 -850
  97. package/packages/locale/lang/pt-BR.ts +850 -850
  98. package/packages/locale/lang/ru-RU.ts +850 -850
  99. package/packages/locale/lang/th-TH.ts +850 -850
  100. package/packages/locale/lang/ug-CN.ts +850 -850
  101. package/packages/locale/lang/uk-UA.ts +850 -850
  102. package/packages/locale/lang/uz-UZ.ts +850 -850
  103. package/packages/locale/lang/vi-VN.ts +850 -850
  104. package/packages/locale/lang/zh-CHT.ts +850 -850
  105. package/packages/table/module/export/hook.ts +68 -10
  106. package/packages/table/src/cell.ts +6 -1
  107. /package/es/{iconfont.1779843543280.ttf → iconfont.1779936744129.ttf} +0 -0
  108. /package/es/{iconfont.1779843543280.woff → iconfont.1779936744129.woff} +0 -0
  109. /package/es/{iconfont.1779843543280.woff2 → iconfont.1779936744129.woff2} +0 -0
  110. /package/lib/{iconfont.1779843543280.ttf → iconfont.1779936744129.ttf} +0 -0
  111. /package/lib/{iconfont.1779843543280.woff → iconfont.1779936744129.woff} +0 -0
  112. /package/lib/{iconfont.1779843543280.woff2 → iconfont.1779936744129.woff2} +0 -0
@@ -338,9 +338,10 @@ hooks.add('tableExportModule', {
338
338
  }
339
339
 
340
340
  const getBodyLabelData = (opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) => {
341
- const { isTreeAllExpanded, isRowGroupAllExpanded, mode } = opts
341
+ const { isTreeAllExpanded, isRowGroupAllExpanded, mode: expMode } = opts
342
342
  const { treeConfig } = props
343
343
  const { isRowGroupStatus } = reactData
344
+ const { fullColumnFieldData } = internalData
344
345
  const radioOpts = computeRadioOpts.value
345
346
  const checkboxOpts = computeCheckboxOpts.value
346
347
  const treeOpts = computeTreeOpts.value
@@ -352,7 +353,7 @@ hooks.add('tableExportModule', {
352
353
  const { handleGetRowId } = createHandleGetRowId($xeTable)
353
354
  if (isRowGroupStatus) {
354
355
  // 如果是数据分组
355
- const { mapChildrenField } = aggregateOpts
356
+ const { mode: aggMode, showTotal, totalMethod, countFields, contentMethod, formatValuesMethod, mapChildrenField } = aggregateOpts
356
357
  const rest: any[] = []
357
358
  const expandMaps: Record<string, boolean> = {}
358
359
  const useMaps: Record<string, boolean> = {}
@@ -373,8 +374,9 @@ hooks.add('tableExportModule', {
373
374
  _expand: hasRowChild && $xeTable.isRowExpandByRow(row)
374
375
  }
375
376
  columns.forEach((column, $columnIndex) => {
377
+ const { field, editRender, cellRender, aggFunc, rowGroupNode } = column
376
378
  let cellValue: string | number | boolean | null = ''
377
- const renderOpts = column.editRender || column.cellRender
379
+ const renderOpts = editRender || cellRender
378
380
  let bodyExportMethod: VxeColumnPropTypes.ExportMethod | undefined = column.exportMethod || columnOpts.exportMethod
379
381
  if (!bodyExportMethod && renderOpts && renderOpts.name) {
380
382
  const compConf = renderer.get(renderOpts.name)
@@ -391,21 +393,75 @@ hooks.add('tableExportModule', {
391
393
  switch (column.type) {
392
394
  case 'seq': {
393
395
  const seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('')
394
- cellValue = mode === 'all' ? seqVal : getSeq(seqVal, row, $rowIndex, column, $columnIndex)
396
+ cellValue = expMode === 'all' ? seqVal : getSeq(seqVal, row, $rowIndex, column, $columnIndex)
395
397
  break
396
398
  }
397
- case 'checkbox':
399
+ case 'checkbox': {
398
400
  cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row))
399
401
  item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : ''
400
402
  item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row })
401
403
  break
402
- case 'radio':
404
+ }
405
+ case 'radio': {
403
406
  cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row))
404
407
  item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : ''
405
408
  item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row })
406
409
  break
407
- default:
408
- if (opts.original) {
410
+ }
411
+ default: {
412
+ if (field && row.isAggregate) {
413
+ const aggRow: VxeTableDefines.AggregateRowInfo = row
414
+ const aggData = aggRow.aggData
415
+ const currAggData = aggData ? aggData[field] : null
416
+ const groupField = aggRow.groupField
417
+ const groupContent = aggRow.groupContent
418
+ const childList = mapChildrenField ? (aggRow[mapChildrenField] || []) : []
419
+ const childCount = aggRow.childCount
420
+ const colRest = fullColumnFieldData[groupField] || {}
421
+ const ctParams = {
422
+ $table: $xeTable,
423
+ groupField,
424
+ groupColumn: (colRest ? colRest.column : null) as VxeTableDefines.ColumnInfo,
425
+ column,
426
+ groupValue: groupContent,
427
+ childList,
428
+ childCount,
429
+ aggValue: null as any,
430
+
431
+ /**
432
+ * 已废弃
433
+ * @deprecated
434
+ */
435
+ children: childList,
436
+ /**
437
+ * 已废弃
438
+ * @deprecated
439
+ */
440
+ totalValue: childCount
441
+ }
442
+ if (aggMode === 'column' ? field === aggRow.groupField : rowGroupNode) {
443
+ cellValue = groupContent
444
+ if (contentMethod) {
445
+ cellValue = `${contentMethod(ctParams)}`
446
+ }
447
+ if (showTotal) {
448
+ cellValue = getI18n('vxe.table.rowGroupContentTotal', [cellValue, totalMethod ? totalMethod(ctParams) : childCount, childCount])
449
+ }
450
+ } else if ($xeTable.getPivotTableAggregateCellAggValue) {
451
+ const aggParams = {
452
+ $table: $xeTable,
453
+ row,
454
+ column
455
+ }
456
+ cellValue = $xeTable.getPivotTableAggregateCellAggValue(aggParams)
457
+ } else if (aggFunc === true || (countFields && countFields.includes(field))) {
458
+ cellValue = currAggData ? currAggData.value : childCount
459
+ ctParams.aggValue = cellValue
460
+ if (formatValuesMethod) {
461
+ cellValue = formatValuesMethod(ctParams)
462
+ }
463
+ }
464
+ } else if (opts.original) {
409
465
  cellValue = getCellValue(row, column)
410
466
  } else {
411
467
  cellValue = $xeTable.getCellLabel(row, column)
@@ -419,6 +475,8 @@ hooks.add('tableExportModule', {
419
475
  }
420
476
  }
421
477
  }
478
+ break
479
+ }
422
480
  }
423
481
  }
424
482
  item[column.id] = toStringValue(cellValue)
@@ -473,7 +531,7 @@ hooks.add('tableExportModule', {
473
531
  switch (column.type) {
474
532
  case 'seq': {
475
533
  const seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('')
476
- cellValue = mode === 'all' ? seqVal : getSeq(seqVal, row, $rowIndex, column, $columnIndex)
534
+ cellValue = expMode === 'all' ? seqVal : getSeq(seqVal, row, $rowIndex, column, $columnIndex)
477
535
  break
478
536
  }
479
537
  case 'checkbox':
@@ -534,7 +592,7 @@ hooks.add('tableExportModule', {
534
592
  switch (column.type) {
535
593
  case 'seq': {
536
594
  const seqValue = $rowIndex + 1
537
- cellValue = mode === 'all' ? seqValue : getSeq(seqValue, row, $rowIndex, column, $columnIndex)
595
+ cellValue = expMode === 'all' ? seqValue : getSeq(seqValue, row, $rowIndex, column, $columnIndex)
538
596
  break
539
597
  }
540
598
  case 'checkbox':
@@ -631,7 +631,12 @@ export const Cell = {
631
631
  const { computeAggregateOpts } = $table.getComputeMaps()
632
632
  const aggregateOpts = computeAggregateOpts.value
633
633
  const { mode } = aggregateOpts
634
- if (mode === 'column' ? column.field === row.groupField : rowGroupNode) {
634
+ if (mode === 'column') {
635
+ if (row.groupField && column.field === row.groupField) {
636
+ return [Cell.renderRowGroupBtn(params, cellVNodes)]
637
+ }
638
+ return cellVNodes
639
+ } else if (rowGroupNode) {
635
640
  return [Cell.renderRowGroupBtn(params, cellVNodes)]
636
641
  }
637
642
  }