react-native-drawer-layout
Advanced tools
Comparing version 1.1.5-0 to 1.1.5-1
@@ -1,5 +0,4 @@ | ||
Object.defineProperty(exports, "__esModule", { value: true });exports.default = undefined;var _extends = Object.assign || function (target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i];for (var key in source) {if (Object.prototype.hasOwnProperty.call(source, key)) {target[key] = source[key];}}}return target;};var _createClass = function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();var _desc, _value, _class, _class2, _temp;var _react = require('react');var _react2 = _interopRequireDefault(_react); | ||
var _autobindDecorator = require('autobind-decorator');var _autobindDecorator2 = _interopRequireDefault(_autobindDecorator); | ||
Object.defineProperty(exports, "__esModule", { value: true });exports.default = undefined;var _extends = Object.assign || function (target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i];for (var key in source) {if (Object.prototype.hasOwnProperty.call(source, key)) {target[key] = source[key];}}}return target;};var _createClass = function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();var _class, _temp;var _react = require('react');var _react2 = _interopRequireDefault(_react); | ||
var _reactNativeDismissKeyboard = require('react-native-dismiss-keyboard');var _reactNativeDismissKeyboard2 = _interopRequireDefault(_reactNativeDismissKeyboard); | ||
var _reactNative = require('react-native');function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self, call) {if (!self) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call && (typeof call === "object" || typeof call === "function") ? call : self;}function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;}function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {var desc = {};Object['ke' + 'ys'](descriptor).forEach(function (key) {desc[key] = descriptor[key];});desc.enumerable = !!desc.enumerable;desc.configurable = !!desc.configurable;if ('value' in desc || desc.initializer) {desc.writable = true;}desc = decorators.slice().reverse().reduce(function (desc, decorator) {return decorator(target, property, desc) || desc;}, desc);if (context && desc.initializer !== void 0) {desc.value = desc.initializer ? desc.initializer.call(context) : void 0;desc.initializer = undefined;}if (desc.initializer === void 0) {Object['define' + 'Property'](target, property, desc);desc = null;}return desc;} | ||
var _reactNative = require('react-native');function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self, call) {if (!self) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call && (typeof call === "object" || typeof call === "function") ? call : self;}function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;} | ||
@@ -13,3 +12,2 @@ | ||
var DEVICE_WIDTH = parseFloat(_reactNative.Dimensions.get('window').width); | ||
@@ -23,3 +21,3 @@ var THRESHOLD = DEVICE_WIDTH / 2; | ||
DrawerLayout = (_class = (_temp = _class2 = function (_Component) {_inherits(DrawerLayout, _Component); | ||
DrawerLayout = (_temp = _class = function (_Component) {_inherits(DrawerLayout, _Component); | ||
@@ -54,56 +52,20 @@ | ||
function DrawerLayout(props, context) {_classCallCheck(this, DrawerLayout);var _this = _possibleConstructorReturn(this, (DrawerLayout.__proto__ || Object.getPrototypeOf(DrawerLayout)).call(this, | ||
props, context)); | ||
props, context));_this. | ||
_this.interactionHandle = null; | ||
_this.state = { | ||
openValue: new _reactNative.Animated.Value(0), | ||
drawerShown: false };return _this; | ||
}_createClass(DrawerLayout, [{ key: 'componentWillMount', value: function componentWillMount() | ||
{var _this2 = this;var | ||
openValue = this.state.openValue; | ||
openValue.addListener(function (_ref) {var value = _ref.value; | ||
var drawerShown = value > 0; | ||
if (drawerShown !== _this2.state.drawerShown) { | ||
_this2.setState({ drawerShown: drawerShown }); | ||
} | ||
if (_this2.props.keyboardDismissMode === 'on-drag') { | ||
(0, _reactNativeDismissKeyboard2.default)(); | ||
} | ||
if (value === 0 || value === 1) { | ||
if (_this2.interactionHandle) { | ||
_reactNative.InteractionManager.clearInteractionHandle(_this2.interactionHandle); | ||
_this2.interactionHandle = undefined; | ||
} | ||
} else if (!_this2.interactionHandle) { | ||
_this2.interactionHandle = _reactNative.InteractionManager.createInteractionHandle(); | ||
} | ||
_this2._lastOpenValue = value; | ||
if (_this2.props.onDrawerSlide) { | ||
_this2.props.onDrawerSlide({ nativeEvent: { offset: value } }); | ||
} | ||
}); | ||
this._panResponder = _reactNative.PanResponder.create({ | ||
onMoveShouldSetPanResponder: this._shouldSetPanResponder, | ||
onPanResponderGrant: this._panResponderGrant, | ||
onPanResponderMove: this._panResponderMove, | ||
onPanResponderTerminationRequest: function onPanResponderTerminationRequest() {return false;}, | ||
onPanResponderRelease: this._panResponderRelease, | ||
onPanResponderTerminate: function onPanResponderTerminate() {} }); | ||
} }, { key: 'render', value: function render() | ||
{var _state = | ||
this.state,drawerShown = _state.drawerShown,openValue = _state.openValue;var _props = | ||
@@ -114,119 +76,151 @@ | ||
this.props,drawerBackgroundColor = _props.drawerBackgroundColor,drawerPosition = _props.drawerPosition,drawerWidth = _props.drawerWidth; | ||
var dynamicDrawerStyles = { | ||
backgroundColor: drawerBackgroundColor }; | ||
dynamicDrawerStyles[drawerPosition] = 0; | ||
dynamicDrawerStyles.width = drawerWidth; | ||
var outputRange = void 0; | ||
if (drawerPosition === 'left') { | ||
outputRange = [-drawerWidth, 0]; | ||
} else { | ||
outputRange = [drawerWidth, 0]; | ||
} | ||
var drawerTranslateX = openValue.interpolate({ | ||
inputRange: [0, 1], | ||
outputRange: outputRange, | ||
extrapolate: 'clamp' }); | ||
var animatedDrawerStyles = { | ||
transform: [{ translateX: drawerTranslateX }] }; | ||
var overlayOpacity = openValue.interpolate({ | ||
inputRange: [0, 1], | ||
outputRange: [0, 0.7], | ||
extrapolate: 'clamp' }); | ||
var animatedOverlayStyles = { opacity: overlayOpacity }; | ||
return ( | ||
_react2.default.createElement(_reactNative.View, _extends({ | ||
style: { flex: 1, backgroundColor: 'transparent' } }, | ||
this._panResponder.panHandlers), | ||
_react2.default.createElement(_reactNative.Animated.View, { style: styles.main }, | ||
this.props.children), | ||
drawerShown && | ||
_react2.default.createElement(_reactNative.TouchableWithoutFeedback, { onPress: this._onOverlayClick }, | ||
_react2.default.createElement(_reactNative.Animated.View, { style: [styles.overlay, animatedOverlayStyles] })), | ||
_react2.default.createElement(_reactNative.Animated.View, { | ||
style: [styles.drawer, dynamicDrawerStyles, animatedDrawerStyles] }, | ||
this.props.renderNavigationView()))); | ||
} }, { key: '_onOverlayClick', value: function _onOverlayClick( | ||
e) { | ||
_onOverlayClick = function (e) { | ||
e.stopPropagation(); | ||
if (!this._isLockedClosed() && !this._isLockedOpen()) { | ||
this.closeDrawer(); | ||
if (!_this._isLockedClosed() && !_this._isLockedOpen()) { | ||
_this.closeDrawer(); | ||
} | ||
} }, { key: '_emitStateChanged', value: function _emitStateChanged( | ||
};_this. | ||
newState) { | ||
if (this.props.onDrawerStateChanged) { | ||
this.props.onDrawerStateChanged(newState); | ||
_emitStateChanged = function (newState) { | ||
if (_this.props.onDrawerStateChanged) { | ||
_this.props.onDrawerStateChanged(newState); | ||
} | ||
} }, { key: 'openDrawer', value: function openDrawer() | ||
};_this. | ||
{var _this3 = this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
this._emitStateChanged(SETTLING); | ||
_reactNative.Animated.spring(this.state.openValue, _extends({ | ||
openDrawer = function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
_this._emitStateChanged(SETTLING); | ||
_reactNative.Animated.spring(_this.state.openValue, _extends({ | ||
toValue: 1, | ||
bounciness: 0, | ||
restSpeedThreshold: 0.1 }, | ||
restSpeedThreshold: 0.1, | ||
useNativeDriver: _this.props.useNativeAnimations }, | ||
options)). | ||
start(function () { | ||
if (_this3.props.onDrawerOpen) { | ||
_this3.props.onDrawerOpen(); | ||
if (_this.props.onDrawerOpen) { | ||
_this.props.onDrawerOpen(); | ||
} | ||
_this3._emitStateChanged(IDLE); | ||
_this._emitStateChanged(IDLE); | ||
}); | ||
} }, { key: 'closeDrawer', value: function closeDrawer() | ||
};_this. | ||
{var _this4 = this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
this._emitStateChanged(SETTLING); | ||
_reactNative.Animated.spring(this.state.openValue, _extends({ | ||
closeDrawer = function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
_this._emitStateChanged(SETTLING); | ||
_reactNative.Animated.spring(_this.state.openValue, _extends({ | ||
toValue: 0, | ||
bounciness: 0, | ||
restSpeedThreshold: 1 }, | ||
restSpeedThreshold: 1, | ||
useNativeDriver: _this.props.useNativeAnimations }, | ||
options)). | ||
start(function () { | ||
if (_this4.props.onDrawerClose) { | ||
_this4.props.onDrawerClose(); | ||
if (_this.props.onDrawerClose) { | ||
_this.props.onDrawerClose(); | ||
} | ||
_this4._emitStateChanged(IDLE); | ||
_this._emitStateChanged(IDLE); | ||
}); | ||
} }, { key: '_handleDrawerOpen', value: function _handleDrawerOpen() | ||
};_this. | ||
{ | ||
if (this.props.onDrawerOpen) { | ||
this.props.onDrawerOpen(); | ||
_handleDrawerOpen = function () { | ||
if (_this.props.onDrawerOpen) { | ||
_this.props.onDrawerOpen(); | ||
} | ||
} }, { key: '_handleDrawerClose', value: function _handleDrawerClose() | ||
};_this. | ||
{ | ||
if (this.props.onDrawerClose) { | ||
this.props.onDrawerClose(); | ||
_handleDrawerClose = function () { | ||
if (_this.props.onDrawerClose) { | ||
_this.props.onDrawerClose(); | ||
} | ||
} }, { key: '_shouldSetPanResponder', value: function _shouldSetPanResponder( | ||
};_this. | ||
e, _ref2) {var moveX = _ref2.moveX,dx = _ref2.dx,dy = _ref2.dy;var | ||
drawerPosition = this.props.drawerPosition; | ||
_shouldSetPanResponder = function (e, _ref) {var moveX = _ref.moveX,dx = _ref.dx,dy = _ref.dy; | ||
if (!dx || !dy) { | ||
return false; | ||
}var | ||
if (this._isLockedClosed() || this._isLockedOpen()) { | ||
drawerPosition = _this.props.drawerPosition; | ||
if (_this._isLockedClosed() || _this._isLockedOpen()) { | ||
return false; | ||
@@ -237,10 +231,10 @@ } | ||
var overlayArea = DEVICE_WIDTH - ( | ||
DEVICE_WIDTH - this.props.drawerWidth); | ||
DEVICE_WIDTH - _this.props.drawerWidth); | ||
if (this._lastOpenValue === 1) { | ||
if (_this._lastOpenValue === 1) { | ||
if ( | ||
dx < 0 && Math.abs(dx) > Math.abs(dy) * 3 || moveX > overlayArea) | ||
{ | ||
this._isClosing = true; | ||
this._closingAnchorValue = this._getOpenValueForX(moveX); | ||
_this._isClosing = true; | ||
_this._closingAnchorValue = _this._getOpenValueForX(moveX); | ||
return true; | ||
@@ -250,3 +244,3 @@ } | ||
if (moveX <= 35 && dx > 0) { | ||
this._isClosing = false; | ||
_this._isClosing = false; | ||
return true; | ||
@@ -258,10 +252,10 @@ } | ||
} else { | ||
var _overlayArea = DEVICE_WIDTH - this.props.drawerWidth; | ||
var _overlayArea = DEVICE_WIDTH - _this.props.drawerWidth; | ||
if (this._lastOpenValue === 1) { | ||
if (_this._lastOpenValue === 1) { | ||
if ( | ||
dx > 0 && Math.abs(dx) > Math.abs(dy) * 3 || moveX < _overlayArea) | ||
{ | ||
this._isClosing = true; | ||
this._closingAnchorValue = this._getOpenValueForX(moveX); | ||
_this._isClosing = true; | ||
_this._closingAnchorValue = _this._getOpenValueForX(moveX); | ||
return true; | ||
@@ -271,3 +265,3 @@ } | ||
if (moveX >= DEVICE_WIDTH - 35 && dx < 0) { | ||
this._isClosing = false; | ||
_this._isClosing = false; | ||
return true; | ||
@@ -279,13 +273,13 @@ } | ||
} | ||
} }, { key: '_panResponderGrant', value: function _panResponderGrant() | ||
};_this. | ||
{ | ||
this._emitStateChanged(DRAGGING); | ||
} }, { key: '_panResponderMove', value: function _panResponderMove( | ||
_panResponderGrant = function () { | ||
_this._emitStateChanged(DRAGGING); | ||
};_this. | ||
e, _ref3) {var moveX = _ref3.moveX; | ||
var openValue = this._getOpenValueForX(moveX); | ||
_panResponderMove = function (e, _ref2) {var moveX = _ref2.moveX; | ||
var openValue = _this._getOpenValueForX(moveX); | ||
if (this._isClosing) { | ||
openValue = 1 - (this._closingAnchorValue - openValue); | ||
if (_this._isClosing) { | ||
openValue = 1 - (_this._closingAnchorValue - openValue); | ||
} | ||
@@ -299,8 +293,8 @@ | ||
this.state.openValue.setValue(openValue); | ||
} }, { key: '_panResponderRelease', value: function _panResponderRelease( | ||
_this.state.openValue.setValue(openValue); | ||
};_this. | ||
e, _ref4) {var moveX = _ref4.moveX,vx = _ref4.vx;var | ||
drawerPosition = this.props.drawerPosition; | ||
var previouslyOpen = this._isClosing; | ||
_panResponderRelease = function (e, _ref3) {var moveX = _ref3.moveX,vx = _ref3.vx;var | ||
drawerPosition = _this.props.drawerPosition; | ||
var previouslyOpen = _this._isClosing; | ||
var isWithinVelocityThreshold = vx < VX_MAX && vx > -VX_MAX; | ||
@@ -314,3 +308,3 @@ | ||
{ | ||
this.openDrawer({ velocity: vx }); | ||
_this.openDrawer({ velocity: vx }); | ||
} else if ( | ||
@@ -321,7 +315,7 @@ vx < 0 && moveX < THRESHOLD || | ||
{ | ||
this.closeDrawer({ velocity: vx }); | ||
_this.closeDrawer({ velocity: vx }); | ||
} else if (previouslyOpen) { | ||
this.openDrawer(); | ||
_this.openDrawer(); | ||
} else { | ||
this.closeDrawer(); | ||
_this.closeDrawer(); | ||
} | ||
@@ -336,3 +330,3 @@ } | ||
{ | ||
this.openDrawer({ velocity: -1 * vx }); | ||
_this.openDrawer({ velocity: -1 * vx }); | ||
} else if ( | ||
@@ -343,23 +337,23 @@ vx > 0 && moveX > THRESHOLD || | ||
{ | ||
this.closeDrawer({ velocity: -1 * vx }); | ||
_this.closeDrawer({ velocity: -1 * vx }); | ||
} else if (previouslyOpen) { | ||
this.openDrawer(); | ||
_this.openDrawer(); | ||
} else { | ||
this.closeDrawer(); | ||
_this.closeDrawer(); | ||
} | ||
} | ||
} }, { key: '_isLockedClosed', value: function _isLockedClosed() | ||
};_this. | ||
{ | ||
return this.props.drawerLockMode === 'locked-closed' && | ||
!this.state.drawerShown; | ||
} }, { key: '_isLockedOpen', value: function _isLockedOpen() | ||
_isLockedClosed = function () { | ||
return _this.props.drawerLockMode === 'locked-closed' && | ||
!_this.state.drawerShown; | ||
};_this. | ||
{ | ||
return this.props.drawerLockMode === 'locked-open' && | ||
this.state.drawerShown; | ||
} }, { key: '_getOpenValueForX', value: function _getOpenValueForX( | ||
_isLockedOpen = function () { | ||
return _this.props.drawerLockMode === 'locked-open' && | ||
_this.state.drawerShown; | ||
};_this. | ||
x) {var _props2 = | ||
this.props,drawerPosition = _props2.drawerPosition,drawerWidth = _props2.drawerWidth; | ||
_getOpenValueForX = function (x) {var _this$props = | ||
_this.props,drawerPosition = _this$props.drawerPosition,drawerWidth = _this$props.drawerWidth; | ||
@@ -371,3 +365,3 @@ if (drawerPosition === 'left') { | ||
} | ||
} }]);return DrawerLayout;}(_react.Component), _class2.defaultProps = { drawerWidth: 0, drawerPosition: 'left' }, _class2.positions = { Left: 'left', Right: 'right' }, _class2.propTypes = { children: _react.PropTypes.node, drawerBackgroundColor: _react.PropTypes.string, drawerLockMode: _react.PropTypes.oneOf(['unlocked', 'locked-closed', 'locked-open']), drawerPosition: _react.PropTypes.oneOf(['left', 'right']).isRequired, drawerWidth: _react.PropTypes.number.isRequired, keyboardDismissMode: _react.PropTypes.oneOf(['none', 'on-drag']), onDrawerClose: _react.PropTypes.func, onDrawerOpen: _react.PropTypes.func, onDrawerSlide: _react.PropTypes.func, onDrawerStateChanged: _react.PropTypes.func, renderNavigationView: _react.PropTypes.func.isRequired, statusBarBackgroundColor: _react.PropTypes.string }, _temp), (_applyDecoratedDescriptor(_class.prototype, '_onOverlayClick', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, '_onOverlayClick'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'openDrawer', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'openDrawer'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'closeDrawer', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'closeDrawer'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, '_handleDrawerOpen', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, '_handleDrawerOpen'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, '_handleDrawerClose', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, '_handleDrawerClose'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, '_shouldSetPanResponder', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, '_shouldSetPanResponder'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, '_panResponderGrant', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, '_panResponderGrant'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, '_panResponderMove', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, '_panResponderMove'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, '_panResponderRelease', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, '_panResponderRelease'), _class.prototype)), _class);exports.default = DrawerLayout; | ||
};_this.state = { openValue: new _reactNative.Animated.Value(0), drawerShown: false };return _this;}_createClass(DrawerLayout, [{ key: 'componentWillMount', value: function componentWillMount() {var _this2 = this;var openValue = this.state.openValue;openValue.addListener(function (_ref4) {var value = _ref4.value;var drawerShown = value > 0;if (drawerShown !== _this2.state.drawerShown) {_this2.setState({ drawerShown: drawerShown });}if (_this2.props.keyboardDismissMode === 'on-drag') {(0, _reactNativeDismissKeyboard2.default)();}_this2._lastOpenValue = value;if (_this2.props.onDrawerSlide) {_this2.props.onDrawerSlide({ nativeEvent: { offset: value } });}});this._panResponder = _reactNative.PanResponder.create({ onMoveShouldSetPanResponder: this._shouldSetPanResponder, onPanResponderGrant: this._panResponderGrant, onPanResponderMove: this._panResponderMove, onPanResponderTerminationRequest: function onPanResponderTerminationRequest() {return false;}, onPanResponderRelease: this._panResponderRelease, onPanResponderTerminate: function onPanResponderTerminate() {} });} }, { key: 'render', value: function render() {var _state = this.state,drawerShown = _state.drawerShown,openValue = _state.openValue;var _props = this.props,drawerBackgroundColor = _props.drawerBackgroundColor,drawerPosition = _props.drawerPosition,drawerWidth = _props.drawerWidth;var dynamicDrawerStyles = { backgroundColor: drawerBackgroundColor };dynamicDrawerStyles[drawerPosition] = 0;dynamicDrawerStyles.width = drawerWidth;var outputRange = void 0;if (drawerPosition === 'left') {outputRange = [-drawerWidth, 0];} else {outputRange = [drawerWidth, 0];}var drawerTranslateX = openValue.interpolate({ inputRange: [0, 1], outputRange: outputRange, extrapolate: 'clamp' });var animatedDrawerStyles = { transform: [{ translateX: drawerTranslateX }] };var overlayOpacity = openValue.interpolate({ inputRange: [0, 1], outputRange: [0, 0.7], extrapolate: 'clamp' });var animatedOverlayStyles = { opacity: overlayOpacity };var pointerEvents = drawerShown ? 'auto' : 'none';return _react2.default.createElement(_reactNative.View, _extends({ style: { flex: 1, backgroundColor: 'transparent' } }, this._panResponder.panHandlers), _react2.default.createElement(_reactNative.Animated.View, { style: styles.main }, this.props.children), _react2.default.createElement(_reactNative.TouchableWithoutFeedback, { pointerEvents: pointerEvents, onPress: this._onOverlayClick }, _react2.default.createElement(_reactNative.Animated.View, { pointerEvents: pointerEvents, style: [styles.overlay, animatedOverlayStyles] })), _react2.default.createElement(_reactNative.Animated.View, { style: [styles.drawer, dynamicDrawerStyles, animatedDrawerStyles] }, this.props.renderNavigationView()));} }]);return DrawerLayout;}(_react.Component), _class.defaultProps = { drawerWidth: 0, drawerPosition: 'left', useNativeAnimations: false }, _class.positions = { Left: 'left', Right: 'right' }, _class.propTypes = { children: _react.PropTypes.node, drawerBackgroundColor: _react.PropTypes.string, drawerLockMode: _react.PropTypes.oneOf(['unlocked', 'locked-closed', 'locked-open']), drawerPosition: _react.PropTypes.oneOf(['left', 'right']).isRequired, drawerWidth: _react.PropTypes.number.isRequired, keyboardDismissMode: _react.PropTypes.oneOf(['none', 'on-drag']), onDrawerClose: _react.PropTypes.func, onDrawerOpen: _react.PropTypes.func, onDrawerSlide: _react.PropTypes.func, onDrawerStateChanged: _react.PropTypes.func, renderNavigationView: _react.PropTypes.func.isRequired, statusBarBackgroundColor: _react.PropTypes.string, useNativeAnimations: _react.PropTypes.bool }, _temp);exports.default = DrawerLayout; | ||
@@ -374,0 +368,0 @@ |
{ | ||
"name": "react-native-drawer-layout", | ||
"version": "1.1.5-0", | ||
"version": "1.1.5-1", | ||
"description": "A platform-agnostic drawer layout. Pure JavaScript implementation on iOS and native implementation on Android. Why? Because the drawer layout is a useful component regardless of the platform! And if you can use it without changing any code, that's perfect.", | ||
@@ -92,3 +92,2 @@ "main": "dist/DrawerLayout.js", | ||
"dependencies": { | ||
"autobind-decorator": "^1.3.2", | ||
"react-native-dismiss-keyboard": "1.0.0" | ||
@@ -95,0 +94,0 @@ }, |
@@ -29,4 +29,3 @@ ## react-native-drawer-layout [![CircleCI](https://circleci.com/gh/react-native-community/react-native-drawer-layout/tree/master.svg?style=svg)](https://circleci.com/gh/react-native-community/react-native-drawer-layout/tree/master) | ||
| React Native Version | react-nativ | ||
e-dismiss-keyboard Version | | ||
| React Native Version | react-native-drawer-layout Version | | ||
|---------------------------|---------------------------------------| | ||
@@ -33,0 +32,0 @@ | >= 11 & < 23 | < 1.0 | |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1
18367
216
57
1
- Removedautobind-decorator@^1.3.2
- Removedautobind-decorator@1.4.3(transitive)