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

react-transition-group

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-transition-group - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

14

CSSTransitionGroup.js

@@ -5,2 +5,4 @@ 'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = require('react');

@@ -10,2 +12,6 @@

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _TransitionGroup = require('./TransitionGroup');

@@ -32,5 +38,5 @@

transitionAppear: _react2.default.PropTypes.bool,
transitionEnter: _react2.default.PropTypes.bool,
transitionLeave: _react2.default.PropTypes.bool,
transitionAppear: _propTypes2.default.bool,
transitionEnter: _propTypes2.default.bool,
transitionLeave: _propTypes2.default.bool,
transitionAppearTimeout: (0, _PropTypes.transitionTimeout)('Appear'),

@@ -78,3 +84,3 @@ transitionEnterTimeout: (0, _PropTypes.transitionTimeout)('Enter'),

CSSTransitionGroup.prototype.render = function render() {
return _react2.default.createElement(_TransitionGroup2.default, Object.assign({}, this.props, { childFactory: this._wrapChild }));
return _react2.default.createElement(_TransitionGroup2.default, _extends({}, this.props, { childFactory: this._wrapChild }));
};

@@ -81,0 +87,0 @@

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

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = require('react-dom');

@@ -60,3 +64,3 @@

var propTypes = {
children: _react2.default.PropTypes.node,
children: _propTypes2.default.node,
name: _PropTypes.nameShape.isRequired,

@@ -67,8 +71,8 @@

// or a bool for the timeout flags (appearTimeout etc.)
appear: _react2.default.PropTypes.bool,
enter: _react2.default.PropTypes.bool,
leave: _react2.default.PropTypes.bool,
appearTimeout: _react2.default.PropTypes.number,
enterTimeout: _react2.default.PropTypes.number,
leaveTimeout: _react2.default.PropTypes.number
appear: _propTypes2.default.bool,
enter: _propTypes2.default.bool,
leave: _propTypes2.default.bool,
appearTimeout: _propTypes2.default.number,
enterTimeout: _propTypes2.default.number,
leaveTimeout: _propTypes2.default.number
};

@@ -75,0 +79,0 @@

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

