Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-popper

Package Overview
Dependencies
Maintainers
2
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-popper - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

33

dist/index.umd.js

@@ -1124,2 +1124,14 @@ (function (global, factory) {

var objectWithoutProperties = function (obj, keys) {
var target = {};
for (var i in obj) {
if (keys.indexOf(i) >= 0) continue;
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
target[i] = obj[i];
}
return target;
};
var possibleConstructorReturn = function (self, call) {

@@ -1220,3 +1232,3 @@ if (!self) {

}, _this.popperNode = null, _this.arrowNode = null, _this.setPopperNode = function (popperNode) {
if (_this.popperNode === popperNode) return;
if (!popperNode || _this.popperNode === popperNode) return;

@@ -1228,6 +1240,3 @@ safeInvoke(_this.props.innerRef, popperNode);

}, _this.setArrowNode = function (arrowNode) {
if (_this.arrowNode === arrowNode) return;
_this.arrowNode = arrowNode;
if (!_this.popperInstance) _this.updatePopperInstance();
}, _this.updateStateModifier = {

@@ -1239,3 +1248,3 @@ enabled: true,

_this.setState({ data: data, placement: placement }, placement !== _this.state.placement ? _this.scheduleUpdate : undefined);
_this.setState({ data: data, placement: placement });
return data;

@@ -1308,2 +1317,3 @@ }

InnerPopper.prototype.componentWillUnmount = function componentWillUnmount() {
safeInvoke(this.props.innerRef, null);
this.destroyPopperInstance();

@@ -1337,9 +1347,14 @@ };

function Popper(props) {
function Popper(_ref) {
var referenceElement = _ref.referenceElement,
props = objectWithoutProperties(_ref, ['referenceElement']);
return React.createElement(
ManagerContext.Consumer,
null,
function (_ref) {
var referenceNode = _ref.referenceNode;
return React.createElement(InnerPopper, _extends({ referenceElement: referenceNode }, props));
function (_ref2) {
var referenceNode = _ref2.referenceNode;
return React.createElement(InnerPopper, _extends({
referenceElement: referenceElement !== undefined ? referenceElement : referenceNode
}, props));
}

@@ -1346,0 +1361,0 @@ );

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","react","popper.js"],t):t(e.ReactPopper={},e.React,e.Popper)}(this,function(e,r,i){"use strict";var d="default"in r?r.default:r;i=i&&i.hasOwnProperty("default")?i.default:i;var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function o(e,t){return e(t={exports:{}},t.exports),t.exports}function a(e){return function(){return e}}var p=function(){};p.thatReturns=a,p.thatReturnsFalse=a(!1),p.thatReturnsTrue=a(!0),p.thatReturnsNull=a(null),p.thatReturnsThis=function(){return this},p.thatReturnsArgument=function(e){return e};var s=p;var c=function(e,t,n,r,o,a,p,i){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,p,i],u=0;(s=new Error(t.replace(/%s/g,function(){return c[u++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}},h=s,u=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}})()&&Object.assign;var y=o(function(e){e.exports=function(){function e(e,t,n,r,o,a){"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a&&c(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}var n={array:e.isRequired=e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=s,n.PropTypes=n}()}),v="__global_unique_id__",m=function(){return t[v]=(t[v]||0)+1},b=o(function(e,t){t.__esModule=!0;var n=r(d),i=r(y),s=r(m);r(h);function r(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=1073741823;t.default=n.default.createContext||function(e,p){var t,n,r="__create-react-context-"+(0,s.default)()+"__",o=function(i){function s(){var e,t,n,r;c(this,s);for(var o=arguments.length,a=Array(o),p=0;p<o;p++)a[p]=arguments[p];return(e=t=u(this,i.call.apply(i,[this].concat(a)))).emitter=(n=t.props.value,r=[],{on:function(e){r.push(e)},off:function(t){r=r.filter(function(e){return e!==t})},get:function(){return n},set:function(e,t){n=e,r.forEach(function(e){return e(n,t)})}}),u(t,e)}return f(s,i),s.prototype.getChildContext=function(){var e;return(e={})[r]=this.emitter,e},s.prototype.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var t=this.props.value,n=e.value,r=void 0;((o=t)===(a=n)?0!==o||1/o==1/a:o!=o&&a!=a)?r=0:(r="function"==typeof p?p(t,n):l,0!=(r|=0)&&this.emitter.set(e.value,r))}var o,a},s.prototype.render=function(){return this.props.children},s}(d.Component);o.childContextTypes=((t={})[r]=i.default.object.isRequired,t);var a=function(a){function p(){var e,n;c(this,p);for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return(e=n=u(this,a.call.apply(a,[this].concat(r)))).state={value:n.getValue()},n.onUpdate=function(e,t){0!=((0|n.observedBits)&t)&&n.setState({value:n.getValue()})},u(n,e)}return f(p,a),p.prototype.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?l:t},p.prototype.componentDidMount=function(){this.context[r]&&this.context[r].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?l:e},p.prototype.componentWillUnmount=function(){this.context[r]&&this.context[r].off(this.onUpdate)},p.prototype.getValue=function(){return this.context[r]?this.context[r].get():e},p.prototype.render=function(){return e=this.props.children,(Array.isArray(e)?e[0]:e)(this.state.value);var e},p}(d.Component);return a.contextTypes=((n={})[r]=i.default.object,n),{Provider:o,Consumer:a}},e.exports=t.default});n(b);var g=n(o(function(e,t){t.__esModule=!0;var n=o(d),r=o(b);function o(e){return e&&e.__esModule?e:{default:e}}t.default=n.default.createContext||r.default,e.exports=t.default})),O=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},w=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},_=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},R=g({getReferenceRef:void 0,referenceNode:void 0}),x=function(t){function n(){O(this,n);var e=_(this,t.call(this));return e.getReferenceRef=function(n){return e.setState(function(e){var t=e.context;return{context:w({},t,{referenceNode:n})}})},e.state={context:{getReferenceRef:e.getReferenceRef,referenceNode:void 0}},e}return P(n,t),n.prototype.render=function(){return r.createElement(R.Provider,{value:this.state.context},this.props.children)},n}(r.Component),E=function(e){return Array.isArray(e)?e[0]:e},j=function(e){for(var t=arguments.length,n=Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if("function"==typeof e)return e.apply(void 0,n)},N={position:"absolute",top:0,left:0,opacity:0,pointerEvents:"none"},S={},I=function(a){function p(){var e,n;O(this,p);for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return(e=n=_(this,a.call.apply(a,[this].concat(r)))).state={data:void 0,placement:void 0},n.popperNode=null,n.arrowNode=null,n.setPopperNode=function(e){n.popperNode!==e&&(j(n.props.innerRef,e),n.popperNode=e,n.updatePopperInstance())},n.setArrowNode=function(e){n.arrowNode!==e&&(n.arrowNode=e,n.popperInstance||n.updatePopperInstance())},n.updateStateModifier={enabled:!0,order:900,fn:function(e){var t=e.placement;return n.setState({data:e,placement:t},t!==n.state.placement?n.scheduleUpdate:void 0),e}},n.getOptions=function(){return{placement:n.props.placement,eventsEnabled:n.props.eventsEnabled,positionFixed:n.props.positionFixed,modifiers:w({},n.props.modifiers,{arrow:w({},n.props.modifiers&&n.props.modifiers.arrow,{enabled:!!n.arrowNode,element:n.arrowNode}),applyStyle:{enabled:!1},updateStateModifier:n.updateStateModifier})}},n.getPopperStyle=function(){return n.popperNode&&n.state.data?w({position:n.state.data.offsets.popper.position},n.state.data.styles):N},n.getPopperPlacement=function(){return n.state.data?n.state.placement:void 0},n.getArrowStyle=function(){return n.arrowNode&&n.state.data?n.state.data.arrowStyles:S},n.getOutOfBoundariesState=function(){return n.state.data?n.state.data.hide:void 0},n.destroyPopperInstance=function(){n.popperInstance&&(n.popperInstance.destroy(),n.popperInstance=null)},n.updatePopperInstance=function(){n.destroyPopperInstance();var e=n.popperNode,t=n.props.referenceElement;t&&e&&(n.popperInstance=new i(t,e,n.getOptions()))},n.scheduleUpdate=function(){n.popperInstance&&n.popperInstance.scheduleUpdate()},_(n,e)}return P(p,a),p.prototype.componentDidUpdate=function(e,t){this.props.placement!==e.placement||this.props.referenceElement!==e.referenceElement||this.props.positionFixed!==e.positionFixed?this.updatePopperInstance():this.props.eventsEnabled!==e.eventsEnabled&&this.popperInstance&&(this.props.eventsEnabled?this.popperInstance.enableEventListeners():this.popperInstance.disableEventListeners()),t.placement!==this.state.placement&&this.scheduleUpdate()},p.prototype.componentWillUnmount=function(){this.destroyPopperInstance()},p.prototype.render=function(){return E(this.props.children)({ref:this.setPopperNode,style:this.getPopperStyle(),placement:this.getPopperPlacement(),outOfBoundaries:this.getOutOfBoundariesState(),scheduleUpdate:this.scheduleUpdate,arrowProps:{ref:this.setArrowNode,style:this.getArrowStyle()}})},p}(r.Component);I.defaultProps={placement:"bottom",eventsEnabled:!0,referenceElement:void 0,positionFixed:!1};var C=i.placements;var T=function(){},A=function(a){function p(){var e,t;O(this,p);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=t=_(this,a.call.apply(a,[this].concat(r)))).refHandler=function(e){j(t.props.innerRef,e),j(t.props.getReferenceRef,e)},_(t,e)}return P(p,a),p.prototype.render=function(){return T(this.props.getReferenceRef,"`Reference` should not be used outside of a `Manager` component."),E(this.props.children)({ref:this.refHandler})},p}(r.Component);e.Popper=function(n){return r.createElement(R.Consumer,null,function(e){var t=e.referenceNode;return r.createElement(I,w({referenceElement:t},n))})},e.placements=C,e.Manager=x,e.Reference=function(n){return r.createElement(R.Consumer,null,function(e){var t=e.getReferenceRef;return r.createElement(A,w({getReferenceRef:t},n))})},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","react","popper.js"],t):t(e.ReactPopper={},e.React,e.Popper)}(this,function(e,o,p){"use strict";var d="default"in o?o.default:o;p=p&&p.hasOwnProperty("default")?p.default:p;var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e,t){return e(t={exports:{}},t.exports),t.exports}function a(e){return function(){return e}}var i=function(){};i.thatReturns=a,i.thatReturnsFalse=a(!1),i.thatReturnsTrue=a(!0),i.thatReturnsNull=a(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e};var s=i;var c=function(e,t,n,r,o,a,i,p){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,i,p],u=0;(s=new Error(t.replace(/%s/g,function(){return c[u++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}},h=s,u=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}})()&&Object.assign;var y=r(function(e){e.exports=function(){function e(e,t,n,r,o,a){"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a&&c(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}var n={array:e.isRequired=e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=s,n.PropTypes=n}()}),v="__global_unique_id__",m=function(){return t[v]=(t[v]||0)+1},b=r(function(e,t){t.__esModule=!0;var n=r(d),p=r(y),s=r(m);r(h);function r(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=1073741823;t.default=n.default.createContext||function(e,i){var t,n,r="__create-react-context-"+(0,s.default)()+"__",o=function(p){function s(){var e,t,n,r;c(this,s);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return(e=t=u(this,p.call.apply(p,[this].concat(a)))).emitter=(n=t.props.value,r=[],{on:function(e){r.push(e)},off:function(t){r=r.filter(function(e){return e!==t})},get:function(){return n},set:function(e,t){n=e,r.forEach(function(e){return e(n,t)})}}),u(t,e)}return f(s,p),s.prototype.getChildContext=function(){var e;return(e={})[r]=this.emitter,e},s.prototype.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var t=this.props.value,n=e.value,r=void 0;((o=t)===(a=n)?0!==o||1/o==1/a:o!=o&&a!=a)?r=0:(r="function"==typeof i?i(t,n):l,0!=(r|=0)&&this.emitter.set(e.value,r))}var o,a},s.prototype.render=function(){return this.props.children},s}(d.Component);o.childContextTypes=((t={})[r]=p.default.object.isRequired,t);var a=function(a){function i(){var e,n;c(this,i);for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return(e=n=u(this,a.call.apply(a,[this].concat(r)))).state={value:n.getValue()},n.onUpdate=function(e,t){0!=((0|n.observedBits)&t)&&n.setState({value:n.getValue()})},u(n,e)}return f(i,a),i.prototype.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?l:t},i.prototype.componentDidMount=function(){this.context[r]&&this.context[r].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?l:e},i.prototype.componentWillUnmount=function(){this.context[r]&&this.context[r].off(this.onUpdate)},i.prototype.getValue=function(){return this.context[r]?this.context[r].get():e},i.prototype.render=function(){return e=this.props.children,(Array.isArray(e)?e[0]:e)(this.state.value);var e},i}(d.Component);return a.contextTypes=((n={})[r]=p.default.object,n),{Provider:o,Consumer:a}},e.exports=t.default});n(b);var g=n(r(function(e,t){t.__esModule=!0;var n=o(d),r=o(b);function o(e){return e&&e.__esModule?e:{default:e}}t.default=n.default.createContext||r.default,e.exports=t.default})),O=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},w=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},_=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},R=g({getReferenceRef:void 0,referenceNode:void 0}),E=function(t){function n(){O(this,n);var e=_(this,t.call(this));return e.getReferenceRef=function(n){return e.setState(function(e){var t=e.context;return{context:w({},t,{referenceNode:n})}})},e.state={context:{getReferenceRef:e.getReferenceRef,referenceNode:void 0}},e}return P(n,t),n.prototype.render=function(){return o.createElement(R.Provider,{value:this.state.context},this.props.children)},n}(o.Component),x=function(e){return Array.isArray(e)?e[0]:e},j=function(e){for(var t=arguments.length,n=Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if("function"==typeof e)return e.apply(void 0,n)},S={position:"absolute",top:0,left:0,opacity:0,pointerEvents:"none"},N={},I=function(a){function i(){var e,n;O(this,i);for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return(e=n=_(this,a.call.apply(a,[this].concat(r)))).state={data:void 0,placement:void 0},n.popperNode=null,n.arrowNode=null,n.setPopperNode=function(e){e&&n.popperNode!==e&&(j(n.props.innerRef,e),n.popperNode=e,n.updatePopperInstance())},n.setArrowNode=function(e){n.arrowNode=e},n.updateStateModifier={enabled:!0,order:900,fn:function(e){var t=e.placement;return n.setState({data:e,placement:t}),e}},n.getOptions=function(){return{placement:n.props.placement,eventsEnabled:n.props.eventsEnabled,positionFixed:n.props.positionFixed,modifiers:w({},n.props.modifiers,{arrow:w({},n.props.modifiers&&n.props.modifiers.arrow,{enabled:!!n.arrowNode,element:n.arrowNode}),applyStyle:{enabled:!1},updateStateModifier:n.updateStateModifier})}},n.getPopperStyle=function(){return n.popperNode&&n.state.data?w({position:n.state.data.offsets.popper.position},n.state.data.styles):S},n.getPopperPlacement=function(){return n.state.data?n.state.placement:void 0},n.getArrowStyle=function(){return n.arrowNode&&n.state.data?n.state.data.arrowStyles:N},n.getOutOfBoundariesState=function(){return n.state.data?n.state.data.hide:void 0},n.destroyPopperInstance=function(){n.popperInstance&&(n.popperInstance.destroy(),n.popperInstance=null)},n.updatePopperInstance=function(){n.destroyPopperInstance();var e=n.popperNode,t=n.props.referenceElement;t&&e&&(n.popperInstance=new p(t,e,n.getOptions()))},n.scheduleUpdate=function(){n.popperInstance&&n.popperInstance.scheduleUpdate()},_(n,e)}return P(i,a),i.prototype.componentDidUpdate=function(e,t){this.props.placement!==e.placement||this.props.referenceElement!==e.referenceElement||this.props.positionFixed!==e.positionFixed?this.updatePopperInstance():this.props.eventsEnabled!==e.eventsEnabled&&this.popperInstance&&(this.props.eventsEnabled?this.popperInstance.enableEventListeners():this.popperInstance.disableEventListeners()),t.placement!==this.state.placement&&this.scheduleUpdate()},i.prototype.componentWillUnmount=function(){j(this.props.innerRef,null),this.destroyPopperInstance()},i.prototype.render=function(){return x(this.props.children)({ref:this.setPopperNode,style:this.getPopperStyle(),placement:this.getPopperPlacement(),outOfBoundaries:this.getOutOfBoundariesState(),scheduleUpdate:this.scheduleUpdate,arrowProps:{ref:this.setArrowNode,style:this.getArrowStyle()}})},i}(o.Component);I.defaultProps={placement:"bottom",eventsEnabled:!0,referenceElement:void 0,positionFixed:!1};var C=p.placements;var T=function(){},A=function(a){function i(){var e,t;O(this,i);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=t=_(this,a.call.apply(a,[this].concat(r)))).refHandler=function(e){j(t.props.innerRef,e),j(t.props.getReferenceRef,e)},_(t,e)}return P(i,a),i.prototype.render=function(){return T(this.props.getReferenceRef,"`Reference` should not be used outside of a `Manager` component."),x(this.props.children)({ref:this.refHandler})},i}(o.Component);e.Popper=function(e){var n=e.referenceElement,r=function(e,t){var n={};for(var r in e)0<=t.indexOf(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["referenceElement"]);return o.createElement(R.Consumer,null,function(e){var t=e.referenceNode;return o.createElement(I,w({referenceElement:void 0!==n?n:t},r))})},e.placements=C,e.Manager=E,e.Reference=function(n){return o.createElement(R.Consumer,null,function(e){var t=e.getReferenceRef;return o.createElement(A,w({getReferenceRef:t},n))})},Object.defineProperty(e,"__esModule",{value:!0})});

