vxe-table 3.21.3 → 3.21.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 (110) hide show
  1. package/es/locale/lang/ar-EG.js +2 -2
  2. package/es/locale/lang/de-DE.js +1 -1
  3. package/es/locale/lang/en-US.js +1 -1
  4. package/es/locale/lang/fr-FR.js +2 -2
  5. package/es/locale/lang/hu-HU.js +1 -1
  6. package/es/locale/lang/hy-AM.js +1 -1
  7. package/es/locale/lang/id-ID.js +2 -2
  8. package/es/locale/lang/it-IT.js +1 -1
  9. package/es/locale/lang/ko-KR.js +1 -1
  10. package/es/locale/lang/ms-MY.js +2 -2
  11. package/es/locale/lang/nb-NO.js +2 -2
  12. package/es/locale/lang/pt-BR.js +2 -2
  13. package/es/locale/lang/th-TH.js +1 -1
  14. package/es/locale/lang/ug-CN.js +1 -1
  15. package/es/locale/lang/uk-UA.js +1 -1
  16. package/es/locale/lang/uz-UZ.js +1 -1
  17. package/es/style.css +1 -1
  18. package/es/table/module/export/mixin.js +71 -11
  19. package/es/table/src/cell.js +7 -1
  20. package/es/ui/index.js +1 -1
  21. package/es/ui/src/log.js +1 -1
  22. package/lib/index.umd.js +112 -33
  23. package/lib/index.umd.min.js +1 -1
  24. package/lib/locale/lang/ar-EG.js +2 -2
  25. package/lib/locale/lang/ar-EG.min.js +1 -1
  26. package/lib/locale/lang/ar-EG.umd.js +2 -2
  27. package/lib/locale/lang/de-DE.js +1 -1
  28. package/lib/locale/lang/de-DE.min.js +1 -1
  29. package/lib/locale/lang/de-DE.umd.js +1 -1
  30. package/lib/locale/lang/en-US.js +1 -1
  31. package/lib/locale/lang/en-US.min.js +1 -1
  32. package/lib/locale/lang/en-US.umd.js +1 -1
  33. package/lib/locale/lang/fr-FR.js +2 -2
  34. package/lib/locale/lang/fr-FR.min.js +1 -1
  35. package/lib/locale/lang/fr-FR.umd.js +2 -2
  36. package/lib/locale/lang/hu-HU.js +1 -1
  37. package/lib/locale/lang/hu-HU.min.js +1 -1
  38. package/lib/locale/lang/hu-HU.umd.js +1 -1
  39. package/lib/locale/lang/hy-AM.js +1 -1
  40. package/lib/locale/lang/hy-AM.min.js +1 -1
  41. package/lib/locale/lang/hy-AM.umd.js +1 -1
  42. package/lib/locale/lang/id-ID.js +2 -2
  43. package/lib/locale/lang/id-ID.min.js +1 -1
  44. package/lib/locale/lang/id-ID.umd.js +2 -2
  45. package/lib/locale/lang/it-IT.js +1 -1
  46. package/lib/locale/lang/it-IT.min.js +1 -1
  47. package/lib/locale/lang/it-IT.umd.js +1 -1
  48. package/lib/locale/lang/ko-KR.js +1 -1
  49. package/lib/locale/lang/ko-KR.min.js +1 -1
  50. package/lib/locale/lang/ko-KR.umd.js +1 -1
  51. package/lib/locale/lang/ms-MY.js +2 -2
  52. package/lib/locale/lang/ms-MY.min.js +1 -1
  53. package/lib/locale/lang/ms-MY.umd.js +2 -2
  54. package/lib/locale/lang/nb-NO.js +2 -2
  55. package/lib/locale/lang/nb-NO.min.js +1 -1
  56. package/lib/locale/lang/nb-NO.umd.js +2 -2
  57. package/lib/locale/lang/pt-BR.js +2 -2
  58. package/lib/locale/lang/pt-BR.min.js +1 -1
  59. package/lib/locale/lang/pt-BR.umd.js +2 -2
  60. package/lib/locale/lang/th-TH.js +1 -1
  61. package/lib/locale/lang/th-TH.min.js +1 -1
  62. package/lib/locale/lang/th-TH.umd.js +1 -1
  63. package/lib/locale/lang/ug-CN.js +1 -1
  64. package/lib/locale/lang/ug-CN.min.js +1 -1
  65. package/lib/locale/lang/ug-CN.umd.js +1 -1
  66. package/lib/locale/lang/uk-UA.js +1 -1
  67. package/lib/locale/lang/uk-UA.min.js +1 -1
  68. package/lib/locale/lang/uk-UA.umd.js +1 -1
  69. package/lib/locale/lang/uz-UZ.js +1 -1
  70. package/lib/locale/lang/uz-UZ.min.js +1 -1
  71. package/lib/locale/lang/uz-UZ.umd.js +1 -1
  72. package/lib/style.css +1 -1
  73. package/lib/table/module/export/mixin.js +104 -30
  74. package/lib/table/module/export/mixin.min.js +1 -1
  75. package/lib/table/src/cell.js +6 -1
  76. package/lib/table/src/cell.min.js +1 -1
  77. package/lib/ui/index.js +1 -1
  78. package/lib/ui/index.min.js +1 -1
  79. package/lib/ui/src/log.js +1 -1
  80. package/lib/ui/src/log.min.js +1 -1
  81. package/package.json +1 -1
  82. package/packages/locale/lang/ar-EG.ts +850 -850
  83. package/packages/locale/lang/de-DE.ts +850 -850
  84. package/packages/locale/lang/en-US.ts +850 -850
  85. package/packages/locale/lang/es-ES.ts +850 -850
  86. package/packages/locale/lang/fr-FR.ts +850 -850
  87. package/packages/locale/lang/hu-HU.ts +850 -850
  88. package/packages/locale/lang/hy-AM.ts +850 -850
  89. package/packages/locale/lang/id-ID.ts +850 -850
  90. package/packages/locale/lang/it-IT.ts +850 -850
  91. package/packages/locale/lang/ja-JP.ts +850 -850
  92. package/packages/locale/lang/ko-KR.ts +850 -850
  93. package/packages/locale/lang/ms-MY.ts +850 -850
  94. package/packages/locale/lang/nb-NO.ts +850 -850
  95. package/packages/locale/lang/pt-BR.ts +850 -850
  96. package/packages/locale/lang/ru-RU.ts +850 -850
  97. package/packages/locale/lang/th-TH.ts +850 -850
  98. package/packages/locale/lang/ug-CN.ts +850 -850
  99. package/packages/locale/lang/uk-UA.ts +850 -850
  100. package/packages/locale/lang/uz-UZ.ts +850 -850
  101. package/packages/locale/lang/vi-VN.ts +850 -850
  102. package/packages/locale/lang/zh-CHT.ts +850 -850
  103. package/packages/table/module/export/mixin.ts +70 -12
  104. package/packages/table/src/cell.ts +6 -1
  105. /package/es/{iconfont.1779843521280.ttf → iconfont.1779936730544.ttf} +0 -0
  106. /package/es/{iconfont.1779843521280.woff → iconfont.1779936730544.woff} +0 -0
  107. /package/es/{iconfont.1779843521280.woff2 → iconfont.1779936730544.woff2} +0 -0
  108. /package/lib/{iconfont.1779843521280.ttf → iconfont.1779936730544.ttf} +0 -0
  109. /package/lib/{iconfont.1779843521280.woff → iconfont.1779936730544.woff} +0 -0
  110. /package/lib/{iconfont.1779843521280.woff2 → iconfont.1779936730544.woff2} +0 -0
