@render-props/rect
Advanced tools
Comparing version 0.1.15 to 0.1.16
@@ -12,10 +12,2 @@ 'use strict' | ||
var _assertThisInitialized2 = _interopRequireDefault( | ||
require('@babel/runtime/helpers/assertThisInitialized') | ||
) | ||
var _defineProperty2 = _interopRequireDefault( | ||
require('@babel/runtime/helpers/defineProperty') | ||
) | ||
var _react = _interopRequireDefault(require('react')) | ||
@@ -83,40 +75,20 @@ | ||
_this = _React$Component.call(this, props) || this | ||
;(0, _defineProperty2.default)( | ||
(0, _assertThisInitialized2.default)( | ||
(0, _assertThisInitialized2.default)(_this) | ||
), | ||
'element', | ||
null | ||
) | ||
;(0, _defineProperty2.default)( | ||
(0, _assertThisInitialized2.default)( | ||
(0, _assertThisInitialized2.default)(_this) | ||
), | ||
'rectRef', | ||
function(el) { | ||
if (el !== null && el !== _this.element) { | ||
_this.element = el | ||
_this.element = null | ||
_this.recalcRect() | ||
} | ||
_this.rectRef = function(el) { | ||
if (el !== null && el !== _this.element) { | ||
_this.element = el | ||
_this.recalcRect() | ||
} | ||
) | ||
;(0, _defineProperty2.default)( | ||
(0, _assertThisInitialized2.default)( | ||
(0, _assertThisInitialized2.default)(_this) | ||
), | ||
'recalcRect', | ||
function() { | ||
return _this.props.throttleState((0, _utils.rect)(_this.element)) | ||
} | ||
) | ||
;(0, _defineProperty2.default)( | ||
(0, _assertThisInitialized2.default)( | ||
(0, _assertThisInitialized2.default)(_this) | ||
), | ||
'getRect', | ||
function() { | ||
return _this.props.state | ||
} | ||
) | ||
} | ||
_this.recalcRect = function() { | ||
return _this.props.throttleState((0, _utils.rect)(_this.element)) | ||
} | ||
_this.getRect = function() { | ||
return _this.props.state | ||
} | ||
_this.rectContext = { | ||
@@ -135,7 +107,7 @@ rectRef: _this.rectRef, | ||
;(0, _defineProperty2.default)(Rect_, 'displayName', 'Rect') | ||
;(0, _defineProperty2.default)(Rect_, 'defaultProps', { | ||
Rect_.displayName = 'Rect' | ||
Rect_.defaultProps = { | ||
recalcOnWindowResize: true, | ||
withCoords: true, | ||
}) | ||
} | ||
@@ -142,0 +114,0 @@ function Rect(props) { |
import _inheritsLoose from '@babel/runtime/helpers/inheritsLoose' | ||
import _assertThisInitialized from '@babel/runtime/helpers/assertThisInitialized' | ||
import _defineProperty from '@babel/runtime/helpers/defineProperty' | ||
import React from 'react' | ||
@@ -62,36 +60,19 @@ import PropTypes from 'prop-types' | ||
_this = _React$Component.call(this, props) || this | ||
_this.element = null | ||
_defineProperty( | ||
_assertThisInitialized(_assertThisInitialized(_this)), | ||
'element', | ||
null | ||
) | ||
_this.rectRef = function(el) { | ||
if (el !== null && el !== _this.element) { | ||
_this.element = el | ||
_defineProperty( | ||
_assertThisInitialized(_assertThisInitialized(_this)), | ||
'rectRef', | ||
function(el) { | ||
if (el !== null && el !== _this.element) { | ||
_this.element = el | ||
_this.recalcRect() | ||
} | ||
_this.recalcRect() | ||
} | ||
) | ||
} | ||
_defineProperty( | ||
_assertThisInitialized(_assertThisInitialized(_this)), | ||
'recalcRect', | ||
function() { | ||
return _this.props.throttleState(rect(_this.element)) | ||
} | ||
) | ||
_this.recalcRect = function() { | ||
return _this.props.throttleState(rect(_this.element)) | ||
} | ||
_defineProperty( | ||
_assertThisInitialized(_assertThisInitialized(_this)), | ||
'getRect', | ||
function() { | ||
return _this.props.state | ||
} | ||
) | ||
_this.getRect = function() { | ||
return _this.props.state | ||
} | ||
@@ -111,9 +92,7 @@ _this.rectContext = { | ||
_defineProperty(Rect_, 'displayName', 'Rect') | ||
_defineProperty(Rect_, 'defaultProps', { | ||
Rect_.displayName = 'Rect' | ||
Rect_.defaultProps = { | ||
recalcOnWindowResize: true, | ||
withCoords: true, | ||
}) | ||
} | ||
export default function Rect(props) { | ||
@@ -120,0 +99,0 @@ return React.createElement(Events, null, function(eventsContext) { |
{ | ||
"version": "0.1.15", | ||
"version": "0.1.16", | ||
"main": "commonjs/index.js", | ||
@@ -4,0 +4,0 @@ "module": "es/index.js", |
17859
414