-
Notifications
You must be signed in to change notification settings - Fork 99
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 #2712 from XiaoMi/feature/resize-box
feat(resize-box): 增加收缩功能
- Loading branch information
Showing
7 changed files
with
204 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@hi-ui/resize-box", | ||
"version": "4.0.2", | ||
"version": "4.0.3-alpha.1", | ||
"description": "A sub-package for @hi-ui/hiui.", | ||
"keywords": [], | ||
"author": "HiUI <[email protected]>", | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from 'react' | ||
import ResizeBox, { ResizeBoxPane } from '../src' | ||
|
||
/** | ||
* @title 设置是否可折叠 | ||
*/ | ||
export const Collapsible = () => { | ||
const [collapsed, setCollapsed] = React.useState<boolean>(false) | ||
|
||
return ( | ||
<> | ||
<h1>Collapsible</h1> | ||
<div className="resize-box-collapsible__wrap"> | ||
<ResizeBox style={{ width: 600, height: 400, border: '1px solid #ddd' }}> | ||
<ResizeBoxPane | ||
collapsible | ||
collapsed={collapsed} | ||
onCollapse={setCollapsed} | ||
defaultWidth={200} | ||
onResize={console.log} | ||
> | ||
<div | ||
style={{ | ||
width: '100%', | ||
overflow: 'auto', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}} | ||
> | ||
left content | ||
</div> | ||
</ResizeBoxPane> | ||
<ResizeBoxPane> | ||
<div | ||
style={{ | ||
width: '100%', | ||
overflow: 'auto', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}} | ||
> | ||
right content | ||
</div> | ||
</ResizeBoxPane> | ||
</ResizeBox> | ||
</div> | ||
</> | ||
) | ||
} |
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