react-outside-click-handler
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -19,2 +19,6 @@ Object.defineProperty(exports, "__esModule", { | ||
var _object = require('object.values'); | ||
var _object2 = _interopRequireDefault(_object); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -30,2 +34,3 @@ | ||
BLOCK: 'block', | ||
FLEX: 'flex', | ||
INLINE_BLOCK: 'inline-block' | ||
@@ -197,3 +202,3 @@ }; | ||
ref: this.setChildNodeRef, | ||
style: display === DISPLAY.INLINE_BLOCK ? { display: display } : undefined | ||
style: display !== DISPLAY.BLOCK && (0, _object2['default'])(DISPLAY).includes(display) ? { display: display } : undefined | ||
}, | ||
@@ -200,0 +205,0 @@ children |
# Change Log | ||
## v1.1.0 | ||
- Add `flex` as a display prop option ([#4](https://github.com/airbnb/react-outside-click-handler/pull/4)) | ||
## v1.0.0 | ||
- Initial commit |
@@ -14,5 +14,7 @@ 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; }; }(); | ||
import { addEventListener } from 'consolidated-events'; | ||
import objectValues from 'object.values'; | ||
var DISPLAY = { | ||
BLOCK: 'block', | ||
FLEX: 'flex', | ||
INLINE_BLOCK: 'inline-block' | ||
@@ -184,3 +186,3 @@ }; | ||
ref: this.setChildNodeRef, | ||
style: display === DISPLAY.INLINE_BLOCK ? { display: display } : undefined | ||
style: display !== DISPLAY.BLOCK && objectValues(DISPLAY).includes(display) ? { display: display } : undefined | ||
}, | ||
@@ -187,0 +189,0 @@ children |
{ | ||
"name": "react-outside-click-handler", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A React component for dealing with clicks outside its subtree", | ||
@@ -68,2 +68,3 @@ "main": "index.js", | ||
"consolidated-events": "^1.1.1", | ||
"object.values": "^1.0.4", | ||
"prop-types": "^15.6.1" | ||
@@ -70,0 +71,0 @@ }, |
@@ -47,4 +47,4 @@ # react-outside-click-handler | ||
### display: `PropTypes.oneOf(['block', 'inline-block'])` | ||
### display: `PropTypes.oneOf(['block', 'flex', 'inline-block'])` | ||
By default, the `OutsideClickHandler` renders a `display: block` `<div />` to wrap the subtree defined by `children`. If desired, the `display` can be set to `inline-block` instead. There is no way not to render a wrapping `<div />`. | ||
By default, the `OutsideClickHandler` renders a `display: block` `<div />` to wrap the subtree defined by `children`. If desired, the `display` can be set to `inline-block` or `flex` instead. There is no way not to render a wrapping `<div />`. |
@@ -6,5 +6,7 @@ import React from 'react'; | ||
import { addEventListener } from 'consolidated-events'; | ||
import objectValues from 'object.values'; | ||
const DISPLAY = { | ||
BLOCK: 'block', | ||
FLEX: 'flex', | ||
INLINE_BLOCK: 'inline-block', | ||
@@ -116,3 +118,7 @@ }; | ||
ref={this.setChildNodeRef} | ||
style={display === DISPLAY.INLINE_BLOCK ? { display } : undefined} | ||
style={ | ||
display !== DISPLAY.BLOCK && objectValues(DISPLAY).includes(display) | ||
? { display } | ||
: undefined | ||
} | ||
> | ||
@@ -119,0 +125,0 @@ {children} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
29258
539
1
6
+ Addedobject.values@^1.0.4
+ Addedes-to-primitive@1.3.0(transitive)
+ Addedis-finalizationregistry@1.1.0(transitive)
+ Addedobject.values@1.2.0(transitive)
+ Addedreflect.getprototypeof@1.0.7(transitive)
+ Addedtyped-array-length@1.0.7(transitive)
+ Addedwhich-builtin-type@1.2.0(transitive)
+ Addedwhich-typed-array@1.1.16(transitive)
- Removedes-to-primitive@1.2.1(transitive)
- Removedis-finalizationregistry@1.0.2(transitive)
- Removedreflect.getprototypeof@1.0.6(transitive)
- Removedtyped-array-length@1.0.6(transitive)
- Removedwhich-builtin-type@1.1.4(transitive)
- Removedwhich-typed-array@1.1.15(transitive)