feat: update table
parent
213706c185
commit
d50fad7f6d
|
@ -1,4 +1,4 @@
|
||||||
// base rc-table 6.2.8
|
// base rc-table 6.2.9
|
||||||
import T from './src/Table'
|
import T from './src/Table'
|
||||||
import Column from './src/Column'
|
import Column from './src/Column'
|
||||||
import ColumnGroup from './src/ColumnGroup'
|
import ColumnGroup from './src/ColumnGroup'
|
||||||
|
|
|
@ -46,7 +46,7 @@ const BaseTable = {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
renderRows (renderData, indent, rows = [], ancestorKeys = []) {
|
renderRows (renderData, indent, ancestorKeys = []) {
|
||||||
const {
|
const {
|
||||||
columnManager, sComponents: components,
|
columnManager, sComponents: components,
|
||||||
prefixCls,
|
prefixCls,
|
||||||
|
@ -64,6 +64,8 @@ const BaseTable = {
|
||||||
} = this.table
|
} = this.table
|
||||||
const { getRowKey, fixed, expander, isAnyColumnsFixed } = this
|
const { getRowKey, fixed, expander, isAnyColumnsFixed } = this
|
||||||
|
|
||||||
|
const rows = []
|
||||||
|
|
||||||
for (let i = 0; i < renderData.length; i++) {
|
for (let i = 0; i < renderData.length; i++) {
|
||||||
const record = renderData[i]
|
const record = renderData[i]
|
||||||
const key = getRowKey(record, i)
|
const key = getRowKey(record, i)
|
||||||
|
@ -84,16 +86,12 @@ const BaseTable = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const rowPrefixCls = `${prefixCls}-row`
|
const rowPrefixCls = `${prefixCls}-row`
|
||||||
const rowIndex = rows.filter(row => {
|
|
||||||
const props = getOptionProps(row)
|
|
||||||
return !props.expandedRow
|
|
||||||
}).length
|
|
||||||
|
|
||||||
const expandableRowProps = {
|
const expandableRowProps = {
|
||||||
props: {
|
props: {
|
||||||
...expander.props,
|
...expander.props,
|
||||||
fixed,
|
fixed,
|
||||||
index: rowIndex,
|
index: i,
|
||||||
prefixCls: rowPrefixCls,
|
prefixCls: rowPrefixCls,
|
||||||
record,
|
record,
|
||||||
rowKey: key,
|
rowKey: key,
|
||||||
|
@ -112,7 +110,7 @@ const BaseTable = {
|
||||||
fixed,
|
fixed,
|
||||||
indent,
|
indent,
|
||||||
record,
|
record,
|
||||||
index: rowIndex,
|
index: i,
|
||||||
prefixCls: rowPrefixCls,
|
prefixCls: rowPrefixCls,
|
||||||
childrenColumnName: childrenColumnName,
|
childrenColumnName: childrenColumnName,
|
||||||
columns: leafColumns,
|
columns: leafColumns,
|
||||||
|
|
|
@ -201,7 +201,7 @@ const ExpandableTable = {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (childrenData) {
|
if (childrenData) {
|
||||||
renderRows(childrenData, nextIndent, rows, nextAncestorKeys)
|
rows.push(...renderRows(childrenData, nextIndent, nextAncestorKeys))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// based on rc-tree 1.12.6
|
// based on rc-tree 1.14.6
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
module.exports = require('./src/')
|
module.exports = require('./src/')
|
||||||
|
|
Loading…
Reference in New Issue