vendor: 4,094 bytes, lines 1-98
1(function webpackUniversalModuleDefinition(root, factory) { 2 if(typeof exports === 'object' && typeof module === 'object') 3 module.exports = factory(require("jquery")); 4 else if(typeof define === 'function' && define.amd) 5 define(["jquery"], factory); 6 else { 7 var a = typeof exports === 'object' ? factory(require("jquery")) : factory(root["jQuery"]); 8 for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; 9 } 10})(window, function(__WEBPACK_EXTERNAL_MODULE_jquery__) { 11return /******/ (function(modules) { // webpackBootstrap 12/******/ // The module cache 13/******/ var installedModules = {}; 14/******/ 15/******/ // The require function 16/******/ function __webpack_require__(moduleId) { 17/******/ 18/******/ // Check if module is in cache 19/******/ if(installedModules[moduleId]) { 20/******/ return installedModules[moduleId].exports; 21/******/ } 22/******/ // Create a new module (and put it into the cache) 23/******/ var module = installedModules[moduleId] = { 24/******/ i: moduleId, 25/******/ l: false, 26/******/ exports: {} 27/******/ }; 28/******/ 29/******/ // Execute the module function 30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 31/******/ 32/******/ // Flag the module as loaded 33/******/ module.l = true; 34/******/ 35/******/ // Return the exports of the module 36/******/ return module.exports; 37/******/ } 38/******/ 39/******/ 40/******/ // expose the modules object (__webpack_modules__) 41/******/ __webpack_require__.m = modules; 42/******/ 43/******/ // expose the module cache 44/******/ __webpack_require__.c = installedModules; 45/******/ 46/******/ // define getter function for harmony exports 47/******/ __webpack_require__.d = function(exports, name, getter) { 48/******/ if(!__webpack_require__.o(exports, name)) { 49/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 50/******/ } 51/******/ }; 52/******/ 53/******/ // define __esModule on exports 54/******/ __webpack_require__.r = function(exports) { 55/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 56/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 57/******/ } 58/******/ Object.defineProperty(exports, '__esModule', { value: true }); 59/******/ }; 60/******/ 61/******/ // create a fake namespace object 62/******/ // mode & 1: value is a module id, require it 63/******/ // mode & 2: merge all properties of value into the ns 64/******/ // mode & 4: return value when already ns object 65/******/ // mode & 8|1: behave like require 66/******/ __webpack_require__.t = function(value, mode) { 67/******/ if(mode & 1) value = __webpack_require__(value); 68/******/ if(mode & 8) return value; 69/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 70/******/ var ns = Object.create(null); 71/******/ __webpack_require__.r(ns); 72/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 73/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 74/******/ return ns; 75/******/ }; 76/******/ 77/******/ // getDefaultExport function for compatibility with non-harmony modules 78/******/ __webpack_require__.n = function(module) { 79/******/ var getter = module && module.__esModule ? 80/******/ function getDefault() { return module['default']; } : 81/******/ function getModuleExports() { return module; }; 82/******/ __webpack_require__.d(getter, 'a', getter); 83/******/ return getter; 84/******/ }; 85/******/ 86/******/ // Object.prototype.hasOwnProperty.call 87/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 88/******/ 89/******/ // __webpack_public_path__ 90/******/ __webpack_require__.p = ""; 91/******/ 92/******/ 93/******/ // Load entry module and return exports 94/******/ return __webpack_require__(__webpack_require__.s = 0); 95/******/ }) 96/************************************************************************/ 97/******/ ({ 98
99/***/ "./js/entries/foundation.js": 100/*!**********************************!*\ 101 !*** ./js/entries/foundation.js ***! 102 \**********************************/ 103/*! exports provided: Foundation, CoreUtils, Box, onImagesLoaded, Keyboard, MediaQuery, Motion, Nest, Timer, Touch, Triggers, Abide, Accordion, AccordionMenu, Drilldown, Dropdown, DropdownMenu, Equalizer, Interchange, Magellan, OffCanvas, Orbit, ResponsiveMenu, ResponsiveToggle, Reveal, Slider, SmoothScroll, Sticky, Tabs, Toggler, Tooltip, ResponsiveAccordionTabs, default */ 104/***/ (function(module, __webpack_exports__, __webpack_require__) { 105 106"use strict"; 107__webpack_require__.r(__webpack_exports__); 108/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 109/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 110/* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../foundation.core */ "./js/foundation.core.js"); 111/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Foundation", function() { return _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"]; }); 112 113/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../foundation.core.utils */ "./js/foundation.core.utils.js"); 114/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "CoreUtils", function() { return _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__; }); 115/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../foundation.util.box */ "./js/foundation.util.box.js"); 116/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Box", function() { return _foundation_util_box__WEBPACK_IMPORTED_MODULE_3__["Bo
116x"]; }); 117 118/* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js"); 119/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onImagesLoaded", function() { return _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"]; }); 120 121/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 122/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Keyboard", function() { return _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_5__["Keyboard"]; }); 123 124/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 125/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MediaQuery", function() { return _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_6__["MediaQuery"]; }); 126 127/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../foundation.util.motion */ "./js/foundation.util.motion.js"); 128/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Motion", function() { return _foundation_util_motion__WEBPACK_IMPORTED_MODULE_7__["Motion"]; }); 129 130/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../foundation.util.nest */ "./js/foundation.util.nest.js"); 131/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Nest", function() { return _foundation_util_nest__WEBPACK_IMPORTED_MODULE_8__["Nest"]; }); 132 133/* harmony import */ var _foundation_util_timer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../foundation.util.timer */ "./js/foundation.util.timer.js"); 134/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return _foundation_util_timer__WEBPACK_IMPORTED_MODULE_9__["Timer"]; }); 135 136/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../foundation.util.touch */ "./js/foundation.util.touch.js"); 137/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Touch", function() { return _foundation_util_touch__WEBPACK_IMPORTED_MODULE_10__["Touch"]; }); 138 139/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../foundation.util.triggers */ "./js/foundation.util.triggers.js"); 140/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Triggers", function() { return _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_11__["Triggers"]; }); 141 142/* harmony import */ var _foundation_abide__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../foundation.abide */ "./js/foundation.abide.js"); 143/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Abide", function() { return _foundation_abide__WEBPACK_IMPORTED_MODULE_12__["Abide"]; }); 144 145/* harmony import */ var _foundation_accordion__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../foundation.accordion */ "./js/foundation.accordion.js"); 146/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return _foundation_accordion__WEBPACK_IMPORTED_MODULE_13__["Accordion"]; }); 147 148/* harmony import */ var _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../foundation.accordionMenu */ "./js/foundation.accordionMenu.js"); 149/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccordionMenu", function() { return _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_14__["AccordionMenu"]; }); 150 151/* harmony import */ var _foundation_drilldown__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../foundation.drilldown */ "./js/foundation.drilldown.js"); 152/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Drilldown", function() { return _foundation_drilldown__WEBPACK_IMPORTED_MODULE_15__["Drilldown"]; }); 153 154/* harmony import */ var _foundation_dropdown__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../foundation.dropdown */ "./js/foundation.dropdown.js"); 155/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return _foundation_dropdown__WEBPACK_IMPORTED_MODULE_16__["Dropdown"]; }); 156 157/* harmony import */ var _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../foundation.dropdownMenu */ "./js/foundation.dropdownMenu.js"); 158/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_17__["DropdownMenu"]; }); 159 160/* harmony import */ var _foundation_equalizer__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../foundation.equalizer */ "./js/foundation.equalizer.js"); 161/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Equalizer", function() { return _foundation_equalizer__WEBPACK_IMPORTED_MODULE_18__["Equalizer"]; }); 162 163/* harmony import */ var _foundation_interchange__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../foundation.interchange */ "./js/foundation.interchange.js"); 164/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Interchange", function() { return _foundation_interchange__WEBPACK_IMPORTED_MODULE_19__["Interchange"]; }); 165 166/* harmony import */ var _foundation_magellan__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../foundation.magellan */ "./js/foundation.magellan.js"); 167/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Magellan", function() { return _foundation_magellan__WEBPACK_IMPORTED_MODULE_20__["Magellan"]; }); 168 169/* harmony import */ var _foundation_offcanvas__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../foundation.offcanvas */ "./js/foundation.offcanvas.js"); 170/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OffCanvas", function() { return _foundation_offcanvas__WEBPACK_IMPORTED_MODULE_21__["OffCanvas"]; }); 171 172/* harmony import */ var _foundation_orbit__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../foundation.orbit */ "./js/foundation.orbit.js"); 173/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Orb
173it", function() { return _foundation_orbit__WEBPACK_IMPORTED_MODULE_22__["Orbit"]; }); 174 175/* harmony import */ var _foundation_responsiveMenu__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../foundation.responsiveMenu */ "./js/foundation.responsiveMenu.js"); 176/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveMenu", function() { return _foundation_responsiveMenu__WEBPACK_IMPORTED_MODULE_23__["ResponsiveMenu"]; }); 177 178/* harmony import */ var _foundation_responsiveToggle__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../foundation.responsiveToggle */ "./js/foundation.responsiveToggle.js"); 179/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveToggle", function() { return _foundation_responsiveToggle__WEBPACK_IMPORTED_MODULE_24__["ResponsiveToggle"]; }); 180 181/* harmony import */ var _foundation_reveal__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../foundation.reveal */ "./js/foundation.reveal.js"); 182/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Reveal", function() { return _foundation_reveal__WEBPACK_IMPORTED_MODULE_25__["Reveal"]; }); 183 184/* harmony import */ var _foundation_slider__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../foundation.slider */ "./js/foundation.slider.js"); 185/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Slider", function() { return _foundation_slider__WEBPACK_IMPORTED_MODULE_26__["Slider"]; }); 186 187/* harmony import */ var _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../foundation.smoothScroll */ "./js/foundation.smoothScroll.js"); 188/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SmoothScroll", function() { return _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_27__["SmoothScroll"]; }); 189 190/* harmony import */ var _foundation_sticky__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../foundation.sticky */ "./js/foundation.sticky.js"); 191/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Sticky", function() { return _foundation_sticky__WEBPACK_IMPORTED_MODULE_28__["Sticky"]; }); 192 193/* harmony import */ var _foundation_tabs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../foundation.tabs */ "./js/foundation.tabs.js"); 194/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tabs", function() { return _foundation_tabs__WEBPACK_IMPORTED_MODULE_29__["Tabs"]; }); 195 196/* harmony import */ var _foundation_toggler__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../foundation.toggler */ "./js/foundation.toggler.js"); 197/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Toggler", function() { return _foundation_toggler__WEBPACK_IMPORTED_MODULE_30__["Toggler"]; }); 198 199/* harmony import */ var _foundation_tooltip__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../foundation.tooltip */ "./js/foundation.tooltip.js"); 200/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return _foundation_tooltip__WEBPACK_IMPORTED_MODULE_31__["Tooltip"]; }); 201 202/* harmony import */ var _foundation_responsiveAccordionTabs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../foundation.responsiveAccordionTabs */ "./js/foundation.responsiveAccordionTabs.js"); 203/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveAccordionTabs", function() { return _foundation_responsiveAccordionTabs__WEBPACK_IMPORTED_MODULE_32__["ResponsiveAccordionTabs"]; }); 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].addToJquery(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); // Add Foundation Utils to Foundation global namespace for backwards 239// compatibility. 240 241_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].rtl = _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"]; 242_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].GetYoDigits = _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"]; 243_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].transitionend = _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["transitionend"]; 244_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].RegExpEscape = _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["RegExpEscape"]; 245_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].onLoad = _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"]; 246_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Box = _foundation_util_box__WEBPACK_IMPORTED_MODULE_3__["Bo
246x"]; 247_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].onImagesLoaded = _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"]; 248_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Keyboard = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_5__["Keyboard"]; 249_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].MediaQuery = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_6__["MediaQuery"]; 250_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Motion = _foundation_util_motion__WEBPACK_IMPORTED_MODULE_7__["Motion"]; 251_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Move = _foundation_util_motion__WEBPACK_IMPORTED_MODULE_7__["Move"]; 252_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Nest = _foundation_util_nest__WEBPACK_IMPORTED_MODULE_8__["Nest"]; 253_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].Timer = _foundation_util_timer__WEBPACK_IMPORTED_MODULE_9__["Timer"]; // Touch and Triggers previously were almost purely sede effect driven, 254// so no need to add it to Foundation, just init them. 255
256_foundation_util_touch__WEBPACK_IMPORTED_MODULE_10__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 257_foundation_util_triggers__WEBPACK_IMPORTED_MODULE_11__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a, _foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"]); 258 259_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_6__["MediaQuery"]._init(); 260 261_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_abide__WEBPACK_IMPORTED_MODULE_12__["Abide"], 'Abide'); 262_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_accordion__WEBPACK_IMPORTED_MODULE_13__["Accordion"], 'Accordion'); 263_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_14__["AccordionMenu"], 'AccordionMenu'); 264_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_drilldown__WEBPACK_IMPORTED_MODULE_15__["Drilldown"], 'Drilldown'); 265_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_dropdown__WEBPACK_IMPORTED_MODULE_16__["Dropdown"], 'Dropdown'); 266_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_17__["DropdownMenu"], 'DropdownMenu'); 267_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_equalizer__WEBPACK_IMPORTED_MODULE_18__["Equalizer"], 'Equalizer'); 268_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_interchange__WEBPACK_IMPORTED_MODULE_19__["Interchange"], 'Interchange'); 269_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_magellan__WEBPACK_IMPORTED_MODULE_20__["Magellan"], 'Magellan'); 270_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_offcanvas__WEBPACK_IMPORTED_MODULE_21__["OffCanvas"], 'OffCanvas'); 271_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_orbit__WEBPACK_IMPORTED_MODULE_22__["Orbit"], 'Orbit'); 272_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_responsiveMenu__WEBPACK_IMPORTED_MODULE_23__["ResponsiveMenu"], 'ResponsiveMenu'); 273_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_responsiveToggle__WEBPACK_IMPORTED_MODULE_24__["ResponsiveToggle"], 'ResponsiveToggle'); 274_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_reveal__WEBPACK_IMPORTED_MODULE_25__["Reveal"], 'Reveal'); 275_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_slider__WEBPACK_IMPORTED_MODULE_26__["Slider"], 'Slider'); 276_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_27__["SmoothScroll"], 'SmoothScroll'); 277_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_sticky__WEBPACK_IMPORTED_MODULE_28__["Sticky"], 'Sticky'); 278_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_tabs__WEBPACK_IMPORTED_MODULE_29__["Tabs"], 'Tabs'); 279_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_toggler__WEBPACK_IMPORTED_MODULE_30__["Toggler"], 'Toggler'); 280_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_tooltip__WEBPACK_IMPORTED_MODULE_31__["Tooltip"], 'Tooltip'); 281_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"].plugin(_foundation_responsiveAccordionTabs__WEBPACK_IMPORTED_MODULE_32__["ResponsiveAccordionTabs"], 'ResponsiveAccordionTabs'); 282 283/* harmony default export */ __webpack_exports__["default"] = (_foundation_core__WEBPACK_IMPORTED_MODULE_1__["Foundation"]); 284 285/***/ }), 286
vendor: 5,345 bytes, lines 287-373
287/***/ "./js/foundation.abide.js": 288/*!********************************!*\ 289 !*** ./js/foundation.abide.js ***! 290 \********************************/ 291/*! exports provided: Abide */ 292/***/ (function(module, __webpack_exports__, __webpack_require__) { 293 294"use strict"; 295__webpack_require__.r(__webpack_exports__); 296/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Abide", function() { return Abide; }); 297/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 298/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 299/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 300/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 301function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 302 303function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 304 305function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 306 307function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 308 309function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 310 311function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 312 313function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 314 315function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 316 317function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 318 319function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 320 321function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 322 323 324 325 326/** 327 * Abide module. 328 * @module foundation.abide 329 */ 330 331var Abide = /*#__PURE__*/function (_Plugin) { 332 _inherits(Abide, _Plugin); 333 334 var _super = _createSuper(Abide); 335 336 function Abide() { 337 _classCallCheck(this, Abide); 338 339 return _super.apply(this, arguments); 340 } 341 342 _createClass(Abide, [{ 343 key: "_setup", 344 value: 345 /** 346 * Creates a new instance of Abide. 347 * @class 348 * @name Abide 349 * @fires Abide#init 350 * @param {Object} element - jQuery object to add the trigger to. 351 * @param {Object} options - Overrides to the default plugin settings. 352 */ 353 function _setup(element) { 354 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 355 this.$element = element; 356 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(true, {}, Abide.defaults, this.$element.data(), options); 357 this.isEnabled = true; 358 this.formnovalidate = null; 359 this.className = 'Abide'; // ie9 back compat 360 361 this._init(); 362 } 363 /** 364 * Initializes the Abide plugin and calls functions to get Abide functioning on load. 365 * @private 366 */ 367 368 }, { 369 key: "_init", 370 value: function _init() { 371 var _this2 = this; 372 373 this.$inputs = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.merge
vendor: 29,426 bytes, lines 373-1219
373( // Consider as input to validate: 374 this.$element.find('input').not('[type="submit"]'), // * all input fields expect submit 375 this.$element.find('textarea, select') // * all textareas and select fields 376 ); 377 this.$submits = this.$element.find('[type="submit"]'); 378 var $globalErrors = this.$element.find('[data-abide-error]'); // Add a11y attributes to all fields 379 380 if (this.options.a11yAttributes) { 381 this.$inputs.each(function (i, input) { 382 return _this2.addA11yAttributes(jquery__WEBPACK_IMPORTED_MODULE_0___default()(input)); 383 }); 384 $globalErrors.each(function (i, error) { 385 return _this2.addGlobalErrorA11yAttributes(jquery__WEBPACK_IMPORTED_MODULE_0___default()(error)); 386 }); 387 } 388 389 this._events(); 390 } 391 /** 392 * Initializes events for Abide. 393 * @private 394 */ 395 396 }, { 397 key: "_events", 398 value: function _events() { 399 var _this3 = this; 400 401 this.$element.off('.abide').on('reset.zf.abide', function () { 402 _this3.resetForm(); 403 }).on('submit.zf.abide', function () { 404 return _this3.validateForm(); 405 }); 406 this.$submits.off('click.zf.abide keydown.zf.abide').on('click.zf.abide keydown.zf.abide', function (e) { 407 if (!e.key || e.key === ' ' || e.key === 'Enter') { 408 e.preventDefault(); 409 _this3.formnovalidate = e.target.getAttribute('formnovalidate') !== null; 410 411 _this3.$element.submit(); 412 } 413 }); 414 415 if (this.options.validateOn === 'fieldChange') { 416 this.$inputs.off('change.zf.abide').on('change.zf.abide', function (e) { 417 _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target)); 418 }); 419 } 420 421 if (this.options.liveValidate) { 422 this.$inputs.off('input.zf.abide').on('input.zf.abide', function (e) { 423 _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target)); 424 }); 425 } 426 427 if (this.options.validateOnBlur) { 428 this.$inputs.off('blur.zf.abide').on('blur.zf.abide', function (e) { 429 _this3.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target)); 430 }); 431 } 432 } 433 /** 434 * Calls necessary functions to update Abide upon DOM change 435 * @private 436 */ 437 438 }, { 439 key: "_reflow", 440 value: function _reflow() { 441 this._init(); 442 } 443 /** 444 * Checks whether the submitted form should be validated or not, consodering formnovalidate and isEnabled 445 * @returns {Boolean} 446 * @private 447 */ 448 449 }, { 450 key: "_validationIsDisabled", 451 value: function _validationIsDisabled() { 452 if (this.isEnabled === false) { 453 // whole validation disabled 454 return true; 455 } else if (typeof this.formnovalidate === 'boolean') { 456 // triggered by $submit 457 return this.formnovalidate; 458 } // triggered by Enter in non-submit input 459 460 461 return this.$submits.length ? this.$submits[0].getAttribute('formnovalidate') !== null : false; 462 } 463 /** 464 * Enables the whole validation 465 */ 466 467 }, { 468 key: "enableValidation", 469 value: function enableValidation() { 470 this.isEnabled = true; 471 } 472 /** 473 * Disables the whole validation 474 */ 475 476 }, { 477 key: "disableValidation", 478 value: function disableValidation() { 479 this.isEnabled = false; 480 } 481 /** 482 * Checks whether or not a form element has the required attribute and if it's checked or not 483 * @param {Object} element - jQuery object to check for required attribute 484 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 485 */ 486 487 }, { 488 key: "requiredCheck", 489 value: function requiredCheck($el) { 490 if (!$el.attr('required')) return true; 491 var isGood = true; 492 493 switch ($el[0].type) { 494 case 'checkbox': 495 isGood = $el[0].checked; 496 break; 497 498 case 'select': 499 case 'select-one': 500 case 'select-multiple': 501 var opt = $el.find('option:selected'); 502 if (!opt.length || !opt.val()) isGood = false; 503 break; 504 505 default: 506 if (!$el.val() || !$el.val().length) isGood = false; 507 } 508 509 return isGood; 510 } 511 /** 512 * Get: 513 * - Based on $el, the first element(s) corresponding to `formErrorSelector` in this order: 514 * 1. The element's direct sibling('s). 515 * 2. The element's parent's children. 516 * - Element(s) with the attribute `[data-form-error-for]` set with the element's id. 517 * 518 * This allows for multiple form errors per input, though if none are found, no form errors will be shown. 519 * 520 * @param {Object} $el - jQuery object to use as reference to find the form error selector. 521 * @param {String[]} [failedValidators] - List of failed validators. 522 * @returns {Object} jQuery object with the selector. 523 */ 524 525 }, { 526 key: "findFormError", 527 value: function findFormError($el, failedValidators) { 528 var _this4 = this; 529 530 var id = $el.length ? $el[0].id : ''; 531 var $error = $el.siblings(this.options.formErrorSelector); 532 533 if (!$error.length) { 534 $error = $el.parent().find(this.options.formErrorSelector); 535 } 536 537 if (id) { 538 $error = $error.add(this.$element.find("[data-form-error-for=\"".concat(id, "\"]"))); 539 } 540 541 if (!!failedValidators) { 542 $error = $error.not('[data-form-error-on]'); 543 failedValidators.forEach(function (v) { 544 $error = $error.add($el.siblings("[data-form-error-on=\"".concat(v, "\"]"))); 545 $error = $error.add(_this4.$element.find("[data-form-error-for=\"".concat(id, "\"][data-form-error-on=\"").concat(v, "\"]"))); 546 }); 547 } 548 549 return $error; 550 } 551 /** 552 * Get the first element in this order: 553 * 2. The <label> with the attribute `[for="someInputId"]` 554 * 3. The `.closest()` <label> 555 * 556 * @param {Object} $el - jQuery object to check for required attribute 557 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 558 */ 559 560 }, { 561 key: "findLabel", 562 value: function findLabel($el) { 563 var id = $el[0].id; 564 var $label = this.$element.find("label[for=\"".concat(id, "\"]")); 565 566 if (!$label.length) { 567 return $el.closest('label'); 568 } 569 570 return $label; 571 } 572 /** 573 * Get the set of labels associated with a set of radio els in this order 574 * 2. The <label> with the attribute `[for="someInputId"]` 575 * 3. The `.closest()` <label> 576 * 577 * @param {Object} $el - jQuery object to check for required attribute 578 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 579 */ 580 581 }, { 582 key: "findRadioLabels", 583 value: function findRadioLabels($els) { 584 var _this5 = this; 585 586 var labels = $els.map(function (i, el) { 587 var id = el.id; 588 589 var $label = _this5.$element.find("label[for=\"".concat(id, "\"]")); 590 591 if (!$label.length) { 592 $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).closest('label'); 593 } 594 595 return $label[0]; 596 }); 597 return jquery__WEBPACK_IMPORTED_MODULE_0___default()(labels); 598 } 599 /** 600 * Get the set of labels associated with a set of checkbox els in this order 601 * 2. The <label> with the attribute `[for="someInputId"]` 602 * 3. The `.closest()` <label> 603 * 604 * @param {Object} $el - jQuery object to check for required attribute 605 * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty 606 */ 607 608 }, { 609 key: "findCheckboxLabels", 610 value: function findCheckboxLabels($els) { 611 var _this6 = this; 612 613 var labels = $els.map(function (i, el) { 614 var id = el.id; 615 616 var $label = _this6.$element.find("label[for=\"".concat(id, "\"]")); 617 618 if (!$label.length) { 619 $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).closest('label'); 620 } 621 622 return $label[0]; 623 }); 624 return jquery__WEBPACK_IMPORTED_MODULE_0___default()(labels); 625 } 626 /** 627 * Adds the CSS error class as specified by the Abide settings to the label, input, and the form 628 * @param {Object} $el - jQuery object to add the class to 629 * @param {String[]} [failedValidators] - List of failed validators. 630 */ 631 632 }, { 633 key: "addErrorClasses", 634 value: function addErrorClasses($el, failedValidators) { 635 var $label = this.findLabel($el); 636 var $formError = this.findFormError($el, failedValidators); 637 638 if ($label.length) { 639 $label.addClass(this.options.labelErrorClass); 640 } 641 642 if ($formError.length) { 643 $formError.addClass(this.options.formErrorClass); 644 } 645 646 $el.addClass(this.options.inputErrorClass).attr({ 647 'data-invalid': '', 648 'aria-invalid': true 649 }); 650 } 651 /** 652 * Adds [for] and [role=alert] attributes to all form error targetting $el, 653 * and [aria-describedby] attribute to $el toward the first form error. 654 * @param {Object} $el - jQuery object 655 */ 656 657 }, { 658 key: "addA11yAttributes", 659 value: function addA11yAttributes($el) { 660 var $errors = this.findFormError($el); 661 var $labels = $errors.filter('label'); 662 var $error = $errors.first(); 663 if (!$errors.length) return; // Set [aria-describedby] on the input toward the first form error if it is not set 664 665 if (typeof $el.attr('aria-describedby') === 'undefined') { 666 // Get the first error ID or create one 667 var errorId = $error.attr('id'); 668 669 if (typeof errorId === 'undefined') { 670 errorId = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'abide-error'); 671 $error.attr('id', errorId); 672 } 673 674 $el.attr('aria-describedby', errorId); 675 } 676 677 if ($labels.filter('[for]').length < $labels.length) { 678 // Get the input ID or create one 679 var elemId = $el.attr('id'); 680 681 if (typeof elemId === 'undefined') { 682 elemId = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'abide-input'); 683 $el.attr('id', elemId); 684 } // For each label targeting $el, set [for] if it is not set. 685 686 687 $labels.each(function (i, label) { 688 var $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(label); 689 if (typeof $label.attr('for') === 'undefined') $label.attr('for', elemId); 690 }); 691 } // For each error targeting $el, set [role=alert] if it is not set. 692 693 694 $errors.each(function (i, label) { 695 var $label = jquery__WEBPACK_IMPORTED_MODULE_0___default()(label); 696 if (typeof $label.attr('role') === 'undefined') $label.attr('role', 'alert'); 697 }).end(); 698 } 699 /** 700 * Adds [aria-live] attribute to the given global form error $el. 701 * @param {Object} $el - jQuery object to add the attribute to 702 */ 703 704 }, { 705 key: "addGlobalErrorA11yAttributes", 706 value: function addGlobalErrorA11yAttributes($el) { 707 if (typeof $el.attr('aria-live') === 'undefined') $el.attr('aria-live', this.options.a11yErrorLevel); 708 } 709 /** 710 * Remove CSS error classes etc from an entire radio button group 711 * @param {String} groupName - A string that specifies the name of a radio button group 712 * 713 */ 714 715 }, { 716 key: "removeRadioErrorClasses", 717 value: function removeRadioErrorClasses(groupName) { 718 var $els = this.$element.find(":radio[name=\"".concat(groupName, "\"]")); 719 var $labels = this.findRadioLabels($els); 720 var $formErrors = this.findFormError($els); 721 722 if ($labels.length) { 723 $labels.removeClass(this.options.labelErrorClass); 724 } 725 726 if ($formErrors.length) { 727 $formErrors.removeClass(this.options.formErrorClass); 728 } 729 730 $els.removeClass(this.options.inputErrorClass).attr({ 731 'data-invalid': null, 732 'aria-invalid': null 733 }); 734 } 735 /** 736 * Remove CSS error classes etc from an entire checkbox group 737 * @param {String} groupName - A string that specifies the name of a checkbox group 738 * 739 */ 740 741 }, { 742 key: "removeCheckboxErrorClasses", 743 value: function removeCheckboxErrorClasses(groupName) { 744 var $els = this.$element.find(":checkbox[name=\"".concat(groupName, "\"]")); 745 var $labels = this.findCheckboxLabels($els); 746 var $formErrors = this.findFormError($els); 747 748 if ($labels.length) { 749 $labels.removeClass(this.options.labelErrorClass); 750 } 751 752 if ($formErrors.length) { 753 $formErrors.removeClass(this.options.formErrorClass); 754 } 755 756 $els.removeClass(this.options.inputErrorClass).attr({ 757 'data-invalid': null, 758 'aria-invalid': null 759 }); 760 } 761 /** 762 * Removes CSS error class as specified by the Abide settings from the label, input, and the form 763 * @param {Object} $el - jQuery object to remove the class from 764 */ 765 766 }, { 767 key: "removeErrorClasses", 768 value: function removeErrorClasses($el) { 769 // radios need to clear all of the els 770 if ($el[0].type === 'radio') { 771 return this.removeRadioErrorClasses($el.attr('name')); 772 } // checkboxes need to clear all of the els 773 else if ($el[0].type === 'checkbox') { 774 return this.removeCheckboxErrorClasses($el.attr('name')); 775 } 776 777 var $label = this.findLabel($el); 778 var $formError = this.findFormError($el); 779 780 if ($label.length) { 781 $label.removeClass(this.options.labelErrorClass); 782 } 783 784 if ($formError.length) { 785 $formError.removeClass(this.options.formErrorClass); 786 } 787 788 $el.removeClass(this.options.inputErrorClass).attr({ 789 'data-invalid': null, 790 'aria-invalid': null 791 }); 792 } 793 /** 794 * Goes through a form to find inputs and proceeds to validate them in ways specific to their type. 795 * Ignores inputs with data-abide-ignore, type="hidden" or disabled attributes set 796 * @fires Abide#invalid 797 * @fires Abide#valid 798 * @param {Object} element - jQuery object to validate, should be an HTML input 799 * @returns {Boolean} goodToGo - If the input is valid or not. 800 */ 801 802 }, { 803 key: "validateInput", 804 value: function validateInput($el) { 805 var _this7 = this; 806 807 var clearRequire = this.requiredCheck($el), 808 validator = $el.attr('data-validator'), 809 failedValidators = [], 810 manageErrorClasses = true; // skip validation if disabled 811 812 if (this._validationIsDisabled()) { 813 return true; 814 } // don't validate ignored inputs or hidden inputs or disabled inputs 815 816 817 if ($el.is('[data-abide-ignore]') || $el.is('[type="hidden"]') || $el.is('[disabled]')) { 818 return true; 819 } 820 821 switch ($el[0].type) { 822 case 'radio': 823 this.validateRadio($el.attr('name')) || failedValidators.push('required'); 824 break; 825 826 case 'checkbox': 827 this.validateCheckbox($el.attr('name')) || failedValidators.push('required'); // validateCheckbox() adds/removes error classes 828 829 manageErrorClasses = false; 830 break; 831 832 case 'select': 833 case 'select-one': 834 case 'select-multiple': 835 clearRequire || failedValidators.push('required'); 836 break; 837 838 default: 839 clearRequire || failedValidators.push('required'); 840 this.validateText($el) || failedValidators.push('pattern'); 841 } 842 843 if (validator) { 844 var required = $el.attr('required') ? true : false; 845 validator.split(' ').forEach(function (v) { 846 _this7.options.validators[v]($el, required, $el.parent()) || failedValidators.push(v); 847 }); 848 } 849 850 if ($el.attr('data-equalto')) { 851 this.options.validators.equalTo($el) || failedValidators.push('equalTo'); 852 } 853 854 var goodToGo = failedValidators.length === 0; 855 var message = (goodToGo ? 'valid' : 'invalid') + '.zf.abide'; 856 857 if (goodToGo) { 858 // Re-validate inputs that depend on this one with equalto 859 var dependentElements = this.$element.find("[data-equalto=\"".concat($el.attr('id'), "\"]")); 860 861 if (dependentElements.length) { 862 var _this = this; 863 864 dependentElements.each(function () { 865 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val()) { 866 _this.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 867 } 868 }); 869 } 870 } 871 872 if (manageErrorClasses) { 873 if (!goodToGo) { 874 this.addErrorClasses($el, failedValidators); 875 } else { 876 this.removeErrorClasses($el); 877 } 878 } 879 /** 880 * Fires when the input is done checking for validation. Event trigger is either `valid.zf.abide` or `invalid.zf.abide` 881 * Trigger includes the DOM element of the input. 882 * @event Abide#valid 883 * @event Abide#invalid 884 */ 885 886 887 $el.trigger(message, [$el]); 888 return goodToGo; 889 } 890 /** 891 * Goes through a form and if there are any invalid inputs, it will display the form error element 892 * @returns {Boolean} noError - true if no errors were detected... 893 * @fires Abide#formvalid 894 * @fires Abide#forminvalid 895 */ 896 897 }, { 898 key: "validateForm", 899 value: function validateForm() { 900 var _this8 = this; 901 902 var acc = []; 903 904 var _this = this; 905 906 var checkboxGroupName; // Remember first form submission to prevent specific checkbox validation (more than one required) until form got initially submitted 907 908 if (!this.initialized) { 909 this.initialized = true; 910 } // skip validation if disabled 911 912 913 if (this._validationIsDisabled()) { 914 this.formnovalidate = null; 915 return true; 916 } 917 918 this.$inputs.each(function () { 919 // Only use one checkbox per group since validateCheckbox() iterates over all associated checkboxes 920 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)[0].type === 'checkbox') { 921 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('name') === checkboxGroupName) return true; 922 checkboxGroupName = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('name'); 923 } 924 925 acc.push(_this.validateInput(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this))); 926 }); 927 var noError = acc.indexOf(false) === -1; 928 this.$element.find('[data-abide-error]').each(function (i, elem) { 929 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(elem); // Ensure a11y attributes are set 930 931 if (_this8.options.a11yAttributes) _this8.addGlobalErrorA11yAttributes($elem); // Show or hide the error 932 933 $elem.css('display', noError ? 'none' : 'block'); 934 }); 935 /** 936 * Fires when the form is finished validating. Event trigger is either `formvalid.zf.abide` or `forminvalid.zf.abide`. 937 * Trigger includes the element of the form. 938 * @event Abide#formvalid 939 * @event Abide#forminvalid 940 */ 941 942 this.$element.trigger((noError ? 'formvalid' : 'forminvalid') + '.zf.abide', [this.$element]); 943 return noError; 944 } 945 /** 946 * Determines whether or a not a text input is valid based on the pattern specified in the attribute. If no matching pattern is found, returns true. 947 * @param {Object} $el - jQuery object to validate, should be a text input HTML element 948 * @param {String} pattern - string value of one of the RegEx patterns in Abide.options.patterns 949 * @returns {Boolean} Boolean value depends on whether or not the input value matches the pattern specified 950 */ 951 952 }, { 953 key: "validateText", 954 value: function validateText($el, pattern) { 955 // A pattern can be passed to this function, or it will be infered from the input's "pattern" attribute, or it's "type" attribute 956 pattern = pattern || $el.attr('data-pattern') || $el.attr('pattern') || $el.attr('type'); 957 var inputText = $el.val(); 958 var valid = true; 959 960 if (inputText.length) { 961 // If the pattern attribute on the element is in Abide's list of patterns, then test that regexp 962 if (this.options.patterns.hasOwnProperty(pattern)) { 963 valid = this.options.patterns[pattern].test(inputText); 964 } // If the pattern name isn't also the type attribute of the field, then test it as a regexp 965 else if (pattern !== $el.attr('type')) { 966 valid = new RegExp(pattern).test(inputText); 967 } 968 } 969 970 return valid; 971 } 972 /** 973 * Determines whether or a not a radio input is valid based on whether or not it is required and selected. Although the function targets a single `<input>`, it validates by checking the `required` and `checked` properties of all radio buttons in its group. 974 * @param {String} groupName - A string that specifies the name of a radio button group 975 * @returns {Boolean} Boolean value depends on whether or not at least one radio input has been selected (if it's required) 976 */ 977 978 }, { 979 key: "validateRadio", 980 value: function validateRadio(groupName) { 981 // If at least one radio in the group has the `required` attribute, the group is considered required 982 // Per W3C spec, all radio buttons in a group should have `required`, but we're being nice 983 var $group = this.$element.find(":radio[name=\"".concat(groupName, "\"]")); 984 var valid = false, 985 required = false; // For the group to be required, at least one radio needs to be required 986 987 $group.each(function (i, e) { 988 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('required')) { 989 required = true; 990 } 991 }); 992 if (!required) valid = true; 993 994 if (!valid) { 995 // For the group to be valid, at least one radio needs to be checked 996 $group.each(function (i, e) { 997 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).prop('checked')) { 998 valid = true; 999 } 1000 }); 1001 } 1002 1003 return valid; 1004 } 1005 /** 1006 * Determines whether or a not a checkbox input is valid based on whether or not it is required and checked. Although the function targets a single `<input>`, it validates by checking the `required` and `checked` properties of all checkboxes in its group. 1007 * @param {String} groupName - A string that specifies the name of a checkbox group 1008 * @returns {Boolean} Boolean value depends on whether or not at least one checkbox input has been checked (if it's required) 1009 */ 1010 1011 }, { 1012 key: "validateCheckbox", 1013 value: function validateCheckbox(groupName) { 1014 var _this9 = this; 1015 1016 // If at least one checkbox in the group has the `required` attribute, the group is considered required 1017 // Per W3C spec, all checkboxes in a group should have `required`, but we're being nice 1018 var $group = this.$element.find(":checkbox[name=\"".concat(groupName, "\"]")); 1019 var valid = false, 1020 required = false, 1021 minRequired = 1, 1022 checked = 0; // For the group to be required, at least one checkbox needs to be required 1023 1024 $group.each(function (i, e) { 1025 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('required')) { 1026 required = true; 1027 } 1028 }); 1029 if (!required) valid = true; 1030 1031 if (!valid) { 1032 // Count checked checkboxes within the group 1033 // Use data-min-required if available (default: 1) 1034 $group.each(function (i, e) { 1035 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).prop('checked')) { 1036 checked++; 1037 } 1038 1039 if (typeof jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('data-min-required') !== 'undefined') { 1040 minRequired = parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e).attr('data-min-required'), 10); 1041 } 1042 }); // For the group to be valid, the minRequired amount of checkboxes have to be checked 1043 1044 if (checked >= minRequired) { 1045 valid = true; 1046 } 1047 } // Skip validation if more than 1 checkbox have to be checked AND if the form hasn't got submitted yet (otherwise it will already show an error during the first fill in) 1048 1049 1050 if (this.initialized !== true && minRequired > 1) { 1051 return true; 1052 } // Refresh error class for all input 1053 1054 1055 $group.each(function (i, e) { 1056 if (!valid) { 1057 _this9.addErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e), ['required']); 1058 } else { 1059 _this9.removeErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e)); 1060 } 1061 }); 1062 return valid; 1063 } 1064 /** 1065 * Determines if a selected input passes a custom validation function. Multiple validations can be used, if passed to the element with `data-validator="foo bar baz"` in a space separated listed. 1066 * @param {Object} $el - jQuery input element. 1067 * @param {String} validators - a string of function names matching functions in the Abide.options.validators object. 1068 * @param {Boolean} required - self explanatory? 1069 * @returns {Boolean} - true if validations passed. 1070 */ 1071 1072 }, { 1073 key: "matchValidation", 1074 value: function matchValidation($el, validators, required) { 1075 var _this10 = this; 1076 1077 required = required ? true : false; 1078 var clear = validators.split(' ').map(function (v) { 1079 return _this10.options.validators[v]($el, required, $el.parent()); 1080 }); 1081 return clear.indexOf(false) === -1; 1082 } 1083 /** 1084 * Resets form inputs and styles 1085 * @fires Abide#formreset 1086 */ 1087 1088 }, { 1089 key: "resetForm", 1090 value: function resetForm() { 1091 var $form = this.$element, 1092 opts = this.options; 1093 jquery__WEBPACK_IMPORTED_MODULE_0___default()(".".concat(opts.labelErrorClass), $form).not('small').removeClass(opts.labelErrorClass); 1094 jquery__WEBPACK_IMPORTED_MODULE_0___default()(".".concat(opts.inputErrorClass), $form).not('small').removeClass(opts.inputErrorClass); 1095 jquery__WEBPACK_IMPORTED_MODULE_0___default()("".concat(opts.formErrorSelector, ".").concat(opts.formErrorClass)).removeClass(opts.formErrorClass); 1096 $form.find('[data-abide-error]').css('display', 'none'); 1097 jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input', $form).not(':button, :submit, :reset, :hidden, :radio, :checkbox, [data-abide-ignore]').val('').attr({ 1098 'data-invalid': null, 1099 'aria-invalid': null 1100 }); 1101 jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input:radio', $form).not('[data-abide-ignore]').prop('checked', false).attr({ 1102 'data-invalid': null, 1103 'aria-invalid': null 1104 }); 1105 jquery__WEBPACK_IMPORTED_MODULE_0___default()(':input:checkbox', $form).not('[data-abide-ignore]').prop('checked', false).attr({ 1106 'data-invalid': null, 1107 'aria-invalid': null 1108 }); 1109 /** 1110 * Fires when the form has been reset. 1111 * @event Abide#formreset 1112 */ 1113 1114 $form.trigger('formreset.zf.abide', [$form]); 1115 } 1116 /** 1117 * Destroys an instance of Abide. 1118 * Removes error styles and classes from elements, without resetting their values. 1119 */ 1120 1121 }, { 1122 key: "_destroy", 1123 value: function _destroy() { 1124 var _this = this; 1125 1126 this.$element.off('.abide').find('[data-abide-error]').css('display', 'none'); 1127 this.$inputs.off('.abide').each(function () { 1128 _this.removeErrorClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 1129 }); 1130 this.$submits.off('.abide'); 1131 } 1132 }]); 1133 1134 return Abide; 1135}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 1136/** 1137 * Default settings for plugin 1138 */ 1139 1140 1141Abide.defaults = { 1142 /** 1143 * The default event to validate inputs. Checkboxes and radios validate immediately. 1144 * Remove or change this value for manual validation. 1145 * @option 1146 * @type {?string} 1147 * @default 'fieldChange' 1148 */ 1149 validateOn: 'fieldChange', 1150 1151 /** 1152 * Class to be applied to input labels on failed validation. 1153 * @option 1154 * @type {string} 1155 * @default 'is-invalid-label' 1156 */ 1157 labelErrorClass: 'is-invalid-label', 1158 1159 /** 1160 * Class to be applied to inputs on failed validation. 1161 * @option 1162 * @type {string} 1163 * @default 'is-invalid-input' 1164 */ 1165 inputErrorClass: 'is-invalid-input', 1166 1167 /** 1168 * Class selector to use to target Form Errors for show/hide. 1169 * @option 1170 * @type {string} 1171 * @default '.form-error' 1172 */ 1173 formErrorSelector: '.form-error', 1174 1175 /** 1176 * Class added to Form Errors on failed validation. 1177 * @option 1178 * @type {string} 1179 * @default 'is-visible' 1180 */ 1181 formErrorClass: 'is-visible', 1182 1183 /** 1184 * If true, automatically insert when possible: 1185 * - `[aria-describedby]` on fields 1186 * - `[role=alert]` on form errors and `[for]` on form error labels 1187 * - `[aria-live]` on global errors `[data-abide-error]` (see option `a11yErrorLevel`). 1188 * @option 1189 * @type {boolean} 1190 * @default true 1191 */ 1192 a11yAttributes: true, 1193 1194 /** 1195 * [aria-live] attribute value to be applied on global errors `[data-abide-error]`. 1196 * Options are: 'assertive', 'polite' and 'off'/null 1197 * @option 1198 * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions 1199 * @type {string} 1200 * @default 'assertive' 1201 */ 1202 a11yErrorLevel: 'assertive', 1203 1204 /** 1205 * Set to true to validate text inputs on any value change. 1206 * @option 1207 * @type {boolean} 1208 * @default false 1209 */ 1210 liveValidate: false, 1211 1212 /** 1213 * Set to true to validate inputs on blur. 1214 * @option 1215 * @type {boolean} 1216 * @default false 1217 */ 1218 validateOnBlur: false, 1219 patterns: {
1220 alpha: /^[a-zA-Z]+$/, 1221 // eslint-disable-next-line camelcase 1222 alpha_numeric: /^[a-zA-Z0-9]+$/, 1223 integer: /^[-+]?\d+$/, 1224 number: /^[-+]?\d*(?:[\.\,]\d+)?$/, 1225 // amex, visa, diners 1226 card: /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(?:222[1-9]|2[3-6][0-9]{2}|27[0-1][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/, 1227 cvv: /^([0-9]){3,4}$/, 1228 // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address 1229 email: /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/, 1230 // From CommonRegexJS (@talyssonoc) 1231 // https://github.com/talyssonoc/CommonRegexJS/blob/e2901b9f57222bc14069dc8f0598d5f412555411/lib/commonregex.js#L76 1232 // For more restrictive URL Regexs, see https://mathiasbynens.be/demo/url-regex. 1233 url: /^((?:(https?|ftps?|file|ssh|sftp):\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\))+(?:\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))$/, 1234 // abc.de 1235 domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/, 1236 datetime: /^([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))$/, 1237 // YYYY-MM-DD 1238 date: /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))$/, 1239 // HH:MM:SS 1240 time: /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/, 1241 dateISO: /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/, 1242 // MM/DD/YYYY 1243 // eslint-disable-next-line camelcase 1244 month_day_year: /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/, 1245 // DD/MM/YYYY 1246 // eslint-disable-next-line camelcase 1247 day_month_year: /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/, 1248 // #FFF or #FFFFFF 1249 color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/, 1250 // Domain || URL 1251 website: { 1252 test: function test(text) { 1253 return Abide.defaults.patterns.domain.test(text) || Abide.defaults.patterns.url.test(text); 1254 } 1255 } 1256 }, 1257 1258 /** 1259 * Optional validation functions to be used. `equalTo` being the only default included function. 1260 * Functions should return only a boolean if the input is valid or not. Functions are given the following arguments: 1261 * el : The jQuery element to validate. 1262 * @option 1263 */ 1264 validators: { 1265 equalTo: function equalTo(el) { 1266 return jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(el.attr('data-equalto'))).val() === el.val(); 1267 } 1268 } 1269}; 1270 1271 1272/***/ }), 1273
vendor: 4,171 bytes, lines 1274-1309
1274/***/ "./js/foundation.accordion.js": 1275/*!************************************!*\ 1276 !*** ./js/foundation.accordion.js ***! 1277 \************************************/ 1278/*! exports provided: Accordion */ 1279/***/ (function(module, __webpack_exports__, __webpack_require__) { 1280 1281"use strict"; 1282__webpack_require__.r(__webpack_exports__); 1283/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return Accordion; }); 1284/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 1285/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 1286/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 1287/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 1288/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 1289function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 1290 1291function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 1292 1293function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 1294 1295function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 1296 1297function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 1298 1299function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 1300 1301function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 1302 1303function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 1304 1305function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 1306 1307function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 1308 1309function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o
vendor: 11,911 bytes, lines 1309-1692
1309) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 1310 1311 1312 1313 1314 1315/** 1316 * Accordion module. 1317 * @module foundation.accordion 1318 * @requires foundation.util.keyboard 1319 */ 1320 1321var Accordion = /*#__PURE__*/function (_Plugin) { 1322 _inherits(Accordion, _Plugin); 1323 1324 var _super = _createSuper(Accordion); 1325 1326 function Accordion() { 1327 _classCallCheck(this, Accordion); 1328 1329 return _super.apply(this, arguments); 1330 } 1331 1332 _createClass(Accordion, [{ 1333 key: "_setup", 1334 value: 1335 /** 1336 * Creates a new instance of an accordion. 1337 * @class 1338 * @name Accordion 1339 * @fires Accordion#init 1340 * @param {jQuery} element - jQuery object to make into an accordion. 1341 * @param {Object} options - a plain object with settings to override the default options. 1342 */ 1343 function _setup(element, options) { 1344 this.$element = element; 1345 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Accordion.defaults, this.$element.data(), options); 1346 this.className = 'Accordion'; // ie9 back compat 1347 1348 this._init(); 1349 1350 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('Accordion', { 1351 'ENTER': 'toggle', 1352 'SPACE': 'toggle', 1353 'ARROW_DOWN': 'next', 1354 'ARROW_UP': 'previous', 1355 'HOME': 'first', 1356 'END': 'last' 1357 }); 1358 } 1359 /** 1360 * Initializes the accordion by animating the preset active pane(s). 1361 * @private 1362 */ 1363 1364 }, { 1365 key: "_init", 1366 value: function _init() { 1367 var _this2 = this; 1368 1369 this._isInitializing = true; 1370 this.$tabs = this.$element.children('[data-accordion-item]'); 1371 this.$tabs.each(function (idx, el) { 1372 var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el), 1373 $content = $el.children('[data-tab-content]'), 1374 id = $content[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'accordion'), 1375 linkId = el.id ? "".concat(el.id, "-label") : "".concat(id, "-label"); 1376 $el.find('a:first').attr({ 1377 'aria-controls': id, 1378 'id': linkId, 1379 'aria-expanded': false 1380 }); 1381 $content.attr({ 1382 'role': 'region', 1383 'aria-labelledby': linkId, 1384 'aria-hidden': true, 1385 'id': id 1386 }); 1387 }); 1388 var $initActive = this.$element.find('.is-active').children('[data-tab-content]'); 1389 1390 if ($initActive.length) { 1391 // Save up the initial hash to return to it later when going back in history 1392 this._initialAnchor = $initActive.prev('a').attr('href'); 1393 1394 this._openSingleTab($initActive); 1395 } 1396 1397 this._checkDeepLink = function () { 1398 var anchor = window.location.hash; 1399 1400 if (!anchor.length) { 1401 // If we are still initializing and there is no anchor, then there is nothing to do 1402 if (_this2._isInitializing) return; // Otherwise, move to the initial anchor 1403 1404 if (_this2._initialAnchor) anchor = _this2._initialAnchor; 1405 } 1406 1407 var $anchor = anchor && jquery__WEBPACK_IMPORTED_MODULE_0___default()(anchor); 1408 1409 var $link = anchor && _this2.$element.find("[href$=\"".concat(anchor, "\"]")); // Whether the anchor element that has been found is part of this element 1410 1411 1412 var isOwnAnchor = !!($anchor.length && $link.length); 1413 1414 if (isOwnAnchor) { 1415 // If there is an anchor for the hash, open it (if not already active) 1416 if ($anchor && $link && $link.length) { 1417 if (!$link.parent('[data-accordion-item]').hasClass('is-active')) { 1418 _this2._openSingleTab($anchor); 1419 } 1420 } // Otherwise, close everything 1421 else { 1422 _this2._closeAllTabs(); 1423 } // Roll up a little to show the titles 1424 1425 1426 if (_this2.options.deepLinkSmudge) { 1427 Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 1428 var offset = _this2.$element.offset(); 1429 1430 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({ 1431 scrollTop: offset.top - _this2.options.deepLinkSmudgeOffset 1432 }, _this2.options.deepLinkSmudgeDelay); 1433 }); 1434 } 1435 /** 1436 * Fires when the plugin has deeplinked at pageload 1437 * @event Accordion#deeplink 1438 */ 1439 1440 1441 _this2.$element.trigger('deeplink.zf.accordion', [$link, $anchor]); 1442 } 1443 }; //use browser to open a tab, if it exists in this tabset 1444 1445 1446 if (this.options.deepLink) { 1447 this._checkDeepLink(); 1448 } 1449 1450 this._events(); 1451 1452 this._isInitializing = false; 1453 } 1454 /** 1455 * Adds event handlers for items within the accordion. 1456 * @private 1457 */ 1458 1459 }, { 1460 key: "_events", 1461 value: function _events() { 1462 var _this = this; 1463 1464 this.$tabs.each(function () { 1465 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 1466 var $tabContent = $elem.children('[data-tab-content]'); 1467 1468 if ($tabContent.length) { 1469 $elem.children('a').off('click.zf.accordion keydown.zf.accordion').on('click.zf.accordion', function (e) { 1470 e.preventDefault(); 1471 1472 _this.toggle($tabContent); 1473 }).on('keydown.zf.accordion', function (e) { 1474 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'Accordion', { 1475 toggle: function toggle() { 1476 _this.toggle($tabContent); 1477 }, 1478 next: function next() { 1479 var $a = $elem.next().find('a').focus(); 1480 1481 if (!_this.options.multiExpand) { 1482 $a.trigger('click.zf.accordion'); 1483 } 1484 }, 1485 previous: function previous() { 1486 var $a = $elem.prev().find('a').focus(); 1487 1488 if (!_this.options.multiExpand) { 1489 $a.trigger('click.zf.accordion'); 1490 } 1491 }, 1492 first: function first() { 1493 var $a = _this.$tabs.first().find('.accordion-title').focus(); 1494 1495 if (!_this.options.multiExpand) { 1496 $a.trigger('click.zf.accordion'); 1497 } 1498 }, 1499 last: function last() { 1500 var $a = _this.$tabs.last().find('.accordion-title').focus(); 1501 1502 if (!_this.options.multiExpand) { 1503 $a.trigger('click.zf.accordion'); 1504 } 1505 }, 1506 handled: function handled() { 1507 e.preventDefault(); 1508 } 1509 }); 1510 }); 1511 } 1512 }); 1513 1514 if (this.options.deepLink) { 1515 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._checkDeepLink); 1516 } 1517 } 1518 /** 1519 * Toggles the selected content pane's open/close state. 1520 * @param {jQuery} $target - jQuery object of the pane to toggle (`.accordion-content`). 1521 * @function 1522 */ 1523 1524 }, { 1525 key: "toggle", 1526 value: function toggle($target) { 1527 if ($target.closest('[data-accordion]').is('[disabled]')) { 1528 console.info('Cannot toggle an accordion that is disabled.'); 1529 return; 1530 } 1531 1532 if ($target.parent().hasClass('is-active')) { 1533 this.up($target); 1534 } else { 1535 this.down($target); 1536 } //either replace or update browser history 1537 1538 1539 if (this.options.deepLink) { 1540 var anchor = $target.prev('a').attr('href'); 1541 1542 if (this.options.updateHistory) { 1543 history.pushState({}, '', anchor); 1544 } else { 1545 history.replaceState({}, '', anchor); 1546 } 1547 } 1548 } 1549 /** 1550 * Opens the accordion tab defined by `$target`. 1551 * @param {jQuery} $target - Accordion pane to open (`.accordion-content`). 1552 * @fires Accordion#down 1553 * @function 1554 */ 1555 1556 }, { 1557 key: "down", 1558 value: function down($target) { 1559 if ($target.closest('[data-accordion]').is('[disabled]')) { 1560 console.info('Cannot call down on an accordion that is disabled.'); 1561 return; 1562 } 1563 1564 if (this.options.multiExpand) this._openTab($target);else this._openSingleTab($target); 1565 } 1566 /** 1567 * Closes the tab defined by `$target`. 1568 * It may be ignored if the Accordion options don't allow it. 1569 * 1570 * @param {jQuery} $target - Accordion tab to close (`.accordion-content`). 1571 * @fires Accordion#up 1572 * @function 1573 */ 1574 1575 }, { 1576 key: "up", 1577 value: function up($target) { 1578 if (this.$element.is('[disabled]')) { 1579 console.info('Cannot call up on an accordion that is disabled.'); 1580 return; 1581 } // Don't close the item if it is already closed 1582 1583 1584 var $targetItem = $target.parent(); 1585 if (!$targetItem.hasClass('is-active')) return; // Don't close the item if there is no other active item (unless with `allowAllClosed`) 1586 1587 var $othersItems = $targetItem.siblings(); 1588 if (!this.options.allowAllClosed && !$othersItems.hasClass('is-active')) return; 1589 1590 this._closeTab($target); 1591 } 1592 /** 1593 * Make the tab defined by `$target` the only opened tab, closing all others tabs. 1594 * @param {jQuery} $target - Accordion tab to open (`.accordion-content`). 1595 * @function 1596 * @private 1597 */ 1598 1599 }, { 1600 key: "_openSingleTab", 1601 value: function _openSingleTab($target) { 1602 // Close all the others active tabs. 1603 var $activeContents = this.$element.children('.is-active').children('[data-tab-content]'); 1604 1605 if ($activeContents.length) { 1606 this._closeTab($activeContents.not($target)); 1607 } // Then open the target. 1608 1609 1610 this._openTab($target); 1611 } 1612 /** 1613 * Opens the tab defined by `$target`. 1614 * @param {jQuery} $target - Accordion tab to open (`.accordion-content`). 1615 * @fires Accordion#down 1616 * @function 1617 * @private 1618 */ 1619 1620 }, { 1621 key: "_openTab", 1622 value: function _openTab($target) { 1623 var _this3 = this; 1624 1625 var $targetItem = $target.parent(); 1626 var targetContentId = $target.attr('aria-labelledby'); 1627 $target.attr('aria-hidden', false); 1628 $targetItem.addClass('is-active'); 1629 jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetContentId)).attr({ 1630 'aria-expanded': true 1631 }); 1632 $target.finish().slideDown(this.options.slideSpeed, function () { 1633 /** 1634 * Fires when the tab is done opening. 1635 * @event Accordion#down 1636 */ 1637 _this3.$element.trigger('down.zf.accordion', [$target]); 1638 }); 1639 } 1640 /** 1641 * Closes the tab defined by `$target`. 1642 * @param {jQuery} $target - Accordion tab to close (`.accordion-content`). 1643 * @fires Accordion#up 1644 * @function 1645 * @private 1646 */ 1647 1648 }, { 1649 key: "_closeTab", 1650 value: function _closeTab($target) { 1651 var _this4 = this; 1652 1653 var $targetItem = $target.parent(); 1654 var targetContentId = $target.attr('aria-labelledby'); 1655 $target.attr('aria-hidden', true); 1656 $targetItem.removeClass('is-active'); 1657 jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetContentId)).attr({ 1658 'aria-expanded': false 1659 }); 1660 $target.finish().slideUp(this.options.slideSpeed, function () { 1661 /** 1662 * Fires when the tab is done collapsing up. 1663 * @event Accordion#up 1664 */ 1665 _this4.$element.trigger('up.zf.accordion', [$target]); 1666 }); 1667 } 1668 /** 1669 * Closes all active tabs 1670 * @fires Accordion#up 1671 * @function 1672 * @private 1673 */ 1674 1675 }, { 1676 key: "_closeAllTabs", 1677 value: function _closeAllTabs() { 1678 var $activeTabs = this.$element.children('.is-active').children('[data-tab-content]'); 1679 1680 if ($activeTabs.length) { 1681 this._closeTab($activeTabs); 1682 } 1683 } 1684 /** 1685 * Destroys an instance of an accordion. 1686 * @fires Accordion#destroyed 1687 * @function 1688 */ 1689 1690 }, { 1691 key: "_destroy", 1692 value: function _destroy() {
1693 this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', ''); 1694 this.$element.find('a').off('.zf.accordion'); 1695 1696 if (this.options.deepLink) { 1697 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._checkDeepLink); 1698 } 1699 } 1700 }]); 1701 1702 return Accordion; 1703}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 1704 1705Accordion.defaults = { 1706 /** 1707 * Amount of time to animate the opening of an accordion pane. 1708 * @option 1709 * @type {number} 1710 * @default 250 1711 */ 1712 slideSpeed: 250, 1713 1714 /** 1715 * Allow the accordion to have multiple open panes. 1716 * @option 1717 * @type {boolean} 1718 * @default false 1719 */ 1720 multiExpand: false, 1721 1722 /** 1723 * Allow the accordion to close all panes. 1724 * @option 1725 * @type {boolean} 1726 * @default false 1727 */ 1728 allowAllClosed: false, 1729 1730 /** 1731 * Link the location hash to the open pane. 1732 * Set the location hash when the opened pane changes, and open and scroll to the corresponding pane when the location changes. 1733 * @option 1734 * @type {boolean} 1735 * @default false 1736 */ 1737 deepLink: false, 1738 1739 /** 1740 * If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the accordion panel is visible 1741 * @option 1742 * @type {boolean} 1743 * @default false 1744 */ 1745 deepLinkSmudge: false, 1746 1747 /** 1748 * If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment 1749 * @option 1750 * @type {number} 1751 * @default 300 1752 */ 1753 deepLinkSmudgeDelay: 300, 1754 1755 /** 1756 * If `deepLinkSmudge` is enabled, the offset for scrollToTtop to prevent overlap by a sticky element at the top of the page 1757 * @option 1758 * @type {number} 1759 * @default 0 1760 */ 1761 deepLinkSmudgeOffset: 0, 1762 1763 /** 1764 * If `deepLink` is enabled, update the browser history with the open accordion 1765 * @option 1766 * @type {boolean} 1767 * @default false 1768 */ 1769 updateHistory: false 1770}; 1771 1772 1773/***/ }), 1774
vendor: 4,238 bytes, lines 1775-1810
1775/***/ "./js/foundation.accordionMenu.js": 1776/*!****************************************!*\ 1777 !*** ./js/foundation.accordionMenu.js ***! 1778 \****************************************/ 1779/*! exports provided: AccordionMenu */ 1780/***/ (function(module, __webpack_exports__, __webpack_require__) { 1781 1782"use strict"; 1783__webpack_require__.r(__webpack_exports__); 1784/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccordionMenu", function() { return AccordionMenu; }); 1785/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 1786/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 1787/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 1788/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.nest */ "./js/foundation.util.nest.js"); 1789/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 1790/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 1791function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 1792 1793function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 1794 1795function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 1796 1797function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 1798 1799function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 1800 1801function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 1802 1803function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 1804 1805function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 1806 1807function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 1808 1809function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 1810
vendor: 7,301 bytes, lines 1811-2006
1811function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 1812 1813 1814 1815 1816 1817 1818/** 1819 * AccordionMenu module. 1820 * @module foundation.accordionMenu 1821 * @requires foundation.util.keyboard 1822 * @requires foundation.util.nest 1823 */ 1824 1825var AccordionMenu = /*#__PURE__*/function (_Plugin) { 1826 _inherits(AccordionMenu, _Plugin); 1827 1828 var _super = _createSuper(AccordionMenu); 1829 1830 function AccordionMenu() { 1831 _classCallCheck(this, AccordionMenu); 1832 1833 return _super.apply(this, arguments); 1834 } 1835 1836 _createClass(AccordionMenu, [{ 1837 key: "_setup", 1838 value: 1839 /** 1840 * Creates a new instance of an accordion menu. 1841 * @class 1842 * @name AccordionMenu 1843 * @fires AccordionMenu#init 1844 * @param {jQuery} element - jQuery object to make into an accordion menu. 1845 * @param {Object} options - Overrides to the default plugin settings. 1846 */ 1847 function _setup(element, options) { 1848 this.$element = element; 1849 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, AccordionMenu.defaults, this.$element.data(), options); 1850 this.className = 'AccordionMenu'; // ie9 back compat 1851 1852 this._init(); 1853 1854 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('AccordionMenu', { 1855 'ENTER': 'toggle', 1856 'SPACE': 'toggle', 1857 'ARROW_RIGHT': 'open', 1858 'ARROW_UP': 'up', 1859 'ARROW_DOWN': 'down', 1860 'ARROW_LEFT': 'close', 1861 'ESCAPE': 'closeAll' 1862 }); 1863 } 1864 /** 1865 * Initializes the accordion menu by hiding all nested menus. 1866 * @private 1867 */ 1868 1869 }, { 1870 key: "_init", 1871 value: function _init() { 1872 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Feather(this.$element, 'accordion'); 1873 1874 var _this = this; 1875 1876 this.$element.find('[data-submenu]').not('.is-active').slideUp(0); //.find('a').css('padding-left', '1rem'); 1877 1878 this.$element.attr({ 1879 'aria-multiselectable': this.options.multiOpen 1880 }); 1881 this.$menuLinks = this.$element.find('.is-accordion-submenu-parent'); 1882 this.$menuLinks.each(function () { 1883 var linkId = this.id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'acc-menu-link'), 1884 $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 1885 $sub = $elem.children('[data-submenu]'), 1886 subId = $sub[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'acc-menu'), 1887 isActive = $sub.hasClass('is-active'); 1888 1889 if (_this.options.parentLink) { 1890 var $anchor = $elem.children('a'); 1891 $anchor.clone().prependTo($sub).wrap('<li data-is-parent-link class="is-submenu-parent-item is-submenu-item is-accordion-submenu-item"></li>'); 1892 } 1893 1894 if (_this.options.submenuToggle) { 1895 $elem.addClass('has-submenu-toggle'); 1896 $elem.children('a').after('<button id="' + linkId + '" class="submenu-toggle" aria-controls="' + subId + '" aria-expanded="' + isActive + '" title="' + _this.options.submenuToggleText + '"><span class="submenu-toggle-text">' + _this.options.submenuToggleText + '</span></button>'); 1897 } else { 1898 $elem.attr({ 1899 'aria-controls': subId, 1900 'aria-expanded': isActive, 1901 'id': linkId 1902 }); 1903 } 1904 1905 $sub.attr({ 1906 'aria-labelledby': linkId, 1907 'aria-hidden': !isActive, 1908 'role': 'group', 1909 'id': subId 1910 }); 1911 }); 1912 var initPanes = this.$element.find('.is-active'); 1913 1914 if (initPanes.length) { 1915 initPanes.each(function () { 1916 _this.down(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 1917 }); 1918 } 1919 1920 this._events(); 1921 } 1922 /** 1923 * Adds event handlers for items within the menu. 1924 * @private 1925 */ 1926 1927 }, { 1928 key: "_events", 1929 value: function _events() { 1930 var _this = this; 1931 1932 this.$element.find('li').each(function () { 1933 var $submenu = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('[data-submenu]'); 1934 1935 if ($submenu.length) { 1936 if (_this.options.submenuToggle) { 1937 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('.submenu-toggle').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function () { 1938 _this.toggle($submenu); 1939 }); 1940 } else { 1941 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('a').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function (e) { 1942 e.preventDefault(); 1943 1944 _this.toggle($submenu); 1945 }); 1946 } 1947 } 1948 }).on('keydown.zf.accordionMenu', function (e) { 1949 var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 1950 $elements = $element.parent('ul').children('li'), 1951 $prevElement, 1952 $nextElement, 1953 $target = $element.children('[data-submenu]'); 1954 $elements.each(function (i) { 1955 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) { 1956 $prevElement = $elements.eq(Math.max(0, i - 1)).find('a').first(); 1957 $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)).find('a').first(); 1958 1959 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children('[data-submenu]:visible').length) { 1960 // has open sub menu 1961 $nextElement = $element.find('li:first-child').find('a').first(); 1962 } 1963 1964 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':first-child')) { 1965 // is first element of sub menu 1966 $prevElement = $element.parents('li').first().find('a').first(); 1967 } else if ($prevElement.parents('li').first().children('[data-submenu]:visible').length) { 1968 // if previous element has open sub menu 1969 $prevElement = $prevElement.parents('li').find('li:last-child').find('a').first(); 1970 } 1971 1972 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':last-child')) { 1973 // is last element of sub menu 1974 $nextElement = $element.parents('li').first().next('li').find('a').first(); 1975 } 1976 1977 return; 1978 } 1979 }); 1980 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'AccordionMenu', { 1981 open: function open() { 1982 if ($target.is(':hidden')) { 1983 _this.down($target); 1984 1985 $target.find('li').first().find('a').first().focus(); 1986 } 1987 }, 1988 close: function close() { 1989 if ($target.length && !$target.is(':hidden')) { 1990 // close active sub of this item 1991 _this.up($target); 1992 } else if ($element.parent('[data-submenu]').length) { 1993 // close currently open sub 1994 _this.up($element.parent('[data-submenu]')); 1995 1996 $element.parents('li').first().find('a').first().focus(); 1997 } 1998 }, 1999 up: function up() { 2000 $prevElement.focus(); 2001 return true; 2002 }, 2003 down: function down() { 2004 $nextElement.focus(); 2005 return true; 2006 },
vendor: 4,450 bytes, lines 2007-2162
2007 toggle: function toggle() { 2008 if (_this.options.submenuToggle) { 2009 return false; 2010 } 2011 2012 if ($element.children('[data-submenu]').length) { 2013 _this.toggle($element.children('[data-submenu]')); 2014 2015 return true; 2016 } 2017 }, 2018 closeAll: function closeAll() { 2019 _this.hideAll(); 2020 }, 2021 handled: function handled(preventDefault) { 2022 if (preventDefault) { 2023 e.preventDefault(); 2024 } 2025 } 2026 }); 2027 }); //.attr('tabindex', 0); 2028 } 2029 /** 2030 * Closes all panes of the menu. 2031 * @function 2032 */ 2033 2034 }, { 2035 key: "hideAll", 2036 value: function hideAll() { 2037 this.up(this.$element.find('[data-submenu]')); 2038 } 2039 /** 2040 * Opens all panes of the menu. 2041 * @function 2042 */ 2043 2044 }, { 2045 key: "showAll", 2046 value: function showAll() { 2047 this.down(this.$element.find('[data-submenu]')); 2048 } 2049 /** 2050 * Toggles the open/close state of a submenu. 2051 * @function 2052 * @param {jQuery} $target - the submenu to toggle 2053 */ 2054 2055 }, { 2056 key: "toggle", 2057 value: function toggle($target) { 2058 if (!$target.is(':animated')) { 2059 if (!$target.is(':hidden')) { 2060 this.up($target); 2061 } else { 2062 this.down($target); 2063 } 2064 } 2065 } 2066 /** 2067 * Opens the sub-menu defined by `$target`. 2068 * @param {jQuery} $target - Sub-menu to open. 2069 * @fires AccordionMenu#down 2070 */ 2071 2072 }, { 2073 key: "down", 2074 value: function down($target) { 2075 var _this2 = this; 2076 2077 // If having multiple submenus active is disabled, close all the submenus 2078 // that are not parents or children of the targeted submenu. 2079 if (!this.options.multiOpen) { 2080 // The "branch" of the targetted submenu, from the component root to 2081 // the active submenus nested in it. 2082 var $targetBranch = $target.parentsUntil(this.$element).add($target).add($target.find('.is-active')); // All the active submenus that are not in the branch. 2083 2084 var $othersActiveSubmenus = this.$element.find('.is-active').not($targetBranch); 2085 this.up($othersActiveSubmenus); 2086 } 2087 2088 $target.addClass('is-active').attr({ 2089 'aria-hidden': false 2090 }); 2091 2092 if (this.options.submenuToggle) { 2093 $target.prev('.submenu-toggle').attr({ 2094 'aria-expanded': true 2095 }); 2096 } else { 2097 $target.parent('.is-accordion-submenu-parent').attr({ 2098 'aria-expanded': true 2099 }); 2100 } 2101 2102 $target.slideDown(this.options.slideSpeed, function () { 2103 /** 2104 * Fires when the menu is done opening. 2105 * @event AccordionMenu#down 2106 */ 2107 _this2.$element.trigger('down.zf.accordionMenu', [$target]); 2108 }); 2109 } 2110 /** 2111 * Closes the sub-menu defined by `$target`. All sub-menus inside the target will be closed as well. 2112 * @param {jQuery} $target - Sub-menu to close. 2113 * @fires AccordionMenu#up 2114 */ 2115 2116 }, { 2117 key: "up", 2118 value: function up($target) { 2119 var _this3 = this; 2120 2121 var $submenus = $target.find('[data-submenu]'); 2122 var $allmenus = $target.add($submenus); 2123 $submenus.slideUp(0); 2124 $allmenus.removeClass('is-active').attr('aria-hidden', true); 2125 2126 if (this.options.submenuToggle) { 2127 $allmenus.prev('.submenu-toggle').attr('aria-expanded', false); 2128 } else { 2129 $allmenus.parent('.is-accordion-submenu-parent').attr('aria-expanded', false); 2130 } 2131 2132 $target.slideUp(this.options.slideSpeed, function () { 2133 /** 2134 * Fires when the menu is done collapsing up. 2135 * @event AccordionMenu#up 2136 */ 2137 _this3.$element.trigger('up.zf.accordionMenu', [$target]); 2138 }); 2139 } 2140 /** 2141 * Destroys an instance of accordion menu. 2142 * @fires AccordionMenu#destroyed 2143 */ 2144 2145 }, { 2146 key: "_destroy", 2147 value: function _destroy() { 2148 this.$element.find('[data-submenu]').slideDown(0).css('display', ''); 2149 this.$element.find('a').off('click.zf.accordionMenu'); 2150 this.$element.find('[data-is-parent-link]').detach(); 2151 2152 if (this.options.submenuToggle) { 2153 this.$element.find('.has-submenu-toggle').removeClass('has-submenu-toggle'); 2154 this.$element.find('.submenu-toggle').remove(); 2155 } 2156 2157 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Burn(this.$element, 'accordion'); 2158 } 2159 }]); 2160 2161 return AccordionMenu; 2162}
2162(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]); 2163 2164AccordionMenu.defaults = { 2165 /** 2166 * Adds the parent link to the submenu. 2167 * @option 2168 * @type {boolean} 2169 * @default false 2170 */ 2171 parentLink: false, 2172 2173 /** 2174 * Amount of time to animate the opening of a submenu in ms. 2175 * @option 2176 * @type {number} 2177 * @default 250 2178 */ 2179 slideSpeed: 250, 2180 2181 /** 2182 * Adds a separate submenu toggle button. This allows the parent item to have a link. 2183 * @option 2184 * @example true 2185 */ 2186 submenuToggle: false, 2187 2188 /** 2189 * The text used for the submenu toggle if enabled. This is used for screen readers only. 2190 * @option 2191 * @example true 2192 */ 2193 submenuToggleText: 'Toggle menu', 2194 2195 /** 2196 * Allow the menu to have multiple open panes. 2197 * @option 2198 * @type {boolean} 2199 * @default true 2200 */ 2201 multiOpen: true 2202}; 2203 2204 2205/***/ }), 2206
vendor: 10,985 bytes, lines 2207-2481
2207/***/ "./js/foundation.core.js": 2208/*!*******************************!*\ 2209 !*** ./js/foundation.core.js ***! 2210 \*******************************/ 2211/*! exports provided: Foundation */ 2212/***/ (function(module, __webpack_exports__, __webpack_require__) { 2213 2214"use strict"; 2215__webpack_require__.r(__webpack_exports__); 2216/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Foundation", function() { return Foundation; }); 2217/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 2218/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 2219/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 2220/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 2221function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 2222 2223 2224 2225 2226var FOUNDATION_VERSION = '6.7.4'; // Global Foundation object 2227// This is attached to the window, or used as a module for AMD/Browserify 2228 2229var Foundation = { 2230 version: FOUNDATION_VERSION, 2231 2232 /** 2233 * Stores initialized plugins. 2234 */ 2235 _plugins: {}, 2236 2237 /** 2238 * Stores generated unique ids for plugin instances 2239 */ 2240 _uuids: [], 2241 2242 /** 2243 * Defines a Foundation plugin, adding it to the `Foundation` namespace and the list of plugins to initialize when reflowing. 2244 * @param {Object} plugin - The constructor of the plugin. 2245 */ 2246 plugin: function plugin(_plugin, name) { 2247 // Object key to use when adding to global Foundation object 2248 // Examples: Foundation.Reveal, Foundation.OffCanvas 2249 var className = name || functionName(_plugin); // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin 2250 // Examples: data-reveal, data-off-canvas 2251 2252 var attrName = hyphenate(className); // Add to the Foundation object and the plugins list (for reflowing) 2253 2254 this._plugins[attrName] = this[className] = _plugin; 2255 }, 2256 2257 /** 2258 * @function 2259 * Populates the _uuids array with pointers to each individual plugin instance. 2260 * Adds the `zfPlugin` data-attribute to programmatically created plugins to allow use of $(selector).foundation(method) calls. 2261 * Also fires the initialization event for each plugin, consolidating repetitive code. 2262 * @param {Object} plugin - an instance of a plugin, usually `this` in context. 2263 * @param {String} name - the name of the plugin, passed as a camelCased string. 2264 * @fires Plugin#init 2265 */ 2266 registerPlugin: function registerPlugin(plugin, name) { 2267 var pluginName = name ? hyphenate(name) : functionName(plugin.constructor).toLowerCase(); 2268 plugin.uuid = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, pluginName); 2269 2270 if (!plugin.$element.attr("data-".concat(pluginName))) { 2271 plugin.$element.attr("data-".concat(pluginName), plugin.uuid); 2272 } 2273 2274 if (!plugin.$element.data('zfPlugin')) { 2275 plugin.$element.data('zfPlugin', plugin); 2276 } 2277 /** 2278 * Fires when the plugin has initialized. 2279 * @event Plugin#init 2280 */ 2281 2282 2283 plugin.$element.trigger("init.zf.".concat(pluginName)); 2284 2285 this._uuids.push(plugin.uuid); 2286 2287 return; 2288 }, 2289 2290 /** 2291 * @function 2292 * Removes the plugins uuid from the _uuids array. 2293 * Removes the zfPlugin data attribute, as well as the data-plugin-name attribute. 2294 * Also fires the destroyed event for the plugin, consolidating repetitive code. 2295 * @param {Object} plugin - an instance of a plugin, usually `this` in context. 2296 * @fires Plugin#destroyed 2297 */ 2298 unregisterPlugin: function unregisterPlugin(plugin) { 2299 var pluginName = hyphenate(functionName(plugin.$element.data('zfPlugin').constructor)); 2300 2301 this._uuids.splice(this._uuids.indexOf(plugin.uuid), 1); 2302 2303 plugin.$element.removeAttr("data-".concat(pluginName)).removeData('zfPlugin') 2304 /** 2305 * Fires when the plugin has been destroyed. 2306 * @event Plugin#destroyed 2307 */ 2308 .trigger("destroyed.zf.".concat(pluginName)); 2309 2310 for (var prop in plugin) { 2311 if (typeof plugin[prop] === 'function') { 2312 plugin[prop] = null; //clean up script to prep for garbage collection. 2313 } 2314 } 2315 2316 return; 2317 }, 2318 2319 /** 2320 * @function 2321 * Causes one or more active plugins to re-initialize, resetting event listeners, recalculating positions, etc. 2322 * @param {String} plugins - optional string of an individual plugin key, attained by calling `$(element).data('pluginName')`, or string of a plugin class i.e. `'dropdown'` 2323 * @default If no argument is passed, reflow all currently active plugins. 2324 */ 2325 reInit: function reInit(plugins) { 2326 var isJQ = plugins instanceof jquery__WEBPACK_IMPORTED_MODULE_0___default.a; 2327 2328 try { 2329 if (isJQ) { 2330 plugins.each(function () { 2331 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('zfPlugin')._init(); 2332 }); 2333 } else { 2334 var type = _typeof(plugins), 2335 _this = this, 2336 fns = { 2337 'object': function object(plgs) { 2338 plgs.forEach(function (p) { 2339 p = hyphenate(p); 2340 jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-' + p + ']').foundation('_init'); 2341 }); 2342 }, 2343 'string': function string() { 2344 plugins = hyphenate(plugins); 2345 jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-' + plugins + ']').foundation('_init'); 2346 }, 2347 'undefined': function undefined() { 2348 this.object(Object.keys(_this._plugins)); 2349 } 2350 }; 2351 2352 fns[type](plugins); 2353 } 2354 } catch (err) { 2355 console.error(err); 2356 } finally { 2357 return plugins; 2358 } 2359 }, 2360 2361 /** 2362 * Initialize plugins on any elements within `elem` (and `elem` itself) that aren't already initialized. 2363 * @param {Object} elem - jQuery object containing the element to check inside. Also checks the element itself, unless it's the `document` object. 2364 * @param {String|Array} plugins - A list of plugins to initialize. Leave this out to initialize everything. 2365 */ 2366 reflow: function reflow(elem, plugins) { 2367 // If plugins is undefined, just grab everything 2368 if (typeof plugins === 'undefined') { 2369 plugins = Object.keys(this._plugins); 2370 } // If plugins is a string, convert it to an array with one item 2371 else if (typeof plugins === 'string') { 2372 plugins = [plugins]; 2373 } 2374 2375 var _this = this; // Iterate through each plugin 2376 2377 2378 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(plugins, function (i, name) { 2379 // Get the current plugin 2380 var plugin = _this._plugins[name]; // Localize the search to all elements inside elem, as well as elem itself, unless elem === document 2381 2382 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(elem).find('[data-' + name + ']').addBack('[data-' + name + ']').filter(function () { 2383 return typeof jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data("zfPlugin") === 'undefined'; 2384 }); // For each plugin found, initialize it 2385 2386 $elem.each(function () { 2387 var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 2388 opts = { 2389 reflow: true 2390 }; 2391 2392 if ($el.attr('data-options')) { 2393 $el.attr('data-options').split(';').forEach(function (option) { 2394 var opt = option.split(':').map(function (el) { 2395 return el.trim(); 2396 }); 2397 if (opt[0]) opts[opt[0]] = parseValue(opt[1]); 2398 }); 2399 } 2400 2401 try { 2402 $el.data('zfPlugin', new plugin(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), opts)); 2403 } catch (er) { 2404 console.error(er); 2405 } finally { 2406 return; 2407 } 2408 }); 2409 }); 2410 }, 2411 getFnName: functionName, 2412 addToJquery: function addToJquery() { 2413 // TODO: consider not making this a jQuery function 2414 // TODO: need way to reflow vs. re-initialize 2415 2416 /** 2417 * The Foundation jQuery method. 2418 * @param {String|Array} method - An action to perform on the current jQuery object. 2419 */ 2420 var foundation = function foundation(method) { 2421 var type = _typeof(method), 2422 $noJS = jquery__WEBPACK_IMPORTED_MODULE_0___default()('.no-js'); 2423 2424 if ($noJS.length) { 2425 $noJS.removeClass('no-js'); 2426 } 2427 2428 if (type === 'undefined') { 2429 //needs to initialize the Foundation object, or an individual plugin. 2430 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"]._init(); 2431 2432 Foundation.reflow(this); 2433 } else if (type === 'string') { 2434 //an individual method to invoke on a plugin or group of plugins 2435 var args = Array.prototype.slice.call(arguments, 1); //collect all the arguments, if necessary 2436 2437 var plugClass = this.data('zfPlugin'); //determine the class of plugin 2438 2439 if (typeof plugClass !== 'undefined' && typeof plugClass[method] !== 'undefined') { 2440 //make sure both the class and method exist 2441 if (this.length === 1) { 2442 //if there's only one, call it directly. 2443 plugClass[method].apply(plugClass, args); 2444 } else { 2445 this.each(function (i, el) { 2446 //otherwise loop through the jQuery collection and invoke the method on each 2447 plugClass[method].apply(jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).data('zfPlugin'), args); 2448 }); 2449 } 2450 } else { 2451 //error for no class or no method 2452 throw new ReferenceError("We're sorry, '" + method + "' is not an available method for " + (plugClass ? functionName(plugClass) : 'this element') + '.'); 2453 } 2454 } else { 2455 //error for invalid argument type 2456 throw new TypeError("We're sorry, ".concat(type, " is not a valid parameter. You must use a string representing the method you wish to invoke.")); 2457 } 2458 2459 return this; 2460 }; 2461 2462 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.fn.foundation = foundation; 2463 return jquery__WEBPACK_IMPORTED_MODULE_0___default.a; 2464 } 2465}; 2466Foundation.util = { 2467 /** 2468 * Function for applying a debounce effect to a function call. 2469 * @function 2470 * @param {Function} func - Function to be called at end of timeout. 2471 * @param {Number} delay - Time in ms to delay the call of `func`. 2472 * @returns function 2473 */ 2474 throttle: function throttle(func, delay) { 2475 var timer = null; 2476 return function () { 2477 var context = this, 2478 args = arguments; 2479 2480 if (timer === null) { 2481 timer = setTimeout(function () {
vendor: 6,001 bytes, lines 2482-2668
2482 func.apply(context, args); 2483 timer = null; 2484 }, delay); 2485 } 2486 }; 2487 } 2488}; 2489window.Foundation = Foundation; // Polyfill for requestAnimationFrame 2490 2491(function () { 2492 if (!Date.now || !window.Date.now) window.Date.now = Date.now = function () { 2493 return new Date().getTime(); 2494 }; 2495 var vendors = ['webkit', 'moz']; 2496 2497 for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) { 2498 var vp = vendors[i]; 2499 window.requestAnimationFrame = window[vp + 'RequestAnimationFrame']; 2500 window.cancelAnimationFrame = window[vp + 'CancelAnimationFrame'] || window[vp + 'CancelRequestAnimationFrame']; 2501 } 2502 2503 if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !window.requestAnimationFrame || !window.cancelAnimationFrame) { 2504 var lastTime = 0; 2505 2506 window.requestAnimationFrame = function (callback) { 2507 var now = Date.now(); 2508 var nextTime = Math.max(lastTime + 16, now); 2509 return setTimeout(function () { 2510 callback(lastTime = nextTime); 2511 }, nextTime - now); 2512 }; 2513 2514 window.cancelAnimationFrame = clearTimeout; 2515 } 2516 /** 2517 * Polyfill for performance.now, required by rAF 2518 */ 2519 2520 2521 if (!window.performance || !window.performance.now) { 2522 window.performance = { 2523 start: Date.now(), 2524 now: function now() { 2525 return Date.now() - this.start; 2526 } 2527 }; 2528 } 2529})(); 2530 2531if (!Function.prototype.bind) { 2532 /* eslint-disable no-extend-native */ 2533 Function.prototype.bind = function (oThis) { 2534 if (typeof this !== 'function') { 2535 // closest thing possible to the ECMAScript 5 2536 // internal IsCallable function 2537 throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable'); 2538 } 2539 2540 var aArgs = Array.prototype.slice.call(arguments, 1), 2541 fToBind = this, 2542 fNOP = function fNOP() {}, 2543 fBound = function fBound() { 2544 return fToBind.apply(this instanceof fNOP ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments))); 2545 }; 2546 2547 if (this.prototype) { 2548 // native functions don't have a prototype 2549 fNOP.prototype = this.prototype; 2550 } 2551 2552 fBound.prototype = new fNOP(); 2553 return fBound; 2554 }; 2555} // Polyfill to get the name of a function in IE9 2556 2557 2558function functionName(fn) { 2559 if (typeof Function.prototype.name === 'undefined') { 2560 var funcNameRegex = /function\s([^(]{1,})\(/; 2561 var results = funcNameRegex.exec(fn.toString()); 2562 return results && results.length > 1 ? results[1].trim() : ""; 2563 } else if (typeof fn.prototype === 'undefined') { 2564 return fn.constructor.name; 2565 } else { 2566 return fn.prototype.constructor.name; 2567 } 2568} 2569 2570function parseValue(str) { 2571 if ('true' === str) return true;else if ('false' === str) return false;else if (!isNaN(str * 1)) return parseFloat(str); 2572 return str; 2573} // Convert PascalCase to kebab-case 2574// Thank you: http://stackoverflow.com/a/8955580 2575 2576 2577function hyphenate(str) { 2578 return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); 2579} 2580 2581 2582 2583/***/ }), 2584 2585/***/ "./js/foundation.core.plugin.js": 2586/*!**************************************!*\ 2587 !*** ./js/foundation.core.plugin.js ***! 2588 \**************************************/ 2589/*! exports provided: Plugin */ 2590/***/ (function(module, __webpack_exports__, __webpack_require__) { 2591 2592"use strict"; 2593__webpack_require__.r(__webpack_exports__); 2594/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Plugin", function() { return Plugin; }); 2595/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 2596function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 2597 2598function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 2599 2600function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 2601 2602 // Abstract class for providing lifecycle hooks. Expect plugins to define AT LEAST 2603// {function} _setup (replaces previous constructor), 2604// {function} _destroy (replaces previous destroy) 2605 2606var Plugin = /*#__PURE__*/function () { 2607 function Plugin(element, options) { 2608 _classCallCheck(this, Plugin); 2609 2610 this._setup(element, options); 2611 2612 var pluginName = getPluginName(this); 2613 this.uuid = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_0__["GetYoDigits"])(6, pluginName); 2614 2615 if (!this.$element.attr("data-".concat(pluginName))) { 2616 this.$element.attr("data-".concat(pluginName), this.uuid); 2617 } 2618 2619 if (!this.$element.data('zfPlugin')) { 2620 this.$element.data('zfPlugin', this); 2621 } 2622 /** 2623 * Fires when the plugin has initialized. 2624 * @event Plugin#init 2625 */ 2626 2627 2628 this.$element.trigger("init.zf.".concat(pluginName)); 2629 } 2630 2631 _createClass(Plugin, [{ 2632 key: "destroy", 2633 value: function destroy() { 2634 this._destroy(); 2635 2636 var pluginName = getPluginName(this); 2637 this.$element.removeAttr("data-".concat(pluginName)).removeData('zfPlugin') 2638 /** 2639 * Fires when the plugin has been destroyed. 2640 * @event Plugin#destroyed 2641 */ 2642 .trigger("destroyed.zf.".concat(pluginName)); 2643 2644 for (var prop in this) { 2645 if (this.hasOwnProperty(prop)) { 2646 this[prop] = null; //clean up script to prep for garbage collection. 2647 } 2648 } 2649 } 2650 }]); 2651 2652 return Plugin; 2653}(); // Convert PascalCase to kebab-case 2654// Thank you: http://stackoverflow.com/a/8955580 2655 2656 2657function hyphenate(str) { 2658 return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); 2659} 2660 2661function getPluginName(obj) { 2662 return hyphenate(obj.className); 2663} 2664 2665 2666 2667/***/ }), 2668
vendor: 7,163 bytes, lines 2669-2849
2669/***/ "./js/foundation.core.utils.js": 2670/*!*************************************!*\ 2671 !*** ./js/foundation.core.utils.js ***! 2672 \*************************************/ 2673/*! exports provided: rtl, GetYoDigits, RegExpEscape, transitionend, onLoad, ignoreMousedisappear */ 2674/***/ (function(module, __webpack_exports__, __webpack_require__) { 2675 2676"use strict"; 2677__webpack_require__.r(__webpack_exports__); 2678/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rtl", function() { return rtl; }); 2679/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GetYoDigits", function() { return GetYoDigits; }); 2680/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RegExpEscape", function() { return RegExpEscape; }); 2681/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transitionend", function() { return transitionend; }); 2682/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onLoad", function() { return onLoad; }); 2683/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreMousedisappear", function() { return ignoreMousedisappear; }); 2684/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 2685/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 2686 // Core Foundation Utilities, utilized in a number of places. 2687 2688/** 2689 * Returns a boolean for RTL support 2690 */ 2691 2692function rtl() { 2693 return jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').attr('dir') === 'rtl'; 2694} 2695/** 2696 * returns a random base-36 uid with namespacing 2697 * @function 2698 * @param {Number} length - number of random base-36 digits desired. Increase for more random strings. 2699 * @param {String} namespace - name of plugin to be incorporated in uid, optional. 2700 * @default {String} '' - if no plugin name is provided, nothing is appended to the uid. 2701 * @returns {String} - unique id 2702 */ 2703 2704 2705function GetYoDigits() { 2706 var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 6; 2707 var namespace = arguments.length > 1 ? arguments[1] : undefined; 2708 var str = ''; 2709 var chars = '0123456789abcdefghijklmnopqrstuvwxyz'; 2710 var charsLength = chars.length; 2711 2712 for (var i = 0; i < length; i++) { 2713 str += chars[Math.floor(Math.random() * charsLength)]; 2714 } 2715 2716 return namespace ? "".concat(str, "-").concat(namespace) : str; 2717} 2718/** 2719 * Escape a string so it can be used as a regexp pattern 2720 * @function 2721 * @see https://stackoverflow.com/a/9310752/4317384 2722 * 2723 * @param {String} str - string to escape. 2724 * @returns {String} - escaped string 2725 */ 2726 2727 2728function RegExpEscape(str) { 2729 return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); 2730} 2731 2732function transitionend($elem) { 2733 var transitions = { 2734 'transition': 'transitionend', 2735 'WebkitTransition': 'webkitTransitionEnd', 2736 'MozTransition': 'transitionend', 2737 'OTransition': 'otransitionend' 2738 }; 2739 var elem = document.createElement('div'), 2740 end; 2741 2742 for (var transition in transitions) { 2743 if (typeof elem.style[transition] !== 'undefined') { 2744 end = transitions[transition]; 2745 } 2746 } 2747 2748 if (end) { 2749 return end; 2750 } else { 2751 setTimeout(function () { 2752 $elem.triggerHandler('transitionend', [$elem]); 2753 }, 1); 2754 return 'transitionend'; 2755 } 2756} 2757/** 2758 * Return an event type to listen for window load. 2759 * 2760 * If `$elem` is passed, an event will be triggered on `$elem`. If window is already loaded, the event will still be triggered. 2761 * If `handler` is passed, attach it to the event on `$elem`. 2762 * Calling `onLoad` without handler allows you to get the event type that will be triggered before attaching the handler by yourself. 2763 * @function 2764 * 2765 * @param {Object} [] $elem - jQuery element on which the event will be triggered if passed. 2766 * @param {Function} [] handler - function to attach to the event. 2767 * @returns {String} - event type that should or will be triggered. 2768 */ 2769 2770 2771function onLoad($elem, handler) { 2772 var didLoad = document.readyState === 'complete'; 2773 var eventType = (didLoad ? '_didLoad' : 'load') + '.zf.util.onLoad'; 2774 2775 var cb = function cb() { 2776 return $elem.triggerHandler(eventType); 2777 }; 2778 2779 if ($elem) { 2780 if (handler) $elem.one(eventType, handler); 2781 if (didLoad) setTimeout(cb);else jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).one('load', cb); 2782 } 2783 2784 return eventType; 2785} 2786/** 2787 * Retuns an handler for the `mouseleave` that ignore disappeared mouses. 2788 * 2789 * If the mouse "disappeared" from the document (like when going on a browser UI element, See https://git.io/zf-11410), 2790 * the event is ignored. 2791 * - If the `ignoreLeaveWindow` is `true`, the event is ignored when the user actually left the window 2792 * (like by switching to an other window with [Alt]+[Tab]). 2793 * - If the `ignoreReappear` is `true`, the event will be ignored when the mouse will reappear later on the document 2794 * outside of the element it left. 2795 * 2796 * @function 2797 * 2798 * @param {Function} [] handler - handler for the filtered `mouseleave` event to watch. 2799 * @param {Object} [] options - object of options: 2800 * - {Boolean} [false] ignoreLeaveWindow - also ignore when the user switched windows. 2801 * - {Boolean} [false] ignoreReappear - also ignore when the mouse reappeared outside of the element it left. 2802 * @returns {Function} - filtered handler to use to listen on the `mouseleave` event. 2803 */ 2804 2805 2806function ignoreMousedisappear(handler) { 2807 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 2808 _ref$ignoreLeaveWindo = _ref.ignoreLeaveWindow, 2809 ignoreLeaveWindow = _ref$ignoreLeaveWindo === void 0 ? false : _ref$ignoreLeaveWindo, 2810 _ref$ignoreReappear = _ref.ignoreReappear, 2811 ignoreReappear = _ref$ignoreReappear === void 0 ? false : _ref$ignoreReappear; 2812 2813 return function leaveEventHandler(eLeave) { 2814 for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 2815 rest[_key - 1] = arguments[_key]; 2816 } 2817 2818 var callback = handler.bind.apply(handler, [this, eLeave].concat(rest)); // The mouse left: call the given callback if the mouse entered elsewhere 2819 2820 if (eLeave.relatedTarget !== null) { 2821 return callback(); 2822 } // Otherwise, check if the mouse actually left the window. 2823 // In firefox if the user switched between windows, the window sill have the focus by the time 2824 // the event is triggered. We have to debounce the event to test this case. 2825 2826 2827 setTimeout(function leaveEventDebouncer() { 2828 if (!ignoreLeaveWindow && document.hasFocus && !document.hasFocus()) { 2829 return callback(); 2830 } // Otherwise, wait for the mouse to reeapear outside of the element, 2831 2832 2833 if (!ignoreReappear) { 2834 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).one('mouseenter', function reenterEventHandler(eReenter) { 2835 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(eLeave.currentTarget).has(eReenter.target).length) { 2836 // Fill where the mouse finally entered. 2837 eLeave.relatedTarget = eReenter.target; 2838 callback(); 2839 } 2840 }); 2841 } 2842 }, 0); 2843 }; 2844} 2845 2846 2847 2848/***/ }), 2849
vendor: 4,368 bytes, lines 2850-2886
2850/***/ "./js/foundation.drilldown.js": 2851/*!************************************!*\ 2852 !*** ./js/foundation.drilldown.js ***! 2853 \************************************/ 2854/*! exports provided: Drilldown */ 2855/***/ (function(module, __webpack_exports__, __webpack_require__) { 2856 2857"use strict"; 2858__webpack_require__.r(__webpack_exports__); 2859/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Drilldown", function() { return Drilldown; }); 2860/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 2861/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 2862/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 2863/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.nest */ "./js/foundation.util.nest.js"); 2864/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 2865/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.box */ "./js/foundation.util.box.js"); 2866/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 2867function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 2868 2869function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 2870 2871function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 2872 2873function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 2874 2875function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 2876 2877function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 2878 2879function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 2880 2881function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 2882 2883function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 2884 2885function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 2886
vendor: 10,731 bytes, lines 2887-3194
2887function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 2888 2889 2890 2891 2892 2893 2894 2895/** 2896 * Drilldown module. 2897 * @module foundation.drilldown 2898 * @requires foundation.util.keyboard 2899 * @requires foundation.util.nest 2900 * @requires foundation.util.box 2901 */ 2902 2903var Drilldown = /*#__PURE__*/function (_Plugin) { 2904 _inherits(Drilldown, _Plugin); 2905 2906 var _super = _createSuper(Drilldown); 2907 2908 function Drilldown() { 2909 _classCallCheck(this, Drilldown); 2910 2911 return _super.apply(this, arguments); 2912 } 2913 2914 _createClass(Drilldown, [{ 2915 key: "_setup", 2916 value: 2917 /** 2918 * Creates a new instance of a drilldown menu. 2919 * @class 2920 * @name Drilldown 2921 * @param {jQuery} element - jQuery object to make into an accordion menu. 2922 * @param {Object} options - Overrides to the default plugin settings. 2923 */ 2924 function _setup(element, options) { 2925 this.$element = element; 2926 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Drilldown.defaults, this.$element.data(), options); 2927 this.className = 'Drilldown'; // ie9 back compat 2928 2929 this._init(); 2930 2931 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Drilldown', { 2932 'ENTER': 'open', 2933 'SPACE': 'open', 2934 'ARROW_RIGHT': 'next', 2935 'ARROW_UP': 'up', 2936 'ARROW_DOWN': 'down', 2937 'ARROW_LEFT': 'previous', 2938 'ESCAPE': 'close' 2939 }); 2940 } 2941 /** 2942 * Initializes the drilldown by creating jQuery collections of elements 2943 * @private 2944 */ 2945 2946 }, { 2947 key: "_init", 2948 value: function _init() { 2949 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Feather(this.$element, 'drilldown'); 2950 2951 if (this.options.autoApplyClass) { 2952 this.$element.addClass('drilldown'); 2953 } 2954 2955 this.$element.attr({ 2956 'aria-multiselectable': false 2957 }); 2958 this.$submenuAnchors = this.$element.find('li.is-drilldown-submenu-parent').children('a'); 2959 this.$submenus = this.$submenuAnchors.parent('li').children('[data-submenu]').attr('role', 'group'); 2960 this.$menuItems = this.$element.find('li').not('.js-drilldown-back').find('a'); // Set the main menu as current by default (unless a submenu is selected) 2961 // Used to set the wrapper height when the drilldown is closed/reopened from any (sub)menu 2962 2963 this.$currentMenu = this.$element; 2964 this.$element.attr('data-mutate', this.$element.attr('data-drilldown') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'drilldown')); 2965 2966 this._prepareMenu(); 2967 2968 this._registerEvents(); 2969 2970 this._keyboardEvents(); 2971 } 2972 /** 2973 * prepares drilldown menu by setting attributes to links and elements 2974 * sets a min height to prevent content jumping 2975 * wraps the element if not already wrapped 2976 * @private 2977 * @function 2978 */ 2979 2980 }, { 2981 key: "_prepareMenu", 2982 value: function _prepareMenu() { 2983 var _this = this; // if(!this.options.holdOpen){ 2984 // this._menuLinkEvents(); 2985 // } 2986 2987 2988 this.$submenuAnchors.each(function () { 2989 var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 2990 var $sub = $link.parent(); 2991 2992 if (_this.options.parentLink) { 2993 $link.clone().prependTo($sub.children('[data-submenu]')).wrap('<li data-is-parent-link class="is-submenu-parent-item is-submenu-item is-drilldown-submenu-item" role="none"></li>'); 2994 } 2995 2996 $link.data('savedHref', $link.attr('href')).removeAttr('href').attr('tabindex', 0); 2997 $link.children('[data-submenu]').attr({ 2998 'aria-hidden': true, 2999 'tabindex': 0, 3000 'role': 'group' 3001 }); 3002 3003 _this._events($link); 3004 }); 3005 this.$submenus.each(function () { 3006 var $menu = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 3007 $back = $menu.find('.js-drilldown-back'); 3008 3009 if (!$back.length) { 3010 switch (_this.options.backButtonPosition) { 3011 case "bottom": 3012 $menu.append(_this.options.backButton); 3013 break; 3014 3015 case "top": 3016 $menu.prepend(_this.options.backButton); 3017 break; 3018 3019 default: 3020 console.error("Unsupported backButtonPosition value '" + _this.options.backButtonPosition + "'"); 3021 } 3022 } 3023 3024 _this._back($menu); 3025 }); 3026 this.$submenus.addClass('invisible'); 3027 3028 if (!this.options.autoHeight) { 3029 this.$submenus.addClass('drilldown-submenu-cover-previous'); 3030 } // create a wrapper on element if it doesn't exist. 3031 3032 3033 if (!this.$element.parent().hasClass('is-drilldown')) { 3034 this.$wrapper = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.wrapper).addClass('is-drilldown'); 3035 if (this.options.animateHeight) this.$wrapper.addClass('animate-height'); 3036 this.$element.wrap(this.$wrapper); 3037 } // set wrapper 3038 3039 3040 this.$wrapper = this.$element.parent(); 3041 this.$wrapper.css(this._getMaxDims()); 3042 } 3043 }, { 3044 key: "_resize", 3045 value: function _resize() { 3046 this.$wrapper.css({ 3047 'max-width': 'none', 3048 'min-height': 'none' 3049 }); // _getMaxDims has side effects (boo) but calling it should update all other necessary heights & widths 3050 3051 this.$wrapper.css(this._getMaxDims()); 3052 } 3053 /** 3054 * Adds event handlers to elements in the menu. 3055 * @function 3056 * @private 3057 * @param {jQuery} $elem - the current menu item to add handlers to. 3058 */ 3059 3060 }, { 3061 key: "_events", 3062 value: function _events($elem) { 3063 var _this = this; 3064 3065 $elem.off('click.zf.drilldown').on('click.zf.drilldown', function (e) { 3066 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', 'li').hasClass('is-drilldown-submenu-parent')) { 3067 e.preventDefault(); 3068 } // if(e.target !== e.currentTarget.firstElementChild){ 3069 // return false; 3070 // } 3071 3072 3073 _this._show($elem.parent('li')); 3074 3075 if (_this.options.closeOnClick) { 3076 var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body'); 3077 $body.off('.zf.drilldown').on('click.zf.drilldown', function (ev) { 3078 if (ev.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(_this.$element[0], ev.target)) { 3079 return; 3080 } 3081 3082 ev.preventDefault(); 3083 3084 _this._hideAll(); 3085 3086 $body.off('.zf.drilldown'); 3087 }); 3088 } 3089 }); 3090 } 3091 /** 3092 * Adds event handlers to the menu element. 3093 * @function 3094 * @private 3095 */ 3096 3097 }, { 3098 key: "_registerEvents", 3099 value: function _registerEvents() { 3100 if (this.options.scrollTop) { 3101 this._bindHandler = this._scrollTop.bind(this); 3102 this.$element.on('open.zf.drilldown hide.zf.drilldown close.zf.drilldown closed.zf.drilldown', this._bindHandler); 3103 } 3104 3105 this.$element.on('mutateme.zf.trigger', this._resize.bind(this)); 3106 } 3107 /** 3108 * Scroll to Top of Element or data-scroll-top-element 3109 * @function 3110 * @fires Drilldown#scrollme 3111 */ 3112 3113 }, { 3114 key: "_scrollTop", 3115 value: function _scrollTop() { 3116 var _this = this; 3117 3118 var $scrollTopElement = _this.options.scrollTopElement !== '' ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this.options.scrollTopElement) : _this.$element, 3119 scrollPos = parseInt($scrollTopElement.offset().top + _this.options.scrollTopOffset, 10); 3120 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').stop(true).animate({ 3121 scrollTop: scrollPos 3122 }, _this.options.animationDuration, _this.options.animationEasing, function () { 3123 /** 3124 * Fires after the menu has scrolled 3125 * @event Drilldown#scrollme 3126 */ 3127 if (this === jquery__WEBPACK_IMPORTED_MODULE_0___default()('html')[0]) _this.$element.trigger('scrollme.zf.drilldown'); 3128 }); 3129 } 3130 /** 3131 * Adds keydown event listener to `li`'s in the menu. 3132 * @private 3133 */ 3134 3135 }, { 3136 key: "_keyboardEvents", 3137 value: function _keyboardEvents() { 3138 var _this = this; 3139 3140 this.$menuItems.add(this.$element.find('.js-drilldown-back > a, .is-submenu-parent-item > a')).on('keydown.zf.drilldown', function (e) { 3141 var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 3142 $elements = $element.parent('li').parent('ul').children('li').children('a'), 3143 $prevElement, 3144 $nextElement; 3145 $elements.each(function (i) { 3146 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) { 3147 $prevElement = $elements.eq(Math.max(0, i - 1)); 3148 $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)); 3149 return; 3150 } 3151 }); 3152 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Drilldown', { 3153 next: function next() { 3154 if ($element.is(_this.$submenuAnchors)) { 3155 _this._show($element.parent('li')); 3156 3157 $element.parent('li').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () { 3158 $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus(); 3159 }); 3160 return true; 3161 } 3162 }, 3163 previous: function previous() { 3164 _this._hide($element.parent('li').parent('ul')); 3165 3166 $element.parent('li').parent('ul').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () { 3167 setTimeout(function () { 3168 $element.parent('li').parent('ul').parent('li').children('a').first().focus(); 3169 }, 1); 3170 }); 3171 return true; 3172 }, 3173 up: function up() { 3174 $prevElement.focus(); // Don't tap focus on first element in root ul 3175 3176 return !$element.is(_this.$element.find('> li:first-child > a')); 3177 }, 3178 down: function down() { 3179 $nextElement.focus(); // Don't tap focus on last element in root ul 3180 3181 return !$element.is(_this.$element.find('> li:last-child > a')); 3182 }, 3183 close: function close() { 3184 // Don't close on element in root ul 3185 if (!$element.is(_this.$element.find('> li > a'))) { 3186 _this._hide($element.parent().parent()); 3187 3188 $element.parent().parent().siblings('a').focus(); 3189 } 3190 }, 3191 open: function open() { 3192 if (_this.options.parentLink && $element.attr('href')) { 3193 // Link with href 3194 return false;
vendor: 4,608 bytes, lines 3195-3341
3195 } else if (!$element.is(_this.$menuItems)) { 3196 // not menu item means back button 3197 _this._hide($element.parent('li').parent('ul')); 3198 3199 $element.parent('li').parent('ul').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () { 3200 setTimeout(function () { 3201 $element.parent('li').parent('ul').parent('li').children('a').first().focus(); 3202 }, 1); 3203 }); 3204 return true; 3205 } else if ($element.is(_this.$submenuAnchors)) { 3206 // Sub menu item 3207 _this._show($element.parent('li')); 3208 3209 $element.parent('li').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($element), function () { 3210 $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus(); 3211 }); 3212 return true; 3213 } 3214 }, 3215 handled: function handled(preventDefault) { 3216 if (preventDefault) { 3217 e.preventDefault(); 3218 } 3219 } 3220 }); 3221 }); // end keyboardAccess 3222 } 3223 /** 3224 * Closes all open elements, and returns to root menu. 3225 * @function 3226 * @fires Drilldown#close 3227 * @fires Drilldown#closed 3228 */ 3229 3230 }, { 3231 key: "_hideAll", 3232 value: function _hideAll() { 3233 var _this2 = this; 3234 3235 var $elem = this.$element.find('.is-drilldown-submenu.is-active'); 3236 $elem.addClass('is-closing'); 3237 3238 if (this.options.autoHeight) { 3239 var calcHeight = $elem.parent().closest('ul').data('calcHeight'); 3240 this.$wrapper.css({ 3241 height: calcHeight 3242 }); 3243 } 3244 /** 3245 * Fires when the menu is closing. 3246 * @event Drilldown#close 3247 */ 3248 3249 3250 this.$element.trigger('close.zf.drilldown'); 3251 $elem.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($elem), function () { 3252 $elem.removeClass('is-active is-closing'); 3253 /** 3254 * Fires when the menu is fully closed. 3255 * @event Drilldown#closed 3256 */ 3257 3258 _this2.$element.trigger('closed.zf.drilldown'); 3259 }); 3260 } 3261 /** 3262 * Adds event listener for each `back` button, and closes open menus. 3263 * @function 3264 * @fires Drilldown#back 3265 * @param {jQuery} $elem - the current sub-menu to add `back` event. 3266 */ 3267 3268 }, { 3269 key: "_back", 3270 value: function _back($elem) { 3271 var _this = this; 3272 3273 $elem.off('click.zf.drilldown'); 3274 $elem.children('.js-drilldown-back').on('click.zf.drilldown', function () { 3275 _this._hide($elem); // If there is a parent submenu, call show 3276 3277 3278 var parentSubMenu = $elem.parent('li').parent('ul').parent('li'); 3279 3280 if (parentSubMenu.length) { 3281 _this._show(parentSubMenu); 3282 } else { 3283 _this.$currentMenu = _this.$element; 3284 } 3285 }); 3286 } 3287 /** 3288 * Adds event listener to menu items w/o submenus to close open menus on click. 3289 * @function 3290 * @private 3291 */ 3292 3293 }, { 3294 key: "_menuLinkEvents", 3295 value: function _menuLinkEvents() { 3296 var _this = this; 3297 3298 this.$menuItems.not('.is-drilldown-submenu-parent').off('click.zf.drilldown').on('click.zf.drilldown', function () { 3299 setTimeout(function () { 3300 _this._hideAll(); 3301 }, 0); 3302 }); 3303 } 3304 /** 3305 * Sets the CSS classes for submenu to show it. 3306 * @function 3307 * @private 3308 * @param {jQuery} $elem - the target submenu (`ul` tag) 3309 * @param {boolean} trigger - trigger drilldown event 3310 */ 3311 3312 }, { 3313 key: "_setShowSubMenuClasses", 3314 value: function _setShowSubMenuClasses($elem, trigger) { 3315 $elem.addClass('is-active').removeClass('invisible').attr('aria-hidden', false); 3316 $elem.parent('li').attr('aria-expanded', true); 3317 3318 if (trigger === true) { 3319 this.$element.trigger('open.zf.drilldown', [$elem]); 3320 } 3321 } 3322 /** 3323 * Sets the CSS classes for submenu to hide it. 3324 * @function 3325 * @private 3326 * @param {jQuery} $elem - the target submenu (`ul` tag) 3327 * @param {boolean} trigger - trigger drilldown event 3328 */ 3329 3330 }, { 3331 key: "_setHideSubMenuClasses", 3332 value: function _setHideSubMenuClasses($elem, trigger) { 3333 $elem.removeClass('is-active').addClass('invisible').attr('aria-hidden', true); 3334 $elem.parent('li').attr('aria-expanded', false); 3335 3336 if (trigger === true) { 3337 $elem.trigger('hide.zf.drilldown', [$elem]); 3338 } 3339 } 3340 /** 3341 * Opens a specific drilldown (sub)menu no matter which (sub)menu in
vendor: 6,797 bytes, lines 3341-3512
3341it is currently visible. 3342 * Compared to _show() this lets you jump into any submenu without clicking through every submenu on the way to it. 3343 * @function 3344 * @fires Drilldown#open 3345 * @param {jQuery} $elem - the target (sub)menu (`ul` tag) 3346 * @param {boolean} autoFocus - if true the first link in the target (sub)menu gets auto focused 3347 */ 3348 3349 }, { 3350 key: "_showMenu", 3351 value: function _showMenu($elem, autoFocus) { 3352 var _this = this; // Reset drilldown 3353 3354 3355 var $expandedSubmenus = this.$element.find('li[aria-expanded="true"] > ul[data-submenu]'); 3356 $expandedSubmenus.each(function () { 3357 _this._setHideSubMenuClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 3358 }); // Save the menu as the currently displayed one. 3359 3360 this.$currentMenu = $elem; // If target menu is root, focus first link & exit 3361 3362 if ($elem.is('[data-drilldown]')) { 3363 if (autoFocus === true) $elem.find('li > a').first().focus(); 3364 if (this.options.autoHeight) this.$wrapper.css('height', $elem.data('calcHeight')); 3365 return; 3366 } // Find all submenus on way to root incl. the element itself 3367 3368 3369 var $submenus = $elem.children().first().parentsUntil('[data-drilldown]', '[data-submenu]'); // Open target menu and all submenus on its way to root 3370 3371 $submenus.each(function (index) { 3372 // Update height of first child (target menu) if autoHeight option true 3373 if (index === 0 && _this.options.autoHeight) { 3374 _this.$wrapper.css('height', jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('calcHeight')); 3375 } 3376 3377 var isLastChild = index === $submenus.length - 1; // Add transitionsend listener to last child (root due to reverse order) to open target menu's first link 3378 // Last child makes sure the event gets always triggered even if going through several menus 3379 3380 if (isLastChild === true) { 3381 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)), function () { 3382 if (autoFocus === true) { 3383 $elem.find('li > a').first().focus(); 3384 } 3385 }); 3386 } 3387 3388 _this._setShowSubMenuClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), isLastChild); 3389 }); 3390 } 3391 /** 3392 * Opens a submenu. 3393 * @function 3394 * @fires Drilldown#open 3395 * @param {jQuery} $elem - the current element with a submenu to open, i.e. the `li` tag. 3396 */ 3397 3398 }, { 3399 key: "_show", 3400 value: function _show($elem) { 3401 var $submenu = $elem.children('[data-submenu]'); 3402 $elem.attr('aria-expanded', true); 3403 this.$currentMenu = $submenu; //hide drilldown parent menu when submenu is open 3404 // this removes it from the dom so that the tab key will take the user to the next visible element 3405 3406 $elem.parent().closest('ul').addClass('invisible'); // add visible class to submenu to override invisible class above 3407 3408 $submenu.addClass('is-active visible').removeClass('invisible').attr('aria-hidden', false); 3409 3410 if (this.options.autoHeight) { 3411 this.$wrapper.css({ 3412 height: $submenu.data('calcHeight') 3413 }); 3414 } 3415 /** 3416 * Fires when the submenu has opened. 3417 * @event Drilldown#open 3418 */ 3419 3420 3421 this.$element.trigger('open.zf.drilldown', [$elem]); 3422 } 3423 /** 3424 * Hides a submenu 3425 * @function 3426 * @fires Drilldown#hide 3427 * @param {jQuery} $elem - the current sub-menu to hide, i.e. the `ul` tag. 3428 */ 3429 3430 }, { 3431 key: "_hide", 3432 value: function _hide($elem) { 3433 if (this.options.autoHeight) this.$wrapper.css({ 3434 height: $elem.parent().closest('ul').data('calcHeight') 3435 }); 3436 $elem.parent().closest('ul').removeClass('invisible'); 3437 $elem.parent('li').attr('aria-expanded', false); 3438 $elem.attr('aria-hidden', true); 3439 $elem.addClass('is-closing').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["transitionend"])($elem), function () { 3440 $elem.removeClass('is-active is-closing visible'); 3441 $elem.blur().addClass('invisible'); 3442 }); 3443 /** 3444 * Fires when the submenu has closed. 3445 * @event Drilldown#hide 3446 */ 3447 3448 $elem.trigger('hide.zf.drilldown', [$elem]); 3449 } 3450 /** 3451 * Iterates through the nested menus to calculate the min-height, and max-width for the menu. 3452 * Prevents content jumping. 3453 * @function 3454 * @private 3455 */ 3456 3457 }, { 3458 key: "_getMaxDims", 3459 value: function _getMaxDims() { 3460 var maxHeight = 0, 3461 result = {}, 3462 _this = this; // Recalculate menu heights and total max height 3463 3464 3465 this.$submenus.add(this.$element).each(function () { 3466 var height = _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__["Box"].GetDimensions(this).height; 3467 maxHeight = height > maxHeight ? height : maxHeight; 3468 3469 if (_this.options.autoHeight) { 3470 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('calcHeight', height); 3471 } 3472 }); 3473 if (this.options.autoHeight) result.height = this.$currentMenu.data('calcHeight');else result['min-height'] = "".concat(maxHeight, "px"); 3474 result['max-width'] = "".concat(this.$element[0].getBoundingClientRect().width, "px"); 3475 return result; 3476 } 3477 /** 3478 * Destroys the Drilldown Menu 3479 * @function 3480 */ 3481 3482 }, { 3483 key: "_destroy", 3484 value: function _destroy() { 3485 jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').off('.zf.drilldown'); 3486 if (this.options.scrollTop) this.$element.off('.zf.drilldown', this._bindHandler); 3487 3488 this._hideAll(); 3489 3490 this.$element.off('mutateme.zf.trigger'); 3491 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__["Nest"].Burn(this.$element, 'drilldown'); 3492 this.$element.unwrap().find('.js-drilldown-back, .is-submenu-parent-item').remove().end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu').off('transitionend otransitionend webkitTransitionEnd').end().find('[data-submenu]').removeAttr('aria-hidden tabindex role'); 3493 this.$submenuAnchors.each(function () { 3494 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).off('.zf.drilldown'); 3495 }); 3496 this.$element.find('[data-is-parent-link]').detach(); 3497 this.$submenus.removeClass('drilldown-submenu-cover-previous invisible'); 3498 this.$element.find('a').each(function () { 3499 var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 3500 $link.removeAttr('tabindex'); 3501 3502 if ($link.data('savedHref')) { 3503 $link.attr('href', $link.data('savedHref')).removeData('savedHref'); 3504 } else { 3505 return; 3506 } 3507 }); 3508 } 3509 }]); 3510 3511 return Drilldown; 3512}
3512(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_5__["Plugin"]); 3513 3514Drilldown.defaults = { 3515 /** 3516 * Drilldowns depend on styles in order to function properly; in the default build of Foundation these are 3517 * on the `drilldown` class. This option auto-applies this class to the drilldown upon initialization. 3518 * @option 3519 * @type {boolean} 3520 * @default true 3521 */ 3522 autoApplyClass: true, 3523 3524 /** 3525 * Markup used for JS generated back button. Prepended or appended (see backButtonPosition) to submenu lists and deleted on `destroy` method, 'js-drilldown-back' class required. Remove the backslash (`\`) if copy and pasting. 3526 * @option 3527 * @type {string} 3528 * @default '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>' 3529 */ 3530 backButton: '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>', 3531 3532 /** 3533 * Position the back button either at the top or bottom of drilldown submenus. Can be `'left'` or `'bottom'`. 3534 * @option 3535 * @type {string} 3536 * @default top 3537 */ 3538 backButtonPosition: 'top', 3539 3540 /** 3541 * Markup used to wrap drilldown menu. Use a class name for independent styling; the JS applied class: `is-drilldown` is required. Remove the backslash (`\`) if copy and pasting. 3542 * @option 3543 * @type {string} 3544 * @default '<div></div>' 3545 */ 3546 wrapper: '<div></div>', 3547 3548 /** 3549 * Adds the parent link to the submenu. 3550 * @option 3551 * @type {boolean} 3552 * @default false 3553 */ 3554 parentLink: false, 3555 3556 /** 3557 * Allow the menu to return to root list on body click. 3558 * @option 3559 * @type {boolean} 3560 * @default false 3561 */ 3562 closeOnClick: false, 3563 3564 /** 3565 * Allow the menu to auto adjust height. 3566 * @option 3567 * @type {boolean} 3568 * @default false 3569 */ 3570 autoHeight: false, 3571 3572 /** 3573 * Animate the auto adjust height. 3574 * @option 3575 * @type {boolean} 3576 * @default false 3577 */ 3578 animateHeight: false, 3579 3580 /** 3581 * Scroll to the top of the menu after opening a submenu or navigating back using the menu back button 3582 * @option 3583 * @type {boolean} 3584 * @default false 3585 */ 3586 scrollTop: false, 3587 3588 /** 3589 * String jquery selector (for example 'body') of element to take offset().top from, if empty string the drilldown menu offset().top is taken 3590 * @option 3591 * @type {string} 3592 * @default '' 3593 */ 3594 scrollTopElement: '', 3595 3596 /** 3597 * ScrollTop offset 3598 * @option 3599 * @type {number} 3600 * @default 0 3601 */ 3602 scrollTopOffset: 0, 3603 3604 /** 3605 * Scroll animation duration 3606 * @option 3607 * @type {number} 3608 * @default 500 3609 */ 3610 animationDuration: 500, 3611 3612 /** 3613 * Scroll animation easing. Can be `'swing'` or `'linear'`. 3614 * @option 3615 * @type {string} 3616 * @see {@link https://api.jquery.com/animate|JQuery animate} 3617 * @default 'swing' 3618 */ 3619 animationEasing: 'swing' // holdOpen: false 3620 3621}; 3622 3623 3624/***/ }), 3625
vendor: 5,003 bytes, lines 3626-3666
3626/***/ "./js/foundation.dropdown.js": 3627/*!***********************************!*\ 3628 !*** ./js/foundation.dropdown.js ***! 3629 \***********************************/ 3630/*! exports provided: Dropdown */ 3631/***/ (function(module, __webpack_exports__, __webpack_require__) { 3632 3633"use strict"; 3634__webpack_require__.r(__webpack_exports__); 3635/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return Dropdown; }); 3636/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 3637/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 3638/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 3639/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 3640/* harmony import */ var _foundation_positionable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.positionable */ "./js/foundation.positionable.js"); 3641/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 3642/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js"); 3643function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 3644 3645function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 3646 3647function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 3648 3649function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 3650 3651function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } 3652 3653function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 3654 3655function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 3656 3657function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 3658 3659function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 3660 3661function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 3662 3663function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 3664 3665function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 3666
3667function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 3668 3669 3670 3671 3672 3673 3674 3675/** 3676 * Dropdown module. 3677 * @module foundation.dropdown 3678 * @requires foundation.util.keyboard 3679 * @requires foundation.util.box 3680 * @requires foundation.util.touch 3681 * @requires foundation.util.triggers 3682 */ 3683 3684var Dropdown = /*#__PURE__*/function (_Positionable) { 3685 _inherits(Dropdown, _Positionable); 3686 3687 var _super = _createSuper(Dropdown); 3688 3689 function Dropdown() { 3690 _classCallCheck(this, Dropdown); 3691 3692 return _super.apply(this, arguments); 3693 } 3694 3695 _createClass(Dropdown, [{ 3696 key: "_setup", 3697 value: 3698 /** 3699 * Creates a new instance of a dropdown. 3700 * @class 3701 * @name Dropdown 3702 * @param {jQuery} element - jQuery object to make into a dropdown. 3703 * Object should be of the dropdown panel, rather than its anchor. 3704 * @param {Object} options - Overrides to the default plugin settings. 3705 */ 3706 function _setup(element, options) { 3707 this.$element = element; 3708 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Dropdown.defaults, this.$element.data(), options); 3709 this.className = 'Dropdown'; // ie9 back compat 3710 // Touch and Triggers init are idempotent, just need to make sure they are initialized 3711 3712 _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 3713 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 3714 3715 this._init(); 3716 3717 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Dropdown', { 3718 'ENTER': 'toggle', 3719 'SPACE': 'toggle', 3720 'ESCAPE': 'close' 3721 }); 3722 } 3723 /** 3724 * Initializes the plugin by setting/checking options and attributes, adding helper variables, and saving the anchor. 3725 * @function 3726 * @private 3727 */ 3728 3729 }, { 3730 key: "_init", 3731 value: function _init() { 3732 var $id = this.$element.attr('id'); 3733 this.$anchors = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-toggle=\"".concat($id, "\"]")).length ? jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-toggle=\"".concat($id, "\"]")) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat($id, "\"]")); 3734 this.$anchors.attr({ 3735 'aria-controls': $id, 3736 'data-is-focus': false, 3737 'data-yeti-box': $id, 3738 'aria-haspopup': true, 3739 'aria-expanded': false 3740 }); 3741 3742 this._setCurrentAnchor(this.$anchors.first()); 3743 3744 if (this.options.parentClass) { 3745 this.$parent = this.$element.parents('.' + this.options.parentClass); 3746 } else { 3747 this.$parent = null; 3748 } // Set [aria-labelledby] on the Dropdown if it is not set 3749 3750 3751 if (typeof this.$element.attr('aria-labelledby') === 'undefined') { 3752 // Get the anchor ID or create one 3753 if (typeof this.$currentAnchor.attr('id') === 'undefined') { 3754 this.$currentAnchor.attr('id', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'dd-anchor')); 3755 } 3756 3757 this.$element.attr('aria-labelledby', this.$currentAnchor.attr('id')); 3758 } 3759 3760 this.$element.attr({ 3761 'aria-hidden': 'true', 3762 'data-yeti-box': $id, 3763 'data-resize': $id 3764 }); 3765 3766 _get(_getPrototypeOf(Dropdown.prototype), "_init", this).call(this); 3767 3768 this._events(); 3769 } 3770 }, { 3771 key: "_getDefaultPosition", 3772 value: function _getDefaultPosition() { 3773 // handle legacy classnames 3774 var position = this.$element[0].className.match(/(top|left|right|bottom)/g); 3775 3776 if (position) { 3777 return position[0]; 3778 } else { 3779 return 'bottom'; 3780 } 3781 } 3782 }, { 3783 key: "_getDefaultAlignment", 3784 value: function _getDefaultAlignment() { 3785 // handle legacy float approach 3786 var horizontalPosition = /float-(\S+)/.exec(this.$currentAnchor.attr('class')); 3787 3788 if (horizontalPosition) { 3789 return horizontalPosition[1]; 3790 } 3791 3792 return _get(_getPrototypeOf(Dropdown.prototype), "_getDefaultAlignment", this).call(this); 3793 } 3794 /** 3795 * Sets the position and orientation of the dropdown pane, checks for c
vendor: 5,870 bytes, lines 3795-3964
3795ollisions if allow-overlap is not true. 3796 * Recursively calls itself if a collision is detected, with a new position class. 3797 * @function 3798 * @private 3799 */ 3800 3801 }, { 3802 key: "_setPosition", 3803 value: function _setPosition() { 3804 this.$element.removeClass("has-position-".concat(this.position, " has-alignment-").concat(this.alignment)); 3805 3806 _get(_getPrototypeOf(Dropdown.prototype), "_setPosition", this).call(this, this.$currentAnchor, this.$element, this.$parent); 3807 3808 this.$element.addClass("has-position-".concat(this.position, " has-alignment-").concat(this.alignment)); 3809 } 3810 /** 3811 * Make it a current anchor. 3812 * Current anchor as the reference for the position of Dropdown panes. 3813 * @param {HTML} el - DOM element of the anchor. 3814 * @function 3815 * @private 3816 */ 3817 3818 }, { 3819 key: "_setCurrentAnchor", 3820 value: function _setCurrentAnchor(el) { 3821 this.$currentAnchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el); 3822 } 3823 /** 3824 * Adds event listeners to the element utilizing the triggers utility library. 3825 * @function 3826 * @private 3827 */ 3828 3829 }, { 3830 key: "_events", 3831 value: function _events() { 3832 var _this = this, 3833 hasTouch = 'ontouchstart' in window || typeof window.ontouchstart !== 'undefined'; 3834 3835 this.$element.on({ 3836 'open.zf.trigger': this.open.bind(this), 3837 'close.zf.trigger': this.close.bind(this), 3838 'toggle.zf.trigger': this.toggle.bind(this), 3839 'resizeme.zf.trigger': this._setPosition.bind(this) 3840 }); 3841 this.$anchors.off('click.zf.trigger').on('click.zf.trigger', function (e) { 3842 _this._setCurrentAnchor(this); 3843 3844 if ( // if forceFollow false, always prevent default action 3845 _this.options.forceFollow === false || // if forceFollow true and hover option true, only prevent default action on 1st click 3846 // on 2nd click (dropown opened) the default action (e.g. follow a href) gets executed 3847 hasTouch && _this.options.hover && _this.$element.hasClass('is-open') === false) { 3848 e.preventDefault(); 3849 } 3850 }); 3851 3852 if (this.options.hover) { 3853 this.$anchors.off('mouseenter.zf.dropdown mouseleave.zf.dropdown').on('mouseenter.zf.dropdown', function () { 3854 _this._setCurrentAnchor(this); 3855 3856 var bodyData = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').data(); 3857 3858 if (typeof bodyData.whatinput === 'undefined' || bodyData.whatinput === 'mouse') { 3859 clearTimeout(_this.timeout); 3860 _this.timeout = setTimeout(function () { 3861 _this.open(); 3862 3863 _this.$anchors.data('hover', true); 3864 }, _this.options.hoverDelay); 3865 } 3866 }).on('mouseleave.zf.dropdown', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["ignoreMousedisappear"])(function () { 3867 clearTimeout(_this.timeout); 3868 _this.timeout = setTimeout(function () { 3869 _this.close(); 3870 3871 _this.$anchors.data('hover', false); 3872 }, _this.options.hoverDelay); 3873 })); 3874 3875 if (this.options.hoverPane) { 3876 this.$element.off('mouseenter.zf.dropdown mouseleave.zf.dropdown').on('mouseenter.zf.dropdown', function () { 3877 clearTimeout(_this.timeout); 3878 }).on('mouseleave.zf.dropdown', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["ignoreMousedisappear"])(function () { 3879 clearTimeout(_this.timeout); 3880 _this.timeout = setTimeout(function () { 3881 _this.close(); 3882 3883 _this.$anchors.data('hover', false); 3884 }, _this.options.hoverDelay); 3885 })); 3886 } 3887 } 3888 3889 this.$anchors.add(this.$element).on('keydown.zf.dropdown', function (e) { 3890 var $target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 3891 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Dropdown', { 3892 open: function open() { 3893 if ($target.is(_this.$anchors) && !$target.is('input, textarea')) { 3894 _this.open(); 3895 3896 _this.$element.attr('tabindex', -1).focus(); 3897 3898 e.preventDefault(); 3899 } 3900 }, 3901 close: function close() { 3902 _this.close(); 3903 3904 _this.$anchors.focus(); 3905 } 3906 }); 3907 }); 3908 } 3909 /** 3910 * Adds an event handler to the body to close any dropdowns on a click. 3911 * @function 3912 * @private 3913 */ 3914 3915 }, { 3916 key: "_addBodyHandler", 3917 value: function _addBodyHandler() { 3918 var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).not(this.$element), 3919 _this = this; 3920 3921 $body.off('click.zf.dropdown tap.zf.dropdown').on('click.zf.dropdown tap.zf.dropdown', function (e) { 3922 if (_this.$anchors.is(e.target) || _this.$anchors.find(e.target).length) { 3923 return; 3924 } 3925 3926 if (_this.$element.is(e.target) || _this.$element.find(e.target).length) { 3927 return; 3928 } 3929 3930 _this.close(); 3931 3932 $body.off('click.zf.dropdown tap.zf.dropdown'); 3933 }); 3934 } 3935 /** 3936 * Opens the dropdown pane, and fires a bubbling event to close other dropdowns. 3937 * @function 3938 * @fires Dropdown#closeme 3939 * @fires Dropdown#show 3940 */ 3941 3942 }, { 3943 key: "open", 3944 value: function open() { 3945 // var _this = this; 3946 3947 /** 3948 * Fires to close other open dropdowns, typically when dropdown is opening 3949 * @event Dropdown#closeme 3950 */ 3951 this.$element.trigger('closeme.zf.dropdown', this.$element.attr('id')); 3952 this.$anchors.addClass('hover').attr({ 3953 'aria-expanded': true 3954 }); // this.$element/*.show()*/; 3955 3956 this.$element.addClass('is-opening'); 3957 3958 this._setPosition(); 3959 3960 this.$element.removeClass('is-opening').addClass('is-open').attr({ 3961 'aria-hidden': false 3962 }); 3963 3964 if (this.options.autoFocus) {
vendor: 4,783 bytes, lines 3965-4165
3965 var $focusable = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].findFocusable(this.$element); 3966 3967 if ($focusable.length) { 3968 $focusable.eq(0).focus(); 3969 } 3970 } 3971 3972 if (this.options.closeOnClick) { 3973 this._addBodyHandler(); 3974 } 3975 3976 if (this.options.trapFocus) { 3977 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].trapFocus(this.$element); 3978 } 3979 /** 3980 * Fires once the dropdown is visible. 3981 * @event Dropdown#show 3982 */ 3983 3984 3985 this.$element.trigger('show.zf.dropdown', [this.$element]); 3986 } 3987 /** 3988 * Closes the open dropdown pane. 3989 * @function 3990 * @fires Dropdown#hide 3991 */ 3992 3993 }, { 3994 key: "close", 3995 value: function close() { 3996 if (!this.$element.hasClass('is-open')) { 3997 return false; 3998 } 3999 4000 this.$element.removeClass('is-open').attr({ 4001 'aria-hidden': true 4002 }); 4003 this.$anchors.removeClass('hover').attr('aria-expanded', false); 4004 /** 4005 * Fires once the dropdown is no longer visible. 4006 * @event Dropdown#hide 4007 */ 4008 4009 this.$element.trigger('hide.zf.dropdown', [this.$element]); 4010 4011 if (this.options.trapFocus) { 4012 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].releaseFocus(this.$element); 4013 } 4014 } 4015 /** 4016 * Toggles the dropdown pane's visibility. 4017 * @function 4018 */ 4019 4020 }, { 4021 key: "toggle", 4022 value: function toggle() { 4023 if (this.$element.hasClass('is-open')) { 4024 if (this.$anchors.data('hover')) return; 4025 this.close(); 4026 } else { 4027 this.open(); 4028 } 4029 } 4030 /** 4031 * Destroys the dropdown. 4032 * @function 4033 */ 4034 4035 }, { 4036 key: "_destroy", 4037 value: function _destroy() { 4038 this.$element.off('.zf.trigger').hide(); 4039 this.$anchors.off('.zf.dropdown'); 4040 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).off('click.zf.dropdown tap.zf.dropdown'); 4041 } 4042 }]); 4043 4044 return Dropdown; 4045}(_foundation_positionable__WEBPACK_IMPORTED_MODULE_3__["Positionable"]); 4046 4047Dropdown.defaults = { 4048 /** 4049 * Class that designates bounding container of Dropdown (default: window) 4050 * @option 4051 * @type {?string} 4052 * @default null 4053 */ 4054 parentClass: null, 4055 4056 /** 4057 * Amount of time to delay opening a submenu on hover event. 4058 * @option 4059 * @type {number} 4060 * @default 250 4061 */ 4062 hoverDelay: 250, 4063 4064 /** 4065 * Allow submenus to open on hover events 4066 * @option 4067 * @type {boolean} 4068 * @default false 4069 */ 4070 hover: false, 4071 4072 /** 4073 * Don't close dropdown when hovering over dropdown pane 4074 * @option 4075 * @type {boolean} 4076 * @default false 4077 */ 4078 hoverPane: false, 4079 4080 /** 4081 * Number of pixels between the dropdown pane and the triggering element on open. 4082 * @option 4083 * @type {number} 4084 * @default 0 4085 */ 4086 vOffset: 0, 4087 4088 /** 4089 * Number of pixels between the dropdown pane and the triggering element on open. 4090 * @option 4091 * @type {number} 4092 * @default 0 4093 */ 4094 hOffset: 0, 4095 4096 /** 4097 * Position of dropdown. Can be left, right, bottom, top, or auto. 4098 * @option 4099 * @type {string} 4100 * @default 'auto' 4101 */ 4102 position: 'auto', 4103 4104 /** 4105 * Alignment of dropdown relative to anchor. Can be left, right, bottom, top, center, or auto. 4106 * @option 4107 * @type {string} 4108 * @default 'auto' 4109 */ 4110 alignment: 'auto', 4111 4112 /** 4113 * Allow overlap of container/window. If false, dropdown will first try to position as defined by data-position and data-alignment, but reposition if it would cause an overflow. 4114 * @option 4115 * @type {boolean} 4116 * @default false 4117 */ 4118 allowOverlap: false, 4119 4120 /** 4121 * Allow overlap of only the bottom of the container. This is the most common 4122 * behavior for dropdowns, allowing the dropdown to extend the bottom of the 4123 * screen but not otherwise influence or break out of the container. 4124 * @option 4125 * @type {boolean} 4126 * @default true 4127 */ 4128 allowBottomOverlap: true, 4129 4130 /** 4131 * Allow the plugin to trap focus to the dropdown pane if opened with keyboard commands. 4132 * @option 4133 * @type {boolean} 4134 * @default false 4135 */ 4136 trapFocus: false, 4137 4138 /** 4139 * Allow the plugin to set focus to the first focusable element within the pane, regardless of method of opening. 4140 * @option 4141 * @type {boolean} 4142 * @default false 4143 */ 4144 autoFocus: false, 4145 4146 /** 4147 * Allows a click on the body to close the dropdown. 4148 * @option 4149 * @type {boolean} 4150 * @default false 4151 */ 4152 closeOnClick: false, 4153 4154 /** 4155 * If true the default action of the toggle (e.g. follow a link with href) gets executed on click. If hover option is also true the default action gets prevented on first click for mobile / touch devices and executed on second click. 4156 * @option 4157 * @type {boolean} 4158 * @default true 4159 */ 4160 forceFollow: true 4161}; 4162 4163 4164/***/ }), 4165
vendor: 4,553 bytes, lines 4166-4203
4166/***/ "./js/foundation.dropdownMenu.js": 4167/*!***************************************!*\ 4168 !*** ./js/foundation.dropdownMenu.js ***! 4169 \***************************************/ 4170/*! exports provided: DropdownMenu */ 4171/***/ (function(module, __webpack_exports__, __webpack_require__) { 4172 4173"use strict"; 4174__webpack_require__.r(__webpack_exports__); 4175/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return DropdownMenu; }); 4176/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 4177/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 4178/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 4179/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 4180/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 4181/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.nest */ "./js/foundation.util.nest.js"); 4182/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.box */ "./js/foundation.util.box.js"); 4183/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js"); 4184function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 4185 4186function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 4187 4188function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 4189 4190function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 4191 4192function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 4193 4194function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 4195 4196function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 4197 4198function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 4199 4200function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 4201 4202function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 4203
4204function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 4205 4206 4207 4208 4209 4210 4211 4212 4213/** 4214 * DropdownMenu module. 4215 * @module foundation.dropdownMenu 4216 * @requires foundation.util.keyboard 4217 * @requires foundation.util.box 4218 * @requires foundation.util.nest 4219 * @requires foundation.util.touch 4220 */ 4221 4222var DropdownMenu = /*#__PURE__*/function (_Plugin) { 4223 _inherits(DropdownMenu, _Plugin); 4224 4225 var _super = _createSuper(DropdownMenu); 4226 4227 function DropdownMenu() { 4228 _classCallCheck(this, DropdownMenu); 4229 4230 return _super.apply(this, arguments); 4231 } 4232 4233 _createClass(DropdownMenu, [{ 4234 key: "_setup", 4235 value: 4236 /** 4237 * Creates a new instance of DropdownMenu. 4238 * @class 4239 * @name DropdownMenu 4240 * @fires DropdownMenu#init 4241 * @param {jQuery} element - jQuery object to make into a dropdown menu. 4242 * @param {Object} options - Overrides to the default plugin settings. 4243 */ 4244 function _setup(element, options) { 4245 this.$element = element; 4246 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, DropdownMenu.defaults, this.$element.data(), options); 4247 this.className = 'DropdownMenu'; // ie9 back compat 4248 4249 _foundation_util_touch__WEBPACK_IMPORTED_MODULE_6__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); // Touch init is idempotent, we just need to make sure it's initialied. 4250 4251 this._init(); 4252 4253 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('DropdownMenu', { 4254 'ENTER': 'open', 4255 'SPACE': 'open', 4256 'ARROW_RIGHT': 'next', 4257 'ARROW_UP': 'up', 4258 'ARROW_DOWN': 'down', 4259 'ARROW_LEFT': 'previous', 4260 'ESCAPE': 'close' 4261 }); 4262 } 4263 /** 4264 * Initializes the plugin, and calls _prepareMenu 4265 * @private 4266 * @function 4267 */ 4268 4269 }, { 4270 key: "_init", 4271 value: function _init() { 4272 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_4__["Nest"].Feather(this.$element, 'dropdown'); 4273 var subs = this.$element.find('li.is-dropdown-submenu-parent'); 4274 this.$element.children('.is-dropdown-submenu-parent').children('.is-dropdown-submenu').addClass('first-sub'); 4275 this.$menuItems = this.$element.find('li[role="none"]'); 4276 this.$tabs = this.$element.children('li[role="none"]'); 4277 this.$tabs.find('ul.is-dropdown-submenu').addClass(this.options.verticalClass); 4278 4279 if (this.options.alignment === 'auto') { 4280 if (this.$element.hasClass(this.options.rightClass) || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"])() || this.$element.parents('.top-bar-right').is('*')) { 4281 this.options.alignment = 'right'; 4282 subs.addClass('opens-left'); 4283 } else { 4284 this.options.alignment = 'left'; 4285 subs.addClass('opens-right'); 4286 } 4287 } else { 4288 if (this.options.alignment === 'right') { 4289 subs.addClass('opens-left'); 4290 } else { 4291 subs.addClass('opens-right'); 4292 } 4293 } 4294 4295 this.changed = false; 4296 4297 this._events(); 4298 } 4299 }, { 4300 key: "_isVertical", 4301 value: function _isVertical() { 4302 return this.$tabs.css('display') === 'block' || this.$element.css('flex-direction') === 'column'; 4303 } 4304 }, { 4305 key: "_isRtl", 4306 value: function _isRtl() { 4307 return this.$element.hasClass('align-right') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"])() && !this.$element.hasClass('align-left'); 4308 } 4309 /** 4310 * Adds event listeners to elements within the menu 4311 * @private 4312 * @function 4313 */ 4314 4315 }, { 4316 key: "_events", 4317 value: function _events() { 4318 var _this = this, 4319 hasTouch = 'ontouchstart' in window || typeof window.ontouchstart !== 'undefined', 4320 parClass = 'is-dropdown-submenu-parent'; // used for onClick and in the keyboard handlers 4321 4322 4323 var handleClickFn = function handleClickFn(e) { 4324 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', ".".concat(parClass)), 4325 hasSub = $elem.hasClass(parClass), 4326 hasClicked = $elem.attr('data-is-click') === 'true', 4327 $sub = $elem.children('.is-dropdown-submenu'); 4328 4329 if (hasSub) { 4330 if (hasClicked) { 4331 if (!_this.options.closeOnClick || !_this.options.clickOpen && !hasTouch || _this.options.forceFollow && hasTouch) { 4332 return; 4333 } 4334 4335 e.stopImmediatePropagation(); 4336 e.preventDefault(); 4337 4338 _this._hide($elem); 4339 } else { 4340 e.stopImmediatePropagation(); 4341 e.preventDefault(); 4342 4343 _this._show($sub); 4344 4345 $elem.add($elem.parentsUntil(_this.$element, ".".concat(parClass))).attr('data-is-click', true); 4346 } 4347 } 4348 }; 4349 4350 if (this.options.clickOpen || hasTouch) { 4351 this.$menuItems.on('click.zf.dropdownMenu touchstart.zf.dropdownMenu', handleClick
vendor: 12,315 bytes, lines 4351-4756
4351Fn); 4352 } // Handle Leaf element Clicks 4353 4354 4355 if (_this.options.closeOnClickInside) { 4356 this.$menuItems.on('click.zf.dropdownMenu', function () { 4357 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 4358 hasSub = $elem.hasClass(parClass); 4359 4360 if (!hasSub) { 4361 _this._hide(); 4362 } 4363 }); 4364 } 4365 4366 if (hasTouch && this.options.disableHoverOnTouch) this.options.disableHover = true; 4367 4368 if (!this.options.disableHover) { 4369 this.$menuItems.on('mouseenter.zf.dropdownMenu', function () { 4370 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 4371 hasSub = $elem.hasClass(parClass); 4372 4373 if (hasSub) { 4374 clearTimeout($elem.data('_delay')); 4375 $elem.data('_delay', setTimeout(function () { 4376 _this._show($elem.children('.is-dropdown-submenu')); 4377 }, _this.options.hoverDelay)); 4378 } 4379 }).on('mouseleave.zf.dropdownMenu', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["ignoreMousedisappear"])(function () { 4380 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 4381 hasSub = $elem.hasClass(parClass); 4382 4383 if (hasSub && _this.options.autoclose) { 4384 if ($elem.attr('data-is-click') === 'true' && _this.options.clickOpen) { 4385 return false; 4386 } 4387 4388 clearTimeout($elem.data('_delay')); 4389 $elem.data('_delay', setTimeout(function () { 4390 _this._hide($elem); 4391 }, _this.options.closingTime)); 4392 } 4393 })); 4394 } 4395 4396 this.$menuItems.on('keydown.zf.dropdownMenu', function (e) { 4397 var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', '[role="none"]'), 4398 isTab = _this.$tabs.index($element) > -1, 4399 $elements = isTab ? _this.$tabs : $element.siblings('li').add($element), 4400 $prevElement, 4401 $nextElement; 4402 $elements.each(function (i) { 4403 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) { 4404 $prevElement = $elements.eq(i - 1); 4405 $nextElement = $elements.eq(i + 1); 4406 return; 4407 } 4408 }); 4409 4410 var nextSibling = function nextSibling() { 4411 $nextElement.children('a:first').focus(); 4412 e.preventDefault(); 4413 }, 4414 prevSibling = function prevSibling() { 4415 $prevElement.children('a:first').focus(); 4416 e.preventDefault(); 4417 }, 4418 openSub = function openSub() { 4419 var $sub = $element.children('ul.is-dropdown-submenu'); 4420 4421 if ($sub.length) { 4422 _this._show($sub); 4423 4424 $element.find('li > a:first').focus(); 4425 e.preventDefault(); 4426 } else { 4427 return; 4428 } 4429 }, 4430 closeSub = function closeSub() { 4431 //if ($element.is(':first-child')) { 4432 var close = $element.parent('ul').parent('li'); 4433 close.children('a:first').focus(); 4434 4435 _this._hide(close); 4436 4437 e.preventDefault(); //} 4438 }; 4439 4440 var functions = { 4441 open: openSub, 4442 close: function close() { 4443 _this._hide(_this.$element); 4444 4445 _this.$menuItems.eq(0).children('a').focus(); // focus to first element 4446 4447 4448 e.preventDefault(); 4449 } 4450 }; 4451 4452 if (isTab) { 4453 if (_this._isVertical()) { 4454 // vertical menu 4455 if (_this._isRtl()) { 4456 // right aligned 4457 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4458 down: nextSibling, 4459 up: prevSibling, 4460 next: closeSub, 4461 previous: openSub 4462 }); 4463 } else { 4464 // left aligned 4465 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4466 down: nextSibling, 4467 up: prevSibling, 4468 next: openSub, 4469 previous: closeSub 4470 }); 4471 } 4472 } else { 4473 // horizontal menu 4474 if (_this._isRtl()) { 4475 // right aligned 4476 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4477 next: prevSibling, 4478 previous: nextSibling, 4479 down: openSub, 4480 up: closeSub 4481 }); 4482 } else { 4483 // left aligned 4484 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4485 next: nextSibling, 4486 previous: prevSibling, 4487 down: openSub, 4488 up: closeSub 4489 }); 4490 } 4491 } 4492 } else { 4493 // not tabs -> one sub 4494 if (_this._isRtl()) { 4495 // right aligned 4496 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4497 next: closeSub, 4498 previous: openSub, 4499 down: nextSibling, 4500 up: prevSibling 4501 }); 4502 } else { 4503 // left aligned 4504 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(functions, { 4505 next: openSub, 4506 previous: closeSub, 4507 down: nextSibling, 4508 up: prevSibling 4509 }); 4510 } 4511 } 4512 4513 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'DropdownMenu', functions); 4514 }); 4515 } 4516 /** 4517 * Adds an event handler to the body to close any dropdowns on a click. 4518 * @function 4519 * @private 4520 */ 4521 4522 }, { 4523 key: "_addBodyHandler", 4524 value: function _addBodyHandler() { 4525 var _this2 = this; 4526 4527 var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body); 4528 4529 this._removeBodyHandler(); 4530 4531 $body.on('click.zf.dropdownMenu tap.zf.dropdownMenu', function (e) { 4532 var isItself = !!jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).closest(_this2.$element).length; 4533 if (isItself) return; 4534 4535 _this2._hide(); 4536 4537 _this2._removeBodyHandler(); 4538 }); 4539 } 4540 /** 4541 * Remove the body event handler. See `_addBodyHandler`. 4542 * @function 4543 * @private 4544 */ 4545 4546 }, { 4547 key: "_removeBodyHandler", 4548 value: function _removeBodyHandler() { 4549 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).off('click.zf.dropdownMenu tap.zf.dropdownMenu'); 4550 } 4551 /** 4552 * Opens a dropdown pane, and checks for collisions first. 4553 * @param {jQuery} $sub - ul element that is a submenu to show 4554 * @function 4555 * @private 4556 * @fires DropdownMenu#show 4557 */ 4558 4559 }, { 4560 key: "_show", 4561 value: function _show($sub) { 4562 var idx = this.$tabs.index(this.$tabs.filter(function (i, el) { 4563 return jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).find($sub).length > 0; 4564 })); 4565 var $sibs = $sub.parent('li.is-dropdown-submenu-parent').siblings('li.is-dropdown-submenu-parent'); 4566 4567 this._hide($sibs, idx); 4568 4569 $sub.css('visibility', 'hidden').addClass('js-dropdown-active').parent('li.is-dropdown-submenu-parent').addClass('is-active'); 4570 var clear = _foundation_util_box__WEBPACK_IMPORTED_MODULE_5__["Box"].ImNotTouchingYou($sub, null, true); 4571 4572 if (!clear) { 4573 var oldClass = this.options.alignment === 'left' ? '-right' : '-left', 4574 $parentLi = $sub.parent('.is-dropdown-submenu-parent'); 4575 $parentLi.removeClass("opens".concat(oldClass)).addClass("opens-".concat(this.options.alignment)); 4576 clear = _foundation_util_box__WEBPACK_IMPORTED_MODULE_5__["Box"].ImNotTouchingYou($sub, null, true); 4577 4578 if (!clear) { 4579 $parentLi.removeClass("opens-".concat(this.options.alignment)).addClass('opens-inner'); 4580 } 4581 4582 this.changed = true; 4583 } 4584 4585 $sub.css('visibility', ''); 4586 4587 if (this.options.closeOnClick) { 4588 this._addBodyHandler(); 4589 } 4590 /** 4591 * Fires when the new dropdown pane is visible. 4592 * @event DropdownMenu#show 4593 */ 4594 4595 4596 this.$element.trigger('show.zf.dropdownMenu', [$sub]); 4597 } 4598 /** 4599 * Hides a single, currently open dropdown pane, if passed a parameter, otherwise, hides everything. 4600 * @function 4601 * @param {jQuery} $elem - element with a submenu to hide 4602 * @param {Number} idx - index of the $tabs collection to hide 4603 * @fires DropdownMenu#hide 4604 * @private 4605 */ 4606 4607 }, { 4608 key: "_hide", 4609 value: function _hide($elem, idx) { 4610 var $toClose; 4611 4612 if ($elem && $elem.length) { 4613 $toClose = $elem; 4614 } else if (typeof idx !== 'undefined') { 4615 $toClose = this.$tabs.not(function (i) { 4616 return i === idx; 4617 }); 4618 } else { 4619 $toClose = this.$element; 4620 } 4621 4622 var somethingToClose = $toClose.hasClass('is-active') || $toClose.find('.is-active').length > 0; 4623 4624 if (somethingToClose) { 4625 var $activeItem = $toClose.find('li.is-active'); 4626 $activeItem.add($toClose).attr({ 4627 'data-is-click': false 4628 }).removeClass('is-active'); 4629 $toClose.find('ul.js-dropdown-active').removeClass('js-dropdown-active'); 4630 4631 if (this.changed || $toClose.find('opens-inner').length) { 4632 var oldClass = this.options.alignment === 'left' ? 'right' : 'left'; 4633 $toClose.find('li.is-dropdown-submenu-parent').add($toClose).removeClass("opens-inner opens-".concat(this.options.alignment)).addClass("opens-".concat(oldClass)); 4634 this.changed = false; 4635 } 4636 4637 clearTimeout($activeItem.data('_delay')); 4638 4639 this._removeBodyHandler(); 4640 /** 4641 * Fires when the open menus are closed. 4642 * @event DropdownMenu#hide 4643 */ 4644 4645 4646 this.$element.trigger('hide.zf.dropdownMenu', [$toClose]); 4647 } 4648 } 4649 /** 4650 * Destroys the plugin. 4651 * @function 4652 */ 4653 4654 }, { 4655 key: "_destroy", 4656 value: function _destroy() { 4657 this.$menuItems.off('.zf.dropdownMenu').removeAttr('data-is-click').removeClass('is-right-arrow is-left-arrow is-down-arrow opens-right opens-left opens-inner'); 4658 jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.body).off('.zf.dropdownMenu'); 4659 _foundation_util_nest__WEBPACK_IMPORTED_MODULE_4__["Nest"].Burn(this.$element, 'dropdown'); 4660 } 4661 }]); 4662 4663 return DropdownMenu; 4664}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 4665/** 4666 * Default settings for plugin 4667 */ 4668 4669 4670DropdownMenu.defaults = { 4671 /** 4672 * Disallows hover events from opening submenus 4673 * @option 4674 * @type {boolean} 4675 * @default false 4676 */ 4677 disableHover: false, 4678 4679 /** 4680 * Disallows hover on touch devices 4681 * @option 4682 * @type {boolean} 4683 * @default true 4684 */ 4685 disableHoverOnTouch: true, 4686 4687 /** 4688 * Allow a submenu to automatically close on a mouseleave event, if not clicked open. 4689 * @option 4690 * @type {boolean} 4691 * @default true 4692 */ 4693 autoclose: true, 4694 4695 /** 4696 * Amount of time to delay opening a submenu on hover event. 4697 * @option 4698 * @type {number} 4699 * @default 50 4700 */ 4701 hoverDelay: 50, 4702 4703 /** 4704 * Allow a submenu to open/remain open on parent click event. Allows cursor to move away from menu. 4705 * @option 4706 * @type {boolean} 4707 * @default false 4708 */ 4709 clickOpen: false, 4710 4711 /** 4712 * Amount of time to delay closing a submenu on a mouseleave event. 4713 * @option 4714 * @type {number} 4715 * @default 500 4716 */ 4717 closingTime: 500, 4718 4719 /** 4720 * Position of the menu relative to what direction the submenus should open. Handled by JS. Can be `'auto'`, `'left'` or `'right'`. 4721 * @option 4722 * @type {string} 4723 * @default 'auto' 4724 */ 4725 alignment: 'auto', 4726 4727 /** 4728 * Allow clicks on the body to close any open submenus. 4729 * @option 4730 * @type {boolean} 4731 * @default true 4732 */ 4733 closeOnClick: true, 4734 4735 /** 4736 * Allow clicks on leaf anchor links to close any open submenus. 4737 * @option 4738 * @type {boolean} 4739 * @default true 4740 */ 4741 closeOnClickInside: true, 4742 4743 /** 4744 * Class applied to vertical oriented menus, Foundation default is `vertical`. Update this if using your own class. 4745 * @option 4746 * @type {string} 4747 * @default 'vertical' 4748 */ 4749 verticalClass: 'vertical', 4750 4751 /** 4752 * Class applied to right-side oriented menus, Foundation default is `align-right`. Update this if using your own class. 4753 * @option 4754 * @type {string} 4755 * @default 'align-right' 4756 */
4757 rightClass: 'align-right', 4758 4759 /** 4760 * Boolean to force overide the clicking of links to perform default action, on second touch event for mobile. 4761 * @option 4762 * @type {boolean} 4763 * @default true 4764 */ 4765 forceFollow: true 4766}; 4767 4768 4769/***/ }), 4770
vendor: 4,237 bytes, lines 4771-4806
4771/***/ "./js/foundation.equalizer.js": 4772/*!************************************!*\ 4773 !*** ./js/foundation.equalizer.js ***! 4774 \************************************/ 4775/*! exports provided: Equalizer */ 4776/***/ (function(module, __webpack_exports__, __webpack_require__) { 4777 4778"use strict"; 4779__webpack_require__.r(__webpack_exports__); 4780/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Equalizer", function() { return Equalizer; }); 4781/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 4782/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 4783/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 4784/* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js"); 4785/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 4786/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 4787function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 4788 4789function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 4790 4791function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 4792 4793function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 4794 4795function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 4796 4797function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 4798 4799function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 4800 4801function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 4802 4803function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 4804 4805function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 4806
vendor: 4,155 bytes, lines 4807-4938
4807function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 4808 4809 4810 4811 4812 4813 4814/** 4815 * Equalizer module. 4816 * @module foundation.equalizer 4817 * @requires foundation.util.mediaQuery 4818 * @requires foundation.util.imageLoader if equalizer contains images 4819 */ 4820 4821var Equalizer = /*#__PURE__*/function (_Plugin) { 4822 _inherits(Equalizer, _Plugin); 4823 4824 var _super = _createSuper(Equalizer); 4825 4826 function Equalizer() { 4827 _classCallCheck(this, Equalizer); 4828 4829 return _super.apply(this, arguments); 4830 } 4831 4832 _createClass(Equalizer, [{ 4833 key: "_setup", 4834 value: 4835 /** 4836 * Creates a new instance of Equalizer. 4837 * @class 4838 * @name Equalizer 4839 * @fires Equalizer#init 4840 * @param {Object} element - jQuery object to add the trigger to. 4841 * @param {Object} options - Overrides to the default plugin settings. 4842 */ 4843 function _setup(element, options) { 4844 this.$element = element; 4845 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Equalizer.defaults, this.$element.data(), options); 4846 this.className = 'Equalizer'; // ie9 back compat 4847 4848 this._init(); 4849 } 4850 /** 4851 * Initializes the Equalizer plugin and calls functions to get equalizer functioning on load. 4852 * @private 4853 */ 4854 4855 }, { 4856 key: "_init", 4857 value: function _init() { 4858 var eqId = this.$element.attr('data-equalizer') || ''; 4859 var $watched = this.$element.find("[data-equalizer-watch=\"".concat(eqId, "\"]")); 4860 4861 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); 4862 4863 this.$watched = $watched.length ? $watched : this.$element.find('[data-equalizer-watch]'); 4864 this.$element.attr('data-resize', eqId || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'eq')); 4865 this.$element.attr('data-mutate', eqId || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'eq')); 4866 this.hasNested = this.$element.find('[data-equalizer]').length > 0; 4867 this.isNested = this.$element.parentsUntil(document.body, '[data-equalizer]').length > 0; 4868 this.isOn = false; 4869 this._bindHandler = { 4870 onResizeMeBound: this._onResizeMe.bind(this), 4871 onPostEqualizedBound: this._onPostEqualized.bind(this) 4872 }; 4873 var imgs = this.$element.find('img'); 4874 var tooSmall; 4875 4876 if (this.options.equalizeOn) { 4877 tooSmall = this._checkMQ(); 4878 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._checkMQ.bind(this)); 4879 } else { 4880 this._events(); 4881 } 4882 4883 if (typeof tooSmall !== 'undefined' && tooSmall === false || typeof tooSmall === 'undefined') { 4884 if (imgs.length) { 4885 Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_2__["onImagesLoaded"])(imgs, this._reflow.bind(this)); 4886 } else { 4887 this._reflow(); 4888 } 4889 } 4890 } 4891 /** 4892 * Removes event listeners if the breakpoint is too small. 4893 * @private 4894 */ 4895 4896 }, { 4897 key: "_pauseEvents", 4898 value: function _pauseEvents() { 4899 this.isOn = false; 4900 this.$element.off({ 4901 '.zf.equalizer': this._bindHandler.onPostEqualizedBound, 4902 'resizeme.zf.trigger': this._bindHandler.onResizeMeBound, 4903 'mutateme.zf.trigger': this._bindHandler.onResizeMeBound 4904 }); 4905 } 4906 /** 4907 * function to handle $elements resizeme.zf.trigger, with bound this on _bindHandler.onResizeMeBound 4908 * @private 4909 */ 4910 4911 }, { 4912 key: "_onResizeMe", 4913 value: function _onResizeMe() { 4914 this._reflow(); 4915 } 4916 /** 4917 * function to handle $elements postequalized.zf.equalizer, with bound this on _bindHandler.onPostEqualizedBound 4918 * @private 4919 */ 4920 4921 }, { 4922 key: "_onPostEqualized", 4923 value: function _onPostEqualized(e) { 4924 if (e.target !== this.$element[0]) { 4925 this._reflow(); 4926 } 4927 } 4928 /** 4929 * Initializes events for Equalizer. 4930 * @private 4931 */ 4932 4933 }, { 4934 key: "_events", 4935 value: function _events() { 4936 this._pauseEvents(); 4937 4938 if (this.hasNested) {
vendor: 7,250 bytes, lines 4939-5202
4939 this.$element.on('postequalized.zf.equalizer', this._bindHandler.onPostEqualizedBound); 4940 } else { 4941 this.$element.on('resizeme.zf.trigger', this._bindHandler.onResizeMeBound); 4942 this.$element.on('mutateme.zf.trigger', this._bindHandler.onResizeMeBound); 4943 } 4944 4945 this.isOn = true; 4946 } 4947 /** 4948 * Checks the current breakpoint to the minimum required size. 4949 * @private 4950 */ 4951 4952 }, { 4953 key: "_checkMQ", 4954 value: function _checkMQ() { 4955 var tooSmall = !_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].is(this.options.equalizeOn); 4956 4957 if (tooSmall) { 4958 if (this.isOn) { 4959 this._pauseEvents(); 4960 4961 this.$watched.css('height', 'auto'); 4962 } 4963 } else { 4964 if (!this.isOn) { 4965 this._events(); 4966 } 4967 } 4968 4969 return tooSmall; 4970 } 4971 /** 4972 * A noop version for the plugin 4973 * @private 4974 */ 4975 4976 }, { 4977 key: "_killswitch", 4978 value: function _killswitch() { 4979 return; 4980 } 4981 /** 4982 * Calls necessary functions to update Equalizer upon DOM change 4983 * @private 4984 */ 4985 4986 }, { 4987 key: "_reflow", 4988 value: function _reflow() { 4989 if (!this.options.equalizeOnStack) { 4990 if (this._isStacked()) { 4991 this.$watched.css('height', 'auto'); 4992 return false; 4993 } 4994 } 4995 4996 if (this.options.equalizeByRow) { 4997 this.getHeightsByRow(this.applyHeightByRow.bind(this)); 4998 } else { 4999 this.getHeights(this.applyHeight.bind(this)); 5000 } 5001 } 5002 /** 5003 * Manually determines if the first 2 elements are *NOT* stacked. 5004 * @private 5005 */ 5006 5007 }, { 5008 key: "_isStacked", 5009 value: function _isStacked() { 5010 if (!this.$watched[0] || !this.$watched[1]) { 5011 return true; 5012 } 5013 5014 return this.$watched[0].getBoundingClientRect().top !== this.$watched[1].getBoundingClientRect().top; 5015 } 5016 /** 5017 * Finds the outer heights of children contained within an Equalizer parent and returns them in an array 5018 * @param {Function} cb - A non-optional callback to return the heights array to. 5019 * @returns {Array} heights - An array of heights of children within Equalizer container 5020 */ 5021 5022 }, { 5023 key: "getHeights", 5024 value: function getHeights(cb) { 5025 var heights = []; 5026 5027 for (var i = 0, len = this.$watched.length; i < len; i++) { 5028 this.$watched[i].style.height = 'auto'; 5029 heights.push(this.$watched[i].offsetHeight); 5030 } 5031 5032 cb(heights); 5033 } 5034 /** 5035 * Finds the outer heights of children contained within an Equalizer parent and returns them in an array 5036 * @param {Function} cb - A non-optional callback to return the heights array to. 5037 * @returns {Array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child 5038 */ 5039 5040 }, { 5041 key: "getHeightsByRow", 5042 value: function getHeightsByRow(cb) { 5043 var lastElTopOffset = this.$watched.length ? this.$watched.first().offset().top : 0, 5044 groups = [], 5045 group = 0; //group by Row 5046 5047 groups[group] = []; 5048 5049 for (var i = 0, len = this.$watched.length; i < len; i++) { 5050 this.$watched[i].style.height = 'auto'; //maybe could use this.$watched[i].offsetTop 5051 5052 var elOffsetTop = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$watched[i]).offset().top; 5053 5054 if (elOffsetTop !== lastElTopOffset) { 5055 group++; 5056 groups[group] = []; 5057 lastElTopOffset = elOffsetTop; 5058 } 5059 5060 groups[group].push([this.$watched[i], this.$watched[i].offsetHeight]); 5061 } 5062 5063 for (var j = 0, ln = groups.length; j < ln; j++) { 5064 var heights = jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[j]).map(function () { 5065 return this[1]; 5066 }).get(); 5067 var max = Math.max.apply(null, heights); 5068 groups[j].push(max); 5069 } 5070 5071 cb(groups); 5072 } 5073 /** 5074 * Changes the CSS height property of each child in an Equalizer parent to match the tallest 5075 * @param {array} heights - An array of heights of children within Equalizer container 5076 * @fires Equalizer#preequalized 5077 * @fires Equalizer#postequalized 5078 */ 5079 5080 }, { 5081 key: "applyHeight", 5082 value: function applyHeight(heights) { 5083 var max = Math.max.apply(null, heights); 5084 /** 5085 * Fires before the heights are applied 5086 * @event Equalizer#preequalized 5087 */ 5088 5089 this.$element.trigger('preequalized.zf.equalizer'); 5090 this.$watched.css('height', max); 5091 /** 5092 * Fires when the heights have been applied 5093 * @event Equalizer#postequalized 5094 */ 5095 5096 this.$element.trigger('postequalized.zf.equalizer'); 5097 } 5098 /** 5099 * Changes the CSS height property of each child in an Equalizer parent to match the tallest by row 5100 * @param {array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child 5101 * @fires Equalizer#preequalized 5102 * @fires Equalizer#preequalizedrow 5103 * @fires Equalizer#postequalizedrow 5104 * @fires Equalizer#postequalized 5105 */ 5106 5107 }, { 5108 key: "applyHeightByRow", 5109 value: function applyHeightByRow(groups) { 5110 /** 5111 * Fires before the heights are applied 5112 */ 5113 this.$element.trigger('preequalized.zf.equalizer'); 5114 5115 for (var i = 0, len = groups.length; i < len; i++) { 5116 var groupsILength = groups[i].length, 5117 max = groups[i][groupsILength - 1]; 5118 5119 if (groupsILength <= 2) { 5120 jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[i][0][0]).css({ 5121 'height': 'auto' 5122 }); 5123 continue; 5124 } 5125 /** 5126 * Fires before the heights per row are applied 5127 * @event Equalizer#preequalizedrow 5128 */ 5129 5130 5131 this.$element.trigger('preequalizedrow.zf.equalizer'); 5132 5133 for (var j = 0, lenJ = groupsILength - 1; j < lenJ; j++) { 5134 jquery__WEBPACK_IMPORTED_MODULE_0___default()(groups[i][j][0]).css({ 5135 'height': max 5136 }); 5137 } 5138 /** 5139 * Fires when the heights per row have been applied 5140 * @event Equalizer#postequalizedrow 5141 */ 5142 5143 5144 this.$element.trigger('postequalizedrow.zf.equalizer'); 5145 } 5146 /** 5147 * Fires when the heights have been applied 5148 */ 5149 5150 5151 this.$element.trigger('postequalized.zf.equalizer'); 5152 } 5153 /** 5154 * Destroys an instance of Equalizer. 5155 * @function 5156 */ 5157 5158 }, { 5159 key: "_destroy", 5160 value: function _destroy() { 5161 this._pauseEvents(); 5162 5163 this.$watched.css('height', 'auto'); 5164 } 5165 }]); 5166 5167 return Equalizer; 5168}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]); 5169/** 5170 * Default settings for plugin 5171 */ 5172 5173 5174Equalizer.defaults = { 5175 /** 5176 * Enable height equalization when stacked on smaller screens. 5177 * @option 5178 * @type {boolean} 5179 * @default false 5180 */ 5181 equalizeOnStack: false, 5182 5183 /** 5184 * Enable height equalization row by row. 5185 * @option 5186 * @type {boolean} 5187 * @default false 5188 */ 5189 equalizeByRow: false, 5190 5191 /** 5192 * String representing the minimum breakpoint size the plugin should equalize heights on. 5193 * @option 5194 * @type {string} 5195 * @default '' 5196 */ 5197 equalizeOn: '' 5198}; 5199 5200 5201/***/ }), 5202
vendor: 4,242 bytes, lines 5203-5238
5203/***/ "./js/foundation.interchange.js": 5204/*!**************************************!*\ 5205 !*** ./js/foundation.interchange.js ***! 5206 \**************************************/ 5207/*! exports provided: Interchange */ 5208/***/ (function(module, __webpack_exports__, __webpack_require__) { 5209 5210"use strict"; 5211__webpack_require__.r(__webpack_exports__); 5212/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Interchange", function() { return Interchange; }); 5213/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 5214/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 5215/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 5216/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 5217/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 5218/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 5219function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 5220 5221function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 5222 5223function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 5224 5225function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 5226 5227function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 5228 5229function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 5230 5231function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 5232 5233function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 5234 5235function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 5236 5237function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 5238
vendor: 5,918 bytes, lines 5239-5442
5239function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 5240 5241 5242 5243 5244 5245 5246/** 5247 * Interchange module. 5248 * @module foundation.interchange 5249 * @requires foundation.util.mediaQuery 5250 */ 5251 5252var Interchange = /*#__PURE__*/function (_Plugin) { 5253 _inherits(Interchange, _Plugin); 5254 5255 var _super = _createSuper(Interchange); 5256 5257 function Interchange() { 5258 _classCallCheck(this, Interchange); 5259 5260 return _super.apply(this, arguments); 5261 } 5262 5263 _createClass(Interchange, [{ 5264 key: "_setup", 5265 value: 5266 /** 5267 * Creates a new instance of Interchange. 5268 * @class 5269 * @name Interchange 5270 * @fires Interchange#init 5271 * @param {Object} element - jQuery object to add the trigger to. 5272 * @param {Object} options - Overrides to the default plugin settings. 5273 */ 5274 function _setup(element, options) { 5275 this.$element = element; 5276 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Interchange.defaults, this.$element.data(), options); 5277 this.rules = []; 5278 this.currentPath = ''; 5279 this.className = 'Interchange'; // ie9 back compat 5280 // Triggers init is idempotent, just need to make sure it is initialized 5281 5282 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 5283 5284 this._init(); 5285 5286 this._events(); 5287 } 5288 /** 5289 * Initializes the Interchange plugin and calls functions to get interchange functioning on load. 5290 * @function 5291 * @private 5292 */ 5293 5294 }, { 5295 key: "_init", 5296 value: function _init() { 5297 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); 5298 5299 var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'interchange'); 5300 this.$element.attr({ 5301 'data-resize': id, 5302 'id': id 5303 }); 5304 5305 this._parseOptions(); 5306 5307 this._addBreakpoints(); 5308 5309 this._generateRules(); 5310 5311 this._reflow(); 5312 } 5313 /** 5314 * Initializes events for Interchange. 5315 * @function 5316 * @private 5317 */ 5318 5319 }, { 5320 key: "_events", 5321 value: function _events() { 5322 var _this = this; 5323 5324 this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function () { 5325 return _this._reflow(); 5326 }); 5327 } 5328 /** 5329 * Calls necessary functions to update Interchange upon DOM change 5330 * @function 5331 * @private 5332 */ 5333 5334 }, { 5335 key: "_reflow", 5336 value: function _reflow() { 5337 var match; // Iterate through each rule, but only save the last match 5338 5339 for (var i in this.rules) { 5340 if (this.rules.hasOwnProperty(i)) { 5341 var rule = this.rules[i]; 5342 5343 if (window.matchMedia(rule.query).matches) { 5344 match = rule; 5345 } 5346 } 5347 } 5348 5349 if (match) { 5350 this.replace(match.path); 5351 } 5352 } 5353 /** 5354 * Check options valifity and set defaults for: 5355 * - `data-interchange-type`: if set, enforce the type of replacement (auto, src, background or html) 5356 * @function 5357 * @private 5358 */ 5359 5360 }, { 5361 key: "_parseOptions", 5362 value: function _parseOptions() { 5363 var types = ['auto', 'src', 'background', 'html']; 5364 if (typeof this.options.type === 'undefined') this.options.type = 'auto';else if (types.indexOf(this.options.type) === -1) { 5365 console.warn("Warning: invalid value \"".concat(this.options.type, "\" for Interchange option \"type\"")); 5366 this.options.type = 'auto'; 5367 } 5368 } 5369 /** 5370 * Gets the Foundation breakpoints and adds them to the Interchange.SPECIAL_QUERIES object. 5371 * @function 5372 * @private 5373 */ 5374 5375 }, { 5376 key: "_addBreakpoints", 5377 value: function _addBreakpoints() { 5378 for (var i in _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries) { 5379 if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries.hasOwnProperty(i)) { 5380 var query = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].queries[i]; 5381 Interchange.SPECIAL_QUERIES[query.name] = query.value; 5382 } 5383 } 5384 } 5385 /** 5386 * Checks the Interchange element for the provided media query + content pairings 5387 * @function 5388 * @private 5389 * @returns {Array} scenarios - Array of objects that have 'mq' and 'path' keys with corresponding keys 5390 */ 5391 5392 }, { 5393 key: "_generateRules", 5394 value: function _generateRules() { 5395 var rulesList = []; 5396 var rules; 5397 5398 if (this.options.rules) { 5399 rules = this.options.rules; 5400 } else { 5401 rules = this.$element.data('interchange'); 5402 } 5403 5404 rules = typeof rules === 'string' ? rules.match(/\[.*?, .*?\]/g) : rules; 5405 5406 for (var i in rules) { 5407 if (rules.hasOwnProperty(i)) { 5408 var rule = rules[i].slice(1, -1).split(', '); 5409 var path = rule.slice(0, -1).join(''); 5410 var query = rule[rule.length - 1]; 5411 5412 if (Interchange.SPECIAL_QUERIES[query]) { 5413 query = Interchange.SPECIAL_QUERIES[query]; 5414 } 5415 5416 rulesList.push({ 5417 path: path, 5418 query: query 5419 }); 5420 } 5421 } 5422 5423 this.rules = rulesList; 5424 } 5425 /** 5426 * Update the `src` property of an image, or change the HTML of a container, to the specified path. 5427 * @function 5428 * @param {String} path - Path to the image or HTML partial. 5429 * @fires Interchange#replaced 5430 */ 5431 5432 }, { 5433 key: "replace", 5434 value: function replace(path) { 5435 var _this2 = this; 5436 5437 if (this.currentPath === path) return; 5438 var trigger = 'replaced.zf.interchange'; 5439 var type = this.options.type; 5440 5441 if (type === 'auto') { 5442 if (this.$element[0].nodeName === 'IMG') type = 'src';else if (path.match(/\.(gif|jpe?g|png|svg|tiff)([?#].*)?/i)) type = 'background';
vendor: 2,438 bytes, lines 5442-5520
5442else type = 'html'; 5443 } // Replacing images 5444 5445 5446 if (type === 'src') { 5447 this.$element.attr('src', path).on('load', function () { 5448 _this2.currentPath = path; 5449 }).trigger(trigger); 5450 } // Replacing background images 5451 else if (type === 'background') { 5452 path = path.replace(/\(/g, '%28').replace(/\)/g, '%29'); 5453 this.$element.css({ 5454 'background-image': 'url(' + path + ')' 5455 }).trigger(trigger); 5456 } // Replacing HTML 5457 else if (type === 'html') { 5458 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.get(path, function (response) { 5459 _this2.$element.html(response).trigger(trigger); 5460 5461 jquery__WEBPACK_IMPORTED_MODULE_0___default()(response).foundation(); 5462 _this2.currentPath = path; 5463 }); 5464 } 5465 /** 5466 * Fires when content in an Interchange element is done being loaded. 5467 * @event Interchange#replaced 5468 */ 5469 // this.$element.trigger('replaced.zf.interchange'); 5470 5471 } 5472 /** 5473 * Destroys an instance of interchange. 5474 * @function 5475 */ 5476 5477 }, { 5478 key: "_destroy", 5479 value: function _destroy() { 5480 this.$element.off('resizeme.zf.trigger'); 5481 } 5482 }]); 5483 5484 return Interchange; 5485}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]); 5486/** 5487 * Default settings for plugin 5488 */ 5489 5490 5491Interchange.defaults = { 5492 /** 5493 * Rules to be applied to Interchange elements. Set with the `data-interchange` array notation. 5494 * @option 5495 * @type {?array} 5496 * @default null 5497 */ 5498 rules: null, 5499 5500 /** 5501 * Type of the responsive ressource to replace. It can take the following options: 5502 * - `auto` (default): choose the type according to the element tag or the ressource extension, 5503 * - `src`: replace the `[src]` attribute, recommended for images `<img>`. 5504 * - `background`: replace the `background-image` CSS property. 5505 * - `html`: replace the element content. 5506 * @option 5507 * @type {string} 5508 * @default 'auto' 5509 */ 5510 type: 'auto' 5511}; 5512Interchange.SPECIAL_QUERIES = { 5513 'landscape': 'screen and (orientation: landscape)', 5514 'portrait': 'screen and (orientation: portrait)', 5515 'retina': 'only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx)' 5516}; 5517 5518 5519/***/ }), 5520
vendor: 4,212 bytes, lines 5521-5556
5521/***/ "./js/foundation.magellan.js": 5522/*!***********************************!*\ 5523 !*** ./js/foundation.magellan.js ***! 5524 \***********************************/ 5525/*! exports provided: Magellan */ 5526/***/ (function(module, __webpack_exports__, __webpack_require__) { 5527 5528"use strict"; 5529__webpack_require__.r(__webpack_exports__); 5530/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Magellan", function() { return Magellan; }); 5531/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 5532/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 5533/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 5534/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 5535/* harmony import */ var _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.smoothScroll */ "./js/foundation.smoothScroll.js"); 5536/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 5537function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 5538 5539function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 5540 5541function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 5542 5543function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 5544 5545function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 5546 5547function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 5548 5549function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 5550 5551function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 5552 5553function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 5554 5555function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 5556
5557function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 5558 5559 5560 5561 5562 5563 5564/** 5565 * Magellan module. 5566 * @module foundation.magellan 5567 * @requires foundation.smoothScroll 5568 * @requires foundation.util.triggers 5569 */ 5570 5571var Magellan = /*#__PURE__*/function (_Plugin) { 5572 _inherits(Magellan, _Plugin); 5573 5574 var _super = _createSuper(Magellan); 5575 5576 function Magellan() { 5577 _classCallCheck(this, Magellan); 5578 5579 return _super.apply(this, arguments); 5580 } 5581 5582 _createClass(Magellan, [{ 5583 key: "_setup", 5584 value: 5585 /** 5586 * Creates a new instance of Magellan. 5587 * @class 5588 * @name Magellan 5589 * @fires Magellan#init 5590 * @param {Object} element - jQuery object to add the trigger to. 5591 * @param {Object} options - Overrides to the default plugin settings. 5592 */ 5593 function _setup(element, options) { 5594 this.$element = element; 5595 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Magellan.defaults, this.$element.data(), options); 5596 this.className = 'Magellan'; // ie9 back compat 5597 // Triggers init is idempotent, just need to make sure it is initialized 5598 5599 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 5600 5601 this._init(); 5602 5603 this.calcPoints(); 5604 } 5605 /** 5606 * Initializes the Magellan plugin and calls functions to get equalizer functioning on load. 5607 * @private 5608 */ 5609 5610 }, { 5611 key: "_init", 5612 value: function _init() { 5613 var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'magellan'); 5614 this.$targets = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-magellan-target]'); 5615 this.$links = this.$element.find('a'); 5616 this.$element.attr({ 5617 'data-resize': id, 5618 'data-scroll': id, 5619 'id': id 5620 }); 5621 this.$active = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5622 this.scrollPos = parseInt(window.pageYOffset, 10); 5623 5624 this._events(); 5625 } 5626 /** 5627 * Calculates an array of pixel values that are the demarcation lines between locations on the page. 5628 * Can be invoked if new elements are added or the size of a location changes. 5629 * @function 5630 */ 5631 5632 }, { 5633 key: "calcPoints", 5634 value: function calcPoints() { 5635 var _this = this, 5636 body = document.body, 5637 html = document.documentElement; 5638 5639 this.points = []; 5640 this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight)); 5641 this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight)); 5642 this.$targets.each(function () { 5643 var $tar = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 5644 pt = Math.round($tar.offset().top - _this.options.threshold); 5645 $tar.targetPoint = pt; 5646 5647 _this.points.push(pt); 5648 }); 5649 } 5650 /** 5651 * Initializes events for Magellan. 5652 * @private 5653 */ 5654 5655 }, { 5656 key: "_events", 5657 value: function _events() { 5658 var _this = this; 5659 5660 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).one('load', function () { 5661 if (_this.options.deepLinking) { 5662 if (location.hash) { 5663 _this.scrollToLoc(location.hash); 5664 } 5665 } 5666 5667 _this.calcPoints(); 5668 5669 _this._updateActive(); 5670 }); 5671 _this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 5672 _this.$element.on({ 5673 'resizeme.zf.trigger': _this.reflow.bind(_this), 5674 'scrollme.zf.trigger': _this._updateActive.bind(_this) 5675 }).on('click.zf.magellan', 'a[href^="#"]', function (e) { 5676 e.preventDefault(); 5677 var arrival = this.getAttribute('href'); 5678 5679 _this.scrollToLoc(arrival); 5680 }); 5681 }); 5682 5683 this._deepLinkScroll = function () { 5684 if (_this.options.deepLinking) { 5685 _this.scrollToLoc(window.location.hash); 5686 } 5687 }; 5688 5689 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._deepLinkScroll); 5690 } 5691 /** 5692 * Function to scroll to a given location on the page. 5693 * @param {String} loc - a properly formatted jQuery id selector. Example: '#foo' 5694 * @function 5695 */ 5696 5697 }, { 5698 key: "scrollToLoc", 5699 value: function scrollToLoc(loc) { 5700 this._inTransition = true; 5701 5702 var _this = this; 5703 5704 var options = { 5705 animationEasing: this.options.animationEasing, 5706 animationDuration: this.options.animationDuration, 5707 threshold: this.options.threshold, 5708 offset: this.options.offset 5709 }; 5710 _foundation_smoothScroll__WEBPACK_IMPORTED_MODULE_3__["SmoothScroll"].scrollToLoc(loc, options, function () { 5711 _this._inTransition = false;
vendor: 5,193 bytes, lines 5712-5890
5712 }); 5713 } 5714 /** 5715 * Calls necessary functions to update Magellan upon DOM change 5716 * @function 5717 */ 5718 5719 }, { 5720 key: "reflow", 5721 value: function reflow() { 5722 this.calcPoints(); 5723 5724 this._updateActive(); 5725 } 5726 /** 5727 * Updates the visibility of an active location link, and updates the url hash for the page, if deepLinking enabled. 5728 * @private 5729 * @function 5730 * @fires Magellan#update 5731 */ 5732 5733 }, { 5734 key: "_updateActive", 5735 value: function 5736 /*evt, elem, scrollPos*/ 5737 _updateActive() { 5738 var _this2 = this; 5739 5740 if (this._inTransition) return; 5741 var newScrollPos = parseInt(window.pageYOffset, 10); 5742 var isScrollingUp = this.scrollPos > newScrollPos; 5743 this.scrollPos = newScrollPos; 5744 var activeIdx; // Before the first point: no link 5745 5746 if (newScrollPos < this.points[0] - this.options.offset - (isScrollingUp ? this.options.threshold : 0)) { 5747 /* do nothing */ 5748 } // At the bottom of the page: last link 5749 else if (newScrollPos + this.winHeight === this.docHeight) { 5750 activeIdx = this.points.length - 1; 5751 } // Otherwhise, use the last visible link 5752 else { 5753 var visibleLinks = this.points.filter(function (p) { 5754 return p - _this2.options.offset - (isScrollingUp ? _this2.options.threshold : 0) <= newScrollPos; 5755 }); 5756 activeIdx = visibleLinks.length ? visibleLinks.length - 1 : 0; 5757 } // Get the new active link 5758 5759 5760 var $oldActive = this.$active; 5761 var activeHash = ''; 5762 5763 if (typeof activeIdx !== 'undefined') { 5764 this.$active = this.$links.filter('[href="#' + this.$targets.eq(activeIdx).data('magellan-target') + '"]'); 5765 if (this.$active.length) activeHash = this.$active[0].getAttribute('href'); 5766 } else { 5767 this.$active = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5768 } 5769 5770 var isNewActive = !(!this.$active.length && !$oldActive.length) && !this.$active.is($oldActive); 5771 var isNewHash = activeHash !== window.location.hash; // Update the active link element 5772 5773 if (isNewActive) { 5774 $oldActive.removeClass(this.options.activeClass); 5775 this.$active.addClass(this.options.activeClass); 5776 } // Update the hash (it may have changed with the same active link) 5777 5778 5779 if (this.options.deepLinking && isNewHash) { 5780 if (window.history.pushState) { 5781 // Set or remove the hash (see: https://stackoverflow.com/a/5298684/4317384 5782 var url = activeHash ? activeHash : window.location.pathname + window.location.search; 5783 5784 if (this.options.updateHistory) { 5785 window.history.pushState({}, '', url); 5786 } else { 5787 window.history.replaceState({}, '', url); 5788 } 5789 } else { 5790 window.location.hash = activeHash; 5791 } 5792 } 5793 5794 if (isNewActive) { 5795 /** 5796 * Fires when magellan is finished updating to the new active element. 5797 * @event Magellan#update 5798 */ 5799 this.$element.trigger('update.zf.magellan', [this.$active]); 5800 } 5801 } 5802 /** 5803 * Destroys an instance of Magellan and resets the url of the window. 5804 * @function 5805 */ 5806 5807 }, { 5808 key: "_destroy", 5809 value: function _destroy() { 5810 this.$element.off('.zf.trigger .zf.magellan').find(".".concat(this.options.activeClass)).removeClass(this.options.activeClass); 5811 5812 if (this.options.deepLinking) { 5813 var hash = this.$active[0].getAttribute('href'); 5814 window.location.hash.replace(hash, ''); 5815 } 5816 5817 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._deepLinkScroll); 5818 if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener); 5819 } 5820 }]); 5821 5822 return Magellan; 5823}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 5824/** 5825 * Default settings for plugin 5826 */ 5827 5828 5829Magellan.defaults = { 5830 /** 5831 * Amount of time, in ms, the animated scrolling should take between locations. 5832 * @option 5833 * @type {number} 5834 * @default 500 5835 */ 5836 animationDuration: 500, 5837 5838 /** 5839 * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`. 5840 * @option 5841 * @type {string} 5842 * @default 'linear' 5843 * @see {@link https://api.jquery.com/animate|Jquery animate} 5844 */ 5845 animationEasing: 'linear', 5846 5847 /** 5848 * Number of pixels to use as a marker for location changes. 5849 * @option 5850 * @type {number} 5851 * @default 50 5852 */ 5853 threshold: 50, 5854 5855 /** 5856 * Class applied to the active locations link on the magellan container. 5857 * @option 5858 * @type {string} 5859 * @default 'is-active' 5860 */ 5861 activeClass: 'is-active', 5862 5863 /** 5864 * Allows the script to manipulate the url of the current page, and if supported, alter the history. 5865 * @option 5866 * @type {boolean} 5867 * @default false 5868 */ 5869 deepLinking: false, 5870 5871 /** 5872 * Update the browser history with the active link, if deep linking is enabled. 5873 * @option 5874 * @type {boolean} 5875 * @default false 5876 */ 5877 updateHistory: false, 5878 5879 /** 5880 * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar. 5881 * @option 5882 * @type {number} 5883 * @default 0 5884 */ 5885 offset: 0 5886}; 5887 5888 5889/***/ }), 5890
vendor: 4,401 bytes, lines 5891-5927
5891/***/ "./js/foundation.offcanvas.js": 5892/*!************************************!*\ 5893 !*** ./js/foundation.offcanvas.js ***! 5894 \************************************/ 5895/*! exports provided: OffCanvas */ 5896/***/ (function(module, __webpack_exports__, __webpack_require__) { 5897 5898"use strict"; 5899__webpack_require__.r(__webpack_exports__); 5900/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OffCanvas", function() { return OffCanvas; }); 5901/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 5902/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 5903/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 5904/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 5905/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 5906/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 5907/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 5908function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 5909 5910function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 5911 5912function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 5913 5914function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 5915 5916function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 5917 5918function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 5919 5920function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 5921 5922function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 5923 5924function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 5925 5926function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 5927
vendor: 23,816 bytes, lines 5928-6598
5928function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 5929 5930 5931 5932 5933 5934 5935 5936/** 5937 * OffCanvas module. 5938 * @module foundation.offCanvas 5939 * @requires foundation.util.keyboard 5940 * @requires foundation.util.mediaQuery 5941 * @requires foundation.util.triggers 5942 */ 5943 5944var OffCanvas = /*#__PURE__*/function (_Plugin) { 5945 _inherits(OffCanvas, _Plugin); 5946 5947 var _super = _createSuper(OffCanvas); 5948 5949 function OffCanvas() { 5950 _classCallCheck(this, OffCanvas); 5951 5952 return _super.apply(this, arguments); 5953 } 5954 5955 _createClass(OffCanvas, [{ 5956 key: "_setup", 5957 value: 5958 /** 5959 * Creates a new instance of an off-canvas wrapper. 5960 * @class 5961 * @name OffCanvas 5962 * @fires OffCanvas#init 5963 * @param {Object} element - jQuery object to initialize. 5964 * @param {Object} options - Overrides to the default plugin settings. 5965 */ 5966 function _setup(element, options) { 5967 var _this2 = this; 5968 5969 this.className = 'OffCanvas'; // ie9 back compat 5970 5971 this.$element = element; 5972 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, OffCanvas.defaults, this.$element.data(), options); 5973 this.contentClasses = { 5974 base: [], 5975 reveal: [] 5976 }; 5977 this.$lastTrigger = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5978 this.$triggers = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5979 this.position = 'left'; 5980 this.$content = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5981 this.nested = !!this.options.nested; 5982 this.$sticky = jquery__WEBPACK_IMPORTED_MODULE_0___default()(); 5983 this.isInCanvas = false; // Defines the CSS transition/position classes of the off-canvas content container. 5984 5985 jquery__WEBPACK_IMPORTED_MODULE_0___default()(['push', 'overlap']).each(function (index, val) { 5986 _this2.contentClasses.base.push('has-transition-' + val); 5987 }); 5988 jquery__WEBPACK_IMPORTED_MODULE_0___default()(['left', 'right', 'top', 'bottom']).each(function (index, val) { 5989 _this2.contentClasses.base.push('has-position-' + val); 5990 5991 _this2.contentClasses.reveal.push('has-reveal-' + val); 5992 }); // Triggers init is idempotent, just need to make sure it is initialized 5993 5994 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_5__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 5995 5996 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"]._init(); 5997 5998 this._init(); 5999 6000 this._events(); 6001 6002 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('OffCanvas', { 6003 'ESCAPE': 'close' 6004 }); 6005 } 6006 /** 6007 * Initializes the off-canvas wrapper by adding the exit overlay (if needed). 6008 * @function 6009 * @private 6010 */ 6011 6012 }, { 6013 key: "_init", 6014 value: function _init() { 6015 var id = this.$element.attr('id'); 6016 this.$element.attr('aria-hidden', 'true'); // Find off-canvas content, either by ID (if specified), by siblings or by closest selector (fallback) 6017 6018 if (this.options.contentId) { 6019 this.$content = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#' + this.options.contentId); 6020 } else if (this.$element.siblings('[data-off-canvas-content]').length) { 6021 this.$content = this.$element.siblings('[data-off-canvas-content]').first(); 6022 } else { 6023 this.$content = this.$element.closest('[data-off-canvas-content]').first(); 6024 } 6025 6026 if (!this.options.contentId) { 6027 // Assume that the off-canvas element is nested if it isn't a sibling of the content 6028 this.nested = this.$element.siblings('[data-off-canvas-content]').length === 0; 6029 } else if (this.options.contentId && this.options.nested === null) { 6030 // Warning if using content ID without setting the nested option 6031 // Once the element is nested it is required to work properly in this case 6032 console.warn('Remember to use the nested option if using the content ID option!'); 6033 } 6034 6035 if (this.nested === true) { 6036 // Force transition overlap if nested 6037 this.options.transition = 'overlap'; // Remove appropriate classes if already assigned in markup 6038 6039 this.$element.removeClass('is-transition-push'); 6040 } 6041 6042 this.$element.addClass("is-transition-".concat(this.options.transition, " is-closed")); // Find triggers that affect this element and add aria-expanded to them 6043 6044 this.$triggers = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).find('[data-open="' + id + '"], [data-close="' + id + '"], [data-toggle="' + id + '"]').attr('aria-expanded', 'false').attr('aria-controls', id); // Get position by checking for related CSS class 6045 6046 this.position = this.$element.is('.position-left, .position-top, .position-right, .position-bottom') ? this.$element.attr('class').match(/position\-(left|top|right|bottom)/)[1] : this.position; // Add an overlay over the content if necessary 6047 6048 if (this.options.contentOverlay === true) { 6049 var overlay = document.createElement('div'); 6050 var overlayPosition = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$element).css("position") === 'fixed' ? 'is-overlay-fixed' : 'is-overlay-absolute'; 6051 overlay.setAttribute('class', 'js-off-canvas-overlay ' + overlayPosition); 6052 this.$overlay = jquery__WEBPACK_IMPORTED_MODULE_0___default()(overlay); 6053 6054 if (overlayPosition === 'is-overlay-fixed') { 6055 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.$overlay).insertAfter(this.$element); 6056 } else { 6057 this.$content.append(this.$overlay); 6058 } 6059 } // Get the revealOn option from the class. 6060 6061 6062 var revealOnRegExp = new RegExp(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["RegExpEscape"])(this.options.revealClass) + '([^\\s]+)', 'g'); 6063 var revealOnClass = revealOnRegExp.exec(this.$element[0].className); 6064 6065 if (revealOnClass) { 6066 this.options.isRevealed = true; 6067 this.options.revealOn = this.options.revealOn || revealOnClass[1]; 6068 } // Ensure the `reveal-on-*` class is set. 6069 6070 6071 if (this.options.isRevealed === true && this.options.revealOn) { 6072 this.$element.first().addClass("".concat(this.options.revealClass).concat(this.options.revealOn)); 6073 6074 this._setMQChecker(); 6075 } 6076 6077 if (this.options.transitionTime) { 6078 this.$element.css('transition-duration', this.options.transitionTime); 6079 } // Find fixed elements that should stay fixed while off-canvas is opened 6080 6081 6082 this.$sticky = this.$content.find('[data-off-canvas-sticky]'); 6083 6084 if (this.$sticky.length > 0 && this.options.transition === 'push') { 6085 // If there's at least one match force contentScroll:false because the absolute top value doesn't get recalculated on scroll 6086 // Limit to push transition since there's no transform scope for overlap 6087 this.options.contentScroll = false; 6088 } 6089 6090 var inCanvasFor = this.$element.attr('class').match(/\bin-canvas-for-(\w+)/); 6091 6092 if (inCanvasFor && inCanvasFor.length === 2) { 6093 // Set `inCanvasOn` option if found in-canvas-for-[BREAKPONT] CSS class 6094 this.options.inCanvasOn = inCanvasFor[1]; 6095 } else if (this.options.inCanvasOn) { 6096 // Ensure the CSS class is set 6097 this.$element.addClass("in-canvas-for-".concat(this.options.inCanvasOn)); 6098 } 6099 6100 if (this.options.inCanvasOn) { 6101 this._checkInCanvas(); 6102 } // Initally remove all transition/position CSS classes from off-canvas content container. 6103 6104 6105 this._removeContentClasses(); 6106 } 6107 /** 6108 * Adds event handlers to the off-canvas wrapper and the exit overlay. 6109 * @function 6110 * @private 6111 */ 6112 6113 }, { 6114 key: "_events", 6115 value: function _events() { 6116 var _this3 = this; 6117 6118 this.$element.off('.zf.trigger .zf.offCanvas').on({ 6119 'open.zf.trigger': this.open.bind(this), 6120 'close.zf.trigger': this.close.bind(this), 6121 'toggle.zf.trigger': this.toggle.bind(this), 6122 'keydown.zf.offCanvas': this._handleKeyboard.bind(this) 6123 }); 6124 6125 if (this.options.closeOnClick === true) { 6126 var $target = this.options.contentOverlay ? this.$overlay : this.$content; 6127 $target.on({ 6128 'click.zf.offCanvas': this.close.bind(this) 6129 }); 6130 } 6131 6132 if (this.options.inCanvasOn) { 6133 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', function () { 6134 _this3._checkInCanvas(); 6135 }); 6136 } 6137 } 6138 /** 6139 * Applies event listener for elements that will reveal at certain breakpoints. 6140 * @private 6141 */ 6142 6143 }, { 6144 key: "_setMQChecker", 6145 value: function _setMQChecker() { 6146 var _this = this; 6147 6148 this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 6149 if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"].atLeast(_this.options.revealOn)) { 6150 _this.reveal(true); 6151 } 6152 }); 6153 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', function () { 6154 if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"].atLeast(_this.options.revealOn)) { 6155 _this.reveal(true); 6156 } else { 6157 _this.reveal(false); 6158 } 6159 }); 6160 } 6161 /** 6162 * Checks if InCanvas on current breakpoint and adjust off-canvas accordingly 6163 * @private 6164 */ 6165 6166 }, { 6167 key: "_checkInCanvas", 6168 value: function _checkInCanvas() { 6169 this.isInCanvas = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"].atLeast(this.options.inCanvasOn); 6170 6171 if (this.isInCanvas === true) { 6172 this.close(); 6173 } 6174 } 6175 /** 6176 * Removes the CSS transition/position classes of the off-canvas content container. 6177 * Removing the classes is important when another off-canvas gets opened that uses the same content container. 6178 * @param {Boolean} hasReveal - true if related off-canvas element is revealed. 6179 * @private 6180 */ 6181 6182 }, { 6183 key: "_removeContentClasses", 6184 value: function _removeContentClasses(hasReveal) { 6185 if (typeof hasReveal !== 'boolean') { 6186 this.$content.removeClass(this.contentClasses.base.join(' ')); 6187 } else if (hasReveal === false) { 6188 this.$content.removeClass("has-reveal-".concat(this.position)); 6189 } 6190 } 6191 /** 6192 * Adds the CSS transition/position classes of the off-canvas content container, based on the opening off-canvas element. 6193 * Beforehand any transition/position class gets removed. 6194 * @param {Boolean} hasReveal - true if related off-canvas element is revealed. 6195 * @private 6196 */ 6197 6198 }, { 6199 key: "_addContentClasses", 6200 value: function _addContentClasses(hasReveal) { 6201 this._removeContentClasses(hasReveal); 6202 6203 if (typeof hasReveal !== 'boolean') { 6204 this.$content.addClass("has-transition-".concat(this.options.transition, " has-position-").concat(this.position)); 6205 } else if (hasReveal === true) { 6206 this.$content.addClass("has-reveal-".concat(this.position)); 6207 } 6208 } 6209 /** 6210 * Preserves the fixed behavior of sticky elements on opening an off-canvas with push transition. 6211 * Since the off-canvas container has got a transform scope in such a case, it is done by calculating position absolute values. 6212 * @private 6213 */ 6214 6215 }, { 6216 key: "_fixStickyElements", 6217 value: function _fixStickyElements() { 6218 this.$sticky.each(function (_, el) { 6219 var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el); // If sticky element is currently fixed, adjust its top value to match absolute position due to transform scope 6220 // Limit to push transition because postion:fixed works without problems for overlap (no transform scope) 6221 6222 if ($el.css('position') === 'fixed') { 6223 // Save current inline styling to restore it if undoing the absolute fixing 6224 var topVal = parseInt($el.css('top'), 10); 6225 $el.data('offCanvasSticky', { 6226 top: topVal 6227 }); 6228 var absoluteTopVal = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).scrollTop() + topVal; 6229 $el.css({ 6230 top: "".concat(absoluteTopVal, "px"), 6231 width: '100%', 6232 transition: 'none' 6233 }); 6234 } 6235 }); 6236 } 6237 /** 6238 * Restores the original fixed styling of sticky elements after having closed an off-canvas that got pseudo fixed beforehand. 6239 * This reverts the changes of _fixStickyElements() 6240 * @private 6241 */ 6242 6243 }, { 6244 key: "_unfixStickyElements", 6245 value: function _unfixStickyElements() { 6246 this.$sticky.each(function (_, el) { 6247 var $el = jquery__WEBPACK_IMPORTED_MODULE_0___default()(el); 6248 var stickyData = $el.data('offCanvasSticky'); // If sticky element has got data object with prior values (meaning it was originally fixed) restore these values once off-canvas is closed 6249 6250 if (_typeof(stickyData) === 'object') { 6251 $el.css({ 6252 top: "".concat(stickyData.top, "px"), 6253 width: '', 6254 transition: '' 6255 }); 6256 $el.data('offCanvasSticky', ''); 6257 } 6258 }); 6259 } 6260 /** 6261 * Handles the revealing/hiding the off-canvas at breakpoints, not the same as open. 6262 * @param {Boolean} isRevealed - true if element should be revealed. 6263 * @function 6264 */ 6265 6266 }, { 6267 key: "reveal", 6268 value: function reveal(isRevealed) { 6269 if (isRevealed) { 6270 this.close(); 6271 this.isRevealed = true; 6272 this.$element.attr('aria-hidden', 'false'); 6273 this.$element.off('open.zf.trigger toggle.zf.trigger'); 6274 this.$element.removeClass('is-closed'); 6275 } else { 6276 this.isRevealed = false; 6277 this.$element.attr('aria-hidden', 'true'); 6278 this.$element.off('open.zf.trigger toggle.zf.trigger').on({ 6279 'open.zf.trigger': this.open.bind(this), 6280 'toggle.zf.trigger': this.toggle.bind(this) 6281 }); 6282 this.$element.addClass('is-closed'); 6283 } 6284 6285 this._addContentClasses(isRevealed); 6286 } 6287 /** 6288 * Stops scrolling of the body when OffCanvas is open on mobile Safari and other troublesome browsers. 6289 * @function 6290 * @private 6291 */ 6292 6293 }, { 6294 key: "_stopScrolling", 6295 value: function _stopScrolling() { 6296 return false; 6297 } 6298 /** 6299 * Save current finger y-position 6300 * @param event 6301 * @private 6302 */ 6303 6304 }, { 6305 key: "_recordScrollable", 6306 value: function _recordScrollable(event) { 6307 var elem = this; 6308 elem.lastY = event.touches[0].pageY; 6309 } 6310 /** 6311 * Prevent further scrolling when it hits the edges 6312 * @param event 6313 * @private 6314 */ 6315 6316 }, { 6317 key: "_preventDefaultAtEdges", 6318 value: function _preventDefaultAtEdges(event) { 6319 var elem = this; 6320 var _this = event.data; 6321 var delta = elem.lastY - event.touches[0].pageY; 6322 elem.lastY = event.touches[0].pageY; 6323 6324 if (!_this._canScroll(delta, elem)) { 6325 event.preventDefault(); 6326 } 6327 } 6328 /** 6329 * Handle continuous scrolling of scrollbox 6330 * Don't bubble up to _preventDefaultAtEdges 6331 * @param event 6332 * @private 6333 */ 6334 6335 }, { 6336 key: "_scrollboxTouchMoved", 6337 value: function _scrollboxTouchMoved(event) { 6338 var elem = this; 6339 var _this = event.data; 6340 var parent = elem.closest('[data-off-canvas], [data-off-canvas-scrollbox-outer]'); 6341 var delta = elem.lastY - event.touches[0].pageY; 6342 parent.lastY = elem.lastY = event.touches[0].pageY; 6343 event.stopPropagation(); 6344 6345 if (!_this._canScroll(delta, elem)) { 6346 if (!_this._canScroll(delta, parent)) { 6347 event.preventDefault(); 6348 } else { 6349 parent.scrollTop += delta; 6350 } 6351 } 6352 } 6353 /** 6354 * Detect possibility of scrolling 6355 * @param delta 6356 * @param elem 6357 * @returns boolean 6358 * @private 6359 */ 6360 6361 }, { 6362 key: "_canScroll", 6363 value: function _canScroll(delta, elem) { 6364 var up = delta < 0; 6365 var down = delta > 0; 6366 var allowUp = elem.scrollTop > 0; 6367 var allowDown = elem.scrollTop < elem.scrollHeight - elem.clientHeight; 6368 return up && allowUp || down && allowDown; 6369 } 6370 /** 6371 * Opens the off-canvas menu. 6372 * @function 6373 * @param {Object} event - Event object passed from listener. 6374 * @param {jQuery} trigger - element that triggered the off-canvas to open. 6375 * @fires OffCanvas#opened 6376 * @todo also trigger 'open' event? 6377 */ 6378 6379 }, { 6380 key: "open", 6381 value: function open(event, trigger) { 6382 var _this4 = this; 6383 6384 if (this.$element.hasClass('is-open') || this.isRevealed || this.isInCanvas) { 6385 return; 6386 } 6387 6388 var _this = this; 6389 6390 if (trigger) { 6391 this.$lastTrigger = trigger; 6392 } 6393 6394 if (this.options.forceTo === 'top') { 6395 window.scrollTo(0, 0); 6396 } else if (this.options.forceTo === 'bottom') { 6397 window.scrollTo(0, document.body.scrollHeight); 6398 } 6399 6400 if (this.options.transitionTime && this.options.transition !== 'overlap') { 6401 this.$element.siblings('[data-off-canvas-content]').css('transition-duration', this.options.transitionTime); 6402 } else { 6403 this.$element.siblings('[data-off-canvas-content]').css('transition-duration', ''); 6404 } 6405 6406 this.$element.addClass('is-open').removeClass('is-closed'); 6407 this.$triggers.attr('aria-expanded', 'true'); 6408 this.$element.attr('aria-hidden', 'false'); 6409 this.$content.addClass('is-open-' + this.position); // If `contentScroll` is set to false, add class and disable scrolling on touch devices. 6410 6411 if (this.options.contentScroll === false) { 6412 jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').addClass('is-off-canvas-open').on('touchmove', this._stopScrolling); 6413 this.$element.on('touchstart', this._recordScrollable); 6414 this.$element.on('touchmove', this, this._preventDefaultAtEdges); 6415 this.$element.on('touchstart', '[data-off-canvas-scrollbox]', this._recordScrollable); 6416 this.$element.on('touchmove', '[data-off-canvas-scrollbox]', this, this._scrollboxTouchMoved); 6417 } 6418 6419 if (this.options.contentOverlay === true) { 6420 this.$overlay.addClass('is-visible'); 6421 } 6422 6423 if (this.options.closeOnClick === true && this.options.contentOverlay === true) { 6424 this.$overlay.addClass('is-closable'); 6425 } 6426 6427 if (this.options.autoFocus === true) { 6428 this.$element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["transitionend"])(this.$element), function () { 6429 if (!_this.$element.hasClass('is-open')) { 6430 return; // exit if prematurely closed 6431 } 6432 6433 var canvasFocus = _this.$element.find('[data-autofocus]'); 6434 6435 if (canvasFocus.length) { 6436 canvasFocus.eq(0).focus(); 6437 } else { 6438 _this.$element.find('a, button').eq(0).focus(); 6439 } 6440 }); 6441 } 6442 6443 if (this.options.trapFocus === true) { 6444 this.$content.attr('tabindex', '-1'); 6445 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].trapFocus(this.$element); 6446 } 6447 6448 if (this.options.transition === 'push') { 6449 this._fixStickyElements(); 6450 } 6451 6452 this._addContentClasses(); 6453 /** 6454 * Fires when the off-canvas menu opens. 6455 * @event OffCanvas#opened 6456 */ 6457 6458 6459 this.$element.trigger('opened.zf.offCanvas'); 6460 /** 6461 * Fires when the off-canvas menu open transition is done. 6462 * @event OffCanvas#openedEnd 6463 */ 6464 6465 this.$element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["transitionend"])(this.$element), function () { 6466 _this4.$element.trigger('openedEnd.zf.offCanvas'); 6467 }); 6468 } 6469 /** 6470 * Closes the off-canvas menu. 6471 * @function 6472 * @param {Function} cb - optional cb to fire after closure. 6473 * @fires OffCanvas#close 6474 * @fires OffCanvas#closed 6475 */ 6476 6477 }, { 6478 key: "close", 6479 value: function close() { 6480 var _this5 = this; 6481 6482 if (!this.$element.hasClass('is-open') || this.isRevealed) { 6483 return; 6484 } 6485 /** 6486 * Fires when the off-canvas menu closes. 6487 * @event OffCanvas#close 6488 */ 6489 6490 6491 this.$element.trigger('close.zf.offCanvas'); 6492 this.$element.removeClass('is-open'); 6493 this.$element.attr('aria-hidden', 'true'); 6494 this.$content.removeClass('is-open-left is-open-top is-open-right is-open-bottom'); 6495 6496 if (this.options.contentOverlay === true) { 6497 this.$overlay.removeClass('is-visible'); 6498 } 6499 6500 if (this.options.closeOnClick === true && this.options.contentOverlay === true) { 6501 this.$overlay.removeClass('is-closable'); 6502 } 6503 6504 this.$triggers.attr('aria-expanded', 'false'); // Listen to transitionEnd: add class, re-enable scrolling and release focus when done. 6505 6506 this.$element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["transitionend"])(this.$element), function () { 6507 _this5.$element.addClass('is-closed'); 6508 6509 _this5._removeContentClasses(); 6510 6511 if (_this5.options.transition === 'push') { 6512 _this5._unfixStickyElements(); 6513 } // If `contentScroll` is set to false, remove class and re-enable scrolling on touch devices. 6514 6515 6516 if (_this5.options.contentScroll === false) { 6517 jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').removeClass('is-off-canvas-open').off('touchmove', _this5._stopScrolling); 6518 6519 _this5.$element.off('touchstart', _this5._recordScrollable); 6520 6521 _this5.$element.off('touchmove', _this5._preventDefaultAtEdges); 6522 6523 _this5.$element.off('touchstart', '[data-off-canvas-scrollbox]', _this5._recordScrollable); 6524 6525 _this5.$element.off('touchmove', '[data-off-canvas-scrollbox]', _this5._scrollboxTouchMoved); 6526 } 6527 6528 if (_this5.options.trapFocus === true) { 6529 _this5.$content.removeAttr('tabindex'); 6530 6531 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].releaseFocus(_this5.$element); 6532 } 6533 /** 6534 * Fires when the off-canvas menu close transition is done. 6535 * @event OffCanvas#closed 6536 */ 6537 6538 6539 _this5.$element.trigger('closed.zf.offCanvas'); 6540 }); 6541 } 6542 /** 6543 * Toggles the off-canvas menu open or closed. 6544 * @function 6545 * @param {Object} event - Event object passed from listener. 6546 * @param {jQuery} trigger - element that triggered the off-canvas to open. 6547 */ 6548 6549 }, { 6550 key: "toggle", 6551 value: function toggle(event, trigger) { 6552 if (this.$element.hasClass('is-open')) { 6553 this.close(event, trigger); 6554 } else { 6555 this.open(event, trigger); 6556 } 6557 } 6558 /** 6559 * Handles keyboard input when detected. When the escape key is pressed, the off-canvas menu closes, and focus is restored to the element that opened the menu. 6560 * @function 6561 * @private 6562 */ 6563 6564 }, { 6565 key: "_handleKeyboard", 6566 value: function _handleKeyboard(e) { 6567 var _this6 = this; 6568 6569 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'OffCanvas', { 6570 close: function close() { 6571 _this6.close(); 6572 6573 _this6.$lastTrigger.focus(); 6574 6575 return true; 6576 }, 6577 handled: function handled() { 6578 e.preventDefault(); 6579 } 6580 }); 6581 } 6582 /** 6583 * Destroys the OffCanvas plugin. 6584 * @function 6585 */ 6586 6587 }, { 6588 key: "_destroy", 6589 value: function _destroy() { 6590 this.close(); 6591 this.$element.off('.zf.trigger .zf.offCanvas'); 6592 this.$overlay.off('.zf.offCanvas'); 6593 if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener); 6594 } 6595 }]); 6596 6597 return OffCanvas; 6598}
6598(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 6599 6600OffCanvas.defaults = { 6601 /** 6602 * Allow the user to click outside of the menu to close it. 6603 * @option 6604 * @type {boolean} 6605 * @default true 6606 */ 6607 closeOnClick: true, 6608 6609 /** 6610 * Adds an overlay on top of `[data-off-canvas-content]`. 6611 * @option 6612 * @type {boolean} 6613 * @default true 6614 */ 6615 contentOverlay: true, 6616 6617 /** 6618 * Target an off-canvas content container by ID that may be placed anywhere. If null the closest content container will be taken. 6619 * @option 6620 * @type {?string} 6621 * @default null 6622 */ 6623 contentId: null, 6624 6625 /** 6626 * Define the off-canvas element is nested in an off-canvas content. This is required when using the contentId option for a nested element. 6627 * @option 6628 * @type {boolean} 6629 * @default null 6630 */ 6631 nested: null, 6632 6633 /** 6634 * Enable/disable scrolling of the main content when an off canvas panel is open. 6635 * @option 6636 * @type {boolean} 6637 * @default true 6638 */ 6639 contentScroll: true, 6640 6641 /** 6642 * Amount of time the open and close transition requires, including the appropriate milliseconds (`ms`) or seconds (`s`) unit (e.g. `500ms`, `.75s`) If none selected, pulls from body style. 6643 * @option 6644 * @type {string} 6645 * @default null 6646 */ 6647 transitionTime: null, 6648 6649 /** 6650 * Type of transition for the OffCanvas menu. Options are 'push', 'detached' or 'slide'. 6651 * @option 6652 * @type {string} 6653 * @default push 6654 */ 6655 transition: 'push', 6656 6657 /** 6658 * Force the page to scroll to top or bottom on open. 6659 * @option 6660 * @type {?string} 6661 * @default null 6662 */ 6663 forceTo: null, 6664 6665 /** 6666 * Allow the OffCanvas to remain open for certain breakpoints. 6667 * @option 6668 * @type {boolean} 6669 * @default false 6670 */ 6671 isRevealed: false, 6672 6673 /** 6674 * Breakpoint at which to reveal. JS will use a RegExp to target standard classes, if changing classnames, pass your class with the `revealClass` option. 6675 * @option 6676 * @type {?string} 6677 * @default null 6678 */ 6679 revealOn: null, 6680 6681 /** 6682 * Breakpoint at which the off-canvas gets moved into canvas content and acts as regular page element. 6683 * @option 6684 * @type {?string} 6685 * @default null 6686 */ 6687 inCanvasOn: null, 6688 6689 /** 6690 * Force focus to the offcanvas on open. If true, will focus the opening trigger on close. 6691 * @option 6692 * @type {boolean} 6693 * @default true 6694 */ 6695 autoFocus: true, 6696 6697 /** 6698 * Class used to force an OffCanvas to remain open. Foundation defaults for this are `reveal-for-large` & `reveal-for-medium`. 6699 * @option 6700 * @type {string} 6701 * @default reveal-for- 6702 * @todo improve the regex testing for this. 6703 */ 6704 revealClass: 'reveal-for-', 6705 6706 /** 6707 * Triggers optional focus trapping when opening an OffCanvas. Sets tabindex of [data-off-canvas-content] to -1 for accessibility purposes. 6708 * @option 6709 * @type {boolean} 6710 * @default false 6711 */ 6712 trapFocus: false 6713}; 6714 6715 6716/***/ }), 6717
vendor: 4,698 bytes, lines 6718-6756
6718/***/ "./js/foundation.orbit.js": 6719/*!********************************!*\ 6720 !*** ./js/foundation.orbit.js ***! 6721 \********************************/ 6722/*! exports provided: Orbit */ 6723/***/ (function(module, __webpack_exports__, __webpack_require__) { 6724 6725"use strict"; 6726__webpack_require__.r(__webpack_exports__); 6727/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Orbit", function() { return Orbit; }); 6728/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 6729/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 6730/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 6731/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 6732/* harmony import */ var _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.timer */ "./js/foundation.util.timer.js"); 6733/* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js"); 6734/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 6735/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 6736/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js"); 6737function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 6738 6739function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 6740 6741function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 6742 6743function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 6744 6745function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 6746 6747function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 6748 6749function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 6750 6751function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 6752 6753function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 6754 6755function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 6756
6757function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767/** 6768 * Orbit module. 6769 * @module foundation.orbit 6770 * @requires foundation.util.keyboard 6771 * @requires foundation.util.motion 6772 * @requires foundation.util.timer 6773 * @requires foundation.util.imageLoader 6774 * @requires foundation.util.touch 6775 */ 6776 6777var Orbit = /*#__PURE__*/function (_Plugin) { 6778 _inherits(Orbit, _Plugin); 6779 6780 var _super = _createSuper(Orbit); 6781 6782 function Orbit() { 6783 _classCallCheck(this, Orbit); 6784 6785 return _super.apply(this, arguments); 6786 } 6787 6788 _createClass(Orbit, [{ 6789 key: "_setup", 6790 value: 6791 /** 6792 * Creates a new instance of an orbit carousel. 6793 * @class 6794 * @name Orbit 6795 * @param {jQuery} element - jQuery object to make into an Orbit Carousel. 6796 * @param {Object} options - Overrides to the default plugin settings. 6797 */ 6798 function _setup(element, options) { 6799 this.$element = element; 6800 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Orbit.defaults, this.$element.data(), options); 6801 this.className = 'Orbit'; // ie9 back compat 6802 6803 _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); // Touch init is idempotent, we just need to make sure it's initialied. 6804 6805 this._init(); 6806 6807 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Orbit', { 6808 'ltr': { 6809 'ARROW_RIGHT': 'next', 6810 'ARROW_LEFT': 'previous' 6811 }, 6812 'rtl': { 6813 'ARROW_LEFT': 'next', 6814 'ARROW_RIGHT': 'previous' 6815 } 6816 }); 6817 } 6818 /** 6819 * Initializes the plugin by creating jQuery collections, setting attributes, and starting the animation. 6820 * @function 6821 * @private 6822 */ 6823 6824 }, { 6825 key: "_init", 6826 value: function _init() { 6827 // @TODO: consider discussion on PR #9278 about DOM pollution by changeSlide 6828 this._reset(); 6829 6830 this.$wrapper = this.$element.find(".".concat(this.options.containerClass)); 6831 this.$slides = this.$element.find(".".concat(this.options.slideClass)); 6832 var $images = this.$element.find('img'), 6833 initActive = this.$slides.filter('.is-active'), 6834 id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_5__["GetYoDigits"])(6, 'orbit'); 6835 this.$element.attr({ 6836 'data-resize': id, 6837 'id': id 6838 }); 6839 6840 if (!initActive.length) { 6841 this.$slides.eq(0).addClass('is-active'); 6842 } 6843 6844 if (!this.options.useMUI) { 6845 this.$slides.addClass('no-motionui'); 6846 } 6847 6848 if ($images.length) { 6849 Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"])($images, this._prepareForOrbit.bind(this)); 6850 } else { 6851 this._prepareForOrbit(); //hehe 6852 6853 } 6854 6855 if (this.options.bullets) { 6856 this._loadBullets(); 6857 } 6858 6859 this._events(); 6860 6861 if (this.options.autoPlay && this.$slides.length > 1) { 6862 this.geoSync(); 6863 } 6864 6865 if (this.options.accessible) { 6866 // allow wrapper to be focusable to enable arrow navigation 6867 this.$wrapper.attr('tabindex', 0); 6868 } 6869 } 6870 /** 6871 * Creates a jQuery collection of bullets, if they are being used. 6872 * @function 6873 * @private 6874 */ 6875 6876 }, { 6877 key: "_loadBullets", 6878 value: function _loadBullets() { 6879 this.$bullets = this.$element.find(".".concat(this.options.boxOfBullets)).find('button'); 6880 } 6881 /** 6882 * Sets a `timer` object on the orbit, and starts the counter for the next slide. 6883 * @function 6884 */ 6885 6886 }, { 6887 key: "geoSync", 6888 value: function geoSync() { 6889 var _this = this; 6890 6891 this.timer = new _foundation_util_timer__WEBPACK_IMPORTED_MODULE_3__["Timer"](this.$element, { 6892 duration: this.options.timerDelay, 6893 infinite: false 6894 }, function () { 6895 _this.changeSlide(true); 6896 }); 6897 this.timer.start(); 6898 } 6899 /** 6900 * Sets wrapper and slide heights for the orbit. 6901 * @function 6902 * @private 6903 */ 6904 6905 }, { 6906 key: "_prepareForOrbit", 6907 value: function _prepareForOrbit() { 6908 this._setWrapperHeight(); 6909 } 6910 /** 6911 * Calulates the height of each slide in the collection, and uses the tallest one for the wrapper height. 6912 * @function 6913 * @private 6914 * @param {Function} cb - a callback function to fire when complete. 6915 */ 6916 6917 }, { 6918 key: "_setWrapperHeight", 6919 value: function _setWrapperHeight(cb) { 6920 //rewrite this to `for` loop 6921 var max = 0, 6922 temp, 6923 counter = 0, 6924 _this = this; 6925 6926 this.$slides.each(function () { 6927 temp = this.getBoundingClientRect().height; 6928 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('data-sli
vendor: 14,145 bytes, lines 6928-7385
6928de', counter); // hide all slides but the active one 6929 6930 if (!/mui/g.test(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)[0].className) && _this.$slides.filter('.is-active')[0] !== _this.$slides.eq(counter)[0]) { 6931 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).css({ 6932 'display': 'none' 6933 }); 6934 } 6935 6936 max = temp > max ? temp : max; 6937 counter++; 6938 }); 6939 6940 if (counter === this.$slides.length) { 6941 this.$wrapper.css({ 6942 'height': max 6943 }); //only change the wrapper height property once. 6944 6945 if (cb) { 6946 cb(max); 6947 } //fire callback with max height dimension. 6948 6949 } 6950 } 6951 /** 6952 * Sets the max-height of each slide. 6953 * @function 6954 * @private 6955 */ 6956 6957 }, { 6958 key: "_setSlideHeight", 6959 value: function _setSlideHeight(height) { 6960 this.$slides.each(function () { 6961 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).css('max-height', height); 6962 }); 6963 } 6964 /** 6965 * Adds event listeners to basically everything within the element. 6966 * @function 6967 * @private 6968 */ 6969 6970 }, { 6971 key: "_events", 6972 value: function _events() { 6973 var _this = this; //*************************************** 6974 //**Now using custom event - thanks to:** 6975 //** Yohai Ararat of Toronto ** 6976 //*************************************** 6977 // 6978 6979 6980 this.$element.off('.resizeme.zf.trigger').on({ 6981 'resizeme.zf.trigger': this._prepareForOrbit.bind(this) 6982 }); 6983 6984 if (this.$slides.length > 1) { 6985 if (this.options.swipe) { 6986 this.$slides.off('swipeleft.zf.orbit swiperight.zf.orbit').on('swipeleft.zf.orbit', function (e) { 6987 e.preventDefault(); 6988 6989 _this.changeSlide(true); 6990 }).on('swiperight.zf.orbit', function (e) { 6991 e.preventDefault(); 6992 6993 _this.changeSlide(false); 6994 }); 6995 } //*************************************** 6996 6997 6998 if (this.options.autoPlay) { 6999 this.$slides.on('click.zf.orbit', function () { 7000 _this.$element.data('clickedOn', _this.$element.data('clickedOn') ? false : true); 7001 7002 _this.timer[_this.$element.data('clickedOn') ? 'pause' : 'start'](); 7003 }); 7004 7005 if (this.options.pauseOnHover) { 7006 this.$element.on('mouseenter.zf.orbit', function () { 7007 _this.timer.pause(); 7008 }).on('mouseleave.zf.orbit', function () { 7009 if (!_this.$element.data('clickedOn')) { 7010 _this.timer.start(); 7011 } 7012 }); 7013 } 7014 } 7015 7016 if (this.options.navButtons) { 7017 var $controls = this.$element.find(".".concat(this.options.nextClass, ", .").concat(this.options.prevClass)); 7018 $controls.attr('tabindex', 0) //also need to handle enter/return and spacebar key presses 7019 .on('click.zf.orbit touchend.zf.orbit', function (e) { 7020 e.preventDefault(); 7021 7022 _this.changeSlide(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).hasClass(_this.options.nextClass)); 7023 }); 7024 } 7025 7026 if (this.options.bullets) { 7027 this.$bullets.on('click.zf.orbit touchend.zf.orbit', function () { 7028 if (/is-active/g.test(this.className)) { 7029 return false; 7030 } //if this is active, kick out of function. 7031 7032 7033 var idx = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('slide'), 7034 ltr = idx > _this.$slides.filter('.is-active').data('slide'), 7035 $slide = _this.$slides.eq(idx); 7036 7037 _this.changeSlide(ltr, $slide, idx); 7038 }); 7039 } 7040 7041 if (this.options.accessible) { 7042 this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function (e) { 7043 // handle keyboard event with keyboard util 7044 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Orbit', { 7045 next: function next() { 7046 _this.changeSlide(true); 7047 }, 7048 previous: function previous() { 7049 _this.changeSlide(false); 7050 }, 7051 handled: function handled() { 7052 // if bullet is focused, make sure focus moves 7053 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).is(_this.$bullets)) { 7054 _this.$bullets.filter('.is-active').focus(); 7055 } 7056 } 7057 }); 7058 }); 7059 } 7060 } 7061 } 7062 /** 7063 * Resets Orbit so it can be reinitialized 7064 */ 7065 7066 }, { 7067 key: "_reset", 7068 value: function _reset() { 7069 // Don't do anything if there are no slides (first run) 7070 if (typeof this.$slides === 'undefined') { 7071 return; 7072 } 7073 7074 if (this.$slides.length > 1) { 7075 // Remove old events 7076 this.$element.off('.zf.orbit').find('*').off('.zf.orbit'); // Restart timer if autoPlay is enabled 7077 7078 if (this.options.autoPlay) { 7079 this.timer.restart(); 7080 } // Reset all sliddes 7081 7082 7083 this.$slides.each(function (el) { 7084 jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).removeClass('is-active is-active is-in').removeAttr('aria-live').hide(); 7085 }); // Show the first slide 7086 7087 this.$slides.first().addClass('is-active').show(); // Triggers when the slide has finished animating 7088 7089 this.$element.trigger('slidechange.zf.orbit', [this.$slides.first()]); // Select first bullet if bullets are present 7090 7091 if (this.options.bullets) { 7092 this._updateBullets(0); 7093 } 7094 } 7095 } 7096 /** 7097 * Changes the current slide to a new one. 7098 * @function 7099 * @param {Boolean} isLTR - if true the slide moves from right to left, if false the slide moves from left to right. 7100 * @param {jQuery} chosenSlide - the jQuery element of the slide to show next, if one is selected. 7101 * @param {Number} idx - the index of the new slide in its collection, if one chosen. 7102 * @fires Orbit#slidechange 7103 */ 7104 7105 }, { 7106 key: "changeSlide", 7107 value: function changeSlide(isLTR, chosenSlide, idx) { 7108 if (!this.$slides) { 7109 return; 7110 } // Don't freak out if we're in the middle of cleanup 7111 7112 7113 var $curSlide = this.$slides.filter('.is-active').eq(0); 7114 7115 if (/mui/g.test($curSlide[0].className)) { 7116 return false; 7117 } //if the slide is currently animating, kick out of the function 7118 7119 7120 var $firstSlide = this.$slides.first(), 7121 $lastSlide = this.$slides.last(), 7122 dirIn = isLTR ? 'Right' : 'Left', 7123 dirOut = isLTR ? 'Left' : 'Right', 7124 _this = this, 7125 $newSlide; 7126 7127 if (!chosenSlide) { 7128 //most of the time, this will be auto played or clicked from the navButtons. 7129 $newSlide = isLTR ? //if wrapping enabled, check to see if there is a `next` or `prev` sibling, if not, select the first or last slide to fill in. if wrapping not enabled, attempt to select `next` or `prev`, if there's nothing there, the function will kick out on next step. CRAZY NESTED TERNARIES!!!!! 7130 this.options.infiniteWrap ? $curSlide.next(".".concat(this.options.slideClass)).length ? $curSlide.next(".".concat(this.options.slideClass)) : $firstSlide : $curSlide.next(".".concat(this.options.slideClass)) //pick next slide if moving left to right 7131 : this.options.infiniteWrap ? $curSlide.prev(".".concat(this.options.slideClass)).length ? $curSlide.prev(".".concat(this.options.slideClass)) : $lastSlide : $curSlide.prev(".".concat(this.options.slideClass)); //pick prev slide if moving right to left 7132 } else { 7133 $newSlide = chosenSlide; 7134 } 7135 7136 if ($newSlide.length) { 7137 /** 7138 * Triggers before the next slide starts animating in and only if a next slide has been found. 7139 * @event Orbit#beforeslidechange 7140 */ 7141 this.$element.trigger('beforeslidechange.zf.orbit', [$curSlide, $newSlide]); 7142 7143 if (this.options.bullets) { 7144 idx = idx || this.$slides.index($newSlide); //grab index to update bullets 7145 7146 this._updateBullets(idx); 7147 } 7148 7149 if (this.options.useMUI && !this.$element.is(':hidden')) { 7150 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateIn($newSlide.addClass('is-active'), this.options["animInFrom".concat(dirIn)], function () { 7151 $newSlide.css({ 7152 'display': 'block' 7153 }).attr('aria-live', 'polite'); 7154 }); 7155 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut($curSlide.removeClass('is-active'), this.options["animOutTo".concat(dirOut)], function () { 7156 $curSlide.removeAttr('aria-live'); 7157 7158 if (_this.options.autoPlay && !_this.timer.isPaused) { 7159 _this.timer.restart(); 7160 } //do stuff? 7161 7162 }); 7163 } else { 7164 $curSlide.removeClass('is-active is-in').removeAttr('aria-live').hide(); 7165 $newSlide.addClass('is-active is-in').attr('aria-live', 'polite').show(); 7166 7167 if (this.options.autoPlay && !this.timer.isPaused) { 7168 this.timer.restart(); 7169 } 7170 } 7171 /** 7172 * Triggers when the slide has finished animating in. 7173 * @event Orbit#slidechange 7174 */ 7175 7176 7177 this.$element.trigger('slidechange.zf.orbit', [$newSlide]); 7178 } 7179 } 7180 /** 7181 * Updates the active state of the bullets, if displayed. 7182 * Move the descriptor of the current slide `[data-slide-active-label]` to the newly active bullet. 7183 * If no `[data-slide-active-label]` is set, will move the exceeding `span` element. 7184 * 7185 * @function 7186 * @private 7187 * @param {Number} idx - the index of the current slide. 7188 */ 7189 7190 }, { 7191 key: "_updateBullets", 7192 value: function _updateBullets(idx) { 7193 var $oldBullet = this.$bullets.filter('.is-active'); 7194 var $othersBullets = this.$bullets.not('.is-active'); 7195 var $newBullet = this.$bullets.eq(idx); 7196 $oldBullet.removeClass('is-active').blur(); 7197 $newBullet.addClass('is-active'); // Find the descriptor for the current slide to move it to the new slide button 7198 7199 var activeStateDescriptor = $oldBullet.children('[data-slide-active-label]').last(); // If not explicitely given, search for the last "exceeding" span element (compared to others bullets). 7200 7201 if (!activeStateDescriptor.length) { 7202 var spans = $oldBullet.children('span'); 7203 var spanCountInOthersBullets = $othersBullets.toArray().map(function (b) { 7204 return jquery__WEBPACK_IMPORTED_MODULE_0___default()(b).children('span').length; 7205 }); // If there is an exceeding span element, use it as current slide descriptor 7206 7207 if (spanCountInOthersBullets.every(function (count) { 7208 return count < spans.length; 7209 })) { 7210 activeStateDescriptor = spans.last(); 7211 activeStateDescriptor.attr('data-slide-active-label', ''); 7212 } 7213 } // Move the current slide descriptor to the new slide button 7214 7215 7216 if (activeStateDescriptor.length) { 7217 activeStateDescriptor.detach(); 7218 $newBullet.append(activeStateDescriptor); 7219 } 7220 } 7221 /** 7222 * Destroys the carousel and hides the element. 7223 * @function 7224 */ 7225 7226 }, { 7227 key: "_destroy", 7228 value: function _destroy() { 7229 this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide(); 7230 } 7231 }]); 7232 7233 return Orbit; 7234}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_6__["Plugin"]); 7235 7236Orbit.defaults = { 7237 /** 7238 * Tells the JS to look for and loadBullets. 7239 * @option 7240 * @type {boolean} 7241 * @default true 7242 */ 7243 bullets: true, 7244 7245 /** 7246 * Tells the JS to apply event listeners to nav buttons 7247 * @option 7248 * @type {boolean} 7249 * @default true 7250 */ 7251 navButtons: true, 7252 7253 /** 7254 * motion-ui animation class to apply 7255 * @option 7256 * @type {string} 7257 * @default 'slide-in-right' 7258 */ 7259 animInFromRight: 'slide-in-right', 7260 7261 /** 7262 * motion-ui animation class to apply 7263 * @option 7264 * @type {string} 7265 * @default 'slide-out-right' 7266 */ 7267 animOutToRight: 'slide-out-right', 7268 7269 /** 7270 * motion-ui animation class to apply 7271 * @option 7272 * @type {string} 7273 * @default 'slide-in-left' 7274 * 7275 */ 7276 animInFromLeft: 'slide-in-left', 7277 7278 /** 7279 * motion-ui animation class to apply 7280 * @option 7281 * @type {string} 7282 * @default 'slide-out-left' 7283 */ 7284 animOutToLeft: 'slide-out-left', 7285 7286 /** 7287 * Allows Orbit to automatically animate on page load. 7288 * @option 7289 * @type {boolean} 7290 * @default true 7291 */ 7292 autoPlay: true, 7293 7294 /** 7295 * Amount of time, in ms, between slide transitions 7296 * @option 7297 * @type {number} 7298 * @default 5000 7299 */ 7300 timerDelay: 5000, 7301 7302 /** 7303 * Allows Orbit to infinitely loop through the slides 7304 * @option 7305 * @type {boolean} 7306 * @default true 7307 */ 7308 infiniteWrap: true, 7309 7310 /** 7311 * Allows the Orbit slides to bind to swipe events for mobile, requires an additional util library 7312 * @option 7313 * @type {boolean} 7314 * @default true 7315 */ 7316 swipe: true, 7317 7318 /** 7319 * Allows the timing function to pause animation on hover. 7320 * @option 7321 * @type {boolean} 7322 * @default true 7323 */ 7324 pauseOnHover: true, 7325 7326 /** 7327 * Allows Orbit to bind keyboard events to the slider, to animate frames with arrow keys 7328 * @option 7329 * @type {boolean} 7330 * @default true 7331 */ 7332 accessible: true, 7333 7334 /** 7335 * Class applied to the container of Orbit 7336 * @option 7337 * @type {string} 7338 * @default 'orbit-container' 7339 */ 7340 containerClass: 'orbit-container', 7341 7342 /** 7343 * Class applied to individual slides. 7344 * @option 7345 * @type {string} 7346 * @default 'orbit-slide' 7347 */ 7348 slideClass: 'orbit-slide', 7349 7350 /** 7351 * Class applied to the bullet container. You're welcome. 7352 * @option 7353 * @type {string} 7354 * @default 'orbit-bullets' 7355 */ 7356 boxOfBullets: 'orbit-bullets', 7357 7358 /** 7359 * Class applied to the `next` navigation button. 7360 * @option 7361 * @type {string} 7362 * @default 'orbit-next' 7363 */ 7364 nextClass: 'orbit-next', 7365 7366 /** 7367 * Class applied to the `previous` navigation button. 7368 * @option 7369 * @type {string} 7370 * @default 'orbit-previous' 7371 */ 7372 prevClass: 'orbit-previous', 7373 7374 /** 7375 * Boolean to flag the js to use motion ui classes or not. Default to true for backwards compatibility. 7376 * @option 7377 * @type {boolean} 7378 * @default true 7379 */ 7380 useMUI: true 7381}; 7382 7383 7384/***/ }), 7385
vendor: 4,177 bytes, lines 7386-7426
7386/***/ "./js/foundation.positionable.js": 7387/*!***************************************!*\ 7388 !*** ./js/foundation.positionable.js ***! 7389 \***************************************/ 7390/*! exports provided: Positionable */ 7391/***/ (function(module, __webpack_exports__, __webpack_require__) { 7392 7393"use strict"; 7394__webpack_require__.r(__webpack_exports__); 7395/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Positionable", function() { return Positionable; }); 7396/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.util.box */ "./js/foundation.util.box.js"); 7397/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 7398/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 7399function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 7400 7401function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 7402 7403function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 7404 7405function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 7406 7407function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 7408 7409function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 7410 7411function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 7412 7413function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 7414 7415function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 7416 7417function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 7418 7419function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 7420 7421 7422 7423 7424var POSITIONS = ['left', 'right', 'top', 'bottom']; 7425var VERTICAL_ALIGNMENTS = ['top', 'bottom', 'center']; 7426var HORIZONTAL_ALIGNMENTS = ['left', 'right', 'center'];
vendor: 4,280 bytes, lines 7427-7565
7427var ALIGNMENTS = { 7428 'left': VERTICAL_ALIGNMENTS, 7429 'right': VERTICAL_ALIGNMENTS, 7430 'top': HORIZONTAL_ALIGNMENTS, 7431 'bottom': HORIZONTAL_ALIGNMENTS 7432}; 7433 7434function nextItem(item, array) { 7435 var currentIdx = array.indexOf(item); 7436 7437 if (currentIdx === array.length - 1) { 7438 return array[0]; 7439 } else { 7440 return array[currentIdx + 1]; 7441 } 7442} 7443 7444var Positionable = /*#__PURE__*/function (_Plugin) { 7445 _inherits(Positionable, _Plugin); 7446 7447 var _super = _createSuper(Positionable); 7448 7449 function Positionable() { 7450 _classCallCheck(this, Positionable); 7451 7452 return _super.apply(this, arguments); 7453 } 7454 7455 _createClass(Positionable, [{ 7456 key: "_init", 7457 value: 7458 /** 7459 * Abstract class encapsulating the tether-like explicit positioning logic 7460 * including repositioning based on overlap. 7461 * Expects classes to define defaults for vOffset, hOffset, position, 7462 * alignment, allowOverlap, and allowBottomOverlap. They can do this by 7463 * extending the defaults, or (for now recommended due to the way docs are 7464 * generated) by explicitly declaring them. 7465 * 7466 **/ 7467 function _init() { 7468 this.triedPositions = {}; 7469 this.position = this.options.position === 'auto' ? this._getDefaultPosition() : this.options.position; 7470 this.alignment = this.options.alignment === 'auto' ? this._getDefaultAlignment() : this.options.alignment; 7471 this.originalPosition = this.position; 7472 this.originalAlignment = this.alignment; 7473 } 7474 }, { 7475 key: "_getDefaultPosition", 7476 value: function _getDefaultPosition() { 7477 return 'bottom'; 7478 } 7479 }, { 7480 key: "_getDefaultAlignment", 7481 value: function _getDefaultAlignment() { 7482 switch (this.position) { 7483 case 'bottom': 7484 case 'top': 7485 return Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["rtl"])() ? 'right' : 'left'; 7486 7487 case 'left': 7488 case 'right': 7489 return 'bottom'; 7490 } 7491 } 7492 /** 7493 * Adjusts the positionable possible positions by iterating through alignments 7494 * and positions. 7495 * @function 7496 * @private 7497 */ 7498 7499 }, { 7500 key: "_reposition", 7501 value: function _reposition() { 7502 if (this._alignmentsExhausted(this.position)) { 7503 this.position = nextItem(this.position, POSITIONS); 7504 this.alignment = ALIGNMENTS[this.position][0]; 7505 } else { 7506 this._realign(); 7507 } 7508 } 7509 /** 7510 * Adjusts the dropdown pane possible positions by iterating through alignments 7511 * on the current position. 7512 * @function 7513 * @private 7514 */ 7515 7516 }, { 7517 key: "_realign", 7518 value: function _realign() { 7519 this._addTriedPosition(this.position, this.alignment); 7520 7521 this.alignment = nextItem(this.alignment, ALIGNMENTS[this.position]); 7522 } 7523 }, { 7524 key: "_addTriedPosition", 7525 value: function _addTriedPosition(position, alignment) { 7526 this.triedPositions[position] = this.triedPositions[position] || []; 7527 this.triedPositions[position].push(alignment); 7528 } 7529 }, { 7530 key: "_positionsExhausted", 7531 value: function _positionsExhausted() { 7532 var isExhausted = true; 7533 7534 for (var i = 0; i < POSITIONS.length; i++) { 7535 isExhausted = isExhausted && this._alignmentsExhausted(POSITIONS[i]); 7536 } 7537 7538 return isExhausted; 7539 } 7540 }, { 7541 key: "_alignmentsExhausted", 7542 value: function _alignmentsExhausted(position) { 7543 return this.triedPositions[position] && this.triedPositions[position].length === ALIGNMENTS[position].length; 7544 } // When we're trying to center, we don't want to apply offset that's going to 7545 // take us just off center, so wrap around to return 0 for the appropriate 7546 // offset in those alignments. TODO: Figure out if we want to make this 7547 // configurable behavior... it feels more intuitive, especially for tooltips, but 7548 // it's possible someone might actually want to start from center and then nudge 7549 // slightly off. 7550 7551 }, { 7552 key: "_getVOffset", 7553 value: function _getVOffset() { 7554 return this.options.vOffset; 7555 } 7556 }, { 7557 key: "_getHOffset", 7558 value: function _getHOffset() { 7559 return this.options.hOffset; 7560 } 7561 }, { 7562 key: "_setPosition", 7563 value: function _setPosition($anchor, $element, $parent) { 7564 if ($anchor.attr('aria-expanded') === 'false') { 7565 return false;
7566 } 7567 7568 if (!this.options.allowOverlap) { 7569 // restore original position & alignment before checking overlap 7570 this.position = this.originalPosition; 7571 this.alignment = this.originalAlignment; 7572 } 7573 7574 $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset())); 7575 7576 if (!this.options.allowOverlap) { 7577 var minOverlap = 100000000; // default coordinates to how we start, in case we can't figure out better 7578 7579 var minCoordinates = { 7580 position: this.position, 7581 alignment: this.alignment 7582 }; 7583 7584 while (!this._positionsExhausted()) { 7585 var overlap = _foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].OverlapArea($element, $parent, false, false, this.options.allowBottomOverlap); 7586 7587 if (overlap === 0) { 7588 return; 7589 } 7590 7591 if (overlap < minOverlap) { 7592 minOverlap = overlap; 7593 minCoordinates = { 7594 position: this.position, 7595 alignment: this.alignment 7596 }; 7597 } 7598 7599 this._reposition(); 7600 7601 $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset())); 7602 } // If we get through the entire loop, there was no non-overlapping 7603 // position available. Pick the version with least overlap. 7604 7605 7606 this.position = minCoordinates.position; 7607 this.alignment = minCoordinates.alignment; 7608 $element.offset(_foundation_util_box__WEBPACK_IMPORTED_MODULE_0__["Box"].GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset())); 7609 } 7610 } 7611 }]); 7612 7613 return Positionable; 7614}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 7615 7616Positionable.defaults = { 7617 /** 7618 * Position of positionable relative to anchor. Can be left, right, bottom, top, or auto. 7619 * @option 7620 * @type {string} 7621 * @default 'auto' 7622 */ 7623 position: 'auto', 7624 7625 /** 7626 * Alignment of positionable relative to anchor. Can be left, right, bottom, top, center, or auto. 7627 * @option 7628 * @type {string} 7629 * @default 'auto' 7630 */ 7631 alignment: 'auto', 7632 7633 /** 7634 * Allow overlap of container/window. If false, dropdown positionable first 7635 * try to position as defined by data-position and data-alignment, but 7636 * reposition if it would cause an overflow. 7637 * @option 7638 * @type {boolean} 7639 * @default false 7640 */ 7641 allowOverlap: false, 7642 7643 /** 7644 * Allow overlap of only the bottom of the container. This is the most common 7645 * behavior for dropdowns, allowing the dropdown to extend the bottom of the 7646 * screen but not otherwise influence or break out of the container. 7647 * @option 7648 * @type {boolean} 7649 * @default true 7650 */ 7651 allowBottomOverlap: true, 7652 7653 /** 7654 * Number of pixels the positionable should be separated vertically from anchor 7655 * @option 7656 * @type {number} 7657 * @default 0 7658 */ 7659 vOffset: 0, 7660 7661 /** 7662 * Number of pixels the positionable should be separated horizontally from anchor 7663 * @option 7664 * @type {number} 7665 * @default 0 7666 */ 7667 hOffset: 0 7668}; 7669 7670 7671/***/ }), 7672
vendor: 4,460 bytes, lines 7673-7709
7673/***/ "./js/foundation.responsiveAccordionTabs.js": 7674/*!**************************************************!*\ 7675 !*** ./js/foundation.responsiveAccordionTabs.js ***! 7676 \**************************************************/ 7677/*! exports provided: ResponsiveAccordionTabs */ 7678/***/ (function(module, __webpack_exports__, __webpack_require__) { 7679 7680"use strict"; 7681__webpack_require__.r(__webpack_exports__); 7682/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveAccordionTabs", function() { return ResponsiveAccordionTabs; }); 7683/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 7684/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 7685/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 7686/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 7687/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 7688/* harmony import */ var _foundation_accordion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.accordion */ "./js/foundation.accordion.js"); 7689/* harmony import */ var _foundation_tabs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.tabs */ "./js/foundation.tabs.js"); 7690function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 7691 7692function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 7693 7694function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 7695 7696function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 7697 7698function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 7699 7700function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 7701 7702function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 7703 7704function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 7705 7706function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 7707 7708function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 7709
vendor: 12,526 bytes, lines 7710-8039
7710function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 7711 7712 7713 7714 7715 7716 7717 // The plugin matches the plugin classes with these plugin instances. 7718 7719var MenuPlugins = { 7720 tabs: { 7721 cssClass: 'tabs', 7722 plugin: _foundation_tabs__WEBPACK_IMPORTED_MODULE_5__["Tabs"], 7723 open: function open(plugin, target) { 7724 return plugin.selectTab(target); 7725 }, 7726 close: null 7727 /* not supported */ 7728 , 7729 toggle: null 7730 /* not supported */ 7731 7732 }, 7733 accordion: { 7734 cssClass: 'accordion', 7735 plugin: _foundation_accordion__WEBPACK_IMPORTED_MODULE_4__["Accordion"], 7736 open: function open(plugin, target) { 7737 return plugin.down(jquery__WEBPACK_IMPORTED_MODULE_0___default()(target)); 7738 }, 7739 close: function close(plugin, target) { 7740 return plugin.up(jquery__WEBPACK_IMPORTED_MODULE_0___default()(target)); 7741 }, 7742 toggle: function toggle(plugin, target) { 7743 return plugin.toggle(jquery__WEBPACK_IMPORTED_MODULE_0___default()(target)); 7744 } 7745 } 7746}; 7747/** 7748 * ResponsiveAccordionTabs module. 7749 * @module foundation.responsiveAccordionTabs 7750 * @requires foundation.util.motion 7751 * @requires foundation.accordion 7752 * @requires foundation.tabs 7753 */ 7754 7755var ResponsiveAccordionTabs = /*#__PURE__*/function (_Plugin) { 7756 _inherits(ResponsiveAccordionTabs, _Plugin); 7757 7758 var _super = _createSuper(ResponsiveAccordionTabs); 7759 7760 function ResponsiveAccordionTabs(element, options) { 7761 var _this2; 7762 7763 _classCallCheck(this, ResponsiveAccordionTabs); 7764 7765 _this2 = _super.call(this, element, options); 7766 return _possibleConstructorReturn(_this2, _this2.options.reflow && _this2.storezfData || _assertThisInitialized(_this2)); 7767 } 7768 /** 7769 * Creates a new instance of a responsive accordion tabs. 7770 * @class 7771 * @name ResponsiveAccordionTabs 7772 * @fires ResponsiveAccordionTabs#init 7773 * @param {jQuery} element - jQuery object to make into Responsive Accordion Tabs. 7774 * @param {Object} options - Overrides to the default plugin settings. 7775 */ 7776 7777 7778 _createClass(ResponsiveAccordionTabs, [{ 7779 key: "_setup", 7780 value: function _setup(element, options) { 7781 this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element); 7782 this.$element.data('zfPluginBase', this); 7783 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, ResponsiveAccordionTabs.defaults, this.$element.data(), options); 7784 this.rules = this.$element.data('responsive-accordion-tabs'); 7785 this.currentMq = null; 7786 this.currentRule = null; 7787 this.currentPlugin = null; 7788 this.className = 'ResponsiveAccordionTabs'; // ie9 back compat 7789 7790 if (!this.$element.attr('id')) { 7791 this.$element.attr('id', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'responsiveaccordiontabs')); 7792 } 7793 7794 this._init(); 7795 7796 this._events(); 7797 } 7798 /** 7799 * Initializes the Menu by parsing the classes from the 'data-responsive-accordion-tabs' attribute on the element. 7800 * @function 7801 * @private 7802 */ 7803 7804 }, { 7805 key: "_init", 7806 value: function _init() { 7807 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); // The first time an Interchange plugin is initialized, this.rules is converted from a string of "classes" to an object of rules 7808 7809 7810 if (typeof this.rules === 'string') { 7811 var rulesTree = {}; // Parse rules from "classes" pulled from data attribute 7812 7813 var rules = this.rules.split(' '); // Iterate through every rule found 7814 7815 for (var i = 0; i < rules.length; i++) { 7816 var rule = rules[i].split('-'); 7817 var ruleSize = rule.length > 1 ? rule[0] : 'small'; 7818 var rulePlugin = rule.length > 1 ? rule[1] : rule[0]; 7819 7820 if (MenuPlugins[rulePlugin] !== null) { 7821 rulesTree[ruleSize] = MenuPlugins[rulePlugin]; 7822 } 7823 } 7824 7825 this.rules = rulesTree; 7826 } 7827 7828 this._getAllOptions(); 7829 7830 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default.a.isEmptyObject(this.rules)) { 7831 this._checkMediaQueries(); 7832 } 7833 } 7834 }, { 7835 key: "_getAllOptions", 7836 value: function _getAllOptions() { 7837 //get all defaults and options 7838 var _this = this; 7839 7840 _this.allOptions = {}; 7841 7842 for (var key in MenuPlugins) { 7843 if (MenuPlugins.hasOwnProperty(key)) { 7844 var obj = MenuPlugins[key]; 7845 7846 try { 7847 var dummyPlugin = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<ul></ul>'); 7848 var tmpPlugin = new obj.plugin(dummyPlugin, _this.options); 7849 7850 for (var keyKey in tmpPlugin.options) { 7851 if (tmpPlugin.options.hasOwnProperty(keyKey) && keyKey !== 'zfPlugin') { 7852 var objObj = tmpPlugin.options[keyKey]; 7853 _this.allOptions[keyKey] = objObj; 7854 } 7855 } 7856 7857 tmpPlugin.destroy(); 7858 } catch (e) { 7859 console.warn("Warning: Problems getting Accordion/Tab options: ".concat(e)); 7860 } 7861 } 7862 } 7863 } 7864 /** 7865 * Initializes events for the Menu. 7866 * @function 7867 * @private 7868 */ 7869 7870 }, { 7871 key: "_events", 7872 value: function _events() { 7873 this._changedZfMediaQueryHandler = this._checkMediaQueries.bind(this); 7874 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._changedZfMediaQueryHandler); 7875 } 7876 /** 7877 * Checks the current screen width against available media queries. If the media query has changed, and the plugin needed has changed, the plugins will swap out. 7878 * @function 7879 * @private 7880 */ 7881 7882 }, { 7883 key: "_checkMediaQueries", 7884 value: function _checkMediaQueries() { 7885 var matchedMq, 7886 _this = this; // Iterate through each rule and find the last matching rule 7887 7888 7889 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(this.rules, function (key) { 7890 if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(key)) { 7891 matchedMq = key; 7892 } 7893 }); // No match? No dice 7894 7895 if (!matchedMq) return; // Plugin already initialized? We good 7896 7897 if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return; // Remove existing plugin-specific CSS classes 7898 7899 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(MenuPlugins, function (key, value) { 7900 _this.$element.removeClass(value.cssClass); 7901 }); // Add the CSS class for the new plugin 7902 7903 this.$element.addClass(this.rules[matchedMq].cssClass); // Create an instance of the new plugin 7904 7905 if (this.currentPlugin) { 7906 //don't know why but on nested elements data zfPlugin get's lost 7907 if (!this.currentPlugin.$element.data('zfPlugin') && this.storezfData) this.currentPlugin.$element.data('zfPlugin', this.storezfData); 7908 this.currentPlugin.destroy(); 7909 } 7910 7911 this._handleMarkup(this.rules[matchedMq].cssClass); 7912 7913 this.currentRule = this.rules[matchedMq]; 7914 this.currentPlugin = new this.currentRule.plugin(this.$element, this.options); 7915 this.storezfData = this.currentPlugin.$element.data('zfPlugin'); 7916 } 7917 }, { 7918 key: "_handleMarkup", 7919 value: function _handleMarkup(toSet) { 7920 var _this = this, 7921 fromString = 'accordion'; 7922 7923 var $panels = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + this.$element.attr('id') + ']'); 7924 if ($panels.length) fromString = 'tabs'; 7925 7926 if (fromString === toSet) { 7927 return; 7928 } 7929 7930 var tabsTitle = _this.allOptions.linkClass ? _this.allOptions.linkClass : 'tabs-title'; 7931 var tabsPanel = _this.allOptions.panelClass ? _this.allOptions.panelClass : 'tabs-panel'; 7932 this.$element.removeAttr('role'); 7933 var $liHeads = this.$element.children('.' + tabsTitle + ',[data-accordion-item]').removeClass(tabsTitle).removeClass('accordion-item').removeAttr('data-accordion-item'); 7934 var $liHeadsA = $liHeads.children('a').removeClass('accordion-title'); 7935 7936 if (fromString === 'tabs') { 7937 $panels = $panels.children('.' + tabsPanel).removeClass(tabsPanel).removeAttr('role').removeAttr('aria-hidden').removeAttr('aria-labelledby'); 7938 $panels.children('a').removeAttr('role').removeAttr('aria-controls').removeAttr('aria-selected'); 7939 } else { 7940 $panels = $liHeads.children('[data-tab-content]').removeClass('accordion-content'); 7941 } 7942 7943 $panels.css({ 7944 display: '', 7945 visibility: '' 7946 }); 7947 $liHeads.css({ 7948 display: '', 7949 visibility: '' 7950 }); 7951 7952 if (toSet === 'accordion') { 7953 $panels.each(function (key, value) { 7954 jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).appendTo($liHeads.get(key)).addClass('accordion-content').attr('data-tab-content', '').removeClass('is-active').css({ 7955 height: '' 7956 }); 7957 jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + _this.$element.attr('id') + ']').after('<div id="tabs-placeholder-' + _this.$element.attr('id') + '"></div>').detach(); 7958 $liHeads.addClass('accordion-item').attr('data-accordion-item', ''); 7959 $liHeadsA.addClass('accordion-title'); 7960 }); 7961 } else if (toSet === 'tabs') { 7962 var $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-tabs-content=' + _this.$element.attr('id') + ']'); 7963 var $placeholder = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#tabs-placeholder-' + _this.$element.attr('id')); 7964 7965 if ($placeholder.length) { 7966 $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="tabs-content"></div>').insertAfter($placeholder).attr('data-tabs-content', _this.$element.attr('id')); 7967 $placeholder.remove(); 7968 } else { 7969 $tabsContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="tabs-content"></div>').insertAfter(_this.$element).attr('data-tabs-content', _this.$element.attr('id')); 7970 } 7971 7972 $panels.each(function (key, value) { 7973 var tempValue = jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).appendTo($tabsContent).addClass(tabsPanel); 7974 var hash = $liHeadsA.get(key).hash.slice(1); 7975 var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'accordion'); 7976 7977 if (hash !== id) { 7978 if (hash !== '') { 7979 jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id', hash); 7980 } else { 7981 hash = id; 7982 jquery__WEBPACK_IMPORTED_MODULE_0___default()(value).attr('id', hash); 7983 jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeadsA.get(key)).attr('href', jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeadsA.get(key)).attr('href').replace('#', '') + '#' + hash); 7984 } 7985 } 7986 7987 var isActive = jquery__WEBPACK_IMPORTED_MODULE_0___default()($liHeads.get(key)).hasClass('is-active'); 7988 7989 if (isActive) { 7990 tempValue.addClass('is-active'); 7991 } 7992 }); 7993 $liHeads.addClass(tabsTitle); 7994 } 7995 7996 ; 7997 } 7998 /** 7999 * Opens the plugin pane defined by `target`. 8000 * @param {jQuery | String} target - jQuery object or string of the id of the pane to open. 8001 * @see Accordion.down 8002 * @see Tabs.selectTab 8003 * @function 8004 */ 8005 8006 }, { 8007 key: "open", 8008 value: function open() { 8009 if (this.currentRule && typeof this.currentRule.open === 'function') { 8010 var _this$currentRule; 8011 8012 return (_this$currentRule = this.currentRule).open.apply(_this$currentRule, [this.currentPlugin].concat(Array.prototype.slice.call(arguments))); 8013 } 8014 } 8015 /** 8016 * Closes the plugin pane defined by `target`. Not availaible for Tabs. 8017 * @param {jQuery | String} target - jQuery object or string of the id of the pane to close. 8018 * @see Accordion.up 8019 * @function 8020 */ 8021 8022 }, { 8023 key: "close", 8024 value: function close() { 8025 if (this.currentRule && typeof this.currentRule.close === 'function') { 8026 var _this$currentRule2; 8027 8028 return (_this$currentRule2 = this.currentRule).close.apply(_this$currentRule2, [this.currentPlugin].concat(Array.prototype.slice.call(arguments))); 8029 } 8030 } 8031 /** 8032 * Toggles the plugin pane defined by `target`. Not availaible for Tabs. 8033 * @param {jQuery | String} target - jQuery object or string of the id of the pane to toggle. 8034 * @see Accordion.toggle 8035 * @function 8036 */ 8037 8038 }, { 8039 key: "toggle",
8040 value: function toggle() { 8041 if (this.currentRule && typeof this.currentRule.toggle === 'function') { 8042 var _this$currentRule3; 8043 8044 return (_this$currentRule3 = this.currentRule).toggle.apply(_this$currentRule3, [this.currentPlugin].concat(Array.prototype.slice.call(arguments))); 8045 } 8046 } 8047 /** 8048 * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out. 8049 * @function 8050 */ 8051 8052 }, { 8053 key: "_destroy", 8054 value: function _destroy() { 8055 if (this.currentPlugin) this.currentPlugin.destroy(); 8056 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._changedZfMediaQueryHandler); 8057 } 8058 }]); 8059 8060 return ResponsiveAccordionTabs; 8061}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]); 8062 8063ResponsiveAccordionTabs.defaults = {}; 8064 8065 8066/***/ }), 8067
vendor: 4,594 bytes, lines 8068-8105
8068/***/ "./js/foundation.responsiveMenu.js": 8069/*!*****************************************!*\ 8070 !*** ./js/foundation.responsiveMenu.js ***! 8071 \*****************************************/ 8072/*! exports provided: ResponsiveMenu */ 8073/***/ (function(module, __webpack_exports__, __webpack_require__) { 8074 8075"use strict"; 8076__webpack_require__.r(__webpack_exports__); 8077/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveMenu", function() { return ResponsiveMenu; }); 8078/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 8079/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 8080/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 8081/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 8082/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 8083/* harmony import */ var _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.dropdownMenu */ "./js/foundation.dropdownMenu.js"); 8084/* harmony import */ var _foundation_drilldown__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.drilldown */ "./js/foundation.drilldown.js"); 8085/* harmony import */ var _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.accordionMenu */ "./js/foundation.accordionMenu.js"); 8086function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 8087 8088function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 8089 8090function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 8091 8092function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 8093 8094function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 8095 8096function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 8097 8098function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 8099 8100function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 8101 8102function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 8103 8104function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 8105
8106function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 8107 8108 8109 8110 8111 8112 8113 8114 8115var MenuPlugins = { 8116 dropdown: { 8117 cssClass: 'dropdown', 8118 plugin: _foundation_dropdownMenu__WEBPACK_IMPORTED_MODULE_4__["DropdownMenu"] 8119 }, 8120 drilldown: { 8121 cssClass: 'drilldown', 8122 plugin: _foundation_drilldown__WEBPACK_IMPORTED_MODULE_5__["Drilldown"] 8123 }, 8124 accordion: { 8125 cssClass: 'accordion-menu', 8126 plugin: _foundation_accordionMenu__WEBPACK_IMPORTED_MODULE_6__["AccordionMenu"] 8127 } 8128}; // import "foundation.util.triggers.js"; 8129 8130/** 8131 * ResponsiveMenu module. 8132 * @module foundation.responsiveMenu 8133 * @requires foundation.util.triggers 8134 * @requires foundation.util.mediaQuery 8135 */ 8136 8137var ResponsiveMenu = /*#__PURE__*/function (_Plugin) { 8138 _inherits(ResponsiveMenu, _Plugin); 8139 8140 var _super = _createSuper(ResponsiveMenu); 8141 8142 function ResponsiveMenu() { 8143 _classCallCheck(this, ResponsiveMenu); 8144 8145 return _super.apply(this, arguments); 8146 } 8147 8148 _createClass(ResponsiveMenu, [{ 8149 key: "_setup", 8150 value: 8151 /** 8152 * Creates a new instance of a responsive menu. 8153 * @class 8154 * @name ResponsiveMenu 8155 * @fires ResponsiveMenu#init 8156 * @param {jQuery} element - jQuery object to make into a dropdown menu. 8157 * @param {Object} options - Overrides to the default plugin settings. 8158 */ 8159 function _setup(element) { 8160 this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element); 8161 this.rules = this.$element.data('responsive-menu'); 8162 this.currentMq = null; 8163 this.currentPlugin = null; 8164 this.className = 'ResponsiveMenu'; // ie9 back compat 8165 8166 this._init(); 8167 8168 this._events(); 8169 } 8170 /** 8171 * Initializes the Menu by parsing the classes from the 'data-ResponsiveMenu' attribute on the element. 8172 * @function 8173 * @private 8174 */ 8175 8176 }, { 8177 key: "_init", 8178 value: function _init() { 8179 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); // The first time an Interchange plugin is initialized, this.rules is converted from a string of "classes" to an object of rules 8180 8181 8182 if (typeof this.rules === 'string') { 8183 var rulesTree = {}; // Parse rules from "classes" pulled from data attribute 8184 8185 var rules = this.rules.split(' '); // Iterate through every rule found 8186 8187 for (var i = 0; i < rules.length; i++) { 8188 var rule = rules[i].split('-'); 8189 var ruleSize = rule.length > 1 ? rule[0] : 'small'; 8190 var rulePlugin = rule.length > 1 ? rule[1] : rule[0]; 8191 8192 if (MenuPlugins[rulePlugin] !== null) { 8193 rulesTree[ruleSize] = MenuPlugins[rulePlugin]; 8194 } 8195 } 8196 8197 this.rules = rulesTree; 8198 } 8199 8200 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default.a.isEmptyObject(this.rules)) { 8201 this._checkMediaQueries(); 8202 } // Add data-mutate since children may need it. 8203 8204 8205 this.$element.attr('data-mutate', this.$element.attr('data-mutate') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'responsive-menu')); 8206 } 8207 /** 8208 * Initializes events for the Menu. 8209 * @function 8210 * @private 8211 */ 8212 8213 }, { 8214 key: "_events", 8215 value: function _events() { 8216 var _this = this; 8217 8218 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', function () { 8219 _this._checkMediaQueries(); 8220 }); // $(window).on('resize.zf.ResponsiveMenu', function() { 8221 // _this._checkMediaQueries(); 8222 // }); 8223 } 8224 /** 8225 * Checks the current screen width against available media queries. If the media query has changed, and the plugin needed has changed, the plugins will swap out. 8226 * @function 8227 * @private 8228 */ 8229 8230 }, { 8231 key: "_checkMediaQueries", 8232 value: function _checkMediaQueries() { 8233 var matchedMq, 8234 _this = this; // Iterate through each rule and find the last matching rule 8235 8236 8237 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(this.rules, function (key) { 8238 if (_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(key)) { 8239 matchedMq = key; 8240 } 8241 }); // No match? No dice 8242 8243 if (!matchedMq) return; // Plugin already initialized? We good 8244 8245 if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return; // Remove existing plugin-specific CSS classes 8246 8247 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(MenuPlugins, function (key, value) { 8248 _this.$element.removeClass(value.cssClass); 8249 }); // Add the CSS class for the new plugin 8250 8251 this.$element.addClass(this.rules[matchedMq].cssClass); // Create an instance of the new plugin 8252 8253 if (this.currentPlugin) this.currentPlugin.destroy(); 8254 this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {}); 8255 } 8256 /** 8257 * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out. 8258 * @function 8259 */ 8260 8261 }, { 8262 key: "_destroy", 8263 value: function _destroy() { 8264 this.currentPlugin.destroy(); 8265 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('.zf.ResponsiveMenu'); 8266 } 8267 }]); 8268 8269 return ResponsiveMenu; 8270}
8270(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]); 8271 8272ResponsiveMenu.defaults = {}; 8273 8274 8275/***/ }), 8276
vendor: 4,107 bytes, lines 8277-8311
8277/***/ "./js/foundation.responsiveToggle.js": 8278/*!*******************************************!*\ 8279 !*** ./js/foundation.responsiveToggle.js ***! 8280 \*******************************************/ 8281/*! exports provided: ResponsiveToggle */ 8282/***/ (function(module, __webpack_exports__, __webpack_require__) { 8283 8284"use strict"; 8285__webpack_require__.r(__webpack_exports__); 8286/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsiveToggle", function() { return ResponsiveToggle; }); 8287/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 8288/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 8289/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 8290/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 8291/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 8292function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 8293 8294function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 8295 8296function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 8297 8298function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 8299 8300function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 8301 8302function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 8303 8304function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 8305 8306function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 8307 8308function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 8309 8310function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 8311
8312function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 8313 8314 8315 8316 8317 8318/** 8319 * ResponsiveToggle module. 8320 * @module foundation.responsiveToggle 8321 * @requires foundation.util.mediaQuery 8322 * @requires foundation.util.motion 8323 */ 8324 8325var ResponsiveToggle = /*#__PURE__*/function (_Plugin) { 8326 _inherits(ResponsiveToggle, _Plugin); 8327 8328 var _super = _createSuper(ResponsiveToggle); 8329 8330 function ResponsiveToggle() { 8331 _classCallCheck(this, ResponsiveToggle); 8332 8333 return _super.apply(this, arguments); 8334 } 8335 8336 _createClass(ResponsiveToggle, [{ 8337 key: "_setup", 8338 value: 8339 /** 8340 * Creates a new instance of Tab Bar. 8341 * @class 8342 * @name ResponsiveToggle 8343 * @fires ResponsiveToggle#init 8344 * @param {jQuery} element - jQuery object to attach tab bar functionality to. 8345 * @param {Object} options - Overrides to the default plugin settings. 8346 */ 8347 function _setup(element, options) { 8348 this.$element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element); 8349 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, ResponsiveToggle.defaults, this.$element.data(), options); 8350 this.className = 'ResponsiveToggle'; // ie9 back compat 8351 8352 this._init(); 8353 8354 this._events(); 8355 } 8356 /** 8357 * Initializes the tab bar by finding the target element, toggling element, and running update(). 8358 * @function 8359 * @private 8360 */ 8361 8362 }, { 8363 key: "_init", 8364 value: function _init() { 8365 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]._init(); 8366 8367 var targetID = this.$element.data('responsive-toggle'); 8368 8369 if (!targetID) { 8370 console.error('Your tab bar needs an ID of a Menu as the value of data-tab-bar.'); 8371 } 8372 8373 this.$targetMenu = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(targetID)); 8374 this.$toggler = this.$element.find('[data-toggle]').filter(function () { 8375 var target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle'); 8376 return target === targetID || target === ""; 8377 }); 8378 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, this.options, this.$targetMenu.data()); // If they were set, parse the animation classes 8379 8380 if (this.options.animate) { 8381 var input = this.options.animate.split(' '); 8382 this.animationIn = input[0]; 8383 this.animationOut = input[1] || null; 8384 } 8385 8386 this._update(); 8387 } 8388 /** 8389 * Adds necessary event handlers for the tab bar to work. 8390 * @function 8391 * @private 8392 */ 8393 8394 }, { 8395 key: "_events", 8396 value: function _events() { 8397 this._updateMqHandler = this._update.bind(this); 8398 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._updateMqHandler); 8399 this.$toggler.on('click.zf.responsiveToggle', this.toggleMenu.bind(this)); 8400 } 8401 /** 8402 * Checks the current media query to determine if the tab bar should be visible or hidden. 8403 * @function 8404 * @private 8405 */ 8406 8407 }, { 8408 key: "_update", 8409 value: function _update() { 8410 // Mobile 8411 if (!_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(this.options.hideFor)) { 8412 this.$element.show(); 8413 this.$targetMenu.hide(); 8414 } // Desktop 8415 else { 8416 this.$element.hide(); 8417 this.$targetMenu.show(); 8418 } 8419 } 8420 /** 8421 * Toggles the element attached to the tab bar. The toggle only happens if the screen is small enough to allow it. 8422 * @function 8423 * @fires ResponsiveToggle#toggled 8424 */ 8425 8426 }, { 8427 key: "toggleMenu", 8428 value: function toggleMenu() { 8429 var _this = this; 8430 8431 if (!_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"].atLeast(this.options.hideFor)) { 8432 /** 8433 * Fires when the element attached to the tab bar toggles. 8434 * @event ResponsiveToggle#toggled 8435 */ 8436 if (this.options.animate) { 8437 if (this.$targetMenu.is(':hidden')) { 8438 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateIn(this.$targetMenu, this.animationIn, function () { 8439 _this.$element.trigger('toggled.zf.responsiveToggle'); 8440 8441 _this.$targetMenu.find('[data-mutate]').triggerHandler('mutateme.zf.trigger'); 8442 }); 8443 } else { 8444 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut(this.$targetMenu, this.animationOut, function () { 8445 _this.$element.trigger('toggled.zf.responsiveToggle'); 8446 }); 8447 } 8448 } else { 8449 this.$targetMenu.toggle(0); 8450 this.$targetMenu.find('[data-mutate]').trigger('mutateme.zf.trigger'); 8451 this.$element.trigger('toggled.zf.responsiveToggle'); 8452 } 8453 } 8454 } 8455 }, { 8456 key: "_destroy", 8457 value: function _destroy() { 8458 this.$element.off('.zf.responsiveToggle'); 8459 this.$toggler.off('.zf.responsiveToggle'); 8460 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._updateMqHandler); 8461 } 8462 }]); 8463 8464 return ResponsiveToggle; 8465}
8465(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_3__["Plugin"]); 8466 8467ResponsiveToggle.defaults = { 8468 /** 8469 * The breakpoint after which the menu is always shown, and the tab bar is hidden. 8470 * @option 8471 * @type {string} 8472 * @default 'medium' 8473 */ 8474 hideFor: 'medium', 8475 8476 /** 8477 * To decide if the toggle should be animated or not. 8478 * @option 8479 * @type {boolean} 8480 * @default false 8481 */ 8482 animate: false 8483}; 8484 8485 8486/***/ }), 8487
vendor: 4,711 bytes, lines 8488-8526
8488/***/ "./js/foundation.reveal.js": 8489/*!*********************************!*\ 8490 !*** ./js/foundation.reveal.js ***! 8491 \*********************************/ 8492/*! exports provided: Reveal */ 8493/***/ (function(module, __webpack_exports__, __webpack_require__) { 8494 8495"use strict"; 8496__webpack_require__.r(__webpack_exports__); 8497/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reveal", function() { return Reveal; }); 8498/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 8499/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 8500/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 8501/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 8502/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 8503/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 8504/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 8505/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 8506/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js"); 8507function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 8508 8509function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 8510 8511function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 8512 8513function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 8514 8515function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 8516 8517function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 8518 8519function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 8520 8521function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 8522 8523function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 8524 8525function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 8526
8527function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537/** 8538 * Reveal module. 8539 * @module foundation.reveal 8540 * @requires foundation.util.keyboard 8541 * @requires foundation.util.touch 8542 * @requires foundation.util.triggers 8543 * @requires foundation.util.mediaQuery 8544 * @requires foundation.util.motion if using animations 8545 */ 8546 8547var Reveal = /*#__PURE__*/function (_Plugin) { 8548 _inherits(Reveal, _Plugin); 8549 8550 var _super = _createSuper(Reveal); 8551 8552 function Reveal() { 8553 _classCallCheck(this, Reveal); 8554 8555 return _super.apply(this, arguments); 8556 } 8557 8558 _createClass(Reveal, [{ 8559 key: "_setup", 8560 value: 8561 /** 8562 * Creates a new instance of Reveal. 8563 * @class 8564 * @name Reveal 8565 * @param {jQuery} element - jQuery object to use for the modal. 8566 * @param {Object} options - optional parameters. 8567 */ 8568 function _setup(element, options) { 8569 this.$element = element; 8570 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Reveal.defaults, this.$element.data(), options); 8571 this.className = 'Reveal'; // ie9 back compat 8572 8573 this._init(); // Touch and Triggers init are idempotent, just need to make sure they are initialized 8574 8575 8576 _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 8577 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 8578 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('Reveal', { 8579 'ESCAPE': 'close' 8580 }); 8581 } 8582 /** 8583 * Initializes the modal by adding the overlay and close buttons, (if selected). 8584 * @private 8585 */ 8586 8587 }, { 8588 key: "_init", 8589 value: function _init() { 8590 var _this2 = this; 8591 8592 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"]._init(); 8593 8594 this.id = this.$element.attr('id'); 8595 this.isActive = false; 8596 this.cached = { 8597 mq: _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_4__["MediaQuery"].current 8598 }; 8599 this.$anchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat(this.id, "\"]")).length ? jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat(this.id, "\"]")) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-toggle=\"".concat(this.id, "\"]")); 8600 this.$anchor.attr({ 8601 'aria-controls': this.id, 8602 'aria-haspopup': 'dialog', 8603 'tabindex': 0 8604 }); 8605 8606 if (this.options.fullScreen || this.$element.hasClass('full')) { 8607 this.options.fullScreen = true; 8608 this.options.overlay = false; 8609 } 8610 8611 if (this.options.overlay && !this.$overlay) { 8612 this.$overlay = this._makeOverlay(this.id); 8613 } 8614 8615 this.$element.attr({ 8616 'role': 'dialog', 8617 'aria-hidden': true, 8618 'data-yeti-box': this.id, 8619 'data-resize': this.id 8620 }); 8621 8622 if (this.$overlay) { 8623 this.$element.detach().appendTo(this.$overlay); 8624 } else { 8625 this.$element.detach().appendTo(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.appendTo)); 8626 this.$element.addClass('without-overlay'); 8627 } 8628 8629 this._events(); 8630 8631 if (this.options.deepLink && window.location.hash === "#".concat(this.id)) { 8632 this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 8633 return _this2.open(); 8634 }); 8635 } 8636 } 8637 /** 8638 * Creates an overlay div to display behind the modal. 8639 * @private 8640 */ 8641 8642 }, { 8643 key: "_makeOverlay", 8644 value: function _makeOverlay() { 8645 var additionalOverlayClasses = ''; 8646 8647 if (this.options.additionalOverlayClasses) { 8648 additionalOverlayClasses = ' ' + this.options.additionalOverlayClasses; 8649 } 8650 8651 return jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div></div>
vendor: 15,849 bytes, lines 8651-9126
8651').addClass('reveal-overlay' + additionalOverlayClasses).appendTo(this.options.appendTo); 8652 } 8653 /** 8654 * Updates position of modal 8655 * TODO: Figure out if we actually need to cache these values or if it doesn't matter 8656 * @private 8657 */ 8658 8659 }, { 8660 key: "_updatePosition", 8661 value: function _updatePosition() { 8662 var width = this.$element.outerWidth(); 8663 var outerWidth = jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).width(); 8664 var height = this.$element.outerHeight(); 8665 var outerHeight = jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height(); 8666 var left, 8667 top = null; 8668 8669 if (this.options.hOffset === 'auto') { 8670 left = parseInt((outerWidth - width) / 2, 10); 8671 } else { 8672 left = parseInt(this.options.hOffset, 10); 8673 } 8674 8675 if (this.options.vOffset === 'auto') { 8676 if (height > outerHeight) { 8677 top = parseInt(Math.min(100, outerHeight / 10), 10); 8678 } else { 8679 top = parseInt((outerHeight - height) / 4, 10); 8680 } 8681 } else if (this.options.vOffset !== null) { 8682 top = parseInt(this.options.vOffset, 10); 8683 } 8684 8685 if (top !== null) { 8686 this.$element.css({ 8687 top: top + 'px' 8688 }); 8689 } // only worry about left if we don't have an overlay or we have a horizontal offset, 8690 // otherwise we're perfectly in the middle 8691 8692 8693 if (!this.$overlay || this.options.hOffset !== 'auto') { 8694 this.$element.css({ 8695 left: left + 'px' 8696 }); 8697 this.$element.css({ 8698 margin: '0px' 8699 }); 8700 } 8701 } 8702 /** 8703 * Adds event handlers for the modal. 8704 * @private 8705 */ 8706 8707 }, { 8708 key: "_events", 8709 value: function _events() { 8710 var _this3 = this; 8711 8712 var _this = this; 8713 8714 this.$element.on({ 8715 'open.zf.trigger': this.open.bind(this), 8716 'close.zf.trigger': function closeZfTrigger(event, $element) { 8717 if (event.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default()(event.target).parents('[data-closable]')[0] === $element) { 8718 // only close reveal when it's explicitly called 8719 return _this3.close.apply(_this3); 8720 } 8721 }, 8722 'toggle.zf.trigger': this.toggle.bind(this), 8723 'resizeme.zf.trigger': function resizemeZfTrigger() { 8724 _this._updatePosition(); 8725 } 8726 }); 8727 8728 if (this.options.closeOnClick && this.options.overlay) { 8729 this.$overlay.off('.zf.reveal').on('click.zf.dropdown tap.zf.dropdown', function (e) { 8730 if (e.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(_this.$element[0], e.target) || !jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(document, e.target)) { 8731 return; 8732 } 8733 8734 _this.close(); 8735 }); 8736 } 8737 8738 if (this.options.deepLink) { 8739 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on("hashchange.zf.reveal:".concat(this.id), this._handleState.bind(this)); 8740 } 8741 } 8742 /** 8743 * Handles modal methods on back/forward button clicks or any other event that triggers hashchange. 8744 * @private 8745 */ 8746 8747 }, { 8748 key: "_handleState", 8749 value: function _handleState() { 8750 if (window.location.hash === '#' + this.id && !this.isActive) { 8751 this.open(); 8752 } else { 8753 this.close(); 8754 } 8755 } 8756 /** 8757 * Disables the scroll when Reveal is shown to prevent the background from shifting 8758 * @param {number} scrollTop - Scroll to visually apply, window current scroll by default 8759 */ 8760 8761 }, { 8762 key: "_disableScroll", 8763 value: function _disableScroll(scrollTop) { 8764 scrollTop = scrollTop || jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop(); 8765 8766 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height()) { 8767 jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top", -scrollTop); 8768 } 8769 } 8770 /** 8771 * Reenables the scroll when Reveal closes 8772 * @param {number} scrollTop - Scroll to restore, html "top" property by default (as set by `_disableScroll`) 8773 */ 8774 8775 }, { 8776 key: "_enableScroll", 8777 value: function _enableScroll(scrollTop) { 8778 scrollTop = scrollTop || parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top"), 10); 8779 8780 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height()) { 8781 jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top", ""); 8782 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop(-scrollTop); 8783 } 8784 } 8785 /** 8786 * Opens the modal controlled by `this.$anchor`, and closes all others by default. 8787 * @function 8788 * @fires Reveal#closeme 8789 * @fires Reveal#open 8790 */ 8791 8792 }, { 8793 key: "open", 8794 value: function open() { 8795 var _this4 = this; 8796 8797 // either update or replace browser history 8798 var hash = "#".concat(this.id); 8799 8800 if (this.options.deepLink && window.location.hash !== hash) { 8801 if (window.history.pushState) { 8802 if (this.options.updateHistory) { 8803 window.history.pushState({}, '', hash); 8804 } else { 8805 window.history.replaceState({}, '', hash); 8806 } 8807 } else { 8808 window.location.hash = hash; 8809 } 8810 } // Remember anchor that opened it to set focus back later, have general anchors as fallback 8811 8812 8813 this.$activeAnchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.activeElement).is(this.$anchor) ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(document.activeElement) : this.$anchor; 8814 this.isActive = true; // Make elements invisible, but remove display: none so we can get size and positioning 8815 8816 this.$element.css({ 8817 'visibility': 'hidden' 8818 }).show().scrollTop(0); 8819 8820 if (this.options.overlay) { 8821 this.$overlay.css({ 8822 'visibility': 'hidden' 8823 }).show(); 8824 } 8825 8826 this._updatePosition(); 8827 8828 this.$element.hide().css({ 8829 'visibility': '' 8830 }); 8831 8832 if (this.$overlay) { 8833 this.$overlay.css({ 8834 'visibility': '' 8835 }).hide(); 8836 8837 if (this.$element.hasClass('fast')) { 8838 this.$overlay.addClass('fast'); 8839 } else if (this.$element.hasClass('slow')) { 8840 this.$overlay.addClass('slow'); 8841 } 8842 } 8843 8844 if (!this.options.multipleOpened) { 8845 /** 8846 * Fires immediately before the modal opens. 8847 * Closes any other modals that are currently open 8848 * @event Reveal#closeme 8849 */ 8850 this.$element.trigger('closeme.zf.reveal', this.id); 8851 } 8852 8853 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) { 8854 this._disableScroll(); 8855 } 8856 8857 var _this = this; // Motion UI method of reveal 8858 8859 8860 if (this.options.animationIn) { 8861 var afterAnimation = function afterAnimation() { 8862 _this.$element.attr({ 8863 'aria-hidden': false, 8864 'tabindex': -1 8865 }).focus(); 8866 8867 _this._addGlobalClasses(); 8868 8869 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].trapFocus(_this.$element); 8870 }; 8871 8872 if (this.options.overlay) { 8873 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_5__["Motion"].animateIn(this.$overlay, 'fade-in'); 8874 } 8875 8876 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_5__["Motion"].animateIn(this.$element, this.options.animationIn, function () { 8877 if (_this4.$element) { 8878 // protect against object having been removed 8879 _this4.focusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].findFocusable(_this4.$element); 8880 afterAnimation(); 8881 } 8882 }); 8883 } // jQuery method of reveal 8884 else { 8885 if (this.options.overlay) { 8886 this.$overlay.show(0); 8887 } 8888 8889 this.$element.show(this.options.showDelay); 8890 } // handle accessibility 8891 8892 8893 this.$element.attr({ 8894 'aria-hidden': false, 8895 'tabindex': -1 8896 }).focus(); 8897 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].trapFocus(this.$element); 8898 8899 this._addGlobalClasses(); 8900 8901 this._addGlobalListeners(); 8902 /** 8903 * Fires when the modal has successfully opened. 8904 * @event Reveal#open 8905 */ 8906 8907 8908 this.$element.trigger('open.zf.reveal'); 8909 } 8910 /** 8911 * Adds classes and listeners on document required by open modals. 8912 * 8913 * The following classes are added and updated: 8914 * - `.is-reveal-open` - Prevents the scroll on document 8915 * - `.zf-has-scroll` - Displays a disabled scrollbar on document if required like if the 8916 * scroll was not disabled. This prevent a "shift" of the page content due 8917 * the scrollbar disappearing when the modal opens. 8918 * 8919 * @private 8920 */ 8921 8922 }, { 8923 key: "_addGlobalClasses", 8924 value: function _addGlobalClasses() { 8925 var updateScrollbarClass = function updateScrollbarClass() { 8926 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').toggleClass('zf-has-scroll', !!(jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).height() > jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).height())); 8927 }; 8928 8929 this.$element.on('resizeme.zf.trigger.revealScrollbarListener', function () { 8930 return updateScrollbarClass(); 8931 }); 8932 updateScrollbarClass(); 8933 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').addClass('is-reveal-open'); 8934 } 8935 /** 8936 * Removes classes and listeners on document that were required by open modals. 8937 * @private 8938 */ 8939 8940 }, { 8941 key: "_removeGlobalClasses", 8942 value: function _removeGlobalClasses() { 8943 this.$element.off('resizeme.zf.trigger.revealScrollbarListener'); 8944 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').removeClass('is-reveal-open'); 8945 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html').removeClass('zf-has-scroll'); 8946 } 8947 /** 8948 * Adds extra event handlers for the body and window if necessary. 8949 * @private 8950 */ 8951 8952 }, { 8953 key: "_addGlobalListeners", 8954 value: function _addGlobalListeners() { 8955 var _this = this; 8956 8957 if (!this.$element) { 8958 return; 8959 } // If we're in the middle of cleanup, don't freak out 8960 8961 8962 this.focusableElements = _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].findFocusable(this.$element); 8963 8964 if (!this.options.overlay && this.options.closeOnClick && !this.options.fullScreen) { 8965 jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').on('click.zf.dropdown tap.zf.dropdown', function (e) { 8966 if (e.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(_this.$element[0], e.target) || !jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(document, e.target)) { 8967 return; 8968 } 8969 8970 _this.close(); 8971 }); 8972 } 8973 8974 if (this.options.closeOnEsc) { 8975 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('keydown.zf.reveal', function (e) { 8976 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'Reveal', { 8977 close: function close() { 8978 if (_this.options.closeOnEsc) { 8979 _this.close(); 8980 } 8981 } 8982 }); 8983 }); 8984 } 8985 } 8986 /** 8987 * Closes the modal. 8988 * @function 8989 * @fires Reveal#closed 8990 */ 8991 8992 }, { 8993 key: "close", 8994 value: function close() { 8995 if (!this.isActive || !this.$element.is(':visible')) { 8996 return false; 8997 } 8998 8999 var _this = this; // Motion UI method of hiding 9000 9001 9002 if (this.options.animationOut) { 9003 if (this.options.overlay) { 9004 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_5__["Motion"].animateOut(this.$overlay, 'fade-out'); 9005 } 9006 9007 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_5__["Motion"].animateOut(this.$element, this.options.animationOut, finishUp); 9008 } // jQuery method of hiding 9009 else { 9010 this.$element.hide(this.options.hideDelay); 9011 9012 if (this.options.overlay) { 9013 this.$overlay.hide(0, finishUp); 9014 } else { 9015 finishUp(); 9016 } 9017 } // Conditionals to remove extra event listeners added on open 9018 9019 9020 if (this.options.closeOnEsc) { 9021 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('keydown.zf.reveal'); 9022 } 9023 9024 if (!this.options.overlay && this.options.closeOnClick) { 9025 jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').off('click.zf.dropdown tap.zf.dropdown'); 9026 } 9027 9028 this.$element.off('keydown.zf.reveal'); 9029 9030 function finishUp() { 9031 // Get the current top before the modal is closed and restore the scroll after. 9032 // TODO: use component properties instead of HTML properties 9033 // See https://github.com/foundation/foundation-sites/pull/10786 9034 var scrollTop = parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()("html").css("top"), 10); 9035 9036 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) { 9037 _this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal 9038 9039 } 9040 9041 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].releaseFocus(_this.$element); 9042 9043 _this.$element.attr('aria-hidden', true); 9044 9045 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) { 9046 _this._enableScroll(scrollTop); 9047 } 9048 /** 9049 * Fires when the modal is done closing. 9050 * @event Reveal#closed 9051 */ 9052 9053 9054 _this.$element.trigger('closed.zf.reveal'); 9055 } 9056 /** 9057 * Resets the modal content 9058 * This prevents a running video to keep going in the background 9059 */ 9060 9061 9062 if (this.options.resetOnClose) { 9063 this.$element.html(this.$element.html()); 9064 } 9065 9066 this.isActive = false; // If deepLink and we did not switched to an other modal... 9067 9068 if (_this.options.deepLink && window.location.hash === "#".concat(this.id)) { 9069 // Remove the history hash 9070 if (window.history.replaceState) { 9071 var urlWithoutHash = window.location.pathname + window.location.search; 9072 9073 if (this.options.updateHistory) { 9074 window.history.pushState({}, '', urlWithoutHash); // remove the hash 9075 } else { 9076 window.history.replaceState('', document.title, urlWithoutHash); 9077 } 9078 } else { 9079 window.location.hash = ''; 9080 } 9081 } 9082 9083 this.$activeAnchor.focus(); 9084 } 9085 /** 9086 * Toggles the open/closed state of a modal. 9087 * @function 9088 */ 9089 9090 }, { 9091 key: "toggle", 9092 value: function toggle() { 9093 if (this.isActive) { 9094 this.close(); 9095 } else { 9096 this.open(); 9097 } 9098 } 9099 }, { 9100 key: "_destroy", 9101 value: 9102 /** 9103 * Destroys an instance of a modal. 9104 * @function 9105 */ 9106 function _destroy() { 9107 if (this.options.overlay) { 9108 this.$element.appendTo(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.appendTo)); // move $element outside of $overlay to prevent error unregisterPlugin() 9109 9110 this.$overlay.hide().off().remove(); 9111 } 9112 9113 this.$element.hide().off(); 9114 this.$anchor.off('.zf'); 9115 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(".zf.reveal:".concat(this.id)); 9116 if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener); 9117 9118 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.reveal:visible').length === 0) { 9119 this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal 9120 9121 } 9122 } 9123 }]); 9124 9125 return Reveal; 9126}
9126(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 9127 9128Reveal.defaults = { 9129 /** 9130 * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide. 9131 * @option 9132 * @type {string} 9133 * @default '' 9134 */ 9135 animationIn: '', 9136 9137 /** 9138 * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide. 9139 * @option 9140 * @type {string} 9141 * @default '' 9142 */ 9143 animationOut: '', 9144 9145 /** 9146 * Time, in ms, to delay the opening of a modal after a click if no animation used. 9147 * @option 9148 * @type {number} 9149 * @default 0 9150 */ 9151 showDelay: 0, 9152 9153 /** 9154 * Time, in ms, to delay the closing of a modal after a click if no animation used. 9155 * @option 9156 * @type {number} 9157 * @default 0 9158 */ 9159 hideDelay: 0, 9160 9161 /** 9162 * Allows a click on the body/overlay to close the modal. 9163 * @option 9164 * @type {boolean} 9165 * @default true 9166 */ 9167 closeOnClick: true, 9168 9169 /** 9170 * Allows the modal to close if the user presses the `ESCAPE` key. 9171 * @option 9172 * @type {boolean} 9173 * @default true 9174 */ 9175 closeOnEsc: true, 9176 9177 /** 9178 * If true, allows multiple modals to be displayed at once. 9179 * @option 9180 * @type {boolean} 9181 * @default false 9182 */ 9183 multipleOpened: false, 9184 9185 /** 9186 * Distance, in pixels, the modal should push down from the top of the screen. 9187 * @option 9188 * @type {number|string} 9189 * @default auto 9190 */ 9191 vOffset: 'auto', 9192 9193 /** 9194 * Distance, in pixels, the modal should push in from the side of the screen. 9195 * @option 9196 * @type {number|string} 9197 * @default auto 9198 */ 9199 hOffset: 'auto', 9200 9201 /** 9202 * Allows the modal to be fullscreen, completely blocking out the rest of the view. JS checks for this as well. 9203 * @option 9204 * @type {boolean} 9205 * @default false 9206 */ 9207 fullScreen: false, 9208 9209 /** 9210 * Allows the modal to generate an overlay div, which will cover the view when modal opens. 9211 * @option 9212 * @type {boolean} 9213 * @default true 9214 */ 9215 overlay: true, 9216 9217 /** 9218 * Allows the modal to remove and reinject markup on close. Should be true if using video elements w/o using provider's api, otherwise, videos will continue to play in the background. 9219 * @option 9220 * @type {boolean} 9221 * @default false 9222 */ 9223 resetOnClose: false, 9224 9225 /** 9226 * Link the location hash to the modal. 9227 * Set the location hash when the modal is opened/closed, and open/close the modal when the location changes. 9228 * @option 9229 * @type {boolean} 9230 * @default false 9231 */ 9232 deepLink: false, 9233 9234 /** 9235 * If `deepLink` is enabled, update the browser history with the open modal 9236 * @option 9237 * @default false 9238 */ 9239 updateHistory: false, 9240 9241 /** 9242 * Allows the modal to append to custom div. 9243 * @option 9244 * @type {string} 9245 * @default "body" 9246 */ 9247 appendTo: "body", 9248 9249 /** 9250 * Allows adding additional class names to the reveal overlay. 9251 * @option 9252 * @type {string} 9253 * @default '' 9254 */ 9255 additionalOverlayClasses: '' 9256}; 9257 9258 9259/***/ }), 9260
vendor: 4,532 bytes, lines 9261-9298
9261/***/ "./js/foundation.slider.js": 9262/*!*********************************!*\ 9263 !*** ./js/foundation.slider.js ***! 9264 \*********************************/ 9265/*! exports provided: Slider */ 9266/***/ (function(module, __webpack_exports__, __webpack_require__) { 9267 9268"use strict"; 9269__webpack_require__.r(__webpack_exports__); 9270/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Slider", function() { return Slider; }); 9271/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 9272/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 9273/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 9274/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 9275/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 9276/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 9277/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js"); 9278/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 9279function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 9280 9281function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 9282 9283function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 9284 9285function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 9286 9287function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 9288 9289function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 9290 9291function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 9292 9293function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 9294 9295function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 9296 9297function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 9298
vendor: 22,755 bytes, lines 9299-9943
9299function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 9300 9301 9302 9303 9304 9305 9306 9307 9308/** 9309 * Slider module. 9310 * @module foundation.slider 9311 * @requires foundation.util.motion 9312 * @requires foundation.util.triggers 9313 * @requires foundation.util.keyboard 9314 * @requires foundation.util.touch 9315 */ 9316 9317var Slider = /*#__PURE__*/function (_Plugin) { 9318 _inherits(Slider, _Plugin); 9319 9320 var _super = _createSuper(Slider); 9321 9322 function Slider() { 9323 _classCallCheck(this, Slider); 9324 9325 return _super.apply(this, arguments); 9326 } 9327 9328 _createClass(Slider, [{ 9329 key: "_setup", 9330 value: 9331 /** 9332 * Creates a new instance of a slider control. 9333 * @class 9334 * @name Slider 9335 * @param {jQuery} element - jQuery object to make into a slider control. 9336 * @param {Object} options - Overrides to the default plugin settings. 9337 */ 9338 function _setup(element, options) { 9339 this.$element = element; 9340 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Slider.defaults, this.$element.data(), options); 9341 this.className = 'Slider'; // ie9 back compat 9342 9343 this.initialized = false; // Touch and Triggers inits are idempotent, we just need to make sure it's initialied. 9344 9345 _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__["Touch"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 9346 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 9347 9348 this._init(); 9349 9350 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].register('Slider', { 9351 'ltr': { 9352 'ARROW_RIGHT': 'increase', 9353 'ARROW_UP': 'increase', 9354 'ARROW_DOWN': 'decrease', 9355 'ARROW_LEFT': 'decrease', 9356 'SHIFT_ARROW_RIGHT': 'increaseFast', 9357 'SHIFT_ARROW_UP': 'increaseFast', 9358 'SHIFT_ARROW_DOWN': 'decreaseFast', 9359 'SHIFT_ARROW_LEFT': 'decreaseFast', 9360 'HOME': 'min', 9361 'END': 'max' 9362 }, 9363 'rtl': { 9364 'ARROW_LEFT': 'increase', 9365 'ARROW_RIGHT': 'decrease', 9366 'SHIFT_ARROW_LEFT': 'increaseFast', 9367 'SHIFT_ARROW_RIGHT': 'decreaseFast' 9368 } 9369 }); 9370 } 9371 /** 9372 * Initilizes the plugin by reading/setting attributes, creating collections and setting the initial position of the handle(s). 9373 * @function 9374 * @private 9375 */ 9376 9377 }, { 9378 key: "_init", 9379 value: function _init() { 9380 this.inputs = this.$element.find('input'); 9381 this.handles = this.$element.find('[data-slider-handle]'); 9382 this.$handle = this.handles.eq(0); 9383 this.$input = this.inputs.length ? this.inputs.eq(0) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(this.$handle.attr('aria-controls'))); 9384 this.$fill = this.$element.find('[data-slider-fill]').css(this.options.vertical ? 'height' : 'width', 0); 9385 9386 if (this.options.disabled || this.$element.hasClass(this.options.disabledClass)) { 9387 this.options.disabled = true; 9388 this.$element.addClass(this.options.disabledClass); 9389 } 9390 9391 if (!this.inputs.length) { 9392 this.inputs = jquery__WEBPACK_IMPORTED_MODULE_0___default()().add(this.$input); 9393 this.options.binding = true; 9394 } 9395 9396 this._setInitAttr(0); 9397 9398 if (this.handles[1]) { 9399 this.options.doubleSided = true; 9400 this.$handle2 = this.handles.eq(1); 9401 this.$input2 = this.inputs.length > 1 ? this.inputs.eq(1) : jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(this.$handle2.attr('aria-controls'))); 9402 9403 if (!this.inputs[1]) { 9404 this.inputs = this.inputs.add(this.$input2); 9405 } // this.$handle.triggerHandler('click.zf.slider'); 9406 9407 9408 this._setInitAttr(1); 9409 } // Set handle positions 9410 9411 9412 this.setHandles(); 9413 9414 this._events(); 9415 9416 this.initialized = true; 9417 } 9418 }, { 9419 key: "setHandles", 9420 value: function setHandles() { 9421 var _this2 = this; 9422 9423 if (this.handles[1]) { 9424 this._setHandlePos(this.$handle, this.inputs.eq(0).val(), function () { 9425 _this2._setHandlePos(_this2.$handle2, _this2.inputs.eq(1).val()); 9426 }); 9427 } else { 9428 this._setHandlePos(this.$handle, this.inputs.eq(0).val()); 9429 } 9430 } 9431 }, { 9432 key: "_reflow", 9433 value: function _reflow() { 9434 this.setHandles(); 9435 } 9436 /** 9437 * @function 9438 * @private 9439 * @param {Number} value - floating point (the value) to be transformed using to a relative position on the slider (the inverse of _value) 9440 */ 9441 9442 }, { 9443 key: "_pctOfBar", 9444 value: function _pctOfBar(value) { 9445 var pctOfBar = percent(value - this.options.start, this.options.end - this.options.start); 9446 9447 switch (this.options.positionValueFunction) { 9448 case "pow": 9449 pctOfBar = this._logTransform(pctOfBar); 9450 break; 9451 9452 case "log": 9453 pctOfBar = this._powTransform(pctOfBar); 9454 break; 9455 } 9456 9457 return pctOfBar.toFixed(2); 9458 } 9459 /** 9460 * @function 9461 * @private 9462 * @param {Number} pctOfBar - floating point, the relative position of the slider (typically between 0-1) to be transformed to a value 9463 */ 9464 9465 }, { 9466 key: "_value", 9467 value: function _value(pctOfBar) { 9468 switch (this.options.positionValueFunction) { 9469 case "pow": 9470 pctOfBar = this._powTransform(pctOfBar); 9471 break; 9472 9473 case "log": 9474 pctOfBar = this._logTransform(pctOfBar); 9475 break; 9476 } 9477 9478 var value; 9479 9480 if (this.options.vertical) { 9481 // linear interpolation which is working with negative values for start 9482 // https://math.stackexchange.com/a/1019084 9483 value = parseFloat(this.options.end) + pctOfBar * (this.options.start - this.options.end); 9484 } else { 9485 value = (this.options.end - this.options.start) * pctOfBar + parseFloat(this.options.start); 9486 } 9487 9488 return value; 9489 } 9490 /** 9491 * @function 9492 * @private 9493 * @param {Number} value - floating point (typically between 0-1) to be transformed using the log function 9494 */ 9495 9496 }, { 9497 key: "_logTransform", 9498 value: function _logTransform(value) { 9499 return baseLog(this.options.nonLinearBase, value * (this.options.nonLinearBase - 1) + 1); 9500 } 9501 /** 9502 * @function 9503 * @private 9504 * @param {Number} value - floating point (typically between 0-1) to be transformed using the power function 9505 */ 9506 9507 }, { 9508 key: "_powTransform", 9509 value: function _powTransform(value) { 9510 return (Math.pow(this.options.nonLinearBase, value) - 1) / (this.options.nonLinearBase - 1); 9511 } 9512 /** 9513 * Sets the position of the selected handle and fill bar. 9514 * @function 9515 * @private 9516 * @param {jQuery} $hndl - the selected handle to move. 9517 * @param {Number} location - floating point between the start and end values of the slider bar. 9518 * @param {Function} cb - callback function to fire on completion. 9519 * @fires Slider#moved 9520 * @fires Slider#changed 9521 */ 9522 9523 }, { 9524 key: "_setHandlePos", 9525 value: function _setHandlePos($hndl, location, cb) { 9526 // don't move if the slider has been disabled since its initialization 9527 if (this.$element.hasClass(this.options.disabledClass)) { 9528 return; 9529 } //might need to alter that slightly for bars that will have odd number selections. 9530 9531 9532 location = parseFloat(location); //on input change events, convert string to number...grumble. 9533 // prevent slider from running out of bounds, if value exceeds the limits set through options, override the value to min/max 9534 9535 if (location < this.options.start) { 9536 location = this.options.start; 9537 } else if (location > this.options.end) { 9538 location = this.options.end; 9539 } 9540 9541 var isDbl = this.options.doubleSided; 9542 9543 if (isDbl) { 9544 //this block is to prevent 2 handles from crossing eachother. Could/should be improved. 9545 if (this.handles.index($hndl) === 0) { 9546 var h2Val = parseFloat(this.$handle2.attr('aria-valuenow')); 9547 location = location >= h2Val ? h2Val - this.options.step : location; 9548 } else { 9549 var h1Val = parseFloat(this.$handle.attr('aria-valuenow')); 9550 location = location <= h1Val ? h1Val + this.options.step : location; 9551 } 9552 } 9553 9554 var _this = this, 9555 vert = this.options.vertical, 9556 hOrW = vert ? 'height' : 'width', 9557 lOrT = vert ? 'top' : 'left', 9558 handleDim = $hndl[0].getBoundingClientRect()[hOrW], 9559 elemDim = this.$element[0].getBoundingClientRect()[hOrW], 9560 //percentage of bar min/max value based on click or drag point 9561 pctOfBar = this._pctOfBar(location), 9562 //number of actual pixels to shift the handle, based on the percentage obtained above 9563 pxToMove = (elemDim - handleDim) * pctOfBar, 9564 //percentage of bar to shift the handle 9565 movement = (percent(pxToMove, elemDim) * 100).toFixed(this.options.decimal); //fixing the decimal value for the location number, is passed to other methods as a fixed floating-point value 9566 9567 9568 location = parseFloat(location.toFixed(this.options.decimal)); // declare empty object for css adjustments, only used with 2 handled-sliders 9569 9570 var css = {}; 9571 9572 this._setValues($hndl, location); // TODO update to calculate based on values set to respective inputs?? 9573 9574 9575 if (isDbl) { 9576 var isLeftHndl = this.handles.index($hndl) === 0, 9577 //empty variable, will be used for min-height/width for fill bar 9578 dim, 9579 //percentage w/h of the handle compared to the slider bar 9580 handlePct = Math.floor(percent(handleDim, elemDim) * 100); //if left handle, the math is slightly different than if it's the right handle, and the left/top property needs to be changed for the fill bar 9581 9582 if (isLeftHndl) { 9583 //left or top percentage value to apply to the fill bar. 9584 css[lOrT] = "".concat(movement, "%"); //calculate the new min-height/width for the fill bar. 9585 9586 dim = parseFloat(this.$handle2[0].style[lOrT]) - movement + handlePct; //this callback is necessary to prevent errors and allow the proper placement and initialization of a 2-handled slider 9587 //plus, it means we don't care if 'dim' isNaN on init, it won't be in the future. 9588 9589 if (cb && typeof cb === 'function') { 9590 cb(); 9591 } //this is only needed for the initialization of 2 handled sliders 9592 9593 } else { 9594 //just caching the value of the left/bottom handle's left/top property 9595 var handlePos = parseFloat(this.$handle[0].style[lOrT]); //calculate the new min-height/width for the fill bar. Use isNaN to prevent false positives for numbers <= 0 9596 //based on the percentage of movement of the handle being manipulated, less the opposing handle's left/top position, plus the percentage w/h of the handle itself 9597 9598 dim = movement - (isNaN(handlePos) ? (this.options.initialStart - this.options.start) / ((this.options.end - this.options.start) / 100) : handlePos) + handlePct; 9599 } // assign the min-height/width to our css object 9600 9601 9602 css["min-".concat(hOrW)] = "".concat(dim, "%"); 9603 } //because we don't know exactly how the handle will be moved, check the amount of time it should take to move. 9604 9605 9606 var moveTime = this.$element.data('dragging') ? 1000 / 60 : this.options.moveTime; 9607 Object(_foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Move"])(moveTime, $hndl, function () { 9608 // adjusting the left/top property of the handle, based on the percentage calculated above 9609 // if movement isNaN, that is because the slider is hidden and we cannot determine handle width, 9610 // fall back to next best guess. 9611 if (isNaN(movement)) { 9612 $hndl.css(lOrT, "".concat(pctOfBar * 100, "%")); 9613 } else { 9614 $hndl.css(lOrT, "".concat(movement, "%")); 9615 } 9616 9617 if (!_this.options.doubleSided) { 9618 //if single-handled, a simple method to expand the fill bar 9619 _this.$fill.css(hOrW, "".concat(pctOfBar * 100, "%")); 9620 } else { 9621 //otherwise, use the css object we created above 9622 _this.$fill.css(css); 9623 } 9624 }); 9625 9626 if (this.initialized) { 9627 this.$element.one('finished.zf.animate', function () { 9628 /** 9629 * Fires when the handle is done moving. 9630 * @event Slider#moved 9631 */ 9632 _this.$element.trigger('moved.zf.slider', [$hndl]); 9633 }); 9634 /** 9635 * Fires when the value has not been change for a given time. 9636 * @event Slider#changed 9637 */ 9638 9639 clearTimeout(_this.timeout); 9640 _this.timeout = setTimeout(function () { 9641 _this.$element.trigger('changed.zf.slider', [$hndl]); 9642 }, _this.options.changedDelay); 9643 } 9644 } 9645 /** 9646 * Sets the initial attribute for the slider element. 9647 * @function 9648 * @private 9649 * @param {Number} idx - index of the current handle/input to use. 9650 */ 9651 9652 }, { 9653 key: "_setInitAttr", 9654 value: function _setInitAttr(idx) { 9655 var initVal = idx === 0 ? this.options.initialStart : this.options.initialEnd; 9656 var id = this.inputs.eq(idx).attr('id') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["GetYoDigits"])(6, 'slider'); 9657 this.inputs.eq(idx).attr({ 9658 'id': id, 9659 'max': this.options.end, 9660 'min': this.options.start, 9661 'step': this.options.step 9662 }); 9663 this.inputs.eq(idx).val(initVal); 9664 this.handles.eq(idx).attr({ 9665 'role': 'slider', 9666 'aria-controls': id, 9667 'aria-valuemax': this.options.end, 9668 'aria-valuemin': this.options.start, 9669 'aria-valuenow': initVal, 9670 'aria-orientation': this.options.vertical ? 'vertical' : 'horizontal', 9671 'tabindex': 0 9672 }); 9673 } 9674 /** 9675 * Sets the input and `aria-valuenow` values for the slider element. 9676 * @function 9677 * @private 9678 * @param {jQuery} $handle - the currently selected handle. 9679 * @param {Number} val - floating point of the new value. 9680 */ 9681 9682 }, { 9683 key: "_setValues", 9684 value: function _setValues($handle, val) { 9685 var idx = this.options.doubleSided ? this.handles.index($handle) : 0; 9686 this.inputs.eq(idx).val(val); 9687 $handle.attr('aria-valuenow', val); 9688 } 9689 /** 9690 * Handles events on the slider element. 9691 * Calculates the new location of the current handle. 9692 * If there are two handles and the bar was clicked, it determines which handle to move. 9693 * @function 9694 * @private 9695 * @param {Object} e - the `event` object passed from the listener. 9696 * @param {jQuery} $handle - the current handle to calculate for, if selected. 9697 * @param {Number} val - floating point number for the new value of the slider. 9698 * TODO clean this up, there's a lot of repeated code between this and the _setHandlePos fn. 9699 */ 9700 9701 }, { 9702 key: "_handleEvent", 9703 value: function _handleEvent(e, $handle, val) { 9704 var value; 9705 9706 if (!val) { 9707 //click or drag events 9708 e.preventDefault(); 9709 9710 var _this = this, 9711 vertical = this.options.vertical, 9712 param = vertical ? 'height' : 'width', 9713 direction = vertical ? 'top' : 'left', 9714 eventOffset = vertical ? e.pageY : e.pageX, 9715 barDim = this.$element[0].getBoundingClientRect()[param], 9716 windowScroll = vertical ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollTop() : jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).scrollLeft(); 9717 9718 var elemOffset = this.$element.offset()[direction]; // touch events emulated by the touch util give position relative to screen, add window.scroll to event coordinates... 9719 // best way to guess this is simulated is if clientY == pageY 9720 9721 if (e.clientY === e.pageY) { 9722 eventOffset = eventOffset + windowScroll; 9723 } 9724 9725 var eventFromBar = eventOffset - elemOffset; 9726 var barXY; 9727 9728 if (eventFromBar < 0) { 9729 barXY = 0; 9730 } else if (eventFromBar > barDim) { 9731 barXY = barDim; 9732 } else { 9733 barXY = eventFromBar; 9734 } 9735 9736 var offsetPct = percent(barXY, barDim); 9737 value = this._value(offsetPct); // turn everything around for RTL, yay math! 9738 9739 if (Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["rtl"])() && !this.options.vertical) { 9740 value = this.options.end - value; 9741 } 9742 9743 value = _this._adjustValue(null, value); 9744 9745 if (!$handle) { 9746 //figure out which handle it is, pass it to the next function. 9747 var firstHndlPos = absPosition(this.$handle, direction, barXY, param), 9748 secndHndlPos = absPosition(this.$handle2, direction, barXY, param); 9749 $handle = firstHndlPos <= secndHndlPos ? this.$handle : this.$handle2; 9750 } 9751 } else { 9752 //change event on input 9753 value = this._adjustValue(null, val); 9754 } 9755 9756 this._setHandlePos($handle, value); 9757 } 9758 /** 9759 * Adjustes value for handle in regard to step value. returns adjusted value 9760 * @function 9761 * @private 9762 * @param {jQuery} $handle - the selected handle. 9763 * @param {Number} value - value to adjust. used if $handle is falsy 9764 */ 9765 9766 }, { 9767 key: "_adjustValue", 9768 value: function _adjustValue($handle, value) { 9769 var val, 9770 step = this.options.step, 9771 div = parseFloat(step / 2), 9772 left, 9773 previousVal, 9774 nextVal; 9775 9776 if (!!$handle) { 9777 val = parseFloat($handle.attr('aria-valuenow')); 9778 } else { 9779 val = value; 9780 } 9781 9782 if (val >= 0) { 9783 left = val % step; 9784 } else { 9785 left = step + val % step; 9786 } 9787 9788 previousVal = val - left; 9789 nextVal = previousVal + step; 9790 9791 if (left === 0) { 9792 return val; 9793 } 9794 9795 val = val >= previousVal + div ? nextVal : previousVal; 9796 return val; 9797 } 9798 /** 9799 * Adds event listeners to the slider elements. 9800 * @function 9801 * @private 9802 */ 9803 9804 }, { 9805 key: "_events", 9806 value: function _events() { 9807 this._eventsForHandle(this.$handle); 9808 9809 if (this.handles[1]) { 9810 this._eventsForHandle(this.$handle2); 9811 } 9812 } 9813 /** 9814 * Adds event listeners a particular handle 9815 * @function 9816 * @private 9817 * @param {jQuery} $handle - the current handle to apply listeners to. 9818 */ 9819 9820 }, { 9821 key: "_eventsForHandle", 9822 value: function _eventsForHandle($handle) { 9823 var _this = this, 9824 curHandle; 9825 9826 var handleChangeEvent = function handleChangeEvent(e) { 9827 var idx = _this.inputs.index(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 9828 9829 _this._handleEvent(e, _this.handles.eq(idx), jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).val()); 9830 }; // IE only triggers the change event when the input loses focus which strictly follows the HTML specification 9831 // listen for the enter key and trigger a change 9832 // @see https://html.spec.whatwg.org/multipage/input.html#common-input-element-events 9833 9834 9835 this.inputs.off('keyup.zf.slider').on('keyup.zf.slider', function (e) { 9836 if (e.keyCode === 13) handleChangeEvent.call(this, e); 9837 }); 9838 this.inputs.off('change.zf.slider').on('change.zf.slider', handleChangeEvent); 9839 9840 if (this.options.clickSelect) { 9841 this.$element.off('click.zf.slider').on('click.zf.slider', function (e) { 9842 if (_this.$element.data('dragging')) { 9843 return false; 9844 } 9845 9846 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).is('[data-slider-handle]')) { 9847 if (_this.options.doubleSided) { 9848 _this._handleEvent(e); 9849 } else { 9850 _this._handleEvent(e, _this.$handle); 9851 } 9852 } 9853 }); 9854 } 9855 9856 if (this.options.draggable) { 9857 this.handles.addTouch(); 9858 var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body'); 9859 $handle.off('mousedown.zf.slider').on('mousedown.zf.slider', function (e) { 9860 $handle.addClass('is-dragging'); 9861 9862 _this.$fill.addClass('is-dragging'); // 9863 9864 9865 _this.$element.data('dragging', true); 9866 9867 curHandle = jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.currentTarget); 9868 $body.on('mousemove.zf.slider', function (ev) { 9869 ev.preventDefault(); 9870 9871 _this._handleEvent(ev, curHandle); 9872 }).on('mouseup.zf.slider', function (ev) { 9873 _this._handleEvent(ev, curHandle); 9874 9875 $handle.removeClass('is-dragging'); 9876 9877 _this.$fill.removeClass('is-dragging'); 9878 9879 _this.$element.data('dragging', false); 9880 9881 $body.off('mousemove.zf.slider mouseup.zf.slider'); 9882 }); 9883 }) // prevent events triggered by touch 9884 .on('selectstart.zf.slider touchmove.zf.slider', function (e) { 9885 e.preventDefault(); 9886 }); 9887 } 9888 9889 $handle.off('keydown.zf.slider').on('keydown.zf.slider', function (e) { 9890 var _$handle = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 9891 idx = _this.options.doubleSided ? _this.handles.index(_$handle) : 0, 9892 oldValue = parseFloat(_this.inputs.eq(idx).val()), 9893 newValue; // handle keyboard event with keyboard util 9894 9895 9896 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__["Keyboard"].handleKey(e, 'Slider', { 9897 decrease: function decrease() { 9898 newValue = oldValue - _this.options.step; 9899 }, 9900 increase: function increase() { 9901 newValue = oldValue + _this.options.step; 9902 }, 9903 decreaseFast: function decreaseFast() { 9904 newValue = oldValue - _this.options.step * 10; 9905 }, 9906 increaseFast: function increaseFast() { 9907 newValue = oldValue + _this.options.step * 10; 9908 }, 9909 min: function min() { 9910 newValue = _this.options.start; 9911 }, 9912 max: function max() { 9913 newValue = _this.options.end; 9914 }, 9915 handled: function handled() { 9916 // only set handle pos when event was handled specially 9917 e.preventDefault(); 9918 9919 _this._setHandlePos(_$handle, newValue); 9920 } 9921 }); 9922 /*if (newValue) { // if pressed key has special function, update value 9923 e.preventDefault(); 9924 _this._setHandlePos(_$handle, newValue); 9925 }*/ 9926 }); 9927 } 9928 /** 9929 * Destroys the slider plugin. 9930 */ 9931 9932 }, { 9933 key: "_destroy", 9934 value: function _destroy() { 9935 this.handles.off('.zf.slider'); 9936 this.inputs.off('.zf.slider'); 9937 this.$element.off('.zf.slider'); 9938 clearTimeout(this.timeout); 9939 } 9940 }]); 9941 9942 return Slider; 9943}
9943(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_4__["Plugin"]); 9944 9945Slider.defaults = { 9946 /** 9947 * Minimum value for the slider scale. 9948 * @option 9949 * @type {number} 9950 * @default 0 9951 */ 9952 start: 0, 9953 9954 /** 9955 * Maximum value for the slider scale. 9956 * @option 9957 * @type {number} 9958 * @default 100 9959 */ 9960 end: 100, 9961 9962 /** 9963 * Minimum value change per change event. 9964 * @option 9965 * @type {number} 9966 * @default 1 9967 */ 9968 step: 1, 9969 9970 /** 9971 * Value at which the handle/input *(left handle/first input)* should be set to on initialization. 9972 * @option 9973 * @type {number} 9974 * @default 0 9975 */ 9976 initialStart: 0, 9977 9978 /** 9979 * Value at which the right handle/second input should be set to on initialization. 9980 * @option 9981 * @type {number} 9982 * @default 100 9983 */ 9984 initialEnd: 100, 9985 9986 /** 9987 * Allows the input to be located outside the container and visible. Set to by the JS 9988 * @option 9989 * @type {boolean} 9990 * @default false 9991 */ 9992 binding: false, 9993 9994 /** 9995 * Allows the user to click/tap on the slider bar to select a value. 9996 * @option 9997 * @type {boolean} 9998 * @default true 9999 */ 10000 clickSelect: true, 10001 10002 /** 10003 * Set to true and use the `vertical` class to change alignment to vertical. 10004 * @option 10005 * @type {boolean} 10006 * @default false 10007 */ 10008 vertical: false, 10009 10010 /** 10011 * Allows the user to drag the slider handle(s) to select a value. 10012 * @option 10013 * @type {boolean} 10014 * @default true 10015 */ 10016 draggable: true, 10017 10018 /** 10019 * Disables the slider and prevents event listeners from being applied. Double checked by JS with `disabledClass`. 10020 * @option 10021 * @type {boolean} 10022 * @default false 10023 */ 10024 disabled: false, 10025 10026 /** 10027 * Allows the use of two handles. Double checked by the JS. Changes some logic handling. 10028 * @option 10029 * @type {boolean} 10030 * @default false 10031 */ 10032 doubleSided: false, 10033 10034 /** 10035 * Potential future feature. 10036 */ 10037 // steps: 100, 10038 10039 /** 10040 * Number of decimal places the plugin should go to for floating point precision. 10041 * @option 10042 * @type {number} 10043 * @default 2 10044 */ 10045 decimal: 2, 10046 10047 /** 10048 * Time delay for dragged elements. 10049 */ 10050 // dragDelay: 0, 10051 10052 /** 10053 * Time, in ms, to animate the movement of a slider handle if user clicks/taps on the bar. Needs to be manually set if updating the transition time in the Sass settings. 10054 * @option 10055 * @type {number} 10056 * @default 200 10057 */ 10058 moveTime: 200, 10059 //update this if changing the transition time in the sass 10060 10061 /** 10062 * Class applied to disabled sliders. 10063 * @option 10064 * @type {string} 10065 * @default 'disabled' 10066 */ 10067 disabledClass: 'disabled', 10068 10069 /** 10070 * Will invert the default layout for a vertical<span data-tooltip title="who would do this???"> </span>slider. 10071 * @option 10072 * @type {boolean} 10073 * @default false 10074 */ 10075 invertVertical: false, 10076 10077 /** 10078 * Milliseconds before the `changed.zf-slider` event is triggered after value change. 10079 * @option 10080 * @type {number} 10081 * @default 500 10082 */ 10083 changedDelay: 500, 10084 10085 /** 10086 * Basevalue for non-linear sliders 10087 * @option 10088 * @type {number} 10089 * @default 5 10090 */ 10091 nonLinearBase: 5, 10092 10093 /** 10094 * Basevalue for non-linear sliders, possible values are: `'linear'`, `'pow'` & `'log'`. Pow and Log use the nonLinearBase setting. 10095 * @option 10096 * @type {string} 10097 * @default 'linear' 10098 */ 10099 positionValueFunction: 'linear' 10100}; 10101 10102function percent(frac, num) { 10103 return frac / num; 10104} 10105 10106function absPosition($handle, dir, clickPos, param) { 10107 return Math.abs($handle.position()[dir] + $handle[param]() / 2 - clickPos); 10108} 10109 10110function baseLog(base, value) { 10111 return Math.log(value) / Math.log(base); 10112} 10113 10114 10115 10116/***/ }), 10117
vendor: 4,073 bytes, lines 10118-10152
10118/***/ "./js/foundation.smoothScroll.js": 10119/*!***************************************!*\ 10120 !*** ./js/foundation.smoothScroll.js ***! 10121 \***************************************/ 10122/*! exports provided: SmoothScroll */ 10123/***/ (function(module, __webpack_exports__, __webpack_require__) { 10124 10125"use strict"; 10126__webpack_require__.r(__webpack_exports__); 10127/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SmoothScroll", function() { return SmoothScroll; }); 10128/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 10129/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 10130/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 10131/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 10132function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 10133 10134function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 10135 10136function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 10137 10138function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 10139 10140function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 10141 10142function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 10143 10144function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 10145 10146function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 10147 10148function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 10149 10150function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 10151 10152function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); };
vendor: 4,715 bytes, lines 10152-10322
10152 return _getPrototypeOf(o); } 10153 10154 10155 10156 10157/** 10158 * SmoothScroll module. 10159 * @module foundation.smoothScroll 10160 */ 10161 10162var SmoothScroll = /*#__PURE__*/function (_Plugin) { 10163 _inherits(SmoothScroll, _Plugin); 10164 10165 var _super = _createSuper(SmoothScroll); 10166 10167 function SmoothScroll() { 10168 _classCallCheck(this, SmoothScroll); 10169 10170 return _super.apply(this, arguments); 10171 } 10172 10173 _createClass(SmoothScroll, [{ 10174 key: "_setup", 10175 value: 10176 /** 10177 * Creates a new instance of SmoothScroll. 10178 * @class 10179 * @name SmoothScroll 10180 * @fires SmoothScroll#init 10181 * @param {Object} element - jQuery object to add the trigger to. 10182 * @param {Object} options - Overrides to the default plugin settings. 10183 */ 10184 function _setup(element, options) { 10185 this.$element = element; 10186 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, SmoothScroll.defaults, this.$element.data(), options); 10187 this.className = 'SmoothScroll'; // ie9 back compat 10188 10189 this._init(); 10190 } 10191 /** 10192 * Initialize the SmoothScroll plugin 10193 * @private 10194 */ 10195 10196 }, { 10197 key: "_init", 10198 value: function _init() { 10199 var id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'smooth-scroll'); 10200 this.$element.attr({ 10201 id: id 10202 }); 10203 10204 this._events(); 10205 } 10206 /** 10207 * Initializes events for SmoothScroll. 10208 * @private 10209 */ 10210 10211 }, { 10212 key: "_events", 10213 value: function _events() { 10214 this._linkClickListener = this._handleLinkClick.bind(this); 10215 this.$element.on('click.zf.smoothScroll', this._linkClickListener); 10216 this.$element.on('click.zf.smoothScroll', 'a[href^="#"]', this._linkClickListener); 10217 } 10218 /** 10219 * Handle the given event to smoothly scroll to the anchor pointed by the event target. 10220 * @param {*} e - event 10221 * @function 10222 * @private 10223 */ 10224 10225 }, { 10226 key: "_handleLinkClick", 10227 value: function _handleLinkClick(e) { 10228 var _this = this; 10229 10230 // Follow the link if it does not point to an anchor. 10231 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.currentTarget).is('a[href^="#"]')) return; 10232 var arrival = e.currentTarget.getAttribute('href'); 10233 this._inTransition = true; 10234 SmoothScroll.scrollToLoc(arrival, this.options, function () { 10235 _this._inTransition = false; 10236 }); 10237 e.preventDefault(); 10238 } 10239 }, { 10240 key: "_destroy", 10241 value: 10242 /** 10243 * Destroys the SmoothScroll instance. 10244 * @function 10245 */ 10246 function _destroy() { 10247 this.$element.off('click.zf.smoothScroll', this._linkClickListener); 10248 this.$element.off('click.zf.smoothScroll', 'a[href^="#"]', this._linkClickListener); 10249 } 10250 }], [{ 10251 key: "scrollToLoc", 10252 value: 10253 /** 10254 * Function to scroll to a given location on the page. 10255 * @param {String} loc - A properly formatted jQuery id selector. Example: '#foo' 10256 * @param {Object} options - The options to use. 10257 * @param {Function} callback - The callback function. 10258 * @static 10259 * @function 10260 */ 10261 function scrollToLoc(loc) { 10262 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SmoothScroll.defaults; 10263 var callback = arguments.length > 2 ? arguments[2] : undefined; 10264 var $loc = jquery__WEBPACK_IMPORTED_MODULE_0___default()(loc); // Do nothing if target does not exist to prevent errors 10265 10266 if (!$loc.length) return false; 10267 var scrollPos = Math.round($loc.offset().top - options.threshold / 2 - options.offset); 10268 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').stop(true).animate({ 10269 scrollTop: scrollPos 10270 }, options.animationDuration, options.animationEasing, function () { 10271 if (typeof callback === 'function') { 10272 callback(); 10273 } 10274 }); 10275 } 10276 }]); 10277 10278 return SmoothScroll; 10279}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]); 10280/** 10281 * Default settings for plugin. 10282 */ 10283 10284 10285SmoothScroll.defaults = { 10286 /** 10287 * Amount of time, in ms, the animated scrolling should take between locations. 10288 * @option 10289 * @type {number} 10290 * @default 500 10291 */ 10292 animationDuration: 500, 10293 10294 /** 10295 * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`. 10296 * @option 10297 * @type {string} 10298 * @default 'linear' 10299 * @see {@link https://api.jquery.com/animate|Jquery animate} 10300 */ 10301 animationEasing: 'linear', 10302 10303 /** 10304 * Number of pixels to use as a marker for location changes. 10305 * @option 10306 * @type {number} 10307 * @default 50 10308 */ 10309 threshold: 50, 10310 10311 /** 10312 * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar. 10313 * @option 10314 * @type {number} 10315 * @default 0 10316 */ 10317 offset: 0 10318}; 10319 10320 10321/***/ }), 10322
vendor: 4,207 bytes, lines 10323-10358
10323/***/ "./js/foundation.sticky.js": 10324/*!*********************************!*\ 10325 !*** ./js/foundation.sticky.js ***! 10326 \*********************************/ 10327/*! exports provided: Sticky */ 10328/***/ (function(module, __webpack_exports__, __webpack_require__) { 10329 10330"use strict"; 10331__webpack_require__.r(__webpack_exports__); 10332/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sticky", function() { return Sticky; }); 10333/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 10334/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 10335/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 10336/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 10337/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 10338/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 10339function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 10340 10341function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 10342 10343function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 10344 10345function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 10346 10347function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 10348 10349function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 10350 10351function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 10352 10353function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 10354 10355function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 10356 10357function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 10358
vendor: 6,914 bytes, lines 10359-10583
10359function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 10360 10361 10362 10363 10364 10365 10366/** 10367 * Sticky module. 10368 * @module foundation.sticky 10369 * @requires foundation.util.triggers 10370 * @requires foundation.util.mediaQuery 10371 */ 10372 10373var Sticky = /*#__PURE__*/function (_Plugin) { 10374 _inherits(Sticky, _Plugin); 10375 10376 var _super = _createSuper(Sticky); 10377 10378 function Sticky() { 10379 _classCallCheck(this, Sticky); 10380 10381 return _super.apply(this, arguments); 10382 } 10383 10384 _createClass(Sticky, [{ 10385 key: "_setup", 10386 value: 10387 /** 10388 * Creates a new instance of a sticky thing. 10389 * @class 10390 * @name Sticky 10391 * @param {jQuery} element - jQuery object to make sticky. 10392 * @param {Object} options - options object passed when creating the element programmatically. 10393 */ 10394 function _setup(element, options) { 10395 this.$element = element; 10396 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Sticky.defaults, this.$element.data(), options); 10397 this.className = 'Sticky'; // ie9 back compat 10398 // Triggers init is idempotent, just need to make sure it is initialized 10399 10400 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 10401 10402 this._init(); 10403 } 10404 /** 10405 * Initializes the sticky element by adding classes, getting/setting dimensions, breakpoints and attributes 10406 * @function 10407 * @private 10408 */ 10409 10410 }, { 10411 key: "_init", 10412 value: function _init() { 10413 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"]._init(); 10414 10415 var $parent = this.$element.parent('[data-sticky-container]'), 10416 id = this.$element[0].id || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["GetYoDigits"])(6, 'sticky'), 10417 _this = this; 10418 10419 if ($parent.length) { 10420 this.$container = $parent; 10421 } else { 10422 this.wasWrapped = true; 10423 this.$element.wrap(this.options.container); 10424 this.$container = this.$element.parent(); 10425 } 10426 10427 this.$container.addClass(this.options.containerClass); 10428 this.$element.addClass(this.options.stickyClass).attr({ 10429 'data-resize': id, 10430 'data-mutate': id 10431 }); 10432 10433 if (this.options.anchor !== '') { 10434 jquery__WEBPACK_IMPORTED_MODULE_0___default()('#' + _this.options.anchor).attr({ 10435 'data-mutate': id 10436 }); 10437 } 10438 10439 this.scrollCount = this.options.checkEvery; 10440 this.isStuck = false; 10441 this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 10442 //We calculate the container height to have correct values for anchor points offset calculation. 10443 _this.containerHeight = _this.$element.css("display") === "none" ? 0 : _this.$element[0].getBoundingClientRect().height; 10444 10445 _this.$container.css('height', _this.containerHeight); 10446 10447 _this.elemHeight = _this.containerHeight; 10448 10449 if (_this.options.anchor !== '') { 10450 _this.$anchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#' + _this.options.anchor); 10451 } else { 10452 _this._parsePoints(); 10453 } 10454 10455 _this._setSizes(function () { 10456 var scroll = window.pageYOffset; 10457 10458 _this._calc(false, scroll); //Unstick the element will ensure that proper classes are set. 10459 10460 10461 if (!_this.isStuck) { 10462 _this._removeSticky(scroll >= _this.topPoint ? false : true); 10463 } 10464 }); 10465 10466 _this._events(id.split('-').reverse().join('-')); 10467 }); 10468 } 10469 /** 10470 * If using multiple elements as anchors, calculates the top and bottom pixel values the sticky thing should stick and unstick on. 10471 * @function 10472 * @private 10473 */ 10474 10475 }, { 10476 key: "_parsePoints", 10477 value: function _parsePoints() { 10478 var top = this.options.topAnchor === "" ? 1 : this.options.topAnchor, 10479 btm = this.options.btmAnchor === "" ? document.documentElement.scrollHeight : this.options.btmAnchor, 10480 pts = [top, btm], 10481 breaks = {}; 10482 10483 for (var i = 0, len = pts.length; i < len && pts[i]; i++) { 10484 var pt; 10485 10486 if (typeof pts[i] === 'number') { 10487 pt = pts[i]; 10488 } else { 10489 var place = pts[i].split(':'), 10490 anchor = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(place[0])); 10491 pt = anchor.offset().top; 10492 10493 if (place[1] && place[1].toLowerCase() === 'bottom') { 10494 pt += anchor[0].getBoundingClientRect().height; 10495 } 10496 } 10497 10498 breaks[i] = pt; 10499 } 10500 10501 this.points = breaks; 10502 return; 10503 } 10504 /** 10505 * Adds event handlers for the scrolling element. 10506 * @private 10507 * @param {String} id - pseudo-random id for unique scroll event listener. 10508 */ 10509 10510 }, { 10511 key: "_events", 10512 value: function _events(id) { 10513 var _this = this, 10514 scrollListener = this.scrollListener = "scroll.zf.".concat(id); 10515 10516 if (this.isOn) { 10517 return; 10518 } 10519 10520 if (this.canStick) { 10521 this.isOn = true; 10522 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(scrollListener).on(scrollListener, function () { 10523 if (_this.scrollCount === 0) { 10524 _this.scrollCount = _this.options.checkEvery; 10525 10526 _this._setSizes(function () { 10527 _this._calc(false, window.pageYOffset); 10528 }); 10529 } else { 10530 _this.scrollCount--; 10531 10532 _this._calc(false, window.pageYOffset); 10533 } 10534 }); 10535 } 10536 10537 this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', function () { 10538 _this._eventsHandler(id); 10539 }); 10540 this.$element.on('mutateme.zf.trigger', function () { 10541 _this._eventsHandler(id); 10542 }); 10543 10544 if (this.$anchor) { 10545 this.$anchor.on('mutateme.zf.trigger', function () { 10546 _this._eventsHandler(id); 10547 }); 10548 } 10549 } 10550 /** 10551 * Handler for events. 10552 * @private 10553 * @param {String} id - pseudo-random id for unique scroll event listener. 10554 */ 10555 10556 }, { 10557 key: "_eventsHandler", 10558 value: function _eventsHandler(id) { 10559 var _this = this, 10560 scrollListener = this.scrollListener = "scroll.zf.".concat(id); 10561 10562 _this._setSizes(function () { 10563 _this._calc(false); 10564 10565 if (_this.canStick) { 10566 if (!_this.isOn) { 10567 _this._events(id); 10568 } 10569 } else if (_this.isOn) { 10570 _this._pauseListeners(scrollListener); 10571 } 10572 }); 10573 } 10574 /** 10575 * Removes event handlers for scroll and change events on anchor. 10576 * @fires Sticky#pause 10577 * @param {String} scrollListener - unique, namespaced scroll listener attached to `window` 10578 */ 10579 10580 }, { 10581 key: "_pauseListeners", 10582 value: function _pauseListeners(scrollListener) { 10583 this.isOn = false;
vendor: 5,573 bytes, lines 10584-10748
10584 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(scrollListener); 10585 /** 10586 * Fires when the plugin is paused due to resize event shrinking the view. 10587 * @event Sticky#pause 10588 * @private 10589 */ 10590 10591 this.$element.trigger('pause.zf.sticky'); 10592 } 10593 /** 10594 * Called on every `scroll` event and on `_init` 10595 * fires functions based on booleans and cached values 10596 * @param {Boolean} checkSizes - true if plugin should recalculate sizes and breakpoints. 10597 * @param {Number} scroll - current scroll position passed from scroll event cb function. If not passed, defaults to `window.pageYOffset`. 10598 */ 10599 10600 }, { 10601 key: "_calc", 10602 value: function _calc(checkSizes, scroll) { 10603 if (checkSizes) { 10604 this._setSizes(); 10605 } 10606 10607 if (!this.canStick) { 10608 if (this.isStuck) { 10609 this._removeSticky(true); 10610 } 10611 10612 return false; 10613 } 10614 10615 if (!scroll) { 10616 scroll = window.pageYOffset; 10617 } 10618 10619 if (scroll >= this.topPoint) { 10620 if (scroll <= this.bottomPoint) { 10621 if (!this.isStuck) { 10622 this._setSticky(); 10623 } 10624 } else { 10625 if (this.isStuck) { 10626 this._removeSticky(false); 10627 } 10628 } 10629 } else { 10630 if (this.isStuck) { 10631 this._removeSticky(true); 10632 } 10633 } 10634 } 10635 /** 10636 * Causes the $element to become stuck. 10637 * Adds `position: fixed;`, and helper classes. 10638 * @fires Sticky#stuckto 10639 * @function 10640 * @private 10641 */ 10642 10643 }, { 10644 key: "_setSticky", 10645 value: function _setSticky() { 10646 var _this = this, 10647 stickTo = this.options.stickTo, 10648 mrgn = stickTo === 'top' ? 'marginTop' : 'marginBottom', 10649 notStuckTo = stickTo === 'top' ? 'bottom' : 'top', 10650 css = {}; 10651 10652 css[mrgn] = "".concat(this.options[mrgn], "em"); 10653 css[stickTo] = 0; 10654 css[notStuckTo] = 'auto'; 10655 this.isStuck = true; 10656 this.$element.removeClass("is-anchored is-at-".concat(notStuckTo)).addClass("is-stuck is-at-".concat(stickTo)).css(css) 10657 /** 10658 * Fires when the $element has become `position: fixed;` 10659 * Namespaced to `top` or `bottom`, e.g. `sticky.zf.stuckto:top` 10660 * @event Sticky#stuckto 10661 */ 10662 .trigger("sticky.zf.stuckto:".concat(stickTo)); 10663 this.$element.on("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd", function () { 10664 _this._setSizes(); 10665 }); 10666 } 10667 /** 10668 * Causes the $element to become unstuck. 10669 * Removes `position: fixed;`, and helper classes. 10670 * Adds other helper classes. 10671 * @param {Boolean} isTop - tells the function if the $element should anchor to the top or bottom of its $anchor element. 10672 * @fires Sticky#unstuckfrom 10673 * @private 10674 */ 10675 10676 }, { 10677 key: "_removeSticky", 10678 value: function _removeSticky(isTop) { 10679 var stickTo = this.options.stickTo, 10680 stickToTop = stickTo === 'top', 10681 css = {}, 10682 anchorPt = (this.points ? this.points[1] - this.points[0] : this.anchorHeight) - this.elemHeight, 10683 mrgn = stickToTop ? 'marginTop' : 'marginBottom', 10684 topOrBottom = isTop ? 'top' : 'bottom'; 10685 css[mrgn] = 0; 10686 css.bottom = 'auto'; 10687 10688 if (isTop) { 10689 css.top = 0; 10690 } else { 10691 css.top = anchorPt; 10692 } 10693 10694 this.isStuck = false; 10695 this.$element.removeClass("is-stuck is-at-".concat(stickTo)).addClass("is-anchored is-at-".concat(topOrBottom)).css(css) 10696 /** 10697 * Fires when the $element has become anchored. 10698 * Namespaced to `top` or `bottom`, e.g. `sticky.zf.unstuckfrom:bottom` 10699 * @event Sticky#unstuckfrom 10700 */ 10701 .trigger("sticky.zf.unstuckfrom:".concat(topOrBottom)); 10702 } 10703 /** 10704 * Sets the $element and $container sizes for plugin. 10705 * Calls `_setBreakPoints`. 10706 * @param {Function} cb - optional callback function to fire on completion of `_setBreakPoints`. 10707 * @private 10708 */ 10709 10710 }, { 10711 key: "_setSizes", 10712 value: function _setSizes(cb) { 10713 this.canStick = _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"].is(this.options.stickyOn); 10714 10715 if (!this.canStick) { 10716 if (cb && typeof cb === 'function') { 10717 cb(); 10718 } 10719 } 10720 10721 var newElemWidth = this.$container[0].getBoundingClientRect().width, 10722 comp = window.getComputedStyle(this.$container[0]), 10723 pdngl = parseInt(comp['padding-left'], 10), 10724 pdngr = parseInt(comp['padding-right'], 10); 10725 10726 if (this.$anchor && this.$anchor.length) { 10727 this.anchorHeight = this.$anchor[0].getBoundingClientRect().height; 10728 } else { 10729 this._parsePoints(); 10730 } 10731 10732 this.$element.css({ 10733 'max-width': "".concat(newElemWidth - pdngl - pdngr, "px") 10734 }); // Recalculate the height only if it is "dynamic" 10735 10736 if (this.options.dynamicHeight || !this.containerHeight) { 10737 // Get the sticked element height and apply it to the container to "hold the place" 10738 var newContainerHeight = this.$element[0].getBoundingClientRect().height || this.containerHeight; 10739 newContainerHeight = this.$element.css("display") === "none" ? 0 : newContainerHeight; 10740 this.$container.css('height', newContainerHeight); 10741 this.containerHeight = newContainerHeight; 10742 } 10743 10744 this.elemHeight = this.containerHeight; 10745 10746 if (!this.isStuck) { 10747 if (this.$element.hasClass('is-at-bottom')) { 10748 var anchorPt = (this.points ? this.points[1] - this.$container.offset().top : this.anchorHeight) - this.elemHeight;
vendor: 5,425 bytes, lines 10749-10949
10749 this.$element.css('top', anchorPt); 10750 } 10751 } 10752 10753 this._setBreakPoints(this.containerHeight, function () { 10754 if (cb && typeof cb === 'function') { 10755 cb(); 10756 } 10757 }); 10758 } 10759 /** 10760 * Sets the upper and lower breakpoints for the element to become sticky/unsticky. 10761 * @param {Number} elemHeight - px value for sticky.$element height, calculated by `_setSizes`. 10762 * @param {Function} cb - optional callback function to be called on completion. 10763 * @private 10764 */ 10765 10766 }, { 10767 key: "_setBreakPoints", 10768 value: function _setBreakPoints(elemHeight, cb) { 10769 if (!this.canStick) { 10770 if (cb && typeof cb === 'function') { 10771 cb(); 10772 } else { 10773 return false; 10774 } 10775 } 10776 10777 var mTop = emCalc(this.options.marginTop), 10778 mBtm = emCalc(this.options.marginBottom), 10779 topPoint = this.points ? this.points[0] : this.$anchor.offset().top, 10780 bottomPoint = this.points ? this.points[1] : topPoint + this.anchorHeight, 10781 // topPoint = this.$anchor.offset().top || this.points[0], 10782 // bottomPoint = topPoint + this.anchorHeight || this.points[1], 10783 winHeight = window.innerHeight; 10784 10785 if (this.options.stickTo === 'top') { 10786 topPoint -= mTop; 10787 bottomPoint -= elemHeight + mTop; 10788 } else if (this.options.stickTo === 'bottom') { 10789 topPoint -= winHeight - (elemHeight + mBtm); 10790 bottomPoint -= winHeight - mBtm; 10791 } else {//this would be the stickTo: both option... tricky 10792 } 10793 10794 this.topPoint = topPoint; 10795 this.bottomPoint = bottomPoint; 10796 10797 if (cb && typeof cb === 'function') { 10798 cb(); 10799 } 10800 } 10801 /** 10802 * Destroys the current sticky element. 10803 * Resets the element to the top position first. 10804 * Removes event listeners, JS-added css properties and classes, and unwraps the $element if the JS added the $container. 10805 * @function 10806 */ 10807 10808 }, { 10809 key: "_destroy", 10810 value: function _destroy() { 10811 this._removeSticky(true); 10812 10813 this.$element.removeClass("".concat(this.options.stickyClass, " is-anchored is-at-top")).css({ 10814 height: '', 10815 top: '', 10816 bottom: '', 10817 'max-width': '' 10818 }).off('resizeme.zf.trigger').off('mutateme.zf.trigger'); 10819 10820 if (this.$anchor && this.$anchor.length) { 10821 this.$anchor.off('change.zf.sticky'); 10822 } 10823 10824 if (this.scrollListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.scrollListener); 10825 if (this.onLoadListener) jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener); 10826 10827 if (this.wasWrapped) { 10828 this.$element.unwrap(); 10829 } else { 10830 this.$container.removeClass(this.options.containerClass).css({ 10831 height: '' 10832 }); 10833 } 10834 } 10835 }]); 10836 10837 return Sticky; 10838}(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 10839 10840Sticky.defaults = { 10841 /** 10842 * Customizable container template. Add your own classes for styling and sizing. 10843 * @option 10844 * @type {string} 10845 * @default '<div data-sticky-container></div>' 10846 */ 10847 container: '<div data-sticky-container></div>', 10848 10849 /** 10850 * Location in the view the element sticks to. Can be `'top'` or `'bottom'`. 10851 * @option 10852 * @type {string} 10853 * @default 'top' 10854 */ 10855 stickTo: 'top', 10856 10857 /** 10858 * If anchored to a single element, the id of that element. 10859 * @option 10860 * @type {string} 10861 * @default '' 10862 */ 10863 anchor: '', 10864 10865 /** 10866 * If using more than one element as anchor points, the id of the top anchor. 10867 * @option 10868 * @type {string} 10869 * @default '' 10870 */ 10871 topAnchor: '', 10872 10873 /** 10874 * If using more than one element as anchor points, the id of the bottom anchor. 10875 * @option 10876 * @type {string} 10877 * @default '' 10878 */ 10879 btmAnchor: '', 10880 10881 /** 10882 * Margin, in `em`'s to apply to the top of the element when it becomes sticky. 10883 * @option 10884 * @type {number} 10885 * @default 1 10886 */ 10887 marginTop: 1, 10888 10889 /** 10890 * Margin, in `em`'s to apply to the bottom of the element when it becomes sticky. 10891 * @option 10892 * @type {number} 10893 * @default 1 10894 */ 10895 marginBottom: 1, 10896 10897 /** 10898 * Breakpoint string that is the minimum screen size an element should become sticky. 10899 * @option 10900 * @type {string} 10901 * @default 'medium' 10902 */ 10903 stickyOn: 'medium', 10904 10905 /** 10906 * Class applied to sticky element, and removed on destruction. Foundation defaults to `sticky`. 10907 * @option 10908 * @type {string} 10909 * @default 'sticky' 10910 */ 10911 stickyClass: 'sticky', 10912 10913 /** 10914 * Class applied to sticky container. Foundation defaults to `sticky-container`. 10915 * @option 10916 * @type {string} 10917 * @default 'sticky-container' 10918 */ 10919 containerClass: 'sticky-container', 10920 10921 /** 10922 * If true (by default), keep the sticky container the same height as the element. Otherwise, the container height is set once and does not change. 10923 * @option 10924 * @type {boolean} 10925 * @default true 10926 */ 10927 dynamicHeight: true, 10928 10929 /** 10930 * Number of scroll events between the plugin's recalculating sticky points. Setting it to `0` will cause it to recalc every scroll event, setting it to `-1` will prevent recalc on scroll. 10931 * @option 10932 * @type {number} 10933 * @default -1 10934 */ 10935 checkEvery: -1 10936}; 10937/** 10938 * Helper function to calculate em values 10939 * @param Number {em} - number of em's to calculate into pixels 10940 */ 10941 10942function emCalc(em) { 10943 return parseInt(window.getComputedStyle(document.body, null).fontSize, 10) * em; 10944} 10945 10946 10947 10948/***/ }), 10949
vendor: 4,196 bytes, lines 10950-10985
10950/***/ "./js/foundation.tabs.js": 10951/*!*******************************!*\ 10952 !*** ./js/foundation.tabs.js ***! 10953 \*******************************/ 10954/*! exports provided: Tabs */ 10955/***/ (function(module, __webpack_exports__, __webpack_require__) { 10956 10957"use strict"; 10958__webpack_require__.r(__webpack_exports__); 10959/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tabs", function() { return Tabs; }); 10960/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 10961/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 10962/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 10963/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 10964/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js"); 10965/* harmony import */ var _foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.imageLoader */ "./js/foundation.util.imageLoader.js"); 10966function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 10967 10968function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 10969 10970function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 10971 10972function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 10973 10974function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 10975 10976function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 10977 10978function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 10979 10980function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 10981 10982function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 10983 10984function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 10985
vendor: 15,289 bytes, lines 10986-11461
10986function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 10987 10988 10989 10990 10991 10992 10993/** 10994 * Tabs module. 10995 * @module foundation.tabs 10996 * @requires foundation.util.keyboard 10997 * @requires foundation.util.imageLoader if tabs contain images 10998 */ 10999 11000var Tabs = /*#__PURE__*/function (_Plugin) { 11001 _inherits(Tabs, _Plugin); 11002 11003 var _super = _createSuper(Tabs); 11004 11005 function Tabs() { 11006 _classCallCheck(this, Tabs); 11007 11008 return _super.apply(this, arguments); 11009 } 11010 11011 _createClass(Tabs, [{ 11012 key: "_setup", 11013 value: 11014 /** 11015 * Creates a new instance of tabs. 11016 * @class 11017 * @name Tabs 11018 * @fires Tabs#init 11019 * @param {jQuery} element - jQuery object to make into tabs. 11020 * @param {Object} options - Overrides to the default plugin settings. 11021 */ 11022 function _setup(element, options) { 11023 this.$element = element; 11024 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Tabs.defaults, this.$element.data(), options); 11025 this.className = 'Tabs'; // ie9 back compat 11026 11027 this._init(); 11028 11029 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].register('Tabs', { 11030 'ENTER': 'open', 11031 'SPACE': 'open', 11032 'ARROW_RIGHT': 'next', 11033 'ARROW_UP': 'previous', 11034 'ARROW_DOWN': 'next', 11035 'ARROW_LEFT': 'previous' // 'TAB': 'next', 11036 // 'SHIFT_TAB': 'previous' 11037 11038 }); 11039 } 11040 /** 11041 * Initializes the tabs by showing and focusing (if autoFocus=true) the preset active tab. 11042 * @private 11043 */ 11044 11045 }, { 11046 key: "_init", 11047 value: function _init() { 11048 var _this2 = this; 11049 11050 var _this = this; 11051 11052 this._isInitializing = true; 11053 this.$element.attr({ 11054 'role': 'tablist' 11055 }); 11056 this.$tabTitles = this.$element.find(".".concat(this.options.linkClass)); 11057 this.$tabContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-tabs-content=\"".concat(this.$element[0].id, "\"]")); 11058 this.$tabTitles.each(function () { 11059 var $elem = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 11060 $link = $elem.find('a'), 11061 isActive = $elem.hasClass("".concat(_this.options.linkActiveClass)), 11062 hash = $link.attr('data-tabs-target') || $link[0].hash.slice(1), 11063 linkId = $link[0].id ? $link[0].id : "".concat(hash, "-label"), 11064 $tabContent = jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(hash)); 11065 $elem.attr({ 11066 'role': 'presentation' 11067 }); 11068 $link.attr({ 11069 'role': 'tab', 11070 'aria-controls': hash, 11071 'aria-selected': isActive, 11072 'id': linkId, 11073 'tabindex': isActive ? '0' : '-1' 11074 }); 11075 $tabContent.attr({ 11076 'role': 'tabpanel', 11077 'aria-labelledby': linkId 11078 }); // Save up the initial hash to return to it later when going back in history 11079 11080 if (isActive) { 11081 _this._initialAnchor = "#".concat(hash); 11082 } 11083 11084 if (!isActive) { 11085 $tabContent.attr('aria-hidden', 'true'); 11086 } 11087 11088 if (isActive && _this.options.autoFocus) { 11089 _this.onLoadListener = Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 11090 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({ 11091 scrollTop: $elem.offset().top 11092 }, _this.options.deepLinkSmudgeDelay, function () { 11093 $link.focus(); 11094 }); 11095 }); 11096 } 11097 }); 11098 11099 if (this.options.matchHeight) { 11100 var $images = this.$tabContent.find('img'); 11101 11102 if ($images.length) { 11103 Object(_foundation_util_imageLoader__WEBPACK_IMPORTED_MODULE_4__["onImagesLoaded"])($images, this._setHeight.bind(this)); 11104 } else { 11105 this._setHeight(); 11106 } 11107 } // Current context-bound function to open tabs on page load or history hashchange 11108 11109 11110 this._checkDeepLink = function () { 11111 var anchor = window.location.hash; 11112 11113 if (!anchor.length) { 11114 // If we are still initializing and there is no anchor, then there is nothing to do 11115 if (_this2._isInitializing) return; // Otherwise, move to the initial anchor 11116 11117 if (_this2._initialAnchor) anchor = _this2._initialAnchor; 11118 } 11119 11120 var anchorNoHash = anchor.indexOf('#') >= 0 ? anchor.slice(1) : anchor; 11121 var $anchor = anchorNoHash && jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(anchorNoHash)); 11122 11123 var $link = anchor && _this2.$element.find("[href$=\"".concat(anchor, "\"],[data-tabs-target=\"").concat(anchorNoHash, "\"]")).first(); // Whether the anchor element that has been found is part of this element 11124 11125 11126 var isOwnAnchor = !!($anchor.length && $link.length); 11127 11128 if (isOwnAnchor) { 11129 // If there is an anchor for the hash, select it 11130 if ($anchor && $anchor.length && $link && $link.length) { 11131 _this2.selectTab($anchor, true); 11132 } // Otherwise, collapse everything 11133 else { 11134 _this2._collapse(); 11135 } // Roll up a little to show the titles 11136 11137 11138 if (_this2.options.deepLinkSmudge) { 11139 var offset = _this2.$element.offset(); 11140 11141 jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').animate({ 11142 scrollTop: offset.top - _this2.options.deepLinkSmudgeOffset 11143 }, _this2.options.deepLinkSmudgeDelay); 11144 } 11145 /** 11146 * Fires when the plugin has deeplinked at pageload 11147 * @event Tabs#deeplink 11148 */ 11149 11150 11151 _this2.$element.trigger('deeplink.zf.tabs', [$link, $anchor]); 11152 } 11153 }; //use browser to open a tab, if it exists in this tabset 11154 11155 11156 if (this.options.deepLink) { 11157 this._checkDeepLink(); 11158 } 11159 11160 this._events(); 11161 11162 this._isInitializing = false; 11163 } 11164 /** 11165 * Adds event handlers for items within the tabs. 11166 * @private 11167 */ 11168 11169 }, { 11170 key: "_events", 11171 value: function _events() { 11172 this._addKeyHandler(); 11173 11174 this._addClickHandler(); 11175 11176 this._setHeightMqHandler = null; 11177 11178 if (this.options.matchHeight) { 11179 this._setHeightMqHandler = this._setHeight.bind(this); 11180 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('changed.zf.mediaquery', this._setHeightMqHandler); 11181 } 11182 11183 if (this.options.deepLink) { 11184 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('hashchange', this._checkDeepLink); 11185 } 11186 } 11187 /** 11188 * Adds click handlers for items within the tabs. 11189 * @private 11190 */ 11191 11192 }, { 11193 key: "_addClickHandler", 11194 value: function _addClickHandler() { 11195 var _this = this; 11196 11197 this.$element.off('click.zf.tabs').on('click.zf.tabs', ".".concat(this.options.linkClass), function (e) { 11198 e.preventDefault(); 11199 11200 _this._handleTabChange(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)); 11201 }); 11202 } 11203 /** 11204 * Adds keyboard event handlers for items within the tabs. 11205 * @private 11206 */ 11207 11208 }, { 11209 key: "_addKeyHandler", 11210 value: function _addKeyHandler() { 11211 var _this = this; 11212 11213 this.$tabTitles.off('keydown.zf.tabs').on('keydown.zf.tabs', function (e) { 11214 if (e.which === 9) return; 11215 var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 11216 $elements = $element.parent('ul').children('li'), 11217 $prevElement, 11218 $nextElement; 11219 $elements.each(function (i) { 11220 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) { 11221 if (_this.options.wrapOnKeys) { 11222 $prevElement = i === 0 ? $elements.last() : $elements.eq(i - 1); 11223 $nextElement = i === $elements.length - 1 ? $elements.first() : $elements.eq(i + 1); 11224 } else { 11225 $prevElement = $elements.eq(Math.max(0, i - 1)); 11226 $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1)); 11227 } 11228 11229 return; 11230 } 11231 }); // handle keyboard event with keyboard util 11232 11233 _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_3__["Keyboard"].handleKey(e, 'Tabs', { 11234 open: function open() { 11235 $element.find('[role="tab"]').focus(); 11236 11237 _this._handleTabChange($element); 11238 }, 11239 previous: function previous() { 11240 $prevElement.find('[role="tab"]').focus(); 11241 11242 _this._handleTabChange($prevElement); 11243 }, 11244 next: function next() { 11245 $nextElement.find('[role="tab"]').focus(); 11246 11247 _this._handleTabChange($nextElement); 11248 }, 11249 handled: function handled() { 11250 e.preventDefault(); 11251 } 11252 }); 11253 }); 11254 } 11255 /** 11256 * Opens the tab `$targetContent` defined by `$target`. Collapses active tab. 11257 * @param {jQuery} $target - Tab to open. 11258 * @param {boolean} historyHandled - browser has already handled a history update 11259 * @fires Tabs#change 11260 * @function 11261 */ 11262 11263 }, { 11264 key: "_handleTabChange", 11265 value: function _handleTabChange($target, historyHandled) { 11266 // With `activeCollapse`, if the target is the active Tab, collapse it. 11267 if ($target.hasClass("".concat(this.options.linkActiveClass))) { 11268 if (this.options.activeCollapse) { 11269 this._collapse(); 11270 } 11271 11272 return; 11273 } 11274 11275 var $oldTab = this.$element.find(".".concat(this.options.linkClass, ".").concat(this.options.linkActiveClass)), 11276 $tabLink = $target.find('[role="tab"]'), 11277 target = $tabLink.attr('data-tabs-target'), 11278 anchor = target && target.length ? "#".concat(target) : $tabLink[0].hash, 11279 $targetContent = this.$tabContent.find(anchor); //close old tab 11280 11281 this._collapseTab($oldTab); //open new tab 11282 11283 11284 this._openTab($target); //either replace or update browser history 11285 11286 11287 if (this.options.deepLink && !historyHandled) { 11288 if (this.options.updateHistory) { 11289 history.pushState({}, '', anchor); 11290 } else { 11291 history.replaceState({}, '', anchor); 11292 } 11293 } 11294 /** 11295 * Fires when the plugin has successfully changed tabs. 11296 * @event Tabs#change 11297 */ 11298 11299 11300 this.$element.trigger('change.zf.tabs', [$target, $targetContent]); //fire to children a mutation event 11301 11302 $targetContent.find("[data-mutate]").trigger("mutateme.zf.trigger"); 11303 } 11304 /** 11305 * Opens the tab `$targetContent` defined by `$target`. 11306 * @param {jQuery} $target - Tab to open. 11307 * @function 11308 */ 11309 11310 }, { 11311 key: "_openTab", 11312 value: function _openTab($target) { 11313 var $tabLink = $target.find('[role="tab"]'), 11314 hash = $tabLink.attr('data-tabs-target') || $tabLink[0].hash.slice(1), 11315 $targetContent = this.$tabContent.find("#".concat(hash)); 11316 $target.addClass("".concat(this.options.linkActiveClass)); 11317 $tabLink.attr({ 11318 'aria-selected': 'true', 11319 'tabindex': '0' 11320 }); 11321 $targetContent.addClass("".concat(this.options.panelActiveClass)).removeAttr('aria-hidden'); 11322 } 11323 /** 11324 * Collapses `$targetContent` defined by `$target`. 11325 * @param {jQuery} $target - Tab to collapse. 11326 * @function 11327 */ 11328 11329 }, { 11330 key: "_collapseTab", 11331 value: function _collapseTab($target) { 11332 var $targetAnchor = $target.removeClass("".concat(this.options.linkActiveClass)).find('[role="tab"]').attr({ 11333 'aria-selected': 'false', 11334 'tabindex': -1 11335 }); 11336 jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat($targetAnchor.attr('aria-controls'))).removeClass("".concat(this.options.panelActiveClass)).attr({ 11337 'aria-hidden': 'true' 11338 }); 11339 } 11340 /** 11341 * Collapses the active Tab. 11342 * @fires Tabs#collapse 11343 * @function 11344 */ 11345 11346 }, { 11347 key: "_collapse", 11348 value: function _collapse() { 11349 var $activeTab = this.$element.find(".".concat(this.options.linkClass, ".").concat(this.options.linkActiveClass)); 11350 11351 if ($activeTab.length) { 11352 this._collapseTab($activeTab); 11353 /** 11354 * Fires when the plugin has successfully collapsed tabs. 11355 * @event Tabs#collapse 11356 */ 11357 11358 11359 this.$element.trigger('collapse.zf.tabs', [$activeTab]); 11360 } 11361 } 11362 /** 11363 * Public method for selecting a content pane to display. 11364 * @param {jQuery | String} elem - jQuery object or string of the id of the pane to display. 11365 * @param {boolean} historyHandled - browser has already handled a history update 11366 * @function 11367 */ 11368 11369 }, { 11370 key: "selectTab", 11371 value: function selectTab(elem, historyHandled) { 11372 var idStr, hashIdStr; 11373 11374 if (_typeof(elem) === 'object') { 11375 idStr = elem[0].id; 11376 } else { 11377 idStr = elem; 11378 } 11379 11380 if (idStr.indexOf('#') < 0) { 11381 hashIdStr = "#".concat(idStr); 11382 } else { 11383 hashIdStr = idStr; 11384 idStr = idStr.slice(1); 11385 } 11386 11387 var $target = this.$tabTitles.has("[href$=\"".concat(hashIdStr, "\"],[data-tabs-target=\"").concat(idStr, "\"]")).first(); 11388 11389 this._handleTabChange($target, historyHandled); 11390 } 11391 }, { 11392 key: "_setHeight", 11393 value: 11394 /** 11395 * Sets the height of each panel to the height of the tallest panel. 11396 * If enabled in options, gets called on media query change. 11397 * If loading content via external source, can be called directly or with _reflow. 11398 * If enabled with `data-match-height="true"`, tabs sets to equal height 11399 * @function 11400 * @private 11401 */ 11402 function _setHeight() { 11403 var max = 0, 11404 _this = this; // Lock down the `this` value for the root tabs object 11405 11406 11407 if (!this.$tabContent) { 11408 return; 11409 } 11410 11411 this.$tabContent.find(".".concat(this.options.panelClass)).css('min-height', '').each(function () { 11412 var panel = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 11413 isActive = panel.hasClass("".concat(_this.options.panelActiveClass)); // get the options from the parent instead of trying to get them from the child 11414 11415 if (!isActive) { 11416 panel.css({ 11417 'visibility': 'hidden', 11418 'display': 'block' 11419 }); 11420 } 11421 11422 var temp = this.getBoundingClientRect().height; 11423 11424 if (!isActive) { 11425 panel.css({ 11426 'visibility': '', 11427 'display': '' 11428 }); 11429 } 11430 11431 max = temp > max ? temp : max; 11432 }).css('min-height', "".concat(max, "px")); 11433 } 11434 /** 11435 * Destroys an instance of tabs. 11436 * @fires Tabs#destroyed 11437 */ 11438 11439 }, { 11440 key: "_destroy", 11441 value: function _destroy() { 11442 this.$element.find(".".concat(this.options.linkClass)).off('.zf.tabs').hide().end().find(".".concat(this.options.panelClass)).hide(); 11443 11444 if (this.options.matchHeight) { 11445 if (this._setHeightMqHandler != null) { 11446 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('changed.zf.mediaquery', this._setHeightMqHandler); 11447 } 11448 } 11449 11450 if (this.options.deepLink) { 11451 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off('hashchange', this._checkDeepLink); 11452 } 11453 11454 if (this.onLoadListener) { 11455 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(this.onLoadListener); 11456 } 11457 } 11458 }]); 11459 11460 return Tabs; 11461}
11461(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_1__["Plugin"]); 11462 11463Tabs.defaults = { 11464 /** 11465 * Link the location hash to the active pane. 11466 * Set the location hash when the active pane changes, and open the corresponding pane when the location changes. 11467 * @option 11468 * @type {boolean} 11469 * @default false 11470 */ 11471 deepLink: false, 11472 11473 /** 11474 * If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the tab panel is visible 11475 * @option 11476 * @type {boolean} 11477 * @default false 11478 */ 11479 deepLinkSmudge: false, 11480 11481 /** 11482 * If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment 11483 * @option 11484 * @type {number} 11485 * @default 300 11486 */ 11487 deepLinkSmudgeDelay: 300, 11488 11489 /** 11490 * If `deepLinkSmudge` is enabled, animation offset from the top for the deep link adjustment 11491 * @option 11492 * @type {number} 11493 * @default 0 11494 */ 11495 deepLinkSmudgeOffset: 0, 11496 11497 /** 11498 * If `deepLink` is enabled, update the browser history with the open tab 11499 * @option 11500 * @type {boolean} 11501 * @default false 11502 */ 11503 updateHistory: false, 11504 11505 /** 11506 * Allows the window to scroll to content of active pane on load. 11507 * Not recommended if more than one tab panel per page. 11508 * @option 11509 * @type {boolean} 11510 * @default false 11511 */ 11512 autoFocus: false, 11513 11514 /** 11515 * Allows keyboard input to 'wrap' around the tab links. 11516 * @option 11517 * @type {boolean} 11518 * @default true 11519 */ 11520 wrapOnKeys: true, 11521 11522 /** 11523 * Allows the tab content panes to match heights if set to true. 11524 * @option 11525 * @type {boolean} 11526 * @default false 11527 */ 11528 matchHeight: false, 11529 11530 /** 11531 * Allows active tabs to collapse when clicked. 11532 * @option 11533 * @type {boolean} 11534 * @default false 11535 */ 11536 activeCollapse: false, 11537 11538 /** 11539 * Class applied to `li`'s in tab link list. 11540 * @option 11541 * @type {string} 11542 * @default 'tabs-title' 11543 */ 11544 linkClass: 'tabs-title', 11545 11546 /** 11547 * Class applied to the active `li` in tab link list. 11548 * @option 11549 * @type {string} 11550 * @default 'is-active' 11551 */ 11552 linkActiveClass: 'is-active', 11553 11554 /** 11555 * Class applied to the content containers. 11556 * @option 11557 * @type {string} 11558 * @default 'tabs-panel' 11559 */ 11560 panelClass: 'tabs-panel', 11561 11562 /** 11563 * Class applied to the active content container. 11564 * @option 11565 * @type {string} 11566 * @default 'is-active' 11567 */ 11568 panelActiveClass: 'is-active' 11569}; 11570 11571 11572/***/ }), 11573
vendor: 4,202 bytes, lines 11574-11609
11574/***/ "./js/foundation.toggler.js": 11575/*!**********************************!*\ 11576 !*** ./js/foundation.toggler.js ***! 11577 \**********************************/ 11578/*! exports provided: Toggler */ 11579/***/ (function(module, __webpack_exports__, __webpack_require__) { 11580 11581"use strict"; 11582__webpack_require__.r(__webpack_exports__); 11583/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Toggler", function() { return Toggler; }); 11584/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 11585/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 11586/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 11587/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js"); 11588/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 11589/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 11590function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 11591 11592function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 11593 11594function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 11595 11596function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 11597 11598function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 11599 11600function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 11601 11602function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 11603 11604function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 11605 11606function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 11607 11608function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 11609
vendor: 5,971 bytes, lines 11610-11790
11610function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 11611 11612 11613 11614 11615 11616 11617/** 11618 * Toggler module. 11619 * @module foundation.toggler 11620 * @requires foundation.util.motion 11621 * @requires foundation.util.triggers 11622 */ 11623 11624var Toggler = /*#__PURE__*/function (_Plugin) { 11625 _inherits(Toggler, _Plugin); 11626 11627 var _super = _createSuper(Toggler); 11628 11629 function Toggler() { 11630 _classCallCheck(this, Toggler); 11631 11632 return _super.apply(this, arguments); 11633 } 11634 11635 _createClass(Toggler, [{ 11636 key: "_setup", 11637 value: 11638 /** 11639 * Creates a new instance of Toggler. 11640 * @class 11641 * @name Toggler 11642 * @fires Toggler#init 11643 * @param {Object} element - jQuery object to add the trigger to. 11644 * @param {Object} options - Overrides to the default plugin settings. 11645 */ 11646 function _setup(element, options) { 11647 this.$element = element; 11648 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Toggler.defaults, element.data(), options); 11649 this.className = ''; 11650 this.className = 'Toggler'; // ie9 back compat 11651 // Triggers init is idempotent, just need to make sure it is initialized 11652 11653 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 11654 11655 this._init(); 11656 11657 this._events(); 11658 } 11659 /** 11660 * Initializes the Toggler plugin by parsing the toggle class from data-toggler, or animation classes from data-animate. 11661 * @function 11662 * @private 11663 */ 11664 11665 }, { 11666 key: "_init", 11667 value: function _init() { 11668 // Collect triggers to set ARIA attributes to 11669 var id = this.$element[0].id, 11670 $triggers = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open~=\"".concat(id, "\"], [data-close~=\"").concat(id, "\"], [data-toggle~=\"").concat(id, "\"]")); 11671 var input; // Parse animation classes if they were set 11672 11673 if (this.options.animate) { 11674 input = this.options.animate.split(' '); 11675 this.animationIn = input[0]; 11676 this.animationOut = input[1] || null; // - aria-expanded: according to the element visibility. 11677 11678 $triggers.attr('aria-expanded', !this.$element.is(':hidden')); 11679 } // Otherwise, parse toggle class 11680 else { 11681 input = this.options.toggler; 11682 11683 if (typeof input !== 'string' || !input.length) { 11684 throw new Error("The 'toggler' option containing the target class is required, got \"".concat(input, "\"")); 11685 } // Allow for a . at the beginning of the string 11686 11687 11688 this.className = input[0] === '.' ? input.slice(1) : input; // - aria-expanded: according to the elements class set. 11689 11690 $triggers.attr('aria-expanded', this.$element.hasClass(this.className)); 11691 } // - aria-controls: adding the element id to it if not already in it. 11692 11693 11694 $triggers.each(function (index, trigger) { 11695 var $trigger = jquery__WEBPACK_IMPORTED_MODULE_0___default()(trigger); 11696 var controls = $trigger.attr('aria-controls') || ''; 11697 var containsId = new RegExp("\\b".concat(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__["RegExpEscape"])(id), "\\b")).test(controls); 11698 if (!containsId) $trigger.attr('aria-controls', controls ? "".concat(controls, " ").concat(id) : id); 11699 }); 11700 } 11701 /** 11702 * Initializes events for the toggle trigger. 11703 * @function 11704 * @private 11705 */ 11706 11707 }, { 11708 key: "_events", 11709 value: function _events() { 11710 this.$element.off('toggle.zf.trigger').on('toggle.zf.trigger', this.toggle.bind(this)); 11711 } 11712 /** 11713 * Toggles the target class on the target element. An event is fired from the original trigger depending on if the resultant state was "on" or "off". 11714 * @function 11715 * @fires Toggler#on 11716 * @fires Toggler#off 11717 */ 11718 11719 }, { 11720 key: "toggle", 11721 value: function toggle() { 11722 this[this.options.animate ? '_toggleAnimate' : '_toggleClass'](); 11723 } 11724 }, { 11725 key: "_toggleClass", 11726 value: function _toggleClass() { 11727 this.$element.toggleClass(this.className); 11728 var isOn = this.$element.hasClass(this.className); 11729 11730 if (isOn) { 11731 /** 11732 * Fires if the target element has the class after a toggle. 11733 * @event Toggler#on 11734 */ 11735 this.$element.trigger('on.zf.toggler'); 11736 } else { 11737 /** 11738 * Fires if the target element does not have the class after a toggle. 11739 * @event Toggler#off 11740 */ 11741 this.$element.trigger('off.zf.toggler'); 11742 } 11743 11744 this._updateARIA(isOn); 11745 11746 this.$element.find('[data-mutate]').trigger('mutateme.zf.trigger'); 11747 } 11748 }, { 11749 key: "_toggleAnimate", 11750 value: function _toggleAnimate() { 11751 var _this = this; 11752 11753 if (this.$element.is(':hidden')) { 11754 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Motion"].animateIn(this.$element, this.animationIn, function () { 11755 _this._updateARIA(true); 11756 11757 this.trigger('on.zf.toggler'); 11758 this.find('[data-mutate]').trigger('mutateme.zf.trigger'); 11759 }); 11760 } else { 11761 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_1__["Motion"].animateOut(this.$element, this.animationOut, function () { 11762 _this._updateARIA(false); 11763 11764 this.trigger('off.zf.toggler'); 11765 this.find('[data-mutate]').trigger('mutateme.zf.trigger'); 11766 }); 11767 } 11768 } 11769 }, { 11770 key: "_updateARIA", 11771 value: function _updateARIA(isOn) { 11772 var id = this.$element[0].id; 11773 jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-open=\"".concat(id, "\"], [data-close=\"").concat(id, "\"], [data-toggle=\"").concat(id, "\"]")).attr({ 11774 'aria-expanded': isOn ? true : false 11775 }); 11776 } 11777 /** 11778 * Destroys the instance of Toggler on the element. 11779 * @function 11780 */ 11781 11782 }, { 11783 key: "_destroy", 11784 value: function _destroy() { 11785 this.$element.off('.zf.toggler'); 11786 } 11787 }]); 11788 11789 return Toggler; 11790}
11790(_foundation_core_plugin__WEBPACK_IMPORTED_MODULE_2__["Plugin"]); 11791 11792Toggler.defaults = { 11793 /** 11794 * Class of the element to toggle. It can be provided with or without "." 11795 * @option 11796 * @type {string} 11797 */ 11798 toggler: undefined, 11799 11800 /** 11801 * Tells the plugin if the element should animated when toggled. 11802 * @option 11803 * @type {boolean} 11804 * @default false 11805 */ 11806 animate: false 11807}; 11808 11809 11810/***/ }), 11811
vendor: 4,838 bytes, lines 11812-11851
11812/***/ "./js/foundation.tooltip.js": 11813/*!**********************************!*\ 11814 !*** ./js/foundation.tooltip.js ***! 11815 \**********************************/ 11816/*! exports provided: Tooltip */ 11817/***/ (function(module, __webpack_exports__, __webpack_require__) { 11818 11819"use strict"; 11820__webpack_require__.r(__webpack_exports__); 11821/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return Tooltip; }); 11822/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 11823/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 11824/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 11825/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js"); 11826/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js"); 11827/* harmony import */ var _foundation_positionable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.positionable */ "./js/foundation.positionable.js"); 11828function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 11829 11830function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 11831 11832function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 11833 11834function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 11835 11836function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } 11837 11838function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 11839 11840function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 11841 11842function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 11843 11844function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 11845 11846function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } 11847 11848function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 11849 11850function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 11851
11852function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 11853 11854 11855 11856 11857 11858 11859/** 11860 * Tooltip module. 11861 * @module foundation.tooltip 11862 * @requires foundation.util.box 11863 * @requires foundation.util.mediaQuery 11864 * @requires foundation.util.triggers 11865 */ 11866 11867var Tooltip = /*#__PURE__*/function (_Positionable) { 11868 _inherits(Tooltip, _Positionable); 11869 11870 var _super = _createSuper(Tooltip); 11871 11872 function Tooltip() { 11873 _classCallCheck(this, Tooltip); 11874 11875 return _super.apply(this, arguments); 11876 } 11877 11878 _createClass(Tooltip, [{ 11879 key: "_setup", 11880 value: 11881 /** 11882 * Creates a new instance of a Tooltip. 11883 * @class 11884 * @name Tooltip 11885 * @fires Tooltip#init 11886 * @param {jQuery} element - jQuery object to attach a tooltip to. 11887 * @param {Object} options - object to extend the default configuration. 11888 */ 11889 function _setup(element, options) { 11890 this.$element = element; 11891 this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Tooltip.defaults, this.$element.data(), options); 11892 this.className = 'Tooltip'; // ie9 back compat 11893 11894 this.isActive = false; 11895 this.isClick = false; // Triggers init is idempotent, just need to make sure it is initialized 11896 11897 _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_3__["Triggers"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 11898 11899 this._init(); 11900 } 11901 /** 11902 * Initializes the tooltip by setting the creating the tip element, adding it's text, setting private variables and setting attributes on the anchor. 11903 * @private 11904 */ 11905 11906 }, { 11907 key: "_init", 11908 value: function _init() { 11909 _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"]._init(); 11910 11911 var elemId = this.$element.attr('aria-describedby') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["GetYoDigits"])(6, 'tooltip'); 11912 this.options.tipText = this.options.tipText || this.$element.attr('title'); 11913 this.template = this.options.template ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.template) : this._buildTemplate(elemId); 11914 11915 if (this.options.allowHtml) { 11916 this.template.appendTo(document.body).html(this.options.tipText).hide(); 11917 } else { 11918 this.template.appendTo(document.body).text(this.options.tipText).hide(); 11919 } 11920 11921 this.$element.attr({ 11922 'title': '', 11923 'aria-describedby': elemId, 11924 'data-yeti-box': elemId, 11925 'data-toggle': elemId, 11926 'data-resize': elemId 11927 }).addClass(this.options.triggerClass); 11928 11929 _get(_getPrototypeOf(Tooltip.prototype), "_init", this).call(this); 11930 11931 this._events(); 11932 } 11933 }, { 11934 key: "_getDefaultPosition", 11935 value: function _getDefaultPosition() { 11936 // handle legacy classnames 11937 var elementClassName = this.$element[0].className; 11938 11939 if (this.$element[0] instanceof SVGElement) { 11940 elementClassName = elementClassName.baseVal; 11941 } 11942 11943 var position = elementClassName.match(/\b(top|left|right|bottom)\b/g); 11944 return position ? position[0] : 'top'; 11945 } 11946 }, { 11947 key: "_getDefaultAlignment", 11948 value: function _getDefaultAlignment() { 11949 return 'center'; 11950 } 11951 }, { 11952 key: "_getHOffset", 11953 value: function _getHOffset() { 11954 if (this.position === 'left' || this.position === 'right') { 11955 return this.options.hOffset + this.options.tooltipWidth; 11956 } else { 11957 return this.options.hOffset; 11958 } 11959 } 11960 }, { 11961 key: "_getVOffset", 11962 value: function _getVOffset() { 11963 if (this.position === 'top' || this.position === 'bottom') { 11964 return this.options.vOffset + this.options.tooltipHeight; 11965 } else { 11966 return this.options.vOffset; 11967 } 11968 } 11969 /** 11970 * builds the tooltip element, adds attributes, and returns the template. 11971 * @private 11972 */ 11973 11974 }, { 11975 key: "_buildTemplate", 11976 value: function _buildTemplate(id) { 11977 var templateClasses = "".concat(this.options.tooltipClass, " ").concat(this.options.templateClasses).trim(); 11978 var $template = jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div></div>').addClass(templateClasses).attr({ 11979 'role': 'tooltip', 11980 'aria-hidden': true, 11981 'data-is-active': false, 11982 'data-is-focus': false, 11983 'id': id 11984 }); 11985 return $template; 11986 } 11987 /** 11988 * sets the position class of an element and recursively calls itself until there are no more possible positions to attempt, or the tooltip element is no longer colliding. 11989 * if the tooltip is larger than the screen width, default to full width - any user selected margin 11990 * @private 11991 */ 11992 11993 }, { 11994 key: "_setPosition", 11995 value: function _setPosition() { 11996 _get(_getPrototypeOf(Tooltip.prototype), "_setPosition", this).call(this, this.$element, this.template); 11997 } 11998 /** 11999 * reveals the tooltip, and fires an event to close any other open tooltips on the page 12000 * @fires Tooltip#closeme 12001 * @fires Tooltip#show 12002 * @function 12003 */ 12004 12005 }, { 12006 key: "show", 12007 value: function show() { 12008 if (this.options.showOn !== 'all' && !_foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_2__["MediaQuery"].is(this.options.showOn)) { 12009 // console.error('The screen is too small to display this tooltip'); 12010 return false;
vendor: 1,610 bytes, lines 12011-12067
12011 } 12012 12013 var _this = this; 12014 12015 this.template.css('visibility', 'hidden').show(); 12016 12017 this._setPosition(); 12018 12019 this.template.removeClass('top bottom left right').addClass(this.position); 12020 this.template.removeClass('align-top align-bottom align-left align-right align-center').addClass('align-' + this.alignment); 12021 /** 12022 * Fires to close all other open tooltips on the page 12023 * @event Closeme#tooltip 12024 */ 12025 12026 this.$element.trigger('closeme.zf.tooltip', this.template.attr('id')); 12027 this.template.attr({ 12028 'data-is-active': true, 12029 'aria-hidden': false 12030 }); 12031 _this.isActive = true; 12032 this.template.stop().hide().css('visibility', '').fadeIn(this.options.fadeInDuration, function () {//maybe do stuff? 12033 }); 12034 /** 12035 * Fires when the tooltip is shown 12036 * @event Tooltip#show 12037 */ 12038 12039 this.$element.trigger('show.zf.tooltip'); 12040 } 12041 /** 12042 * Hides the current tooltip, and resets the positioning class if it was changed due to collision 12043 * @fires Tooltip#hide 12044 * @function 12045 */ 12046 12047 }, { 12048 key: "hide", 12049 value: function hide() { 12050 var _this = this; 12051 12052 this.template.stop().attr({ 12053 'aria-hidden': true, 12054 'data-is-active': false 12055 }).fadeOut(this.options.fadeOutDuration, function () { 12056 _this.isActive = false; 12057 _this.isClick = false; 12058 }); 12059 /** 12060 * fires when the tooltip is hidden 12061 * @event Tooltip#hide 12062 */ 12063 12064 this.$element.trigger('hide.zf.tooltip'); 12065 } 12066 /** 12067 * adds event listeners for the tooltip and its anchor
vendor: 6,520 bytes, lines 12068-12319
12068 * TODO combine some of the listeners like focus and mouseenter, etc. 12069 * @private 12070 */ 12071 12072 }, { 12073 key: "_events", 12074 value: function _events() { 12075 var _this = this; 12076 12077 var hasTouch = 'ontouchstart' in window || typeof window.ontouchstart !== 'undefined'; 12078 var isFocus = false; // `disableForTouch: Fully disable the tooltip on touch devices 12079 12080 if (hasTouch && this.options.disableForTouch) return; 12081 12082 if (!this.options.disableHover) { 12083 this.$element.on('mouseenter.zf.tooltip', function () { 12084 if (!_this.isActive) { 12085 _this.timeout = setTimeout(function () { 12086 _this.show(); 12087 }, _this.options.hoverDelay); 12088 } 12089 }).on('mouseleave.zf.tooltip', Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["ignoreMousedisappear"])(function () { 12090 clearTimeout(_this.timeout); 12091 12092 if (!isFocus || _this.isClick && !_this.options.clickOpen) { 12093 _this.hide(); 12094 } 12095 })); 12096 } 12097 12098 if (hasTouch) { 12099 this.$element.on('tap.zf.tooltip touchend.zf.tooltip', function () { 12100 _this.isActive ? _this.hide() : _this.show(); 12101 }); 12102 } 12103 12104 if (this.options.clickOpen) { 12105 this.$element.on('mousedown.zf.tooltip', function () { 12106 if (_this.isClick) {//_this.hide(); 12107 // _this.isClick = false; 12108 } else { 12109 _this.isClick = true; 12110 12111 if ((_this.options.disableHover || !_this.$element.attr('tabindex')) && !_this.isActive) { 12112 _this.show(); 12113 } 12114 } 12115 }); 12116 } else { 12117 this.$element.on('mousedown.zf.tooltip', function () { 12118 _this.isClick = true; 12119 }); 12120 } 12121 12122 this.$element.on({ 12123 // 'toggle.zf.trigger': this.toggle.bind(this), 12124 // 'close.zf.trigger': this.hide.bind(this) 12125 'close.zf.trigger': this.hide.bind(this) 12126 }); 12127 this.$element.on('focus.zf.tooltip', function () { 12128 isFocus = true; 12129 12130 if (_this.isClick) { 12131 // If we're not showing open on clicks, we need to pretend a click-launched focus isn't 12132 // a real focus, otherwise on hover and come back we get bad behavior 12133 if (!_this.options.clickOpen) { 12134 isFocus = false; 12135 } 12136 12137 return false; 12138 } else { 12139 _this.show(); 12140 } 12141 }).on('focusout.zf.tooltip', function () { 12142 isFocus = false; 12143 _this.isClick = false; 12144 12145 _this.hide(); 12146 }).on('resizeme.zf.trigger', function () { 12147 if (_this.isActive) { 12148 _this._setPosition(); 12149 } 12150 }); 12151 } 12152 /** 12153 * adds a toggle method, in addition to the static show() & hide() functions 12154 * @function 12155 */ 12156 12157 }, { 12158 key: "toggle", 12159 value: function toggle() { 12160 if (this.isActive) { 12161 this.hide(); 12162 } else { 12163 this.show(); 12164 } 12165 } 12166 /** 12167 * Destroys an instance of tooltip, removes template element from the view. 12168 * @function 12169 */ 12170 12171 }, { 12172 key: "_destroy", 12173 value: function _destroy() { 12174 this.$element.attr('title', this.template.text()).off('.zf.trigger .zf.tooltip').removeClass(this.options.triggerClass).removeClass('top right left bottom').removeAttr('aria-describedby data-disable-hover data-resize data-toggle data-tooltip data-yeti-box'); 12175 this.template.remove(); 12176 } 12177 }]); 12178 12179 return Tooltip; 12180}(_foundation_positionable__WEBPACK_IMPORTED_MODULE_4__["Positionable"]); 12181 12182Tooltip.defaults = { 12183 /** 12184 * Time, in ms, before a tooltip should open on hover. 12185 * @option 12186 * @type {number} 12187 * @default 200 12188 */ 12189 hoverDelay: 200, 12190 12191 /** 12192 * Time, in ms, a tooltip should take to fade into view. 12193 * @option 12194 * @type {number} 12195 * @default 150 12196 */ 12197 fadeInDuration: 150, 12198 12199 /** 12200 * Time, in ms, a tooltip should take to fade out of view. 12201 * @option 12202 * @type {number} 12203 * @default 150 12204 */ 12205 fadeOutDuration: 150, 12206 12207 /** 12208 * Disables hover events from opening the tooltip if set to true 12209 * @option 12210 * @type {boolean} 12211 * @default false 12212 */ 12213 disableHover: false, 12214 12215 /** 12216 * Disable the tooltip for touch devices. 12217 * This can be useful to make elements with a tooltip on it trigger their 12218 * action on the first tap instead of displaying the tooltip. 12219 * @option 12220 * @type {booelan} 12221 * @default false 12222 */ 12223 disableForTouch: false, 12224 12225 /** 12226 * Optional addtional classes to apply to the tooltip template on init. 12227 * @option 12228 * @type {string} 12229 * @default '' 12230 */ 12231 templateClasses: '', 12232 12233 /** 12234 * Non-optional class added to tooltip templates. Foundation default is 'tooltip'. 12235 * @option 12236 * @type {string} 12237 * @default 'tooltip' 12238 */ 12239 tooltipClass: 'tooltip', 12240 12241 /** 12242 * Class applied to the tooltip anchor element. 12243 * @option 12244 * @type {string} 12245 * @default 'has-tip' 12246 */ 12247 triggerClass: 'has-tip', 12248 12249 /** 12250 * Minimum breakpoint size at which to open the tooltip. 12251 * @option 12252 * @type {string} 12253 * @default 'small' 12254 */ 12255 showOn: 'small', 12256 12257 /** 12258 * Custom template to be used to generate markup for tooltip. 12259 * @option 12260 * @type {string} 12261 * @default '' 12262 */ 12263 template: '', 12264 12265 /** 12266 * Text displayed in the tooltip template on open. 12267 * @option 12268 * @type {string} 12269 * @default '' 12270 */ 12271 tipText: '', 12272 touchCloseText: 'Tap to close.', 12273 12274 /** 12275 * Allows the tooltip to remain open if triggered with a click or touch event. 12276 * @option 12277 * @type {boolean} 12278 * @default true 12279 */ 12280 clickOpen: true, 12281 12282 /** 12283 * Position of tooltip. Can be left, right, bottom, top, or auto. 12284 * @option 12285 * @type {string} 12286 * @default 'auto' 12287 */ 12288 position: 'auto', 12289 12290 /** 12291 * Alignment of tooltip relative to anchor. Can be left, right, bottom, top, center, or auto. 12292 * @option 12293 * @type {string} 12294 * @default 'auto' 12295 */ 12296 alignment: 'auto', 12297 12298 /** 12299 * Allow overlap of container/window. If false, tooltip will first try to 12300 * position as defined by data-position and data-alignment, but reposition if 12301 * it would cause an overflow. @option 12302 * @type {boolean} 12303 * @default false 12304 */ 12305 allowOverlap: false, 12306 12307 /** 12308 * Allow overlap of only the bottom of the container. This is the most common 12309 * behavior for dropdowns, allowing the dropdown to extend the bottom of the 12310 * screen but not otherwise influence or break out of the container. 12311 * Less common for tooltips. 12312 * @option 12313 * @type {boolean} 12314 * @default false 12315 */ 12316 allowBottomOverlap: false, 12317 12318 /** 12319 * Distance, in pixels, the template should push away from the anch
12319or on the Y axis. 12320 * @option 12321 * @type {number} 12322 * @default 0 12323 */ 12324 vOffset: 0, 12325 12326 /** 12327 * Distance, in pixels, the template should push away from the anchor on the X axis 12328 * @option 12329 * @type {number} 12330 * @default 0 12331 */ 12332 hOffset: 0, 12333 12334 /** 12335 * Distance, in pixels, the template spacing auto-adjust for a vertical tooltip 12336 * @option 12337 * @type {number} 12338 * @default 14 12339 */ 12340 tooltipHeight: 14, 12341 12342 /** 12343 * Distance, in pixels, the template spacing auto-adjust for a horizontal tooltip 12344 * @option 12345 * @type {number} 12346 * @default 12 12347 */ 12348 tooltipWidth: 12, 12349 12350 /** 12351 * Allow HTML in tooltip. Warning: If you are loading user-generated content into tooltips, 12352 * allowing HTML may open yourself up to XSS attacks. 12353 * @option 12354 * @type {boolean} 12355 * @default false 12356 */ 12357 allowHtml: false 12358}; 12359/** 12360 * TODO utilize resize event trigger 12361 */ 12362 12363 12364 12365/***/ }), 12366
vendor: 6,784 bytes, lines 12367-12570
12367/***/ "./js/foundation.util.box.js": 12368/*!***********************************!*\ 12369 !*** ./js/foundation.util.box.js ***! 12370 \***********************************/ 12371/*! exports provided: Box */ 12372/***/ (function(module, __webpack_exports__, __webpack_require__) { 12373 12374"use strict"; 12375__webpack_require__.r(__webpack_exports__); 12376/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Box", function() { return Box; }); 12377var Box = { 12378 ImNotTouchingYou: ImNotTouchingYou, 12379 OverlapArea: OverlapArea, 12380 GetDimensions: GetDimensions, 12381 GetExplicitOffsets: GetExplicitOffsets 12382}; 12383/** 12384 * Compares the dimensions of an element to a container and determines collision events with container. 12385 * @function 12386 * @param {jQuery} element - jQuery object to test for collisions. 12387 * @param {jQuery} parent - jQuery object to use as bounding container. 12388 * @param {Boolean} lrOnly - set to true to check left and right values only. 12389 * @param {Boolean} tbOnly - set to true to check top and bottom values only. 12390 * @default if no parent object passed, detects collisions with `window`. 12391 * @returns {Boolean} - true if collision free, false if a collision in any direction. 12392 */ 12393 12394function ImNotTouchingYou(element, parent, lrOnly, tbOnly, ignoreBottom) { 12395 return OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) === 0; 12396} 12397 12398function OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) { 12399 var eleDims = GetDimensions(element), 12400 topOver, 12401 bottomOver, 12402 leftOver, 12403 rightOver; 12404 12405 if (parent) { 12406 var parDims = GetDimensions(parent); 12407 bottomOver = parDims.height + parDims.offset.top - (eleDims.offset.top + eleDims.height); 12408 topOver = eleDims.offset.top - parDims.offset.top; 12409 leftOver = eleDims.offset.left - parDims.offset.left; 12410 rightOver = parDims.width + parDims.offset.left - (eleDims.offset.left + eleDims.width); 12411 } else { 12412 bottomOver = eleDims.windowDims.height + eleDims.windowDims.offset.top - (eleDims.offset.top + eleDims.height); 12413 topOver = eleDims.offset.top - eleDims.windowDims.offset.top; 12414 leftOver = eleDims.offset.left - eleDims.windowDims.offset.left; 12415 rightOver = eleDims.windowDims.width - (eleDims.offset.left + eleDims.width); 12416 } 12417 12418 bottomOver = ignoreBottom ? 0 : Math.min(bottomOver, 0); 12419 topOver = Math.min(topOver, 0); 12420 leftOver = Math.min(leftOver, 0); 12421 rightOver = Math.min(rightOver, 0); 12422 12423 if (lrOnly) { 12424 return leftOver + rightOver; 12425 } 12426 12427 if (tbOnly) { 12428 return topOver + bottomOver; 12429 } // use sum of squares b/c we care about overlap area. 12430 12431 12432 return Math.sqrt(topOver * topOver + bottomOver * bottomOver + leftOver * leftOver + rightOver * rightOver); 12433} 12434/** 12435 * Uses native methods to return an object of dimension values. 12436 * @function 12437 * @param {jQuery || HTML} element - jQuery object or DOM element for which to get the dimensions. Can be any element other that document or window. 12438 * @returns {Object} - nested object of integer pixel values 12439 * TODO - if element is window, return only those values. 12440 */ 12441 12442 12443function GetDimensions(elem) { 12444 elem = elem.length ? elem[0] : elem; 12445 12446 if (elem === window || elem === document) { 12447 throw new Error("I'm sorry, Dave. I'm afraid I can't do that."); 12448 } 12449 12450 var rect = elem.getBoundingClientRect(), 12451 parRect = elem.parentNode.getBoundingClientRect(), 12452 winRect = document.body.getBoundingClientRect(), 12453 winY = window.pageYOffset, 12454 winX = window.pageXOffset; 12455 return { 12456 width: rect.width, 12457 height: rect.height, 12458 offset: { 12459 top: rect.top + winY, 12460 left: rect.left + winX 12461 }, 12462 parentDims: { 12463 width: parRect.width, 12464 height: parRect.height, 12465 offset: { 12466 top: parRect.top + winY, 12467 left: parRect.left + winX 12468 } 12469 }, 12470 windowDims: { 12471 width: winRect.width, 12472 height: winRect.height, 12473 offset: { 12474 top: winY, 12475 left: winX 12476 } 12477 } 12478 }; 12479} 12480/** 12481 * Returns an object of top and left integer pixel values for dynamically rendered elements, 12482 * such as: Tooltip, Reveal, and Dropdown. Maintained for backwards compatibility, and where 12483 * you don't know alignment, but generally from 12484 * 6.4 forward you should use GetExplicitOffsets, as GetOffsets conflates position and alignment. 12485 * @function 12486 * @param {jQuery} element - jQuery object for the element being positioned. 12487 * @param {jQuery} anchor - jQuery object for the element's anchor point. 12488 * @param {String} position - a string relating to the desired position of the element, relative to it's anchor 12489 * @param {Number} vOffset - integer pixel value of desired vertical separation between anchor and element. 12490 * @param {Number} hOffset - integer pixel value of desired horizontal separation between anchor and element. 12491 * @param {Boolean} isOverflow - if a collision event is detected, sets to true to default the element to full width - any desired offset. 12492 * TODO alter/rewrite to work with `em` values as well/instead of pixels 12493 */ 12494 12495 12496function GetExplicitOffsets(element, anchor, position, alignment, vOffset, hOffset, isOverflow) { 12497 var $eleDims = GetDimensions(element), 12498 $anchorDims = anchor ? GetDimensions(anchor) : null; 12499 var topVal, leftVal; 12500 12501 if ($anchorDims !== null) { 12502 // set position related attribute 12503 switch (position) { 12504 case 'top': 12505 topVal = $anchorDims.offset.top - ($eleDims.height + vOffset); 12506 break; 12507 12508 case 'bottom': 12509 topVal = $anchorDims.offset.top + $anchorDims.height + vOffset; 12510 break; 12511 12512 case 'left': 12513 leftVal = $anchorDims.offset.left - ($eleDims.width + hOffset); 12514 break; 12515 12516 case 'right': 12517 leftVal = $anchorDims.offset.left + $anchorDims.width + hOffset; 12518 break; 12519 } // set alignment related attribute 12520 12521 12522 switch (position) { 12523 case 'top': 12524 case 'bottom': 12525 switch (alignment) { 12526 case 'left': 12527 leftVal = $anchorDims.offset.left + hOffset; 12528 break; 12529 12530 case 'right': 12531 leftVal = $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset; 12532 break; 12533 12534 case 'center': 12535 leftVal = isOverflow ? hOffset : $anchorDims.offset.left + $anchorDims.width / 2 - $eleDims.width / 2 + hOffset; 12536 break; 12537 } 12538 12539 break; 12540 12541 case 'right': 12542 case 'left': 12543 switch (alignment) { 12544 case 'bottom': 12545 topVal = $anchorDims.offset.top - vOffset + $anchorDims.height - $eleDims.height; 12546 break; 12547 12548 case 'top': 12549 topVal = $anchorDims.offset.top + vOffset; 12550 break; 12551 12552 case 'center': 12553 topVal = $anchorDims.offset.top + vOffset + $anchorDims.height / 2 - $eleDims.height / 2; 12554 break; 12555 } 12556 12557 break; 12558 } 12559 } 12560 12561 return { 12562 top: topVal, 12563 left: leftVal 12564 }; 12565} 12566 12567 12568 12569/***/ }), 12570
vendor: 6,693 bytes, lines 12571-12751
12571/***/ "./js/foundation.util.imageLoader.js": 12572/*!*******************************************!*\ 12573 !*** ./js/foundation.util.imageLoader.js ***! 12574 \*******************************************/ 12575/*! exports provided: onImagesLoaded */ 12576/***/ (function(module, __webpack_exports__, __webpack_require__) { 12577 12578"use strict"; 12579__webpack_require__.r(__webpack_exports__); 12580/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onImagesLoaded", function() { return onImagesLoaded; }); 12581/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 12582/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 12583 12584/** 12585 * Runs a callback function when images are fully loaded. 12586 * @param {Object} images - Image(s) to check if loaded. 12587 * @param {Func} callback - Function to execute when image is fully loaded. 12588 */ 12589 12590function onImagesLoaded(images, callback) { 12591 var unloaded = images.length; 12592 12593 if (unloaded === 0) { 12594 callback(); 12595 } 12596 12597 images.each(function () { 12598 // Check if image is loaded 12599 if (this.complete && typeof this.naturalWidth !== 'undefined') { 12600 singleImageLoaded(); 12601 } else { 12602 // If the above check failed, simulate loading on detached element. 12603 var image = new Image(); // Still count image as loaded if it finalizes with an error. 12604 12605 var events = "load.zf.images error.zf.images"; 12606 jquery__WEBPACK_IMPORTED_MODULE_0___default()(image).one(events, function me() { 12607 // Unbind the event listeners. We're using 'one' but only one of the two events will have fired. 12608 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).off(events, me); 12609 singleImageLoaded(); 12610 }); 12611 image.src = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('src'); 12612 } 12613 }); 12614 12615 function singleImageLoaded() { 12616 unloaded--; 12617 12618 if (unloaded === 0) { 12619 callback(); 12620 } 12621 } 12622} 12623 12624 12625 12626/***/ }), 12627 12628/***/ "./js/foundation.util.keyboard.js": 12629/*!****************************************!*\ 12630 !*** ./js/foundation.util.keyboard.js ***! 12631 \****************************************/ 12632/*! exports provided: Keyboard */ 12633/***/ (function(module, __webpack_exports__, __webpack_require__) { 12634 12635"use strict"; 12636__webpack_require__.r(__webpack_exports__); 12637/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Keyboard", function() { return Keyboard; }); 12638/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 12639/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 12640/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 12641/******************************************* 12642 * * 12643 * This util was created by Marius Olbertz * 12644 * Please thank Marius on GitHub /owlbertz * 12645 * or the web http://www.mariusolbertz.de/ * 12646 * * 12647 ******************************************/ 12648 12649 12650var keyCodes = { 12651 9: 'TAB', 12652 13: 'ENTER', 12653 27: 'ESCAPE', 12654 32: 'SPACE', 12655 35: 'END', 12656 36: 'HOME', 12657 37: 'ARROW_LEFT', 12658 38: 'ARROW_UP', 12659 39: 'ARROW_RIGHT', 12660 40: 'ARROW_DOWN' 12661}; 12662var commands = {}; // Functions pulled out to be referenceable from internals 12663 12664function findFocusable($element) { 12665 if (!$element) { 12666 return false; 12667 } 12668 12669 return $element.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function () { 12670 if (!jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is(':visible') || jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('tabindex') < 0) { 12671 return false; 12672 } //only have visible elements and those that have a tabindex greater or equal 0 12673 12674 12675 return true; 12676 }).sort(function (a, b) { 12677 if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(a).attr('tabindex') === jquery__WEBPACK_IMPORTED_MODULE_0___default()(b).attr('tabindex')) { 12678 return 0; 12679 } 12680 12681 var aTabIndex = parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()(a).attr('tabindex'), 10), 12682 bTabIndex = parseInt(jquery__WEBPACK_IMPORTED_MODULE_0___default()(b).attr('tabindex'), 10); // Undefined is treated the same as 0 12683 12684 if (typeof jquery__WEBPACK_IMPORTED_MODULE_0___default()(a).attr('tabindex') === 'undefined' && bTabIndex > 0) { 12685 return 1; 12686 } 12687 12688 if (typeof jquery__WEBPACK_IMPORTED_MODULE_0___default()(b).attr('tabindex') === 'undefined' && aTabIndex > 0) { 12689 return -1; 12690 } 12691 12692 if (aTabIndex === 0 && bTabIndex > 0) { 12693 return 1; 12694 } 12695 12696 if (bTabIndex === 0 && aTabIndex > 0) { 12697 return -1; 12698 } 12699 12700 if (aTabIndex < bTabIndex) { 12701 return -1; 12702 } 12703 12704 if (aTabIndex > bTabIndex) { 12705 return 1; 12706 } 12707 }); 12708} 12709 12710function parseKey(event) { 12711 var key = keyCodes[event.which || event.keyCode] || String.fromCharCode(event.which).toUpperCase(); // Remove un-printable characters, e.g. for `fromCharCode` calls for CTRL only events 12712 12713 key = key.replace(/\W+/, ''); 12714 if (event.shiftKey) key = "SHIFT_".concat(key); 12715 if (event.ctrlKey) key = "CTRL_".concat(key); 12716 if (event.altKey) key = "ALT_".concat(key); // Remove trailing underscore, in case only modifiers were used (e.g. only `CTRL_ALT`) 12717 12718 key = key.replace(/_$/, ''); 12719 return key; 12720} 12721 12722var Keyboard = { 12723 keys: getKeyCodes(keyCodes), 12724 12725 /** 12726 * Parses the (keyboard) event and returns a String that represents its key 12727 * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE 12728 * @param {Event} event - the event generated by the event handler 12729 * @return String key - String that represents the key pressed 12730 */ 12731 parseKey: parseKey, 12732 12733 /** 12734 * Handles the given (keyboard) event 12735 * @param {Event} event - the event generated by the event handler 12736 * @param {String} component - Foundation component's name, e.g. Slider or Reveal 12737 * @param {Objects} functions - collection of functions that are to be executed 12738 */ 12739 handleKey: function handleKey(event, component, functions) { 12740 var commandList = commands[component], 12741 keyCode = this.parseKey(event), 12742 cmds, 12743 command, 12744 fn; 12745 if (!commandList) return console.warn('Component not defined!'); // Ignore the event if it was already handled 12746 12747 if (event.zfIsKeyHandled === true) return; // This component does not differentiate between ltr and rtl 12748 12749 if (typeof commandList.ltr === 'undefined') { 12750 cmds = commandList; // use plain list 12751 } else {
vendor: 2,798 bytes, lines 12752-12838
12752 // merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa 12753 if (Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["rtl"])()) cmds = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, commandList.ltr, commandList.rtl);else cmds = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, commandList.rtl, commandList.ltr); 12754 } 12755 12756 command = cmds[keyCode]; 12757 fn = functions[command]; // Execute the handler if found 12758 12759 if (fn && typeof fn === 'function') { 12760 var returnValue = fn.apply(); // Mark the event as "handled" to prevent future handlings 12761 12762 event.zfIsKeyHandled = true; // Execute function when event was handled 12763 12764 if (functions.handled || typeof functions.handled === 'function') { 12765 functions.handled(returnValue); 12766 } 12767 } else { 12768 // Execute function when event was not handled 12769 if (functions.unhandled || typeof functions.unhandled === 'function') { 12770 functions.unhandled(); 12771 } 12772 } 12773 }, 12774 12775 /** 12776 * Finds all focusable elements within the given `$element` 12777 * @param {jQuery} $element - jQuery object to search within 12778 * @return {jQuery} $focusable - all focusable elements within `$element` 12779 */ 12780 findFocusable: findFocusable, 12781 12782 /** 12783 * Returns the component name name 12784 * @param {Object} component - Foundation component, e.g. Slider or Reveal 12785 * @return String componentName 12786 */ 12787 register: function register(componentName, cmds) { 12788 commands[componentName] = cmds; 12789 }, 12790 // TODO9438: These references to Keyboard need to not require global. Will 'this' work in this context? 12791 // 12792 12793 /** 12794 * Traps the focus in the given element. 12795 * @param {jQuery} $element jQuery object to trap the foucs into. 12796 */ 12797 trapFocus: function trapFocus($element) { 12798 var $focusable = findFocusable($element), 12799 $firstFocusable = $focusable.eq(0), 12800 $lastFocusable = $focusable.eq(-1); 12801 $element.on('keydown.zf.trapfocus', function (event) { 12802 if (event.target === $lastFocusable[0] && parseKey(event) === 'TAB') { 12803 event.preventDefault(); 12804 $firstFocusable.focus(); 12805 } else if (event.target === $firstFocusable[0] && parseKey(event) === 'SHIFT_TAB') { 12806 event.preventDefault(); 12807 $lastFocusable.focus(); 12808 } 12809 }); 12810 }, 12811 12812 /** 12813 * Releases the trapped focus from the given element. 12814 * @param {jQuery} $element jQuery object to release the focus for. 12815 */ 12816 releaseFocus: function releaseFocus($element) { 12817 $element.off('keydown.zf.trapfocus'); 12818 } 12819}; 12820/* 12821 * Constants for easier comparing. 12822 * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE 12823 */ 12824 12825function getKeyCodes(kcs) { 12826 var k = {}; 12827 12828 for (var kc in kcs) { 12829 if (kcs.hasOwnProperty(kc)) k[kcs[kc]] = kcs[kc]; 12830 } 12831 12832 return k; 12833} 12834 12835 12836 12837/***/ }), 12838
12839/***/ "./js/foundation.util.mediaQuery.js": 12840/*!******************************************!*\ 12841 !*** ./js/foundation.util.mediaQuery.js ***! 12842 \******************************************/ 12843/*! exports provided: MediaQuery */ 12844/***/ (function(module, __webpack_exports__, __webpack_require__) { 12845 12846"use strict"; 12847__webpack_require__.r(__webpack_exports__); 12848/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MediaQuery", function() { return MediaQuery; }); 12849/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 12850/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 12851function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 12852 12853function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } 12854 12855function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 12856 12857function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 12858 12859function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } 12860 12861function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } 12862 12863function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 12864 12865 // Default set of media queries 12866// const defaultQueries = { 12867// 'default' : 'only screen', 12868// landscape : 'only screen and (orientation: landscape)', 12869// portrait : 'only screen and (orientation: portrait)', 12870// retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' + 12871// 'only screen and (min--moz-device-pixel-ratio: 2),' + 12872// 'only screen and (-o-min-device-pixel-ratio: 2/1),' + 12873// 'only screen and (min-device-pixel-ratio: 2),' + 12874// 'only screen and (min-resolution: 192dpi),' + 12875// 'only screen and (min-resolution: 2dppx)' 12876// }; 12877// matchMedia() polyfill - Test a CSS media type/query in JS. 12878// Authors & copyright © 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. MIT license 12879 12880/* eslint-disable */ 12881 12882window.matchMedia || (window.matchMedia = function () { 12883 "use strict"; // For browsers that support matchMedium api such as IE 9 and webkit 12884 12885 var styleMedia = window.styleMedia || window.media; // For those that don't support matchMedium 12886 12887 if (!styleMedia) { 12888 var style = document.createElement('style'), 12889 script = document.getElementsByTagName('script')[0], 12890 info = null; 12891 style.type = 'text/css'; 12892 style.id = 'matchmediajs-test'; 12893 12894 if (!script) { 12895 document.head.appendChild(style); 12896 } else { 12897 script.parentNode.insertBefore(style, script); 12898 } // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers 12899 12900 12901 info = 'getComputedStyle' in window && window.getComputedStyle(style, null) || style.currentStyle; 12902 styleMedia = { 12903 matchMedium: function matchMedium(media) { 12904 var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }'; // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers 12905 12906 if (style.styleSheet) { 12907 style.styleSheet.cssText = text; 12908 } else { 12909 style.textContent = text; 12910 } // Test if media query is true or false 12911 12912 12913 return info.width === '1px'; 12914 } 12915 }; 12916 } 12917 12918 return function (media) { 12919 return { 12920 matches: styleMedia.matchMedium(media || 'all'), 12921 media: media || 'all' 12922 }; 12923 }; 12924}()); 12925/* eslint-enable */ 12926 12927var MediaQuery = { 12928 queries: [], 12929 current: '', 12930 12931 /** 12932 * Initializes the media query helper, by extracting the breakpoint list from the CSS and activating the breakpoint watcher. 12933 * @function 12934 * @private 12935 */ 12936 _init: function _init() { 12937 // make sure the initialization is only done once when calling _init() several times 12938 if (this.isInitialized === true) { 12939 return this; 12940 } else { 12941 this.isInitialized = true; 12942 } 12943 12944 var self = this; 12945 var $meta = jquery__WEBPACK_IMPORTED_MODULE_0___default()('meta.foundation-mq'); 12946 12947 if (!$meta.length) { 12948 jquery__WEBPACK_IMPORTED_MODULE_0___default()('<meta class="foundation-mq" name="foundation-mq" content>').appendTo(document.head); 12949 } 12950 12951 var extractedStyles = jquery__WEBPACK_IMPORTED_MODULE_0___default()('.foundation-mq').css('font-family'); 12952 var namedQueries; 12953 namedQueries = parseStyleToObject(extractedStyles); 12954 self.queries = []; // reset 12955
vendor: 4,471 bytes, lines 12956-13104
12956 for (var key in namedQueries) { 12957 if (namedQueries.hasOwnProperty(key)) { 12958 self.queries.push({ 12959 name: key, 12960 value: "only screen and (min-width: ".concat(namedQueries[key], ")") 12961 }); 12962 } 12963 } 12964 12965 this.current = this._getCurrentSize(); 12966 12967 this._watcher(); 12968 }, 12969 12970 /** 12971 * Reinitializes the media query helper. 12972 * Useful if your CSS breakpoint configuration has just been loaded or has changed since the initialization. 12973 * @function 12974 * @private 12975 */ 12976 _reInit: function _reInit() { 12977 this.isInitialized = false; 12978 12979 this._init(); 12980 }, 12981 12982 /** 12983 * Checks if the screen is at least as wide as a breakpoint. 12984 * @function 12985 * @param {String} size - Name of the breakpoint to check. 12986 * @returns {Boolean} `true` if the breakpoint matches, `false` if it's smaller. 12987 */ 12988 atLeast: function atLeast(size) { 12989 var query = this.get(size); 12990 12991 if (query) { 12992 return window.matchMedia(query).matches; 12993 } 12994 12995 return false; 12996 }, 12997 12998 /** 12999 * Checks if the screen is within the given breakpoint. 13000 * If smaller than the breakpoint of larger than its upper limit it returns false. 13001 * @function 13002 * @param {String} size - Name of the breakpoint to check. 13003 * @returns {Boolean} `true` if the breakpoint matches, `false` otherwise. 13004 */ 13005 only: function only(size) { 13006 return size === this._getCurrentSize(); 13007 }, 13008 13009 /** 13010 * Checks if the screen is within a breakpoint or smaller. 13011 * @function 13012 * @param {String} size - Name of the breakpoint to check. 13013 * @returns {Boolean} `true` if the breakpoint matches, `false` if it's larger. 13014 */ 13015 upTo: function upTo(size) { 13016 var nextSize = this.next(size); // If the next breakpoint does not match, the screen is smaller than 13017 // the upper limit of this breakpoint. 13018 13019 if (nextSize) { 13020 return !this.atLeast(nextSize); 13021 } // If there is no next breakpoint, the "size" breakpoint does not have 13022 // an upper limit and the screen will always be within it or smaller. 13023 13024 13025 return true; 13026 }, 13027 13028 /** 13029 * Checks if the screen matches to a breakpoint. 13030 * @function 13031 * @param {String} size - Name of the breakpoint to check, either 'small only' or 'small'. Omitting 'only' falls back to using atLeast() method. 13032 * @returns {Boolean} `true` if the breakpoint matches, `false` if it does not. 13033 */ 13034 is: function is(size) { 13035 var parts = size.trim().split(' ').filter(function (p) { 13036 return !!p.length; 13037 }); 13038 13039 var _parts = _slicedToArray(parts, 2), 13040 bpSize = _parts[0], 13041 _parts$ = _parts[1], 13042 bpModifier = _parts$ === void 0 ? '' : _parts$; // Only the breakpont 13043 13044 13045 if (bpModifier === 'only') { 13046 return this.only(bpSize); 13047 } // At least the breakpoint (included) 13048 13049 13050 if (!bpModifier || bpModifier === 'up') { 13051 return this.atLeast(bpSize); 13052 } // Up to the breakpoint (included) 13053 13054 13055 if (bpModifier === 'down') { 13056 return this.upTo(bpSize); 13057 } 13058 13059 throw new Error("\n Invalid breakpoint passed to MediaQuery.is().\n Expected a breakpoint name formatted like \"<size> <modifier>\", got \"".concat(size, "\".\n ")); 13060 }, 13061 13062 /** 13063 * Gets the media query of a breakpoint. 13064 * @function 13065 * @param {String} size - Name of the breakpoint to get. 13066 * @returns {String|null} - The media query of the breakpoint, or `null` if the breakpoint doesn't exist. 13067 */ 13068 get: function get(size) { 13069 for (var i in this.queries) { 13070 if (this.queries.hasOwnProperty(i)) { 13071 var query = this.queries[i]; 13072 if (size === query.name) return query.value; 13073 } 13074 } 13075 13076 return null; 13077 }, 13078 13079 /** 13080 * Get the breakpoint following the given breakpoint. 13081 * @function 13082 * @param {String} size - Name of the breakpoint. 13083 * @returns {String|null} - The name of the following breakpoint, or `null` if the passed breakpoint was the last one. 13084 */ 13085 next: function next(size) { 13086 var _this = this; 13087 13088 var queryIndex = this.queries.findIndex(function (q) { 13089 return _this._getQueryName(q) === size; 13090 }); 13091 13092 if (queryIndex === -1) { 13093 throw new Error("\n Unknown breakpoint \"".concat(size, "\" passed to MediaQuery.next().\n Ensure it is present in your Sass \"$breakpoints\" setting.\n ")); 13094 } 13095 13096 var nextQuery = this.queries[queryIndex + 1]; 13097 return nextQuery ? nextQuery.name : null; 13098 }, 13099 13100 /** 13101 * Returns the name of the breakpoint related to the given value. 13102 * @function 13103 * @private 13104 * @param {String|Object}
vendor: 10,990 bytes, lines 13104-13444
13104 value - Breakpoint name or query object. 13105 * @returns {String} Name of the breakpoint. 13106 */ 13107 _getQueryName: function _getQueryName(value) { 13108 if (typeof value === 'string') return value; 13109 if (_typeof(value) === 'object') return value.name; 13110 throw new TypeError("\n Invalid value passed to MediaQuery._getQueryName().\n Expected a breakpoint name (String) or a breakpoint query (Object), got \"".concat(value, "\" (").concat(_typeof(value), ")\n ")); 13111 }, 13112 13113 /** 13114 * Gets the current breakpoint name by testing every breakpoint and returning the last one to match (the biggest one). 13115 * @function 13116 * @private 13117 * @returns {String} Name of the current breakpoint. 13118 */ 13119 _getCurrentSize: function _getCurrentSize() { 13120 var matched; 13121 13122 for (var i = 0; i < this.queries.length; i++) { 13123 var query = this.queries[i]; 13124 13125 if (window.matchMedia(query.value).matches) { 13126 matched = query; 13127 } 13128 } 13129 13130 return matched && this._getQueryName(matched); 13131 }, 13132 13133 /** 13134 * Activates the breakpoint watcher, which fires an event on the window whenever the breakpoint changes. 13135 * @function 13136 * @private 13137 */ 13138 _watcher: function _watcher() { 13139 var _this2 = this; 13140 13141 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('resize.zf.trigger', function () { 13142 var newSize = _this2._getCurrentSize(), 13143 currentSize = _this2.current; 13144 13145 if (newSize !== currentSize) { 13146 // Change the current media query 13147 _this2.current = newSize; // Broadcast the media query change on the window 13148 13149 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).trigger('changed.zf.mediaquery', [newSize, currentSize]); 13150 } 13151 }); 13152 } 13153}; // Thank you: https://github.com/sindresorhus/query-string 13154 13155function parseStyleToObject(str) { 13156 var styleObject = {}; 13157 13158 if (typeof str !== 'string') { 13159 return styleObject; 13160 } 13161 13162 str = str.trim().slice(1, -1); // browsers re-quote string style values 13163 13164 if (!str) { 13165 return styleObject; 13166 } 13167 13168 styleObject = str.split('&').reduce(function (ret, param) { 13169 var parts = param.replace(/\+/g, ' ').split('='); 13170 var key = parts[0]; 13171 var val = parts[1]; 13172 key = decodeURIComponent(key); // missing `=` should be `null`: 13173 // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters 13174 13175 val = typeof val === 'undefined' ? null : decodeURIComponent(val); 13176 13177 if (!ret.hasOwnProperty(key)) { 13178 ret[key] = val; 13179 } else if (Array.isArray(ret[key])) { 13180 ret[key].push(val); 13181 } else { 13182 ret[key] = [ret[key], val]; 13183 } 13184 13185 return ret; 13186 }, {}); 13187 return styleObject; 13188} 13189 13190 13191 13192/***/ }), 13193 13194/***/ "./js/foundation.util.motion.js": 13195/*!**************************************!*\ 13196 !*** ./js/foundation.util.motion.js ***! 13197 \**************************************/ 13198/*! exports provided: Move, Motion */ 13199/***/ (function(module, __webpack_exports__, __webpack_require__) { 13200 13201"use strict"; 13202__webpack_require__.r(__webpack_exports__); 13203/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Move", function() { return Move; }); 13204/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Motion", function() { return Motion; }); 13205/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 13206/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 13207/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 13208 13209 13210/** 13211 * Motion module. 13212 * @module foundation.motion 13213 */ 13214 13215var initClasses = ['mui-enter', 'mui-leave']; 13216var activeClasses = ['mui-enter-active', 'mui-leave-active']; 13217var Motion = { 13218 animateIn: function animateIn(element, animation, cb) { 13219 animate(true, element, animation, cb); 13220 }, 13221 animateOut: function animateOut(element, animation, cb) { 13222 animate(false, element, animation, cb); 13223 } 13224}; 13225 13226function Move(duration, elem, fn) { 13227 var anim, 13228 prog, 13229 start = null; 13230 13231 if (duration === 0) { 13232 fn.apply(elem); 13233 elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]); 13234 return; 13235 } 13236 13237 function move(ts) { 13238 if (!start) start = ts; 13239 prog = ts - start; 13240 fn.apply(elem); 13241 13242 if (prog < duration) { 13243 anim = window.requestAnimationFrame(move, elem); 13244 } else { 13245 window.cancelAnimationFrame(anim); 13246 elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]); 13247 } 13248 } 13249 13250 anim = window.requestAnimationFrame(move); 13251} 13252/** 13253 * Animates an element in or out using a CSS transition class. 13254 * @function 13255 * @private 13256 * @param {Boolean} isIn - Defines if the animation is in or out. 13257 * @param {Object} element - jQuery or HTML object to animate. 13258 * @param {String} animation - CSS class to use. 13259 * @param {Function} cb - Callback to run when animation is finished. 13260 */ 13261 13262 13263function animate(isIn, element, animation, cb) { 13264 element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(element).eq(0); 13265 if (!element.length) return; 13266 var initClass = isIn ? initClasses[0] : initClasses[1]; 13267 var activeClass = isIn ? activeClasses[0] : activeClasses[1]; // Set up the animation 13268 13269 reset(); 13270 element.addClass(animation).css('transition', 'none'); 13271 requestAnimationFrame(function () { 13272 element.addClass(initClass); 13273 if (isIn) element.show(); 13274 }); // Start the animation 13275 13276 requestAnimationFrame(function () { 13277 // will trigger the browser to synchronously calculate the style and layout 13278 // also called reflow or layout thrashing 13279 // see https://gist.github.com/paulirish/5d52fb081b3570c81e3a 13280 element[0].offsetWidth; 13281 element.css('transition', '').addClass(activeClass); 13282 }); // Clean up the animation when it finishes 13283 13284 element.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["transitionend"])(element), finish); // Hides the element (for out animations), resets the element, and runs a callback 13285 13286 function finish() { 13287 if (!isIn) element.hide(); 13288 reset(); 13289 if (cb) cb.apply(element); 13290 } // Resets transitions and removes motion-specific classes 13291 13292 13293 function reset() { 13294 element[0].style.transitionDuration = 0; 13295 element.removeClass("".concat(initClass, " ").concat(activeClass, " ").concat(animation)); 13296 } 13297} 13298 13299 13300 13301/***/ }), 13302 13303/***/ "./js/foundation.util.nest.js": 13304/*!************************************!*\ 13305 !*** ./js/foundation.util.nest.js ***! 13306 \************************************/ 13307/*! exports provided: Nest */ 13308/***/ (function(module, __webpack_exports__, __webpack_require__) { 13309 13310"use strict"; 13311__webpack_require__.r(__webpack_exports__); 13312/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Nest", function() { return Nest; }); 13313/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 13314/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 13315 13316var Nest = { 13317 Feather: function Feather(menu) { 13318 var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zf'; 13319 menu.attr('role', 'menubar'); 13320 menu.find('a').attr({ 13321 'role': 'menuitem' 13322 }); 13323 var items = menu.find('li').attr({ 13324 'role': 'none' 13325 }), 13326 subMenuClass = "is-".concat(type, "-submenu"), 13327 subItemClass = "".concat(subMenuClass, "-item"), 13328 hasSubClass = "is-".concat(type, "-submenu-parent"), 13329 applyAria = type !== 'accordion'; // Accordions handle their own ARIA attriutes. 13330 13331 items.each(function () { 13332 var $item = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 13333 $sub = $item.children('ul'); 13334 13335 if ($sub.length) { 13336 $item.addClass(hasSubClass); 13337 13338 if (applyAria) { 13339 $item.children('a:first').attr({ 13340 'aria-haspopup': true, 13341 'aria-label': $item.children('a:first').text() 13342 }); // Note: Drilldowns behave differently in how they hide, and so need 13343 // additional attributes. We should look if this possibly over-generalized 13344 // utility (Nest) is appropriate when we rework menus in 6.4 13345 13346 if (type === 'drilldown') { 13347 $item.attr({ 13348 'aria-expanded': false 13349 }); 13350 } 13351 } 13352 13353 $sub.addClass("submenu ".concat(subMenuClass)).attr({ 13354 'data-submenu': '', 13355 'role': 'menubar' 13356 }); 13357 13358 if (type === 'drilldown') { 13359 $sub.attr({ 13360 'aria-hidden': true 13361 }); 13362 } 13363 } 13364 13365 if ($item.parent('[data-submenu]').length) { 13366 $item.addClass("is-submenu-item ".concat(subItemClass)); 13367 } 13368 }); 13369 return; 13370 }, 13371 Burn: function Burn(menu, type) { 13372 var //items = menu.find('li'), 13373 subMenuClass = "is-".concat(type, "-submenu"), 13374 subItemClass = "".concat(subMenuClass, "-item"), 13375 hasSubClass = "is-".concat(type, "-submenu-parent"); 13376 menu.find('>li, > li > ul, .menu, .menu > li, [data-submenu] > li').removeClass("".concat(subMenuClass, " ").concat(subItemClass, " ").concat(hasSubClass, " is-submenu-item submenu is-active")).removeAttr('data-submenu').css('display', ''); 13377 } 13378}; 13379 13380 13381/***/ }), 13382 13383/***/ "./js/foundation.util.timer.js": 13384/*!*************************************!*\ 13385 !*** ./js/foundation.util.timer.js ***! 13386 \*************************************/ 13387/*! exports provided: Timer */ 13388/***/ (function(module, __webpack_exports__, __webpack_require__) { 13389 13390"use strict"; 13391__webpack_require__.r(__webpack_exports__); 13392/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return Timer; }); 13393function Timer(elem, options, cb) { 13394 var _this = this, 13395 duration = options.duration, 13396 //options is an object for easily adding features later. 13397 nameSpace = Object.keys(elem.data())[0] || 'timer', 13398 remain = -1, 13399 start, 13400 timer; 13401 13402 this.isPaused = false; 13403 13404 this.restart = function () { 13405 remain = -1; 13406 clearTimeout(timer); 13407 this.start(); 13408 }; 13409 13410 this.start = function () { 13411 this.isPaused = false; // if(!elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things. 13412 13413 clearTimeout(timer); 13414 remain = remain <= 0 ? duration : remain; 13415 elem.data('paused', false); 13416 start = Date.now(); 13417 timer = setTimeout(function () { 13418 if (options.infinite) { 13419 _this.restart(); //rerun the timer. 13420 13421 } 13422 13423 if (cb && typeof cb === 'function') { 13424 cb(); 13425 } 13426 }, remain); 13427 elem.trigger("timerstart.zf.".concat(nameSpace)); 13428 }; 13429 13430 this.pause = function () { 13431 this.isPaused = true; //if(elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things. 13432 13433 clearTimeout(timer); 13434 elem.data('paused', true); 13435 var end = Date.now(); 13436 remain = remain - (end - start); 13437 elem.trigger("timerpaused.zf.".concat(nameSpace)); 13438 }; 13439} 13440 13441 13442 13443/***/ }), 13444
vendor: 4,130 bytes, lines 13445-13548
13445/***/ "./js/foundation.util.touch.js": 13446/*!*************************************!*\ 13447 !*** ./js/foundation.util.touch.js ***! 13448 \*************************************/ 13449/*! exports provided: Touch */ 13450/***/ (function(module, __webpack_exports__, __webpack_require__) { 13451 13452"use strict"; 13453__webpack_require__.r(__webpack_exports__); 13454/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Touch", function() { return Touch; }); 13455/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 13456/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 13457function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 13458 13459function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 13460 13461function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 13462 13463//************************************************** 13464//**Work inspired by multiple jquery swipe plugins** 13465//**Done by Yohai Ararat *************************** 13466//************************************************** 13467 13468var Touch = {}; 13469var startPosX, 13470 startTime, 13471 elapsedTime, 13472 startEvent, 13473 isMoving = false, 13474 didMoved = false; 13475 13476function onTouchEnd(e) { 13477 this.removeEventListener('touchmove', onTouchMove); 13478 this.removeEventListener('touchend', onTouchEnd); // If the touch did not move, consider it as a "tap" 13479 13480 if (!didMoved) { 13481 var tapEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event('tap', startEvent || e); 13482 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger(tapEvent); 13483 } 13484 13485 startEvent = null; 13486 isMoving = false; 13487 didMoved = false; 13488} 13489 13490function onTouchMove(e) { 13491 if (true === jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.preventDefault) { 13492 e.preventDefault(); 13493 } 13494 13495 if (isMoving) { 13496 var x = e.touches[0].pageX; // var y = e.touches[0].pageY; 13497 13498 var dx = startPosX - x; // var dy = startPosY - y; 13499 13500 var dir; 13501 didMoved = true; 13502 elapsedTime = new Date().getTime() - startTime; 13503 13504 if (Math.abs(dx) >= jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.moveThreshold && elapsedTime <= jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.timeThreshold) { 13505 dir = dx > 0 ? 'left' : 'right'; 13506 } // else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) { 13507 // dir = dy > 0 ? 'down' : 'up'; 13508 // } 13509 13510 13511 if (dir) { 13512 e.preventDefault(); 13513 onTouchEnd.apply(this, arguments); 13514 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger(jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event('swipe', Object.assign({}, e)), dir).trigger(jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event("swipe".concat(dir), Object.assign({}, e))); 13515 } 13516 } 13517} 13518 13519function onTouchStart(e) { 13520 if (e.touches.length === 1) { 13521 startPosX = e.touches[0].pageX; 13522 startEvent = e; 13523 isMoving = true; 13524 didMoved = false; 13525 startTime = new Date().getTime(); 13526 this.addEventListener('touchmove', onTouchMove, { 13527 passive: true === jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.preventDefault 13528 }); 13529 this.addEventListener('touchend', onTouchEnd, false); 13530 } 13531} 13532 13533function init() { 13534 this.addEventListener && this.addEventListener('touchstart', onTouchStart, { 13535 passive: true 13536 }); 13537} // function teardown() { 13538// this.removeEventListener('touchstart', onTouchStart); 13539// } 13540 13541 13542var SpotSwipe = /*#__PURE__*/function () { 13543 function SpotSwipe() { 13544 _classCallCheck(this, SpotSwipe); 13545 13546 this.version = '1.0.0'; 13547 this.enabled = 'ontouchstart' in document.documentElement; 13548 this.preventDefault = false;
13549 this.moveThreshold = 75; 13550 this.timeThreshold = 200; 13551 13552 this._init(); 13553 } 13554 13555 _createClass(SpotSwipe, [{ 13556 key: "_init", 13557 value: function _init() { 13558 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.event.special.swipe = { 13559 setup: init 13560 }; 13561 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.event.special.tap = { 13562 setup: init 13563 }; 13564 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(['left', 'up', 'down', 'right'], function () { 13565 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.event.special["swipe".concat(this)] = { 13566 setup: function setup() { 13567 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).on('swipe', jquery__WEBPACK_IMPORTED_MODULE_0___default.a.noop); 13568 } 13569 }; 13570 }); 13571 } 13572 }]); 13573 13574 return SpotSwipe; 13575}(); 13576/**************************************************** 13577 * As far as I can tell, both setupSpotSwipe and * 13578 * setupTouchHandler should be idempotent, * 13579 * because they directly replace functions & * 13580 * values, and do not add event handlers directly. * 13581 ****************************************************/ 13582 13583 13584Touch.setupSpotSwipe = function () { 13585 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe = new SpotSwipe(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 13586}; 13587/**************************************************** 13588 * Method for adding pseudo drag events to elements * 13589 ***************************************************/ 13590 13591 13592Touch.setupTouchHandler = function () { 13593 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.fn.addTouch = function () { 13594 this.each(function (i, el) { 13595 jquery__WEBPACK_IMPORTED_MODULE_0___default()(el).bind('touchstart touchmove touchend touchcancel', function (event) { 13596 //we pass the original event object because the jQuery event 13597 //object is normalized to w3c specs and does not provide the TouchList 13598 handleTouch(event); 13599 }); 13600 }); 13601 13602 var handleTouch = function handleTouch(event) { 13603 var touches = event.changedTouches, 13604 first = touches[0], 13605 eventTypes = { 13606 touchstart: 'mousedown', 13607 touchmove: 'mousemove', 13608 touchend: 'mouseup' 13609 }, 13610 type = eventTypes[event.type], 13611 simulatedEvent; 13612 13613 if ('MouseEvent' in window && typeof window.MouseEvent === 'function') { 13614 simulatedEvent = new window.MouseEvent(type, { 13615 'bubbles': true, 13616 'cancelable': true, 13617 'screenX': first.screenX, 13618 'screenY': first.screenY, 13619 'clientX': first.clientX, 13620 'clientY': first.clientY 13621 }); 13622 } else { 13623 simulatedEvent = document.createEvent('MouseEvent'); 13624 simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0 13625 /*left*/ 13626 , null); 13627 } 13628 13629 first.target.dispatchEvent(simulatedEvent); 13630 }; 13631 }; 13632}; 13633 13634Touch.init = function () { 13635 if (typeof jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe === 'undefined') { 13636 Touch.setupSpotSwipe(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 13637 Touch.setupTouchHandler(jquery__WEBPACK_IMPORTED_MODULE_0___default.a); 13638 } 13639}; 13640 13641 13642 13643/***/ }), 13644
vendor: 11,970 bytes, lines 13645-13936
13645/***/ "./js/foundation.util.triggers.js": 13646/*!****************************************!*\ 13647 !*** ./js/foundation.util.triggers.js ***! 13648 \****************************************/ 13649/*! exports provided: Triggers */ 13650/***/ (function(module, __webpack_exports__, __webpack_require__) { 13651 13652"use strict"; 13653__webpack_require__.r(__webpack_exports__); 13654/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Triggers", function() { return Triggers; }); 13655/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery"); 13656/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 13657/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js"); 13658/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js"); 13659function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 13660 13661 13662 13663 13664 13665var MutationObserver = function () { 13666 var prefixes = ['WebKit', 'Moz', 'O', 'Ms', '']; 13667 13668 for (var i = 0; i < prefixes.length; i++) { 13669 if ("".concat(prefixes[i], "MutationObserver") in window) { 13670 return window["".concat(prefixes[i], "MutationObserver")]; 13671 } 13672 } 13673 13674 return false; 13675}(); 13676 13677var triggers = function triggers(el, type) { 13678 el.data(type).split(' ').forEach(function (id) { 13679 jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(id))[type === 'close' ? 'trigger' : 'triggerHandler']("".concat(type, ".zf.trigger"), [el]); 13680 }); 13681}; 13682 13683var Triggers = { 13684 Listeners: { 13685 Basic: {}, 13686 Global: {} 13687 }, 13688 Initializers: {} 13689}; 13690Triggers.Listeners.Basic = { 13691 openListener: function openListener() { 13692 triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'open'); 13693 }, 13694 closeListener: function closeListener() { 13695 var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('close'); 13696 13697 if (id) { 13698 triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'close'); 13699 } else { 13700 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('close.zf.trigger'); 13701 } 13702 }, 13703 toggleListener: function toggleListener() { 13704 var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle'); 13705 13706 if (id) { 13707 triggers(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), 'toggle'); 13708 } else { 13709 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('toggle.zf.trigger'); 13710 } 13711 }, 13712 closeableListener: function closeableListener(e) { 13713 var animation = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('closable'); // Only close the first closable element. See https://git.io/zf-7833 13714 13715 e.stopPropagation(); 13716 13717 if (animation !== '') { 13718 _foundation_util_motion__WEBPACK_IMPORTED_MODULE_2__["Motion"].animateOut(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), animation, function () { 13719 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger('closed.zf'); 13720 }); 13721 } else { 13722 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).fadeOut().trigger('closed.zf'); 13723 } 13724 }, 13725 toggleFocusListener: function toggleFocusListener() { 13726 var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('toggle-focus'); 13727 jquery__WEBPACK_IMPORTED_MODULE_0___default()("#".concat(id)).triggerHandler('toggle.zf.trigger', [jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)]); 13728 } 13729}; // Elements with [data-open] will reveal a plugin that supports it when clicked. 13730 13731Triggers.Initializers.addOpenListener = function ($elem) { 13732 $elem.off('click.zf.trigger', Triggers.Listeners.Basic.openListener); 13733 $elem.on('click.zf.trigger', '[data-open]', Triggers.Listeners.Basic.openListener); 13734}; // Elements with [data-close] will close a plugin that supports it when clicked. 13735// If used without a value on [data-close], the event will bubble, allowing it to close a parent component. 13736 13737 13738Triggers.Initializers.addCloseListener = function ($elem) { 13739 $elem.off('click.zf.trigger', Triggers.Listeners.Basic.closeListener); 13740 $elem.on('click.zf.trigger', '[data-close]', Triggers.Listeners.Basic.closeListener); 13741}; // Elements with [data-toggle] will toggle a plugin that supports it when clicked. 13742 13743 13744Triggers.Initializers.addToggleListener = function ($elem) { 13745 $elem.off('click.zf.trigger', Triggers.Listeners.Basic.toggleListener); 13746 $elem.on('click.zf.trigger', '[data-toggle]', Triggers.Listeners.Basic.toggleListener); 13747}; // Elements with [data-closable] will respond to close.zf.trigger events. 13748 13749 13750Triggers.Initializers.addCloseableListener = function ($elem) { 13751 $elem.off('close.zf.trigger', Triggers.Listeners.Basic.closeableListener); 13752 $elem.on('close.zf.trigger', '[data-closeable], [data-closable]', Triggers.Listeners.Basic.closeableListener); 13753}; // Elements with [data-toggle-focus] will respond to coming in and out of focus 13754 13755 13756Triggers.Initializers.addToggleFocusListener = function ($elem) { 13757 $elem.off('focus.zf.trigger blur.zf.trigger', Triggers.Listeners.Basic.toggleFocusListener); 13758 $elem.on('focus.zf.trigger blur.zf.trigger', '[data-toggle-focus]', Triggers.Listeners.Basic.toggleFocusListener); 13759}; // More Global/complex listeners and triggers 13760 13761 13762Triggers.Listeners.Global = { 13763 resizeListener: function resizeListener($nodes) { 13764 if (!MutationObserver) { 13765 //fallback for IE 9 13766 $nodes.each(function () { 13767 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).triggerHandler('resizeme.zf.trigger'); 13768 }); 13769 } //trigger all listening elements and signal a resize event 13770 13771 13772 $nodes.attr('data-events', "resize"); 13773 }, 13774 scrollListener: function scrollListener($nodes) { 13775 if (!MutationObserver) { 13776 //fallback for IE 9 13777 $nodes.each(function () { 13778 jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).triggerHandler('scrollme.zf.trigger'); 13779 }); 13780 } //trigger all listening elements and signal a scroll event 13781 13782 13783 $nodes.attr('data-events', "scroll"); 13784 }, 13785 closeMeListener: function closeMeListener(e, pluginId) { 13786 var plugin = e.namespace.split('.')[0]; 13787 var plugins = jquery__WEBPACK_IMPORTED_MODULE_0___default()("[data-".concat(plugin, "]")).not("[data-yeti-box=\"".concat(pluginId, "\"]")); 13788 plugins.each(function () { 13789 var _this = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this); 13790 13791 _this.triggerHandler('close.zf.trigger', [_this]); 13792 }); 13793 } 13794}; // Global, parses whole document. 13795 13796Triggers.Initializers.addClosemeListener = function (pluginName) { 13797 var yetiBoxes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-yeti-box]'), 13798 plugNames = ['dropdown', 'tooltip', 'reveal']; 13799 13800 if (pluginName) { 13801 if (typeof pluginName === 'string') { 13802 plugNames.push(pluginName); 13803 } else if (_typeof(pluginName) === 'object' && typeof pluginName[0] === 'string') { 13804 plugNames = plugNames.concat(pluginName); 13805 } else { 13806 console.error('Plugin names must be strings'); 13807 } 13808 } 13809 13810 if (yetiBoxes.length) { 13811 var listeners = plugNames.map(function (name) { 13812 return "closeme.zf.".concat(name); 13813 }).join(' '); 13814 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener); 13815 } 13816}; 13817 13818function debounceGlobalListener(debounce, trigger, listener) { 13819 var timer, 13820 args = Array.prototype.slice.call(arguments, 3); 13821 jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on(trigger, function () { 13822 if (timer) { 13823 clearTimeout(timer); 13824 } 13825 13826 timer = setTimeout(function () { 13827 listener.apply(null, args); 13828 }, debounce || 10); //default time to emit scroll event 13829 }); 13830} 13831 13832Triggers.Initializers.addResizeListener = function (debounce) { 13833 var $nodes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-resize]'); 13834 13835 if ($nodes.length) { 13836 debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes); 13837 } 13838}; 13839 13840Triggers.Initializers.addScrollListener = function (debounce) { 13841 var $nodes = jquery__WEBPACK_IMPORTED_MODULE_0___default()('[data-scroll]'); 13842 13843 if ($nodes.length) { 13844 debounceGlobalListener(debounce, 'scroll.zf.trigger', Triggers.Listeners.Global.scrollListener, $nodes); 13845 } 13846}; 13847 13848Triggers.Initializers.addMutationEventsListener = function ($elem) { 13849 if (!MutationObserver) { 13850 return false; 13851 } 13852 13853 var $nodes = $elem.find('[data-resize], [data-scroll], [data-mutate]'); //element callback 13854 13855 var listeningElementsMutation = function listeningElementsMutation(mutationRecordsList) { 13856 var $target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(mutationRecordsList[0].target); //trigger the event handler for the element depending on type 13857 13858 switch (mutationRecordsList[0].type) { 13859 case "attributes": 13860 if ($target.attr("data-events") === "scroll" && mutationRecordsList[0].attributeName === "data-events") { 13861 $target.triggerHandler('scrollme.zf.trigger', [$target, window.pageYOffset]); 13862 } 13863 13864 if ($target.attr("data-events") === "resize" && mutationRecordsList[0].attributeName === "data-events") { 13865 $target.triggerHandler('resizeme.zf.trigger', [$target]); 13866 } 13867 13868 if (mutationRecordsList[0].attributeName === "style") { 13869 $target.closest("[data-mutate]").attr("data-events", "mutate"); 13870 $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]); 13871 } 13872 13873 break; 13874 13875 case "childList": 13876 $target.closest("[data-mutate]").attr("data-events", "mutate"); 13877 $target.closest("[data-mutate]").triggerHandler('mutateme.zf.trigger', [$target.closest("[data-mutate]")]); 13878 break; 13879 13880 default: 13881 return false; 13882 //nothing 13883 } 13884 }; 13885 13886 if ($nodes.length) { 13887 //for each element that needs to listen for resizing, scrolling, or mutation add a single observer 13888 for (var i = 0; i <= $nodes.length - 1; i++) { 13889 var elementObserver = new MutationObserver(listeningElementsMutation); 13890 elementObserver.observe($nodes[i], { 13891 attributes: true, 13892 childList: true, 13893 characterData: false, 13894 subtree: true, 13895 attributeFilter: ["data-events", "style"] 13896 }); 13897 } 13898 } 13899}; 13900 13901Triggers.Initializers.addSimpleListeners = function () { 13902 var $document = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document); 13903 Triggers.Initializers.addOpenListener($document); 13904 Triggers.Initializers.addCloseListener($document); 13905 Triggers.Initializers.addToggleListener($document); 13906 Triggers.Initializers.addCloseableListener($document); 13907 Triggers.Initializers.addToggleFocusListener($document); 13908}; 13909 13910Triggers.Initializers.addGlobalListeners = function () { 13911 var $document = jquery__WEBPACK_IMPORTED_MODULE_0___default()(document); 13912 Triggers.Initializers.addMutationEventsListener($document); 13913 Triggers.Initializers.addResizeListener(250); 13914 Triggers.Initializers.addScrollListener(); 13915 Triggers.Initializers.addClosemeListener(); 13916}; 13917 13918Triggers.init = function (__, Foundation) { 13919 Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_1__["onLoad"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(window), function () { 13920 if (jquery__WEBPACK_IMPORTED_MODULE_0___default.a.triggersInitialized !== true) { 13921 Triggers.Initializers.addSimpleListeners(); 13922 Triggers.Initializers.addGlobalListeners(); 13923 jquery__WEBPACK_IMPORTED_MODULE_0___default.a.triggersInitialized = true; 13924 } 13925 }); 13926 13927 if (Foundation) { 13928 Foundation.Triggers = Triggers; // Legacy included to be backwards compatible for now. 13929 13930 Foundation.IHearYou = Triggers.Initializers.addGlobalListeners; 13931 } 13932}; 13933 13934 13935 13936/***/ })
13936, 13937 13938/***/ 0: 13939/*!****************************************!*\ 13940 !*** multi ./js/entries/foundation.js ***! 13941 \****************************************/ 13942/*! no static exports found */ 13943/***/ (function(module, exports, __webpack_require__) { 13944 13945module.exports = __webpack_require__(/*! /Users/joeworkman/Development/foundation-sites/js/entries/foundation.js */"./js/entries/foundation.js"); 13946 13947 13948/***/ }), 13949 13950/***/ "jquery": 13951/*!********************************************************************************************!*\ 13952 !*** external {"root":["jQuery"],"amd":"jquery","commonjs":"jquery","commonjs2":"jquery"} ***! 13953 \********************************************************************************************/ 13954/*! no static exports found */ 13955/***/ (function(module, exports) { 13956 13957module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__; 13958 13959/***/ }) 13960 13961/******/ }); 13962}); 13963//# sourceMappingURL=foundation.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.