@@ -56,13 +56,15 @@ const toStringValue = (cellValue: any) => {
56
56
  return eqEmptyValue(cellValue) ? '' : `${cellValue}`
57
57
  }
58
58
 
59
- function getBodyLabelData ($xeTable: VxeTableConstructor, opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) {
59
+ function getBodyLabelData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) {
60
60
  const props = $xeTable
61
61
  const reactData = $xeTable as unknown as TableReactData
62
+ const internalData = $xeTable as unknown as TableInternalData
62
63
 
63
- const { isTreeAllExpanded, isRowGroupAllExpanded, mode } = opts
64
+ const { isTreeAllExpanded, isRowGroupAllExpanded, mode: expMode } = opts
64
65
  const { treeConfig } = props
65
66
  const { isRowGroupStatus } = reactData
67
+ const { fullColumnFieldData } = internalData
66
68
  const radioOpts = $xeTable.computeRadioOpts
67
69
  const checkboxOpts = $xeTable.computeCheckboxOpts
68
70
  const treeOpts = $xeTable.computeTreeOpts
@@ -74,8 +76,7 @@ function getBodyLabelData ($xeTable: VxeTableConstructor, opts: VxeTablePropType
74
76
  const { handleGetRowId } = createHandleGetRowId($xeTable)
75
77
  if (isRowGroupStatus) {
76
78
  // 如果是数据分组
77
- // 如果是数据分组
78
- const { mapChildrenField } = aggregateOpts
79
+ const { mode: aggMode, showTotal, totalMethod, countFields, contentMethod, formatValuesMethod, mapChildrenField } = aggregateOpts
79
80
  const rest: any[] = []
80
81
  const expandMaps: Record<string, boolean> = {}
81
82
  const useMaps: Record<string, boolean> = {}
@@ -96,8 +97,9 @@ function getBodyLabelData ($xeTable: VxeTableConstructor, opts: VxeTablePropType
96
97
  _expand: hasRowChild && $xeTable.isRowExpandByRow(row)
97
98
  }
98
99
  columns.forEach((column, $columnIndex) => {
100
+ const { field, editRender, cellRender, aggFunc, rowGroupNode } = column
99
101
  let cellValue: string | number | boolean | null = ''
100
- const renderOpts = column.editRender || column.cellRender
102
+ const renderOpts = editRender || cellRender
101
103
  let bodyExportMethod: VxeColumnPropTypes.ExportMethod | undefined = column.exportMethod || columnOpts.exportMethod
102
104
  if (!bodyExportMethod && renderOpts && renderOpts.name) {
103
105
  const compConf = renderer.get(renderOpts.name)
@@ -114,21 +116,75 @@ function getBodyLabelData ($xeTable: VxeTableConstructor, opts: VxeTablePropType
114
116
  switch (column.type) {
115
117
  case 'seq': {
116
118
  const seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('')
117
- cellValue = mode === 'all' ? seqVal : getSeq($xeTable, seqVal, row, $rowIndex, column, $columnIndex)
119
+ cellValue = expMode === 'all' ? seqVal : getSeq($xeTable, seqVal, row, $rowIndex, column, $columnIndex)
118
120
  break
119
121
  }
120
- case 'checkbox':
122
+ case 'checkbox': {
121
123
  cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row))
122
124
  item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : ''
123
125
  item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row })
124
126
  break
125
- case 'radio':
127
+ }
128
+ case 'radio': {
126
129
  cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row))
127
130
  item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : ''
128
131
  item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row })
129
132
  break
130
- default:
131
- if (opts.original) {
133
+ }
134
+ default: {
135
+ if (field && row.isAggregate) {
136
+ const aggRow: VxeTableDefines.AggregateRowInfo = row
137
+ const aggData = aggRow.aggData
138
+ const currAggData = aggData ? aggData[field] : null
139
+ const groupField = aggRow.groupField
140
+ const groupContent = aggRow.groupContent
141
+ const childList = mapChildrenField ? (aggRow[mapChildrenField] || []) : []
142
+ const childCount = aggRow.childCount
143
+ const colRest = fullColumnFieldData[groupField] || {}
144
+ const ctParams = {
145
+ $table: $xeTable,
146
+ groupField,
147
+ groupColumn: (colRest ? colRest.column : null) as VxeTableDefines.ColumnInfo,
148
+ column,
149
+ groupValue: groupContent,
150
+ childList,
151
+ childCount,
152
+ aggValue: null as any,
153
+
154
+ /**
155
+ * 已废弃
156
+ * @deprecated
157
+ */
158
+ children: childList,
159
+ /**
160
+ * 已废弃
161
+ * @deprecated
162
+ */
163
+ totalValue: childCount
164
+ }
165
+ if (aggMode === 'column' ? field === aggRow.groupField : rowGroupNode) {
166
+ cellValue = groupContent
167
+ if (contentMethod) {
168
+ cellValue = `${contentMethod(ctParams)}`
169
+ }
170
+ if (showTotal) {
171
+ cellValue = getI18n('vxe.table.rowGroupContentTotal', [cellValue, totalMethod ? totalMethod(ctParams) : childCount, childCount])
172
+ }
173
+ } else if ($xeTable.getPivotTableAggregateCellAggValue) {
174
+ const aggParams = {
175
+ $table: $xeTable,
176
+ row,
177
+ column
178
+ }
179
+ cellValue = $xeTable.getPivotTableAggregateCellAggValue(aggParams)
180
+ } else if (aggFunc === true || (countFields && countFields.includes(field))) {
181
+ cellValue = currAggData ? currAggData.value : childCount
182
+ ctParams.aggValue = cellValue
183
+ if (formatValuesMethod) {
184
+ cellValue = formatValuesMethod(ctParams)
185
+ }
186
+ }
187
+ } else if (opts.original) {
132
188
  cellValue = getCellValue(row, column)
133
189
  } else {
134
190
  cellValue = $xeTable.getCellLabel(row, column)
@@ -142,6 +198,8 @@ function getBodyLabelData ($xeTable: VxeTableConstructor, opts: VxeTablePropType
142
198
  }
143
199
  }
144
200
  }
201
+ break
202
+ }
145
203
  }
