react-overlays
Advanced tools
Comparing version 0.8.3 to 0.9.0
@@ -189,3 +189,3 @@ 'use strict'; | ||
Affix.prototype.componentWillReceiveProps = function componentWillReceiveProps() { | ||
Affix.prototype.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps() { | ||
this._needPositionUpdate = true; | ||
@@ -276,2 +276,3 @@ }; | ||
affixClassName: _propTypes2.default.string, | ||
/** | ||
@@ -293,7 +294,8 @@ * Style to apply when affixed | ||
/** | ||
* Callback fired when the right before the `affixStyle` and `affixStyle` props are rendered | ||
* Callback fired right before the `affixStyle` and `affixClassName` props are rendered | ||
*/ | ||
onAffix: _propTypes2.default.func, | ||
/** | ||
* Callback fired after the component `affixStyle` and `affixClassName` props have been rendered. | ||
* Callback fired after the component `affixStyle` and `affixClassName` props have been rendered | ||
*/ | ||
@@ -303,3 +305,3 @@ onAffixed: _propTypes2.default.func, | ||
/** | ||
* Callback fired when the right before the `topStyle` and `topClassName` props are rendered | ||
* Callback fired right before the `topStyle` and `topClassName` props are rendered | ||
*/ | ||
@@ -309,3 +311,3 @@ onAffixTop: _propTypes2.default.func, | ||
/** | ||
* Callback fired after the component `topStyle` and `topClassName` props have been rendered. | ||
* Callback fired after the component `topStyle` and `topClassName` props have been rendered | ||
*/ | ||
@@ -315,3 +317,3 @@ onAffixedTop: _propTypes2.default.func, | ||
/** | ||
* Callback fired when the right before the `bottomStyle` and `bottomClassName` props are rendered | ||
* Callback fired right before the `bottomStyle` and `bottomClassName` props are rendered | ||
*/ | ||
@@ -321,3 +323,3 @@ onAffixBottom: _propTypes2.default.func, | ||
/** | ||
* Callback fired after the component `bottomStyle` and `bottomClassName` props have been rendered. | ||
* Callback fired after the component `bottomStyle` and `bottomClassName` props have been rendered | ||
*/ | ||
@@ -324,0 +326,0 @@ onAffixedBottom: _propTypes2.default.func |
@@ -175,3 +175,3 @@ 'use strict'; | ||
AutoAffix.prototype.componentWillReceiveProps = function componentWillReceiveProps() { | ||
AutoAffix.prototype.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps() { | ||
this._needPositionUpdate = true; | ||
@@ -178,0 +178,0 @@ }; |
@@ -104,3 +104,3 @@ 'use strict'; | ||
Portal.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
Portal.prototype.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) { | ||
if (this._overlayTarget && nextProps.container !== this.props.container) { | ||
@@ -107,0 +107,0 @@ this._portalContainerNode.removeChild(this._overlayTarget); |
@@ -214,3 +214,3 @@ 'use strict'; | ||
Modal.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
Modal.prototype.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) { | ||
if (nextProps.show) { | ||
@@ -224,3 +224,3 @@ this.setState({ exited: false }); | ||
Modal.prototype.componentWillUpdate = function componentWillUpdate(nextProps) { | ||
Modal.prototype.UNSAFE_componentWillUpdate = function UNSAFE_componentWillUpdate(nextProps) { | ||
if (!this.props.show && nextProps.show) { | ||
@@ -227,0 +227,0 @@ this.checkForFocus(); |
@@ -67,3 +67,3 @@ 'use strict'; | ||
Overlay.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
Overlay.prototype.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) { | ||
if (nextProps.show) { | ||
@@ -138,3 +138,6 @@ this.setState({ exited: false }); | ||
_RootCloseWrapper2.default, | ||
{ onRootClose: props.onHide }, | ||
{ | ||
onRootClose: props.onHide, | ||
event: props.rootCloseEvent | ||
}, | ||
child | ||
@@ -167,2 +170,7 @@ ); | ||
/** | ||
* Specify event for toggling overlay | ||
*/ | ||
rootCloseEvent: _RootCloseWrapper2.default.propTypes.event, | ||
/** | ||
* A Callback fired by the Overlay when it wishes to be hidden. | ||
@@ -169,0 +177,0 @@ * |
@@ -5,2 +5,6 @@ 'use strict'; | ||
var _inDOM = require('dom-helpers/util/inDOM'); | ||
var _inDOM2 = _interopRequireDefault(_inDOM); | ||
var _propTypes = require('prop-types'); | ||
@@ -59,7 +63,3 @@ | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.setContainer = function () { | ||
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props; | ||
_this._portalContainerNode = (0, _getContainer2.default)(props.container, (0, _ownerDocument2.default)(_this).body); | ||
}, _this.getMountNode = function () { | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.getMountNode = function () { | ||
return _this._portalContainerNode; | ||
@@ -69,10 +69,34 @@ }, _temp), _possibleConstructorReturn(_this, _ret); | ||
Portal.prototype.componentWillMount = function componentWillMount() { | ||
if (!_inDOM2.default) { | ||
return; | ||
} | ||
var container = this.props.container; | ||
if (typeof container === 'function') { | ||
container = container(); | ||
} | ||
if (container && !_reactDom2.default.findDOMNode(container)) { | ||
// The container is a React component that has not yet been rendered. | ||
// Don't set the container node yet. | ||
return; | ||
} | ||
this.setContainer(container); | ||
}; | ||
Portal.prototype.componentDidMount = function componentDidMount() { | ||
this.setContainer(); | ||
this.forceUpdate(this.props.onRendered); | ||
if (!this._portalContainerNode) { | ||
this.setContainer(this.props.container); | ||
this.forceUpdate(this.props.onRendered); | ||
} else if (this.props.onRendered) { | ||
this.props.onRendered(); | ||
} | ||
}; | ||
Portal.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
Portal.prototype.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) { | ||
if (nextProps.container !== this.props.container) { | ||
this.setContainer(nextProps); | ||
this.setContainer(nextProps.container); | ||
} | ||
@@ -85,2 +109,6 @@ }; | ||
Portal.prototype.setContainer = function setContainer(container) { | ||
this._portalContainerNode = (0, _getContainer2.default)(container, (0, _ownerDocument2.default)(this).body); | ||
}; | ||
Portal.prototype.render = function render() { | ||
@@ -87,0 +115,0 @@ return this.props.children && this._portalContainerNode ? _reactDom2.default.createPortal(this.props.children, this._portalContainerNode) : null; |
@@ -99,3 +99,3 @@ 'use strict'; | ||
Position.prototype.componentWillReceiveProps = function componentWillReceiveProps() { | ||
Position.prototype.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps() { | ||
this._needsFlush = true; | ||
@@ -102,0 +102,0 @@ }; |
{ | ||
"name": "react-overlays", | ||
"version": "0.8.3", | ||
"version": "0.9.0", | ||
"description": "Utilities for creating robust overlay components", | ||
@@ -39,8 +39,8 @@ "author": "Jason Quense <monastic.panic@gmail.com>", | ||
"prop-types-extra": "^1.0.1", | ||
"react-transition-group": "^2.2.0", | ||
"react-transition-group": "^2.2.1", | ||
"warning": "^3.0.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^0.14.9 || >=15.3.0", | ||
"react-dom": "^0.14.9 || >=15.3.0" | ||
"react": ">=16.3.0", | ||
"react-dom": ">=16.3.0" | ||
}, | ||
@@ -81,5 +81,5 @@ "devDependencies": { | ||
"raw-loader": "^0.5.1", | ||
"react": "^16.0.0", | ||
"react": "^16.3.0", | ||
"react-bootstrap": "^0.31.3", | ||
"react-dom": "^16.0.0", | ||
"react-dom": "^16.3.0", | ||
"release-script": "^1.0.2", | ||
@@ -91,3 +91,2 @@ "rimraf": "^2.6.2", | ||
"style-loader": "^0.18.2", | ||
"teaspoon": "^6.6.0", | ||
"webpack": "^3.6.0", | ||
@@ -94,0 +93,0 @@ "webpack-dev-server": "^2.8.2" |
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
99264
44
1991