From 9715ec0535b7d2a8d39a4486c4037afe9a8bc636 Mon Sep 17 00:00:00 2001 From: Joshua Comeau Date: Tue, 12 Apr 2016 21:29:47 -0400 Subject: [PATCH] Add support for Internet Explorer 10 --- README.md | 6 ++++-- dist/react-flip-move.js | 22 ++++++++++------------ dist/react-flip-move.min.js | 2 +- package.json | 2 +- src/FlipMove.js | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index a1d7c9d..eec43ac 100644 --- a/README.md +++ b/README.md @@ -96,8 +96,10 @@ class TopArticles extends Component { ## Compatibility -Tested in Chrome and Firefox. Will test and ensure compatibility with IE 10+ and Safari very shortly. -'' +| | Chrome | Firefox | Safari | IE | Edge | iOS Safari/Chrome | Android Chrome | +|-----------|:------:|:-------:|:------:|:-----:|:----:|:-----------------:|:--------------:| +| Supported | ✔ 10+ | ✔ 4+ | ✔ 6.1+ | ✔ 10+ | ✔ | ✔ 6.1+ | ✔ | + ## How It Works diff --git a/dist/react-flip-move.js b/dist/react-flip-move.js index aba6f52..45afc55 100644 --- a/dist/react-flip-move.js +++ b/dist/react-flip-move.js @@ -150,10 +150,6 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - Object.defineProperty(exports, "__esModule", { - value: true - }); - var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); 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; }; @@ -176,6 +172,10 @@ return /******/ (function(modules) { // webpackBootstrap * transition between their positions. */ + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _react = __webpack_require__(2); var _react2 = _interopRequireDefault(_react); @@ -227,7 +227,7 @@ return /******/ (function(modules) { // webpackBootstrap // We want to keep the item rendered for a little while, until its animation // can complete. Because we cannot mutate props, we make `state` the source // of truth. - _this.state = { children: _this.props.children }; + _this.state = { children: props.children }; // Keep track of remaining animations so we know when to fire the // all-finished callback, and clean up after ourselves. @@ -499,7 +499,6 @@ return /******/ (function(modules) { // webpackBootstrap var dX = _getPositionDelta4[0]; var dY = _getPositionDelta4[1]; - return dX !== 0 || dY !== 0; } }, { @@ -599,7 +598,6 @@ return /******/ (function(modules) { // webpackBootstrap var staggerDelayBy = _props.staggerDelayBy; var easing = _props.easing; - delay += n * staggerDelayBy; duration += n * staggerDurationBy; @@ -764,16 +762,16 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - Object.defineProperty(exports, "__esModule", { - value: true - }); - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; 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 _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _react = __webpack_require__(2); var _react2 = _interopRequireDefault(_react); @@ -848,7 +846,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'convertAnimationProp', value: function convertAnimationProp(animation, presets) { - var newAnimation = void 0; + var newAnimation = undefined; switch (typeof animation === 'undefined' ? 'undefined' : _typeof(animation)) { case 'boolean': diff --git a/dist/react-flip-move.min.js b/dist/react-flip-move.min.js index f1c220c..081654d 100644 --- a/dist/react-flip-move.min.js +++ b/dist/react-flip-move.min.js @@ -1 +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.FlipMove=t(require("react"),require("react-dom")):e.FlipMove=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]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";e.exports=n(3)},function(e,t){"use strict";function n(e,t){var n="string"==typeof e?parseInt(e):e;return isNaN(n)&&console.error("Invalid prop '"+t+"' supplied to FlipMove. Expected a number, or a string that can easily be resolved to a number (eg. \"100\"). Instead, received '"+e+"'."),n}function r(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return t.map(n)}function o(e,t){var n=arguments.length<=2||void 0===arguments[2]?"key":arguments[2];return t.filter(function(t){return!e.find(function(e){return e[n]===t[n]})})}function i(e,t){Object.keys(t).forEach(function(n){e.style[n]=t[n]})}function a(){var e={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};if("undefined"==typeof document)return"";var t=document.createElement("fakeelement");for(var n in e)if(void 0!==t.style[n])return e[n]}Object.defineProperty(t,"__esModule",{value:!0}),t.convertToInt=n,t.convertAllToInt=r,t.filterNewItems=o,t.applyStylesToDOMNode=i,t.whichTransitionEvent=a},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,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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 s(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 l,p=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){o=!0,i=l}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=Object.assign||function(e){for(var t=1;t>>0,o=arguments[1],i=0;r>i;i++)if(t=n[i],e.call(o,t,i,n))return t})},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){var t,n;return n=t=function(t){function n(){return o(this,n),i(this,Object.getPrototypeOf(n).apply(this,arguments))}return a(n,t),u(n,[{key:"convertProps",value:function(e){var t=p({},e),n=["duration","delay","staggerDurationBy","staggerDelayBy"];return n.forEach(function(e){return t[e]=(0,d.convertToInt)(t[e],e)}),t.children=c.default.Children.toArray(this.props.children),t.enterAnimation=this.convertAnimationProp(t.enterAnimation,y.enterPresets),t.leaveAnimation=this.convertAnimationProp(t.leaveAnimation,y.leavePresets),"undefined"!=typeof e.disableAnimations&&(console.warn("Warning, via react-flip-move: `disableAnimations` is deprecated. Please switch to use `disableAllAnimations`. This will become a silent error in future versions."),t.disableAnimations=void 0,t.disableAllAnimations=e.disableAnimations),t}},{key:"convertAnimationProp",value:function(e,t){var n=void 0;switch("undefined"==typeof e?"undefined":l(e)){case"boolean":n=t[e?y.defaultPreset:y.disablePreset];break;case"string":var r=Object.keys(t);-1===r.indexOf(e)?(console.warn("Warning, via react-flip-move: You supplied an invalid preset name of '"+e+"'. The accepted values are: "+r.join(", ")+". Defaulting to "+y.defaultPreset),n=t[y.defaultPreset]):n=t[e];break;case"object":"object"===l(e.from)&&"object"===l(e.to)||console.error("Error, via react-flip-move: Please provide `from` and `to` properties when supplying a custom animation object, or use a preset."),n=e}return n}},{key:"render",value:function(){return c.default.createElement(e,this.convertProps(this.props))}}]),n}(f.Component),t.propTypes={children:f.PropTypes.oneOfType([f.PropTypes.array,f.PropTypes.object]).isRequired,easing:f.PropTypes.string,duration:f.PropTypes.oneOfType([f.PropTypes.string,f.PropTypes.number]),delay:f.PropTypes.oneOfType([f.PropTypes.string,f.PropTypes.number]),staggerDurationBy:f.PropTypes.oneOfType([f.PropTypes.string,f.PropTypes.number]),staggerDelayBy:f.PropTypes.oneOfType([f.PropTypes.string,f.PropTypes.number]),onStart:f.PropTypes.func,onFinish:f.PropTypes.func,onFinishAll:f.PropTypes.func,className:f.PropTypes.string,typeName:f.PropTypes.string,disableAllAnimations:f.PropTypes.bool,enterAnimation:f.PropTypes.oneOfType([f.PropTypes.string,f.PropTypes.bool,f.PropTypes.object]),leaveAnimation:f.PropTypes.oneOfType([f.PropTypes.string,f.PropTypes.bool,f.PropTypes.object])},t.defaultProps={easing:"ease-in-out",duration:350,delay:0,staggerDurationBy:0,staggerDelayBy:0,typeName:"div",enterAnimation:y.defaultPreset,leaveAnimation:y.defaultPreset},n}Object.defineProperty(t,"__esModule",{value:!0});var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},p=Object.assign||function(e){for(var t=1;tr;r++)t[r]=arguments[r];return t.map(n)}function o(e,t){var n=arguments.length<=2||void 0===arguments[2]?"key":arguments[2];return t.filter(function(t){return!e.find(function(e){return e[n]===t[n]})})}function i(e,t){Object.keys(t).forEach(function(n){e.style[n]=t[n]})}function a(){var e={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};if("undefined"==typeof document)return"";var t=document.createElement("fakeelement");for(var n in e)if(void 0!==t.style[n])return e[n]}Object.defineProperty(t,"__esModule",{value:!0}),t.convertToInt=n,t.convertAllToInt=r,t.filterNewItems=o,t.applyStylesToDOMNode=i,t.whichTransitionEvent=a},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,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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 s(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,u=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){o=!0,i=l}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=Object.assign||function(e){for(var t=1;t>>0,o=arguments[1],i=0;r>i;i++)if(t=n[i],e.call(o,t,i,n))return t})},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){var t,n;return n=t=function(t){function n(){return o(this,n),i(this,Object.getPrototypeOf(n).apply(this,arguments))}return a(n,t),p(n,[{key:"convertProps",value:function(e){var t=u({},e),n=["duration","delay","staggerDurationBy","staggerDelayBy"];return n.forEach(function(e){return t[e]=(0,d.convertToInt)(t[e],e)}),t.children=c.default.Children.toArray(this.props.children),t.enterAnimation=this.convertAnimationProp(t.enterAnimation,y.enterPresets),t.leaveAnimation=this.convertAnimationProp(t.leaveAnimation,y.leavePresets),"undefined"!=typeof e.disableAnimations&&(console.warn("Warning, via react-flip-move: `disableAnimations` is deprecated. Please switch to use `disableAllAnimations`. This will become a silent error in future versions."),t.disableAnimations=void 0,t.disableAllAnimations=e.disableAnimations),t}},{key:"convertAnimationProp",value:function(e,t){var n=void 0;switch("undefined"==typeof e?"undefined":l(e)){case"boolean":n=t[e?y.defaultPreset:y.disablePreset];break;case"string":var r=Object.keys(t);-1===r.indexOf(e)?(console.warn("Warning, via react-flip-move: You supplied an invalid preset name of '"+e+"'. The accepted values are: "+r.join(", ")+". Defaulting to "+y.defaultPreset),n=t[y.defaultPreset]):n=t[e];break;case"object":("object"!==l(e.from)||"object"!==l(e.to))&&console.error("Error, via react-flip-move: Please provide `from` and `to` properties when supplying a custom animation object, or use a preset."),n=e}return n}},{key:"render",value:function(){return c.default.createElement(e,this.convertProps(this.props))}}]),n}(f.Component),t.propTypes={children:f.PropTypes.oneOfType([f.PropTypes.array,f.PropTypes.object]).isRequired,easing:f.PropTypes.string,duration:f.PropTypes.oneOfType([f.PropTypes.string,f.PropTypes.number]),delay:f.PropTypes.oneOfType([f.PropTypes.string,f.PropTypes.number]),staggerDurationBy:f.PropTypes.oneOfType([f.PropTypes.string,f.PropTypes.number]),staggerDelayBy:f.PropTypes.oneOfType([f.PropTypes.string,f.PropTypes.number]),onStart:f.PropTypes.func,onFinish:f.PropTypes.func,onFinishAll:f.PropTypes.func,className:f.PropTypes.string,typeName:f.PropTypes.string,disableAllAnimations:f.PropTypes.bool,enterAnimation:f.PropTypes.oneOfType([f.PropTypes.string,f.PropTypes.bool,f.PropTypes.object]),leaveAnimation:f.PropTypes.oneOfType([f.PropTypes.string,f.PropTypes.bool,f.PropTypes.object])},t.defaultProps={easing:"ease-in-out",duration:350,delay:0,staggerDurationBy:0,staggerDelayBy:0,typeName:"div",enterAnimation:y.defaultPreset,leaveAnimation:y.defaultPreset},n}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},u=Object.assign||function(e){for(var t=1;t