vxe-table 4.9.28 → 4.9.30
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +3 -0
- package/es/locale/lang/de-DE.js +3 -0
- package/es/locale/lang/en-US.js +3 -0
- package/es/locale/lang/es-ES.js +3 -0
- package/es/locale/lang/fr-FR.js +3 -0
- package/es/locale/lang/hu-HU.js +3 -0
- package/es/locale/lang/hy-AM.js +3 -0
- package/es/locale/lang/ja-JP.js +3 -0
- package/es/locale/lang/ko-KR.js +3 -0
- package/es/locale/lang/nb-NO.js +3 -0
- package/es/locale/lang/pt-BR.js +3 -0
- package/es/locale/lang/ru-RU.js +3 -0
- package/es/locale/lang/ug-CN.js +3 -0
- package/es/locale/lang/uk-UA.js +3 -0
- package/es/locale/lang/vi-VN.js +3 -0
- package/es/locale/lang/zh-CHT.js +3 -0
- package/es/locale/lang/zh-CN.js +3 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/export/hook.js +24 -11
- package/es/table/render/index.js +18 -7
- package/es/table/src/body.js +7 -4
- package/es/table/src/footer.js +5 -2
- package/es/table/src/header.js +4 -1
- package/es/table/style.css +73 -27
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +5 -3
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +73 -27
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +75 -31
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +3 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +3 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +3 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +3 -0
- package/lib/locale/lang/es-ES.js +3 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +3 -0
- package/lib/locale/lang/fr-FR.js +3 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +3 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +3 -0
- package/lib/locale/lang/hy-AM.js +3 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +3 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +3 -0
- package/lib/locale/lang/ko-KR.js +3 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +3 -0
- package/lib/locale/lang/nb-NO.js +3 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +3 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +3 -0
- package/lib/locale/lang/ru-RU.js +3 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +3 -0
- package/lib/locale/lang/ug-CN.js +3 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +3 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +3 -0
- package/lib/locale/lang/vi-VN.js +3 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +3 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CN.js +3 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +3 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/export/hook.js +27 -14
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/render/index.js +21 -7
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +8 -4
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +6 -2
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +4 -1
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/style/style.css +73 -27
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +5 -3
- 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/lib/vxe-table/style/style.css +73 -27
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +3 -0
- package/packages/locale/lang/de-DE.ts +3 -0
- package/packages/locale/lang/en-US.ts +3 -0
- package/packages/locale/lang/es-ES.ts +3 -0
- package/packages/locale/lang/fr-FR.ts +3 -0
- package/packages/locale/lang/hu-HU.ts +3 -0
- package/packages/locale/lang/hy-AM.ts +3 -0
- package/packages/locale/lang/ja-JP.ts +3 -0
- package/packages/locale/lang/ko-KR.ts +3 -0
- package/packages/locale/lang/nb-NO.ts +3 -0
- package/packages/locale/lang/pt-BR.ts +3 -0
- package/packages/locale/lang/ru-RU.ts +3 -0
- package/packages/locale/lang/ug-CN.ts +3 -0
- package/packages/locale/lang/uk-UA.ts +3 -0
- package/packages/locale/lang/vi-VN.ts +3 -0
- package/packages/locale/lang/zh-CHT.ts +3 -0
- package/packages/locale/lang/zh-CN.ts +3 -0
- package/packages/table/module/export/hook.ts +28 -15
- package/packages/table/render/index.ts +18 -6
- package/packages/table/src/body.ts +7 -4
- package/packages/table/src/footer.ts +6 -2
- package/packages/table/src/header.ts +5 -1
- package/packages/ui/index.ts +4 -2
- package/styles/components/table.scss +90 -19
- /package/es/{iconfont.1734331313492.ttf → iconfont.1734489196175.ttf} +0 -0
- /package/es/{iconfont.1734331313492.woff → iconfont.1734489196175.woff} +0 -0
- /package/es/{iconfont.1734331313492.woff2 → iconfont.1734489196175.woff2} +0 -0
- /package/lib/{iconfont.1734331313492.ttf → iconfont.1734489196175.ttf} +0 -0
- /package/lib/{iconfont.1734331313492.woff → iconfont.1734489196175.woff} +0 -0
- /package/lib/{iconfont.1734331313492.woff2 → iconfont.1734489196175.woff2} +0 -0
|
@@ -16,7 +16,7 @@ const csvBOM = '\ufeff'
|
|
|
16
16
|
const enterSymbol = '\r\n'
|
|
17
17
|
|
|
18
18
|
function defaultFilterExportColumn (column: any) {
|
|
19
|
-
return column.
|
|
19
|
+
return column.field || ['seq', 'checkbox', 'radio'].indexOf(column.type) > -1
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const getConvertColumns = (columns: any) => {
|
|
@@ -271,7 +271,7 @@ function clearColumnConvert (columns: any) {
|
|
|
271
271
|
function checkImportData (columns: any[], fields: string[]) {
|
|
272
272
|
const tableFields: string[] = []
|
|
273
273
|
columns.forEach((column) => {
|
|
274
|
-
const field = column.
|
|
274
|
+
const field = column.field
|
|
275
275
|
if (field) {
|
|
276
276
|
tableFields.push(field)
|
|
277
277
|
}
|
|
@@ -313,7 +313,7 @@ hooks.add('tableExportModule', {
|
|
|
313
313
|
function getHeaderTitle (opts: any, column: any) {
|
|
314
314
|
const columnOpts = computeColumnOpts.value
|
|
315
315
|
const headExportMethod = column.headerExportMethod || columnOpts.headerExportMethod
|
|
316
|
-
return headExportMethod ? headExportMethod({ column, options: opts, $table: $xeTable }) : ((opts.original ? column.
|
|
316
|
+
return headExportMethod ? headExportMethod({ column, options: opts, $table: $xeTable }) : ((opts.original ? column.field : column.getTitle()) || '')
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
const toBooleanValue = (cellValue: any) => {
|
|
@@ -414,7 +414,7 @@ hooks.add('tableExportModule', {
|
|
|
414
414
|
if (!bodyExportMethod && renderOpts && renderOpts.name) {
|
|
415
415
|
const compConf = renderer.get(renderOpts.name)
|
|
416
416
|
if (compConf) {
|
|
417
|
-
bodyExportMethod = compConf.exportMethod
|
|
417
|
+
bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
if (bodyExportMethod) {
|
|
@@ -995,13 +995,13 @@ hooks.add('tableExportModule', {
|
|
|
995
995
|
} else {
|
|
996
996
|
const colid = item.id || item.colId
|
|
997
997
|
const type = item.type
|
|
998
|
-
const field = item.
|
|
998
|
+
const field = item.field
|
|
999
999
|
if (colid) {
|
|
1000
1000
|
return column.id === colid
|
|
1001
1001
|
} else if (field && type) {
|
|
1002
|
-
return column.
|
|
1002
|
+
return column.field === field && column.type === type
|
|
1003
1003
|
} else if (field) {
|
|
1004
|
-
return column.
|
|
1004
|
+
return column.field === field
|
|
1005
1005
|
} else if (type) {
|
|
1006
1006
|
return column.type === type
|
|
1007
1007
|
}
|
|
@@ -1059,7 +1059,7 @@ hooks.add('tableExportModule', {
|
|
|
1059
1059
|
const { tableFullColumn, afterFullData } = internalData
|
|
1060
1060
|
const exportOpts = computeExportOpts.value
|
|
1061
1061
|
const treeOpts = computeTreeOpts.value
|
|
1062
|
-
const opts
|
|
1062
|
+
const opts = Object.assign({
|
|
1063
1063
|
// filename: '',
|
|
1064
1064
|
// sheetName: '',
|
|
1065
1065
|
// original: false,
|
|
@@ -1083,16 +1083,29 @@ hooks.add('tableExportModule', {
|
|
|
1083
1083
|
}, exportOpts, {
|
|
1084
1084
|
print: false
|
|
1085
1085
|
}, options)
|
|
1086
|
-
const { type, mode, columns, original, beforeExportMethod } = opts
|
|
1086
|
+
const { type, mode, columns, original, beforeExportMethod, includeFields, excludeFields } = opts
|
|
1087
1087
|
let groups: any[] = []
|
|
1088
1088
|
const customCols = columns && columns.length ? columns : null
|
|
1089
1089
|
let columnFilterMethod = opts.columnFilterMethod
|
|
1090
1090
|
// 如果设置源数据,则默认导出设置了字段的列
|
|
1091
1091
|
if (!customCols && !columnFilterMethod) {
|
|
1092
|
-
columnFilterMethod =
|
|
1092
|
+
columnFilterMethod = ({ column }) => {
|
|
1093
|
+
if (excludeFields) {
|
|
1094
|
+
if (XEUtils.includes(excludeFields, column.field)) {
|
|
1095
|
+
return false
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
if (includeFields) {
|
|
1099
|
+
if (XEUtils.includes(includeFields, column.field)) {
|
|
1100
|
+
return true
|
|
1101
|
+
}
|
|
1102
|
+
return false
|
|
1103
|
+
}
|
|
1104
|
+
return original ? column.field : defaultFilterExportColumn(column)
|
|
1105
|
+
}
|
|
1093
1106
|
}
|
|
1094
1107
|
if (customCols) {
|
|
1095
|
-
opts._isCustomColumn = true
|
|
1108
|
+
(opts as any)._isCustomColumn = true
|
|
1096
1109
|
groups = XEUtils.searchTree(
|
|
1097
1110
|
XEUtils.mapTree(customCols, (item: any) => {
|
|
1098
1111
|
let targetColumn
|
|
@@ -1104,11 +1117,11 @@ hooks.add('tableExportModule', {
|
|
|
1104
1117
|
} else {
|
|
1105
1118
|
const colid = item.id || item.colId
|
|
1106
1119
|
const type = item.type
|
|
1107
|
-
const field = item.
|
|
1120
|
+
const field = item.field
|
|
1108
1121
|
if (colid) {
|
|
1109
1122
|
targetColumn = $xeTable.getColumnById(colid)
|
|
1110
1123
|
} else if (field && type) {
|
|
1111
|
-
targetColumn = tableFullColumn.find((column: any) => column.
|
|
1124
|
+
targetColumn = tableFullColumn.find((column: any) => column.field === field && column.type === type)
|
|
1112
1125
|
} else if (field) {
|
|
1113
1126
|
targetColumn = $xeTable.getColumnByField(field)
|
|
1114
1127
|
} else if (type) {
|
|
@@ -1141,7 +1154,7 @@ hooks.add('tableExportModule', {
|
|
|
1141
1154
|
}, { children: 'childNodes' })
|
|
1142
1155
|
// 构建分组层级
|
|
1143
1156
|
opts.columns = cols
|
|
1144
|
-
opts.colgroups = convertToRows(groups)
|
|
1157
|
+
;(opts as any).colgroups = convertToRows(groups)
|
|
1145
1158
|
if (!opts.filename) {
|
|
1146
1159
|
opts.filename = getI18n(opts.original ? 'vxe.table.expOriginFilename' : 'vxe.table.expFilename', [XEUtils.toDateString(Date.now(), 'yyyyMMddHHmmss')])
|
|
1147
1160
|
}
|
|
@@ -1163,7 +1176,7 @@ hooks.add('tableExportModule', {
|
|
|
1163
1176
|
|
|
1164
1177
|
if (!opts.print) {
|
|
1165
1178
|
if (beforeExportMethod) {
|
|
1166
|
-
beforeExportMethod({ options: opts, $table: $xeTable, $grid: $xeGrid })
|
|
1179
|
+
beforeExportMethod({ options: opts, $table: $xeTable, $grid: $xeGrid } as any)
|
|
1167
1180
|
}
|
|
1168
1181
|
}
|
|
1169
1182
|
if (!opts.data) {
|
|
@@ -578,7 +578,8 @@ renderer.mixin({
|
|
|
578
578
|
renderTableCell (renderOpts, params) {
|
|
579
579
|
const { props = {} } = renderOpts
|
|
580
580
|
const { row, column } = params
|
|
581
|
-
const
|
|
581
|
+
const inputConfig = getConfig().input || {}
|
|
582
|
+
const digits = props.digits || inputConfig.digits || 2
|
|
582
583
|
let cellValue = XEUtils.get(row, column.field)
|
|
583
584
|
if (cellValue) {
|
|
584
585
|
switch (props.type) {
|
|
@@ -609,12 +610,17 @@ renderer.mixin({
|
|
|
609
610
|
const { type } = props
|
|
610
611
|
let cellValue = XEUtils.get(row, column.field)
|
|
611
612
|
if (cellValue) {
|
|
613
|
+
const numberInputConfig = getConfig().numberInput || {}
|
|
612
614
|
if (type === 'float') {
|
|
613
|
-
const digits = props.digits ||
|
|
615
|
+
const digits = props.digits || numberInputConfig.digits || 1
|
|
614
616
|
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
|
|
615
617
|
} else if (type === 'amount') {
|
|
616
|
-
const digits = props.digits ||
|
|
618
|
+
const digits = props.digits || numberInputConfig.digits || 2
|
|
617
619
|
cellValue = XEUtils.commafy(XEUtils.toNumber(cellValue), { digits })
|
|
620
|
+
const showCurrency = props.showCurrency
|
|
621
|
+
if (XEUtils.isBoolean(showCurrency) ? showCurrency : numberInputConfig.showCurrency) {
|
|
622
|
+
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`
|
|
623
|
+
}
|
|
618
624
|
}
|
|
619
625
|
}
|
|
620
626
|
return getCellLabelVNs(renderOpts, params, cellValue)
|
|
@@ -626,11 +632,12 @@ renderer.mixin({
|
|
|
626
632
|
// 兼容老模式
|
|
627
633
|
const cellValue = XEUtils.isArray(row) ? row[_columnIndex] : XEUtils.get(row, column.field)
|
|
628
634
|
if (XEUtils.isNumber(cellValue)) {
|
|
635
|
+
const numberInputConfig = getConfig().numberInput || {}
|
|
629
636
|
if (type === 'float') {
|
|
630
|
-
const digits = props.digits ||
|
|
637
|
+
const digits = props.digits || numberInputConfig.digits || 1
|
|
631
638
|
return XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
|
|
632
639
|
} else if (type === 'amount') {
|
|
633
|
-
const digits = props.digits ||
|
|
640
|
+
const digits = props.digits || numberInputConfig.digits || 2
|
|
634
641
|
return XEUtils.commafy(XEUtils.toNumber(cellValue), { digits })
|
|
635
642
|
}
|
|
636
643
|
}
|
|
@@ -638,7 +645,12 @@ renderer.mixin({
|
|
|
638
645
|
},
|
|
639
646
|
renderTableDefault: defaultEditRender,
|
|
640
647
|
renderTableFilter: defaultFilterRender,
|
|
641
|
-
tableFilterDefaultMethod: handleInputFilterMethod
|
|
648
|
+
tableFilterDefaultMethod: handleInputFilterMethod,
|
|
649
|
+
tableExportMethod (params) {
|
|
650
|
+
const { row, column } = params
|
|
651
|
+
const cellValue = XEUtils.get(row, column.field)
|
|
652
|
+
return cellValue
|
|
653
|
+
}
|
|
642
654
|
},
|
|
643
655
|
VxeDatePicker: {
|
|
644
656
|
tableAutoFocus: 'input',
|
|
@@ -36,7 +36,7 @@ export default defineComponent({
|
|
|
36
36
|
|
|
37
37
|
const { xID, props: tableProps, context: tableContext, reactData: tableReactData, internalData: tableInternalData } = $xeTable
|
|
38
38
|
const { refTableBody, refTableHeader, refTableFooter, refTableLeftBody, refTableRightBody, refScrollXHandleElem, refScrollYHandleElem } = $xeTable.getRefMaps()
|
|
39
|
-
const { computeEditOpts, computeMouseOpts, computeAreaOpts, computeSYOpts, computeEmptyOpts, computeKeyboardOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts } = $xeTable.getComputeMaps()
|
|
39
|
+
const { computeEditOpts, computeMouseOpts, computeAreaOpts, computeSYOpts, computeEmptyOpts, computeKeyboardOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeColumnDragOpts } = $xeTable.getComputeMaps()
|
|
40
40
|
|
|
41
41
|
const refElem = ref() as Ref<HTMLDivElement>
|
|
42
42
|
const refBodyTable = ref() as Ref<HTMLTableElement>
|
|
@@ -363,6 +363,7 @@ export default defineComponent({
|
|
|
363
363
|
)
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
+
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
|
|
366
367
|
|
|
367
368
|
return h('td', {
|
|
368
369
|
class: [
|
|
@@ -376,6 +377,7 @@ export default defineComponent({
|
|
|
376
377
|
'col--tree-node': treeNode,
|
|
377
378
|
'col--edit': isEdit,
|
|
378
379
|
'col--ellipsis': hasEllipsis,
|
|
380
|
+
'fixed--width': !isAutoCellWidth,
|
|
379
381
|
'fixed--hidden': fixedHiddenColumn,
|
|
380
382
|
'is--drag-cell': isColDragCell,
|
|
381
383
|
'is--drag-disabled': isDisabledDrag,
|
|
@@ -407,6 +409,7 @@ export default defineComponent({
|
|
|
407
409
|
const editOpts = computeEditOpts.value
|
|
408
410
|
const rowOpts = computeRowOpts.value
|
|
409
411
|
const columnOpts = computeColumnOpts.value
|
|
412
|
+
const columnDragOpts = computeColumnDragOpts.value
|
|
410
413
|
const { transform, seqMode } = treeOpts
|
|
411
414
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
412
415
|
const rows: any[] = []
|
|
@@ -483,7 +486,7 @@ export default defineComponent({
|
|
|
483
486
|
return renderColumn(seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData)
|
|
484
487
|
})
|
|
485
488
|
rows.push(
|
|
486
|
-
columnOpts.drag
|
|
489
|
+
columnOpts.drag && columnDragOpts.animation
|
|
487
490
|
? h(TransitionGroup, {
|
|
488
491
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
489
492
|
tag: 'tr',
|
|
@@ -769,7 +772,7 @@ export default defineComponent({
|
|
|
769
772
|
const emptyOpts = computeEmptyOpts.value
|
|
770
773
|
const keyboardOpts = computeKeyboardOpts.value
|
|
771
774
|
const mouseOpts = computeMouseOpts.value
|
|
772
|
-
const
|
|
775
|
+
const rowDragOpts = computeRowDragOpts.value
|
|
773
776
|
// const isMergeLeftFixedExceeded = computeIsMergeLeftFixedExceeded.value
|
|
774
777
|
// const isMergeRightFixedExceeded = computeIsMergeRightFixedExceeded.value
|
|
775
778
|
// 如果是使用优化模式
|
|
@@ -852,7 +855,7 @@ export default defineComponent({
|
|
|
852
855
|
/**
|
|
853
856
|
* 内容
|
|
854
857
|
*/
|
|
855
|
-
rowOpts.drag
|
|
858
|
+
rowOpts.drag && rowDragOpts.animation
|
|
856
859
|
? h(TransitionGroup, {
|
|
857
860
|
ref: refBodyTBody,
|
|
858
861
|
name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`,
|
|
@@ -48,7 +48,7 @@ export default defineComponent({
|
|
|
48
48
|
|
|
49
49
|
const { xID, props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xeTable
|
|
50
50
|
const { refTableHeader, refTableBody, refScrollXHandleElem } = $xeTable.getRefMaps()
|
|
51
|
-
const { computeTooltipOpts, computeColumnOpts } = $xeTable.getComputeMaps()
|
|
51
|
+
const { computeTooltipOpts, computeColumnOpts, computeColumnDragOpts } = $xeTable.getComputeMaps()
|
|
52
52
|
|
|
53
53
|
const refElem = ref() as Ref<HTMLDivElement>
|
|
54
54
|
const refFooterTable = ref() as Ref<HTMLTableElement>
|
|
@@ -193,11 +193,14 @@ export default defineComponent({
|
|
|
193
193
|
attrs.colspan = colspan
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
+
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
|
|
197
|
+
|
|
196
198
|
return h('td', {
|
|
197
199
|
class: ['vxe-footer--column', column.id, {
|
|
198
200
|
[`col--${footAlign}`]: footAlign,
|
|
199
201
|
[`col--${type}`]: type,
|
|
200
202
|
'col--last': $columnIndex === tableColumn.length - 1,
|
|
203
|
+
'fixed--width': !isAutoCellWidth,
|
|
201
204
|
'fixed--hidden': fixedHiddenColumn,
|
|
202
205
|
'col--ellipsis': hasEllipsis,
|
|
203
206
|
'col--current': currentColumn === column
|
|
@@ -230,12 +233,13 @@ export default defineComponent({
|
|
|
230
233
|
const { footerRowClassName, footerRowStyle } = tableProps
|
|
231
234
|
const { isDragColMove } = tableReactData
|
|
232
235
|
const columnOpts = computeColumnOpts.value
|
|
236
|
+
const columnDragOpts = computeColumnDragOpts.value
|
|
233
237
|
|
|
234
238
|
return footerTableData.map((row, $rowIndex) => {
|
|
235
239
|
const _rowIndex = $rowIndex
|
|
236
240
|
const rowParams = { $table: $xeTable, row, _rowIndex, $rowIndex, fixed: fixedType, type: renderType }
|
|
237
241
|
|
|
238
|
-
if (columnOpts.drag) {
|
|
242
|
+
if (columnOpts.drag && columnDragOpts.animation) {
|
|
239
243
|
return h(TransitionGroup, {
|
|
240
244
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
241
245
|
tag: 'tr',
|
|
@@ -219,6 +219,8 @@ export default defineComponent({
|
|
|
219
219
|
thOns.onMouseup = $xeTable.handleHeaderCellDragMouseupEvent
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
+
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
|
|
223
|
+
|
|
222
224
|
return h('th', {
|
|
223
225
|
class: ['vxe-header--column', colid, {
|
|
224
226
|
[`col--${headAlign}`]: headAlign,
|
|
@@ -227,6 +229,7 @@ export default defineComponent({
|
|
|
227
229
|
'col--fixed': column.fixed,
|
|
228
230
|
'col--group': isColGroup,
|
|
229
231
|
'col--ellipsis': hasEllipsis,
|
|
232
|
+
'fixed--width': !isAutoCellWidth,
|
|
230
233
|
'fixed--hidden': fixedHiddenColumn,
|
|
231
234
|
'is--sortable': column.sortable,
|
|
232
235
|
'col--filter': !!column.filters,
|
|
@@ -276,11 +279,12 @@ export default defineComponent({
|
|
|
276
279
|
const { headerRowClassName, headerRowStyle } = tableProps
|
|
277
280
|
const { isDragColMove } = tableReactData
|
|
278
281
|
const columnOpts = computeColumnOpts.value
|
|
282
|
+
const columnDragOpts = computeColumnDragOpts.value
|
|
279
283
|
|
|
280
284
|
return headerGroups.map((cols, $rowIndex) => {
|
|
281
285
|
const params = { $table: $xeTable, $rowIndex, fixed: fixedType, type: renderType }
|
|
282
286
|
|
|
283
|
-
if (columnOpts.drag) {
|
|
287
|
+
if (columnOpts.drag && columnDragOpts.animation) {
|
|
284
288
|
return h(TransitionGroup, {
|
|
285
289
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
286
290
|
tag: 'tr',
|
package/packages/ui/index.ts
CHANGED
|
@@ -48,10 +48,12 @@ VxeUI.setConfig({
|
|
|
48
48
|
strict: true
|
|
49
49
|
},
|
|
50
50
|
rowDragConfig: {
|
|
51
|
-
showIcon: true
|
|
51
|
+
showIcon: true,
|
|
52
|
+
animation: true
|
|
52
53
|
},
|
|
53
54
|
columnDragConfig: {
|
|
54
|
-
showIcon: true
|
|
55
|
+
showIcon: true,
|
|
56
|
+
animation: true
|
|
55
57
|
},
|
|
56
58
|
checkboxConfig: {
|
|
57
59
|
// trigger: 'default',
|
|
@@ -60,6 +60,96 @@
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/*默认的渲染*/
|
|
63
|
+
.vxe-header--column,
|
|
64
|
+
.vxe-footer--column {
|
|
65
|
+
&.fixed--width {
|
|
66
|
+
& > .vxe-cell {
|
|
67
|
+
.vxe-default-input,
|
|
68
|
+
.vxe-default-textarea,
|
|
69
|
+
.vxe-default-select {
|
|
70
|
+
width: 100%;
|
|
71
|
+
}
|
|
72
|
+
.vxe-input,
|
|
73
|
+
.vxe-textarea,
|
|
74
|
+
.vxe-select,
|
|
75
|
+
.vxe-tree-select,
|
|
76
|
+
.vxe-date-picker,
|
|
77
|
+
.vxe-number-input,
|
|
78
|
+
.vxe-ico-picker {
|
|
79
|
+
width: 100%;
|
|
80
|
+
}
|
|
81
|
+
.vxe-cell--tree-node {
|
|
82
|
+
.vxe-input,
|
|
83
|
+
.vxe-textarea,
|
|
84
|
+
.vxe-select,
|
|
85
|
+
.vxe-tree-select,
|
|
86
|
+
.vxe-date-picker,
|
|
87
|
+
.vxe-number-input,
|
|
88
|
+
.vxe-ico-picker {
|
|
89
|
+
width: 100%;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
.vxe-body--column {
|
|
96
|
+
&.fixed--width {
|
|
97
|
+
& > .vxe-cell {
|
|
98
|
+
& > .vxe-default-input,
|
|
99
|
+
& > .vxe-default-textarea,
|
|
100
|
+
& > .vxe-default-select {
|
|
101
|
+
width: 100%;
|
|
102
|
+
}
|
|
103
|
+
& > .vxe-input,
|
|
104
|
+
& > .vxe-textarea,
|
|
105
|
+
& > .vxe-select,
|
|
106
|
+
& > .vxe-tree-select,
|
|
107
|
+
& > .vxe-date-picker,
|
|
108
|
+
& > .vxe-number-input,
|
|
109
|
+
& > .vxe-ico-picker {
|
|
110
|
+
width: 100%;
|
|
111
|
+
}
|
|
112
|
+
& > .vxe-cell--tree-node {
|
|
113
|
+
.vxe-input,
|
|
114
|
+
.vxe-textarea,
|
|
115
|
+
.vxe-select,
|
|
116
|
+
.vxe-tree-select,
|
|
117
|
+
.vxe-date-picker,
|
|
118
|
+
.vxe-number-input,
|
|
119
|
+
.vxe-ico-picker {
|
|
120
|
+
width: 100%;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
.vxe-table--filter-template {
|
|
127
|
+
& > .vxe-default-input,
|
|
128
|
+
& > .vxe-default-textarea,
|
|
129
|
+
& > .vxe-default-select {
|
|
130
|
+
width: 100%;
|
|
131
|
+
}
|
|
132
|
+
& > .vxe-input,
|
|
133
|
+
& > .vxe-textarea,
|
|
134
|
+
& > .vxe-select,
|
|
135
|
+
& > .vxe-tree-select,
|
|
136
|
+
& > .vxe-date-picker,
|
|
137
|
+
& > .vxe-number-input,
|
|
138
|
+
& > .vxe-ico-picker {
|
|
139
|
+
width: 100%;
|
|
140
|
+
}
|
|
141
|
+
& > .vxe-cell--tree-node {
|
|
142
|
+
.vxe-input,
|
|
143
|
+
.vxe-textarea,
|
|
144
|
+
.vxe-select,
|
|
145
|
+
.vxe-tree-select,
|
|
146
|
+
.vxe-date-picker,
|
|
147
|
+
.vxe-number-input,
|
|
148
|
+
.vxe-ico-picker {
|
|
149
|
+
width: 100%;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
63
153
|
.vxe-cell,
|
|
64
154
|
.vxe-table--filter-template {
|
|
65
155
|
.vxe-default-input,
|
|
@@ -71,7 +161,6 @@
|
|
|
71
161
|
.vxe-default-select {
|
|
72
162
|
outline: 0;
|
|
73
163
|
padding: 0 2px;
|
|
74
|
-
width: 100%;
|
|
75
164
|
color: var(--vxe-ui-font-color);
|
|
76
165
|
border-radius: var(--vxe-ui-border-radius);
|
|
77
166
|
border: 1px solid var(--vxe-ui-input-border-color);
|
|
@@ -107,15 +196,6 @@
|
|
|
107
196
|
height: var(--vxe-ui-input-height-default);
|
|
108
197
|
}
|
|
109
198
|
}
|
|
110
|
-
& > .vxe-input,
|
|
111
|
-
& > .vxe-textarea,
|
|
112
|
-
& > .vxe-select,
|
|
113
|
-
& > .vxe-tree-select,
|
|
114
|
-
& > .vxe-date-picker,
|
|
115
|
-
& > .vxe-number-input,
|
|
116
|
-
& > .vxe-ico-picker {
|
|
117
|
-
width: 100%;
|
|
118
|
-
}
|
|
119
199
|
& > .vxe-input > .vxe-input--inner,
|
|
120
200
|
& > .vxe-textarea > .vxe-textarea--inner {
|
|
121
201
|
padding: 0 2px;
|
|
@@ -125,15 +205,6 @@
|
|
|
125
205
|
resize: none;
|
|
126
206
|
}
|
|
127
207
|
& > .vxe-cell--tree-node {
|
|
128
|
-
.vxe-input,
|
|
129
|
-
.vxe-textarea,
|
|
130
|
-
.vxe-select,
|
|
131
|
-
.vxe-tree-select,
|
|
132
|
-
.vxe-date-picker,
|
|
133
|
-
.vxe-number-input,
|
|
134
|
-
.vxe-ico-picker {
|
|
135
|
-
width: 100%;
|
|
136
|
-
}
|
|
137
208
|
.vxe-input > .vxe-input--inner,
|
|
138
209
|
.vxe-textarea > .vxe-textarea--inner {
|
|
139
210
|
padding: 0 2px;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|