well-waterfall 0.1.39 → 0.1.41

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 CHANGED
@@ -140,13 +140,33 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
140
140
 
141
141
  /***/ }),
142
142
 
143
+ /***/ "./src/modules/breakpoints.ts":
144
+ /*!************************************!*\
145
+ !*** ./src/modules/breakpoints.ts ***!
146
+ \************************************/
147
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
148
+
149
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ breakpointsConfig: () => (/* binding */ breakpointsConfig)\n/* harmony export */ });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./src/util.ts\");\n\nfunction breakpointsConfig($this) {\n return {\n 478: {\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'lmobile-centered-slides', null),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'lmobile-slides-per-view', null),\n slidesPerGroup: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'lmobile-slides-per-group', null),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'lmobile-space-between', null),\n },\n 767: {\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'tablet-centered-slides', null),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'tablet-slides-per-view', null),\n slidesPerGroup: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'tablet-slides-per-group', null),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'tablet-space-between', null),\n },\n 991: {\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'desktop-centered-slides', null),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'desktop-slides-per-view', null),\n slidesPerGroup: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'desktop-slides-per-group', null),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'desktop-space-between', null),\n },\n 1280: {\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'large-centered-slides', null),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'large-slides-per-view', null),\n slidesPerGroup: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'large-slides-per-group', null),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'large-space-between', null),\n },\n 1440: {\n centeredSlides: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'xlarge-centered-slides', null),\n slidesPerView: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'xlarge-slides-per-view', null),\n slidesPerGroup: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'xlarge-slides-per-group', null),\n spaceBetween: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'xlarge-space-between', null),\n },\n };\n}\n\n\n//# sourceURL=webpack://Waterfall/./src/modules/breakpoints.ts?");
150
+
151
+ /***/ }),
152
+
143
153
  /***/ "./src/modules/navigation.ts":
144
154
  /*!***********************************!*\
145
155
  !*** ./src/modules/navigation.ts ***!
146
156
  \***********************************/
147
157
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
148
158
 
