@ndla/carousel
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -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 @@ |
@@ -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 @@ |
{ | ||
"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" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
91816
861