0.1.9 • Published 4 years ago

rw-dialog v0.1.9

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

rc-dialog


react dialog component

NPM version build status Test coverage Dependencies DevDependencies npm download bundle size

Screenshot

Install

rc-dialog

Usage

var Dialog = require('rc-dialog');

ReactDOM.render(
  <Dialog title={title} onClose={callback1} visible>
      <p>first dialog</p>
  </Dialog>
), document.getElementById('t1'));

// use dialog

API

rc-dialog

NameTypeDefaultDescriptionVersion
prefixClsStringrc-dialogThe dialog dom node's prefixCls
classNameStringadditional className for dialog
styleObject{}Root style for dialog element.Such as width, height
zIndexNumber
bodyStyleObject{}body style for dialog body element.Such as height
maskStyleObject{}style for mask element
visibleBooleanfalsecurrent dialog's visible status
animationStringpart of dialog animation css class name
maskAnimationStringpart of dialog's mask animation css class name
transitionNameStringdialog animation css class name
maskTransitionNameStringmask animation css class name
titleString|React.ElementTitle of the dialog
footerReact.Elementfooter of the dialog
closableBooleantruewhether show close button
maskBooleantruewhether show mask
maskClosableBooleantruewhether click mask to close
keyboardBooleantruewhether support press esc to close
mousePosition{x:number,y:number}set pageX and pageY of current mouse(it will cause transform origin to be set).
onClosefunction()called when click close button or mask
afterClosefunction()called when close animation end
getContainerfunction(): HTMLElementto determine where Dialog will be mounted
destroyOnCloseBooleanfalseto unmount child compenents on onClose
closeIconReactNodespecific the close icon.
forceRenderBooleanfalseCreate dialog dom node before dialog first show
focusTriggerAfterCloseBooleantruefocus trigger element when dialog closed
modalRender(node: ReactNode) => ReactNodeCustom modal content render8.3.0

Development

npm install
npm start

Example

http://localhost:8007/examples/

online example: http://react-component.github.io/dialog/

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rc-dialog is released under the MIT license.