149
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ navigationConfig: () => (/* binding */ navigationConfig)\n/* harmony export */ });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./src/util.ts\");\n\nfunction navigationConfig($this) {\n return {\n disabledClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'nav-disabled-class', 'swiper-button-disabled'),\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'nav-enabled', null),\n hiddenClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'nav-hidden-class', 'swiper-button-hidden'),\n hideOnClick: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'nav-hide-on-click', false),\n lockClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'nav-lock-class', 'swiper-button-lock'),\n navigationDisabledClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'nav-disabled-class', 'swiper-navigation-disabled'),\n nextEl: `[waterfall='${name}'] [waterfall-el='next']`,\n prevEl: `[waterfall='${name}'] [waterfall-el='prev']`,\n };\n}\n\n\n//# sourceURL=webpack://Waterfall/./src/modules/navigation.ts?");
159
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ navigationConfig: () => (/* binding */ navigationConfig)\n/* harmony export */ });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./src/util.ts\");\n\nfunction navigationConfig($this, name) {\n return {\n disabledClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'nav-disabled-class', 'swiper-button-disabled'),\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'nav-enabled', null),\n hiddenClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'nav-hidden-class', 'swiper-button-hidden'),\n hideOnClick: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'nav-hide-on-click', false),\n lockClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'nav-lock-class', 'swiper-button-lock'),\n navigationDisabledClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'nav-disabled-class', 'swiper-navigation-disabled'),\n nextEl: `[waterfall='${name}'] [waterfall-el='next']`,\n prevEl: `[waterfall='${name}'] [waterfall-el='prev']`,\n };\n}\n\n\n//# sourceURL=webpack://Waterfall/./src/modules/navigation.ts?");
160
+
161
+ /***/ }),
162
+
163
+ /***/ "./src/modules/pagination.ts":
164
+ /*!***********************************!*\
165
+ !*** ./src/modules/pagination.ts ***!
166
+ \***********************************/
167
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
168
+
169
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ paginationConfig: () => (/* binding */ paginationConfig)\n/* harmony export */ });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./src/util.ts\");\n\nfunction paginationConfig($this) {\n var _a;\n let paginationType = (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'pagination-type', '');\n let $paginationBullet = $this.find(\"[waterfall-el='pagination-bullet']\");\n let paginationBulletActive = $this.find(\"[waterfall-el='pagination-bullet-active']\");\n return {\n bulletActiveClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.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_0__.parseAttr)($this, 'pagination-clickable', false),\n clickableClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'pagination-clickable-class', 'swiper-pagination-clickable'),\n currentClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'pagination-current-class', 'swiper-pagination-current'),\n dynamicBullets: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'dynamic-bullets', 'swiper-pagination-current'),\n dynamicMainBullets: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'dynamic-main-bullets', 1),\n el: $this.find(\"[waterfall-el='pagination']\")[0],\n enabled: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'pagination-enabled', null),\n //formatFractionCurrent: null,\n //formatFractionTotal: null,\n hiddenClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'pagination-hidden-class', 'swiper-pagination-hidden'),\n hideOnClick: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'pagination-hide-on-click', true),\n horizontalClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'pagination-horizontal-class', 'swiper-pagination-horizontal'),\n lockClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'pagination-lock-class', 'swiper-pagination-lock'),\n modifierClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'pagination-modifier-class', 'swiper-pagination-'),\n paginationDisabledClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'pagination-disabled-class', 'swiper-pagination-disabled'),\n progressbarFillClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'pagination-progressbar-fill-class', 'swiper-pagination-progressbar-fill'),\n progressbarOpposite: (0,_util__WEBPACK_IMPORTED_MODULE_0__.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_0__.parseAttr)($this, 'pagination-total-class', 'swiper-pagination-total'),\n type: getPaginationType(),\n verticalClass: (0,_util__WEBPACK_IMPORTED_MODULE_0__.parseAttr)($this, 'pagination-vertical-class', 'swiper-pagination-vertical'),\n };\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}\n\n\n//# sourceURL=webpack://Waterfall/./src/modules/pagination.ts?");
150
170
 
151
171
  /***/ }),
152
172
 
@@ -156,7 +176,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
156
176
  \*********************/
157
177
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
158
178
 
159
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\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}\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?");
179
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getUniqueClasses: () => (/* binding */ getUniqueClasses),\n/* harmony export */ parseAttr: () => (/* binding */ parseAttr),\n/* harmony export */ parseString: () => (/* binding */ parseString),\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}\nfunction parseString(el, attrName, defaultValue) {\n var _a;\n const attrValue = (_a = $(el).attr(attrName)) === null || _a === void 0 ? void 0 : _a.trim();\n if (!attrValue)\n return null;\n // Nullify the attribute if it matches the default value from SwiperJS\n if (attrValue === defaultValue)\n return null;\n return attrValue;\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?");
160
180
 
161
181
  /***/ }),
162
182
 
@@ -166,7 +186,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
166
186
  \**************************/
167
187
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
168
188
 