!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.ReactTransitionGroup=t(require("react"),require("react-dom")):e.ReactTransitionGroup=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=15)}([function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 a(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)}t.__esModule=!0;var s=n(5),u=r(s),p=n(0),l=r(p),c=n(11),f=(r(c),n(13)),d={component:l.default.PropTypes.any,childFactory:l.default.PropTypes.func,children:l.default.PropTypes.node},m={component:"span",childFactory:function(e){return e}},h=function(e){function t(n,r){o(this,t);var a=i(this,e.call(this,n,r));return a.performAppear=function(e){a.currentlyTransitioningKeys[e]=!0;var t=a.childRefs[e];t.componentWillAppear?t.componentWillAppear(a._handleDoneAppearing.bind(a,e)):a._handleDoneAppearing(e)},a._handleDoneAppearing=function(e){var t=a.childRefs[e];t&&t.componentDidAppear&&t.componentDidAppear(),delete a.currentlyTransitioningKeys[e];var n=(0,f.getChildMapping)(a.props.children);n&&n.hasOwnProperty(e)||a.performLeave(e)},a.performEnter=function(e){a.currentlyTransitioningKeys[e]=!0;var t=a.childRefs[e];t.componentWillEnter?t.componentWillEnter(a._handleDoneEntering.bind(a,e)):a._handleDoneEntering(e)},a._handleDoneEntering=function(e){var t=a.childRefs[e];t&&t.componentDidEnter&&t.componentDidEnter(),delete a.currentlyTransitioningKeys[e];var n=(0,f.getChildMapping)(a.props.children);n&&n.hasOwnProperty(e)||a.performLeave(e)},a.performLeave=function(e){a.currentlyTransitioningKeys[e]=!0;var t=a.childRefs[e];t.componentWillLeave?t.componentWillLeave(a._handleDoneLeaving.bind(a,e)):a._handleDoneLeaving(e)},a._handleDoneLeaving=function(e){var t=a.childRefs[e];t&&t.componentDidLeave&&t.componentDidLeave(),delete a.currentlyTransitioningKeys[e];var n=(0,f.getChildMapping)(a.props.children);n&&n.hasOwnProperty(e)?a.performEnter(e):a.setState(function(t){var n=Object.assign({},t.children);return delete n[e],{children:n}})},a.childRefs=Object.create(null),a.state={children:(0,f.getChildMapping)(n.children)},a}return a(t,e),t.prototype.componentWillMount=function(){this.currentlyTransitioningKeys={},this.keysToEnter=[],this.keysToLeave=[]},t.prototype.componentDidMount=function(){var e=this.state.children;for(var t in e)e[t]&&this.performAppear(t)},t.prototype.componentWillReceiveProps=function(e){var t=(0,f.getChildMapping)(e.children),n=this.state.children;this.setState({children:(0,f.mergeChildMappings)(n,t)});for(var r in t){var o=n&&n.hasOwnProperty(r);!t[r]||o||this.currentlyTransitioningKeys[r]||this.keysToEnter.push(r)}for(var i in n){var a=t&&t.hasOwnProperty(i);!n[i]||a||this.currentlyTransitioningKeys[i]||this.keysToLeave.push(i)}},t.prototype.componentDidUpdate=function(){var e=this.keysToEnter;this.keysToEnter=[],e.forEach(this.performEnter);var t=this.keysToLeave;this.keysToLeave=[],t.forEach(this.performLeave)},t.prototype.render=function(){var e=this,t=[],n=function(n){var r=e.state.children[n];if(r){var o="string"!=typeof r.ref;t.push(l.default.cloneElement(e.props.childFactory(r),{key:n,ref:(0,u.default)(o?r.ref:null,function(t){e.childRefs[n]=t})}))}};for(var r in this.state.children)n(r);var o=Object.assign({},this.props);return delete o.transitionLeave,delete o.transitionName,delete o.transitionAppear,delete o.transitionEnter,delete o.childFactory,delete o.transitionLeaveTimeout,delete o.transitionEnterTimeout,delete o.transitionAppearTimeout,delete o.component,l.default.createElement(this.props.component,o,t)},t}(l.default.Component);h.displayName="TransitionGroup",h.propTypes=d,h.defaultProps=m,t.default=h,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=!("undefined"==typeof window||!window.document||!window.document.createElement),e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t="transition"+e+"Timeout",n="transition"+e;return function(e){if(e[n]){if(null==e[t])return new Error(t+" wasn't supplied to CSSTransitionGroup: this can cause unreliable animations and won't be supported in a future version of React. See https://fb.me/react-animation-transition-group-timeout for more information.");if("number"!=typeof e[t])return new Error(t+" must be a number (in milliseconds)")}return null}}t.__esModule=!0,t.nameShape=void 0,t.transitionTimeout=o;var i=n(0),a=r(i);t.nameShape=a.default.PropTypes.oneOfType([a.default.PropTypes.string,a.default.PropTypes.shape({enter:a.default.PropTypes.string,leave:a.default.PropTypes.string,active:a.default.PropTypes.string}),a.default.PropTypes.shape({enter:a.default.PropTypes.string,enterActive:a.default.PropTypes.string,leave:a.default.PropTypes.string,leaveActive:a.default.PropTypes.string,appear:a.default.PropTypes.string,appearActive:a.default.PropTypes.string})])},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 a(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)}t.__esModule=!0;var s=n(0),u=r(s),p=n(1),l=r(p),c=n(12),f=r(c),d=n(3),m={transitionName:d.nameShape.isRequired,transitionAppear:u.default.PropTypes.bool,transitionEnter:u.default.PropTypes.bool,transitionLeave:u.default.PropTypes.bool,transitionAppearTimeout:(0,d.transitionTimeout)("Appear"),transitionEnterTimeout:(0,d.transitionTimeout)("Enter"),transitionLeaveTimeout:(0,d.transitionTimeout)("Leave")},h={transitionAppear:!1,transitionEnter:!0,transitionLeave:!0},y=function(e){function t(){var n,r,a;o(this,t);for(var s=arguments.length,p=Array(s),l=0;l<s;l++)p[l]=arguments[l];return n=r=i(this,e.call.apply(e,[this].concat(p))),r._wrapChild=function(e){return u.default.createElement(f.default,{name:r.props.transitionName,appear:r.props.transitionAppear,enter:r.props.transitionEnter,leave:r.props.transitionLeave,appearTimeout:r.props.transitionAppearTimeout,enterTimeout:r.props.transitionEnterTimeout,leaveTimeout:r.props.transitionLeaveTimeout},e)},a=n,i(r,a)}return a(t,e),t.prototype.render=function(){return u.default.createElement(l.default,Object.assign({},this.props,{childFactory:this._wrapChild}))},t}(u.default.Component);y.displayName="CSSTransitionGroup",y.propTypes=m,y.defaultProps=h,t.default=y,e.exports=t.default},function(e,t,n){"use strict";e.exports=function(){for(var e=arguments.length,t=[],n=0;n<e;n++)t[n]=arguments[n];if(t=t.filter(function(e){return null!=e}),0!==t.length)return 1===t.length?t[0]:t.reduce(function(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}})}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){e.classList?e.classList.add(t):(0,a.default)(e)||(e.className=e.className+" "+t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=n(7),a=r(i);e.exports=t.default},function(e,t,n){"use strict";function r(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+e.className+" ").indexOf(" "+t+" ")!==-1}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";e.exports=function(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){for(var e=document.createElement("div").style,t={O:function(e){return"o"+e.toLowerCase()},Moz:function(e){return e.toLowerCase()},Webkit:function(e){return"webkit"+e},ms:function(e){return"MS"+e}},n=Object.keys(t),r=void 0,o=void 0,i="",a=0;a<n.length;a++){var s=n[a];if(s+"TransitionProperty"in e){i="-"+s.toLowerCase(),r=t[s]("TransitionEnd"),o=t[s]("AnimationEnd");break}}return!r&&"transitionProperty"in e&&(r="transitionend"),!o&&"animationName"in e&&(o="animationend"),e=null,{animationEnd:o,transitionEnd:r,prefix:i}}Object.defineProperty(t,"__esModule",{value:!0}),t.animationEnd=t.animationDelay=t.animationTiming=t.animationDuration=t.animationName=t.transitionEnd=t.transitionDuration=t.transitionDelay=t.transitionTiming=t.transitionProperty=t.transform=void 0;var i=n(2),a=r(i),s="transform",u=void 0,p=void 0,l=void 0,c=void 0,f=void 0,d=void 0,m=void 0,h=void 0,y=void 0,v=void 0,T=void 0;if(a.default){var g=o();u=g.prefix,t.transitionEnd=p=g.transitionEnd,t.animationEnd=l=g.animationEnd,t.transform=s=u+"-"+s,t.transitionProperty=c=u+"-transition-property",t.transitionDuration=f=u+"-transition-duration",t.transitionDelay=m=u+"-transition-delay",t.transitionTiming=d=u+"-transition-timing-function",t.animationName=h=u+"-animation-name",t.animationDuration=y=u+"-animation-duration",t.animationTiming=v=u+"-animation-delay",t.animationDelay=T=u+"-animation-timing-function"}t.transform=s,t.transitionProperty=c,t.transitionTiming=d,t.transitionDelay=m,t.transitionDuration=f,t.transitionEnd=p,t.animationName=h,t.animationDuration=y,t.animationTiming=v,t.animationDelay=T,t.animationEnd=l,t.default={transform:s,end:p,property:c,timing:d,delay:m,duration:f}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-f)),r=setTimeout(e,n);return f=t,r}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),a=r(i),s=["","webkit","moz","o","ms"],u="clearTimeout",p=o,l=void 0,c=function(e,t){return e+(e?t[0].toUpperCase()+t.substr(1):t)+"AnimationFrame"};a.default&&s.some(function(e){var t=c(e,"request");if(t in window)return u=c(e,"cancel"),p=function(e){return window[t](e)}});var f=(new Date).getTime();l=function(e){return p(e)},l.cancel=function(e){window[u]&&"function"==typeof window[u]&&window[u](e)},t.default=l,e.exports=t.default},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 a(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 s(e,t){return b.length?b.forEach(function(n){return e.addEventListener(n,t,!1)}):setTimeout(t,0),function(){b.length&&b.forEach(function(n){return e.removeEventListener(n,t,!1)})}}t.__esModule=!0;var u=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=n(6),l=r(p),c=n(8),f=r(c),d=n(10),m=r(d),h=n(9),y=n(0),v=r(y),T=n(14),g=n(3),b=[];h.transitionEnd&&b.push(h.transitionEnd),h.animationEnd&&b.push(h.animationEnd);var E={children:v.default.PropTypes.node,name:g.nameShape.isRequired,appear:v.default.PropTypes.bool,enter:v.default.PropTypes.bool,leave:v.default.PropTypes.bool,appearTimeout:v.default.PropTypes.number,enterTimeout:v.default.PropTypes.number,leaveTimeout:v.default.PropTypes.number},w=function(e){function t(){var n,r,a;o(this,t);for(var s=arguments.length,u=Array(s),p=0;p<s;p++)u[p]=arguments[p];return n=r=i(this,e.call.apply(e,[this].concat(u))),r.componentWillAppear=function(e){r.props.appear?r.transition("appear",e,r.props.appearTimeout):e()},r.componentWillEnter=function(e){r.props.enter?r.transition("enter",e,r.props.enterTimeout):e()},r.componentWillLeave=function(e){r.props.leave?r.transition("leave",e,r.props.leaveTimeout):e()},a=n,i(r,a)}return a(t,e),t.prototype.componentWillMount=function(){this.classNameAndNodeQueue=[],this.transitionTimeouts=[]},t.prototype.componentWillUnmount=function(){this.unmounted=!0,this.timeout&&clearTimeout(this.timeout),this.transitionTimeouts.forEach(function(e){clearTimeout(e)}),this.classNameAndNodeQueue.length=0},t.prototype.transition=function(e,t,n){var r=(0,T.findDOMNode)(this);if(!r)return void(t&&t());var o=this.props.name[e]||this.props.name+"-"+e,i=this.props.name[e+"Active"]||o+"-active",a=null,u=void 0;(0,l.default)(r,o),this.queueClassAndNode(i,r);var p=function(e){e&&e.target!==r||(clearTimeout(a),u&&u(),(0,f.default)(r,o),(0,f.default)(r,i),u&&u(),t&&t())};n?(a=setTimeout(p,n),this.transitionTimeouts.push(a)):h.transitionEnd&&(u=s(r,p))},t.prototype.queueClassAndNode=function(e,t){var n=this;this.classNameAndNodeQueue.push({className:e,node:t}),this.rafHandle||(this.rafHandle=(0,m.default)(function(){return n.flushClassNameAndNodeQueue()}))},t.prototype.flushClassNameAndNodeQueue=function(){this.unmounted||this.classNameAndNodeQueue.forEach(function(e){e.node.scrollTop,(0,l.default)(e.node,e.className)}),this.classNameAndNodeQueue.length=0,this.rafHandle=null},t.prototype.render=function(){var e=u({},this.props);return delete e.name,delete e.appear,delete e.enter,delete e.leave,delete e.appearTimeout,delete e.enterTimeout,delete e.leaveTimeout,delete e.children,v.default.cloneElement(v.default.Children.only(this.props.children),e)},t}(v.default.Component);w.displayName="CSSTransitionGroupChild",w.propTypes=E,t.default=w,e.exports=t.default},function(e,t,n){"use strict";function r(e){if(!e)return e;var t={};return i.Children.map(e,function(e){return e}).forEach(function(e){t[e.key]=e}),t}function o(e,t){function n(n){return t.hasOwnProperty(n)?t[n]:e[n]}e=e||{},t=t||{};var r={},o=[];for(var i in e)t.hasOwnProperty(i)?o.length&&(r[i]=o,o=[]):o.push(i);var a=void 0,s={};for(var u in t){if(r.hasOwnProperty(u))for(a=0;a<r[u].length;a++){var p=r[u][a];s[r[u][a]]=n(p)}s[u]=n(u)}for(a=0;a<o.length;a++)s[o[a]]=n(o[a]);return s}t.__esModule=!0,t.getChildMapping=r,t.mergeChildMappings=o;var i=n(0)},function(e,n){e.exports=t},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var o=n(4),i=r(o),a=n(1),s=r(a);e.exports={TransitionGroup:s.default,CSSTransitionGroup:i.default}}])});
!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.ReactTransitionGroup=t(require("react"),require("react-dom")):e.ReactTransitionGroup=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=17)}([function(t,n){t.exports=e},function(e,t,n){"use strict";"function"==typeof Symbol&&Symbol.iterator;e.exports=n(14)()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 a(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)}t.__esModule=!0;var u=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},s=n(6),l=r(s),c=n(0),p=r(c),f=n(1),d=r(f),m=n(15),h=(r(m),n(18)),v={component:d.default.any,childFactory:d.default.func,children:d.default.node},y={component:"span",childFactory:function(e){return e}},g=function(e){function t(n,r){o(this,t);var a=i(this,e.call(this,n,r));return a.performAppear=function(e){a.currentlyTransitioningKeys[e]=!0;var t=a.childRefs[e];t.componentWillAppear?t.componentWillAppear(a._handleDoneAppearing.bind(a,e)):a._handleDoneAppearing(e)},a._handleDoneAppearing=function(e){var t=a.childRefs[e];t&&t.componentDidAppear&&t.componentDidAppear(),delete a.currentlyTransitioningKeys[e];var n=(0,h.getChildMapping)(a.props.children);n&&n.hasOwnProperty(e)||a.performLeave(e)},a.performEnter=function(e){a.currentlyTransitioningKeys[e]=!0;var t=a.childRefs[e];t.componentWillEnter?t.componentWillEnter(a._handleDoneEntering.bind(a,e)):a._handleDoneEntering(e)},a._handleDoneEntering=function(e){var t=a.childRefs[e];t&&t.componentDidEnter&&t.componentDidEnter(),delete a.currentlyTransitioningKeys[e];var n=(0,h.getChildMapping)(a.props.children);n&&n.hasOwnProperty(e)||a.performLeave(e)},a.performLeave=function(e){a.currentlyTransitioningKeys[e]=!0;var t=a.childRefs[e];t.componentWillLeave?t.componentWillLeave(a._handleDoneLeaving.bind(a,e)):a._handleDoneLeaving(e)},a._handleDoneLeaving=function(e){var t=a.childRefs[e];t&&t.componentDidLeave&&t.componentDidLeave(),delete a.currentlyTransitioningKeys[e];var n=(0,h.getChildMapping)(a.props.children);n&&n.hasOwnProperty(e)?a.performEnter(e):a.setState(function(t){var n=u({},t.children);return delete n[e],{children:n}})},a.childRefs=Object.create(null),a.state={children:(0,h.getChildMapping)(n.children)},a}return a(t,e),t.prototype.componentWillMount=function(){this.currentlyTransitioningKeys={},this.keysToEnter=[],this.keysToLeave=[]},t.prototype.componentDidMount=function(){var e=this.state.children;for(var t in e)e[t]&&this.performAppear(t)},t.prototype.componentWillReceiveProps=function(e){var t=(0,h.getChildMapping)(e.children),n=this.state.children;this.setState({children:(0,h.mergeChildMappings)(n,t)});for(var r in t){var o=n&&n.hasOwnProperty(r);!t[r]||o||this.currentlyTransitioningKeys[r]||this.keysToEnter.push(r)}for(var i in n){var a=t&&t.hasOwnProperty(i);!n[i]||a||this.currentlyTransitioningKeys[i]||this.keysToLeave.push(i)}},t.prototype.componentDidUpdate=function(){var e=this.keysToEnter;this.keysToEnter=[],e.forEach(this.performEnter);var t=this.keysToLeave;this.keysToLeave=[],t.forEach(this.performLeave)},t.prototype.render=function(){var e=this,t=[];for(var n in this.state.children)!function(n){var r=e.state.children[n];if(r){var o="string"!=typeof r.ref;t.push(p.default.cloneElement(e.props.childFactory(r),{key:n,ref:(0,l.default)(o?r.ref:null,function(t){e.childRefs[n]=t})}))}}(n);var r=u({},this.props);return delete r.transitionLeave,delete r.transitionName,delete r.transitionAppear,delete r.transitionEnter,delete r.childFactory,delete r.transitionLeaveTimeout,delete r.transitionEnterTimeout,delete r.transitionAppearTimeout,delete r.component,p.default.createElement(this.props.component,r,t)},t}(p.default.Component);g.displayName="TransitionGroup",g.propTypes=v,g.defaultProps=y,t.default=g,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=!("undefined"==typeof window||!window.document||!window.document.createElement),e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t="transition"+e+"Timeout",n="transition"+e;return function(e){if(e[n]){if(null==e[t])return new Error(t+" wasn't supplied to CSSTransitionGroup: this can cause unreliable animations and won't be supported in a future version of React. See https://fb.me/react-animation-transition-group-timeout for more information.");if("number"!=typeof e[t])return new Error(t+" must be a number (in milliseconds)")}return null}}t.__esModule=!0,t.nameShape=void 0,t.transitionTimeout=o;var i=n(0),a=(r(i),n(1)),u=r(a);t.nameShape=u.default.oneOfType([u.default.string,u.default.shape({enter:u.default.string,leave:u.default.string,active:u.default.string}),u.default.shape({enter:u.default.string,enterActive:u.default.string,leave:u.default.string,leaveActive:u.default.string,appear:u.default.string,appearActive:u.default.string})])},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 a(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)}t.__esModule=!0;var u=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},s=n(0),l=r(s),c=n(1),p=r(c),f=n(2),d=r(f),m=n(16),h=r(m),v=n(4),y={transitionName:v.nameShape.isRequired,transitionAppear:p.default.bool,transitionEnter:p.default.bool,transitionLeave:p.default.bool,transitionAppearTimeout:(0,v.transitionTimeout)("Appear"),transitionEnterTimeout:(0,v.transitionTimeout)("Enter"),transitionLeaveTimeout:(0,v.transitionTimeout)("Leave")},g={transitionAppear:!1,transitionEnter:!0,transitionLeave:!0},T=function(e){function t(){var n,r,a;o(this,t);for(var u=arguments.length,s=Array(u),c=0;c<u;c++)s[c]=arguments[c];return n=r=i(this,e.call.apply(e,[this].concat(s))),r._wrapChild=function(e){return l.default.createElement(h.default,{name:r.props.transitionName,appear:r.props.transitionAppear,enter:r.props.transitionEnter,leave:r.props.transitionLeave,appearTimeout:r.props.transitionAppearTimeout,enterTimeout:r.props.transitionEnterTimeout,leaveTimeout:r.props.transitionLeaveTimeout},e)},a=n,i(r,a)}return a(t,e),t.prototype.render=function(){return l.default.createElement(d.default,u({},this.props,{childFactory:this._wrapChild}))},t}(l.default.Component);T.displayName="CSSTransitionGroup",T.propTypes=y,T.defaultProps=g,t.default=T,e.exports=t.default},function(e,t,n){"use strict";e.exports=function(){for(var e=arguments.length,t=[],n=0;n<e;n++)t[n]=arguments[n];if(t=t.filter(function(e){return null!=e}),0!==t.length)return 1===t.length?t[0]:t.reduce(function(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}})}},function(e,t,n){"use strict";function r(e,t){e.classList?e.classList.add(t):(0,i.default)(e)||(e.className=e.className+" "+t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var o=n(8),i=function(e){return e&&e.__esModule?e:{default:e}}(o);e.exports=t.default},function(e,t,n){"use strict";function r(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+e.className+" ").indexOf(" "+t+" ")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";e.exports=function(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationEnd=t.animationDelay=t.animationTiming=t.animationDuration=t.animationName=t.transitionEnd=t.transitionDuration=t.transitionDelay=t.transitionTiming=t.transitionProperty=t.transform=void 0;var r=n(3),o=function(e){return e&&e.__esModule?e:{default:e}}(r),i="transform",a=void 0,u=void 0,s=void 0,l=void 0,c=void 0,p=void 0,f=void 0,d=void 0,m=void 0,h=void 0,v=void 0;if(o.default){var y=function(){for(var e=document.createElement("div").style,t={O:function(e){return"o"+e.toLowerCase()},Moz:function(e){return e.toLowerCase()},Webkit:function(e){return"webkit"+e},ms:function(e){return"MS"+e}},n=Object.keys(t),r=void 0,o=void 0,i="",a=0;a<n.length;a++){var u=n[a];if(u+"TransitionProperty"in e){i="-"+u.toLowerCase(),r=t[u]("TransitionEnd"),o=t[u]("AnimationEnd");break}}return!r&&"transitionProperty"in e&&(r="transitionend"),!o&&"animationName"in e&&(o="animationend"),e=null,{animationEnd:o,transitionEnd:r,prefix:i}}();a=y.prefix,t.transitionEnd=u=y.transitionEnd,t.animationEnd=s=y.animationEnd,t.transform=i=a+"-"+i,t.transitionProperty=l=a+"-transition-property",t.transitionDuration=c=a+"-transition-duration",t.transitionDelay=f=a+"-transition-delay",t.transitionTiming=p=a+"-transition-timing-function",t.animationName=d=a+"-animation-name",t.animationDuration=m=a+"-animation-duration",t.animationTiming=h=a+"-animation-delay",t.animationDelay=v=a+"-animation-timing-function"}t.transform=i,t.transitionProperty=l,t.transitionTiming=p,t.transitionDelay=f,t.transitionDuration=c,t.transitionEnd=u,t.animationName=d,t.animationDuration=m,t.animationTiming=h,t.animationDelay=v,t.animationEnd=s,t.default={transform:i,end:u,property:l,timing:p,delay:f,duration:c}},function(e,t,n){"use strict";function r(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-p)),r=setTimeout(e,n);return p=t,r}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),i=function(e){return e&&e.__esModule?e:{default:e}}(o),a=["","webkit","moz","o","ms"],u="clearTimeout",s=r,l=void 0,c=function(e,t){return e+(e?t[0].toUpperCase()+t.substr(1):t)+"AnimationFrame"};i.default&&a.some(function(e){var t=c(e,"request");if(t in window)return u=c(e,"cancel"),s=function(e){return window[t](e)}});var p=(new Date).getTime();l=function(e){return s(e)},l.cancel=function(e){window[u]&&"function"==typeof window[u]&&window[u](e)},t.default=l,e.exports=t.default},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";function r(e,t,n,r,i,a,u,s){if(o(t),!e){var l;if(void 0===t)l=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,i,a,u,s],p=0;l=new Error(t.replace(/%s/g,function(){return c[p++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";var r=n(12),o=n(13);e.exports=function(){function e(){o(!1)}function t(){return e}e.isRequired=e;var n={array: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};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 a(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 u(e,t){return w.length?w.forEach(function(n){return e.addEventListener(n,t,!1)}):setTimeout(t,0),function(){w.length&&w.forEach(function(n){return e.removeEventListener(n,t,!1)})}}t.__esModule=!0;var s=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},l=n(7),c=r(l),p=n(9),f=r(p),d=n(11),m=r(d),h=n(10),v=n(0),y=r(v),g=n(1),T=r(g),b=n(19),E=n(4),w=[];h.transitionEnd&&w.push(h.transitionEnd),h.animationEnd&&w.push(h.animationEnd);var _={children:T.default.node,name:E.nameShape.isRequired,appear:T.default.bool,enter:T.default.bool,leave:T.default.bool,appearTimeout:T.default.number,enterTimeout:T.default.number,leaveTimeout:T.default.number},O=function(e){function t(){var n,r,a;o(this,t);for(var u=arguments.length,s=Array(u),l=0;l<u;l++)s[l]=arguments[l];return n=r=i(this,e.call.apply(e,[this].concat(s))),r.componentWillAppear=function(e){r.props.appear?r.transition("appear",e,r.props.appearTimeout):e()},r.componentWillEnter=function(e){r.props.enter?r.transition("enter",e,r.props.enterTimeout):e()},r.componentWillLeave=function(e){r.props.leave?r.transition("leave",e,r.props.leaveTimeout):e()},a=n,i(r,a)}return a(t,e),t.prototype.componentWillMount=function(){this.classNameAndNodeQueue=[],this.transitionTimeouts=[]},t.prototype.componentWillUnmount=function(){this.unmounted=!0,this.timeout&&clearTimeout(this.timeout),this.transitionTimeouts.forEach(function(e){clearTimeout(e)}),this.classNameAndNodeQueue.length=0},t.prototype.transition=function(e,t,n){var r=(0,b.findDOMNode)(this);if(!r)return void(t&&t());var o=this.props.name[e]||this.props.name+"-"+e,i=this.props.name[e+"Active"]||o+"-active",a=null,s=void 0;(0,c.default)(r,o),this.queueClassAndNode(i,r);var l=function(e){e&&e.target!==r||(clearTimeout(a),s&&s(),(0,f.default)(r,o),(0,f.default)(r,i),s&&s(),t&&t())};n?(a=setTimeout(l,n),this.transitionTimeouts.push(a)):h.transitionEnd&&(s=u(r,l))},t.prototype.queueClassAndNode=function(e,t){var n=this;this.classNameAndNodeQueue.push({className:e,node:t}),this.rafHandle||(this.rafHandle=(0,m.default)(function(){return n.flushClassNameAndNodeQueue()}))},t.prototype.flushClassNameAndNodeQueue=function(){this.unmounted||this.classNameAndNodeQueue.forEach(function(e){e.node.scrollTop,(0,c.default)(e.node,e.className)}),this.classNameAndNodeQueue.length=0,this.rafHandle=null},t.prototype.render=function(){var e=s({},this.props);return delete e.name,delete e.appear,delete e.enter,delete e.leave,delete e.appearTimeout,delete e.enterTimeout,delete e.leaveTimeout,delete e.children,y.default.cloneElement(y.default.Children.only(this.props.children),e)},t}(y.default.Component);O.displayName="CSSTransitionGroupChild",O.propTypes=_,t.default=O,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var o=n(5),i=r(o),a=n(2),u=r(a);e.exports={TransitionGroup:u.default,CSSTransitionGroup:i.default}},function(e,t,n){"use strict";function r(e){if(!e)return e;var t={};return i.Children.map(e,function(e){return e}).forEach(function(e){t[e.key]=e}),t}function o(e,t){function n(n){return t.hasOwnProperty(n)?t[n]:e[n]}e=e||{},t=t||{};var r={},o=[];for(var i in e)t.hasOwnProperty(i)?o.length&&(r[i]=o,o=[]):o.push(i);var a=void 0,u={};for(var s in t){if(r.hasOwnProperty(s))for(a=0;a<r[s].length;a++){var l=r[s][a];u[r[s][a]]=n(l)}u[s]=n(s)}for(a=0;a<o.length;a++)u[o[a]]=n(o[a]);return u}t.__esModule=!0,t.getChildMapping=r,t.mergeChildMappings=o;var i=n(0)},function(e,n){e.exports=t}])});
{
"name": "react-transition-group",
"version": "1.1.1",
"version": "1.1.2",
"description": "A react component toolset for managing animations",

@@ -39,4 +39,5 @@ "main": "index.js",

"dom-helpers": "^3.2.0",
"prop-types": "^15.5.6",
"warning": "^3.0.0"
}
}

@@ -5,2 +5,4 @@ 'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _chainFunction = require('chain-function');

@@ -14,2 +16,6 @@

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _warning = require('warning');

@@ -30,5 +36,5 @@

var propTypes = {
component: _react2.default.PropTypes.any,
childFactory: _react2.default.PropTypes.func,
children: _react2.default.PropTypes.node
component: _propTypes2.default.any,
childFactory: _propTypes2.default.func,
children: _propTypes2.default.node
};

@@ -137,3 +143,3 @@

_this.setState(function (state) {
var newChildren = Object.assign({}, state.children);
var newChildren = _extends({}, state.children);
delete newChildren[key];

@@ -235,3 +241,3 @@ return { children: newChildren };

// Do not forward TransitionGroup props to primitive DOM nodes
var props = Object.assign({}, this.props);
var props = _extends({}, this.props);
delete props.transitionLeave;

@@ -238,0 +244,0 @@ delete props.transitionName;

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

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -35,13 +39,13 @@

var nameShape = exports.nameShape = _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.shape({
enter: _react2.default.PropTypes.string,
leave: _react2.default.PropTypes.string,
active: _react2.default.PropTypes.string
}), _react2.default.PropTypes.shape({
enter: _react2.default.PropTypes.string,
enterActive: _react2.default.PropTypes.string,
leave: _react2.default.PropTypes.string,
leaveActive: _react2.default.PropTypes.string,
appear: _react2.default.PropTypes.string,
appearActive: _react2.default.PropTypes.string
var nameShape = exports.nameShape = _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({
enter: _propTypes2.default.string,
leave: _propTypes2.default.string,
active: _propTypes2.default.string
}), _propTypes2.default.shape({
enter: _propTypes2.default.string,
enterActive: _propTypes2.default.string,
leave: _propTypes2.default.string,
leaveActive: _propTypes2.default.string,
appear: _propTypes2.default.string,
appearActive: _propTypes2.default.string
})]);
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