react-multi-carousel
Advanced tools
Comparing version 1.0.14 to 1.0.15
import * as React from "react"; | ||
import { CarouselProps } from "./types"; | ||
declare const Carousel: { | ||
({ children, ...rest }: CarouselProps): React.ReactNode; | ||
displayName: string; | ||
__docgenInfo: { | ||
"description": string; | ||
"displayName": string; | ||
"props": { | ||
"responsive": { | ||
"defaultValue": null; | ||
"description": string; | ||
"name": string; | ||
"required": boolean; | ||
"type": { | ||
"name": string; | ||
}; | ||
}; | ||
"deviceType": { | ||
"defaultValue": null; | ||
"description": string; | ||
"name": string; | ||
"required": boolean; | ||
"type": { | ||
"name": string; | ||
}; | ||
}; | ||
"forSSR": { | ||
"defaultValue": null; | ||
"description": string; | ||
"name": string; | ||
"required": boolean; | ||
"type": { | ||
"name": string; | ||
}; | ||
}; | ||
"slidesToSlide": { | ||
"defaultValue": null; | ||
"description": string; | ||
"name": string; | ||
"required": boolean; | ||
"type": { | ||
"name": string; | ||
}; | ||
}; | ||
"disableDrag": { | ||
"defaultValue": null; | ||
"description": string; | ||
"name": string; | ||
"required": boolean; | ||
"type": { | ||
"name": string; | ||
}; | ||
}; | ||
"removeArrow": { | ||
"defaultValue": null; | ||
"description": string; | ||
"name": string; | ||
"required": boolean; | ||
"type": { | ||
"name": string; | ||
}; | ||
}; | ||
"disableSwipeOnMobile": { | ||
"defaultValue": null; | ||
"description": string; | ||
"name": string; | ||
"required": boolean; | ||
"type": { | ||
"name": string; | ||
}; | ||
}; | ||
"removeArrowOnDeviceType": { | ||
"defaultValue": null; | ||
"description": string; | ||
"name": string; | ||
"required": boolean; | ||
"type": { | ||
"name": string; | ||
}; | ||
}; | ||
"customLeftArrow": { | ||
"defaultValue": null; | ||
"description": string; | ||
"name": string; | ||
"required": boolean; | ||
"type": { | ||
"name": string; | ||
}; | ||
}; | ||
"customRightArrow": { | ||
"defaultValue": null; | ||
"description": string; | ||
"name": string; | ||
"required": boolean; | ||
"type": { | ||
"name": string; | ||
}; | ||
}; | ||
"infinite": { | ||
"defaultValue": null; | ||
"description": string; | ||
"name": string; | ||
"required": boolean; | ||
"type": { | ||
"name": string; | ||
}; | ||
}; | ||
"contentClassName": { | ||
"defaultValue": null; | ||
"description": string; | ||
"name": string; | ||
"required": boolean; | ||
"type": { | ||
"name": string; | ||
}; | ||
}; | ||
"itemClassName": { | ||
"defaultValue": null; | ||
"description": string; | ||
"name": string; | ||
"required": boolean; | ||
"type": { | ||
"name": string; | ||
}; | ||
}; | ||
"containerClassName": { | ||
"defaultValue": null; | ||
"description": string; | ||
"name": string; | ||
"required": boolean; | ||
"type": { | ||
"name": string; | ||
}; | ||
}; | ||
"transition": { | ||
"defaultValue": null; | ||
"description": string; | ||
"name": string; | ||
"required": boolean; | ||
"type": { | ||
"name": string; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
declare const Carousel: ({ children, ...rest }: CarouselProps) => React.ReactNode; | ||
export default Carousel; |
@@ -113,12 +113,11 @@ "use strict"; | ||
onResize() { | ||
const { itemWidth } = this.state; | ||
this.setItemsToSlide(); | ||
if (this.itemRef && | ||
this.itemRef.current && | ||
this.itemRef.current.offsetWidth !== itemWidth) { | ||
this.itemRef.current.offsetWidth !== this.state.itemWidth) { | ||
this.setState({ itemWidth: this.itemRef.current.offsetWidth }); | ||
} | ||
this.setItemsToSlide(); | ||
} | ||
resetAllItems() { | ||
this.setState({ transform: 'translate3d(0px,0,0)', currentSlide: 0 }); | ||
this.setState({ transform: "translate3d(0px,0,0)", currentSlide: 0 }); | ||
} | ||
@@ -130,3 +129,7 @@ componentDidUpdate(prevProps, { domLoaded, itemWidth }) { | ||
if (this.itemRef.current.offsetWidth !== itemWidth) { | ||
this.setState({ itemWidth: this.itemRef.current.offsetWidth }); | ||
this.setState({ | ||
itemWidth: this.itemRef.current.offsetWidth, | ||
transform: `translate3d(${-(this.itemRef.current.offsetWidth * this.state.currentSlide)}px,0,0)` | ||
}); | ||
this.setItemsToSlide(); | ||
} | ||
@@ -200,3 +203,3 @@ } | ||
!(removeArrowOnDeviceType && | ||
(deviceType && removeArrowOnDeviceType.indexOf(deviceType) > -1 || | ||
((deviceType && removeArrowOnDeviceType.indexOf(deviceType) > -1) || | ||
(this.state.deviceType && | ||
@@ -203,0 +206,0 @@ removeArrowOnDeviceType.indexOf(this.state.deviceType) > -1))); |
{ | ||
"name": "react-multi-carousel", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
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
29611
412