169
- 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/* harmony import */ var _modules_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modules/navigation */ \"./src/modules/navigation.ts\");\n/* harmony import */ var _modules_autoplay__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modules/autoplay */ \"./src/modules/autoplay.ts\");\n\n\n\n\n\nconsole.log(`🚿 Hello from Wellflow Waterfall v${\"0.1.39\"}`);\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(`Initializing Waterfall: ${name} ${debug ? '[DEBUG 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 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 // --- BREAKPOINTS ----------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n swiperConfig.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 const autoplayMode = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'autoplay-mode', false);\n if (autoplayMode)\n swiperConfig.autoplay = (0,_modules_autoplay__WEBPACK_IMPORTED_MODULE_4__.autoplayConfig)($this);\n swiperConfig.navigation = (0,_modules_navigation__WEBPACK_IMPORTED_MODULE_3__.navigationConfig)($this);\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 // 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', false),\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 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 const config = (0,_util__WEBPACK_IMPORTED_MODULE_2__.removeNullKeys)(swiperConfig);\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'CONFIG', 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// --- SLIDE COUNT ----------------------------\n// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\ndocument.querySelectorAll('.swiper-wrapper').forEach((swiperWrapper) => {\n swiperWrapper.querySelectorAll('.swiper-slide').forEach((slide, index) => {\n const countEl = slide.querySelector('[waterfall-el=\"slide-count\"]');\n if (countEl) {\n countEl.textContent = (index + 1).toString();\n }\n });\n});\n\n\n//# sourceURL=webpack://Waterfall/./src/waterfall.ts?");
189
+ 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/* harmony import */ var _modules_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modules/navigation */ \"./src/modules/navigation.ts\");\n/* harmony import */ var _modules_autoplay__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modules/autoplay */ \"./src/modules/autoplay.ts\");\n/* harmony import */ var _modules_breakpoints__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modules/breakpoints */ \"./src/modules/breakpoints.ts\");\n/* harmony import */ var _modules_pagination__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modules/pagination */ \"./src/modules/pagination.ts\");\n\n\n\n\n\n\n\nconsole.log(`🚿 Hello from Wellflow Waterfall v${\"0.1.41\"}`);\nconst sliders = [];\n$('[waterfall]').each(function (index) {\n const $this = $(this);\n const name = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseString)($this, 'waterfall', `Swiper ${index}`);\n if (!name)\n return;\n const debug = Boolean((0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'debug-mode', false) || false);\n console.log(`Initializing Waterfall: ${name} ${debug ? '[DEBUG 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 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 // BREAKPOINTS\n swiperConfig.breakpoints = (0,_modules_breakpoints__WEBPACK_IMPORTED_MODULE_5__.breakpointsConfig)($this);\n // AUTOPLAY\n const autoplayMode = (0,_util__WEBPACK_IMPORTED_MODULE_2__.parseAttr)($this, 'autoplay-mode', false);\n if (autoplayMode)\n swiperConfig.autoplay = (0,_modules_autoplay__WEBPACK_IMPORTED_MODULE_4__.autoplayConfig)($this);\n // NAVIGATION\n swiperConfig.navigation = (0,_modules_navigation__WEBPACK_IMPORTED_MODULE_3__.navigationConfig)($this, name);\n // PAGINATION\n let pagination = $this.find(\"[waterfall-el='pagination-bullet']\").length;\n if (pagination)\n swiperConfig.pagination = (0,_modules_pagination__WEBPACK_IMPORTED_MODULE_6__.paginationConfig)($this);\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n // --- SCROLLBAR ------------------------------\n // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\n const $scrollbar = $this.find(\"[waterfall-el='scrollbar']\");\n const $scrollbarDrag = $($scrollbar).find(\"[waterfall-el='scrollbar-drag']\");\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 const config = (0,_util__WEBPACK_IMPORTED_MODULE_2__.removeNullKeys)(swiperConfig);\n (0,_util__WEBPACK_IMPORTED_MODULE_2__.printDebug)(debug, 'CONFIG', 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// --- SLIDE COUNT ----------------------------\n// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\ndocument.querySelectorAll('.swiper-wrapper').forEach((swiperWrapper) => {\n swiperWrapper.querySelectorAll('.swiper-slide').forEach((slide, index) => {\n const countEl = slide.querySelector('[waterfall-el=\"slide-count\"]');\n if (countEl) {\n countEl.textContent = (index + 1).toString();\n }\n });\n});\n\n\n//# sourceURL=webpack://Waterfall/./src/waterfall.ts?");
170
190
 
171
191
  /***/ }),
172
192
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "well-waterfall",
3
- "version": "0.1.39",
3
+ "version": "0.1.41",
4
4
  "description": "An attribute-based wrapper of SwiperJS for Webflow",
5
5
  "main": "waterfall.js",
