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

react-img-carousel

Package Overview
Dependencies
Maintainers
3
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-img-carousel - npm Package Compare versions

Comparing version 1.3.3 to 1.4.0

32

lib/index.js

@@ -19,14 +19,4 @@ 'use strict';

var _lodash = require('lodash.nth');
var _lodash = require('lodash');
var _lodash2 = _interopRequireDefault(_lodash);
var _lodash3 = require('lodash.merge');
var _lodash4 = _interopRequireDefault(_lodash3);
var _lodash5 = require('lodash.inrange');
var _lodash6 = _interopRequireDefault(_lodash5);
var _ms = require('ms');

@@ -280,3 +270,3 @@

for (var index = startIndex; index < endIndex; index++) {
var slide = (0, _lodash2.default)(slides, index % slides.length);
var slide = (0, _lodash.nth)(slides, index % slides.length);
var imageSrc = slide.props.src;

@@ -294,3 +284,3 @@ if (imageSrc && !loadedImages[imageSrc]) {

_this3.setState({
loadedImages: (0, _lodash4.default)({}, _this3.state.loadedImages, _defineProperty({}, image, { width: img.width || 'auto', height: img.height || 'auto' }))
loadedImages: (0, _lodash.merge)({}, _this3.state.loadedImages, _defineProperty({}, image, { width: img.width || 'auto', height: img.height || 'auto' }))
});

@@ -513,7 +503,7 @@ }

});
var containerStyle = (0, _lodash4.default)({}, style.container || {}, {
var containerStyle = (0, _lodash.merge)({}, style.container || {}, {
width: width,
height: height
});
var innerContainerStyle = (0, _lodash4.default)({}, style.containerInner || {}, {
var innerContainerStyle = (0, _lodash.merge)({}, style.containerInner || {}, {
width: width,

@@ -523,3 +513,3 @@ height: height,

});
var viewportStyle = (0, _lodash4.default)({}, style.viewport || {}, {
var viewportStyle = (0, _lodash.merge)({}, style.viewport || {}, {
width: viewportWidth,

@@ -531,3 +521,3 @@ height: viewportHeight || slideHeight || 'auto'

var leftPos = leftOffset + dragOffset;
trackStyle = (0, _lodash4.default)({}, trackStyle, {
trackStyle = (0, _lodash.merge)({}, trackStyle, {
transform: 'translateX(' + leftPos + 'px)',

@@ -653,5 +643,5 @@ transition: transitionDuration ? 'transform ' + (0, _ms2.default)('' + transitionDuration) + 'ms ' + easing : 'none'

slideStyle = (0, _lodash4.default)({}, slideStyle, style.slide || {}, index === currentSlide ? style.selectedSlide || {} : {});
slideStyle = (0, _lodash.merge)({}, slideStyle, style.slide || {}, index === currentSlide ? style.selectedSlide || {} : {});
var loadingSlideStyle = (0, _lodash4.default)({}, slideStyle || {}, {
var loadingSlideStyle = (0, _lodash.merge)({}, slideStyle || {}, {
marginLeft: slideStyle.marginLeft,

@@ -745,3 +735,3 @@ width: slideWidth || slideDimensions.width,

// Render at least 5 slides centered around the current slide, or the slide we just transitioned from
if ((0, _lodash6.default)(index, currentSlide - 2, currentSlide + 3) || transitioningFrom !== null && (0, _lodash6.default)(index, transitioningFrom - 2, transitioningFrom + 3)) {
if ((0, _lodash.inRange)(index, currentSlide - 2, currentSlide + 3) || transitioningFrom !== null && (0, _lodash.inRange)(index, transitioningFrom - 2, transitioningFrom + 3)) {
return true;

@@ -761,3 +751,3 @@ } else if (infinite) {

var numOriginals = originals.length;
var originalsToClone = [(0, _lodash2.default)(originals, numOriginals - 2), (0, _lodash2.default)(originals, numOriginals - 1), (0, _lodash2.default)(originals, 0), (0, _lodash2.default)(originals, Math.min(1, numOriginals - 1))];
var originalsToClone = [(0, _lodash.nth)(originals, numOriginals - 2), (0, _lodash.nth)(originals, numOriginals - 1), (0, _lodash.nth)(originals, 0), (0, _lodash.nth)(originals, Math.min(1, numOriginals - 1))];
var prependClones = [(0, _react.cloneElement)(originalsToClone[0], {

@@ -764,0 +754,0 @@ 'key': 'clone-1',

{
"name": "react-img-carousel",
"version": "1.3.3",
"version": "1.4.0",
"description": "Provides an image carousel React component.",

@@ -40,5 +40,3 @@ "main": "lib/index.js",

"classnames": "^2.0.0",
"lodash.inrange": "^3.3.6",
"lodash.merge": "^4.6.0",
"lodash.nth": "^4.11.2",
"lodash": "^4.17.11",
"ms": "^0.7.2",

@@ -45,0 +43,0 @@ "prop-types": "^15.5.10"

@@ -14,3 +14,3 @@ # react-img-carousel

import { render } from 'react-dom';
import { Carousel } from 'react-carousel';
import Carousel from 'react-carousel';

@@ -17,0 +17,0 @@ require('react-carousel/lib/carousel.css');

import React, { Component, Children, cloneElement } from 'react';
import PropTypes from 'prop-types';
import nth from 'lodash.nth';
import merge from 'lodash.merge';
import inRange from 'lodash.inrange';
import { nth, merge, inRange } from 'lodash';
import ms from 'ms';

@@ -7,0 +5,0 @@ import autobind from 'class-autobind';

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