rc-dialog
Advanced tools
Comparing version 2.0.2 to 2.1.0
/** @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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20026
0
22
399
111
15
- Removedbrowserify-jsx@^0.1.0
- Removedbrowserify-shim@^3.8.0
- RemovedJSONStream@1.3.5(transitive)
- Removedaccessory@1.1.0(transitive)
- Removedacorn@5.7.47.4.1(transitive)
- Removedacorn-node@1.8.2(transitive)
- Removedacorn-walk@7.2.0(transitive)
- Removedamdefine@1.0.1(transitive)
- Removedap@0.2.0(transitive)
- Removedasn1.js@4.10.1(transitive)
- Removedassert@1.5.1(transitive)
- Removedast-types@0.9.6(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedbalanced-match@0.2.11.0.2(transitive)
- Removedbase62@0.1.1(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbn.js@4.12.05.2.1(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbrorand@1.1.0(transitive)
- Removedbrowser-pack@6.1.0(transitive)
- Removedbrowser-resolve@2.0.0(transitive)
- Removedbrowserify@17.0.1(transitive)
- Removedbrowserify-aes@1.2.0(transitive)
- Removedbrowserify-cipher@1.0.1(transitive)
- Removedbrowserify-des@1.0.2(transitive)
- Removedbrowserify-jsx@0.1.0(transitive)
- Removedbrowserify-rsa@4.1.1(transitive)
- Removedbrowserify-shim@3.8.16(transitive)
- Removedbrowserify-sign@4.2.3(transitive)
- Removedbrowserify-zlib@0.2.0(transitive)
- Removedbuffer@5.2.1(transitive)
- Removedbuffer-from@1.1.2(transitive)
- Removedbuffer-xor@1.0.3(transitive)
- Removedbuiltin-status-codes@3.0.0(transitive)
- Removedcached-path-relative@1.1.0(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedcipher-base@1.0.4(transitive)
- Removedcombine-source-map@0.8.0(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcommoner@0.10.8(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconcat-stream@1.6.2(transitive)
- Removedconsole-browserify@1.2.0(transitive)
- Removedconstants-browserify@1.0.0(transitive)
- Removedconvert-source-map@1.1.3(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedcreate-ecdh@4.0.4(transitive)
- Removedcreate-hash@1.2.0(transitive)
- Removedcreate-hmac@1.1.7(transitive)
- Removedcrypto-browserify@3.12.1(transitive)
- Removeddash-ast@1.0.0(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removeddefined@1.0.1(transitive)
- Removeddeps-sort@2.0.1(transitive)
- Removeddes.js@1.1.0(transitive)
- Removeddetective@3.1.04.7.15.2.1(transitive)
- Removeddiffie-hellman@5.0.3(transitive)
- Removeddomain-browser@1.2.0(transitive)
- Removeddot-parts@1.0.1(transitive)
- Removedduplexer2@0.1.4(transitive)
- Removedelliptic@6.6.0(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedescodegen@1.1.0(transitive)
- Removedesprima@1.0.43.1.3(transitive)
- Removedesprima-fb@3001.1.0-dev-harmony-fb8001.1001.0-dev-harmony-fb(transitive)
- Removedestraverse@1.5.1(transitive)
- Removedesutils@1.0.0(transitive)
- Removedevents@3.3.0(transitive)
- Removedevp_bytestokey@1.0.3(transitive)
- Removedexposify@0.5.0(transitive)
- Removedfast-safe-stringify@2.1.1(transitive)
- Removedfind-parent-dir@0.3.1(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-assigned-identifiers@1.2.0(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedglob@5.0.157.2.3(transitive)
- Removedglobo@1.1.0(transitive)
- Removedgopd@1.0.1(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-require@1.2.2(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhash-base@3.0.4(transitive)
- Removedhash.js@1.1.7(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhmac-drbg@1.0.1(transitive)
- Removedhtmlescape@1.1.1(transitive)
- Removedhttps-browserify@1.0.0(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedieee754@1.2.1(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.32.0.4(transitive)
- Removedinline-source-map@0.6.3(transitive)
- Removedinsert-module-globals@7.2.1(transitive)
- Removedis-arguments@1.1.1(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedis-defined@1.0.0(transitive)
- Removedis-generator-function@1.0.10(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedisarray@0.0.11.0.0(transitive)
- Removedjsonparse@1.3.1(transitive)
- Removedjstransform@8.2.0(transitive)
- Removedlabeled-stream-splicer@2.0.2(transitive)
- Removedlodash.memoize@3.0.4(transitive)
- Removedmap-obj@1.0.1(transitive)
- Removedmd5.js@1.3.5(transitive)
- Removedmiller-rabin@4.0.1(transitive)
- Removedminimalistic-assert@1.0.1(transitive)
- Removedminimalistic-crypto-utils@1.0.1(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedmkdirp-classic@0.5.3(transitive)
- Removedmodule-deps@6.2.3(transitive)
- Removedmothership@0.3.0(transitive)
- Removedobject-inspect@1.13.2(transitive)
- Removedobject-keys@0.4.01.1.1(transitive)
- Removedobject.assign@4.1.5(transitive)
- Removedonce@1.4.0(transitive)
- Removedos-browserify@0.3.0(transitive)
- Removedpako@1.0.11(transitive)
- Removedparents@1.0.1(transitive)
- Removedparse-asn1@5.1.7(transitive)
- Removedpatch-text@1.0.2(transitive)
- Removedpath-browserify@1.0.1(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpath-platform@0.11.15(transitive)
- Removedpbkdf2@3.1.2(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedprivate@0.1.8(transitive)
- Removedprocess@0.11.10(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedpublic-encrypt@4.0.3(transitive)
- Removedpunycode@1.4.1(transitive)
- Removedq@1.5.1(transitive)
- Removedqs@6.13.0(transitive)
- Removedquerystring-es3@0.2.1(transitive)
- Removedrandombytes@2.1.0(transitive)
- Removedrandomfill@1.0.4(transitive)
- Removedreact-tools@0.12.2(transitive)
- Removedread-only-stream@2.0.0(transitive)
- Removedreadable-stream@1.0.341.1.142.3.83.6.2(transitive)
- Removedrecast@0.11.23(transitive)
- Removedrename-function-calls@0.1.1(transitive)
- Removedreplace-requires@1.0.4(transitive)
- Removedresolve@0.6.31.22.8(transitive)
- Removedripemd160@2.0.2(transitive)
- Removedsafe-buffer@5.1.25.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedsha.js@2.4.11(transitive)
- Removedshasum-object@1.0.0(transitive)
- Removedshell-quote@1.8.1(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedsimple-concat@1.0.1(transitive)
- Removedsource-map@0.1.310.1.430.5.7(transitive)
- Removedstream-browserify@3.0.0(transitive)
- Removedstream-combiner2@1.1.1(transitive)
- Removedstream-http@3.2.0(transitive)
- Removedstream-splicer@2.0.1(transitive)
- Removedstring_decoder@0.10.311.1.11.3.0(transitive)
- Removedsubarg@1.0.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedsyntax-error@1.4.0(transitive)
- Removedternary@1.0.0(transitive)
- Removedthrough@2.3.8(transitive)
- Removedthrough2@0.4.20.6.52.0.5(transitive)
- Removedtimers-browserify@1.4.2(transitive)
- Removedtransformify@0.1.2(transitive)
- Removedtty-browserify@0.0.1(transitive)
- Removedtypedarray@0.0.6(transitive)
- Removedumd@3.0.3(transitive)
- Removedundeclared-identifiers@1.1.3(transitive)
- Removedurl@0.11.4(transitive)
- Removedutil@0.10.40.12.5(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedvm-browserify@1.1.2(transitive)
- Removedwhich-typed-array@1.1.15(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedxtend@2.1.24.0.2(transitive)