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.
- package/dist/all.esm.js +79 -13
- package/dist/style.css +1 -1
- 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/hook.js +70 -10
- 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 +111 -32
- 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/hook.js +103 -29
- package/lib/table/module/export/hook.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/hook.ts +68 -10
- package/packages/table/src/cell.ts +6 -1
- /package/es/{iconfont.1779843543280.ttf → iconfont.1779936744129.ttf} +0 -0
- /package/es/{iconfont.1779843543280.woff → iconfont.1779936744129.woff} +0 -0
- /package/es/{iconfont.1779843543280.woff2 → iconfont.1779936744129.woff2} +0 -0
- /package/lib/{iconfont.1779843543280.ttf → iconfont.1779936744129.ttf} +0 -0
- /package/lib/{iconfont.1779843543280.woff → iconfont.1779936744129.woff} +0 -0
- /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 =
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
408
|
-
|
|
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 =
|
|
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 =
|
|
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'
|
|
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
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|