react-popper
Advanced tools
Comparing version 0.4.1 to 0.4.2
## CHANGELOG | ||
### 0.4.2 | ||
Move back to `translate3d` and round values since half pixel placement was the culprit for causing blurry text | ||
### 0.4.1 | ||
@@ -3,0 +6,0 @@ Don't use `translate3d` since it causes blurry text on lower res displays |
/*! | ||
* React Popper 0.4.1 | ||
* React Popper 0.4.2 | ||
* https://github.com/souporserious/react-popper | ||
* Copyright (c) 2017 React Popper Authors | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.ReactPopper=t(require("react"),require("react-dom")):e.ReactPopper=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="dist/",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Arrow=t.Popper=t.Target=t.Manager=void 0;var o=r(1),i=n(o),a=r(4),f=n(a),s=r(5),u=n(s),p=r(9),c=n(p);t.Manager=i.default,t.Target=f.default,t.Popper=u.default,t.Arrow=c.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r(2),p=(n(u),r(3)),c=(n(p),function(e){function t(){var e,r,n,o;i(this,t);for(var f=arguments.length,s=Array(f),u=0;u<f;u++)s[u]=arguments[u];return r=n=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),n._setTargetNode=function(e){n._targetNode=e},n._getTargetNode=function(){return n._targetNode},o=r,a(n,o)}return f(t,e),s(t,[{key:"getChildContext",value:function(){return{popperManager:{setTargetNode:this._setTargetNode,getTargetNode:this._getTargetNode}}}},{key:"render",value:function(){var e=this.props,t=e.component,r=o(e,["component"]);return(0,u.createElement)(t,r)}}]),t}(u.Component));c.childContextTypes={popperManager:u.PropTypes.object.isRequired},c.propTypes={component:u.PropTypes.any},c.defaultProps={component:"div"},t.default=c},function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r(2),p=(n(u),r(3)),c=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return f(t,e),s(t,[{key:"componentDidMount",value:function(){this.context.popperManager.setTargetNode((0,p.findDOMNode)(this))}},{key:"render",value:function(){var e=this.props,t=e.component,r=o(e,["component"]);return(0,u.createElement)(t,r)}}]),t}(u.Component);c.contextTypes={popperManager:u.PropTypes.object.isRequired},c.propTypes={component:u.PropTypes.any},c.defaultProps={component:"div"},t.default=c},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),p=r(2),c=(n(p),r(3)),l=(n(c),r(6)),d=n(l),h=r(7),m=n(h),Popper=function(e){function Popper(){var e,t,r,n;i(this,Popper);for(var o=arguments.length,f=Array(o),u=0;u<o;u++)f[u]=arguments[u];return t=r=a(this,(e=Popper.__proto__||Object.getPrototypeOf(Popper)).call.apply(e,[this].concat(f))),r.state={},r._setArrowNode=function(e){r._arrowNode=e},r._getTargetNode=function(){return r.context.popperManager.getTargetNode()},r._updateStateModifier={enabled:!0,order:900,function:function(e){(r.state.data&&!(0,m.default)(e.offsets,r.state.data.offsets)||!r.state.data)&&r.setState({data:e})}},r._getPopperStyle=function(){var e=r.state.data;if(!r._popper||!e)return{position:"absolute",pointerEvents:"none",opacity:0};var t=e.offsets.popper,n=t.top,o=t.left,i=t.position;return s({position:i,top:0,left:0,transform:"translate("+o+"px, "+n+"px)"},e.styles)},r._getPopperPlacement=function(){return r.state.data?r.state.data.placement:void 0},r._getArrowStyle=function(){if(r.state.data&&r.state.data.offsets.arrow){var e=r.state.data.offsets.arrow,t=e.top,n=e.left;return n?{left:+n}:{top:+t}}return{}},n=t,a(r,n)}return f(Popper,e),u(Popper,[{key:"getChildContext",value:function(){return{popper:{setArrowNode:this._setArrowNode,getArrowStyle:this._getArrowStyle}}}},{key:"componentDidMount",value:function(){this._updatePopper()}},{key:"componentDidUpdate",value:function(e){e.placement===this.props.placement&&e.eventsEnabled===this.props.eventsEnabled||this._updatePopper()}},{key:"componentWillUnmount",value:function(){this._destroyPopper()}},{key:"_updatePopper",value:function(){this._destroyPopper(),this._createPopper()}},{key:"_createPopper",value:function(){var e=this.props,t=e.placement,r=e.eventsEnabled,n=s({},this.props.modifiers,{applyStyle:{enabled:!1},updateState:this._updateStateModifier});this._arrowNode&&(n.arrow={element:this._arrowNode}),this._popper=new d.default(this._getTargetNode(),(0,c.findDOMNode)(this),{placement:t,eventsEnabled:r,modifiers:n}),this._popper.scheduleUpdate()}},{key:"_destroyPopper",value:function(){this._popper&&this._popper.destroy()}},{key:"render",value:function(){var e=this.props,t=e.component,r=(e.placement,e.eventsEnabled,e.modifiers,e.style),n=o(e,["component","placement","eventsEnabled","modifiers","style"]);return(0,p.createElement)(t,s({style:s({},this._getPopperStyle(),r),"data-placement":this._getPopperPlacement()},n))}}]),Popper}(p.Component);Popper.contextTypes={popperManager:p.PropTypes.object.isRequired},Popper.childContextTypes={popper:p.PropTypes.object.isRequired},Popper.propTypes={component:p.PropTypes.any,placement:p.PropTypes.oneOf(d.default.placements),eventsEnabled:p.PropTypes.bool,modifiers:p.PropTypes.object},Popper.defaultProps={component:"div",placement:"bottom",eventsEnabled:!0,modifiers:{},className:"popper"},t.default=Popper},function(e,t,r){var n,o,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/**! | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.ReactPopper=t(require("react"),require("react-dom")):e.ReactPopper=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="dist/",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Arrow=t.Popper=t.Target=t.Manager=void 0;var o=r(1),i=n(o),a=r(4),f=n(a),s=r(5),u=n(s),p=r(9),c=n(p);t.Manager=i.default,t.Target=f.default,t.Popper=u.default,t.Arrow=c.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r(2),p=(n(u),r(3)),c=(n(p),function(e){function t(){var e,r,n,o;i(this,t);for(var f=arguments.length,s=Array(f),u=0;u<f;u++)s[u]=arguments[u];return r=n=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),n._setTargetNode=function(e){n._targetNode=e},n._getTargetNode=function(){return n._targetNode},o=r,a(n,o)}return f(t,e),s(t,[{key:"getChildContext",value:function(){return{popperManager:{setTargetNode:this._setTargetNode,getTargetNode:this._getTargetNode}}}},{key:"render",value:function(){var e=this.props,t=e.component,r=o(e,["component"]);return(0,u.createElement)(t,r)}}]),t}(u.Component));c.childContextTypes={popperManager:u.PropTypes.object.isRequired},c.propTypes={component:u.PropTypes.any},c.defaultProps={component:"div"},t.default=c},function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r(2),p=(n(u),r(3)),c=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return f(t,e),s(t,[{key:"componentDidMount",value:function(){this.context.popperManager.setTargetNode((0,p.findDOMNode)(this))}},{key:"render",value:function(){var e=this.props,t=e.component,r=o(e,["component"]);return(0,u.createElement)(t,r)}}]),t}(u.Component);c.contextTypes={popperManager:u.PropTypes.object.isRequired},c.propTypes={component:u.PropTypes.any},c.defaultProps={component:"div"},t.default=c},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),p=r(2),c=(n(p),r(3)),l=(n(c),r(6)),d=n(l),h=r(7),m=n(h),Popper=function(e){function Popper(){var e,t,r,n;i(this,Popper);for(var o=arguments.length,f=Array(o),u=0;u<o;u++)f[u]=arguments[u];return t=r=a(this,(e=Popper.__proto__||Object.getPrototypeOf(Popper)).call.apply(e,[this].concat(f))),r.state={},r._setArrowNode=function(e){r._arrowNode=e},r._getTargetNode=function(){return r.context.popperManager.getTargetNode()},r._updateStateModifier={enabled:!0,order:900,function:function(e){(r.state.data&&!(0,m.default)(e.offsets,r.state.data.offsets)||!r.state.data)&&r.setState({data:e})}},r._getPopperStyle=function(){var e=r.state.data;if(!r._popper||!e)return{position:"absolute",pointerEvents:"none",opacity:0};var t=e.offsets.popper,n=t.top,o=t.left,i=t.position;return s({position:i,top:0,left:0,transform:"translate3d("+Math.round(o)+"px, "+Math.round(n)+"px, 0px)",willChange:"transform"},e.styles)},r._getPopperPlacement=function(){return r.state.data?r.state.data.placement:void 0},r._getArrowStyle=function(){if(r.state.data&&r.state.data.offsets.arrow){var e=r.state.data.offsets.arrow,t=e.top,n=e.left;return n?{left:+n}:{top:+t}}return{}},n=t,a(r,n)}return f(Popper,e),u(Popper,[{key:"getChildContext",value:function(){return{popper:{setArrowNode:this._setArrowNode,getArrowStyle:this._getArrowStyle}}}},{key:"componentDidMount",value:function(){this._updatePopper()}},{key:"componentDidUpdate",value:function(e){e.placement===this.props.placement&&e.eventsEnabled===this.props.eventsEnabled||this._updatePopper()}},{key:"componentWillUnmount",value:function(){this._destroyPopper()}},{key:"_updatePopper",value:function(){this._destroyPopper(),this._createPopper()}},{key:"_createPopper",value:function(){var e=this.props,t=e.placement,r=e.eventsEnabled,n=s({},this.props.modifiers,{applyStyle:{enabled:!1},updateState:this._updateStateModifier});this._arrowNode&&(n.arrow={element:this._arrowNode}),this._popper=new d.default(this._getTargetNode(),(0,c.findDOMNode)(this),{placement:t,eventsEnabled:r,modifiers:n}),this._popper.scheduleUpdate()}},{key:"_destroyPopper",value:function(){this._popper&&this._popper.destroy()}},{key:"render",value:function(){var e=this.props,t=e.component,r=(e.placement,e.eventsEnabled,e.modifiers,e.style),n=o(e,["component","placement","eventsEnabled","modifiers","style"]);return(0,p.createElement)(t,s({style:s({},this._getPopperStyle(),r),"data-placement":this._getPopperPlacement()},n))}}]),Popper}(p.Component);Popper.contextTypes={popperManager:p.PropTypes.object.isRequired},Popper.childContextTypes={popper:p.PropTypes.object.isRequired},Popper.propTypes={component:p.PropTypes.any,placement:p.PropTypes.oneOf(d.default.placements),eventsEnabled:p.PropTypes.bool,modifiers:p.PropTypes.object},Popper.defaultProps={component:"div",placement:"bottom",eventsEnabled:!0,modifiers:{},className:"popper"},t.default=Popper},function(e,t,r){var n,o,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/**! | ||
* @fileOverview Kickass library to create and place poppers near their reference elements. | ||
@@ -8,0 +8,0 @@ * @version 1.0.8 |
@@ -91,3 +91,4 @@ 'use strict'; | ||
left: 0, | ||
transform: 'translate(' + left + 'px, ' + top + 'px)' | ||
transform: 'translate3d(' + Math.round(left) + 'px, ' + Math.round(top) + 'px, 0px)', | ||
willChange: 'transform' | ||
}, data.styles); | ||
@@ -94,0 +95,0 @@ }, _this._getPopperPlacement = function () { |
{ | ||
"name": "react-popper", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "React wrapper around PopperJS.", | ||
@@ -5,0 +5,0 @@ "main": "lib/react-popper.js", |
Sorry, the diff of this file is too big to display
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
235640
4566