embla-carousel-auto-height
Advanced tools
Comparing version 7.0.9 to 7.1.0
@@ -8,3 +8,3 @@ import { AutoHeightOptionsType, OptionsType } from './Options'; | ||
} | ||
export declare type AutoHeightType = CreatePluginType<{}, OptionsType>; | ||
export type AutoHeightType = CreatePluginType<{}, OptionsType>; | ||
declare function AutoHeight(userOptions?: AutoHeightOptionsType): AutoHeightType; | ||
@@ -11,0 +11,0 @@ declare namespace AutoHeight { |
import { CreateOptionsType } from 'embla-carousel/components/Options'; | ||
export declare type OptionsType = CreateOptionsType<{ | ||
export type OptionsType = CreateOptionsType<{ | ||
destroyHeight: CSSStyleDeclaration['height']; | ||
}>; | ||
export declare const defaultOptions: OptionsType; | ||
export declare type AutoHeightOptionsType = Partial<OptionsType>; | ||
export type AutoHeightOptionsType = Partial<OptionsType>; |
@@ -24,12 +24,9 @@ 'use strict'; | ||
var inViewThreshold = 0.5; | ||
function init(embla) { | ||
carousel = embla; | ||
options = optionsHandler.atMedia(self.options); | ||
var _a = carousel.internalEngine(), | ||
axis = _a.options.axis, | ||
slidesInView = _a.slidesInView, | ||
slideRects = _a.slideRects; | ||
axis = _a.options.axis, | ||
slidesInView = _a.slidesInView, | ||
slideRects = _a.slideRects; | ||
if (axis === 'y') return; | ||
@@ -45,3 +42,2 @@ slideBounds = slidesInView.findSlideBounds(undefined, inViewThreshold); | ||
} | ||
function destroy() { | ||
@@ -53,8 +49,6 @@ heightEvents.forEach(function (evt) { | ||
} | ||
function highestInView() { | ||
var _a = carousel.internalEngine(), | ||
slidesInView = _a.slidesInView, | ||
target = _a.target; | ||
slidesInView = _a.slidesInView, | ||
target = _a.target; | ||
var inViewIndexes = slidesInView.check(target.get(), slideBounds); | ||
@@ -68,3 +62,2 @@ var heights = inViewIndexes.map(function (index) { | ||
} | ||
function setContainerHeight(evt) { | ||
@@ -74,3 +67,2 @@ var height = evt === 'destroy' ? options.destroyHeight : "".concat(highestInView(), "px"); | ||
} | ||
var self = { | ||
@@ -84,3 +76,2 @@ name: 'autoHeight', | ||
} | ||
AutoHeight.globalOptions = undefined; | ||
@@ -87,0 +78,0 @@ |
@@ -18,12 +18,9 @@ import EmblaCarousel from 'embla-carousel'; | ||
var inViewThreshold = 0.5; | ||
function init(embla) { | ||
carousel = embla; | ||
options = optionsHandler.atMedia(self.options); | ||
var _a = carousel.internalEngine(), | ||
axis = _a.options.axis, | ||
slidesInView = _a.slidesInView, | ||
slideRects = _a.slideRects; | ||
axis = _a.options.axis, | ||
slidesInView = _a.slidesInView, | ||
slideRects = _a.slideRects; | ||
if (axis === 'y') return; | ||
@@ -39,3 +36,2 @@ slideBounds = slidesInView.findSlideBounds(undefined, inViewThreshold); | ||
} | ||
function destroy() { | ||
@@ -47,8 +43,6 @@ heightEvents.forEach(function (evt) { | ||
} | ||
function highestInView() { | ||
var _a = carousel.internalEngine(), | ||
slidesInView = _a.slidesInView, | ||
target = _a.target; | ||
slidesInView = _a.slidesInView, | ||
target = _a.target; | ||
var inViewIndexes = slidesInView.check(target.get(), slideBounds); | ||
@@ -62,3 +56,2 @@ var heights = inViewIndexes.map(function (index) { | ||
} | ||
function setContainerHeight(evt) { | ||
@@ -68,3 +61,2 @@ var height = evt === 'destroy' ? options.destroyHeight : "".concat(highestInView(), "px"); | ||
} | ||
var self = { | ||
@@ -78,3 +70,2 @@ name: 'autoHeight', | ||
} | ||
AutoHeight.globalOptions = undefined; | ||
@@ -81,0 +72,0 @@ |
{ | ||
"name": "embla-carousel-auto-height", | ||
"version": "7.0.9", | ||
"version": "7.1.0", | ||
"author": "David Jerleke", | ||
@@ -58,4 +58,4 @@ "description": "An auto height plugin for Embla Carousel", | ||
"peerDependencies": { | ||
"embla-carousel": "7.0.9" | ||
"embla-carousel": "7.1.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
22344