react-onclickoutside
Advanced tools
Comparing version 6.13.0 to 6.13.1
@@ -214,2 +214,3 @@ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var react=require('react'),reactDom=require('react-dom');function _inheritsLoose(subClass, superClass) { | ||
if (_this.componentNode === null) return; | ||
if (_this.initTimeStamp > event.timeStamp) return; | ||
@@ -262,2 +263,3 @@ if (_this.props.preventDefault) { | ||
_this._uid = uid(); | ||
_this.initTimeStamp = performance.now(); | ||
return _this; | ||
@@ -264,0 +266,0 @@ } |
@@ -214,2 +214,3 @@ import {createElement,Component}from'react';import {findDOMNode}from'react-dom';function _inheritsLoose(subClass, superClass) { | ||
if (_this.componentNode === null) return; | ||
if (_this.initTimeStamp > event.timeStamp) return; | ||
@@ -262,2 +263,3 @@ if (_this.props.preventDefault) { | ||
_this._uid = uid(); | ||
_this.initTimeStamp = performance.now(); | ||
return _this; | ||
@@ -264,0 +266,0 @@ } |
@@ -214,2 +214,3 @@ (function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports,require('react'),require('react-dom')):typeof define==='function'&&define.amd?define(['exports','react','react-dom'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(g.onClickOutside={},g.React,g.ReactDOM));}(this,(function(exports, react, reactDom){'use strict';function _inheritsLoose(subClass, superClass) { | ||
if (_this.componentNode === null) return; | ||
if (_this.initTimeStamp > event.timeStamp) return; | ||
@@ -262,2 +263,3 @@ if (_this.props.preventDefault) { | ||
_this._uid = uid(); | ||
_this.initTimeStamp = performance.now(); | ||
return _this; | ||
@@ -264,0 +266,0 @@ } |
@@ -214,2 +214,3 @@ (function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports,require('react'),require('react-dom')):typeof define==='function'&&define.amd?define(['exports','react','react-dom'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(g.onClickOutside={},g.React,g.ReactDOM));}(this,(function(exports, react, reactDom){'use strict';function _inheritsLoose(subClass, superClass) { | ||
if (_this.componentNode === null) return; | ||
if (_this.initTimeStamp > event.timeStamp) return; | ||
@@ -262,2 +263,3 @@ if (_this.props.preventDefault) { | ||
_this._uid = uid(); | ||
_this.initTimeStamp = performance.now(); | ||
return _this; | ||
@@ -264,0 +266,0 @@ } |
{ | ||
"name": "react-onclickoutside", | ||
"version": "6.13.0", | ||
"version": "6.13.1", | ||
"description": "An onClickOutside wrapper for React components", | ||
@@ -36,16 +36,14 @@ "main": "dist/react-onclickoutside.cjs.js", | ||
"scripts": { | ||
"clean": "rimraf dist", | ||
"prebuild": "npm run clean", | ||
"build": "rollup -c rollup.config.js --compact", | ||
"lint": "eslint src/*.js ./test", | ||
"release:patch": "npm run prerelease && npm version patch && npm publish && git push --follow-tags", | ||
"release:minor": "npm run prerelease && npm version minor && npm publish && git push --follow-tags", | ||
"release:major": "npm run prerelease && npm version major && npm publish && git push --follow-tags", | ||
"prerelease": "npm run test", | ||
"test": "run-s test:**", | ||
"test:basic": "run-s lint build", | ||
"test:karma": "karma start test/karma.conf.js --single-run", | ||
"test:nodom": "mocha test/no-dom-test.js", | ||
"precommit": "npm test && lint-staged", | ||
"prepare": "npm run build", | ||
"prerelease": "npm run test", | ||
"release:patch": "npm run prerelease && npm version patch && npm publish && git push --follow-tags", | ||
"release:minor": "npm run prerelease && npm version minor && npm publish && git push --follow-tags", | ||
"release:major": "npm run prerelease && npm version major && npm publish && git push --follow-tags" | ||
"lint": "eslint src/*.js ./test", | ||
"build": "rollup -c rollup.config.js --compact", | ||
"prebuild": "npm run clean", | ||
"clean": "rimraf dist", | ||
"precommit": "npm test && lint-staged" | ||
}, | ||
@@ -64,8 +62,2 @@ "devDependencies": { | ||
"husky": "^0.14.3", | ||
"karma": "^6.3.2", | ||
"karma-chai": "^0.1.0", | ||
"karma-firefox-launcher": "^2.1.0", | ||
"karma-mocha": "^2.0.1", | ||
"karma-spec-reporter": "0.0.31", | ||
"karma-webpack": "^5.0.0", | ||
"lint-staged": "^5.0.0", | ||
@@ -72,0 +64,0 @@ "mocha": "^8.4.0", |
@@ -36,4 +36,4 @@ [![npm version](https://img.shields.io/npm/v/react-onclickoutside.svg)](https://www.npmjs.com/package/react-onclickoutside) | ||
* [Usage:](#usage) | ||
* [Functional Component with UseState Hook](#functional-component-with-usestate-hook) | ||
* [ES6 Class Component](#es6-class-component) | ||
* [Functional Component with UseState Hook](#functional-component-with-usestate-hook) | ||
* [CommonJS Require](#commonjs-require) | ||
@@ -67,17 +67,2 @@ * [Ensuring there's a click handler](#ensuring-there-is-a-click-handler) | ||
### ES6 Class Component | ||
```js | ||
import React, { Component } from "react"; | ||
import onClickOutside from "react-onclickoutside"; | ||
class MyComponent extends Component { | ||
handleClickOutside = evt => { | ||
// ..handling code goes here... | ||
}; | ||
} | ||
export default onClickOutside(MyComponent); | ||
``` | ||
### Functional Component with UseState Hook | ||
@@ -135,3 +120,17 @@ | ||
### ES6 Class Component | ||
```js | ||
import React, { Component } from "react"; | ||
import onClickOutside from "react-onclickoutside"; | ||
class MyComponent extends Component { | ||
handleClickOutside = evt => { | ||
// ..handling code goes here... | ||
}; | ||
} | ||
export default onClickOutside(MyComponent); | ||
``` | ||
### CommonJS Require | ||
@@ -138,0 +137,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
65441
22
1130
432