react-native-drawer-layout
Advanced tools
Comparing version 0.4.2 to 0.5.0
@@ -48,2 +48,3 @@ 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 _reactNative = require('react-native');var _reactNative2 = _interopRequireDefault(_reactNative); | ||
function DrawerLayout(props, context) {_classCallCheck(this, DrawerLayout);var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DrawerLayout).call(this, | ||
@@ -151,5 +152,7 @@ props, context)); | ||
e.stopPropagation(); | ||
this.closeDrawer();} }, { key: '_emitStateChanged', value: function _emitStateChanged( | ||
if (!this._isLockedClosed() && !this._isLockedOpen()) { | ||
this.closeDrawer();}} }, { key: '_emitStateChanged', value: function _emitStateChanged( | ||
newState) { | ||
@@ -201,2 +204,6 @@ if (this.props.onDrawerStateChanged) { | ||
if (this._isLockedClosed() || this._isLockedOpen()) { | ||
return false;} | ||
if (drawerPosition === 'left') { | ||
@@ -287,3 +294,3 @@ var overlayArea = DEVICE_WIDTH - (DEVICE_WIDTH - this.props.drawerWidth); | ||
{ | ||
this.closeDrawer();}}} }, { key: '_getOpenValueForX', value: function _getOpenValueForX( | ||
this.closeDrawer();}}} }, { key: '_isLockedClosed', value: function _isLockedClosed() | ||
@@ -293,2 +300,10 @@ | ||
{ | ||
return this.props.drawerLockMode === 'locked-closed' && !this.state.drawerShown;} }, { key: '_isLockedOpen', value: function _isLockedOpen() | ||
{ | ||
return this.props.drawerLockMode === 'locked-open' && this.state.drawerShown;} }, { key: '_getOpenValueForX', value: function _getOpenValueForX( | ||
x) {var _props2 = | ||
@@ -300,3 +315,3 @@ this.props;var drawerPosition = _props2.drawerPosition;var drawerWidth = _props2.drawerWidth; | ||
if (drawerPosition === 'right') { | ||
return (DEVICE_WIDTH - x) / drawerWidth;}} }]);return DrawerLayout;}(_reactNative2.default.Component), _class2.defaultProps = { drawerWidth: 0, drawerPosition: 'left' }, _class2.positions = { Left: 'left', Right: 'right' }, _class2.propTypes = { children: _reactNative2.default.PropTypes.node, drawerPosition: PropTypes.oneOf(['left', 'right']).isRequired, drawerWidth: PropTypes.number.isRequired, keyboardDismissMode: PropTypes.oneOf(['none', 'on-drag']), onDrawerClose: PropTypes.func, onDrawerOpen: PropTypes.func, onDrawerSlide: PropTypes.func, onDrawerStateChanged: PropTypes.func, renderNavigationView: PropTypes.func.isRequired }, _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; | ||
return (DEVICE_WIDTH - x) / drawerWidth;}} }]);return DrawerLayout;}(_reactNative2.default.Component), _class2.defaultProps = { drawerWidth: 0, drawerPosition: 'left' }, _class2.positions = { Left: 'left', Right: 'right' }, _class2.propTypes = { children: _reactNative2.default.PropTypes.node, drawerLockMode: PropTypes.oneOf(['unlocked', 'locked-closed', 'locked-open']), drawerPosition: PropTypes.oneOf(['left', 'right']).isRequired, drawerWidth: PropTypes.number.isRequired, keyboardDismissMode: PropTypes.oneOf(['none', 'on-drag']), onDrawerClose: PropTypes.func, onDrawerOpen: PropTypes.func, onDrawerSlide: PropTypes.func, onDrawerStateChanged: PropTypes.func, renderNavigationView: PropTypes.func.isRequired }, _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; | ||
@@ -303,0 +318,0 @@ |
{ | ||
"name": "react-native-drawer-layout", | ||
"version": "0.4.2", | ||
"version": "0.5.0", | ||
"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.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
19869
214