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

@ndla/carousel

Package Overview
Dependencies
Maintainers
5
Versions
190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ndla/carousel - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

16

es/Carousel.js

@@ -207,18 +207,2 @@ import { jsx as ___EmotionJSX } from "@emotion/core";

}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(nextProps, prevState) {
var columnsPrSlide = nextProps.columnsPrSlide,
items = nextProps.items;
var slideIndex = prevState.slideIndex; // Check if resize caused carousel to be scrolled to far.
if (Math.floor(columnsPrSlide) - items.length > slideIndex) {
var adjustedSlideIndex = slideIndex + (Math.floor(columnsPrSlide) - items.length - slideIndex);
return {
slideIndex: adjustedSlideIndex
};
}
return null;
}
}]);

@@ -225,0 +209,0 @@

3

lib/Carousel.d.ts

@@ -42,5 +42,2 @@ /**

state: State;
static getDerivedStateFromProps(nextProps: Props, prevState: State): {
slideIndex: number;
} | null;
onSwipeEnd: () => void;

@@ -47,0 +44,0 @@ onSwipe: (eventData: EventData<HTMLElement>) => void;

@@ -212,18 +212,2 @@ "use strict";

}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(nextProps, prevState) {
var columnsPrSlide = nextProps.columnsPrSlide,
items = nextProps.items;
var slideIndex = prevState.slideIndex; // Check if resize caused carousel to be scrolled to far.
if (Math.floor(columnsPrSlide) - items.length > slideIndex) {
var adjustedSlideIndex = slideIndex + (Math.floor(columnsPrSlide) - items.length - slideIndex);
return {
slideIndex: adjustedSlideIndex
};
}
return null;
}
}]);

@@ -230,0 +214,0 @@

4

package.json
{
"name": "@ndla/carousel",
"version": "0.2.1",
"version": "0.2.2",
"description": "Carousel for NDLA",

@@ -40,3 +40,3 @@ "license": "GPL-3.0",

},
"gitHead": "84b8002661e3569d84ef1d57fc5e57cf2fe6f062"
"gitHead": "a10a9609b74b75dfab092238f58a85bfe4f5fa6f"
}
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