-
Notifications
You must be signed in to change notification settings - Fork 732
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: shijia.me <shijia.me@bytedance.com>
- Loading branch information
1 parent
52bb3f9
commit 74998fd
Showing
5 changed files
with
118 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/semi-ui/table/_story/RTL/ColumnAlignWithSorter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import { Space } from '../../../index'; | ||
import ColumnAlignWithSorter from '../v2/columnAlignWithSorter'; | ||
import RTLWrapper from '../../../configProvider/_story/RTLDirection/RTLWrapper'; | ||
|
||
function App() { | ||
return ( | ||
<Space vertical align='start' style={{ width: 1200 }}> | ||
<RTLWrapper defaultDirection='rtl'> | ||
<ColumnAlignWithSorter /> | ||
</RTLWrapper> | ||
<RTLWrapper defaultDirection='ltr'> | ||
<ColumnAlignWithSorter /> | ||
</RTLWrapper> | ||
</Space> | ||
); | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
|
||
export { default as RTLAlignScrollBar } from './AlignScrollBar'; | ||
export { default as ColumnAlign } from './ColumnAlign'; | ||
export { default as Direction } from './Direction'; | ||
export { default as Direction } from './Direction'; | ||
export { default as ColumnAlignWithSorter } from './ColumnAlignWithSorter'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
packages/semi-ui/table/_story/v2/columnAlignWithSorter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import React from 'react'; | ||
import { Table } from '@douyinfe/semi-ui'; | ||
|
||
export default function App() { | ||
const columns = [ | ||
{ | ||
title: '大小(align left)', | ||
dataIndex: 'size', | ||
align: 'left', | ||
sorter: (a, b) => (a.size - b.size > 0 ? 1 : -1), | ||
}, | ||
{ | ||
title: '所有者(align right)', | ||
dataIndex: 'owner', | ||
align: 'right', | ||
sorter: (a, b) => (a.size - b.size > 0 ? 1 : -1), | ||
}, | ||
{ | ||
title: '更新日期(align left)', | ||
dataIndex: 'updateTime', | ||
align: 'left', | ||
filters: [ | ||
{ | ||
text: 'Semi Design 设计稿', | ||
value: 'Semi Design 设计稿', | ||
}, | ||
{ | ||
text: 'Semi D2C 设计稿', | ||
value: 'Semi D2C 设计稿', | ||
}, | ||
], | ||
onFilter: (value, record) => record.name.includes(value), | ||
}, | ||
{ | ||
title: '标题(align right)', | ||
dataIndex: 'name', | ||
align: 'right', | ||
filters: [ | ||
{ | ||
text: 'Semi Design 设计稿', | ||
value: 'Semi Design 设计稿', | ||
}, | ||
{ | ||
text: 'Semi D2C 设计稿', | ||
value: 'Semi D2C 设计稿', | ||
}, | ||
], | ||
onFilter: (value, record) => record.name.includes(value), | ||
}, | ||
]; | ||
const data = [ | ||
{ | ||
key: '1', | ||
name: 'Semi Design 设计稿.fig', | ||
nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/figma-icon.png', | ||
size: '2M', | ||
owner: '姜鹏志', | ||
updateTime: '2020-02-02 05:13', | ||
avatarBg: 'grey', | ||
}, | ||
{ | ||
key: '2', | ||
name: 'Semi Design 分享演示文稿', | ||
nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/docs-icon.png', | ||
size: '2M', | ||
owner: '郝宣', | ||
updateTime: '2020-01-17 05:31', | ||
avatarBg: 'red', | ||
}, | ||
{ | ||
key: '3', | ||
name: '设计文档', | ||
nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/docs-icon.png', | ||
size: '34KB', | ||
owner: 'Zoey Edwards', | ||
updateTime: '2020-01-26 11:01', | ||
avatarBg: 'light-blue', | ||
}, | ||
]; | ||
|
||
return <Table columns={columns} dataSource={data} pagination={false} />; | ||
} |