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

nuka-carousel

Package Overview
Dependencies
Maintainers
25
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuka-carousel - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

7

lib/carousel.js

@@ -95,2 +95,3 @@ 'use strict';

initialSlideWidth: _propTypes2.default.number,
onResize: _propTypes2.default.func,
shouldRecalculateHeight: _propTypes2.default.bool,

@@ -124,2 +125,3 @@ slideIndex: _propTypes2.default.number,

heightMode: 'first',
onResize: function onResize() {},
shouldRecalculateHeight: false,

@@ -633,3 +635,3 @@ slideIndex: 0,

onResize: function onResize() {
this.setDimensions();
this.setDimensions(null, this.props.onResize);
},

@@ -692,2 +694,4 @@ onReadyStateChange: function onReadyStateChange() {

setDimensions: function setDimensions(props) {
var stateCb = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
props = props || this.props;

@@ -752,2 +756,3 @@

}, function () {
stateCb();
self.setLeft();

@@ -754,0 +759,0 @@ });

2

package.json
{
"name": "nuka-carousel",
"version": "3.1.0",
"version": "3.2.0",
"description": "Pure React Carousel",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -76,2 +76,3 @@ 'use strict';

initialSlideWidth: PropTypes.number,
onResize: PropTypes.func,
shouldRecalculateHeight: PropTypes.bool,

@@ -108,2 +109,3 @@ slideIndex: PropTypes.number,

heightMode: 'first',
onResize: function() { },
shouldRecalculateHeight: false,

@@ -731,3 +733,3 @@ slideIndex: 0,

onResize() {
this.setDimensions();
this.setDimensions(null, this.props.onResize);
},

@@ -805,3 +807,3 @@

setDimensions(props) {
setDimensions(props, stateCb = () => {}) {
props = props || this.props;

@@ -873,2 +875,3 @@

function() {
stateCb();
self.setLeft();

@@ -875,0 +878,0 @@ }

@@ -521,2 +521,20 @@ 'use strict';

describe('setDimensions', () => {
it('should call the method\'s callback after setState', () => {
var onResizeSpy = sinon.stub();
component = ReactDOM.render(
React.createElement(carousel, { onResize: onResizeSpy },
React.createElement('p', null, 'Slide 1'),
React.createElement('p', null, 'Slide 2'),
React.createElement('p', null, 'Slide 3')
),
container
);
component.onResize();
expect(onResizeSpy).to.have.been.called;
});
});
it('should advance if nextSlide() is called', function() {

@@ -523,0 +541,0 @@ component = ReactDOM.render(

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