well-waterfall 0.0.87 → 0.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/waterfall.js +1 -1
- package/package.json +1 -1
- package/src/waterfall.js +67 -47
package/dist/waterfall.js
CHANGED
|
@@ -136,7 +136,7 @@ eval("\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElem
|
|
|
136
136
|
\**************************/
|
|
137
137
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
138
138
|
|
|
139
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var swiper_bundle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! swiper/bundle */ \"./node_modules/swiper/swiper-bundle.mjs\");\n/* harmony import */ var swiper_css_bundle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! swiper/css/bundle */ \"./node_modules/swiper/swiper-bundle.css\");\n\n\n\nconsole.log(`🚿 Hello from Wellflow Waterfall v${\"0.0.87\"}`);\n\nconst sliders = [];\n\n// Helper function to get an attribute with type conversion\nfunction getAttr(el, attrName, defaultValue) {\n // try to find the attribute\n const value = $(el).attr(attrName);\n // if the attribute doesn't exist, or if it is equal to the default return null\n if (value === undefined || value === null || value.toString() === defaultValue.toString()) return null;\n\n if (typeof defaultValue === \"boolean\") {\n return String(value).toLowerCase() === 'true';\n }\n if (typeof defaultValue === \"number\") {\n return parseInt(value, 10);\n }\n return value;\n}\n\nfunction removeNullKeys(obj) {\n if (typeof obj !== 'object' || obj === null) {\n return obj; // Return non-objects or null as is\n }\n\n // Iterate over the keys in the object\n for (const key in obj) {\n // Remove the key if the value is null or an empty object\n if (obj[key] === null) {\n console.log(\"obj[key] is null. REMOVE: \", key, obj[key]);\n delete obj[key];\n } else if (typeof obj[key] === 'object' && !(obj[key] instanceof HTMLElement)) {\n console.log(\"typeof obj[key] is object. Recurse: \", key, obj[key]);\n // Recursively handle nested objects\n removeNullKeys(obj[key]);\n console.log(\"Complete Recursion: \", key, obj[key]);\n // Check if the object is now empty and remove it if so\n if (Object.keys(obj[key]).length === 0) {\n console.log(\"REMOVE: \", key, obj[key]);\n delete obj[key];\n }\n }\n }\n\n return obj;\n}\n\n$(\"[waterfall]\").each(function (index) {\n const $this = $(this);\n\n const name = getAttr($this, \"waterfall\", `Swiper ${index}`);\n const debug = getAttr($this, \"debug-mode\", false);\n\n console.log(\"Running in\", debug ? \"debug mode\" : \"normal mode\");\n\n function printDebug(str, el) {\n if (!debug) return;\n console.log(str, \": \", el);\n }\n\n const swiperConfig = {\n a11y: {\n prevSlideMessage: getAttr($this, \"a11y-prev-message\", \"Previous Slide\"),\n nextSlideMessage: getAttr($this, \"a11y-next-message\", \"Next Slide\"),\n },\n allowSlideNext: getAttr($this, \"allow-slide-next\", true),\n allowSlidePrev: getAttr($this, \"allow-slide-prev\", true),\n allowTouchMove: getAttr($this, \"allow-touch-move\", true),\n autoHeight: getAttr($this, \"auto-height\", false),\n breakpoints: {\n 478: {\n centeredSlides: getAttr($this, \"lmobile-centered-slides\", null),\n slidesPerView: getAttr($this, \"lmobile-slides-per-view\", null),\n spaceBetween: getAttr($this, \"lmobile-space-between\", null),\n },\n 767: {\n centeredSlides: getAttr($this, \"tablet-centered-slides\", null),\n slidesPerView: getAttr($this, \"tablet-slides-per-view\", null),\n spaceBetween: getAttr($this, \"tablet-space-between\", null),\n },\n 991: {\n centeredSlides: getAttr($this, \"desktop-centered-slides\", null),\n slidesPerView: getAttr($this, \"desktop-slides-per-view\", null),\n spaceBetween: getAttr($this, \"desktop-space-between\", null),\n },\n 1280: {\n centeredSlides: getAttr($this, \"large-centered-slides\", null),\n slidesPerView: getAttr($this, \"large-slides-per-view\", null),\n spaceBetween: getAttr($this, \"large-space-between\", null),\n },\n 1440: {\n centeredSlides: getAttr($this, \"xlarge-centered-slides\", null),\n slidesPerView: getAttr($this, \"xlarge-slides-per-view\", null),\n spaceBetween: getAttr($this, \"xlarge-space-between\", null),\n },\n },\n breakpointsBase: getAttr($this, \"breakpoints-base\", 'window'),\n centerInsufficientSlides: getAttr($this, \"center-insufficient-slides\", false),\n centeredSlides: getAttr($this, \"centered-slides\", false),\n containerModifierClass: getAttr($this, \"container-modifier-class\", 'swiper-'),\n createElements: getAttr($this, \"create-elements\", false),\n cssMode: getAttr($this, \"css-mode\", false),\n direction: getAttr($this, \"direction\", \"horizontal\"),\n edgeSwipeDetection: getAttr($this, \"edge-swipe-detection\", false),\n edgeSwipeThreshold: getAttr($this, \"edge-swipe-threshold\", 20),\n effect: getAttr($this, \"effect\", \"slide\"),\n enabled: getAttr($this, \"enabled\", true),\n eventsPrefix: getAttr($this, \"events-prefix\", \"swiper\"),\n focusableElements: getAttr($this, \"focusable-elements\", 'input, select, option, textarea, button, video, label'),\n followFinger: getAttr($this, \"follow-finger\", true),\n freeMode: {\n enabled: getAttr($this, \"free-mode-enabled\", false),\n sticky: getAttr($this, \"free-mode-sticky\", false),\n },\n grabCursor: getAttr($this, \"grab-cursor\", false),\n //grid: null,\n //hashNavigation: null,\n height: getAttr($this, \"height\", \"null\"),\n //history: null,\n init: getAttr($this, \"init\", true),\n initialSlide: getAttr($this, \"initial-slide\", 0),\n //injectStyles: null, // not needed\n //injectStylesUrls: null, // not needed\n lazyPreloadPrevNext: getAttr($this, \"lazy-preload-prev-next\", \"0\"),\n lazyPreloaderClass: getAttr($this, \"lazy-preloader-class\", \"swiper-lazy-preloader\"),\n longSwipes: getAttr($this, \"long-swipes\", true), // no effect\n longSwipesMs: getAttr($this, \"long-swipes-ms\", 300), // no effect\n longSwipesRatio: getAttr($this, \"long-swipes-ratio\", 0.5), // no effect\n loop: getAttr($this, \"loop-mode\", false),\n loopAddBlankSlides: getAttr($this, \"loop-add-blank-slides\", true),\n loopAdditionalSlides: getAttr($this, \"loop-additional-slides\", 0),\n loopPreventsSliding: getAttr($this, \"loop-prevents-sliding\", true),\n maxBackfaceHiddenSlides: getAttr($this, \"max-backface-hidden-slides\", 10),\n //modules: null, // take a look at this\n //mouseWheel: null,\n //navigation: null,\n nested: getAttr($this, 'nested', false),\n noSwiping: getAttr($this, 'no-swiping', true),\n noSwipingClass: getAttr($this, 'no-swiping-class', 'swiper-no-swiping'),\n noSwipingSelector: getAttr($this, 'no-swiping-selector', 'null'),\n normalizeSlideIndex: getAttr($this, \"normalize-slide-index\", true),\n observeParents: getAttr($this, 'observe-parents', false),\n observeSlideChildren: getAttr($this, 'observe-slide-children', false),\n //observer: null,\n //on: null,\n //onAny: null,\n oneWayMovement: getAttr($this, 'data-one-way-movement', false),\n //pagination: null,\n //parallax: null,\n passiveListeners: getAttr($this, 'passive-listeners', true),\n preventClicks: getAttr($this, 'prevent-clicks', true),\n preventClicksPropagation: getAttr($this, 'prevent-clicks-propagation', true),\n preventInteractionOnTransition: getAttr($this, 'prevent-interaction-on-transition', false),\n resistance: getAttr($this, 'resistance', true),\n resistanceRatio: getAttr($this, 'resistance-ratio', '0.85'),\n resizeObserver: getAttr($this, 'resize-observer', true),\n rewind: getAttr($this, 'rewind', false),\n roundLengths: getAttr($this, 'round-lengths', false),\n runCallbacksOnInit: getAttr($this, 'run-callbacks-on-init', true),\n // scrollbar: null,\n // setWrapperSize: getAttr($this, 'set-wrapper-size', false),\n shortSwipes: getAttr($this, 'short-swipes', true),\n simulateTouch: getAttr($this, 'simulate-touch', true),\n slideActiveClass: getAttr($this, 'slide-active-class', 'swiper-slide-active'),\n slideBlankClass: getAttr($this, 'slide-blank-class', 'swiper-slide-blank'),\n slideClass: getAttr($this, 'slide-class', 'swiper-slide'),\n slideFullyVisibleClass: getAttr($this, 'slide-fully-visible-class', 'swiper-slide-fully-visible'),\n slideNextClass: getAttr($this, 'slide-next-class', 'swiper-slide-next'),\n slidePrevClass: getAttr($this, 'slide-prev-class', 'swiper-slide-prev'),\n slideToClickedSlide: getAttr($this, 'slide-to-clicked-slide', false),\n slideVisibleClass: getAttr($this, 'slide-visible-class', 'swiper-slide-visible'),\n slidesOffsetAfter: getAttr($this, 'slides-offset-after', 0),\n slidesOffsetBefore: getAttr($this, 'slides-offset-before', 0),\n slidesPerGroup: getAttr($this, 'slides-per-group', 1),\n slidesPerGroupAuto: getAttr($this, 'slides-per-group-auto', false),\n slidesPerGroupSkip: getAttr($this, 'slides-per-group-skip', 0),\n slidesPerView: getAttr($this, \"slides-per-view\", 1),\n spaceBetween: getAttr($this, \"space-between\", 0),\n speed: getAttr($this, \"speed\", 300),\n // swipeHandler: getAttr($this, \"swipe-handler\", null),\n swiperElementNodeName: getAttr($this, \"swiper-element-node-name\", \"SWIPER-CONTAINER\"),\n threshold: getAttr($this, \"threshold\", 5),\n // thumbs: null,\n touchAngle: getAttr($this, \"touch-angle\", 45),\n touchEventsTarget: getAttr($this, \"touch-events-target\", \"wrapper\"),\n touchMoveStopPropagation: getAttr($this, \"touch-move-stop-propagation\", false),\n touchRatio: getAttr($this, \"touch-ratio\", 1),\n touchReleaseOnEdges: getAttr($this, \"touch-release-on-edges\", false),\n touchStartForcePreventDefault: getAttr($this, \"touch-start-force-prevent-default\", false),\n touchStartPreventDefault: getAttr($this, \"touch-start-prevent-default\", true),\n uniqueNavElements: getAttr($this, \"unique-nav-elements\", true),\n updateOnWindowResize: getAttr($this, \"update-on-window-resize\", true),\n //url: getAttr($this, \"url\", \"null\"),\n //userAgent: getAttr($this, \"user-agent\", \"null\"),\n //virtual: null,\n virtualTranslate: getAttr($this, \"virtual-translate\", false),\n watchOverflow: getAttr($this, \"watch-overflow\", true),\n watchSlidesProgress: getAttr($this, \"watch-slides-progress\", false),\n width: getAttr($this, \"width\", \"null\"),\n wrapperClass: getAttr($this, \"wrapper-class\", \"swiper-wrapper\"),\n //zoom: null,\n };\n\n //------- Modules --------------------------------\n\n // --- NAVIGATION ---\n swiperConfig.navigation = {\n disabledClass: getAttr($this, \"nav-disabled-class\", \"swiper-button-disabled\"),\n enabled: getAttr($this, 'nav-enabled', ''),\n hiddenClass: getAttr($this, 'nav-hidden-class', 'swiper-button-hidden'),\n hideOnClick: getAttr($this, 'nav-hide-on-click', 'false'),\n lockClass: getAttr($this, 'nav-lock-class', 'swiper-button-lock'),\n navigationDisabledClass: getAttr($this, 'nav-disabled-class', 'swiper-navigation-disabled'),\n nextEl: $this.find(\"[waterfall-el='next']\")[0],\n prevEl: $this.find(\"[waterfall-el='prev']\")[0],\n };\n\n const scrollbarMode = getAttr($this, \"scrollbar-mode\", false);\n //printDebug(\"SCROLLBAR MODE\", scrollbarMode);\n\n // --- AUTOPLAY ---\n const autoplayMode = getAttr($this, \"autoplay-mode\", false);\n printDebug(\"AUTOPLAY MODE\", autoplayMode);\n\n if (autoplayMode) {\n swiperConfig.autoplay = {\n delay: getAttr($this, \"delay\", 0),\n disableOnInteraction: getAttr($this, \"disable-on-interaction\", false), // documentation says default is true, doesn't appear to be correct\n reverseDirection: getAttr($this, \"reverse-direction\", false),\n pauseOnMouseEnter: getAttr($this, \"pause-on-mouse-enter\", false),\n stopOnLastSlide: getAttr($this, \"stop-on-last-slide\", false),\n };\n // Add CSS for Smooth Autoplay\n $(\"[smooth-autoplay='true']\").find(\".swiper-wrapper\").css(\"transition-timing-function\", \"linear\");\n }\n\n // PAGINATION\n const paginationMode = getAttr($this, \"pagination-mode\", false);\n const paginationEl = $this.find(\"[waterfall-el='pagination']\")[0];\n let paginationType = getAttr($this, \"pagination-type\", \"bullets\");\n //printDebug(\"PAGINATION\", paginationEl);\n //printDebug(\"PAGINATION TYPE\", paginationType);\n //printDebug(\"BULLET CLASS\", $this.find(\"[waterfall-el='pagination-bullet']\").attr(\"class\"));\n //printDebug(\"BULLET ACTIVE CLASS\", getAttr($this, \"bullet-active-class\", \"swiper-pagination-bullet-active\"));\n\n let bulletRenderFn;\n if (paginationType === \"numberBullets\") {\n bulletRenderFn = function (index, className) {\n return `<span class=\"${className}\">${index + 1}</span>`;\n }\n }\n\n if (paginationType === \"bullets\") {\n bulletRenderFn = function (index, className) {\n return `<span class=\"${className}\"></span>`;\n }\n }\n\n // Convert type back to bullets\n if (paginationType === \"numberBullets\") paginationType = \"bullets\";\n\n if (paginationMode) {\n swiperConfig.pagination = {\n el: paginationEl,\n clickable: getAttr($this, \"pagination-clickable\", true),\n bulletClass: $this.find(\"[waterfall-el='pagination-bullet']\").attr(\"class\"),\n bulletActiveClass: getAttr($this, \"bullet-active-class\", \"swiper-pagination-bullet-active\"),\n type: paginationType,\n dynamicBullets: false,\n renderBullet: bulletRenderFn,\n };\n }\n\n // --- SCROLLBAR ---\n const scrollbarEl = $this.find(\"[waterfall-el='scrollbar']\")[0];\n printDebug(\"SCROLLBAR\", scrollbarEl);\n const scrollbarDrag = $(scrollbarEl).find(\"[waterfall-el='scrollbar-drag']\")[0];\n printDebug(\"SCROLLBAR DRAG\", scrollbarDrag);\n\n if (scrollbarMode) {\n swiperConfig.scrollbar = {\n dragClass: $(scrollbarDrag).attr(\"class\"),\n dragSize: getAttr($this, \"drag-size\", \"auto\"),\n draggable: getAttr($this, \"draggable\", true),\n el: scrollbarEl,\n enabled: getAttr($this, \"scrollbar-enabled\", true),\n hide: getAttr($this, \"scrollbar-hide\", true),\n horizontalClass: getAttr($this, \"scrollbar-horizontal-class\", \"swiper-scrollbar-horizontal\"),\n lockClass: getAttr($this, \"scrollbar-lock-class\", \"swiper-scrollbar-lock\"),\n scrollbarDisabledClass: getAttr($this, \"scrollbar-disabled-class\", \"swiper-scrollbar-disabled\"),\n snapOnRelease: getAttr($this, \"snap-on-release\", false),\n verticalClass: getAttr($this, \"scrollbar-vertical-class\", \"swiper-scrollbar-vertical\"),\n };\n }\n\n // --- CLEANUP AND EXPORT ---\n\n console.log(JSON.stringify(swiperConfig));\n\n const config = removeNullKeys(swiperConfig);\n\n console.log(JSON.stringify(config));\n\n // Initialize swiper\n const swiper = new swiper_bundle__WEBPACK_IMPORTED_MODULE_0__[\"default\"]($this.find(\".swiper\")[0], config);\n\n sliders.push({ name, slider: swiper });\n});\n\n\n//# sourceURL=webpack://Waterfall/./src/waterfall.js?");
|
|
139
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var swiper_bundle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! swiper/bundle */ \"./node_modules/swiper/swiper-bundle.mjs\");\n/* harmony import */ var swiper_css_bundle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! swiper/css/bundle */ \"./node_modules/swiper/swiper-bundle.css\");\n\n\n\nconsole.log(`🚿 Hello from Wellflow Waterfall v${\"0.0.89\"}`);\n\nconst sliders = [];\n\n// Helper function to get an attribute with type conversion\nfunction getAttr(el, attrName, defaultValue) {\n // try to find the attribute\n const value = $(el).attr(attrName);\n // if the attribute doesn't exist, or if it is equal to the default return null\n if (value === undefined || value === null || value.toString() === defaultValue.toString()) return null;\n\n if (typeof defaultValue === \"boolean\") {\n return String(value).toLowerCase() === 'true';\n }\n if (typeof defaultValue === \"number\") {\n return parseInt(value, 10);\n }\n return value;\n}\n\nfunction removeNullKeys(obj) {\n if (typeof obj !== 'object' || obj === null) {\n return obj; // Return non-objects or null as is\n }\n\n // Iterate over the keys in the object\n for (const key in obj) {\n // Remove the key if the value is null or an empty object\n if (obj[key] === null) {\n console.log(\"obj[key] is null. REMOVE: \", key, obj[key]);\n delete obj[key];\n } else if (typeof obj[key] === 'object' && !(obj[key] instanceof HTMLElement)) {\n console.log(\"typeof obj[key] is object. Recurse: \", key, obj[key]);\n // Recursively handle nested objects\n removeNullKeys(obj[key]);\n console.log(\"Complete Recursion: \", key, obj[key]);\n // Check if the object is now empty and remove it if so\n if (Object.keys(obj[key]).length === 0) {\n console.log(\"REMOVE: \", key, obj[key]);\n delete obj[key];\n }\n }\n }\n\n return obj;\n}\n\n$(\"[waterfall]\").each(function (index) {\n const $this = $(this);\n\n const name = getAttr($this, \"waterfall\", `Swiper ${index}`);\n const debug = getAttr($this, \"debug-mode\", false);\n\n console.log(\"Running in\", debug ? \"debug mode\" : \"normal mode\");\n\n function printDebug(str, el) {\n if (!debug) return;\n console.log(str, \": \", el);\n }\n\n const swiperConfig = {\n a11y: {\n prevSlideMessage: getAttr($this, \"a11y-prev-message\", \"Previous Slide\"),\n nextSlideMessage: getAttr($this, \"a11y-next-message\", \"Next Slide\"),\n },\n allowSlideNext: getAttr($this, \"allow-slide-next\", true),\n allowSlidePrev: getAttr($this, \"allow-slide-prev\", true),\n allowTouchMove: getAttr($this, \"allow-touch-move\", true),\n autoHeight: getAttr($this, \"auto-height\", false),\n breakpoints: {\n 478: {\n centeredSlides: getAttr($this, \"lmobile-centered-slides\", null),\n slidesPerView: getAttr($this, \"lmobile-slides-per-view\", null),\n spaceBetween: getAttr($this, \"lmobile-space-between\", null),\n },\n 767: {\n centeredSlides: getAttr($this, \"tablet-centered-slides\", null),\n slidesPerView: getAttr($this, \"tablet-slides-per-view\", null),\n spaceBetween: getAttr($this, \"tablet-space-between\", null),\n },\n 991: {\n centeredSlides: getAttr($this, \"desktop-centered-slides\", null),\n slidesPerView: getAttr($this, \"desktop-slides-per-view\", null),\n spaceBetween: getAttr($this, \"desktop-space-between\", null),\n },\n 1280: {\n centeredSlides: getAttr($this, \"large-centered-slides\", null),\n slidesPerView: getAttr($this, \"large-slides-per-view\", null),\n spaceBetween: getAttr($this, \"large-space-between\", null),\n },\n 1440: {\n centeredSlides: getAttr($this, \"xlarge-centered-slides\", null),\n slidesPerView: getAttr($this, \"xlarge-slides-per-view\", null),\n spaceBetween: getAttr($this, \"xlarge-space-between\", null),\n },\n },\n breakpointsBase: getAttr($this, \"breakpoints-base\", 'window'),\n centerInsufficientSlides: getAttr($this, \"center-insufficient-slides\", false),\n centeredSlides: getAttr($this, \"centered-slides\", false),\n containerModifierClass: getAttr($this, \"container-modifier-class\", 'swiper-'),\n createElements: getAttr($this, \"create-elements\", false),\n cssMode: getAttr($this, \"css-mode\", false),\n direction: getAttr($this, \"direction\", \"horizontal\"),\n edgeSwipeDetection: getAttr($this, \"edge-swipe-detection\", false),\n edgeSwipeThreshold: getAttr($this, \"edge-swipe-threshold\", 20),\n effect: getAttr($this, \"effect\", \"slide\"),\n enabled: getAttr($this, \"enabled\", true),\n eventsPrefix: getAttr($this, \"events-prefix\", \"swiper\"),\n focusableElements: getAttr($this, \"focusable-elements\", 'input, select, option, textarea, button, video, label'),\n followFinger: getAttr($this, \"follow-finger\", true),\n freeMode: {\n enabled: getAttr($this, \"free-mode-enabled\", false),\n sticky: getAttr($this, \"free-mode-sticky\", false),\n },\n grabCursor: getAttr($this, \"grab-cursor\", false),\n //grid: null,\n //hashNavigation: null,\n height: getAttr($this, \"height\", \"null\"),\n //history: null,\n init: getAttr($this, \"init\", true),\n initialSlide: getAttr($this, \"initial-slide\", 0),\n //injectStyles: null, // not needed\n //injectStylesUrls: null, // not needed\n lazyPreloadPrevNext: getAttr($this, \"lazy-preload-prev-next\", \"0\"),\n lazyPreloaderClass: getAttr($this, \"lazy-preloader-class\", \"swiper-lazy-preloader\"),\n longSwipes: getAttr($this, \"long-swipes\", true), // no effect\n longSwipesMs: getAttr($this, \"long-swipes-ms\", 300), // no effect\n longSwipesRatio: getAttr($this, \"long-swipes-ratio\", 0.5), // no effect\n loop: getAttr($this, \"loop-mode\", false),\n loopAddBlankSlides: getAttr($this, \"loop-add-blank-slides\", true),\n loopAdditionalSlides: getAttr($this, \"loop-additional-slides\", 0),\n loopPreventsSliding: getAttr($this, \"loop-prevents-sliding\", true),\n maxBackfaceHiddenSlides: getAttr($this, \"max-backface-hidden-slides\", 10),\n //modules: null, // take a look at this\n //mouseWheel: null,\n //navigation: null,\n nested: getAttr($this, 'nested', false),\n noSwiping: getAttr($this, 'no-swiping', true),\n noSwipingClass: getAttr($this, 'no-swiping-class', 'swiper-no-swiping'),\n noSwipingSelector: getAttr($this, 'no-swiping-selector', 'null'),\n normalizeSlideIndex: getAttr($this, \"normalize-slide-index\", true),\n observeParents: getAttr($this, 'observe-parents', false),\n observeSlideChildren: getAttr($this, 'observe-slide-children', false),\n //observer: null,\n //on: null,\n //onAny: null,\n oneWayMovement: getAttr($this, 'data-one-way-movement', false),\n //pagination: null,\n //parallax: null,\n passiveListeners: getAttr($this, 'passive-listeners', true),\n preventClicks: getAttr($this, 'prevent-clicks', true),\n preventClicksPropagation: getAttr($this, 'prevent-clicks-propagation', true),\n preventInteractionOnTransition: getAttr($this, 'prevent-interaction-on-transition', false),\n resistance: getAttr($this, 'resistance', true),\n resistanceRatio: getAttr($this, 'resistance-ratio', '0.85'),\n resizeObserver: getAttr($this, 'resize-observer', true),\n rewind: getAttr($this, 'rewind', false),\n roundLengths: getAttr($this, 'round-lengths', false),\n runCallbacksOnInit: getAttr($this, 'run-callbacks-on-init', true),\n // scrollbar: null,\n // setWrapperSize: getAttr($this, 'set-wrapper-size', false),\n shortSwipes: getAttr($this, 'short-swipes', true),\n simulateTouch: getAttr($this, 'simulate-touch', true),\n slideActiveClass: getAttr($this, 'slide-active-class', 'swiper-slide-active'),\n slideBlankClass: getAttr($this, 'slide-blank-class', 'swiper-slide-blank'),\n slideClass: getAttr($this, 'slide-class', 'swiper-slide'),\n slideFullyVisibleClass: getAttr($this, 'slide-fully-visible-class', 'swiper-slide-fully-visible'),\n slideNextClass: getAttr($this, 'slide-next-class', 'swiper-slide-next'),\n slidePrevClass: getAttr($this, 'slide-prev-class', 'swiper-slide-prev'),\n slideToClickedSlide: getAttr($this, 'slide-to-clicked-slide', false),\n slideVisibleClass: getAttr($this, 'slide-visible-class', 'swiper-slide-visible'),\n slidesOffsetAfter: getAttr($this, 'slides-offset-after', 0),\n slidesOffsetBefore: getAttr($this, 'slides-offset-before', 0),\n slidesPerGroup: getAttr($this, 'slides-per-group', 1),\n slidesPerGroupAuto: getAttr($this, 'slides-per-group-auto', false),\n slidesPerGroupSkip: getAttr($this, 'slides-per-group-skip', 0),\n slidesPerView: getAttr($this, \"slides-per-view\", 1),\n spaceBetween: getAttr($this, \"space-between\", 0),\n speed: getAttr($this, \"speed\", 300),\n // swipeHandler: getAttr($this, \"swipe-handler\", null),\n swiperElementNodeName: getAttr($this, \"swiper-element-node-name\", \"SWIPER-CONTAINER\"),\n threshold: getAttr($this, \"threshold\", 5),\n // thumbs: null,\n touchAngle: getAttr($this, \"touch-angle\", 45),\n touchEventsTarget: getAttr($this, \"touch-events-target\", \"wrapper\"),\n touchMoveStopPropagation: getAttr($this, \"touch-move-stop-propagation\", false),\n touchRatio: getAttr($this, \"touch-ratio\", 1),\n touchReleaseOnEdges: getAttr($this, \"touch-release-on-edges\", false),\n touchStartForcePreventDefault: getAttr($this, \"touch-start-force-prevent-default\", false),\n touchStartPreventDefault: getAttr($this, \"touch-start-prevent-default\", true),\n uniqueNavElements: getAttr($this, \"unique-nav-elements\", true),\n updateOnWindowResize: getAttr($this, \"update-on-window-resize\", true),\n //url: getAttr($this, \"url\", \"null\"),\n //userAgent: getAttr($this, \"user-agent\", \"null\"),\n //virtual: null,\n virtualTranslate: getAttr($this, \"virtual-translate\", false),\n watchOverflow: getAttr($this, \"watch-overflow\", true),\n watchSlidesProgress: getAttr($this, \"watch-slides-progress\", false),\n width: getAttr($this, \"width\", \"null\"),\n wrapperClass: getAttr($this, \"wrapper-class\", \"swiper-wrapper\"),\n //zoom: null,\n };\n\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n // --- AUTOPLAY --------------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n const autoplayMode = getAttr($this, \"autoplay-mode\", false);\n printDebug(\"AUTOPLAY MODE\", autoplayMode);\n\n if (autoplayMode) {\n swiperConfig.autoplay = {\n delay: getAttr($this, \"delay\", 0),\n disableOnInteraction: getAttr($this, \"disable-on-interaction\", false), // documentation says default is true, doesn't appear to be correct\n reverseDirection: getAttr($this, \"reverse-direction\", false),\n pauseOnMouseEnter: getAttr($this, \"pause-on-mouse-enter\", false),\n stopOnLastSlide: getAttr($this, \"stop-on-last-slide\", false),\n };\n // Add CSS for Smooth Autoplay\n $(\"[smooth-autoplay='true']\").find(\".swiper-wrapper\").css(\"transition-timing-function\", \"linear\");\n }\n\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n // --- NAVIGATION -----------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n swiperConfig.navigation = {\n disabledClass: getAttr($this, \"nav-disabled-class\", \"swiper-button-disabled\"),\n enabled: getAttr($this, 'nav-enabled', ''),\n hiddenClass: getAttr($this, 'nav-hidden-class', 'swiper-button-hidden'),\n hideOnClick: getAttr($this, 'nav-hide-on-click', 'false'),\n lockClass: getAttr($this, 'nav-lock-class', 'swiper-button-lock'),\n navigationDisabledClass: getAttr($this, 'nav-disabled-class', 'swiper-navigation-disabled'),\n nextEl: $this.find(\"[waterfall-el='next']\")[0],\n prevEl: $this.find(\"[waterfall-el='prev']\")[0],\n };\n\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n // --- PAGINATION -----------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n\n let paginationType = getAttr($this, \"pagination-type\", \"bullets\");\n printDebug(\"PAGINATION TYPE\", paginationType);\n\n // Custom pagination type rendering functions\n function customRenderBullet() {\n if (paginationType === \"numberBullets\") {\n return (index, className) => `<span class=\"${className}\">${index + 1}</span>`;\n }\n if (paginationType === \"bullets\") {\n return (index, className) => `<span class=\"${className}\"></span>`;\n }\n return null;\n }\n\n // Custom function to get extended pagination types\n function getPaginationType() {\n if (paginationType === \"numberBullets\" || paginationType === \"bullets\") return \"bullets\";\n if (paginationType === \"fraction\") return \"fraction\";\n if (paginationType === \"progressbar\") return \"progressbar\";\n if (paginationType === \"custom\") return \"custom\";\n }\n\n swiperConfig.pagination = {\n bulletActiveClass: getAttr($this, \"bullet-active-class\", \"swiper-pagination-bullet-active\"),\n bulletClass: $this.find(\"[waterfall-el='pagination-bullet']\").attr(\"class\"),\n bulletElement: getAttr($this, \"bullet-element\", \"span\"),\n clickable: getAttr($this, \"pagination-clickable\", true),\n clickableClass: getAttr($this, \"pagination-clickable-class\", \"swiper-pagination-clickable\"),\n currentClass: getAttr($this, \"pagination-current-class\", \"swiper-pagination-current\"),\n dynamicBullets: getAttr($this, \"dynamic-bullets\", \"swiper-pagination-current\"),\n dynamicMainBullets: getAttr($this, \"dynamic-main-bullets\", \"1\"),\n el: $this.find(\"[waterfall-el='pagination']\")[0],\n enabled: getAttr($this, \"pagination-enabled\", \"\"),\n //formatFractionCurrent: null,\n //formatFractionTotal: null,\n hiddenClass: getAttr($this, \"pagination-hidden-class\", \"swiper-pagination-hidden\"),\n hideOnClick: getAttr($this, \"pagination-hide-on-click\", \"true\"),\n horizontalClass: getAttr($this, \"pagination-horizontal-class\", \"swiper-pagination-horizontal\"),\n lockClass: getAttr($this, \"pagination-lock-class\", \"swiper-pagination-lock\"),\n modifierClass: getAttr($this, \"pagination-modifier-class\", \"swiper-pagination-\"),\n paginationDisabledClass: getAttr($this, \"pagination-disabled-class\", \"swiper-pagination-disabled\"),\n progressbarFillClass: getAttr($this, \"pagination-progressbar-fill-class\", \"swiper-pagination-progressbar-fill\"),\n progressbarOpposite: getAttr($this, \"pagination-progressbar-opposite\", \"swiper-pagination-progressbar-opposite\"),\n renderBullet: customRenderBullet(),\n //renderCustom: null,\n //renderFraction: null,\n //renderProgressBar: null,\n totalClass: getAttr($this, \"pagination-total-class\", \"swiper-pagination-total\"),\n type: getPaginationType(),\n verticalClass: getAttr($this, \"pagination-vertical-class\", \"swiper-pagination-vertical\"),\n };\n\n // --- SCROLLBAR ---\n const scrollbarMode = getAttr($this, \"scrollbar-mode\", false);\n //printDebug(\"SCROLLBAR MODE\", scrollbarMode);\n const scrollbarEl = $this.find(\"[waterfall-el='scrollbar']\")[0];\n printDebug(\"SCROLLBAR\", scrollbarEl);\n const scrollbarDrag = $(scrollbarEl).find(\"[waterfall-el='scrollbar-drag']\")[0];\n printDebug(\"SCROLLBAR DRAG\", scrollbarDrag);\n\n if (scrollbarMode) {\n swiperConfig.scrollbar = {\n dragClass: $(scrollbarDrag).attr(\"class\"),\n dragSize: getAttr($this, \"drag-size\", \"auto\"),\n draggable: getAttr($this, \"draggable\", true),\n el: scrollbarEl,\n enabled: getAttr($this, \"scrollbar-enabled\", true),\n hide: getAttr($this, \"scrollbar-hide\", true),\n horizontalClass: getAttr($this, \"scrollbar-horizontal-class\", \"swiper-scrollbar-horizontal\"),\n lockClass: getAttr($this, \"scrollbar-lock-class\", \"swiper-scrollbar-lock\"),\n scrollbarDisabledClass: getAttr($this, \"scrollbar-disabled-class\", \"swiper-scrollbar-disabled\"),\n snapOnRelease: getAttr($this, \"snap-on-release\", false),\n verticalClass: getAttr($this, \"scrollbar-vertical-class\", \"swiper-scrollbar-vertical\"),\n };\n }\n\n // --- CLEANUP AND EXPORT ---\n\n console.log(JSON.stringify(swiperConfig));\n\n const config = removeNullKeys(swiperConfig);\n\n console.log(JSON.stringify(config));\n\n // Initialize swiper\n const swiper = new swiper_bundle__WEBPACK_IMPORTED_MODULE_0__[\"default\"]($this.find(\".swiper\")[0], config);\n\n sliders.push({ name, slider: swiper });\n});\n\n\n//# sourceURL=webpack://Waterfall/./src/waterfall.js?");
|
|
140
140
|
|
|
141
141
|
/***/ }),
|
|
142
142
|
|
package/package.json
CHANGED
package/src/waterfall.js
CHANGED
|
@@ -204,24 +204,9 @@ $("[waterfall]").each(function (index) {
|
|
|
204
204
|
//zoom: null,
|
|
205
205
|
};
|
|
206
206
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
//
|
|
210
|
-
swiperConfig.navigation = {
|
|
211
|
-
disabledClass: getAttr($this, "nav-disabled-class", "swiper-button-disabled"),
|
|
212
|
-
enabled: getAttr($this, 'nav-enabled', ''),
|
|
213
|
-
hiddenClass: getAttr($this, 'nav-hidden-class', 'swiper-button-hidden'),
|
|
214
|
-
hideOnClick: getAttr($this, 'nav-hide-on-click', 'false'),
|
|
215
|
-
lockClass: getAttr($this, 'nav-lock-class', 'swiper-button-lock'),
|
|
216
|
-
navigationDisabledClass: getAttr($this, 'nav-disabled-class', 'swiper-navigation-disabled'),
|
|
217
|
-
nextEl: $this.find("[waterfall-el='next']")[0],
|
|
218
|
-
prevEl: $this.find("[waterfall-el='prev']")[0],
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
const scrollbarMode = getAttr($this, "scrollbar-mode", false);
|
|
222
|
-
//printDebug("SCROLLBAR MODE", scrollbarMode);
|
|
223
|
-
|
|
224
|
-
// --- AUTOPLAY ---
|
|
207
|
+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
208
|
+
// --- AUTOPLAY --------------------------------
|
|
209
|
+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
225
210
|
const autoplayMode = getAttr($this, "autoplay-mode", false);
|
|
226
211
|
printDebug("AUTOPLAY MODE", autoplayMode);
|
|
227
212
|
|
|
@@ -237,44 +222,79 @@ $("[waterfall]").each(function (index) {
|
|
|
237
222
|
$("[smooth-autoplay='true']").find(".swiper-wrapper").css("transition-timing-function", "linear");
|
|
238
223
|
}
|
|
239
224
|
|
|
240
|
-
//
|
|
241
|
-
|
|
242
|
-
|
|
225
|
+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
226
|
+
// --- NAVIGATION -----------------------------
|
|
227
|
+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
228
|
+
swiperConfig.navigation = {
|
|
229
|
+
disabledClass: getAttr($this, "nav-disabled-class", "swiper-button-disabled"),
|
|
230
|
+
enabled: getAttr($this, 'nav-enabled', ''),
|
|
231
|
+
hiddenClass: getAttr($this, 'nav-hidden-class', 'swiper-button-hidden'),
|
|
232
|
+
hideOnClick: getAttr($this, 'nav-hide-on-click', 'false'),
|
|
233
|
+
lockClass: getAttr($this, 'nav-lock-class', 'swiper-button-lock'),
|
|
234
|
+
navigationDisabledClass: getAttr($this, 'nav-disabled-class', 'swiper-navigation-disabled'),
|
|
235
|
+
nextEl: $this.find("[waterfall-el='next']")[0],
|
|
236
|
+
prevEl: $this.find("[waterfall-el='prev']")[0],
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
240
|
+
// --- PAGINATION -----------------------------
|
|
241
|
+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
242
|
+
|
|
243
243
|
let paginationType = getAttr($this, "pagination-type", "bullets");
|
|
244
|
-
|
|
245
|
-
//printDebug("PAGINATION TYPE", paginationType);
|
|
246
|
-
//printDebug("BULLET CLASS", $this.find("[waterfall-el='pagination-bullet']").attr("class"));
|
|
247
|
-
//printDebug("BULLET ACTIVE CLASS", getAttr($this, "bullet-active-class", "swiper-pagination-bullet-active"));
|
|
244
|
+
printDebug("PAGINATION TYPE", paginationType);
|
|
248
245
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
return `<span class="${className}">${index + 1}</span>`;
|
|
246
|
+
// Custom pagination type rendering functions
|
|
247
|
+
function customRenderBullet() {
|
|
248
|
+
if (paginationType === "numberBullets") {
|
|
249
|
+
return (index, className) => `<span class="${className}">${index + 1}</span>`;
|
|
253
250
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
if (paginationType === "bullets") {
|
|
257
|
-
bulletRenderFn = function (index, className) {
|
|
258
|
-
return `<span class="${className}"></span>`;
|
|
251
|
+
if (paginationType === "bullets") {
|
|
252
|
+
return (index, className) => `<span class="${className}"></span>`;
|
|
259
253
|
}
|
|
254
|
+
return null;
|
|
260
255
|
}
|
|
261
256
|
|
|
262
|
-
//
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
clickable: getAttr($this, "pagination-clickable", true),
|
|
269
|
-
bulletClass: $this.find("[waterfall-el='pagination-bullet']").attr("class"),
|
|
270
|
-
bulletActiveClass: getAttr($this, "bullet-active-class", "swiper-pagination-bullet-active"),
|
|
271
|
-
type: paginationType,
|
|
272
|
-
dynamicBullets: false,
|
|
273
|
-
renderBullet: bulletRenderFn,
|
|
274
|
-
};
|
|
257
|
+
// Custom function to get extended pagination types
|
|
258
|
+
function getPaginationType() {
|
|
259
|
+
if (paginationType === "numberBullets" || paginationType === "bullets") return "bullets";
|
|
260
|
+
if (paginationType === "fraction") return "fraction";
|
|
261
|
+
if (paginationType === "progressbar") return "progressbar";
|
|
262
|
+
if (paginationType === "custom") return "custom";
|
|
275
263
|
}
|
|
276
264
|
|
|
265
|
+
swiperConfig.pagination = {
|
|
266
|
+
bulletActiveClass: getAttr($this, "bullet-active-class", "swiper-pagination-bullet-active"),
|
|
267
|
+
bulletClass: $this.find("[waterfall-el='pagination-bullet']").attr("class"),
|
|
268
|
+
bulletElement: getAttr($this, "bullet-element", "span"),
|
|
269
|
+
clickable: getAttr($this, "pagination-clickable", true),
|
|
270
|
+
clickableClass: getAttr($this, "pagination-clickable-class", "swiper-pagination-clickable"),
|
|
271
|
+
currentClass: getAttr($this, "pagination-current-class", "swiper-pagination-current"),
|
|
272
|
+
dynamicBullets: getAttr($this, "dynamic-bullets", "swiper-pagination-current"),
|
|
273
|
+
dynamicMainBullets: getAttr($this, "dynamic-main-bullets", "1"),
|
|
274
|
+
el: $this.find("[waterfall-el='pagination']")[0],
|
|
275
|
+
enabled: getAttr($this, "pagination-enabled", ""),
|
|
276
|
+
//formatFractionCurrent: null,
|
|
277
|
+
//formatFractionTotal: null,
|
|
278
|
+
hiddenClass: getAttr($this, "pagination-hidden-class", "swiper-pagination-hidden"),
|
|
279
|
+
hideOnClick: getAttr($this, "pagination-hide-on-click", "true"),
|
|
280
|
+
horizontalClass: getAttr($this, "pagination-horizontal-class", "swiper-pagination-horizontal"),
|
|
281
|
+
lockClass: getAttr($this, "pagination-lock-class", "swiper-pagination-lock"),
|
|
282
|
+
modifierClass: getAttr($this, "pagination-modifier-class", "swiper-pagination-"),
|
|
283
|
+
paginationDisabledClass: getAttr($this, "pagination-disabled-class", "swiper-pagination-disabled"),
|
|
284
|
+
progressbarFillClass: getAttr($this, "pagination-progressbar-fill-class", "swiper-pagination-progressbar-fill"),
|
|
285
|
+
progressbarOpposite: getAttr($this, "pagination-progressbar-opposite", "swiper-pagination-progressbar-opposite"),
|
|
286
|
+
renderBullet: customRenderBullet(),
|
|
287
|
+
//renderCustom: null,
|
|
288
|
+
//renderFraction: null,
|
|
289
|
+
//renderProgressBar: null,
|
|
290
|
+
totalClass: getAttr($this, "pagination-total-class", "swiper-pagination-total"),
|
|
291
|
+
type: getPaginationType(),
|
|
292
|
+
verticalClass: getAttr($this, "pagination-vertical-class", "swiper-pagination-vertical"),
|
|
293
|
+
};
|
|
294
|
+
|
|
277
295
|
// --- SCROLLBAR ---
|
|
296
|
+
const scrollbarMode = getAttr($this, "scrollbar-mode", false);
|
|
297
|
+
//printDebug("SCROLLBAR MODE", scrollbarMode);
|
|
278
298
|
const scrollbarEl = $this.find("[waterfall-el='scrollbar']")[0];
|
|
279
299
|
printDebug("SCROLLBAR", scrollbarEl);
|
|
280
300
|
const scrollbarDrag = $(scrollbarEl).find("[waterfall-el='scrollbar-drag']")[0];
|