well-waterfall 0.1.14 → 0.1.16
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 +2 -2
- package/package.json +1 -1
- package/src/util.ts +41 -2
- package/src/waterfall.ts +156 -198
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 export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getBooleanAttr: () => (/* binding */ getBooleanAttr),\n/* harmony export */ getNumberAttr: () => (/* binding */ getNumberAttr),\n/* harmony export */ getStringAttr: () => (/* binding */ getStringAttr),\n/* harmony export */ getUniqueClasses: () => (/* binding */ getUniqueClasses),\n/* harmony export */ printDebug: () => (/* binding */ printDebug),\n/* harmony export */ removeNullKeys: () => (/* binding */ removeNullKeys)\n/* harmony export */ });\nfunction printDebug(debug, str, el) {\n if (!debug)\n return;\n console.log(str, ': ', el);\n}\nfunction getUniqueClasses(targetElement, comparisonElement) {\n if (!targetElement.length)\n return ''; // If no element, return an empty string\n let targetClasses = (targetElement.attr('class') || '').split(/\\s+/);\n let comparisonClasses = (comparisonElement.attr('class') || '').split(/\\s+/);\n let filtered = targetClasses.filter((className) => className && !comparisonClasses.includes(className));\n // Get the class attribute, split into an array, filter out the classToRemove, and join back into a string\n return filtered.join(' '); // Join the remaining classes into a string\n}\n// Function to get a number attribute\nfunction getNumberAttr(el, attrName, defaultValue) {\n const attrValue = $(el).attr(attrName);\n // If the attribute doesn't exist or the default is null, return null\n if (attrValue === null || attrValue === undefined) {\n return null;\n }\n // Parse the attribute as a number\n const parsedValue = Number(attrValue);\n
|
|
139
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getBooleanAttr: () => (/* binding */ getBooleanAttr),\n/* harmony export */ getNumberAttr: () => (/* binding */ getNumberAttr),\n/* harmony export */ getStringAttr: () => (/* binding */ getStringAttr),\n/* harmony export */ getUniqueClasses: () => (/* binding */ getUniqueClasses),\n/* harmony export */ parseAttr: () => (/* binding */ parseAttr),\n/* harmony export */ printDebug: () => (/* binding */ printDebug),\n/* harmony export */ removeNullKeys: () => (/* binding */ removeNullKeys)\n/* harmony export */ });\nfunction printDebug(debug, str, el) {\n if (!debug)\n return;\n console.log(str, ': ', el);\n}\nfunction getUniqueClasses(targetElement, comparisonElement) {\n if (!targetElement.length)\n return ''; // If no element, return an empty string\n let targetClasses = (targetElement.attr('class') || '').split(/\\s+/);\n let comparisonClasses = (comparisonElement.attr('class') || '').split(/\\s+/);\n let filtered = targetClasses.filter((className) => className && !comparisonClasses.includes(className));\n // Get the class attribute, split into an array, filter out the classToRemove, and join back into a string\n return filtered.join(' '); // Join the remaining classes into a string\n}\n// Function to get a number attribute\nfunction getNumberAttr(el, attrName, defaultValue) {\n const attrValue = $(el).attr(attrName);\n // If the attribute doesn't exist or the default is null, return null\n if (attrValue === null || attrValue === undefined) {\n return null;\n }\n // Parse the attribute as a number\n const parsedValue = Number(attrValue);\n // If the parsed value is not a number or matches the default value, return null\n return isNaN(parsedValue) || parsedValue === defaultValue\n ? null\n : parsedValue;\n}\n// Function to get a boolean attribute\nfunction getBooleanAttr(el, attrName, defaultValue) {\n const value = $(el).attr(attrName);\n // If the attribute doesn't exist or the default is null, return null\n if (value === null || value === undefined || defaultValue === null) {\n return null;\n }\n // Compare the attribute value (converted to lowercase) to 'true'\n const booleanValue = String(value).toLowerCase() === 'true';\n // If the value matches the default, return null\n return booleanValue === defaultValue ? null : booleanValue;\n}\n// Function to get a string attribute\nfunction getStringAttr(el, attrName, defaultValue) {\n const value = $(el).attr(attrName);\n // If the attribute doesn't exist or the default is null, return null\n if (value === null || value === undefined || defaultValue === null) {\n return null;\n }\n // If the attribute matches the default value, return null\n return value.toString() === defaultValue ? null : value.toString();\n}\nfunction parseAttr(el, attrName, defaultValue) {\n const attrValue = $(el).attr(attrName);\n if (!attrValue)\n return null;\n // Trim the input to avoid issues with leading/trailing spaces\n const trimmedInput = attrValue.trim();\n // Check if input is a number\n if (!isNaN(Number(trimmedInput))) {\n const parsedNumber = parseFloat(trimmedInput);\n if (parsedNumber === defaultValue) {\n return null; // Return null if it matches the default value\n }\n return parsedNumber; // Return the parsed number\n }\n // Check if input is a boolean\n if (trimmedInput.toLowerCase() === 'true') {\n if (defaultValue === true) {\n return null; // Return null if it matches the default value\n }\n return true;\n }\n else if (trimmedInput.toLowerCase() === 'false') {\n if (defaultValue === false) {\n return null; // Return null if it matches the default value\n }\n return false;\n }\n // Return null if the input matches the default value (as a string)\n if (trimmedInput === String(defaultValue)) {\n return null;\n }\n // Return the input as a string\n return trimmedInput;\n}\nfunction removeNullKeys(obj) {\n if (typeof obj !== 'object' || obj === null) {\n return obj; // Return non-objects or null as is\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 delete obj[key];\n }\n else if (typeof obj[key] === 'object' &&\n !(obj[key] instanceof HTMLElement)) {\n // Recursively handle nested objects\n removeNullKeys(obj[key]);\n // Check if the object is now empty and remove it if so\n if (Object.keys(obj[key]).length === 0) {\n delete obj[key];\n }\n }\n }\n return obj;\n}\n\n\n//# sourceURL=webpack://Waterfall/./src/util.ts?");
|
|
140
140
|
|
|
141
141
|
/***/ }),
|
|
142
142
|
|
|
@@ -146,7 +146,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
146
146
|
\**************************/
|
|
147
147
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
148
148
|
|
|
149
|
-
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/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./src/util.ts\");\n\n\n\nconsole.log(`🚿 Hello from Wellflow Waterfall v${\"0.1.14\"}`);\nconst sliders = [];\n$('[waterfall]').each(function (index) {\n var _a;\n const $this = $(this);\n const name = (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'waterfall', `Swiper ${index}`);\n const debug = (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'debug-mode', false) || false;\n console.log('Running in', debug ? 'debug mode' : 'normal mode');\n const swiperConfig = {\n a11y: {\n prevSlideMessage: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'a11y-prev-message', 'Previous Slide'),\n nextSlideMessage: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'a11y-next-message', 'Next Slide'),\n },\n allowSlideNext: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'allow-slide-next', true),\n allowSlidePrev: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'allow-slide-prev', true),\n allowTouchMove: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'allow-touch-move', true),\n autoHeight: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'auto-height', false),\n breakpoints: {\n 478: {\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'lmobile-centered-slides', null),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'lmobile-slides-per-view', null),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'lmobile-space-between', null),\n },\n 767: {\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'tablet-centered-slides', null),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'tablet-slides-per-view', null),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'tablet-space-between', null),\n },\n 991: {\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'desktop-centered-slides', null),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'desktop-slides-per-view', null),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'desktop-space-between', null),\n },\n 1280: {\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'large-centered-slides', null),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'large-slides-per-view', null),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'large-space-between', null),\n },\n 1440: {\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'xlarge-centered-slides', null),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'xlarge-slides-per-view', null),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'xlarge-space-between', null),\n },\n },\n breakpointsBase: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'breakpoints-base', 'window'),\n centerInsufficientSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'center-insufficient-slides', false),\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'centered-slides', false),\n containerModifierClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'container-modifier-class', 'swiper-'),\n createElements: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'create-elements', false),\n cssMode: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'css-mode', false),\n direction: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'direction', 'horizontal'),\n edgeSwipeDetection: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'edge-swipe-detection', false),\n edgeSwipeThreshold: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'edge-swipe-threshold', 20),\n effect: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'effect', 'slide'),\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'enabled', true),\n eventsPrefix: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'events-prefix', 'swiper'),\n focusableElements: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'focusable-elements', 'input, select, option, textarea, button, video, label'),\n followFinger: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'follow-finger', true),\n freeMode: {\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'free-mode-enabled', false),\n sticky: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'free-mode-sticky', false),\n },\n grabCursor: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'grab-cursor', false),\n //grid: null,\n //hashNavigation: null,\n height: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'height', null),\n //history: null,\n init: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'init', true),\n initialSlide: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'initial-slide', 0),\n //injectStyles: null, // not needed\n //injectStylesUrls: null, // not needed\n lazyPreloadPrevNext: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'lazy-preload-prev-next', 0),\n lazyPreloaderClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'lazy-preloader-class', 'swiper-lazy-preloader'),\n longSwipes: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'long-swipes', true), // no effect\n longSwipesMs: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'long-swipes-ms', 300), // no effect\n longSwipesRatio: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'long-swipes-ratio', 0.5), // no effect\n loop: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'loop-mode', false),\n loopAddBlankSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'loop-add-blank-slides', true),\n loopAdditionalSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'loop-additional-slides', 0),\n loopPreventsSliding: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'loop-prevents-sliding', true),\n maxBackfaceHiddenSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'max-backface-hidden-slides', 10),\n //modules: null, // take a look at this\n //mouseWheel: null,\n //navigation: null,\n nested: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'nested', false),\n noSwiping: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'no-swiping', true),\n noSwipingClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'no-swiping-class', 'swiper-no-swiping'),\n noSwipingSelector: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'no-swiping-selector', null),\n normalizeSlideIndex: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'normalize-slide-index', true),\n observeParents: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'observe-parents', false),\n observeSlideChildren: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'observe-slide-children', false),\n //observer: null,\n //on: null,\n //onAny: null,\n oneWayMovement: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'data-one-way-movement', false),\n //pagination: null,\n //parallax: null,\n passiveListeners: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'passive-listeners', true),\n preventClicks: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'prevent-clicks', true),\n preventClicksPropagation: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'prevent-clicks-propagation', true),\n preventInteractionOnTransition: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'prevent-interaction-on-transition', false),\n resistance: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'resistance', true),\n resistanceRatio: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'resistance-ratio', 0.85),\n resizeObserver: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'resize-observer', true),\n rewind: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'rewind', false),\n roundLengths: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'round-lengths', false),\n runCallbacksOnInit: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'run-callbacks-on-init', true),\n // scrollbar: null,\n // setWrapperSize: getAttr($this, 'set-wrapper-size', false),\n shortSwipes: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'short-swipes', true),\n simulateTouch: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'simulate-touch', true),\n slideActiveClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'slide-active-class', 'swiper-slide-active'),\n slideBlankClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'slide-blank-class', 'swiper-slide-blank'),\n slideClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'slide-class', 'swiper-slide'),\n slideFullyVisibleClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'slide-fully-visible-class', 'swiper-slide-fully-visible'),\n slideNextClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'slide-next-class', 'swiper-slide-next'),\n slidePrevClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'slide-prev-class', 'swiper-slide-prev'),\n slideToClickedSlide: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'slide-to-clicked-slide', false),\n slideVisibleClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'slide-visible-class', 'swiper-slide-visible'),\n slidesOffsetAfter: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'slides-offset-after', 0),\n slidesOffsetBefore: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'slides-offset-before', 0),\n slidesPerGroup: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'slides-per-group', 1),\n slidesPerGroupAuto: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'slides-per-group-auto', false),\n slidesPerGroupSkip: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'slides-per-group-skip', 0),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'slides-per-view', '1'),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'space-between', 0),\n speed: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'speed', 300),\n // swipeHandler: getAttr($this, \"swipe-handler\", null),\n swiperElementNodeName: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'swiper-element-node-name', 'SWIPER-CONTAINER'),\n threshold: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'threshold', 5),\n // thumbs: null,\n touchAngle: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'touch-angle', 45),\n touchEventsTarget: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'touch-events-target', 'wrapper'),\n touchMoveStopPropagation: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'touch-move-stop-propagation', false),\n touchRatio: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'touch-ratio', 1),\n touchReleaseOnEdges: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'touch-release-on-edges', false),\n touchStartForcePreventDefault: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'touch-start-force-prevent-default', false),\n touchStartPreventDefault: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'touch-start-prevent-default', true),\n uniqueNavElements: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'unique-nav-elements', true),\n updateOnWindowResize: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'update-on-window-resize', true),\n //url: getAttr($this, \"url\", \"null\"),\n //userAgent: getAttr($this, \"user-agent\", \"null\"),\n //virtual: null,\n virtualTranslate: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'virtual-translate', false),\n watchOverflow: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'watch-overflow', true),\n watchSlidesProgress: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'watch-slides-progress', false),\n width: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'width', null),\n wrapperClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'wrapper-class', 'swiper-wrapper'),\n //zoom: null,\n };\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n // --- AUTOPLAY --------------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n const autoplayMode = (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'autoplay-mode', false);\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'AUTOPLAY MODE', autoplayMode);\n if (autoplayMode) {\n swiperConfig.autoplay = {\n delay: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'delay', 0),\n disableOnInteraction: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'disable-on-interaction', false), // documentation says default is true, doesn't appear to be correct\n reverseDirection: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'reverse-direction', false),\n pauseOnMouseEnter: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'pause-on-mouse-enter', false),\n stopOnLastSlide: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'stop-on-last-slide', false),\n };\n // Add CSS for Smooth Autoplay\n $(\"[smooth-autoplay='true']\")\n .find('.swiper-wrapper')\n .css('transition-timing-function', 'linear');\n }\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n // --- NAVIGATION -----------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n swiperConfig.navigation = {\n disabledClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'nav-disabled-class', 'swiper-button-disabled'),\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'nav-enabled', null),\n hiddenClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'nav-hidden-class', 'swiper-button-hidden'),\n hideOnClick: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'nav-hide-on-click', false),\n lockClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'nav-lock-class', 'swiper-button-lock'),\n navigationDisabledClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($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 // --- PAGINATION -----------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n let paginationType = (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'pagination-type', '');\n let $paginationBullet = $this.find(\"[waterfall-el='pagination-bullet']\");\n let paginationBulletActive = $this.find(\"[waterfall-el='pagination-bullet-active']\");\n let pagination = $paginationBullet.length ? true : false;\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'PAGINATION:', pagination);\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'PAGINATION TYPE:', paginationType);\n // Custom pagination type rendering functions\n function customRenderBullet() {\n let renderBullet = null;\n if (paginationType === 'numberBullets') {\n renderBullet = function (index, className) {\n return `<span class=\"${className}\">${index + 1}</span>`;\n };\n }\n if (paginationType === 'bullets') {\n renderBullet = function (index, className) {\n return `<span class=\"${className}\"></span>`;\n };\n }\n return renderBullet;\n }\n // Custom function to get extended pagination types\n function getPaginationType() {\n if (paginationType === 'numberBullets' || paginationType === 'bullets')\n return 'bullets';\n if (paginationType === 'fraction')\n return 'fraction';\n if (paginationType === 'progressbar')\n return 'progressbar';\n if (paginationType === 'custom')\n return 'custom';\n else\n return 'bullets'; // default\n }\n if (pagination) {\n swiperConfig.pagination = {\n bulletActiveClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getUniqueClasses)(paginationBulletActive, $paginationBullet),\n bulletClass: $paginationBullet.attr('class'),\n bulletElement: ((_a = $paginationBullet.prop('tagName')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || 'span', //ISSUE HERE\n clickable: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'pagination-clickable', true),\n clickableClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'pagination-clickable-class', 'swiper-pagination-clickable'),\n currentClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'pagination-current-class', 'swiper-pagination-current'),\n dynamicBullets: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'dynamic-bullets', 'swiper-pagination-current'),\n dynamicMainBullets: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'dynamic-main-bullets', 1),\n el: $this.find(\"[waterfall-el='pagination']\")[0],\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'pagination-enabled', null),\n //formatFractionCurrent: null,\n //formatFractionTotal: null,\n hiddenClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'pagination-hidden-class', 'swiper-pagination-hidden'),\n hideOnClick: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'pagination-hide-on-click', true),\n horizontalClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'pagination-horizontal-class', 'swiper-pagination-horizontal'),\n lockClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'pagination-lock-class', 'swiper-pagination-lock'),\n modifierClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'pagination-modifier-class', 'swiper-pagination-'),\n paginationDisabledClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'pagination-disabled-class', 'swiper-pagination-disabled'),\n progressbarFillClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'pagination-progressbar-fill-class', 'swiper-pagination-progressbar-fill'),\n progressbarOpposite: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'pagination-progressbar-opposite', 'swiper-pagination-progressbar-opposite'),\n renderBullet: customRenderBullet(),\n //renderCustom: null,\n //renderFraction: null,\n //renderProgressBar: null,\n totalClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'pagination-total-class', 'swiper-pagination-total'),\n type: getPaginationType(),\n verticalClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'pagination-vertical-class', 'swiper-pagination-vertical'),\n };\n }\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n // --- SCROLLBAR ------------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n const $scrollbar = $this.find(\"[waterfall-el='scrollbar']\");\n const $scrollbarDrag = $($scrollbar).find(\"[waterfall-el='scrollbar-drag']\");\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'SCROLLBAR', $scrollbar);\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'SCROLLBAR DRAG', $scrollbarDrag);\n if ($scrollbar) {\n swiperConfig.scrollbar = {\n dragClass: $scrollbarDrag.attr('class'),\n dragSize: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'scrollbar-drag-size', 'auto'),\n draggable: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'scrollbar-draggable', false),\n el: $scrollbar[0],\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'scrollbar-enabled', null),\n hide: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'scrollbar-hide', true),\n horizontalClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'scrollbar-horizontal-class', 'swiper-scrollbar-horizontal'),\n lockClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'scrollbar-lock-class', 'swiper-scrollbar-lock'),\n scrollbarDisabledClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'scrollbar-disabled-class', 'swiper-scrollbar-disabled'),\n snapOnRelease: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'snap-on-release', true), // documentation says default is false, but is lying lmao\n verticalClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'scrollbar-vertical-class', 'swiper-scrollbar-vertical'),\n };\n }\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n // --- FREE MODE ------------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n swiperConfig.freeMode = {\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'free-mode-enabled', false),\n minimumVelocity: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'free-mode-minimum-velocity', 0.02),\n momentum: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'free-mode-momentum', true),\n momentumBounce: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'free-mode-momentum-bounce', true),\n momentumBounceRatio: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'free-mode-momentum-bounce-ratio', 1),\n momentumRatio: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'free-mode-momentum-ratio', 1),\n momentumVelocityRatio: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'free-mode-momentum-velocity-ratio', 1),\n sticky: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getBooleanAttr)($this, 'free-mode-sticky', false),\n };\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n // --- GRID -----------------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n swiperConfig.grid = {\n fill: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getStringAttr)($this, 'grid-fill', 'column'),\n rows: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getNumberAttr)($this, 'grid-rows', 1),\n };\n // --- CLEANUP AND EXPORT ---\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'CONFIG', JSON.stringify(swiperConfig));\n const config = (0,_util__WEBPACK_IMPORTED_MODULE_2__.removeNullKeys)(swiperConfig);\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'CONFIG (Cleaned)', config);\n // Initialize swiper\n const swiper = new swiper_bundle__WEBPACK_IMPORTED_MODULE_0__[\"default\"]($this.find('.swiper')[0], config);\n sliders.push({ name, slider: swiper });\n});\n\n\n//# sourceURL=webpack://Waterfall/./src/waterfall.ts?");
|
|
149
|
+
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/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./src/util.ts\");\n\n\n\nconsole.log(`🚿 Hello from Wellflow Waterfall v${\"0.1.16\"}`);\nconst sliders = [];\n$('[waterfall]').each(function (index) {\n var _a;\n const $this = $(this);\n const name = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'waterfall', `Swiper ${index}`);\n const debug = Boolean((0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'debug-mode', false) || false);\n console.log('Running in', debug ? 'debug mode' : 'normal mode');\n const swiperConfig = {\n a11y: {\n prevSlideMessage: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'a11y-prev-message', 'Previous Slide'),\n nextSlideMessage: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'a11y-next-message', 'Next Slide'),\n },\n allowSlideNext: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'allow-slide-next', true),\n allowSlidePrev: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'allow-slide-prev', true),\n allowTouchMove: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'allow-touch-move', true),\n autoHeight: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'auto-height', false),\n breakpoints: {\n 478: {\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'lmobile-centered-slides', null),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'lmobile-slides-per-view', null),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'lmobile-space-between', null),\n },\n 767: {\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'tablet-centered-slides', null),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'tablet-slides-per-view', null),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'tablet-space-between', null),\n },\n 991: {\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'desktop-centered-slides', null),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'desktop-slides-per-view', null),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'desktop-space-between', null),\n },\n 1280: {\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'large-centered-slides', null),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'large-slides-per-view', null),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'large-space-between', null),\n },\n 1440: {\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'xlarge-centered-slides', null),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'xlarge-slides-per-view', null),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'xlarge-space-between', null),\n },\n },\n breakpointsBase: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'breakpoints-base', 'window'),\n centerInsufficientSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'center-insufficient-slides', false),\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'centered-slides', false),\n containerModifierClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'container-modifier-class', 'swiper-'),\n createElements: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'create-elements', false),\n cssMode: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'css-mode', false),\n direction: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'direction', 'horizontal'),\n edgeSwipeDetection: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'edge-swipe-detection', false),\n edgeSwipeThreshold: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'edge-swipe-threshold', 20),\n effect: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'effect', 'slide'),\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'enabled', true),\n eventsPrefix: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'events-prefix', 'swiper'),\n focusableElements: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'focusable-elements', 'input, select, option, textarea, button, video, label'),\n followFinger: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'follow-finger', true),\n freeMode: {\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'free-mode-enabled', false),\n sticky: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'free-mode-sticky', false),\n },\n grabCursor: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'grab-cursor', false),\n //grid: null,\n //hashNavigation: null,\n height: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'height', null),\n //history: null,\n init: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'init', true),\n initialSlide: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'initial-slide', 0),\n //injectStyles: null, // not needed\n //injectStylesUrls: null, // not needed\n lazyPreloadPrevNext: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'lazy-preload-prev-next', 0),\n lazyPreloaderClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'lazy-preloader-class', 'swiper-lazy-preloader'),\n longSwipes: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'long-swipes', true), // no effect\n longSwipesMs: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'long-swipes-ms', 300), // no effect\n longSwipesRatio: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'long-swipes-ratio', 0.5), // no effect\n loop: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'loop-mode', false),\n loopAddBlankSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'loop-add-blank-slides', true),\n loopAdditionalSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'loop-additional-slides', 0),\n loopPreventsSliding: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'loop-prevents-sliding', true),\n maxBackfaceHiddenSlides: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'max-backface-hidden-slides', 10),\n //modules: null, // take a look at this\n //mouseWheel: null,\n //navigation: null,\n nested: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'nested', false),\n noSwiping: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'no-swiping', true),\n noSwipingClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'no-swiping-class', 'swiper-no-swiping'),\n noSwipingSelector: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'no-swiping-selector', null),\n normalizeSlideIndex: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'normalize-slide-index', true),\n observeParents: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'observe-parents', false),\n observeSlideChildren: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'observe-slide-children', false),\n //observer: null,\n //on: null,\n //onAny: null,\n oneWayMovement: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'data-one-way-movement', false),\n //pagination: null,\n //parallax: null,\n passiveListeners: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'passive-listeners', true),\n preventClicks: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'prevent-clicks', true),\n preventClicksPropagation: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'prevent-clicks-propagation', true),\n preventInteractionOnTransition: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'prevent-interaction-on-transition', false),\n resistance: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'resistance', true),\n resistanceRatio: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'resistance-ratio', 0.85),\n resizeObserver: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'resize-observer', true),\n rewind: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'rewind', false),\n roundLengths: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'round-lengths', false),\n runCallbacksOnInit: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'run-callbacks-on-init', true),\n // scrollbar: null,\n // setWrapperSize: getAttr($this, 'set-wrapper-size', false),\n shortSwipes: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'short-swipes', true),\n simulateTouch: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'simulate-touch', true),\n slideActiveClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-active-class', 'swiper-slide-active'),\n slideBlankClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-blank-class', 'swiper-slide-blank'),\n slideClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-class', 'swiper-slide'),\n slideFullyVisibleClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-fully-visible-class', 'swiper-slide-fully-visible'),\n slideNextClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-next-class', 'swiper-slide-next'),\n slidePrevClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-prev-class', 'swiper-slide-prev'),\n slideToClickedSlide: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-to-clicked-slide', false),\n slideVisibleClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slide-visible-class', 'swiper-slide-visible'),\n slidesOffsetAfter: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slides-offset-after', 0),\n slidesOffsetBefore: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slides-offset-before', 0),\n slidesPerGroup: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slides-per-group', 1),\n slidesPerGroupAuto: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slides-per-group-auto', false),\n slidesPerGroupSkip: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slides-per-group-skip', 0),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'slides-per-view', '1'),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'space-between', 0),\n speed: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'speed', 300),\n // swipeHandler: getAttr($this, \"swipe-handler\", null),\n swiperElementNodeName: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'swiper-element-node-name', 'SWIPER-CONTAINER'),\n threshold: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'threshold', 5),\n // thumbs: null,\n touchAngle: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'touch-angle', 45),\n touchEventsTarget: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'touch-events-target', 'wrapper'),\n touchMoveStopPropagation: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'touch-move-stop-propagation', false),\n touchRatio: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'touch-ratio', 1),\n touchReleaseOnEdges: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'touch-release-on-edges', false),\n touchStartForcePreventDefault: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'touch-start-force-prevent-default', false),\n touchStartPreventDefault: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'touch-start-prevent-default', true),\n uniqueNavElements: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'unique-nav-elements', true),\n updateOnWindowResize: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'update-on-window-resize', true),\n //url: getAttr($this, \"url\", \"null\"),\n //userAgent: getAttr($this, \"user-agent\", \"null\"),\n //virtual: null,\n virtualTranslate: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'virtual-translate', false),\n watchOverflow: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'watch-overflow', true),\n watchSlidesProgress: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'watch-slides-progress', false),\n width: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'width', null),\n wrapperClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'wrapper-class', 'swiper-wrapper'),\n //zoom: null,\n };\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n // --- AUTOPLAY --------------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n const autoplayMode = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'autoplay-mode', false);\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'AUTOPLAY MODE', autoplayMode);\n if (autoplayMode) {\n swiperConfig.autoplay = {\n delay: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'delay', 0),\n disableOnInteraction: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'disable-on-interaction', false), // documentation says default is true, doesn't appear to be correct\n reverseDirection: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'reverse-direction', false),\n pauseOnMouseEnter: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pause-on-mouse-enter', false),\n stopOnLastSlide: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'stop-on-last-slide', false),\n };\n // Add CSS for Smooth Autoplay\n $(\"[smooth-autoplay='true']\")\n .find('.swiper-wrapper')\n .css('transition-timing-function', 'linear');\n }\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n // --- NAVIGATION -----------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n swiperConfig.navigation = {\n disabledClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'nav-disabled-class', 'swiper-button-disabled'),\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'nav-enabled', null),\n hiddenClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'nav-hidden-class', 'swiper-button-hidden'),\n hideOnClick: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'nav-hide-on-click', false),\n lockClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'nav-lock-class', 'swiper-button-lock'),\n navigationDisabledClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'nav-disabled-class', 'swiper-navigation-disabled'),\n nextEl: \"[waterfall-el='next']\",\n prevEl: \"[waterfall-el='prev']\",\n };\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n // --- PAGINATION -----------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n let paginationType = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pagination-type', '');\n let $paginationBullet = $this.find(\"[waterfall-el='pagination-bullet']\");\n let paginationBulletActive = $this.find(\"[waterfall-el='pagination-bullet-active']\");\n let pagination = $paginationBullet.length ? true : false;\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'PAGINATION:', pagination);\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'PAGINATION TYPE:', paginationType);\n // Custom pagination type rendering functions\n function customRenderBullet() {\n let renderBullet = null;\n if (paginationType === 'numberBullets') {\n renderBullet = function (index, className) {\n return `<span class=\"${className}\">${index + 1}</span>`;\n };\n }\n if (paginationType === 'bullets') {\n renderBullet = function (index, className) {\n return `<span class=\"${className}\"></span>`;\n };\n }\n return renderBullet;\n }\n // Custom function to get extended pagination types\n function getPaginationType() {\n if (paginationType === 'numberBullets' || paginationType === 'bullets')\n return 'bullets';\n if (paginationType === 'fraction')\n return 'fraction';\n if (paginationType === 'progressbar')\n return 'progressbar';\n if (paginationType === 'custom')\n return 'custom';\n else\n return 'bullets'; // default\n }\n if (pagination) {\n swiperConfig.pagination = {\n bulletActiveClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.getUniqueClasses)(paginationBulletActive, $paginationBullet),\n bulletClass: $paginationBullet.attr('class'),\n bulletElement: ((_a = $paginationBullet.prop('tagName')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || 'span', //ISSUE HERE\n clickable: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pagination-clickable', true),\n clickableClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pagination-clickable-class', 'swiper-pagination-clickable'),\n currentClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pagination-current-class', 'swiper-pagination-current'),\n dynamicBullets: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'dynamic-bullets', 'swiper-pagination-current'),\n dynamicMainBullets: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'dynamic-main-bullets', 1),\n el: $this.find(\"[waterfall-el='pagination']\")[0],\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pagination-enabled', null),\n //formatFractionCurrent: null,\n //formatFractionTotal: null,\n hiddenClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pagination-hidden-class', 'swiper-pagination-hidden'),\n hideOnClick: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pagination-hide-on-click', true),\n horizontalClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pagination-horizontal-class', 'swiper-pagination-horizontal'),\n lockClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pagination-lock-class', 'swiper-pagination-lock'),\n modifierClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pagination-modifier-class', 'swiper-pagination-'),\n paginationDisabledClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pagination-disabled-class', 'swiper-pagination-disabled'),\n progressbarFillClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pagination-progressbar-fill-class', 'swiper-pagination-progressbar-fill'),\n progressbarOpposite: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pagination-progressbar-opposite', 'swiper-pagination-progressbar-opposite'),\n renderBullet: customRenderBullet(),\n //renderCustom: null,\n //renderFraction: null,\n //renderProgressBar: null,\n totalClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pagination-total-class', 'swiper-pagination-total'),\n type: getPaginationType(),\n verticalClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'pagination-vertical-class', 'swiper-pagination-vertical'),\n };\n }\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n // --- SCROLLBAR ------------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n const $scrollbar = $this.find(\"[waterfall-el='scrollbar']\");\n const $scrollbarDrag = $($scrollbar).find(\"[waterfall-el='scrollbar-drag']\");\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'SCROLLBAR', $scrollbar);\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'SCROLLBAR DRAG', $scrollbarDrag);\n if ($scrollbar) {\n swiperConfig.scrollbar = {\n dragClass: $scrollbarDrag.attr('class'),\n dragSize: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'scrollbar-drag-size', 'auto'),\n draggable: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'scrollbar-draggable', false),\n el: $scrollbar[0],\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'scrollbar-enabled', null),\n hide: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'scrollbar-hide', true),\n horizontalClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'scrollbar-horizontal-class', 'swiper-scrollbar-horizontal'),\n lockClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'scrollbar-lock-class', 'swiper-scrollbar-lock'),\n scrollbarDisabledClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'scrollbar-disabled-class', 'swiper-scrollbar-disabled'),\n snapOnRelease: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'snap-on-release', true), // documentation says default is false, but is lying lmao\n verticalClass: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'scrollbar-vertical-class', 'swiper-scrollbar-vertical'),\n };\n }\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n // --- FREE MODE ------------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n swiperConfig.freeMode = {\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'free-mode-enabled', false),\n minimumVelocity: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'free-mode-minimum-velocity', 0.02),\n momentum: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'free-mode-momentum', true),\n momentumBounce: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'free-mode-momentum-bounce', true),\n momentumBounceRatio: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'free-mode-momentum-bounce-ratio', 1),\n momentumRatio: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'free-mode-momentum-ratio', 1),\n momentumVelocityRatio: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'free-mode-momentum-velocity-ratio', 1),\n sticky: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'free-mode-sticky', false),\n };\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n // --- GRID -----------------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n swiperConfig.grid = {\n fill: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'grid-fill', 'column'),\n rows: (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'grid-rows', 1),\n };\n // --- CLEANUP AND EXPORT ---\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'CONFIG', JSON.stringify(swiperConfig));\n const config = (0,_util__WEBPACK_IMPORTED_MODULE_2__.removeNullKeys)(swiperConfig);\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'CONFIG (Cleaned)', config);\n // Initialize swiper\n const swiper = new swiper_bundle__WEBPACK_IMPORTED_MODULE_0__[\"default\"]($this.find('.swiper')[0], config);\n sliders.push({ name, slider: swiper });\n});\n\n\n//# sourceURL=webpack://Waterfall/./src/waterfall.ts?");
|
|
150
150
|
|
|
151
151
|
/***/ }),
|
|
152
152
|
|
package/package.json
CHANGED
package/src/util.ts
CHANGED
|
@@ -34,8 +34,6 @@ export function getNumberAttr(
|
|
|
34
34
|
|
|
35
35
|
// Parse the attribute as a number
|
|
36
36
|
const parsedValue = Number(attrValue);
|
|
37
|
-
console.log('ATTR: ', attrName);
|
|
38
|
-
console.log('PARSED VALUE: ', parsedValue);
|
|
39
37
|
|
|
40
38
|
// If the parsed value is not a number or matches the default value, return null
|
|
41
39
|
return isNaN(parsedValue) || parsedValue === defaultValue
|
|
@@ -80,6 +78,47 @@ export function getStringAttr(
|
|
|
80
78
|
return value.toString() === defaultValue ? null : value.toString();
|
|
81
79
|
}
|
|
82
80
|
|
|
81
|
+
export function parseAttr(
|
|
82
|
+
el: JQuery<HTMLElement>,
|
|
83
|
+
attrName: string,
|
|
84
|
+
defaultValue: string | number | boolean | null,
|
|
85
|
+
): string | number | boolean | null {
|
|
86
|
+
const attrValue = $(el).attr(attrName);
|
|
87
|
+
if (!attrValue) return null;
|
|
88
|
+
// Trim the input to avoid issues with leading/trailing spaces
|
|
89
|
+
const trimmedInput = attrValue.trim();
|
|
90
|
+
|
|
91
|
+
// Check if input is a number
|
|
92
|
+
if (!isNaN(Number(trimmedInput))) {
|
|
93
|
+
const parsedNumber = parseFloat(trimmedInput);
|
|
94
|
+
if (parsedNumber === defaultValue) {
|
|
95
|
+
return null; // Return null if it matches the default value
|
|
96
|
+
}
|
|
97
|
+
return parsedNumber; // Return the parsed number
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Check if input is a boolean
|
|
101
|
+
if (trimmedInput.toLowerCase() === 'true') {
|
|
102
|
+
if (defaultValue === true) {
|
|
103
|
+
return null; // Return null if it matches the default value
|
|
104
|
+
}
|
|
105
|
+
return true;
|
|
106
|
+
} else if (trimmedInput.toLowerCase() === 'false') {
|
|
107
|
+
if (defaultValue === false) {
|
|
108
|
+
return null; // Return null if it matches the default value
|
|
109
|
+
}
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Return null if the input matches the default value (as a string)
|
|
114
|
+
if (trimmedInput === String(defaultValue)) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Return the input as a string
|
|
119
|
+
return trimmedInput;
|
|
120
|
+
}
|
|
121
|
+
|
|
83
122
|
export function removeNullKeys(obj: any) {
|
|
84
123
|
if (typeof obj !== 'object' || obj === null) {
|
|
85
124
|
return obj; // Return non-objects or null as is
|
package/src/waterfall.ts
CHANGED
|
@@ -2,9 +2,7 @@ import Swiper from 'swiper/bundle';
|
|
|
2
2
|
import 'swiper/css/bundle';
|
|
3
3
|
import {
|
|
4
4
|
getUniqueClasses,
|
|
5
|
-
|
|
6
|
-
getNumberAttr,
|
|
7
|
-
getStringAttr,
|
|
5
|
+
parseAttr,
|
|
8
6
|
removeNullKeys,
|
|
9
7
|
printDebug,
|
|
10
8
|
} from './util';
|
|
@@ -16,255 +14,223 @@ const sliders: any[] = [];
|
|
|
16
14
|
$('[waterfall]').each(function (index) {
|
|
17
15
|
const $this = $(this);
|
|
18
16
|
|
|
19
|
-
const name =
|
|
20
|
-
const debug =
|
|
17
|
+
const name = parseAttr($this, 'waterfall', `Swiper ${index}`);
|
|
18
|
+
const debug = Boolean(parseAttr($this, 'debug-mode', false) || false);
|
|
21
19
|
|
|
22
20
|
console.log('Running in', debug ? 'debug mode' : 'normal mode');
|
|
23
21
|
|
|
24
22
|
const swiperConfig: any = {
|
|
25
23
|
a11y: {
|
|
26
|
-
prevSlideMessage:
|
|
27
|
-
|
|
28
|
-
'a11y-prev-message',
|
|
29
|
-
'Previous Slide',
|
|
30
|
-
),
|
|
31
|
-
nextSlideMessage: getStringAttr($this, 'a11y-next-message', 'Next Slide'),
|
|
24
|
+
prevSlideMessage: parseAttr($this, 'a11y-prev-message', 'Previous Slide'),
|
|
25
|
+
nextSlideMessage: parseAttr($this, 'a11y-next-message', 'Next Slide'),
|
|
32
26
|
},
|
|
33
|
-
allowSlideNext:
|
|
34
|
-
allowSlidePrev:
|
|
35
|
-
allowTouchMove:
|
|
36
|
-
autoHeight:
|
|
27
|
+
allowSlideNext: parseAttr($this, 'allow-slide-next', true),
|
|
28
|
+
allowSlidePrev: parseAttr($this, 'allow-slide-prev', true),
|
|
29
|
+
allowTouchMove: parseAttr($this, 'allow-touch-move', true),
|
|
30
|
+
autoHeight: parseAttr($this, 'auto-height', false),
|
|
37
31
|
breakpoints: {
|
|
38
32
|
478: {
|
|
39
|
-
centeredSlides:
|
|
40
|
-
slidesPerView:
|
|
41
|
-
spaceBetween:
|
|
33
|
+
centeredSlides: parseAttr($this, 'lmobile-centered-slides', null),
|
|
34
|
+
slidesPerView: parseAttr($this, 'lmobile-slides-per-view', null),
|
|
35
|
+
spaceBetween: parseAttr($this, 'lmobile-space-between', null),
|
|
42
36
|
},
|
|
43
37
|
767: {
|
|
44
|
-
centeredSlides:
|
|
45
|
-
slidesPerView:
|
|
46
|
-
spaceBetween:
|
|
38
|
+
centeredSlides: parseAttr($this, 'tablet-centered-slides', null),
|
|
39
|
+
slidesPerView: parseAttr($this, 'tablet-slides-per-view', null),
|
|
40
|
+
spaceBetween: parseAttr($this, 'tablet-space-between', null),
|
|
47
41
|
},
|
|
48
42
|
991: {
|
|
49
|
-
centeredSlides:
|
|
50
|
-
slidesPerView:
|
|
51
|
-
spaceBetween:
|
|
43
|
+
centeredSlides: parseAttr($this, 'desktop-centered-slides', null),
|
|
44
|
+
slidesPerView: parseAttr($this, 'desktop-slides-per-view', null),
|
|
45
|
+
spaceBetween: parseAttr($this, 'desktop-space-between', null),
|
|
52
46
|
},
|
|
53
47
|
1280: {
|
|
54
|
-
centeredSlides:
|
|
55
|
-
slidesPerView:
|
|
56
|
-
spaceBetween:
|
|
48
|
+
centeredSlides: parseAttr($this, 'large-centered-slides', null),
|
|
49
|
+
slidesPerView: parseAttr($this, 'large-slides-per-view', null),
|
|
50
|
+
spaceBetween: parseAttr($this, 'large-space-between', null),
|
|
57
51
|
},
|
|
58
52
|
1440: {
|
|
59
|
-
centeredSlides:
|
|
60
|
-
slidesPerView:
|
|
61
|
-
spaceBetween:
|
|
53
|
+
centeredSlides: parseAttr($this, 'xlarge-centered-slides', null),
|
|
54
|
+
slidesPerView: parseAttr($this, 'xlarge-slides-per-view', null),
|
|
55
|
+
spaceBetween: parseAttr($this, 'xlarge-space-between', null),
|
|
62
56
|
},
|
|
63
57
|
},
|
|
64
|
-
breakpointsBase:
|
|
65
|
-
centerInsufficientSlides:
|
|
58
|
+
breakpointsBase: parseAttr($this, 'breakpoints-base', 'window'),
|
|
59
|
+
centerInsufficientSlides: parseAttr(
|
|
66
60
|
$this,
|
|
67
61
|
'center-insufficient-slides',
|
|
68
62
|
false,
|
|
69
63
|
),
|
|
70
|
-
centeredSlides:
|
|
71
|
-
containerModifierClass:
|
|
64
|
+
centeredSlides: parseAttr($this, 'centered-slides', false),
|
|
65
|
+
containerModifierClass: parseAttr(
|
|
72
66
|
$this,
|
|
73
67
|
'container-modifier-class',
|
|
74
68
|
'swiper-',
|
|
75
69
|
),
|
|
76
|
-
createElements:
|
|
77
|
-
cssMode:
|
|
78
|
-
direction:
|
|
79
|
-
edgeSwipeDetection:
|
|
80
|
-
edgeSwipeThreshold:
|
|
81
|
-
effect:
|
|
82
|
-
enabled:
|
|
83
|
-
eventsPrefix:
|
|
84
|
-
focusableElements:
|
|
70
|
+
createElements: parseAttr($this, 'create-elements', false),
|
|
71
|
+
cssMode: parseAttr($this, 'css-mode', false),
|
|
72
|
+
direction: parseAttr($this, 'direction', 'horizontal'),
|
|
73
|
+
edgeSwipeDetection: parseAttr($this, 'edge-swipe-detection', false),
|
|
74
|
+
edgeSwipeThreshold: parseAttr($this, 'edge-swipe-threshold', 20),
|
|
75
|
+
effect: parseAttr($this, 'effect', 'slide'),
|
|
76
|
+
enabled: parseAttr($this, 'enabled', true),
|
|
77
|
+
eventsPrefix: parseAttr($this, 'events-prefix', 'swiper'),
|
|
78
|
+
focusableElements: parseAttr(
|
|
85
79
|
$this,
|
|
86
80
|
'focusable-elements',
|
|
87
81
|
'input, select, option, textarea, button, video, label',
|
|
88
82
|
),
|
|
89
|
-
followFinger:
|
|
83
|
+
followFinger: parseAttr($this, 'follow-finger', true),
|
|
90
84
|
freeMode: {
|
|
91
|
-
enabled:
|
|
92
|
-
sticky:
|
|
85
|
+
enabled: parseAttr($this, 'free-mode-enabled', false),
|
|
86
|
+
sticky: parseAttr($this, 'free-mode-sticky', false),
|
|
93
87
|
},
|
|
94
|
-
grabCursor:
|
|
88
|
+
grabCursor: parseAttr($this, 'grab-cursor', false),
|
|
95
89
|
//grid: null,
|
|
96
90
|
//hashNavigation: null,
|
|
97
|
-
height:
|
|
91
|
+
height: parseAttr($this, 'height', null),
|
|
98
92
|
//history: null,
|
|
99
|
-
init:
|
|
100
|
-
initialSlide:
|
|
93
|
+
init: parseAttr($this, 'init', true),
|
|
94
|
+
initialSlide: parseAttr($this, 'initial-slide', 0),
|
|
101
95
|
//injectStyles: null, // not needed
|
|
102
96
|
//injectStylesUrls: null, // not needed
|
|
103
|
-
lazyPreloadPrevNext:
|
|
104
|
-
lazyPreloaderClass:
|
|
97
|
+
lazyPreloadPrevNext: parseAttr($this, 'lazy-preload-prev-next', 0),
|
|
98
|
+
lazyPreloaderClass: parseAttr(
|
|
105
99
|
$this,
|
|
106
100
|
'lazy-preloader-class',
|
|
107
101
|
'swiper-lazy-preloader',
|
|
108
102
|
),
|
|
109
|
-
longSwipes:
|
|
110
|
-
longSwipesMs:
|
|
111
|
-
longSwipesRatio:
|
|
112
|
-
loop:
|
|
113
|
-
loopAddBlankSlides:
|
|
114
|
-
loopAdditionalSlides:
|
|
115
|
-
loopPreventsSliding:
|
|
116
|
-
maxBackfaceHiddenSlides:
|
|
117
|
-
$this,
|
|
118
|
-
'max-backface-hidden-slides',
|
|
119
|
-
10,
|
|
120
|
-
),
|
|
103
|
+
longSwipes: parseAttr($this, 'long-swipes', true), // no effect
|
|
104
|
+
longSwipesMs: parseAttr($this, 'long-swipes-ms', 300), // no effect
|
|
105
|
+
longSwipesRatio: parseAttr($this, 'long-swipes-ratio', 0.5), // no effect
|
|
106
|
+
loop: parseAttr($this, 'loop-mode', false),
|
|
107
|
+
loopAddBlankSlides: parseAttr($this, 'loop-add-blank-slides', true),
|
|
108
|
+
loopAdditionalSlides: parseAttr($this, 'loop-additional-slides', 0),
|
|
109
|
+
loopPreventsSliding: parseAttr($this, 'loop-prevents-sliding', true),
|
|
110
|
+
maxBackfaceHiddenSlides: parseAttr($this, 'max-backface-hidden-slides', 10),
|
|
121
111
|
//modules: null, // take a look at this
|
|
122
112
|
//mouseWheel: null,
|
|
123
113
|
//navigation: null,
|
|
124
|
-
nested:
|
|
125
|
-
noSwiping:
|
|
126
|
-
noSwipingClass:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
),
|
|
131
|
-
noSwipingSelector: getStringAttr($this, 'no-swiping-selector', null),
|
|
132
|
-
normalizeSlideIndex: getBooleanAttr($this, 'normalize-slide-index', true),
|
|
133
|
-
observeParents: getBooleanAttr($this, 'observe-parents', false),
|
|
134
|
-
observeSlideChildren: getBooleanAttr(
|
|
135
|
-
$this,
|
|
136
|
-
'observe-slide-children',
|
|
137
|
-
false,
|
|
138
|
-
),
|
|
114
|
+
nested: parseAttr($this, 'nested', false),
|
|
115
|
+
noSwiping: parseAttr($this, 'no-swiping', true),
|
|
116
|
+
noSwipingClass: parseAttr($this, 'no-swiping-class', 'swiper-no-swiping'),
|
|
117
|
+
noSwipingSelector: parseAttr($this, 'no-swiping-selector', null),
|
|
118
|
+
normalizeSlideIndex: parseAttr($this, 'normalize-slide-index', true),
|
|
119
|
+
observeParents: parseAttr($this, 'observe-parents', false),
|
|
120
|
+
observeSlideChildren: parseAttr($this, 'observe-slide-children', false),
|
|
139
121
|
//observer: null,
|
|
140
122
|
//on: null,
|
|
141
123
|
//onAny: null,
|
|
142
|
-
oneWayMovement:
|
|
124
|
+
oneWayMovement: parseAttr($this, 'data-one-way-movement', false),
|
|
143
125
|
//pagination: null,
|
|
144
126
|
//parallax: null,
|
|
145
|
-
passiveListeners:
|
|
146
|
-
preventClicks:
|
|
147
|
-
preventClicksPropagation:
|
|
127
|
+
passiveListeners: parseAttr($this, 'passive-listeners', true),
|
|
128
|
+
preventClicks: parseAttr($this, 'prevent-clicks', true),
|
|
129
|
+
preventClicksPropagation: parseAttr(
|
|
148
130
|
$this,
|
|
149
131
|
'prevent-clicks-propagation',
|
|
150
132
|
true,
|
|
151
133
|
),
|
|
152
|
-
preventInteractionOnTransition:
|
|
134
|
+
preventInteractionOnTransition: parseAttr(
|
|
153
135
|
$this,
|
|
154
136
|
'prevent-interaction-on-transition',
|
|
155
137
|
false,
|
|
156
138
|
),
|
|
157
|
-
resistance:
|
|
158
|
-
resistanceRatio:
|
|
159
|
-
resizeObserver:
|
|
160
|
-
rewind:
|
|
161
|
-
roundLengths:
|
|
162
|
-
runCallbacksOnInit:
|
|
139
|
+
resistance: parseAttr($this, 'resistance', true),
|
|
140
|
+
resistanceRatio: parseAttr($this, 'resistance-ratio', 0.85),
|
|
141
|
+
resizeObserver: parseAttr($this, 'resize-observer', true),
|
|
142
|
+
rewind: parseAttr($this, 'rewind', false),
|
|
143
|
+
roundLengths: parseAttr($this, 'round-lengths', false),
|
|
144
|
+
runCallbacksOnInit: parseAttr($this, 'run-callbacks-on-init', true),
|
|
163
145
|
// scrollbar: null,
|
|
164
146
|
// setWrapperSize: getAttr($this, 'set-wrapper-size', false),
|
|
165
|
-
shortSwipes:
|
|
166
|
-
simulateTouch:
|
|
167
|
-
slideActiveClass:
|
|
147
|
+
shortSwipes: parseAttr($this, 'short-swipes', true),
|
|
148
|
+
simulateTouch: parseAttr($this, 'simulate-touch', true),
|
|
149
|
+
slideActiveClass: parseAttr(
|
|
168
150
|
$this,
|
|
169
151
|
'slide-active-class',
|
|
170
152
|
'swiper-slide-active',
|
|
171
153
|
),
|
|
172
|
-
slideBlankClass:
|
|
154
|
+
slideBlankClass: parseAttr(
|
|
173
155
|
$this,
|
|
174
156
|
'slide-blank-class',
|
|
175
157
|
'swiper-slide-blank',
|
|
176
158
|
),
|
|
177
|
-
slideClass:
|
|
178
|
-
slideFullyVisibleClass:
|
|
159
|
+
slideClass: parseAttr($this, 'slide-class', 'swiper-slide'),
|
|
160
|
+
slideFullyVisibleClass: parseAttr(
|
|
179
161
|
$this,
|
|
180
162
|
'slide-fully-visible-class',
|
|
181
163
|
'swiper-slide-fully-visible',
|
|
182
164
|
),
|
|
183
|
-
slideNextClass:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
),
|
|
188
|
-
slidePrevClass: getStringAttr(
|
|
189
|
-
$this,
|
|
190
|
-
'slide-prev-class',
|
|
191
|
-
'swiper-slide-prev',
|
|
192
|
-
),
|
|
193
|
-
slideToClickedSlide: getBooleanAttr($this, 'slide-to-clicked-slide', false),
|
|
194
|
-
slideVisibleClass: getStringAttr(
|
|
165
|
+
slideNextClass: parseAttr($this, 'slide-next-class', 'swiper-slide-next'),
|
|
166
|
+
slidePrevClass: parseAttr($this, 'slide-prev-class', 'swiper-slide-prev'),
|
|
167
|
+
slideToClickedSlide: parseAttr($this, 'slide-to-clicked-slide', false),
|
|
168
|
+
slideVisibleClass: parseAttr(
|
|
195
169
|
$this,
|
|
196
170
|
'slide-visible-class',
|
|
197
171
|
'swiper-slide-visible',
|
|
198
172
|
),
|
|
199
|
-
slidesOffsetAfter:
|
|
200
|
-
slidesOffsetBefore:
|
|
201
|
-
slidesPerGroup:
|
|
202
|
-
slidesPerGroupAuto:
|
|
203
|
-
slidesPerGroupSkip:
|
|
204
|
-
slidesPerView:
|
|
205
|
-
spaceBetween:
|
|
206
|
-
speed:
|
|
173
|
+
slidesOffsetAfter: parseAttr($this, 'slides-offset-after', 0),
|
|
174
|
+
slidesOffsetBefore: parseAttr($this, 'slides-offset-before', 0),
|
|
175
|
+
slidesPerGroup: parseAttr($this, 'slides-per-group', 1),
|
|
176
|
+
slidesPerGroupAuto: parseAttr($this, 'slides-per-group-auto', false),
|
|
177
|
+
slidesPerGroupSkip: parseAttr($this, 'slides-per-group-skip', 0),
|
|
178
|
+
slidesPerView: parseAttr($this, 'slides-per-view', '1'),
|
|
179
|
+
spaceBetween: parseAttr($this, 'space-between', 0),
|
|
180
|
+
speed: parseAttr($this, 'speed', 300),
|
|
207
181
|
// swipeHandler: getAttr($this, "swipe-handler", null),
|
|
208
|
-
swiperElementNodeName:
|
|
182
|
+
swiperElementNodeName: parseAttr(
|
|
209
183
|
$this,
|
|
210
184
|
'swiper-element-node-name',
|
|
211
185
|
'SWIPER-CONTAINER',
|
|
212
186
|
),
|
|
213
|
-
threshold:
|
|
187
|
+
threshold: parseAttr($this, 'threshold', 5),
|
|
214
188
|
// thumbs: null,
|
|
215
|
-
touchAngle:
|
|
216
|
-
touchEventsTarget:
|
|
217
|
-
touchMoveStopPropagation:
|
|
189
|
+
touchAngle: parseAttr($this, 'touch-angle', 45),
|
|
190
|
+
touchEventsTarget: parseAttr($this, 'touch-events-target', 'wrapper'),
|
|
191
|
+
touchMoveStopPropagation: parseAttr(
|
|
218
192
|
$this,
|
|
219
193
|
'touch-move-stop-propagation',
|
|
220
194
|
false,
|
|
221
195
|
),
|
|
222
|
-
touchRatio:
|
|
223
|
-
touchReleaseOnEdges:
|
|
224
|
-
touchStartForcePreventDefault:
|
|
196
|
+
touchRatio: parseAttr($this, 'touch-ratio', 1),
|
|
197
|
+
touchReleaseOnEdges: parseAttr($this, 'touch-release-on-edges', false),
|
|
198
|
+
touchStartForcePreventDefault: parseAttr(
|
|
225
199
|
$this,
|
|
226
200
|
'touch-start-force-prevent-default',
|
|
227
201
|
false,
|
|
228
202
|
),
|
|
229
|
-
touchStartPreventDefault:
|
|
203
|
+
touchStartPreventDefault: parseAttr(
|
|
230
204
|
$this,
|
|
231
205
|
'touch-start-prevent-default',
|
|
232
206
|
true,
|
|
233
207
|
),
|
|
234
|
-
uniqueNavElements:
|
|
235
|
-
updateOnWindowResize:
|
|
236
|
-
$this,
|
|
237
|
-
'update-on-window-resize',
|
|
238
|
-
true,
|
|
239
|
-
),
|
|
208
|
+
uniqueNavElements: parseAttr($this, 'unique-nav-elements', true),
|
|
209
|
+
updateOnWindowResize: parseAttr($this, 'update-on-window-resize', true),
|
|
240
210
|
//url: getAttr($this, "url", "null"),
|
|
241
211
|
//userAgent: getAttr($this, "user-agent", "null"),
|
|
242
212
|
//virtual: null,
|
|
243
|
-
virtualTranslate:
|
|
244
|
-
watchOverflow:
|
|
245
|
-
watchSlidesProgress:
|
|
246
|
-
width:
|
|
247
|
-
wrapperClass:
|
|
213
|
+
virtualTranslate: parseAttr($this, 'virtual-translate', false),
|
|
214
|
+
watchOverflow: parseAttr($this, 'watch-overflow', true),
|
|
215
|
+
watchSlidesProgress: parseAttr($this, 'watch-slides-progress', false),
|
|
216
|
+
width: parseAttr($this, 'width', null),
|
|
217
|
+
wrapperClass: parseAttr($this, 'wrapper-class', 'swiper-wrapper'),
|
|
248
218
|
//zoom: null,
|
|
249
219
|
};
|
|
250
220
|
|
|
251
221
|
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
252
222
|
// --- AUTOPLAY --------------------------------
|
|
253
223
|
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
254
|
-
const autoplayMode =
|
|
224
|
+
const autoplayMode = parseAttr($this, 'autoplay-mode', false);
|
|
255
225
|
printDebug(debug, 'AUTOPLAY MODE', autoplayMode);
|
|
256
226
|
|
|
257
227
|
if (autoplayMode) {
|
|
258
228
|
swiperConfig.autoplay = {
|
|
259
|
-
delay:
|
|
260
|
-
disableOnInteraction:
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
), // documentation says default is true, doesn't appear to be correct
|
|
265
|
-
reverseDirection: getBooleanAttr($this, 'reverse-direction', false),
|
|
266
|
-
pauseOnMouseEnter: getBooleanAttr($this, 'pause-on-mouse-enter', false),
|
|
267
|
-
stopOnLastSlide: getBooleanAttr($this, 'stop-on-last-slide', false),
|
|
229
|
+
delay: parseAttr($this, 'delay', 0),
|
|
230
|
+
disableOnInteraction: parseAttr($this, 'disable-on-interaction', false), // documentation says default is true, doesn't appear to be correct
|
|
231
|
+
reverseDirection: parseAttr($this, 'reverse-direction', false),
|
|
232
|
+
pauseOnMouseEnter: parseAttr($this, 'pause-on-mouse-enter', false),
|
|
233
|
+
stopOnLastSlide: parseAttr($this, 'stop-on-last-slide', false),
|
|
268
234
|
};
|
|
269
235
|
// Add CSS for Smooth Autoplay
|
|
270
236
|
$("[smooth-autoplay='true']")
|
|
@@ -276,33 +242,29 @@ $('[waterfall]').each(function (index) {
|
|
|
276
242
|
// --- NAVIGATION -----------------------------
|
|
277
243
|
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
278
244
|
swiperConfig.navigation = {
|
|
279
|
-
disabledClass:
|
|
245
|
+
disabledClass: parseAttr(
|
|
280
246
|
$this,
|
|
281
247
|
'nav-disabled-class',
|
|
282
248
|
'swiper-button-disabled',
|
|
283
249
|
),
|
|
284
|
-
enabled:
|
|
285
|
-
hiddenClass:
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
),
|
|
290
|
-
hideOnClick: getBooleanAttr($this, 'nav-hide-on-click', false),
|
|
291
|
-
lockClass: getStringAttr($this, 'nav-lock-class', 'swiper-button-lock'),
|
|
292
|
-
navigationDisabledClass: getStringAttr(
|
|
250
|
+
enabled: parseAttr($this, 'nav-enabled', null),
|
|
251
|
+
hiddenClass: parseAttr($this, 'nav-hidden-class', 'swiper-button-hidden'),
|
|
252
|
+
hideOnClick: parseAttr($this, 'nav-hide-on-click', false),
|
|
253
|
+
lockClass: parseAttr($this, 'nav-lock-class', 'swiper-button-lock'),
|
|
254
|
+
navigationDisabledClass: parseAttr(
|
|
293
255
|
$this,
|
|
294
256
|
'nav-disabled-class',
|
|
295
257
|
'swiper-navigation-disabled',
|
|
296
258
|
),
|
|
297
|
-
nextEl:
|
|
298
|
-
prevEl:
|
|
259
|
+
nextEl: "[waterfall-el='next']",
|
|
260
|
+
prevEl: "[waterfall-el='prev']",
|
|
299
261
|
};
|
|
300
262
|
|
|
301
263
|
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
302
264
|
// --- PAGINATION -----------------------------
|
|
303
265
|
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
304
266
|
|
|
305
|
-
let paginationType =
|
|
267
|
+
let paginationType = parseAttr($this, 'pagination-type', '');
|
|
306
268
|
let $paginationBullet = $this.find("[waterfall-el='pagination-bullet']");
|
|
307
269
|
let paginationBulletActive = $this.find(
|
|
308
270
|
"[waterfall-el='pagination-bullet-active']",
|
|
@@ -347,59 +309,59 @@ $('[waterfall]').each(function (index) {
|
|
|
347
309
|
),
|
|
348
310
|
bulletClass: $paginationBullet.attr('class'),
|
|
349
311
|
bulletElement: $paginationBullet.prop('tagName')?.toLowerCase() || 'span', //ISSUE HERE
|
|
350
|
-
clickable:
|
|
351
|
-
clickableClass:
|
|
312
|
+
clickable: parseAttr($this, 'pagination-clickable', true),
|
|
313
|
+
clickableClass: parseAttr(
|
|
352
314
|
$this,
|
|
353
315
|
'pagination-clickable-class',
|
|
354
316
|
'swiper-pagination-clickable',
|
|
355
317
|
),
|
|
356
|
-
currentClass:
|
|
318
|
+
currentClass: parseAttr(
|
|
357
319
|
$this,
|
|
358
320
|
'pagination-current-class',
|
|
359
321
|
'swiper-pagination-current',
|
|
360
322
|
),
|
|
361
|
-
dynamicBullets:
|
|
323
|
+
dynamicBullets: parseAttr(
|
|
362
324
|
$this,
|
|
363
325
|
'dynamic-bullets',
|
|
364
326
|
'swiper-pagination-current',
|
|
365
327
|
),
|
|
366
|
-
dynamicMainBullets:
|
|
328
|
+
dynamicMainBullets: parseAttr($this, 'dynamic-main-bullets', 1),
|
|
367
329
|
el: $this.find("[waterfall-el='pagination']")[0],
|
|
368
|
-
enabled:
|
|
330
|
+
enabled: parseAttr($this, 'pagination-enabled', null),
|
|
369
331
|
//formatFractionCurrent: null,
|
|
370
332
|
//formatFractionTotal: null,
|
|
371
|
-
hiddenClass:
|
|
333
|
+
hiddenClass: parseAttr(
|
|
372
334
|
$this,
|
|
373
335
|
'pagination-hidden-class',
|
|
374
336
|
'swiper-pagination-hidden',
|
|
375
337
|
),
|
|
376
|
-
hideOnClick:
|
|
377
|
-
horizontalClass:
|
|
338
|
+
hideOnClick: parseAttr($this, 'pagination-hide-on-click', true),
|
|
339
|
+
horizontalClass: parseAttr(
|
|
378
340
|
$this,
|
|
379
341
|
'pagination-horizontal-class',
|
|
380
342
|
'swiper-pagination-horizontal',
|
|
381
343
|
),
|
|
382
|
-
lockClass:
|
|
344
|
+
lockClass: parseAttr(
|
|
383
345
|
$this,
|
|
384
346
|
'pagination-lock-class',
|
|
385
347
|
'swiper-pagination-lock',
|
|
386
348
|
),
|
|
387
|
-
modifierClass:
|
|
349
|
+
modifierClass: parseAttr(
|
|
388
350
|
$this,
|
|
389
351
|
'pagination-modifier-class',
|
|
390
352
|
'swiper-pagination-',
|
|
391
353
|
),
|
|
392
|
-
paginationDisabledClass:
|
|
354
|
+
paginationDisabledClass: parseAttr(
|
|
393
355
|
$this,
|
|
394
356
|
'pagination-disabled-class',
|
|
395
357
|
'swiper-pagination-disabled',
|
|
396
358
|
),
|
|
397
|
-
progressbarFillClass:
|
|
359
|
+
progressbarFillClass: parseAttr(
|
|
398
360
|
$this,
|
|
399
361
|
'pagination-progressbar-fill-class',
|
|
400
362
|
'swiper-pagination-progressbar-fill',
|
|
401
363
|
),
|
|
402
|
-
progressbarOpposite:
|
|
364
|
+
progressbarOpposite: parseAttr(
|
|
403
365
|
$this,
|
|
404
366
|
'pagination-progressbar-opposite',
|
|
405
367
|
'swiper-pagination-progressbar-opposite',
|
|
@@ -408,13 +370,13 @@ $('[waterfall]').each(function (index) {
|
|
|
408
370
|
//renderCustom: null,
|
|
409
371
|
//renderFraction: null,
|
|
410
372
|
//renderProgressBar: null,
|
|
411
|
-
totalClass:
|
|
373
|
+
totalClass: parseAttr(
|
|
412
374
|
$this,
|
|
413
375
|
'pagination-total-class',
|
|
414
376
|
'swiper-pagination-total',
|
|
415
377
|
),
|
|
416
378
|
type: getPaginationType(),
|
|
417
|
-
verticalClass:
|
|
379
|
+
verticalClass: parseAttr(
|
|
418
380
|
$this,
|
|
419
381
|
'pagination-vertical-class',
|
|
420
382
|
'swiper-pagination-vertical',
|
|
@@ -435,28 +397,28 @@ $('[waterfall]').each(function (index) {
|
|
|
435
397
|
if ($scrollbar) {
|
|
436
398
|
swiperConfig.scrollbar = {
|
|
437
399
|
dragClass: $scrollbarDrag.attr('class'),
|
|
438
|
-
dragSize:
|
|
439
|
-
draggable:
|
|
400
|
+
dragSize: parseAttr($this, 'scrollbar-drag-size', 'auto'),
|
|
401
|
+
draggable: parseAttr($this, 'scrollbar-draggable', false),
|
|
440
402
|
el: $scrollbar[0],
|
|
441
|
-
enabled:
|
|
442
|
-
hide:
|
|
443
|
-
horizontalClass:
|
|
403
|
+
enabled: parseAttr($this, 'scrollbar-enabled', null),
|
|
404
|
+
hide: parseAttr($this, 'scrollbar-hide', true),
|
|
405
|
+
horizontalClass: parseAttr(
|
|
444
406
|
$this,
|
|
445
407
|
'scrollbar-horizontal-class',
|
|
446
408
|
'swiper-scrollbar-horizontal',
|
|
447
409
|
),
|
|
448
|
-
lockClass:
|
|
410
|
+
lockClass: parseAttr(
|
|
449
411
|
$this,
|
|
450
412
|
'scrollbar-lock-class',
|
|
451
413
|
'swiper-scrollbar-lock',
|
|
452
414
|
),
|
|
453
|
-
scrollbarDisabledClass:
|
|
415
|
+
scrollbarDisabledClass: parseAttr(
|
|
454
416
|
$this,
|
|
455
417
|
'scrollbar-disabled-class',
|
|
456
418
|
'swiper-scrollbar-disabled',
|
|
457
419
|
),
|
|
458
|
-
snapOnRelease:
|
|
459
|
-
verticalClass:
|
|
420
|
+
snapOnRelease: parseAttr($this, 'snap-on-release', true), // documentation says default is false, but is lying lmao
|
|
421
|
+
verticalClass: parseAttr(
|
|
460
422
|
$this,
|
|
461
423
|
'scrollbar-vertical-class',
|
|
462
424
|
'swiper-scrollbar-vertical',
|
|
@@ -469,22 +431,18 @@ $('[waterfall]').each(function (index) {
|
|
|
469
431
|
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
470
432
|
|
|
471
433
|
swiperConfig.freeMode = {
|
|
472
|
-
enabled:
|
|
473
|
-
minimumVelocity:
|
|
474
|
-
momentum:
|
|
475
|
-
momentumBounce:
|
|
476
|
-
momentumBounceRatio:
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
1,
|
|
480
|
-
),
|
|
481
|
-
momentumRatio: getNumberAttr($this, 'free-mode-momentum-ratio', 1),
|
|
482
|
-
momentumVelocityRatio: getNumberAttr(
|
|
434
|
+
enabled: parseAttr($this, 'free-mode-enabled', false),
|
|
435
|
+
minimumVelocity: parseAttr($this, 'free-mode-minimum-velocity', 0.02),
|
|
436
|
+
momentum: parseAttr($this, 'free-mode-momentum', true),
|
|
437
|
+
momentumBounce: parseAttr($this, 'free-mode-momentum-bounce', true),
|
|
438
|
+
momentumBounceRatio: parseAttr($this, 'free-mode-momentum-bounce-ratio', 1),
|
|
439
|
+
momentumRatio: parseAttr($this, 'free-mode-momentum-ratio', 1),
|
|
440
|
+
momentumVelocityRatio: parseAttr(
|
|
483
441
|
$this,
|
|
484
442
|
'free-mode-momentum-velocity-ratio',
|
|
485
443
|
1,
|
|
486
444
|
),
|
|
487
|
-
sticky:
|
|
445
|
+
sticky: parseAttr($this, 'free-mode-sticky', false),
|
|
488
446
|
};
|
|
489
447
|
|
|
490
448
|
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
@@ -492,8 +450,8 @@ $('[waterfall]').each(function (index) {
|
|
|
492
450
|
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
493
451
|
|
|
494
452
|
swiperConfig.grid = {
|
|
495
|
-
fill:
|
|
496
|
-
rows:
|
|
453
|
+
fill: parseAttr($this, 'grid-fill', 'column'),
|
|
454
|
+
rows: parseAttr($this, 'grid-rows', 1),
|
|
497
455
|
};
|
|
498
456
|
|
|
499
457
|
// --- CLEANUP AND EXPORT ---
|