embla-carousel
Advanced tools
Comparing version 2.4.6 to 2.5.0
@@ -10,2 +10,3 @@ import { Animation } from './animation'; | ||
import { ScrollLooper } from './scrollLooper'; | ||
import { ScrollProgress } from './scrollProgress'; | ||
import { SlideLooper } from './slideLooper'; | ||
@@ -18,2 +19,3 @@ import { Translate } from './translate'; | ||
scrollLooper: ScrollLooper; | ||
scrollProgress: ScrollProgress; | ||
index: Counter; | ||
@@ -20,0 +22,0 @@ indexPrevious: Counter; |
@@ -8,16 +8,17 @@ import { Callback as EmblaCallback, Event as EmblaEvent } from './components/eventDispatcher'; | ||
export declare type EmblaCarousel = { | ||
scrollSnapList: () => ScrollSnap[]; | ||
canScrollNext: () => boolean; | ||
canScrollPrev: () => boolean; | ||
changeOptions: (options: UserOptions) => void; | ||
containerNode: () => HTMLElement; | ||
destroy: () => void; | ||
off: (evt: EmblaEvent, cb: EmblaCallback) => void; | ||
on: (evt: EmblaEvent, cb: EmblaCallback) => void; | ||
previousScrollSnap: () => number; | ||
scrollNext: () => void; | ||
scrollPrev: () => void; | ||
scrollProgress: () => number; | ||
scrollSnapList: () => ScrollSnap[]; | ||
scrollTo: (index: number) => void; | ||
destroy: () => void; | ||
containerNode: () => HTMLElement; | ||
selectedScrollSnap: () => number; | ||
slideNodes: () => HTMLElement[]; | ||
selectedScrollSnap: () => number; | ||
previousScrollSnap: () => number; | ||
canScrollNext: () => boolean; | ||
canScrollPrev: () => boolean; | ||
on: (evt: EmblaEvent, cb: EmblaCallback) => void; | ||
off: (evt: EmblaEvent, cb: EmblaCallback) => void; | ||
changeOptions: (options: UserOptions) => void; | ||
}; | ||
@@ -24,0 +25,0 @@ export declare function EmblaCarousel(sliderRoot: HTMLElement, userOptions?: UserOptions): EmblaCarousel; |
@@ -469,7 +469,7 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
var eventDispatcher_1 = __webpack_require__(24); | ||
var eventDispatcher_1 = __webpack_require__(25); | ||
var eventStore_1 = __webpack_require__(5); | ||
var options_1 = __webpack_require__(25); | ||
var options_1 = __webpack_require__(26); | ||
@@ -686,2 +686,6 @@ var utils_1 = __webpack_require__(2); | ||
function scrollProgress() { | ||
return slider.scrollProgress.get(); | ||
} | ||
function containerNode() { | ||
@@ -706,2 +710,3 @@ return elements.container; | ||
scrollPrev: scrollPrev, | ||
scrollProgress: scrollProgress, | ||
scrollSnapList: scrollSnapList, | ||
@@ -757,10 +762,12 @@ scrollTo: scrollTo, | ||
var scrollSnap_1 = __webpack_require__(20); | ||
var scrollProgress_1 = __webpack_require__(20); | ||
var scrollTarget_1 = __webpack_require__(21); | ||
var scrollSnap_1 = __webpack_require__(21); | ||
var slideLooper_1 = __webpack_require__(22); | ||
var scrollTarget_1 = __webpack_require__(22); | ||
var translate_1 = __webpack_require__(23); | ||
var slideLooper_1 = __webpack_require__(23); | ||
var translate_1 = __webpack_require__(24); | ||
var utils_1 = __webpack_require__(2); | ||
@@ -930,2 +937,6 @@ | ||
}), | ||
scrollProgress: scrollProgress_1.ScrollProgress({ | ||
limit: limit, | ||
location: location | ||
}), | ||
slideLooper: slideLooper_1.SlideLooper({ | ||
@@ -1731,2 +1742,33 @@ contentSize: contentSize, | ||
function ScrollProgress(params) { | ||
var location = params.location, | ||
limit = params.limit; | ||
var min = limit.min, | ||
max = limit.max; | ||
var scrollLimit = min - max; | ||
function get() { | ||
var currentLocation = location.get() - max; | ||
return currentLocation / scrollLimit; | ||
} | ||
var self = { | ||
get: get | ||
}; | ||
return Object.freeze(self); | ||
} | ||
exports.ScrollProgress = ScrollProgress; | ||
/***/ }), | ||
/* 21 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var counter_1 = __webpack_require__(4); | ||
@@ -1775,3 +1817,3 @@ | ||
/***/ }), | ||
/* 21 */ | ||
/* 22 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1907,3 +1949,3 @@ | ||
/***/ }), | ||
/* 22 */ | ||
/* 23 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -2023,3 +2065,3 @@ | ||
/***/ }), | ||
/* 23 */ | ||
/* 24 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -2067,3 +2109,3 @@ | ||
/***/ }), | ||
/* 24 */ | ||
/* 25 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -2122,3 +2164,3 @@ | ||
/***/ }), | ||
/* 25 */ | ||
/* 26 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -2125,0 +2167,0 @@ |
{ | ||
"name": "embla-carousel", | ||
"version": "2.4.6", | ||
"version": "2.5.0", | ||
"author": "David Cetinkaya", | ||
@@ -5,0 +5,0 @@ "private": false, |
82705
30
2169