Skip to content

Commit 8056fe2

Browse files
committed
feat: 🎸 (pro-table) header flex custome
1 parent 9d2be09 commit 8056fe2

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/pro-array-table/pro.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ const ArrayTableProInside: ReactFC<ProArrayTableProps> = observer(
185185
props.settings !== false;
186186

187187
const _header = !showHeader ? null : (
188-
<Flex between marginBottom={"6px"} marginTop={"6px"}>
189-
<Flex start>
188+
<Flex {...props.headerFlex} marginBottom={"8px"} marginTop={"8px"}>
190189
{props.title ? (
191190
typeof props.title === "function" ? (
192191
props.title(dataSource)
@@ -199,8 +198,6 @@ const ArrayTableProInside: ReactFC<ProArrayTableProps> = observer(
199198
{rowSelection?.showPro === "top" ? (
200199
<RowSelectionPro ds={dataSlice} rowKey={rowKey}></RowSelectionPro>
201200
) : null}
202-
</Flex>
203-
<Flex end>
204201
{toolbar}
205202
{addition}
206203
{!props.extra && props.settings === false ? null : (
@@ -211,7 +208,6 @@ const ArrayTableProInside: ReactFC<ProArrayTableProps> = observer(
211208
) : null}
212209
</Space>
213210
)}
214-
</Flex>
215211
</Flex>
216212
);
217213

@@ -354,7 +350,6 @@ const ArrayTableProInside: ReactFC<ProArrayTableProps> = observer(
354350
);
355351

356352
const useTableExpandable = () => {
357-
return useContext(TableExpandableContext);
358353
};
359354

360355
const useTableRowSelection = () => {

src/pro-array-table/types.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { Table } from "../adaptor";
44

55
type TableProps<T> = React.ComponentProps<typeof Table>;
66

7+
import { Flex } from './mixin.pro'
78
export type TableChangeParams = Parameters<
89
Required<TableProps<any>>["onChange"]
910
>;
@@ -57,6 +58,7 @@ export interface IProArrayTableBaseMixins {
5758

5859
export type ProArrayTableProps = Omit<TableProps<any>, "title"> &
5960
IProArrayTableBaseMixins & {
61+
headerFlex?: React.ComponentProps<typeof Flex>,
6062
title: string | TableProps<any>["title"];
6163
footer: string | TableProps<any>["footer"];
6264
rowSelection?:

0 commit comments

Comments
 (0)