mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-29 18:50:00 +08:00
feat(Image): support reset action in toolbarRender (#48936)
* feat: support reset action in toolbarRender * feat: support reset action in toolbarRender * Update components/image/index.zh-CN.md Co-authored-by: afc163 <afc163@gmail.com> Signed-off-by: kiner-tang <1127031143@qq.com> * Update components/image/index.en-US.md Signed-off-by: kiner-tang <1127031143@qq.com> --------- Signed-off-by: kiner-tang <1127031143@qq.com> Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
parent
1d138e999c
commit
7a2f5f6f1b
@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
DownloadOutlined,
|
||||
UndoOutlined,
|
||||
RotateLeftOutlined,
|
||||
RotateRightOutlined,
|
||||
SwapOutlined,
|
||||
@ -38,7 +39,15 @@ const App: React.FC = () => {
|
||||
_,
|
||||
{
|
||||
transform: { scale },
|
||||
actions: { onFlipY, onFlipX, onRotateLeft, onRotateRight, onZoomOut, onZoomIn },
|
||||
actions: {
|
||||
onFlipY,
|
||||
onFlipX,
|
||||
onRotateLeft,
|
||||
onRotateRight,
|
||||
onZoomOut,
|
||||
onZoomIn,
|
||||
onReset,
|
||||
},
|
||||
},
|
||||
) => (
|
||||
<Space size={12} className="toolbar-wrapper">
|
||||
@ -49,6 +58,7 @@ const App: React.FC = () => {
|
||||
<RotateRightOutlined onClick={onRotateRight} />
|
||||
<ZoomOutOutlined disabled={scale === 1} onClick={onZoomOut} />
|
||||
<ZoomInOutlined disabled={scale === 50} onClick={onZoomIn} />
|
||||
<UndoOutlined onClick={onReset} />
|
||||
</Space>
|
||||
),
|
||||
}}
|
||||
|
@ -156,6 +156,8 @@ type TransformAction =
|
||||
onRotateRight: () => void;
|
||||
onZoomOut: () => void;
|
||||
onZoomIn: () => void;
|
||||
onReset: () => void; // support after 5.17.3
|
||||
onClose: () => void;
|
||||
};
|
||||
transform: TransformType,
|
||||
current: number;
|
||||
|
@ -135,7 +135,8 @@ type TransformAction =
|
||||
| 'wheel'
|
||||
| 'doubleClick'
|
||||
| 'move'
|
||||
| 'dragRebound';
|
||||
| 'dragRebound'
|
||||
| 'reset';
|
||||
```
|
||||
|
||||
### ToolbarRenderInfoType
|
||||
@ -157,6 +158,8 @@ type TransformAction =
|
||||
onRotateRight: () => void;
|
||||
onZoomOut: () => void;
|
||||
onZoomIn: () => void;
|
||||
onReset: () => void; // 5.17.3 之后支持
|
||||
onClose: () => void;
|
||||
};
|
||||
transform: TransformType,
|
||||
current: number;
|
||||
|
@ -137,7 +137,7 @@
|
||||
"rc-drawer": "~7.1.0",
|
||||
"rc-dropdown": "~4.2.0",
|
||||
"rc-field-form": "~2.2.0",
|
||||
"rc-image": "~7.7.0",
|
||||
"rc-image": "~7.8.0",
|
||||
"rc-input": "~1.4.5",
|
||||
"rc-input-number": "~9.0.0",
|
||||
"rc-mentions": "~2.11.1",
|
||||
|
Loading…
Reference in New Issue
Block a user