nuka-carousel
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -9,3 +9,3 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
@@ -12,0 +12,0 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
@@ -11,3 +11,3 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
@@ -466,6 +466,10 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
this.props.beforeSlide(this.state.currentSlide, 0); | ||
this.setState({ | ||
currentSlide: 0, | ||
isWrappingAround: true, | ||
wrapToIndex: index | ||
this.setState(function (prevState) { | ||
return { | ||
left: _this4.props.vertical ? 0 : _this4.getTargetLeft(_this4.state.slideWidth, prevState.currentSlide), | ||
top: _this4.props.vertical ? _this4.getTargetLeft(_this4.state.slideWidth, prevState.currentSlide) : 0, | ||
currentSlide: 0, | ||
isWrappingAround: true, | ||
wrapToIndex: index | ||
}; | ||
}, function () { | ||
@@ -541,3 +545,3 @@ return setTimeout(function () { | ||
if (this.state.currentSlide >= childrenCount - slidesToShow && !this.props.wrapAround) { | ||
if (this.state.currentSlide >= childrenCount - slidesToShow && !this.props.wrapAround && this.props.cellAlign === 'left') { | ||
return; | ||
@@ -554,3 +558,5 @@ } | ||
this.goToSlide(Math.min(this.state.currentSlide + this.state.slidesToScroll, childrenCount - slidesToShow)); | ||
var offset = this.state.currentSlide + this.state.slidesToScroll; | ||
var nextSlideIndex = this.props.cellAlign !== 'left' ? offset : Math.min(offset, childrenCount - slidesToShow); | ||
this.goToSlide(nextSlideIndex); | ||
} | ||
@@ -716,10 +722,5 @@ } | ||
var childNodes = this.getChildNodes(); | ||
var firstSlide = childNodes[0]; | ||
var slideHeight = this.getSlideHeight(props, childNodes); | ||
slidesToScroll = props.slidesToScroll; | ||
if (firstSlide) { | ||
firstSlide.style.height = 'auto'; | ||
} | ||
if (typeof props.slideWidth !== 'number') { | ||
@@ -1044,3 +1045,3 @@ slideWidth = parseInt(props.slideWidth); | ||
className: ['slider', this.props.className || ''].join(' '), | ||
style: Object.assign({}, this.getSliderStyles(), this.props.style) | ||
style: _extends({}, this.getSliderStyles(), this.props.style) | ||
}, React.createElement(Animate, { | ||
@@ -1052,3 +1053,3 @@ show: true, | ||
}, | ||
update: Object.assign({}, this.getOffsetDeltas(), { | ||
update: _extends({}, this.getOffsetDeltas(), { | ||
timing: { | ||
@@ -1055,0 +1056,0 @@ duration: duration, |
module.exports = require('./lib').default; | ||
module.exports.default = module.exports; |
@@ -20,3 +20,3 @@ "use strict"; | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
@@ -23,0 +23,0 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } |
@@ -52,3 +52,3 @@ "use strict"; | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
@@ -500,6 +500,10 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
this.props.beforeSlide(this.state.currentSlide, 0); | ||
this.setState({ | ||
currentSlide: 0, | ||
isWrappingAround: true, | ||
wrapToIndex: index | ||
this.setState(function (prevState) { | ||
return { | ||
left: _this4.props.vertical ? 0 : _this4.getTargetLeft(_this4.state.slideWidth, prevState.currentSlide), | ||
top: _this4.props.vertical ? _this4.getTargetLeft(_this4.state.slideWidth, prevState.currentSlide) : 0, | ||
currentSlide: 0, | ||
isWrappingAround: true, | ||
wrapToIndex: index | ||
}; | ||
}, function () { | ||
@@ -576,3 +580,3 @@ return setTimeout(function () { | ||
if (this.state.currentSlide >= childrenCount - slidesToShow && !this.props.wrapAround) { | ||
if (this.state.currentSlide >= childrenCount - slidesToShow && !this.props.wrapAround && this.props.cellAlign === 'left') { | ||
return; | ||
@@ -589,3 +593,5 @@ } | ||
this.goToSlide(Math.min(this.state.currentSlide + this.state.slidesToScroll, childrenCount - slidesToShow)); | ||
var offset = this.state.currentSlide + this.state.slidesToScroll; | ||
var nextSlideIndex = this.props.cellAlign !== 'left' ? offset : Math.min(offset, childrenCount - slidesToShow); | ||
this.goToSlide(nextSlideIndex); | ||
} | ||
@@ -751,10 +757,5 @@ } | ||
var childNodes = this.getChildNodes(); | ||
var firstSlide = childNodes[0]; | ||
var slideHeight = this.getSlideHeight(props, childNodes); | ||
slidesToScroll = props.slidesToScroll; | ||
if (firstSlide) { | ||
firstSlide.style.height = 'auto'; | ||
} | ||
if (typeof props.slideWidth !== 'number') { | ||
@@ -1082,3 +1083,3 @@ slideWidth = parseInt(props.slideWidth); | ||
className: ['slider', this.props.className || ''].join(' '), | ||
style: Object.assign({}, this.getSliderStyles(), this.props.style) | ||
style: _extends({}, this.getSliderStyles(), this.props.style) | ||
}, _react.default.createElement(_Animate.default, { | ||
@@ -1090,3 +1091,3 @@ show: true, | ||
}, | ||
update: Object.assign({}, this.getOffsetDeltas(), { | ||
update: _extends({}, this.getOffsetDeltas(), { | ||
timing: { | ||
@@ -1093,0 +1094,0 @@ duration: duration, |
{ | ||
"name": "nuka-carousel", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Pure React Carousel", | ||
@@ -15,7 +15,8 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0-beta.40", | ||
"@babel/core": "^7.0.0-beta.40", | ||
"@babel/polyfill": "^7.0.0-beta.40", | ||
"@babel/preset-env": "^7.0.0-beta.40", | ||
"@babel/preset-react": "^7.0.0-beta.40", | ||
"@babel/cli": "^7.0.0-beta.42", | ||
"@babel/core": "^7.0.0-beta.42", | ||
"@babel/plugin-transform-object-assign": "^7.0.0-beta.42", | ||
"@babel/polyfill": "^7.0.0-beta.42", | ||
"@babel/preset-env": "^7.0.0-beta.42", | ||
"@babel/preset-react": "^7.0.0-beta.42", | ||
"babel-core": "7.0.0-bridge.0", | ||
@@ -44,2 +45,4 @@ "babel-eslint": "^8.2.2", | ||
"jest-enzyme": "^6.0.0", | ||
"jest-puppeteer-preset": "^2.0.1", | ||
"puppeteer": "^1.1.1", | ||
"react": "^16.0.0", | ||
@@ -71,3 +74,4 @@ "react-dom": "^16.0.0", | ||
"lint": "eslint .", | ||
"test": "jest test", | ||
"test": "jest test --config jest.unit.config.js", | ||
"test-e2e": "jest test --config jest.e2e.config.js", | ||
"check": "npm run lint && npm run test" | ||
@@ -90,7 +94,3 @@ }, | ||
"homepage": "https://github.com/FormidableLabs/nuka-carousel", | ||
"sideEffects": false, | ||
"jest": { | ||
"testEnvironment": "enzyme", | ||
"setupTestFrameworkScriptFile": "./node_modules/jest-enzyme/lib/index.js" | ||
} | ||
"sideEffects": false | ||
} |
@@ -0,0 +0,0 @@ # nuka-carousel |
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
117943
10
2815
0
41