@@ -8,2 +8,6 @@ 'use strict';

var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
var _extends2 = require('babel-runtime/helpers/extends');

@@ -69,3 +73,3 @@

}, _this.popperNode = null, _this.arrowNode = null, _this.setPopperNode = function (popperNode) {
if (_this.popperNode === popperNode) return;
if (!popperNode || _this.popperNode === popperNode) return;

@@ -77,6 +81,3 @@ (0, _utils.safeInvoke)(_this.props.innerRef, popperNode);

}, _this.setArrowNode = function (arrowNode) {
if (_this.arrowNode === arrowNode) return;
_this.arrowNode = arrowNode;
if (!_this.popperInstance) _this.updatePopperInstance();
}, _this.updateStateModifier = {

@@ -88,3 +89,3 @@ enabled: true,

_this.setState({ data: data, placement: placement }, placement !== _this.state.placement ? _this.scheduleUpdate : undefined);
_this.setState({ data: data, placement: placement });
return data;

@@ -157,2 +158,3 @@ }

InnerPopper.prototype.componentWillUnmount = function componentWillUnmount() {
(0, _utils.safeInvoke)(this.props.innerRef, null);
this.destroyPopperInstance();

@@ -188,11 +190,16 @@ };

exports.placements = placements;
function Popper(props) {
function Popper(_ref) {
var referenceElement = _ref.referenceElement,
props = (0, _objectWithoutProperties3.default)(_ref, ['referenceElement']);
return React.createElement(
_Manager.ManagerContext.Consumer,
null,
function (_ref) {
var referenceNode = _ref.referenceNode;
return React.createElement(InnerPopper, (0, _extends3.default)({ referenceElement: referenceNode }, props));
function (_ref2) {
var referenceNode = _ref2.referenceNode;
return React.createElement(InnerPopper, (0, _extends3.default)({
referenceElement: referenceElement !== undefined ? referenceElement : referenceNode
}, props));
}
);
}

@@ -0,1 +1,2 @@

import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
import _extends from 'babel-runtime/helpers/extends';

@@ -37,3 +38,3 @@ import _classCallCheck from 'babel-runtime/helpers/classCallCheck';

}, _this.popperNode = null, _this.arrowNode = null, _this.setPopperNode = function (popperNode) {
if (_this.popperNode === popperNode) return;
if (!popperNode || _this.popperNode === popperNode) return;

@@ -45,6 +46,3 @@ safeInvoke(_this.props.innerRef, popperNode);

}, _this.setArrowNode = function (arrowNode) {
if (_this.arrowNode === arrowNode) return;
_this.arrowNode = arrowNode;
if (!_this.popperInstance) _this.updatePopperInstance();
}, _this.updateStateModifier = {

@@ -56,3 +54,3 @@ enabled: true,

_this.setState({ data: data, placement: placement }, placement !== _this.state.placement ? _this.scheduleUpdate : undefined);
_this.setState({ data: data, placement: placement });
return data;

@@ -125,2 +123,3 @@ }

InnerPopper.prototype.componentWillUnmount = function componentWillUnmount() {
safeInvoke(this.props.innerRef, null);
this.destroyPopperInstance();

@@ -155,11 +154,16 @@ };

export default function Popper(props) {
export default function Popper(_ref) {
var referenceElement = _ref.referenceElement,
props = _objectWithoutProperties(_ref, ['referenceElement']);
return React.createElement(
ManagerContext.Consumer,
null,
function (_ref) {
var referenceNode = _ref.referenceNode;
return React.createElement(InnerPopper, _extends({ referenceElement: referenceNode }, props));
function (_ref2) {
var referenceNode = _ref2.referenceNode;
return React.createElement(InnerPopper, _extends({
referenceElement: referenceElement !== undefined ? referenceElement : referenceNode
}, props));
}
);
}
{
"name": "react-popper",
"version": "1.3.0",
"version": "1.3.1",
"description": "React wrapper around Popper.js",

@@ -61,9 +61,8 @@ "license": "MIT",

"dependencies": {
"@types/react": "^16.1.0",
"babel-runtime": "6.x.x",
"create-react-context": "^0.2.1",
"create-react-context": "<=0.2.2",
"popper.js": "^1.14.4",
"prop-types": "^15.6.1",
"typed-styles": "^0.0.5",
"warning": "^3.0.0"
"typed-styles": "^0.0.7",
"warning": "^4.0.2"
},

@@ -70,0 +69,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc