Comparing version 2.2.7 to 2.2.8
@@ -6,2 +6,14 @@ # Change Log | ||
<a name="2.2.8"></a> | ||
## [2.2.8](https://gitlab.alibaba-inc.com/nuke/mask/compare/v2.2.7...v2.2.8) (2018-09-05) | ||
### Bug Fixes | ||
* env import should be {isWeb} ([93b1d93](https://gitlab.alibaba-inc.com/nuke/mask/commit/93b1d93)) | ||
<a name="2.2.7"></a> | ||
@@ -8,0 +20,0 @@ ## [2.2.7](https://gitlab.alibaba-inc.com/nuke/mask/compare/v2.2.6...v2.2.7) (2018-09-05) |
@@ -21,4 +21,2 @@ 'use strict'; | ||
var _nukeEnv2 = _interopRequireDefault(_nukeEnv); | ||
var _nukeTransition = require('nuke-transition'); | ||
@@ -42,6 +40,2 @@ | ||
var isWeb = _nukeEnv2.default.isWeb, | ||
isWeex = _nukeEnv2.default.isWeex, | ||
appInfo = _nukeEnv2.default.appInfo; | ||
var Mask = function (_Component) { | ||
@@ -81,3 +75,2 @@ _inherits(Mask, _Component); | ||
value: function componentDidMount() { | ||
if (this.state.visible) { | ||
@@ -177,3 +170,3 @@ if (this.props.animate) { | ||
// EmptyEvent consumes events in android, so it would not be bubbled to mask press. | ||
if (isWeb) { | ||
if (_nukeEnv.isWeb) { | ||
e.stopPropagation(); | ||
@@ -209,9 +202,5 @@ } | ||
_nukeView2.default, | ||
{ | ||
style: contentStyle, | ||
x: 'autowrap', | ||
onClick: function onClick(e) { | ||
{ style: contentStyle, x: 'autowrap', onClick: function onClick(e) { | ||
return _this4.emptyEvent(e); | ||
} | ||
}, | ||
} }, | ||
children | ||
@@ -238,5 +227,5 @@ ); | ||
if (isWeex) { | ||
if (_nukeEnv.isWeex) { | ||
var nativeAttrs = _extends({}, others, { | ||
style: [appInfo.platform === 'iOS' ? styles.maskNativeIOS : {}, style], | ||
style: [_nukeEnv.appInfo.platform === 'iOS' ? styles.maskNativeIOS : {}, style], | ||
onClick: function onClick(e) { | ||
@@ -243,0 +232,0 @@ return _this5.maskPress(e); |
{ | ||
"name": "nuke-mask", | ||
"version": "2.2.7", | ||
"version": "2.2.8", | ||
"description": "遮罩层", | ||
@@ -55,13 +55,13 @@ "main": "lib/index", | ||
"dependencies": { | ||
"nuke-dimensions": "^2.2.7", | ||
"nuke-env": "^2.2.7", | ||
"nuke-transition": "^2.2.7", | ||
"nuke-view": "^2.2.7" | ||
"nuke-dimensions": "^2.2.8", | ||
"nuke-env": "^2.2.8", | ||
"nuke-transition": "^2.2.8", | ||
"nuke-view": "^2.2.8" | ||
}, | ||
"devDependencies": { | ||
"nuke-button": "^2.2.7", | ||
"nuke-checkbox": "^2.2.7", | ||
"nuke-input": "^2.2.7", | ||
"nuke-page": "^2.2.7", | ||
"nuke-text": "^2.2.7" | ||
"nuke-button": "^2.2.8", | ||
"nuke-checkbox": "^2.2.8", | ||
"nuke-input": "^2.2.8", | ||
"nuke-page": "^2.2.8", | ||
"nuke-text": "^2.2.8" | ||
}, | ||
@@ -72,3 +72,3 @@ "publishConfig": { | ||
"license": "Apache", | ||
"gitHead": "d4dd1bf40c965f5534ec94f8dda8491f634e3cea" | ||
"gitHead": "6b866cdef26dd8f8795e8a5cab614b99348588aa" | ||
} |
@@ -6,8 +6,6 @@ 'use strict'; | ||
import View from 'nuke-view'; | ||
import Env from 'nuke-env'; | ||
import { isWeb, isWeex, appInfo } from 'nuke-env'; | ||
import Transition from 'nuke-transition'; | ||
import Dimensions from 'nuke-dimensions'; | ||
const { isWeb, isWeex, appInfo } = Env; | ||
class Mask extends Component { | ||
@@ -23,3 +21,3 @@ constructor(props) { | ||
visible, | ||
style: visible ? styles.transparent : styles.shown | ||
style: visible ? styles.transparent : styles.shown, | ||
}; | ||
@@ -38,3 +36,2 @@ } | ||
componentDidMount() { | ||
if (this.state.visible) { | ||
@@ -142,7 +139,3 @@ if (this.props.animate) { | ||
return ( | ||
<View | ||
style={contentStyle} | ||
x="autowrap" | ||
onClick={e => this.emptyEvent(e)} | ||
> | ||
<View style={contentStyle} x="autowrap" onClick={e => this.emptyEvent(e)}> | ||
{children} | ||
@@ -154,11 +147,3 @@ </View> | ||
const { visible } = this.state; | ||
const { | ||
content, | ||
children, | ||
style = {}, | ||
onVisibleChanged, | ||
onClick, | ||
noPress = false, | ||
...others | ||
} = this.props; | ||
const { content, children, style = {}, onVisibleChanged, onClick, noPress = false, ...others } = this.props; | ||
@@ -209,5 +194,3 @@ if (isWeex) { | ||
// To get fullscreen mask , we set screen height | ||
height: | ||
`${Math.round(Dimensions.get('screen').height / window.devicePixelRatio) | ||
}wx`, | ||
height: `${Math.round(Dimensions.get('screen').height / window.devicePixelRatio)}wx`, | ||
}, | ||
@@ -214,0 +197,0 @@ |
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
41183
557
Updatednuke-dimensions@^2.2.8
Updatednuke-env@^2.2.8
Updatednuke-transition@^2.2.8
Updatednuke-view@^2.2.8