1.1.1 • Published 8 months ago

amos-dialog v1.1.1

Weekly downloads
1
License
MIT
Repository
-
Last release
8 months ago

amos-dialog

react dialog component

Since v1.0.6 we update react to v16.

The react@15 support last version is v1.0.5.

Install

Usage

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

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

// use dialog

API

props

paramstypedefaultdescription
prefixClsStringamos-dialogThe dialog dom node's prefixCls
classNameString-additional className for dialog
wrapClassNameString-additional className for dialog wrap
styleObject{}Root style for dialog element.Such as width, height
zIndexNumber--
bodyStyleObject{}body style for dialog body element.Such as height
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 or React.ElementTitle of the dialog
footerReact.Elementfooter of the dialog
closableBooleantruewhether show close button and click mask to close
maskBooleantruewhether show mask
maskClosableBooleantruewhether click mask to close, this prop will be ignored if set closable prop to false
mousePosition{x:number,y:number}set pageX and pageY of current mouse(it will cause transform origin to be set).
onClosefunctioncalled when click close button or mask
dragablebooleancalled when click close button or mask
dragableOpsobjectcalled when click close button or mask
getContainerfunction(): HTMLElementto determine where Dialog will be mounted

dragableOps

  • axis:
    • both allows movement horizontally and vertically (default).
    • x limits movement to horizontal axis.
    • y limits movement to vertical axis.
    • 'none' stops all movement.
  • bounds:
  • {left: number, top: number, right: number, bottom: number} | string,

  • defaultPosition:

  • {x: number, y: number}
  • Specifies the x and y that the dragged item should start at.

  • grid:

  • number, number // Specifies the x and y that dragging should snap to.

  • handle: string,

  • Specifies a selector to be used as the handle that initiates drag.
  • Example: '.handle'

Development

npm install
npm start

Example

http://localhost:8007/examples/

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

1.1.1

8 months ago

1.1.0

2 years ago

1.0.11

3 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.2

7 years ago