Skip to content

Commit 9f2070c

Browse files
QdabuliuQzombieJ
andauthored
feat: add resizable drawer feature (#528)
* feat: add resizable drawer feature * fix: reset tsconfig include paths for .dumi directory * feat: refactor resizable drawer to use drag hook * fix: vertical motion and overflow handling in DrawerPopup * feat: improve Drawer resizable logic and add tests * chore: reformat API props in README * fix: resizable drawer logic and useDrag hook * chore: remove redundant comments in DrawerPopup.tsx * chore: update resizable drawer tests * chore: remove redundant comments from drawer menu tests * feat: refactor resizable drawer to support controlled and uncontrolled modes * chore: reset README.md * chore: reset README.md * chore: reset README.md * chore: modify README.md * chore: modify README.md * chore: make resizable onResize callback optional * fix: update resizable prop to use optional callbacks * fix: optional chaining on resizable callbacks * fix: remove resizable prop from modal example * fix: refactor Drawer width and DrawerPopup sizing logic * feat: modify size logic and test units * fix: modify isControlled logic and test units * chore: adjust logic to merge code * chore: clean up * chore: fallback * chore: adjust style * chore: test coverage --------- Co-authored-by: 二货机器人 <[email protected]>
1 parent 88a9f6d commit 9f2070c

File tree

14 files changed

+1113
-255
lines changed

14 files changed

+1113
-255
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ ReactDom.render(
4949
| prefixCls | string | 'drawer' | prefix class |
5050
| width | string \| number | null | drawer content wrapper width, drawer level transition width |
5151
| height | string \| number | null | drawer content wrapper height, drawer level transition height |
52+
| defaultWidth | string \| number | null | default width for uncontrolled resizable drawer |
53+
| defaultHeight | string \| number | null | default height for uncontrolled resizable drawer |
5254
| open | boolean | false | open or close menu |
5355
| defaultOpen | boolean | false | default open menu |
5456
| placement | string | `left` | `left` `top` `right` `bottom` |
@@ -64,6 +66,7 @@ ReactDom.render(
6466
| onClose | func | null | close click function |
6567
| keyboard | boolean | true | Whether support press esc to close |
6668
| autoFocus | boolean | true | Whether focusing on the drawer after it opened |
69+
| resizable | { onResize?: (size: number) => void; onResizeStart?: () => void; onResizeEnd?: () => void; } | - | Resizable configuration with optional callbacks |
6770
| onMouseEnter | React.MouseEventHandler\<HTMLDivElement\> | - | Trigger when mouse enter drawer panel |
6871
| onMouseOver | React.MouseEventHandler\<HTMLDivElement\> | - | Trigger when mouse over drawer panel |
6972
| onMouseLeave | React.MouseEventHandler\<HTMLDivElement\> | - | Trigger when mouse leave drawer panel |

0 commit comments

Comments
 (0)