6
6
  "scripts": {
@@ -0,0 +1,36 @@
1
+ import { parseAttr } from '../util';
2
+
3
+ export function breakpointsConfig($this: JQuery<HTMLElement>) {
4
+ return {
5
+ 478: {
6
+ centeredSlides: parseAttr($this, 'lmobile-centered-slides', null),
7
+ slidesPerView: parseAttr($this, 'lmobile-slides-per-view', null),
8
+ slidesPerGroup: parseAttr($this, 'lmobile-slides-per-group', null),
9
+ spaceBetween: parseAttr($this, 'lmobile-space-between', null),
10
+ },
11
+ 767: {
12
+ centeredSlides: parseAttr($this, 'tablet-centered-slides', null),
13
+ slidesPerView: parseAttr($this, 'tablet-slides-per-view', null),
14
+ slidesPerGroup: parseAttr($this, 'tablet-slides-per-group', null),
15
+ spaceBetween: parseAttr($this, 'tablet-space-between', null),
16
+ },
17
+ 991: {
18
+ centeredSlides: parseAttr($this, 'desktop-centered-slides', null),
19
+ slidesPerView: parseAttr($this, 'desktop-slides-per-view', null),
20
+ slidesPerGroup: parseAttr($this, 'desktop-slides-per-group', null),
21
+ spaceBetween: parseAttr($this, 'desktop-space-between', null),
22
+ },
23
+ 1280: {
24
+ centeredSlides: parseAttr($this, 'large-centered-slides', null),
25
+ slidesPerView: parseAttr($this, 'large-slides-per-view', null),
26
+ slidesPerGroup: parseAttr($this, 'large-slides-per-group', null),
27
+ spaceBetween: parseAttr($this, 'large-space-between', null),
28
+ },
29
+ 1440: {
30
+ centeredSlides: parseAttr($this, 'xlarge-centered-slides', null),
31
+ slidesPerView: parseAttr($this, 'xlarge-slides-per-view', null),
32
+ slidesPerGroup: parseAttr($this, 'xlarge-slides-per-group', null),
33
+ spaceBetween: parseAttr($this, 'xlarge-space-between', null),
34
+ },
35
+ };
36
+ }
@@ -1,6 +1,6 @@
1
1
  import { parseAttr } from '../util';
2
2
 
3
- export function navigationConfig($this: JQuery<HTMLElement>) {
3
+ export function navigationConfig($this: JQuery<HTMLElement>, name: string) {
4
4
  return {
5
5
  disabledClass: parseAttr(
6
6
  $this,
@@ -0,0 +1,119 @@
1
+ import { getUniqueClasses, parseAttr } from '../util';
2
+
3
+ export function paginationConfig($this: JQuery<HTMLElement>) {
4
+ let paginationType = parseAttr($this, 'pagination-type', '');
5
+
6
+ let $paginationBullet = $this.find("[waterfall-el='pagination-bullet']");
7
+ let paginationBulletActive = $this.find(
8
+ "[waterfall-el='pagination-bullet-active']",
9
+ );
10
+
11
+ return {
12
+ bulletActiveClass: getUniqueClasses(
13
+ paginationBulletActive,
14
+ $paginationBullet,
15
+ ),
16
+ bulletClass: $paginationBullet.attr('class'),
17
+ bulletElement: $paginationBullet.prop('tagName')?.toLowerCase() || 'span', //ISSUE HERE
18
+ clickable: parseAttr($this, 'pagination-clickable', false),
19
+ clickableClass: parseAttr(
20
+ $this,
21
+ 'pagination-clickable-class',
22
+ 'swiper-pagination-clickable',
23
+ ),
24
+ currentClass: parseAttr(
25
+ $this,
26
+ 'pagination-current-class',
27
+ 'swiper-pagination-current',
28
+ ),
29
+ dynamicBullets: parseAttr(
30
+ $this,
31
+ 'dynamic-bullets',
32
+ 'swiper-pagination-current',
33
+ ),
34
+ dynamicMainBullets: parseAttr($this, 'dynamic-main-bullets', 1),
35
+ el: $this.find("[waterfall-el='pagination']")[0],
36
+ enabled: parseAttr($this, 'pagination-enabled', null),
37
+ //formatFractionCurrent: null,
38
+ //formatFractionTotal: null,
39
+ hiddenClass: parseAttr(
40
+ $this,
41
+ 'pagination-hidden-class',
42
+ 'swiper-pagination-hidden',
43
+ ),
44
+ hideOnClick: parseAttr($this, 'pagination-hide-on-click', true),
45
+ horizontalClass: parseAttr(
46
+ $this,
47
+ 'pagination-horizontal-class',
48
+ 'swiper-pagination-horizontal',
49
+ ),
50
+ lockClass: parseAttr(
51
+ $this,
52
+ 'pagination-lock-class',
53
+ 'swiper-pagination-lock',
54
+ ),
55
+ modifierClass: parseAttr(
56
+ $this,
57
+ 'pagination-modifier-class',
58
+ 'swiper-pagination-',
59
+ ),
60
+ paginationDisabledClass: parseAttr(
61
+ $this,
62
+ 'pagination-disabled-class',
63
+ 'swiper-pagination-disabled',
64
+ ),
65
+ progressbarFillClass: parseAttr(
66
+ $this,
67
+ 'pagination-progressbar-fill-class',
68
+ 'swiper-pagination-progressbar-fill',
69
+ ),
70
+ progressbarOpposite: parseAttr(
71
+ $this,
72
+ 'pagination-progressbar-opposite',
73
+ 'swiper-pagination-progressbar-opposite',
74
+ ),
75
+ renderBullet: customRenderBullet(),
76
+ //renderCustom: null,
77
+ //renderFraction: null,
78
+ //renderProgressBar: null,
79
+ totalClass: parseAttr(
80
+ $this,
81
+ 'pagination-total-class',
82
+ 'swiper-pagination-total',
83
+ ),
84
+ type: getPaginationType(),
85
+ verticalClass: parseAttr(
86
+ $this,
87
+ 'pagination-vertical-class',
88
+ 'swiper-pagination-vertical',
89
+ ),
90
+ };
91
+
92
+ // Custom pagination type rendering functions
93
+ function customRenderBullet() {
94
+ let renderBullet: RenderBulletFunction | null = null;
95
+ if (paginationType === 'numberBullets') {
96
+ renderBullet = function (index, className) {
97
+ return `<span class="${className}">${index + 1}</span>`;
98
+ };
99
+ }
100
+ if (paginationType === 'bullets') {
101
+ renderBullet = function (index, className) {
102
+ return `<span class="${className}"></span>`;
103
+ };
104
+ }
105
+ return renderBullet;
106
+ }
107
+
108
+ // Custom function to get extended pagination types
109
+ function getPaginationType() {
110
+ if (paginationType === 'numberBullets' || paginationType === 'bullets')
111
+ return 'bullets';
112
+ if (paginationType === 'fraction') return 'fraction';
113
+ if (paginationType === 'progressbar') return 'progressbar';
114
+ if (paginationType === 'custom') return 'custom';
115
+ else return 'bullets'; // default
116
+ }
117
+ }
118
+
119
+ type RenderBulletFunction = (index: number, className: string) => string;
package/src/util.ts CHANGED
@@ -19,6 +19,18 @@ export function getUniqueClasses(
19
19
  return filtered.join(' '); // Join the remaining classes into a string
20
20
  }
21
21
 
22
+ export function parseString(
23
+ el: JQuery<HTMLElement>,
24
+ attrName: string,
25
+ defaultValue: string,
26
+ ) {
27
+ const attrValue = $(el).attr(attrName)?.trim();
28
+ if (!attrValue) return null;
29
+ // Nullify the attribute if it matches the default value from SwiperJS
30
+ if (attrValue === defaultValue) return null;
31
+ return attrValue;
32
+ }
33
+
22
34
  export function parseAttr(
23
35
  el: JQuery<HTMLElement>,
24
36
  attrName: string,
package/src/waterfall.ts CHANGED
@@ -1,13 +1,10 @@
1
1
  import Swiper from 'swiper/bundle';
2
2
  import 'swiper/css/bundle';
3
- import {
4
- getUniqueClasses,
5
- parseAttr,
6
- removeNullKeys,
7
- printDebug,
8
- } from './util';
3
+ import { parseAttr, removeNullKeys, printDebug, parseString } from './util';
9
4
  import { navigationConfig } from './modules/navigation';
10
5
  import { autoplayConfig } from './modules/autoplay';
6
+ import { breakpointsConfig } from './modules/breakpoints';
7
+ import { paginationConfig } from './modules/pagination';
11
8
 
12
9
  console.log(`🚿 Hello from Wellflow Waterfall v${APP_VERSION}`);
13
10
 
@@ -16,7 +13,9 @@ const sliders: any[] = [];
16
13
  $('[waterfall]').each(function (index) {
17
14
  const $this = $(this);
18
15
 
19
- const name = parseAttr($this, 'waterfall', `Swiper ${index}`);
16
+ const name = parseString($this, 'waterfall', `Swiper ${index}`);
17
+ if (!name) return;
18
+
20
19
  const debug = Boolean(parseAttr($this, 'debug-mode', false) || false);
21
20
 
22
21
  console.log(`Initializing Waterfall: ${name} ${debug ? '[DEBUG MODE]' : ''}`);
@@ -193,164 +192,19 @@ $('[waterfall]').each(function (index) {
193
192
  //zoom: null,
194
193
  };
195
194
 
196
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
197
- // --- BREAKPOINTS ----------------------------
198
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
199
-
200
- swiperConfig.breakpoints = {
201
- 478: {
202
- centeredSlides: parseAttr($this, 'lmobile-centered-slides', null),
203
- slidesPerView: parseAttr($this, 'lmobile-slides-per-view', null),
204
- spaceBetween: parseAttr($this, 'lmobile-space-between', null),
205
- },
206
- 767: {
207
- centeredSlides: parseAttr($this, 'tablet-centered-slides', null),
208
- slidesPerView: parseAttr($this, 'tablet-slides-per-view', null),
209
- spaceBetween: parseAttr($this, 'tablet-space-between', null),
210
- },
211
- 991: {
212
- centeredSlides: parseAttr($this, 'desktop-centered-slides', null),
213
- slidesPerView: parseAttr($this, 'desktop-slides-per-view', null),
214
- spaceBetween: parseAttr($this, 'desktop-space-between', null),
215
- },
216
- 1280: {
217
- centeredSlides: parseAttr($this, 'large-centered-slides', null),
218
- slidesPerView: parseAttr($this, 'large-slides-per-view', null),
219
- spaceBetween: parseAttr($this, 'large-space-between', null),
220
- },
221
- 1440: {
222
- centeredSlides: parseAttr($this, 'xlarge-centered-slides', null),
223
- slidesPerView: parseAttr($this, 'xlarge-slides-per-view', null),
224
- spaceBetween: parseAttr($this, 'xlarge-space-between', null),
225
- },
226
- };
195
+ // BREAKPOINTS
196
+ swiperConfig.breakpoints = breakpointsConfig($this);
227
197
 
198
+ // AUTOPLAY
228
199
  const autoplayMode = parseAttr($this, 'autoplay-mode', false);
229
200
  if (autoplayMode) swiperConfig.autoplay = autoplayConfig($this);
230
201
 
231
- swiperConfig.navigation = navigationConfig($this);
232
-
233
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
234
- // --- PAGINATION -----------------------------
235
- // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
236
-
237
- let paginationType = parseAttr($this, 'pagination-type', '');
238
- let $paginationBullet = $this.find("[waterfall-el='pagination-bullet']");
239
- let paginationBulletActive = $this.find(
240
- "[waterfall-el='pagination-bullet-active']",
241
- );
242
- let pagination = $paginationBullet.length ? true : false;
243
-
244
- type RenderBulletFunction = (index: number, className: string) => string;
202
+ // NAVIGATION
203
+ swiperConfig.navigation = navigationConfig($this, name);
245
204
 
246
- // Custom pagination type rendering functions
247
- function customRenderBullet() {
248
- let renderBullet: RenderBulletFunction | null = null;
249
- if (paginationType === 'numberBullets') {
250
- renderBullet = function (index, className) {
251
- return `<span class="${className}">${index + 1}</span>`;
252
- };
253
- }
254
- if (paginationType === 'bullets') {
255
- renderBullet = function (index, className) {
256
- return `<span class="${className}"></span>`;
257
- };
258
- }
259
- return renderBullet;
260
- }
261
-
262
- // Custom function to get extended pagination types
263
- function getPaginationType() {
264
- if (paginationType === 'numberBullets' || paginationType === 'bullets')
265
- return 'bullets';
266
- if (paginationType === 'fraction') return 'fraction';
267
- if (paginationType === 'progressbar') return 'progressbar';
268
- if (paginationType === 'custom') return 'custom';
269
- else return 'bullets'; // default
270
- }
271
-
272
- if (pagination) {
273
- swiperConfig.pagination = {
274
- bulletActiveClass: getUniqueClasses(
275
- paginationBulletActive,
276
- $paginationBullet,
277
- ),
278
- bulletClass: $paginationBullet.attr('class'),
279
- bulletElement: $paginationBullet.prop('tagName')?.toLowerCase() || 'span', //ISSUE HERE
280
- clickable: parseAttr($this, 'pagination-clickable', false),
281
- clickableClass: parseAttr(
282
- $this,
283
- 'pagination-clickable-class',
284
- 'swiper-pagination-clickable',
285
- ),
286
- currentClass: parseAttr(
287
- $this,
288
- 'pagination-current-class',
289
- 'swiper-pagination-current',
290
- ),
291
- dynamicBullets: parseAttr(
292
- $this,
293
- 'dynamic-bullets',
294
- 'swiper-pagination-current',
295
- ),
296
- dynamicMainBullets: parseAttr($this, 'dynamic-main-bullets', 1),
297
- el: $this.find("[waterfall-el='pagination']")[0],
298
- enabled: parseAttr($this, 'pagination-enabled', null),
299
- //formatFractionCurrent: null,
300
- //formatFractionTotal: null,
301
- hiddenClass: parseAttr(
302
- $this,
303
- 'pagination-hidden-class',
304
- 'swiper-pagination-hidden',
305
- ),
306
- hideOnClick: parseAttr($this, 'pagination-hide-on-click', true),
307
- horizontalClass: parseAttr(
308
- $this,
309
- 'pagination-horizontal-class',
310
- 'swiper-pagination-horizontal',
311
- ),
312
- lockClass: parseAttr(
313
- $this,
314
- 'pagination-lock-class',
315
- 'swiper-pagination-lock',
316
- ),
317
- modifierClass: parseAttr(
318
- $this,
319
- 'pagination-modifier-class',
320
- 'swiper-pagination-',
321
- ),
322
- paginationDisabledClass: parseAttr(
323
- $this,
324
- 'pagination-disabled-class',
325
- 'swiper-pagination-disabled',
326
- ),
327
- progressbarFillClass: parseAttr(
328
- $this,
329
- 'pagination-progressbar-fill-class',
330
- 'swiper-pagination-progressbar-fill',
331
- ),
332
- progressbarOpposite: parseAttr(
333
- $this,
334
- 'pagination-progressbar-opposite',
335
- 'swiper-pagination-progressbar-opposite',
336
- ),
337
- renderBullet: customRenderBullet(),
338
- //renderCustom: null,
339
- //renderFraction: null,
340
- //renderProgressBar: null,
341
- totalClass: parseAttr(
342
- $this,
343
- 'pagination-total-class',
344
- 'swiper-pagination-total',
345
- ),
346
- type: getPaginationType(),
347
- verticalClass: parseAttr(
348
- $this,
349
- 'pagination-vertical-class',
350
- 'swiper-pagination-vertical',
351
- ),
352
- };
353
- }
205
+ // PAGINATION
206
+ let pagination = $this.find("[waterfall-el='pagination-bullet']").length;
207
+ if (pagination) swiperConfig.pagination = paginationConfig($this);
354
208
 
355
209
  // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
356
210
  // --- SCROLLBAR ------------------------------