5.1.0 • Published 2 years ago

dw-neit-rc-drawer v5.1.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

dw-neit-rc-drawer

NPM version dumi build status codecov node version npm download

Example

https://drawer-react-component.vercel.app/

Usage

import Drawer from 'dw-neit-rc-drawer';
import React from 'react';
import ReactDom from 'react-dom';

ReactDom.render(
  <Drawer>
    {menu children}
  </Drawer>
, mountNode);

Install

dw-neit-rc-drawer

Browser Support

IEChromeFirefoxOperaSafari
IE 10+ ✔Chrome 31.0+ ✔Firefox 31.0+ ✔Opera 30.0+ ✔Safari 7.0+ ✔

API

propstypedefaultdescription
classNamestringnull-
prefixClsstring'drawer'prefix class
wrapperClassNamestringnullwrapper class name
widthstring | numbernulldrawer content wrapper width, drawer level transition width
heightstring | numbernulldrawer content wrapper height, drawer level transition height
openbooleanfalseopen or close menu
defaultOpenbooleanfalsedefault open menu
handlerboolean | ReactElementtruetrue or false or ReactElement, default: <divclassName="drawer-handle"><i className="drawer-handle-icon" /></div>;
placementstringleftleft top right bottom
levelstring | arrayallWith the drawer level element. all/ null / className / id / tagName / array
levelMovenumber | array | funcnulllevel move value. default is drawer width
durationstring.3slevel animation duration
easestringcubic-bezier(0.78, 0.14, 0.15, 0.86)level animation timing function
getContainerstring | func | HTMLElementbodyReturn the mount node for Drawer. if is null use React.creactElement
showMaskbooleantruemask is show
maskClosablebooleantrueClicking on the mask (area outside the Drawer) to close the Drawer or not.
maskStyleCSSPropertiesnullmask style
onChangefuncnullchange callback(open)
afterVisibleChangefuncnulltransition end callback(open)
onClosefuncnullclose click function
onHandleClickfuncnulhandle icon click function
keyboardBooleantrueWhether support press esc to close
contentWrapperStyleCSSPropertiesnullcontent wrapper style
autoFocusBooleantrueWhether focusing on the drawer after it opened

2.0 Rename onMaskClick -> onClose, add maskClosable.

Development

npm install
npm start