react-resize-detector
Advanced tools
Comparing version 4.1.2 to 4.1.3
@@ -58,6 +58,2 @@ "use strict"; | ||
_defineProperty(_assertThisInitialized(_this), "isDOMElement", function (element) { | ||
return element instanceof Element || element instanceof HTMLDocument; | ||
}); | ||
_defineProperty(_assertThisInitialized(_this), "cancelHandler", function () { | ||
@@ -94,3 +90,3 @@ if (_this.resizeHandler && _this.resizeHandler.cancel) { | ||
if (querySelector) return document.querySelector(querySelector); | ||
if (targetDomEl && _this.isDOMElement(targetDomEl)) return targetDomEl; // eslint-disable-next-line react/no-find-dom-node | ||
if (targetDomEl && (0, _utils.isDOMElement)(targetDomEl)) return targetDomEl; // eslint-disable-next-line react/no-find-dom-node | ||
@@ -273,3 +269,4 @@ var currentElement = _this.element && (0, _reactDom.findDOMNode)(_this.element); | ||
querySelector: _propTypes.string, | ||
targetDomEl: (0, _propTypes.oneOfType)([(0, _propTypes.instanceOf)(Element), (0, _propTypes.instanceOf)(HTMLDocument)]), | ||
targetDomEl: _propTypes.any, | ||
// eslint-disable-line react/forbid-prop-types | ||
onResize: _propTypes.func, | ||
@@ -276,0 +273,0 @@ render: _propTypes.func, |
@@ -25,4 +25,4 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
import rafSchd from 'raf-schd'; | ||
import { bool, number, string, shape, func, any, node, instanceOf, oneOfType } from 'prop-types'; | ||
import { getHandle, isFunction, isSSR } from "../lib/utils"; | ||
import { bool, number, string, shape, func, any, node } from 'prop-types'; | ||
import { getHandle, isFunction, isSSR, isDOMElement } from "../lib/utils"; | ||
import ChildWrapper from "./ChildWrapper"; | ||
@@ -42,6 +42,2 @@ | ||
_defineProperty(_assertThisInitialized(_this), "isDOMElement", function (element) { | ||
return element instanceof Element || element instanceof HTMLDocument; | ||
}); | ||
_defineProperty(_assertThisInitialized(_this), "cancelHandler", function () { | ||
@@ -78,3 +74,3 @@ if (_this.resizeHandler && _this.resizeHandler.cancel) { | ||
if (querySelector) return document.querySelector(querySelector); | ||
if (targetDomEl && _this.isDOMElement(targetDomEl)) return targetDomEl; // eslint-disable-next-line react/no-find-dom-node | ||
if (targetDomEl && isDOMElement(targetDomEl)) return targetDomEl; // eslint-disable-next-line react/no-find-dom-node | ||
@@ -257,3 +253,4 @@ var currentElement = _this.element && findDOMNode(_this.element); | ||
querySelector: string, | ||
targetDomEl: oneOfType([instanceOf(Element), instanceOf(HTMLDocument)]), | ||
targetDomEl: any, | ||
// eslint-disable-line react/forbid-prop-types | ||
onResize: func, | ||
@@ -260,0 +257,0 @@ render: func, |
@@ -15,2 +15,5 @@ import debounce from "lodash-es/debounce"; | ||
return typeof window === 'undefined'; | ||
}; | ||
export var isDOMElement = function isDOMElement(element) { | ||
return element instanceof Element || element instanceof HTMLDocument; | ||
}; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.isSSR = exports.isFunction = exports.getHandle = exports.listHandle = void 0; | ||
exports.isDOMElement = exports.isSSR = exports.isFunction = exports.getHandle = exports.listHandle = void 0; | ||
@@ -37,2 +37,8 @@ var _debounce = _interopRequireDefault(require("lodash/debounce")); | ||
exports.isSSR = isSSR; | ||
exports.isSSR = isSSR; | ||
var isDOMElement = function isDOMElement(element) { | ||
return element instanceof Element || element instanceof HTMLDocument; | ||
}; | ||
exports.isDOMElement = isDOMElement; |
@@ -46,3 +46,3 @@ { | ||
"author": "Vitalii Maslianok <maslianok@gmail.com> (https://github.com/maslianok)", | ||
"version": "4.1.2", | ||
"version": "4.1.3", | ||
"bugs": { | ||
@@ -49,0 +49,0 @@ "url": "https://github.com/maslianok/react-resize-detector/issues" |
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
751
197345