Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve(design): Remove pagination borderTop for bordered Table #207

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions packages/design/src/table/demo/bordered.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import React from 'react';
import { Table } from '@oceanbase/design';
import type { ColumnsType } from '@oceanbase/design/es/table';

interface DataType {
key: string;
name: string;
money: string;
address: string;
}

const columns: ColumnsType<DataType> = [
{
title: 'Name',
dataIndex: 'name',
render: text => <a>{text}</a>,
},
{
title: 'Cash Assets',
className: 'column-money',
dataIndex: 'money',
align: 'right',
},
{
title: 'Address',
dataIndex: 'address',
},
];

const data: DataType[] = [
{
key: '1',
name: 'John Brown',
money: '¥300,000.00',
address: 'New York No. 1 Lake Park',
},
{
key: '2',
name: 'Jim Green',
money: '¥1,256,000.00',
address: 'London No. 1 Lake Park',
},
{
key: '3',
name: 'Joe Black',
money: '¥120,000.00',
address: 'Sydney No. 1 Lake Park',
},
];

const App: React.FC = () => (
<Table
columns={columns}
dataSource={data}
bordered
title={() => 'Header'}
footer={() => 'Footer'}
/>
);

export default App;
2 changes: 2 additions & 0 deletions packages/design/src/table/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ nav:

<code src="./demo/basic.tsx" title="基本"></code>

<code src="./demo/bordered.tsx" title="带边框" description="添加表格边框线"></code>

<code src="./demo/fixed-columns-header-tables.tsx" title="固定头和列"></code>

<code src="./demo/multiple-tables.tsx" title="选择和操作"></code>
Expand Down
13 changes: 8 additions & 5 deletions packages/design/src/table/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,6 @@ export const genTableStyle: GenerateStyle<TableToken> = (token: TableToken): CSS
},
},
},
[`${componentCls}-pagination`]: {
[`&${antCls}-pagination`]: {
borderTop: 'none',
},
},
},

// 分页器样式
Expand All @@ -202,6 +197,14 @@ export const genTableStyle: GenerateStyle<TableToken> = (token: TableToken): CSS
},
},
},
[`${componentCls}${componentCls}-bordered`]: {
[`&+${componentCls}-pagination`]: {
[`&${antCls}-pagination`]: {
// Remove pagination borderTop for bordered Table
borderTop: 'none',
},
},
},
},

// 批量操作栏中的弹出层样式
Expand Down