@@ -6,12 +6,7 @@ import { Center } from 'react-layout-kit';
66import type { Props as RndProps } from 'react-rnd' ;
77import useControlledState from 'use-merge-value' ;
88
9- import {
10- DownOutlined ,
11- LeftOutlined ,
12- RightOutlined ,
13- UpOutlined ,
14- } from '@ant-design/icons' ;
9+ import { DownOutlined , LeftOutlined , RightOutlined , UpOutlined } from '@ant-design/icons' ;
1510import { getPrefixCls } from '../theme' ;
1611import { useStyle } from './style' ;
1712
@@ -36,6 +31,15 @@ export interface FixModePanelProps {
3631 * 最小高度
3732 */
3833 minHeight ?: number ;
34+
35+ /**
36+ * 最大宽度
37+ */
38+ maxWidth ?: number ;
39+ /**
40+ * 最大高度
41+ */
42+ maxHeight ?: number ;
3943 /**
4044 * 控制可缩放区域
4145 */
@@ -127,6 +131,8 @@ export const FixMode: FC<FixModePanelProps> = memo<FixModePanelProps>(
127131 defaultSize : customizeDefaultSize ,
128132 minWidth,
129133 minHeight,
134+ maxHeight,
135+ maxWidth,
130136 prefixCls : customPrefixCls ,
131137 onSizeChange,
132138 onSizeDragging,
@@ -153,8 +159,7 @@ export const FixMode: FC<FixModePanelProps> = memo<FixModePanelProps>(
153159 if ( ! canResizing ) return { } ;
154160
155161 return {
156- [ revesePlacement ( placement ) ] :
157- styles [ `${ revesePlacement ( placement ) } Handle` ] ,
162+ [ revesePlacement ( placement ) ] : styles [ `${ revesePlacement ( placement ) } Handle` ] ,
158163 } ;
159164 } , [ canResizing , placement ] ) ;
160165
@@ -189,8 +194,9 @@ export const FixMode: FC<FixModePanelProps> = memo<FixModePanelProps>(
189194 const sizeProps = isExpand
190195 ? {
191196 minWidth : typeof minWidth === 'number' ? Math . max ( minWidth , 0 ) : 280 ,
192- minHeight :
193- typeof minHeight === 'number' ? Math . max ( minHeight , 0 ) : undefined ,
197+ minHeight : typeof minHeight === 'number' ? Math . max ( minHeight , 0 ) : undefined ,
198+ maxHeight : typeof maxHeight === 'number' ? Math . max ( maxHeight , 0 ) : undefined ,
199+ maxWidth : typeof maxWidth === 'number' ? Math . max ( maxWidth , 0 ) : undefined ,
194200 defaultSize,
195201 size : size as Size ,
196202 style,
0 commit comments