Skip to content

Commit e5c1860

Browse files
committed
chore: row expandable
1 parent a3e7ee9 commit e5c1860

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/Body/BodyRow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function BodyRow<RecordType extends { children?: readonly RecordType[] }>(
117117

118118
// Misc
119119
expanded,
120-
supportExpand,
120+
rowSupportExpand,
121121
expandable,
122122
} = rowInfo;
123123

@@ -206,7 +206,7 @@ function BodyRow<RecordType extends { children?: readonly RecordType[] }>(
206206

207207
// ======================== Expand Row =========================
208208
let expandRowNode: React.ReactElement;
209-
if (supportExpand && (expandRended || expanded)) {
209+
if (rowSupportExpand && (expandRended || expanded)) {
210210
const expandContent = expandedRowRender(record, index, indent + 1, expanded);
211211
const computedExpandedRowClassName =
212212
expandedRowClassName && expandedRowClassName(record, index, indent);

src/StaticTable/BodyLine.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ const BodyLine = React.forwardRef<HTMLDivElement, BodyLineProps>((props, ref) =>
3434
const rowInfo = useRowInfo(record, rowKey);
3535

3636
// ========================== Expand ==========================
37-
const { expandable, expanded } = rowInfo;
37+
const { supportExpand, expanded } = rowInfo;
3838

3939
let expandRowNode: React.ReactElement;
40-
if (expandable && expanded) {
40+
if (supportExpand && expanded) {
4141
expandRowNode = <>233</>;
4242
}
4343

@@ -56,7 +56,7 @@ const BodyLine = React.forwardRef<HTMLDivElement, BodyLineProps>((props, ref) =>
5656
const rowNode = (
5757
<div
5858
{...restProps}
59-
ref={expandable ? null : ref}
59+
ref={supportExpand ? null : ref}
6060
className={classNames(className, `${prefixCls}-row`, {
6161
[`${prefixCls}-row-extra`]: extra,
6262
})}
@@ -80,7 +80,7 @@ const BodyLine = React.forwardRef<HTMLDivElement, BodyLineProps>((props, ref) =>
8080
</div>
8181
);
8282

83-
if (expandable) {
83+
if (supportExpand) {
8484
return (
8585
<div ref={ref}>
8686
{rowNode}

src/hooks/useRowInfo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default function useRowInfo<RecordType>(
2929
expanded: boolean;
3030
hasNestChildren: boolean;
3131
record: RecordType;
32-
supportExpand: boolean;
32+
rowSupportExpand: boolean;
3333
expandable: boolean;
3434
} {
3535
const context: TableContextProps = useContext(TableContext, [
@@ -83,7 +83,7 @@ export default function useRowInfo<RecordType>(
8383
hasNestChildren,
8484
record,
8585
onTriggerExpand: onInternalTriggerExpand,
86-
supportExpand: rowSupportExpand,
86+
rowSupportExpand,
8787
expandable: mergedExpandable,
8888
};
8989
}

0 commit comments

Comments
 (0)