New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@talixo/carousel

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@talixo/carousel - npm Package Compare versions

Comparing version 1.0.0-alpha.21 to 1.0.0-alpha.24

8

dist/index.js

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

Dots.displayName = 'Dots';
Dots.propTypes = propTypes;

@@ -128,2 +130,4 @@ Dots.defaultProps = defaultProps;

Arrows.displayName = 'Arrows';
Arrows.propTypes = propTypes$1;

@@ -680,2 +684,4 @@

Carousel.displayName = 'Carousel';
Carousel.propTypes = propTypes$2;

@@ -937,2 +943,4 @@ Carousel.defaultProps = defaultProps$1;

CarouselAutoplay.displayName = 'CarouselAutoplay';
CarouselAutoplay.propTypes = propTypes$3;

@@ -939,0 +947,0 @@ CarouselAutoplay.defaultProps = defaultProps$2;

2

dist/index.min.js

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

"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var React=_interopDefault(require("react")),PropTypes=_interopDefault(require("prop-types")),shared=require("@talixo/shared"),icon=require("@talixo/icon"),reactDom=require("react-dom"),chunk=_interopDefault(require("lodash/chunk")),moduleName="carousel-dots",propTypes={className:PropTypes.string,slides:PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.node)),perPage:PropTypes.number,onChange:PropTypes.func},defaultProps={slides:[],perPage:1},emptyFn=function(){};function Dots(e){for(var t=e.slides,r=e.onChange,n=e.value,o=e.perPage,a=shared.buildClassName([moduleName,"dot"]),s=shared.buildClassName([moduleName,"dot"],null,["active"]),i=[],l=function(e){var t=r?function(){return r(e*o)}:emptyFn;i.push(React.createElement("div",{key:e,className:e===n?s:a,onClick:t}))},u=0;u<t.length;u++)l(u);return React.createElement("div",{className:shared.buildClassName(moduleName)},i)}Dots.propTypes=propTypes,Dots.defaultProps=defaultProps;var moduleName$1="carousel-arrows",propTypes$1={onBack:PropTypes.func,onForward:PropTypes.func};function Arrows(e){var t=e.onBack,r=e.onForward,n=shared.buildClassName(moduleName$1),o=shared.buildClassName([moduleName$1,"arrow"],null,["back"]),a=shared.buildClassName([moduleName$1,"arrow"],null,["forward"]);return React.createElement("div",{className:n},React.createElement("button",{className:o,onClick:t},React.createElement(icon.Icon,{name:"chevron_left"})),React.createElement("button",{className:a,onClick:r},React.createElement(icon.Icon,{name:"chevron_right"})))}Arrows.propTypes=propTypes$1;var classCallCheck=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},createClass=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}}(),inherits=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)},objectWithoutProperties=function(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},possibleConstructorReturn=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},moduleName$2="carousel";function reflow(e){return e.offsetHeight}var propTypes$2={arrows:PropTypes.bool,children:PropTypes.node,className:PropTypes.string,dots:PropTypes.bool,animationTime:PropTypes.number,infinite:PropTypes.bool,perPage:PropTypes.number,renderDots:PropTypes.func,renderArrows:PropTypes.func,value:PropTypes.number,onChange:PropTypes.func,defaultMovement:PropTypes.oneOf(["exact","forward","back"])},defaultProps$1={children:[],animationTime:500,infinite:!1,perPage:1,renderDots:Dots,renderArrows:Arrows,defaultMovement:"exact"},Carousel=function(e){function t(){var e,r,n;classCallCheck(this,t);for(var o=arguments.length,a=Array(o),s=0;s<o;s++)a[s]=arguments[s];return r=n=possibleConstructorReturn(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),n.mounted=!1,n.state={slides:chunk(n.props.children,n.props.perPage),currentSlide:null!=n.props.value?n.props.value%n.props.children.length:0,transitionTime:n.props.animationTime},n.change=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"exact",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=n.props,a=o.value,s=o.onChange,i=o.children,l=o.infinite,u=o.perPage,p=null==a||r;if(!l){var c=e%i.length,d=Math.max(0,i.length-u);c<0?e-=c:c>d&&(e-=c-d)}return s&&!r&&s(e%i.length,t),p?(n.lastMovementType=null,n.lastMovementIndex=null,"forward"===t||"back"===t?n.go(e,t):void n.setState({currentSlide:e})):(n.lastMovementType=t,void(n.lastMovementIndex=e%i.length))},n.handleForward=function(){var e=n.props.perPage,t=n.state.currentSlide;return n.change(t+e,"forward")},n.handleBack=function(){var e=n.props.perPage,t=n.state.currentSlide;return n.change(t-e,"back")},n.handleExact=function(e){return n.change(e,"exact")},n.setRef=function(e){n.wrapper=reactDom.findDOMNode(e)},possibleConstructorReturn(n,r)}return inherits(t,e),createClass(t,[{key:"componentDidMount",value:function(){this.mounted=!0}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"componentWillReceiveProps",value:function(e){if(e.animationTime!==this.props.animationTime&&this.setState({transitionTime:e.animationTime}),null!=e.value&&this.props.value!==e.value){var t=e.value%e.children.length,r=this.lastMovementIndex===t?this.lastMovementType:this.props.defaultMovement;this.change(t,r,!0)}this.state.currentSlide%this.props.children.length>=e.children.length&&this.setState({currentSlide:e.children.length-1}),e.children===this.props.children&&e.perPage===this.props.perPage||this.setState({slides:chunk(e.children,e.perPage)})}},{key:"goImmediately",value:function(e){var t=this,r=this.state.currentSlide,n=this.props.animationTime;return e===r?Promise.resolve():new Promise(function(r){t.setState({currentSlide:e,transitionTime:0},function(){reflow(t.wrapper),t.setState({transitionTime:n},r)})})}},{key:"go",value:function(e){for(var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"forward",n=this.props,o=n.children,a=n.perPage,s=this.state.currentSlide,i=o.length;i<a;)i+=o.length;for(;e<0;)e=i+e;var l=s%i,u=e%i;"forward"===r?u=u>l?u:i+u:l=u>l?i+l:l,this.goImmediately(l).then(function(){t.mounted&&t.setState({currentSlide:u})})}},{key:"renderSlides",value:function(){var e=this.props,t=e.children,r=e.infinite,n=e.perPage,o=shared.buildClassName([moduleName$2,"slide"]),a={minWidth:100/n+"%",maxWidth:100/n+"%"},s=[];if(r)for(var i=0;i<Math.max(t.length)+3*n;i++)s.push(React.createElement("div",{className:o,style:a,key:"copy-"+i},t[i%t.length]));return t.map(function(e,t){return React.createElement("div",{className:o,style:a,key:t},e)}).concat(s)}},{key:"buildMovementProps",value:function(){var e=this.props,t=(e.renderDots,e.renderArrows,e.children),r=e.perPage,n=objectWithoutProperties(e,["renderDots","renderArrows","children","perPage"]),o=this.state,a=o.currentSlide,s=o.slides,i=a%t.length;return Object.assign({},n,{slides:s,children:t,perPage:r,index:i,value:Math.floor(i/r)})}},{key:"renderDots",value:function(){var e=this.props.renderDots;return React.createElement(e,Object.assign({},this.buildMovementProps(),{onChange:this.handleExact}))}},{key:"renderArrows",value:function(){var e=this.props,t=e.children,r=e.infinite,n=e.perPage,o=e.renderArrows,a=this.state.currentSlide,s=0===a,i=a>=t.length-n,l=Object.assign({},this.buildMovementProps());return s&&!r||(l.onBack=this.handleBack),i&&!r||(l.onForward=this.handleForward),React.createElement(o,l)}},{key:"render",value:function(){var e=this.props,t=e.arrows,r=e.className,n=e.dots,o=e.perPage,a=e.children,s=(e.animationTime,e.infinite),i=(e.renderArrows,e.renderDots,e.value,e.onChange,e.defaultMovement,objectWithoutProperties(e,["arrows","className","dots","perPage","children","animationTime","infinite","renderArrows","renderDots","value","onChange","defaultMovement"])),l=this.state,u=l.currentSlide,p=l.transitionTime,c=0===u,d=u>=a.length-o,h=shared.buildClassName(moduleName$2,r),m=shared.buildClassName([moduleName$2,"content"],null,{first:!s&&c,last:!s&&d}),f=shared.buildClassName([moduleName$2,"wrapper"]),v=shared.buildClassName([moduleName$2,"inner"]),y=n?this.renderDots():null,g=t?this.renderArrows():null,P={ref:this.setRef,style:{transform:"translateX(-"+100*u/o+"%)",transitionDuration:p+"ms"}};return React.createElement("div",Object.assign({className:h},i),React.createElement("div",{className:m},g,React.createElement("div",Object.assign({className:f},P),React.createElement("div",{className:v},this.renderSlides()))),y)}}]),t}(React.PureComponent);Carousel.propTypes=propTypes$2,Carousel.defaultProps=defaultProps$1;var propTypes$3={initialSlide:PropTypes.number,movement:PropTypes.oneOf(["exact","forward","back"]),interval:PropTypes.number,step:PropTypes.number,children:PropTypes.node},defaultProps$2={movement:"forward",interval:3e3},CarouselAutoplay=function(e){function t(e){classCallCheck(this,t);var r=possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.mounted=!1,r.change=function(e){e!==r.state.value&&(r.setState({carousel:r.buildCarousel(r.props,e),value:e}),r.mounted&&(r.stop(),r.tick()))};var n=r.buildCarousel(r.props,r.props.initialSlide);return r.state={carousel:n,value:n.props.value},r}return inherits(t,e),createClass(t,[{key:"componentDidMount",value:function(){this.tick(),this.mounted=!0}},{key:"componentWillUnmount",value:function(){this.stop(),this.mounted=!1}},{key:"tick",value:function(){var e=this;this.tickTimeout=setTimeout(function(){e.next(),e.tick()},this.props.interval)}},{key:"stop",value:function(){clearTimeout(this.tickTimeout)}},{key:"buildCarousel",value:function(e,t){var r=this,n=React.Children.only(e.children),o=n.props.infinite?e.movement:"exact";null==t&&(t=+n.props.value||0);var a=n.props.onChange;return React.cloneElement(e.children,{value:t||0,defaultMovement:o,onChange:null==a?this.change:function(){r.change.apply(r,arguments),a.apply(void 0,arguments)}})}},{key:"next",value:function(){var e=this.props.movement,t=this.state,r=t.value,n=t.carousel,o="back"===e?-1:1,a=null==this.props.step?+n.props.perPage||1:this.props.step,s=(n.props.children.length+r+o*a)%n.props.children.length;this.setState({carousel:this.buildCarousel(this.props,s),value:s})}},{key:"componentWillReceiveProps",value:function(e){var t=this;e.children===this.props.children&&e.movement===this.props.movement||this.setState({carousel:this.buildCarousel(e,this.state.value)}),this.props.interval!==e.interval&&this.mounted&&(this.stop(),this.tickTimeout=setTimeout(function(){return t.tick()}))}},{key:"render",value:function(){return this.state.carousel}}]),t}(React.PureComponent);CarouselAutoplay.propTypes=propTypes$3,CarouselAutoplay.defaultProps=defaultProps$2,exports.Carousel=Carousel,exports.CarouselAutoplay=CarouselAutoplay;
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var React=_interopDefault(require("react")),PropTypes=_interopDefault(require("prop-types")),shared=require("@talixo/shared"),icon=require("@talixo/icon"),reactDom=require("react-dom"),chunk=_interopDefault(require("lodash/chunk")),moduleName="carousel-dots",propTypes={className:PropTypes.string,slides:PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.node)),perPage:PropTypes.number,onChange:PropTypes.func},defaultProps={slides:[],perPage:1},emptyFn=function(){};function Dots(e){for(var t=e.slides,r=e.onChange,n=e.value,o=e.perPage,a=shared.buildClassName([moduleName,"dot"]),s=shared.buildClassName([moduleName,"dot"],null,["active"]),i=[],l=function(e){var t=r?function(){return r(e*o)}:emptyFn;i.push(React.createElement("div",{key:e,className:e===n?s:a,onClick:t}))},u=0;u<t.length;u++)l(u);return React.createElement("div",{className:shared.buildClassName(moduleName)},i)}Dots.displayName="Dots",Dots.propTypes=propTypes,Dots.defaultProps=defaultProps;var moduleName$1="carousel-arrows",propTypes$1={onBack:PropTypes.func,onForward:PropTypes.func};function Arrows(e){var t=e.onBack,r=e.onForward,n=shared.buildClassName(moduleName$1),o=shared.buildClassName([moduleName$1,"arrow"],null,["back"]),a=shared.buildClassName([moduleName$1,"arrow"],null,["forward"]);return React.createElement("div",{className:n},React.createElement("button",{className:o,onClick:t},React.createElement(icon.Icon,{name:"chevron_left"})),React.createElement("button",{className:a,onClick:r},React.createElement(icon.Icon,{name:"chevron_right"})))}Arrows.displayName="Arrows",Arrows.propTypes=propTypes$1;var classCallCheck=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},createClass=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}}(),inherits=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)},objectWithoutProperties=function(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},possibleConstructorReturn=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},moduleName$2="carousel";function reflow(e){return e.offsetHeight}var propTypes$2={arrows:PropTypes.bool,children:PropTypes.node,className:PropTypes.string,dots:PropTypes.bool,animationTime:PropTypes.number,infinite:PropTypes.bool,perPage:PropTypes.number,renderDots:PropTypes.func,renderArrows:PropTypes.func,value:PropTypes.number,onChange:PropTypes.func,defaultMovement:PropTypes.oneOf(["exact","forward","back"])},defaultProps$1={children:[],animationTime:500,infinite:!1,perPage:1,renderDots:Dots,renderArrows:Arrows,defaultMovement:"exact"},Carousel=function(e){function t(){var e,r,n;classCallCheck(this,t);for(var o=arguments.length,a=Array(o),s=0;s<o;s++)a[s]=arguments[s];return r=n=possibleConstructorReturn(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),n.mounted=!1,n.state={slides:chunk(n.props.children,n.props.perPage),currentSlide:null!=n.props.value?n.props.value%n.props.children.length:0,transitionTime:n.props.animationTime},n.change=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"exact",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=n.props,a=o.value,s=o.onChange,i=o.children,l=o.infinite,u=o.perPage,p=null==a||r;if(!l){var c=e%i.length,d=Math.max(0,i.length-u);c<0?e-=c:c>d&&(e-=c-d)}return s&&!r&&s(e%i.length,t),p?(n.lastMovementType=null,n.lastMovementIndex=null,"forward"===t||"back"===t?n.go(e,t):void n.setState({currentSlide:e})):(n.lastMovementType=t,void(n.lastMovementIndex=e%i.length))},n.handleForward=function(){var e=n.props.perPage,t=n.state.currentSlide;return n.change(t+e,"forward")},n.handleBack=function(){var e=n.props.perPage,t=n.state.currentSlide;return n.change(t-e,"back")},n.handleExact=function(e){return n.change(e,"exact")},n.setRef=function(e){n.wrapper=reactDom.findDOMNode(e)},possibleConstructorReturn(n,r)}return inherits(t,e),createClass(t,[{key:"componentDidMount",value:function(){this.mounted=!0}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"componentWillReceiveProps",value:function(e){if(e.animationTime!==this.props.animationTime&&this.setState({transitionTime:e.animationTime}),null!=e.value&&this.props.value!==e.value){var t=e.value%e.children.length,r=this.lastMovementIndex===t?this.lastMovementType:this.props.defaultMovement;this.change(t,r,!0)}this.state.currentSlide%this.props.children.length>=e.children.length&&this.setState({currentSlide:e.children.length-1}),e.children===this.props.children&&e.perPage===this.props.perPage||this.setState({slides:chunk(e.children,e.perPage)})}},{key:"goImmediately",value:function(e){var t=this,r=this.state.currentSlide,n=this.props.animationTime;return e===r?Promise.resolve():new Promise(function(r){t.setState({currentSlide:e,transitionTime:0},function(){reflow(t.wrapper),t.setState({transitionTime:n},r)})})}},{key:"go",value:function(e){for(var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"forward",n=this.props,o=n.children,a=n.perPage,s=this.state.currentSlide,i=o.length;i<a;)i+=o.length;for(;e<0;)e=i+e;var l=s%i,u=e%i;"forward"===r?u=u>l?u:i+u:l=u>l?i+l:l,this.goImmediately(l).then(function(){t.mounted&&t.setState({currentSlide:u})})}},{key:"renderSlides",value:function(){var e=this.props,t=e.children,r=e.infinite,n=e.perPage,o=shared.buildClassName([moduleName$2,"slide"]),a={minWidth:100/n+"%",maxWidth:100/n+"%"},s=[];if(r)for(var i=0;i<Math.max(t.length)+3*n;i++)s.push(React.createElement("div",{className:o,style:a,key:"copy-"+i},t[i%t.length]));return t.map(function(e,t){return React.createElement("div",{className:o,style:a,key:t},e)}).concat(s)}},{key:"buildMovementProps",value:function(){var e=this.props,t=(e.renderDots,e.renderArrows,e.children),r=e.perPage,n=objectWithoutProperties(e,["renderDots","renderArrows","children","perPage"]),o=this.state,a=o.currentSlide,s=o.slides,i=a%t.length;return Object.assign({},n,{slides:s,children:t,perPage:r,index:i,value:Math.floor(i/r)})}},{key:"renderDots",value:function(){var e=this.props.renderDots;return React.createElement(e,Object.assign({},this.buildMovementProps(),{onChange:this.handleExact}))}},{key:"renderArrows",value:function(){var e=this.props,t=e.children,r=e.infinite,n=e.perPage,o=e.renderArrows,a=this.state.currentSlide,s=0===a,i=a>=t.length-n,l=Object.assign({},this.buildMovementProps());return s&&!r||(l.onBack=this.handleBack),i&&!r||(l.onForward=this.handleForward),React.createElement(o,l)}},{key:"render",value:function(){var e=this.props,t=e.arrows,r=e.className,n=e.dots,o=e.perPage,a=e.children,s=(e.animationTime,e.infinite),i=(e.renderArrows,e.renderDots,e.value,e.onChange,e.defaultMovement,objectWithoutProperties(e,["arrows","className","dots","perPage","children","animationTime","infinite","renderArrows","renderDots","value","onChange","defaultMovement"])),l=this.state,u=l.currentSlide,p=l.transitionTime,c=0===u,d=u>=a.length-o,h=shared.buildClassName(moduleName$2,r),m=shared.buildClassName([moduleName$2,"content"],null,{first:!s&&c,last:!s&&d}),f=shared.buildClassName([moduleName$2,"wrapper"]),v=shared.buildClassName([moduleName$2,"inner"]),y=n?this.renderDots():null,g=t?this.renderArrows():null,P={ref:this.setRef,style:{transform:"translateX(-"+100*u/o+"%)",transitionDuration:p+"ms"}};return React.createElement("div",Object.assign({className:h},i),React.createElement("div",{className:m},g,React.createElement("div",Object.assign({className:f},P),React.createElement("div",{className:v},this.renderSlides()))),y)}}]),t}(React.PureComponent);Carousel.displayName="Carousel",Carousel.propTypes=propTypes$2,Carousel.defaultProps=defaultProps$1;var propTypes$3={initialSlide:PropTypes.number,movement:PropTypes.oneOf(["exact","forward","back"]),interval:PropTypes.number,step:PropTypes.number,children:PropTypes.node},defaultProps$2={movement:"forward",interval:3e3},CarouselAutoplay=function(e){function t(e){classCallCheck(this,t);var r=possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.mounted=!1,r.change=function(e){e!==r.state.value&&(r.setState({carousel:r.buildCarousel(r.props,e),value:e}),r.mounted&&(r.stop(),r.tick()))};var n=r.buildCarousel(r.props,r.props.initialSlide);return r.state={carousel:n,value:n.props.value},r}return inherits(t,e),createClass(t,[{key:"componentDidMount",value:function(){this.tick(),this.mounted=!0}},{key:"componentWillUnmount",value:function(){this.stop(),this.mounted=!1}},{key:"tick",value:function(){var e=this;this.tickTimeout=setTimeout(function(){e.next(),e.tick()},this.props.interval)}},{key:"stop",value:function(){clearTimeout(this.tickTimeout)}},{key:"buildCarousel",value:function(e,t){var r=this,n=React.Children.only(e.children),o=n.props.infinite?e.movement:"exact";null==t&&(t=+n.props.value||0);var a=n.props.onChange;return React.cloneElement(e.children,{value:t||0,defaultMovement:o,onChange:null==a?this.change:function(){r.change.apply(r,arguments),a.apply(void 0,arguments)}})}},{key:"next",value:function(){var e=this.props.movement,t=this.state,r=t.value,n=t.carousel,o="back"===e?-1:1,a=null==this.props.step?+n.props.perPage||1:this.props.step,s=(n.props.children.length+r+o*a)%n.props.children.length;this.setState({carousel:this.buildCarousel(this.props,s),value:s})}},{key:"componentWillReceiveProps",value:function(e){var t=this;e.children===this.props.children&&e.movement===this.props.movement||this.setState({carousel:this.buildCarousel(e,this.state.value)}),this.props.interval!==e.interval&&this.mounted&&(this.stop(),this.tickTimeout=setTimeout(function(){return t.tick()}))}},{key:"render",value:function(){return this.state.carousel}}]),t}(React.PureComponent);CarouselAutoplay.displayName="CarouselAutoplay",CarouselAutoplay.propTypes=propTypes$3,CarouselAutoplay.defaultProps=defaultProps$2,exports.Carousel=Carousel,exports.CarouselAutoplay=CarouselAutoplay;

