Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-dialog

Package Overview
Dependencies
Maintainers
2
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-dialog - npm Package Compare versions

Comparing version 2.0.2 to 2.1.0

examples/simple.html

25

lib/Dialog.js
/** @jsx React.DOM */
var React = require('react');
var Mask = require('./Mask');

@@ -30,4 +29,6 @@ function noop() {

className: '',
closable: true,
prefixCls: 'rc-dialog',
visible: false,
onBeforeClose: noop,
onShow: noop,

@@ -72,2 +73,8 @@ onClose: noop

requestClose: function () {
if (this.props.onBeforeClose(this) !== false) {
this.close();
}
},
render: function () {

@@ -79,2 +86,3 @@ var self = this;

var className = [prefixClsFn('wrap')];
var closable = props.closable;

@@ -85,13 +93,18 @@ if (!visible) {

var maskProps = {};
if (closable) {
maskProps.onClick = this.requestClose;
}
return (
<div className={className.join(' ')}>
<Mask visible={this.state.visible}
onClick={this.close}
prefixClsFn = {prefixClsFn}/>
<div {...maskProps} className={prefixClsFn('mask')}></div>
<div className={[prefixClsFn(''), props.className].join(' ')} tabIndex="0" role="dialog" ref='dialog' style={props.style}>
<div className={prefixClsFn('content')}>
<div className={prefixClsFn('header')}>
<a tabIndex="0" onClick={this.close} className={[prefixClsFn('close')].join('')}>
{closable ?
(<a tabIndex="0" onClick={this.requestClose} className={[prefixClsFn('close')].join('')}>
<span className={prefixClsFn('close-x')}>×</span>
</a>
</a>) :
null}
<div className={prefixClsFn('title')}>{props.title}</div>

@@ -98,0 +111,0 @@ </div>

{
"name": "rc-dialog",
"version": "2.0.2",
"version": "2.1.0",
"description": "dialog ui component for react",

@@ -28,3 +28,3 @@ "keywords": [

"dependencies": {
"react": "~0.12.1"
"react": "*"
}

@@ -36,6 +36,7 @@ },

"scripts": {
"example": "rm -rf build && webpack -d && rc-tools run jsx2html",
"less": "rc-tools run less",
"history": "rc-tools run history",
"start": "node --harmony node_modules/.bin/rc-server",
"publish": "rc-tools run tag && spm publish && spm doc publish",
"publish": "rc-tools run tag && spm publish",
"lint": "rc-tools run lint",

@@ -49,9 +50,16 @@ "test": "",

"async": "^0.9.0",
"bootstrap": "^3.3.2",
"css-loader": "^0.9.1",
"expect.js": "~0.3.1",
"jquery": "~1.11.1",
"file-loader": "^0.8.1",
"jquery": "^1.11.2",
"jsx-loader": "^0.12.2",
"precommit-hook": "^1.0.7",
"rc-server": "^1.0.0",
"rc-tools": "^1.0.1",
"rc-server": "^2.0.0",
"rc-tools": "^1.1.0",
"react": "~0.12.1",
"sinon": "1.12.1"
"sinon": "^1.12.2",
"style-loader": "^0.8.3",
"url-loader": "^0.5.5",
"webpack": "~1.5.3"
},

@@ -61,20 +69,3 @@ "precommit": [

"less"
],
"browserify-shim": {
"react": "global:React"
},
"browserify": {
"transform": [
[
"browserify-jsx"
],
[
"browserify-shim"
]
]
},
"dependencies": {
"browserify-shim": "^3.8.0",
"browserify-jsx": "^0.1.0"
}
]
}

@@ -65,2 +65,8 @@ # rc-dialog

#### closable
* whether show close button and click mask to close
#### onBeforeClose
* called by requestClose or click close button or mask
#### onShow

@@ -80,2 +86,5 @@ * When the dialog shown , the callback was called.

#### requestClose
* run props.beforeClose first, if beforeClose does not return false then call close()
## Development

@@ -92,3 +101,3 @@

online example: http://spmjs.io/docs/rc-dialog/examples/
online example: http://react-component.github.io/dialog/build/examples/

@@ -95,0 +104,0 @@ ## Test Case

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc