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.
- package/es/locale/lang/ar-EG.js +2 -2
- package/es/locale/lang/de-DE.js +1 -1
- package/es/locale/lang/en-US.js +1 -1
- package/es/locale/lang/fr-FR.js +2 -2
- package/es/locale/lang/hu-HU.js +1 -1
- package/es/locale/lang/hy-AM.js +1 -1
- package/es/locale/lang/id-ID.js +2 -2
- package/es/locale/lang/it-IT.js +1 -1
- package/es/locale/lang/ko-KR.js +1 -1
- package/es/locale/lang/ms-MY.js +2 -2
- package/es/locale/lang/nb-NO.js +2 -2
- package/es/locale/lang/pt-BR.js +2 -2
- package/es/locale/lang/th-TH.js +1 -1
- package/es/locale/lang/ug-CN.js +1 -1
- package/es/locale/lang/uk-UA.js +1 -1
- package/es/locale/lang/uz-UZ.js +1 -1
- package/es/style.css +1 -1
- package/es/table/module/export/mixin.js +71 -11
- package/es/table/src/cell.js +7 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +112 -33
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +2 -2
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +2 -2
- package/lib/locale/lang/de-DE.js +1 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +1 -1
- package/lib/locale/lang/en-US.js +1 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +1 -1
- package/lib/locale/lang/fr-FR.js +2 -2
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +2 -2
- package/lib/locale/lang/hu-HU.js +1 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +1 -1
- package/lib/locale/lang/hy-AM.js +1 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +1 -1
- package/lib/locale/lang/id-ID.js +2 -2
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +2 -2
- package/lib/locale/lang/it-IT.js +1 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +1 -1
- package/lib/locale/lang/ko-KR.js +1 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +1 -1
- package/lib/locale/lang/ms-MY.js +2 -2
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +2 -2
- package/lib/locale/lang/nb-NO.js +2 -2
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +2 -2
- package/lib/locale/lang/pt-BR.js +2 -2
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -2
- package/lib/locale/lang/th-TH.js +1 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +1 -1
- package/lib/locale/lang/ug-CN.js +1 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +1 -1
- package/lib/locale/lang/uk-UA.js +1 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +1 -1
- package/lib/locale/lang/uz-UZ.js +1 -1
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/export/mixin.js +104 -30
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/src/cell.js +6 -1
- package/lib/table/src/cell.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/locale/lang/ar-EG.ts +850 -850
- package/packages/locale/lang/de-DE.ts +850 -850
- package/packages/locale/lang/en-US.ts +850 -850
- package/packages/locale/lang/es-ES.ts +850 -850
- package/packages/locale/lang/fr-FR.ts +850 -850
- package/packages/locale/lang/hu-HU.ts +850 -850
- package/packages/locale/lang/hy-AM.ts +850 -850
- package/packages/locale/lang/id-ID.ts +850 -850
- package/packages/locale/lang/it-IT.ts +850 -850
- package/packages/locale/lang/ja-JP.ts +850 -850
- package/packages/locale/lang/ko-KR.ts +850 -850
- package/packages/locale/lang/ms-MY.ts +850 -850
- package/packages/locale/lang/nb-NO.ts +850 -850
- package/packages/locale/lang/pt-BR.ts +850 -850
- package/packages/locale/lang/ru-RU.ts +850 -850
- package/packages/locale/lang/th-TH.ts +850 -850
- package/packages/locale/lang/ug-CN.ts +850 -850
- package/packages/locale/lang/uk-UA.ts +850 -850
- package/packages/locale/lang/uz-UZ.ts +850 -850
- package/packages/locale/lang/vi-VN.ts +850 -850
- package/packages/locale/lang/zh-CHT.ts +850 -850
- package/packages/table/module/export/mixin.ts +70 -12
- package/packages/table/src/cell.ts +6 -1
- /package/es/{iconfont.1779843521280.ttf → iconfont.1779936730544.ttf} +0 -0
- /package/es/{iconfont.1779843521280.woff → iconfont.1779936730544.woff} +0 -0
- /package/es/{iconfont.1779843521280.woff2 → iconfont.1779936730544.woff2} +0 -0
- /package/lib/{iconfont.1779843521280.ttf → iconfont.1779936730544.ttf} +0 -0
- /package/lib/{iconfont.1779843521280.woff → iconfont.1779936730544.woff} +0 -0
- /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 =
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
131
|
-
|
|
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 =
|
|
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 =
|
|
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'
|
|
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
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|