146
204
  }
147
205
  item[column.id] = toStringValue(cellValue)
@@ -196,7 +254,7 @@ function getBodyLabelData ($xeTable: VxeTableConstructor, opts: VxeTablePropType
196
254
  switch (column.type) {
197
255
  case 'seq': {
198
256
  const seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('')
199
- cellValue = mode === 'all' ? seqVal : getSeq($xeTable, seqVal, row, $rowIndex, column, $columnIndex)
257
+ cellValue = expMode === 'all' ? seqVal : getSeq($xeTable, seqVal, row, $rowIndex, column, $columnIndex)
200
258
  break
201
259
  }
202
260
  case 'checkbox':
@@ -257,7 +315,7 @@ function getBodyLabelData ($xeTable: VxeTableConstructor, opts: VxeTablePropType
257
315
  switch (column.type) {
258
316
  case 'seq': {
259
317
  const seqValue = $rowIndex + 1
260
- cellValue = mode === 'all' ? seqValue : getSeq($xeTable, seqValue, row, $rowIndex, column, $columnIndex)
318
+ cellValue = expMode === 'all' ? seqValue : getSeq($xeTable, seqValue, row, $rowIndex, column, $columnIndex)
261
319
  break
262
320
  }
263
321
  case 'checkbox':
@@ -622,7 +622,12 @@ export const Cell = {
622
622
  if (rowGroupList.length) {
623
623
  const aggregateOpts = $table.computeAggregateOpts
624
624
  const { mode } = aggregateOpts
625
- if (mode === 'column' ? column.field === row.groupField : rowGroupNode) {
625
+ if (mode === 'column') {
626
+ if (row.groupField && column.field === row.groupField) {
627
+ return [Cell.renderRowGroupBtn(h, params, cellVNodes)]
628
+ }
629
+ return cellVNodes
630
+ } else if (rowGroupNode) {
626
631
  return [Cell.renderRowGroupBtn(h, params, cellVNodes)]
627
632
  }
628
633
  }