@@ -63,4 +63,6 @@ 'use strict';

Arrows.displayName = 'Arrows';
Arrows.propTypes = propTypes;
exports.default = Arrows;

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

Carousel.displayName = 'Carousel';
Carousel.propTypes = propTypes;

@@ -537,0 +539,0 @@ Carousel.defaultProps = defaultProps;

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

CarouselAutoplay.displayName = 'CarouselAutoplay';
CarouselAutoplay.propTypes = propTypes;

@@ -281,0 +283,0 @@ CarouselAutoplay.defaultProps = defaultProps;

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

Dots.displayName = 'Dots';
Dots.propTypes = propTypes;

@@ -89,0 +91,0 @@ Dots.defaultProps = defaultProps;

{
"name": "@talixo/carousel",
"version": "1.0.0-alpha.21",
"version": "1.0.0-alpha.24",
"description": "UI Component which represents Carousel",

@@ -26,4 +26,4 @@ "main": "dist/index.js",

"devDependencies": {
"@talixo/icon": "^1.0.0-alpha.20",
"@talixo/shared": "^1.0.0-alpha.20",
"@talixo/icon": "^1.0.0-alpha.24",
"@talixo/shared": "^1.0.0-alpha.24",
"lodash": "^4.17.10",

@@ -35,4 +35,4 @@ "prop-types": "^15.6.1",

"peerDependencies": {
"@talixo/icon": "^1.0.0-alpha.20",
"@talixo/shared": "^1.0.0-alpha.20",
"@talixo/icon": "^1.0.0-alpha.24",
"@talixo/shared": "^1.0.0-alpha.24",
"lodash": "^4.17.10",

@@ -39,0 +39,0 @@ "prop-types": "^15.6.1",

@@ -14,4 +14,4 @@ # Talixo Carousel

- `@talixo/icon: ^1.0.0-alpha.20`
- `@talixo/shared: ^1.0.0-alpha.20`
- `@talixo/icon: ^1.0.0-alpha.24`
- `@talixo/shared: ^1.0.0-alpha.24`
- `lodash: ^4.17.10`

@@ -18,0 +18,0 @@ - `prop-types: ^15.6.1`

@@ -45,4 +45,6 @@ import React from 'react'

Arrows.displayName = 'Arrows'
Arrows.propTypes = propTypes
export default Arrows

@@ -415,2 +415,4 @@ import React from 'react'

Carousel.displayName = 'Carousel'
Carousel.propTypes = propTypes

@@ -417,0 +419,0 @@ Carousel.defaultProps = defaultProps

@@ -214,2 +214,4 @@ import React from 'react'

CarouselAutoplay.displayName = 'CarouselAutoplay'
CarouselAutoplay.propTypes = propTypes

@@ -216,0 +218,0 @@ CarouselAutoplay.defaultProps = defaultProps

@@ -66,2 +66,4 @@ import React from 'react'

Dots.displayName = 'Dots'
Dots.propTypes = propTypes

@@ -68,0 +70,0 @@ Dots.defaultProps = defaultProps

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