embla-carousel-class-names
Advanced tools
Comparing version 6.1.1 to 6.2.0
@@ -5,2 +5,5 @@ import { ClassNamesOptionsType, OptionsType } from './Options'; | ||
declare function ClassNames(userOptions?: ClassNamesOptionsType): ClassNamesType; | ||
declare namespace ClassNames { | ||
var globalOptions: Partial<OptionsType> | undefined; | ||
} | ||
export default ClassNames; |
@@ -17,3 +17,3 @@ var defaultOptions = { | ||
function ClassNames(userOptions) { | ||
var options = Object.assign({}, defaultOptions, userOptions); | ||
var options = Object.assign({}, defaultOptions, ClassNames.globalOptions, userOptions); | ||
var selected = options.selected, | ||
@@ -89,3 +89,5 @@ draggable = options.draggable, | ||
ClassNames.globalOptions = undefined; | ||
export default ClassNames; | ||
//# sourceMappingURL=embla-carousel-class-names.esm.js.map |
@@ -19,3 +19,3 @@ 'use strict'; | ||
function ClassNames(userOptions) { | ||
var options = Object.assign({}, defaultOptions, userOptions); | ||
var options = Object.assign({}, defaultOptions, ClassNames.globalOptions, userOptions); | ||
var selected = options.selected, | ||
@@ -91,3 +91,5 @@ draggable = options.draggable, | ||
ClassNames.globalOptions = undefined; | ||
module.exports = ClassNames; | ||
//# sourceMappingURL=embla-carousel-class-names.js.map |
@@ -1,1 +0,1 @@ | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).EmblaCarouselClassNames=e()}(this,(function(){"use strict";var n={selected:"is-selected",draggable:"is-draggable",dragging:"is-dragging"};function e(n,e){var o=n.classList;e&&o.contains(e)&&o.remove(e)}function o(n,e){var o=n.classList;e&&!o.contains(e)&&o.add(e)}return function(t){var i,r,s,a=Object.assign({},n,t),f=a.selected,c=a.draggable,u=a.dragging,d=["select","pointerUp"],l=["pointerDown","pointerUp"];function g(n){"pointerDown"===n?o(r,u):e(r,u)}function p(){var n=i.slidesInView(!0);i.slidesNotInView(!0).forEach((function(n){return e(s[n],f)})),n.forEach((function(n){return o(s[n],f)}))}return{name:"ClassNames",options:a,init:function(n){r=(i=n).rootNode(),s=i.slideNodes(),i.internalEngine().options.draggable&&o(r,c),u&&l.forEach((function(n){return i.on(n,g)})),f&&(d.forEach((function(n){return i.on(n,p)})),p())},destroy:function(){e(r,c),l.forEach((function(n){return i.off(n,g)})),d.forEach((function(n){return i.off(n,p)})),s.forEach((function(n){return e(n,f)}))}}}})); | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).EmblaCarouselClassNames=e()}(this,(function(){"use strict";var n={selected:"is-selected",draggable:"is-draggable",dragging:"is-dragging"};function e(n,e){var o=n.classList;e&&o.contains(e)&&o.remove(e)}function o(n,e){var o=n.classList;e&&!o.contains(e)&&o.add(e)}function t(i){var r,s,a,f=Object.assign({},n,t.globalOptions,i),c=f.selected,u=f.draggable,d=f.dragging,l=["select","pointerUp"],g=["pointerDown","pointerUp"];function p(n){"pointerDown"===n?o(s,d):e(s,d)}function b(){var n=r.slidesInView(!0);r.slidesNotInView(!0).forEach((function(n){return e(a[n],c)})),n.forEach((function(n){return o(a[n],c)}))}return{name:"ClassNames",options:f,init:function(n){s=(r=n).rootNode(),a=r.slideNodes(),r.internalEngine().options.draggable&&o(s,u),d&&g.forEach((function(n){return r.on(n,p)})),c&&(l.forEach((function(n){return r.on(n,b)})),b())},destroy:function(){e(s,u),g.forEach((function(n){return r.off(n,p)})),l.forEach((function(n){return r.off(n,b)})),a.forEach((function(n){return e(n,c)}))}}}return t.globalOptions=void 0,t})); |
{ | ||
"name": "embla-carousel-class-names", | ||
"version": "6.1.1", | ||
"version": "6.2.0", | ||
"author": "David Cetinkaya", | ||
@@ -57,4 +57,4 @@ "description": "A class name toggle plugin for Embla Carousel", | ||
"peerDependencies": { | ||
"embla-carousel": "6.1.1" | ||
"embla-carousel": "6.2.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
23162
184