Skip to content

Commit

Permalink
feat: 🎸 (pro-table) header flex custome
Browse files Browse the repository at this point in the history
  • Loading branch information
charlzyx committed Aug 14, 2024
1 parent 9d2be09 commit 8056fe2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 1 addition & 6 deletions src/pro-array-table/pro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ const ArrayTableProInside: ReactFC<ProArrayTableProps> = observer(
props.settings !== false;

const _header = !showHeader ? null : (
<Flex between marginBottom={"6px"} marginTop={"6px"}>
<Flex start>
<Flex {...props.headerFlex} marginBottom={"8px"} marginTop={"8px"}>
{props.title ? (
typeof props.title === "function" ? (
props.title(dataSource)
Expand All @@ -199,8 +198,6 @@ const ArrayTableProInside: ReactFC<ProArrayTableProps> = observer(
{rowSelection?.showPro === "top" ? (
<RowSelectionPro ds={dataSlice} rowKey={rowKey}></RowSelectionPro>
) : null}
</Flex>
<Flex end>
{toolbar}
{addition}
{!props.extra && props.settings === false ? null : (
Expand All @@ -211,7 +208,6 @@ const ArrayTableProInside: ReactFC<ProArrayTableProps> = observer(
) : null}
</Space>
)}
</Flex>
</Flex>
);

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

const useTableExpandable = () => {
return useContext(TableExpandableContext);
};

const useTableRowSelection = () => {
Expand Down
2 changes: 2 additions & 0 deletions src/pro-array-table/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { Table } from "../adaptor";

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

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

export type ProArrayTableProps = Omit<TableProps<any>, "title"> &
IProArrayTableBaseMixins & {
headerFlex?: React.ComponentProps<typeof Flex>,
title: string | TableProps<any>["title"];
footer: string | TableProps<any>["footer"];
rowSelection?:
Expand Down

0 comments on commit 8056fe2

Please sign in to comment.