mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 10:59:19 +08:00
Compare commits
2 Commits
test-eslin
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67c918f880 | ||
|
|
1de95db5c1 |
@@ -60,14 +60,20 @@ export interface DrawerProps
|
||||
*/
|
||||
destroyOnHidden?: boolean;
|
||||
mask?: MaskType;
|
||||
|
||||
focusable?: FocusableConfig;
|
||||
}
|
||||
|
||||
const defaultPushState: PushState = { distance: 180 };
|
||||
const DEFAULT_PUSH_STATE: PushState = { distance: 180 };
|
||||
|
||||
const DEFAULT_SIZE = 378;
|
||||
|
||||
const MOTION_CONFIG: CSSMotionProps = {
|
||||
motionAppear: true,
|
||||
motionEnter: true,
|
||||
motionLeave: true,
|
||||
motionDeadline: 500,
|
||||
} as const;
|
||||
|
||||
const Drawer: React.FC<DrawerProps> & {
|
||||
_InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
|
||||
} = (props) => {
|
||||
@@ -78,7 +84,7 @@ const Drawer: React.FC<DrawerProps> & {
|
||||
height,
|
||||
width,
|
||||
mask: drawerMask,
|
||||
push = defaultPushState,
|
||||
push = DEFAULT_PUSH_STATE,
|
||||
open,
|
||||
afterOpenChange,
|
||||
onClose,
|
||||
@@ -157,18 +163,12 @@ const Drawer: React.FC<DrawerProps> & {
|
||||
// =========================== Motion ===========================
|
||||
const maskMotion: CSSMotionProps = {
|
||||
motionName: getTransitionName(prefixCls, 'mask-motion'),
|
||||
motionAppear: true,
|
||||
motionEnter: true,
|
||||
motionLeave: true,
|
||||
motionDeadline: 500,
|
||||
...MOTION_CONFIG,
|
||||
};
|
||||
|
||||
const panelMotion: RcDrawerProps['motion'] = (motionPlacement) => ({
|
||||
motionName: getTransitionName(prefixCls, `panel-motion-${motionPlacement}`),
|
||||
motionAppear: true,
|
||||
motionEnter: true,
|
||||
motionLeave: true,
|
||||
motionDeadline: 500,
|
||||
...MOTION_CONFIG,
|
||||
});
|
||||
|
||||
// ============================ Refs ============================
|
||||
@@ -205,6 +205,17 @@ const Drawer: React.FC<DrawerProps> & {
|
||||
props: mergedProps,
|
||||
});
|
||||
|
||||
const drawerClassName = clsx(
|
||||
{
|
||||
'no-mask': !mergedMask,
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl',
|
||||
},
|
||||
rootClassName,
|
||||
hashId,
|
||||
cssVarCls,
|
||||
mergedClassNames.root,
|
||||
);
|
||||
|
||||
// ========================== Warning ===========================
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = devUseWarning('Drawer');
|
||||
@@ -237,17 +248,6 @@ const Drawer: React.FC<DrawerProps> & {
|
||||
);
|
||||
}
|
||||
|
||||
const drawerClassName = clsx(
|
||||
{
|
||||
'no-mask': !mergedMask,
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl',
|
||||
},
|
||||
rootClassName,
|
||||
hashId,
|
||||
cssVarCls,
|
||||
mergedClassNames.root,
|
||||
);
|
||||
|
||||
return (
|
||||
<ContextIsolator form space>
|
||||
<zIndexContext.Provider value={contextZIndex}>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { imageDemoTest } from '../../../tests/shared/imageTest';
|
||||
|
||||
describe('List image', () => {
|
||||
imageDemoTest('list', { skip: ['loadmore.tsx'] });
|
||||
imageDemoTest('list', { skip: ['loadmore.tsx', 'vertical.tsx'] });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user