-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #989 from oceanbase/master
[Feature Branch] chore(merge): Merge master branch of v0.4.10
- Loading branch information
Showing
23 changed files
with
259 additions
and
46 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
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
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
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
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
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
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
66 changes: 66 additions & 0 deletions
66
packages/design/src/dropdown/demo/dropdown-with-button.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,66 @@ | ||
import React from 'react'; | ||
import { Button, Dropdown, message, Space, Tooltip } from '@oceanbase/design'; | ||
import type { MenuProps } from '@oceanbase/design'; | ||
import { DownOutlined, EllipsisOutlined, UserOutlined } from '@oceanbase/icons'; | ||
|
||
const handleMenuClick: MenuProps['onClick'] = e => { | ||
message.info('Click on menu item.'); | ||
console.log('click', e); | ||
}; | ||
|
||
const items: MenuProps['items'] = [ | ||
{ | ||
label: '1st menu item', | ||
key: '1', | ||
icon: <UserOutlined />, | ||
}, | ||
{ | ||
label: '2nd menu item', | ||
key: '2', | ||
icon: <UserOutlined />, | ||
}, | ||
{ | ||
label: '3rd menu item', | ||
key: '3', | ||
icon: <UserOutlined />, | ||
danger: true, | ||
}, | ||
{ | ||
label: '4rd menu item', | ||
key: '4', | ||
icon: <UserOutlined />, | ||
danger: true, | ||
disabled: true, | ||
}, | ||
]; | ||
|
||
const menuProps = { | ||
items, | ||
onClick: handleMenuClick, | ||
}; | ||
|
||
const App: React.FC = () => ( | ||
<Space wrap> | ||
<Dropdown menu={menuProps}> | ||
<Button icon={<EllipsisOutlined />}></Button> | ||
</Dropdown> | ||
<Dropdown menu={menuProps}> | ||
<Button> | ||
<Space> | ||
Button | ||
<DownOutlined /> | ||
</Space> | ||
</Button> | ||
</Dropdown> | ||
<Dropdown menu={menuProps}> | ||
<Button type="primary"> | ||
<Space> | ||
Button | ||
<DownOutlined /> | ||
</Space> | ||
</Button> | ||
</Dropdown> | ||
</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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import { Dropdown } from 'antd'; | ||
import type { DropdownButtonProps } from 'antd/es/dropdown'; | ||
import { DownOutlined } from '@oceanbase/icons'; | ||
|
||
type CompoundedComponent = React.FC<DropdownButtonProps> & { | ||
/** @internal */ | ||
__ANT_BUTTON: boolean; | ||
}; | ||
|
||
const DropdownButton: CompoundedComponent = ({ icon = <DownOutlined />, ...restProps }) => { | ||
return <Dropdown.Button icon={icon} {...restProps} />; | ||
}; | ||
|
||
DropdownButton.__ANT_BUTTON = true; | ||
|
||
export default DropdownButton; |
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
This file was deleted.
Oops, something went wrong.
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,22 @@ | ||
import React from 'react'; | ||
import { Dropdown as AntDropdown } from 'antd'; | ||
import type { DropDownProps } from 'antd/es/dropdown'; | ||
import DropdownButton from './dropdown-button'; | ||
|
||
export * from 'antd/es/dropdown'; | ||
|
||
type CompoundedComponent = React.FC<DropDownProps> & { | ||
Button: typeof DropdownButton; | ||
_InternalPanelDoNotUseOrYouWillBeFired: typeof AntDropdown._InternalPanelDoNotUseOrYouWillBeFired; | ||
}; | ||
|
||
const Dropdown: CompoundedComponent = props => { | ||
return <AntDropdown {...props} />; | ||
}; | ||
|
||
Dropdown._InternalPanelDoNotUseOrYouWillBeFired = | ||
AntDropdown._InternalPanelDoNotUseOrYouWillBeFired; | ||
|
||
Dropdown.Button = DropdownButton; | ||
|
||
export default Dropdown; |
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
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
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
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
Oops, something went wrong.