{colName ? {colName}: : }
{row.groupTitle ?? content}
)
}
const getCellProps = (value: any, row: any, rowIndex: number) => {
const meta = getGroupingMeta(row)
if (!meta.isGroupHeader) {
return
}
const { expandable } = meta
const rowKey = row[primaryKey]
const expanded = !openKeySet.has(rowKey)
let onClick: any
if (expandable) {
onClick = (e: React.MouseEvent) => {
e.stopPropagation()
toggle(rowKey)
// if (expanded) {
// onChangeOpenKeys(
// openKeys.filter((key) => key !== rowKey),
// rowKey,
// 'collapse',
// )
// } else {
// onChangeOpenKeys([...openKeys, rowKey], rowKey, 'expand')
// }
}
}
const prevProps = firstCol.getCellProps?.(value, row, rowIndex)
return mergeCellProps(prevProps, {
onClick,
style: { cursor: expandable ? 'pointer' : undefined },
})
}
return [
{
...firstCol,
width: firstCol.isCheckBox ? firstCol.width : indentSize,
render,
getCellProps(value, row, rowIndex) {
return mergeCellProps(getCellProps(value, row, rowIndex), {
className: "art_custom_group_lock_td",
})
},
lock: true,
headerCellProps: {
...firstCol.headerCellProps,
className: "art_custom_group_lock_th" + (firstCol?.headerCellProps?.className ?? ''),
},
getSpanRect(value: any, row: any, rowIndex: number) {
if (getGroupingMeta(row).isGroupHeader) {
return { top: rowIndex, bottom: rowIndex + 1, left: 0, right: columnFlatCount }
} else {
if (isMerged)
return { top: rowIndex, bottom: rowIndex + 1, left: 0, right: groupColumns.length + (firstCol.isCheckBox ? 1 : 0) }
}
},
isDragColumn: true
},
...others.map((it) => {
const newIte = { ...it }
if (typeof it.groupIndex === 'number') {
newIte.width = firstCol.isCheckBox ? 0 : indentSize;
newIte.lock = true;
newIte.getCellProps = function (value, row, rowIndex) {
return mergeCellProps(it.getCellProps?.(value, row, rowIndex) || {}, {
className: "art_custom_group_lock_td"
})
}
newIte.render = () => {
return